net.directj.csf.impl
Class ClientFactoryImpl

java.lang.Object
  |
  +--net.directj.csf.ClientFactory
        |
        +--net.directj.csf.impl.ClientFactoryImpl

public class ClientFactoryImpl
extends ClientFactory

This class is used to easely create clients. It is quite simple, but can manage a lot of client'type, like SSL or TLS server. To change the type of the created client, you may use the getSupportedType(), getSupportedTypeDescription() and setClientType() methods.

Version:
0.1.0
Author:
CARTAPANIS Alexandre <earendil@jprolog.net>

Field Summary
static java.lang.String STANDARD
          The "standard" clienttype.
static java.lang.String STANDARD_DESC
          The "standard" client type.
static java.lang.String[] SUPPORTED_TYPE
          The array of suppported client type.
static java.lang.String[] SUPPORTED_TYPE_DESC
          The array of suppported client type description.
private  java.lang.String type
          The current server type.
 
Fields inherited from class net.directj.csf.ClientFactory
 
Constructor Summary
ClientFactoryImpl()
           
 
Method Summary
 Client createClient(int _port, java.net.InetAddress _address)
          Creates a new client.
 java.lang.String[] getSupportedType()
          Returns the list of client type supported by this factory.
 java.lang.String[] getSupportedTypeDescription()
          Returns the description of the different supported type.
 void setClientType(java.lang.String _type)
          Changes the type of the client that will be created with the createServer method.
 
Methods inherited from class net.directj.csf.ClientFactory
getDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STANDARD

public static final java.lang.String STANDARD
The "standard" clienttype.

See Also:
Constant Field Values

STANDARD_DESC

public static final java.lang.String STANDARD_DESC
The "standard" client type.

See Also:
Constant Field Values

SUPPORTED_TYPE

public static final java.lang.String[] SUPPORTED_TYPE
The array of suppported client type.


SUPPORTED_TYPE_DESC

public static final java.lang.String[] SUPPORTED_TYPE_DESC
The array of suppported client type description.


type

private java.lang.String type
The current server type.

Constructor Detail

ClientFactoryImpl

public ClientFactoryImpl()
Method Detail

getSupportedType

public java.lang.String[] getSupportedType()
Returns the list of client type supported by this factory. You can get a description of each type by using the getSupportedTypeDesciption() method.

Specified by:
getSupportedType in class ClientFactory
Returns:
String[] - An array of string that indicate the list of supported client type.
See Also:
The description method.

getSupportedTypeDescription

public java.lang.String[] getSupportedTypeDescription()
Returns the description of the different supported type. The ith String of the returned array is the description of the ith String returned by the getSupportedTypeDescription.

Specified by:
getSupportedTypeDescription in class ClientFactory
Returns:
String[] - An array of string that describe the supported client type.
See Also:
The client type method.

setClientType

public void setClientType(java.lang.String _type)
                   throws java.lang.IllegalArgumentException
Changes the type of the client that will be created with the createServer method. You can check the valid client type by using the getSupportedType method.

Specified by:
setClientType in class ClientFactory
Parameters:
_type - The client's type.
Throws:
java.lang.IllegalArgumentException - If the specified type is not a valid client's type.
See Also:
The method to check the valid type.

createClient

public Client createClient(int _port,
                           java.net.InetAddress _address)
                    throws java.lang.IllegalArgumentException
Creates a new client.

Specified by:
createClient in class ClientFactory
Parameters:
_port - The server's port, where the client will bind to.
_address - The server's address, where the client will bind to.
Returns:
Client - A new client.
Throws:
java.lang.IllegalArgumentException - If a specified parameters is not valid.


Copyright 2002 CARTAPANIS Alexandre
This page was last updated on May 10 2003