LDAPJDK 4.1

com.netscape.sasl
Class ClientFactory

java.lang.Object
  |
  +--com.netscape.sasl.ClientFactory

public class ClientFactory
extends java.lang.Object
implements SaslClientFactory

An interface for creating instances of SaslClient.

See Also:
SaslClient, Sasl

Constructor Summary
ClientFactory()
           
 
Method Summary
 SaslClient createSaslClient(java.lang.String[] mechanisms, java.lang.String authorizationId, java.lang.String protocol, java.lang.String serverName, java.util.Hashtable props, javax.security.auth.callback.CallbackHandler cbh)
          Creates a SaslClient using the parameters supplied.
 java.lang.String[] getMechanismNames()
          Returns an array of names of mechanisms supported by this factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientFactory

public ClientFactory()
Method Detail

createSaslClient

public SaslClient createSaslClient(java.lang.String[] mechanisms,
                                   java.lang.String authorizationId,
                                   java.lang.String protocol,
                                   java.lang.String serverName,
                                   java.util.Hashtable props,
                                   javax.security.auth.callback.CallbackHandler cbh)
                            throws SaslException
Creates a SaslClient using the parameters supplied.
Specified by:
createSaslClient in interface SaslClientFactory
Parameters:
mechanisms - The non-null list of mechanism names to try. Each is the IANA-registered name of a SASL mechanism. (e.g. "GSSAPI", "CRAM-MD5").
authorizationId - The possibly null authorization ID to use. When the SASL authentication completes successfully, the entity named by authorizationId is granted access.
protocol - The non-null string name of the protocol for which the authentication is being performed (e.g., "ldap").
serverName - The non-null string name of the server to which we are creating an authenticated connection.
props - The possibly null properties to be used by the SASL mechanisms to configure the authentication exchange. For example, "javax.security.sasl.encryption.maximum" might be used to specify the maximum key length to use for encryption.
cbh - The possibly null callback handler to used by the SASL mechanisms to get further information from the application/library to complete the authentication. For example, a SASL mechanism might require the authentication ID and password from the caller.
Returns:
A possibly null SaslClient created using the parameters supplied. If null, this factory cannot produce a SaslClient using the parameters supplied.
Throws:
SaslException - if it cannot create a SaslClient because of an error.

getMechanismNames

public java.lang.String[] getMechanismNames()
Returns an array of names of mechanisms supported by this factory.
Specified by:
getMechanismNames in interface SaslClientFactory
Returns:
A non-null array containing IANA-registered SASL mechanism names.

LDAPJDK 4.1