net.sourceforge.mflow.api
Interface ContactMethodManager

All Known Implementing Classes:
ContactMethodManagerImpl

public interface ContactMethodManager

A class for managing instances of ContactMethod

Version:
$Revision: 1.4 $
Author:
David Carr

Method Summary
 void addContactMethodType(java.lang.Class cmt, java.lang.String protocol)
          Adds a new type of contact method
 ContactMethod getInstance(java.lang.String protocol, java.lang.String identifier)
          Gets an instance of a matching ContactMethod.
 java.lang.String[] getProtocols()
          Returns an array of all known protocols
 ContactMethod parse(java.lang.String s)
          Returns a ContactMethod from a string in the format protocol:identifier
 

Method Detail

addContactMethodType

void addContactMethodType(java.lang.Class cmt,
                          java.lang.String protocol)
                          throws java.util.TooManyListenersException
Adds a new type of contact method

Parameters:
cmt - the Class object for the ContactMethod implementation
protocol - the protocol that this ContactMethod implementation handles
Throws:
java.util.TooManyListenersException - when a handler for this protocol has already been defined

parse

ContactMethod parse(java.lang.String s)
                    throws java.text.ParseException
Returns a ContactMethod from a string in the format protocol:identifier

Parameters:
s - the string to parse
Returns:
a ContactMethod from this string, or null if getInstance fails
Throws:
java.text.ParseException - if the passed string cannot be parsed
See Also:
getInstance(String,String)

getInstance

ContactMethod getInstance(java.lang.String protocol,
                          java.lang.String identifier)
Gets an instance of a matching ContactMethod. If none exists, a new ContactMethod is created and returned. If there are multiple ContactMethods with the same protocol and identifier, it is undefined which is returned.

Parameters:
protocol - the protocol for the ContactMethod
identifier - the identifier for the ContactMethod
Returns:
a ContactMethod with the specified information, returning an existing instance if there is one. Returns null if no ContactMethod implementation is available for the protocol.

getProtocols

java.lang.String[] getProtocols()
Returns an array of all known protocols

Returns:
an array of Strings containing the defined protocols


Copyright © 2002-2004 MFlow Group. All Rights Reserved.