com.genesyslab.soa.client.ws
Class WebServicesFactory

java.lang.Object
  extended bycom.genesyslab.soa.client.ws.WebServicesFactory
All Implemented Interfaces:
BaseServiceFactoryImpl

public class WebServicesFactory
extends java.lang.Object
implements BaseServiceFactoryImpl


Nested Class Summary
 class WebServicesFactory.InvocationContext
           
static class WebServicesFactory.NotificationContext
           
 
Field Summary
static java.lang.String AXIS_CLIENT_CONFIG_FILE
          Optional axis configuration file , key axis.ClientConfigFile, default value client-config.wsdd.
protected  java.lang.String axisClientConfigFile
           
protected  com.genesyslab.soa.client.ws.AxisServer axisServer
           
static java.util.Hashtable axisServers
           
static java.lang.String BACKUP_URLS
          Backup Urls constant, key BackupUrls.
static java.lang.String CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY
          the key for the Axis Property that sets the default connection timeout in millisecs for the httpclient.
static java.lang.String CONNECTION_DEFAULT_SO_TIMEOUT_KEY
          the key for the Axis Property that sets the read timeout in millisecs for the httpclient Key axis.http.client.maximum.total.connections, default value 0 means infinite value.
static java.lang.String CONNECTION_POOL_TIMEOUT_KEY
          the key for the Axis Property that sets the connection pool timeout for the httpclient pool.
static java.lang.String CONNECTION_TIMEOUT
          Timeout used by transport sender in seconds. key ConnectionTimeout, default 45 seconds, specify -1 to disable.
static java.lang.String DEFAULT_SESSION_ID_PARAMETER
          Session identifier parameter, key AisSuffixUrl, default value ?
static java.lang.String DEFAULT_SUFFIX_URL
          Suffix Ail services Url constant, key AisSuffixUrl, default value interaction/.
protected  java.io.InputStream deployWSDDDocumentFileStream
           
protected  java.io.InputStream deployWSDDRpcFileStream
           
static java.lang.String DOCUMENT_MODE
          Optional document mode. key DocumentMode, default false.
protected  boolean documentMode
           
static java.lang.String DOMAIN_NAME
          Optional domain name. key DomainName.
protected  java.lang.String domainName
           
static java.lang.String ENABLE_HTTP_COMMONS_SENDER
          Use internal HTTP commons sender for HTTP 1.1.
static java.lang.String GIS_ASYNCHRONOUS_CONNECTION_INTERVAL
          Asynchronous connection Interval, key gis.asynchronousConnectionInterval, default value 30.
static java.lang.String GIS_CHECK_SESSION_INTERVAL
          Sets check session interval in seconds. if 0, no session ckecking.
protected  java.lang.String GIS_LICENSE
           
static java.lang.String GIS_PASSWORD
          Sets the GIS password to the factory, key gis.password.
static java.lang.String GIS_SESSION_ID
          Sets the GIS session id to the factory, key gis.sessionId.
static java.lang.String GIS_SESSION_ID_PARAMETER_NAME
          Sets the GIS session id parameter name, key gis.sessionIdParameterName, default value?
static java.lang.String GIS_TENANT
          Sets the GIS tenant to the factory.
static java.lang.String GIS_USERNAME
          Sets the GIS username to the factory, key gis.username.
 java.lang.String gisSessionIdParameter
           
static java.lang.String HTTP_PROXY_HOST
          Hostname of proxy server. key http.proxyHost.
static java.lang.String HTTP_PROXY_PASSWORD
          Optional proxy server password. key http.proxyPassword.
static java.lang.String HTTP_PROXY_PORT
          Port on server of proxy. key http.proxyPort.
static java.lang.String HTTP_PROXY_USER
          Optional username for proxy authentication. key http.proxyUser.
protected  int httpPort
           
static java.lang.String INVALID_XML_CHAR_SUBSTITUTE
          Invalid Xml char substitute.
 boolean licenseTaken
           
protected static Log logger
           
 boolean loginDone
           
static java.lang.String MAINTAIN_SESSION
          Participate in a session with the endpoint. key MaintainSession, default value true.
protected  boolean maintainSession
           
static java.lang.String MAXIMUM_CONNECTIONS_PER_HOST_PROPERTY_KEY
          the key for the Axis Property that controls the maximum connections per host allowed by the httpclient pool.
static java.lang.String MAXIMUM_TOTAL_CONNECTIONS_PROPERTY_KEY
          The key for the Axis Property that controls the maximum total connections allowed in the httpclient pool.
static java.lang.String NB_RETRIES_ON_FAILURE
          Sets the number of retries in case on failure connection, key NbRetriesOnFailure, default value 0.
static java.lang.String NOTIF_APPEND_URI
          Notification append object URI to reachable URL, key notification.appendURIToReachableURL, default valuefalse, true append URI.
static java.lang.String NOTIF_BY_HOSTNAME
          Notification by hostname, key notification.byHostname, default valuefalse, true sends hostname, false sends IP address.
static java.lang.String NOTIF_ENABLE_MULTIPLE_ADDRESSES
          Notification enable multiple addresses, key notification.enableMultipleAddresses, default valuefalse.
static java.lang.String NOTIF_HTTP_PORT
          Notification HTTP port, key notification.HTTPport.
static java.lang.String NOTIF_IP_ADDRESS
          Notification IP Address, key notification.IPAddress.
static java.lang.String NOTIF_MAX_POOL_SIZE
          Notification maximum pool size, key notification.maxPoolSize, default value100.
static java.lang.String NOTIF_REACHABLE_URL
          Notification reachable uri from server, key notification.reachableURL>.
protected  java.lang.String notificationIPAddress
           
protected  java.lang.String notifyUrlDocument
           
protected  java.lang.String notifyUrlRpc
           
static java.lang.String OPTION_CLIENT_CONFIG_FILE
          the key for the Axis Property that sets the client-config.wsdd.
protected  java.lang.String password
           
static java.lang.String PASSWORD
          Password for authentication. key Password.
static java.lang.String RETRY_PERIOD_ON_FAILURE
          Sets the retry period in case on failure connection, 0 means no period.
static java.lang.String SERVICE_POINT_CONNECTION_LIMIT
           
static java.lang.String SERVICE_POINT_MAX_IDLE_TIME
           
static java.lang.String SERVICE_POINT_MGR_CONNECTION_LIMIT
           
static java.lang.String SERVICE_POINT_MGR_MAX_IDLE_TIME
           
static java.lang.String SERVICE_POINT_URL
           
protected  java.util.Properties services
           
protected  java.util.Hashtable servicesReverse
           
static java.util.Hashtable subscribers
           
static java.lang.String SUFFIX_URL
          Suffix Url constant, key SuffixUrl default value /services/.
protected  int timeout
           
static java.lang.String URL
          Url constant, key Url.
protected  java.lang.String username
           
static java.lang.String USERNAME
          User name for authentication. key Username.
 
Constructor Summary
WebServicesFactory()
           
 
Method Summary
 boolean clearSubscriber(java.lang.String subscriberId)
           
 void connectToServer()
           
protected  boolean controlGISSessionService()
           
 java.lang.Object createService(java.lang.Class serviceClass, java.util.Properties context)
          Create a real service
static java.lang.reflect.Method getMethod(java.lang.Class clazz, java.lang.String methodName)
           
 java.lang.String getNextUrl(java.util.ArrayList urls, java.lang.String failedUrl)
           
 java.lang.String getNotifyServiceName()
           
 java.lang.String[] getServices()
          Gets all services classname available (ex com.genesyslab.ail.ws.agent.AgentService, com.genesyslab.ail.ws.event.EventService) ;
 void initFactory(ServiceFactory factory, java.util.Properties context, ServiceFactoryListener listener, boolean asyncMode)
          init Fcatory
 void initParameters(java.util.Properties context)
           
 java.lang.Object interceptEventService(WebServicesFactory.InvocationContext invocationContext)
           
 java.lang.Object interceptRequest(WebServicesFactory.InvocationContext invocationContext)
           
 java.lang.Object InternalInvokeServiceMethod(WebServicesFactory.InvocationContext invocationContext)
           
 java.lang.Object invokeServiceMethod(java.lang.Object realService, java.lang.String methodName, java.lang.Object[] parameters)
          Invoke a method on a real service.
 java.lang.String registerNotifyCallback(java.lang.String subscriberId, NotifyService notifyService, java.lang.Object realEventService)
           
 void releaseFactory()
          Release factory
 void releaseGISSessionService()
           
 void removeSubscriber(java.lang.Object realEventService, java.lang.String subscriberId)
           
 void removeSubscribers()
           
 void startAxisServer()
           
 void stopAxisServer()
           
 void updateServicesUrl(java.lang.String url)
           
 void updateServiceUrl(java.lang.Object realService, java.lang.String url)
           
 void updateSessionServiceUrl()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static Log logger

URL

public static final java.lang.String URL
Url constant, key Url.

See Also:
Constant Field Values

BACKUP_URLS

public static final java.lang.String BACKUP_URLS
Backup Urls constant, key BackupUrls.

See Also:
Constant Field Values

SUFFIX_URL

public static final java.lang.String SUFFIX_URL
Suffix Url constant, key SuffixUrl default value /services/.

See Also:
Constant Field Values

DEFAULT_SUFFIX_URL

public static final java.lang.String DEFAULT_SUFFIX_URL
Suffix Ail services Url constant, key AisSuffixUrl, default value interaction/.

See Also:
Constant Field Values

DEFAULT_SESSION_ID_PARAMETER

public static final java.lang.String DEFAULT_SESSION_ID_PARAMETER
Session identifier parameter, key AisSuffixUrl, default value ?GISsessionId=/.

See Also:
Constant Field Values

NOTIF_HTTP_PORT

public static final java.lang.String NOTIF_HTTP_PORT
Notification HTTP port, key notification.HTTPport. If null, the system will choose an open port.

See Also:
Constant Field Values

NOTIF_REACHABLE_URL

public static final java.lang.String NOTIF_REACHABLE_URL
Notification reachable uri from server, key notification.reachableURL>.

See Also:
Constant Field Values

NOTIF_IP_ADDRESS

public static final java.lang.String NOTIF_IP_ADDRESS
Notification IP Address, key notification.IPAddress. If null, the system will choose the local ip address.

See Also:
Constant Field Values

NOTIF_BY_HOSTNAME

public static final java.lang.String NOTIF_BY_HOSTNAME
Notification by hostname, key notification.byHostname, default valuefalse, true sends hostname, false sends IP address.

See Also:
Constant Field Values

NOTIF_ENABLE_MULTIPLE_ADDRESSES

public static final java.lang.String NOTIF_ENABLE_MULTIPLE_ADDRESSES
Notification enable multiple addresses, key notification.enableMultipleAddresses, default valuefalse.

See Also:
Constant Field Values

NOTIF_MAX_POOL_SIZE

public static final java.lang.String NOTIF_MAX_POOL_SIZE
Notification maximum pool size, key notification.maxPoolSize, default value100.

See Also:
Constant Field Values

NOTIF_APPEND_URI

public static final java.lang.String NOTIF_APPEND_URI
Notification append object URI to reachable URL, key notification.appendURIToReachableURL, default valuefalse, true append URI.

See Also:
Constant Field Values

GIS_SESSION_ID

public static final java.lang.String GIS_SESSION_ID
Sets the GIS session id to the factory, key gis.sessionId.

See Also:
Constant Field Values

GIS_USERNAME

public static final java.lang.String GIS_USERNAME
Sets the GIS username to the factory, key gis.username.

See Also:
Constant Field Values

GIS_PASSWORD

public static final java.lang.String GIS_PASSWORD
Sets the GIS password to the factory, key gis.password.

See Also:
Constant Field Values

GIS_TENANT

public static final java.lang.String GIS_TENANT
Sets the GIS tenant to the factory. Optional, key gis.tenant.

See Also:
Constant Field Values

GIS_SESSION_ID_PARAMETER_NAME

public static final java.lang.String GIS_SESSION_ID_PARAMETER_NAME
Sets the GIS session id parameter name, key gis.sessionIdParameterName, default value?GISsessionId=.

See Also:
Constant Field Values

GIS_CHECK_SESSION_INTERVAL

public static final java.lang.String GIS_CHECK_SESSION_INTERVAL
Sets check session interval in seconds. if 0, no session ckecking. Key gis.checkSessionInterval default value 900 seconds.

See Also:
Constant Field Values

MAINTAIN_SESSION

public static final java.lang.String MAINTAIN_SESSION
Participate in a session with the endpoint. key MaintainSession, default value true.

See Also:
Constant Field Values

USERNAME

public static final java.lang.String USERNAME
User name for authentication. key Username.

See Also:
Constant Field Values

PASSWORD

public static final java.lang.String PASSWORD
Password for authentication. key Password.

See Also:
Constant Field Values

CONNECTION_TIMEOUT

public static final java.lang.String CONNECTION_TIMEOUT
Timeout used by transport sender in seconds. key ConnectionTimeout, default 45 seconds, specify -1 to disable.

See Also:
Constant Field Values

HTTP_PROXY_HOST

public static final java.lang.String HTTP_PROXY_HOST
Hostname of proxy server. key http.proxyHost.

See Also:
Constant Field Values

HTTP_PROXY_PORT

public static final java.lang.String HTTP_PROXY_PORT
Port on server of proxy. key http.proxyPort.

See Also:
Constant Field Values

HTTP_PROXY_USER

public static final java.lang.String HTTP_PROXY_USER
Optional username for proxy authentication. key http.proxyUser.

See Also:
Constant Field Values

HTTP_PROXY_PASSWORD

public static final java.lang.String HTTP_PROXY_PASSWORD
Optional proxy server password. key http.proxyPassword.

See Also:
Constant Field Values

DOMAIN_NAME

public static final java.lang.String DOMAIN_NAME
Optional domain name. key DomainName.

See Also:
Constant Field Values

DOCUMENT_MODE

public static final java.lang.String DOCUMENT_MODE
Optional document mode. key DocumentMode, default false.

See Also:
Constant Field Values

GIS_ASYNCHRONOUS_CONNECTION_INTERVAL

public static final java.lang.String GIS_ASYNCHRONOUS_CONNECTION_INTERVAL
Asynchronous connection Interval, key gis.asynchronousConnectionInterval, default value 30.

See Also:
Constant Field Values

AXIS_CLIENT_CONFIG_FILE

public static final java.lang.String AXIS_CLIENT_CONFIG_FILE
Optional axis configuration file , key axis.ClientConfigFile, default value client-config.wsdd.

See Also:
Constant Field Values

SERVICE_POINT_URL

public static final java.lang.String SERVICE_POINT_URL
See Also:
Constant Field Values

SERVICE_POINT_CONNECTION_LIMIT

public static final java.lang.String SERVICE_POINT_CONNECTION_LIMIT
See Also:
Constant Field Values

SERVICE_POINT_MAX_IDLE_TIME

public static final java.lang.String SERVICE_POINT_MAX_IDLE_TIME
See Also:
Constant Field Values

SERVICE_POINT_MGR_CONNECTION_LIMIT

public static java.lang.String SERVICE_POINT_MGR_CONNECTION_LIMIT

SERVICE_POINT_MGR_MAX_IDLE_TIME

public static final java.lang.String SERVICE_POINT_MGR_MAX_IDLE_TIME
See Also:
Constant Field Values

NB_RETRIES_ON_FAILURE

public static final java.lang.String NB_RETRIES_ON_FAILURE
Sets the number of retries in case on failure connection, key NbRetriesOnFailure, default value 0.

See Also:
Constant Field Values

RETRY_PERIOD_ON_FAILURE

public static final java.lang.String RETRY_PERIOD_ON_FAILURE
Sets the retry period in case on failure connection, 0 means no period. Key RetryPeriodOnFailure, default value 1000 milliseconds.

See Also:
Constant Field Values

ENABLE_HTTP_COMMONS_SENDER

public static final java.lang.String ENABLE_HTTP_COMMONS_SENDER
Use internal HTTP commons sender for HTTP 1.1. Key EnableHttpCommonsSender, default value false milliseconds.

See Also:
Constant Field Values

MAXIMUM_TOTAL_CONNECTIONS_PROPERTY_KEY

public static final java.lang.String MAXIMUM_TOTAL_CONNECTIONS_PROPERTY_KEY
The key for the Axis Property that controls the maximum total connections allowed in the httpclient pool. Key axis.http.client.maximum.total.connections, default value 20

See Also:
Constant Field Values

MAXIMUM_CONNECTIONS_PER_HOST_PROPERTY_KEY

public static final java.lang.String MAXIMUM_CONNECTIONS_PER_HOST_PROPERTY_KEY
the key for the Axis Property that controls the maximum connections per host allowed by the httpclient pool. Key axis.http.client.maximum.connections.per.host, default value 2

See Also:
Constant Field Values

CONNECTION_POOL_TIMEOUT_KEY

public static final java.lang.String CONNECTION_POOL_TIMEOUT_KEY
the key for the Axis Property that sets the connection pool timeout for the httpclient pool. Key axis.http.client.connection.pool.timeout, default value 20

See Also:
Constant Field Values

CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY

public static final java.lang.String CONNECTION_DEFAULT_CONNECTION_TIMEOUT_KEY
the key for the Axis Property that sets the default connection timeout in millisecs for the httpclient. Key axis.http.client.connection.default.connection.timeout, default value 0 means not used.

See Also:
Constant Field Values

CONNECTION_DEFAULT_SO_TIMEOUT_KEY

public static final java.lang.String CONNECTION_DEFAULT_SO_TIMEOUT_KEY
the key for the Axis Property that sets the read timeout in millisecs for the httpclient Key axis.http.client.maximum.total.connections, default value 0 means infinite value.

See Also:
Constant Field Values

OPTION_CLIENT_CONFIG_FILE

public static final java.lang.String OPTION_CLIENT_CONFIG_FILE
the key for the Axis Property that sets the client-config.wsdd. Key axis.ClientConfigFile, default value client-config.wsdd.

See Also:
Constant Field Values

INVALID_XML_CHAR_SUBSTITUTE

public static final java.lang.String INVALID_XML_CHAR_SUBSTITUTE
Invalid Xml char substitute. Key InvalidXmlCharSubstitute, default value ? milliseconds.

See Also:
Constant Field Values

axisServers

public static java.util.Hashtable axisServers

subscribers

public static java.util.Hashtable subscribers

licenseTaken

public boolean licenseTaken

loginDone

public boolean loginDone

GIS_LICENSE

protected java.lang.String GIS_LICENSE

gisSessionIdParameter

public java.lang.String gisSessionIdParameter

httpPort

protected int httpPort

axisServer

protected com.genesyslab.soa.client.ws.AxisServer axisServer

notificationIPAddress

protected java.lang.String notificationIPAddress

maintainSession

protected boolean maintainSession

timeout

protected int timeout

username

protected java.lang.String username

password

protected java.lang.String password

domainName

protected java.lang.String domainName

services

protected java.util.Properties services

servicesReverse

protected java.util.Hashtable servicesReverse

deployWSDDRpcFileStream

protected java.io.InputStream deployWSDDRpcFileStream

deployWSDDDocumentFileStream

protected java.io.InputStream deployWSDDDocumentFileStream

documentMode

protected boolean documentMode

notifyUrlRpc

protected java.lang.String notifyUrlRpc

notifyUrlDocument

protected java.lang.String notifyUrlDocument

axisClientConfigFile

protected java.lang.String axisClientConfigFile
Constructor Detail

WebServicesFactory

public WebServicesFactory()
Method Detail

initFactory

public void initFactory(ServiceFactory factory,
                        java.util.Properties context,
                        ServiceFactoryListener listener,
                        boolean asyncMode)
                 throws ServiceException
Description copied from interface: BaseServiceFactoryImpl
init Fcatory

Specified by:
initFactory in interface BaseServiceFactoryImpl
Parameters:
factory -
context -
listener -
asyncMode -
Throws:
ServiceException

connectToServer

public void connectToServer()
                     throws ServiceException
Throws:
ServiceException

initParameters

public void initParameters(java.util.Properties context)
                    throws ServiceException
Throws:
ServiceException

releaseFactory

public void releaseFactory()
Description copied from interface: BaseServiceFactoryImpl
Release factory

Specified by:
releaseFactory in interface BaseServiceFactoryImpl

createService

public java.lang.Object createService(java.lang.Class serviceClass,
                                      java.util.Properties context)
                               throws ServiceException
Description copied from interface: BaseServiceFactoryImpl
Create a real service

Specified by:
createService in interface BaseServiceFactoryImpl
Parameters:
serviceClass - (ex com.genesyslab.ail.ws.agent.AgentService, com.genesyslab.ail.ws.event.EventService)
context - parameters
Returns:
real service
Throws:
ServiceException

getNextUrl

public java.lang.String getNextUrl(java.util.ArrayList urls,
                                   java.lang.String failedUrl)

updateServiceUrl

public void updateServiceUrl(java.lang.Object realService,
                             java.lang.String url)

updateSessionServiceUrl

public void updateSessionServiceUrl()

updateServicesUrl

public void updateServicesUrl(java.lang.String url)

invokeServiceMethod

public java.lang.Object invokeServiceMethod(java.lang.Object realService,
                                            java.lang.String methodName,
                                            java.lang.Object[] parameters)
                                     throws ServiceException
Description copied from interface: BaseServiceFactoryImpl
Invoke a method on a real service.

Specified by:
invokeServiceMethod in interface BaseServiceFactoryImpl
Parameters:
realService -
methodName -
parameters -
Returns:
Throws:
ServiceException

InternalInvokeServiceMethod

public java.lang.Object InternalInvokeServiceMethod(WebServicesFactory.InvocationContext invocationContext)
                                             throws ServiceException
Throws:
ServiceException

getNotifyServiceName

public java.lang.String getNotifyServiceName()

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class clazz,
                                                 java.lang.String methodName)

getServices

public java.lang.String[] getServices()
Description copied from interface: BaseServiceFactoryImpl
Gets all services classname available (ex com.genesyslab.ail.ws.agent.AgentService, com.genesyslab.ail.ws.event.EventService) ;

Specified by:
getServices in interface BaseServiceFactoryImpl
Returns:

controlGISSessionService

protected boolean controlGISSessionService()
                                    throws ServiceException
Throws:
ServiceException

releaseGISSessionService

public void releaseGISSessionService()

startAxisServer

public void startAxisServer()

stopAxisServer

public void stopAxisServer()

removeSubscribers

public void removeSubscribers()

removeSubscriber

public void removeSubscriber(java.lang.Object realEventService,
                             java.lang.String subscriberId)

interceptRequest

public java.lang.Object interceptRequest(WebServicesFactory.InvocationContext invocationContext)
                                  throws ServiceException
Throws:
ServiceException

interceptEventService

public java.lang.Object interceptEventService(WebServicesFactory.InvocationContext invocationContext)
                                       throws ServiceException
Throws:
ServiceException

registerNotifyCallback

public java.lang.String registerNotifyCallback(java.lang.String subscriberId,
                                               NotifyService notifyService,
                                               java.lang.Object realEventService)

clearSubscriber

public boolean clearSubscriber(java.lang.String subscriberId)