com.adobe.idp.dsc.clientsdk
Class ServiceClientFactory

java.lang.Object
  extended by com.adobe.idp.dsc.clientsdk.ServiceClientFactory
All Implemented Interfaces:
com.adobe.idp.DocumentPassivationClientFactory

public class ServiceClientFactory
extends java.lang.Object
implements com.adobe.idp.DocumentPassivationClientFactory

Responsible for maintaining client configuration and providing a ServiceClient instance for an application to use.


Nested Class Summary
static interface ServiceClientFactory.ThrowHandler
          A ThrowHandler instance participates in the handling of any Exception that occurs during the invocation of a service request.
 
Constructor Summary
ServiceClientFactory()
           
 
Method Summary
 FaultCallBackInfo createFaultCallBackInfo(java.lang.String serviceName, java.lang.String operationName, java.lang.String version)
          Sets a fault callback.
static ServiceClientFactory createInstance()
          Creates a new instance of ServiceClientFactory that is used to send invocation requests to a Adobe Experience Manager forms service.
static ServiceClientFactory createInstance(Context aContext)
          Creates a new instance of ServiceClientFactory that is used to send invocation requests to a Adobe Experience Manager forms service.
static ServiceClientFactory createInstance(java.util.Properties aProperties)
          Creates a new instance of ServiceClientFactory that is used to send invocation requests to a Adobe Experience Manager forms service.
static ServiceClientFactory createInstance(java.lang.String aResourceName)
          Creates a ServiceClientFactory object with a resource property.
static ServiceClientFactory createInstance(java.net.URL aPropertyURL)
          Creates a ServiceClientFactory with properties located at the specified URL.
 InvocationRequest createInvocationRequest(java.lang.String aServiceName, java.lang.String aOperationName, java.util.Map aParameterInput, boolean synchronous)
          Creates an InvocationRequest object using the specified Adobe Experience Manager forms service name, operation name, parameter values, and operation mode.
 ResponseCallBackInfo createResponseCallBackInfo(java.lang.String serviceName, java.lang.String operationName, java.lang.String version)
          Sets a response callback.
 Context getContext()
          Returns the context that maintains information such as the user credential values.
static java.util.Properties getDefaultProperties()
          Gets the default properties to use for ServiceClientFactory's created through the empty arg createInstance call.
 com.adobe.idp.DocumentPassivationClient getDocumentPassivationClient(java.lang.String scheme, java.lang.String uri)
           
 java.lang.Object getProperty(java.lang.String aPropertyName)
          Gets a property value that was used to create the ServiceClientFactory object.
 ServiceClient getServiceClient()
          Returns an instance of a ServiceClient object.
static void installThrowHandler(ServiceClientFactory.ThrowHandler th)
          Replaces the global default ThrowHandler instance in order to provide specialized exception handling.
 void setContext(Context aContext)
          Sets the context to use.
static void setDefaultProperties(java.util.Properties aProps)
          Sets the Default Properties to use for ServiceClientFactory's created through the empty arg createInstance call.
 void setProviderId(java.lang.String aConnectorId, java.lang.String aEndpointPublicId)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceClientFactory

public ServiceClientFactory()
Method Detail

setDefaultProperties

public static void setDefaultProperties(java.util.Properties aProps)
Sets the Default Properties to use for ServiceClientFactory's created through the empty arg createInstance call. Note: these properties only apply when used outside of the container, but will be ignored for code running inside the Service Container.

Parameters:
aProps -

getDefaultProperties

public static java.util.Properties getDefaultProperties()
Gets the default properties to use for ServiceClientFactory's created through the empty arg createInstance call.

Returns:
The default properties to use for ServiceClientFactory's created through the empty arg createInstance call.

installThrowHandler

public static void installThrowHandler(ServiceClientFactory.ThrowHandler th)
Replaces the global default ThrowHandler instance in order to provide specialized exception handling. All exceptions originating within the client will pass through the installed handler regardless of the ServiceClientFactory instance the originated them.

Parameters:
th - the ThrowHandler instance that should be used to handle exception sarising during invocation request/response.

createInstance

public static ServiceClientFactory createInstance()
Creates a new instance of ServiceClientFactory that is used to send invocation requests to a Adobe Experience Manager forms service. For information, see Invoking Adobe Experience Manager forms Services.

Returns:
An instance of ServiceClientFactory, or null an error occurs.

createInstance

public static ServiceClientFactory createInstance(Context aContext)
Creates a new instance of ServiceClientFactory that is used to send invocation requests to a Adobe Experience Manager forms service.

Parameters:
aContext - A com.adobe.idp.Context object that is used for authentication and authorization purposes.
Returns:
A ServiceClientFactory object, or null an error occurs.

createInstance

public static ServiceClientFactory createInstance(java.util.Properties aProperties)
                                           throws com.adobe.idp.dsc.DSCRuntimeException
Creates a new instance of ServiceClientFactory that is used to send invocation requests to a Adobe Experience Manager forms service.

Parameters:
aProperties - A java.util.Properties object that stores connection properties. For information, see Invoking Adobe Experience Manager forms Services.
Returns:
A ServiceClientFactory object, or null if an error occurs.
Throws:
com.adobe.idp.dsc.DSCRuntimeException

createInstance

public static ServiceClientFactory createInstance(java.lang.String aResourceName)
Creates a ServiceClientFactory object with a resource property. The specified resource must be located within the classpath of the client application.

Parameters:
aResourceName - The name of the resource.
Returns:
A ServiceClientFactory object, or null if an error occurs.

createInstance

public static ServiceClientFactory createInstance(java.net.URL aPropertyURL)
Creates a ServiceClientFactory with properties located at the specified URL.

Parameters:
aPropertyURL - The URL to the property file.
Returns:
A ServiceClientFactory object, or null if an error occurs.

getServiceClient

public ServiceClient getServiceClient()
Returns an instance of a ServiceClient object. For information, see Invoking Adobe Experience Manager forms Services.

Returns:
A ServiceClient object.

createInvocationRequest

public InvocationRequest createInvocationRequest(java.lang.String aServiceName,
                                                 java.lang.String aOperationName,
                                                 java.util.Map aParameterInput,
                                                 boolean synchronous)
                                          throws com.adobe.idp.dsc.DSCRuntimeException
Creates an InvocationRequest object using the specified Adobe Experience Manager forms service name, operation name, parameter values, and operation mode.

Parameters:
aServiceName - The name of the Adobe Experience Manager forms service to invoke.
aOperationName - The Adobe Experience Manager forms operation name. The operation must belong to the Adobe Experience Manager forms service specified by the aServiceName parameter.
aParameterInput - A map that contains parameter values that are required by the operation.
synchronous - Set to true if the operation is executed synchronously, otherwise, set it to false.
Returns:
An InvocationRequest object.
Throws:
A - DSCRuntimeException if the service name or the operation name is null or an empty string.
com.adobe.idp.dsc.DSCRuntimeException

getContext

public Context getContext()
Returns the context that maintains information such as the user credential values.

Returns:
A Context object or null if the context has not been established.

setContext

public void setContext(Context aContext)
Sets the context to use.

Parameters:
aContext - A Context object.

getProperty

public java.lang.Object getProperty(java.lang.String aPropertyName)
Gets a property value that was used to create the ServiceClientFactory object.

Parameters:
aPropertyName - The name of the property.
Returns:
The value of the specified property.

createResponseCallBackInfo

public ResponseCallBackInfo createResponseCallBackInfo(java.lang.String serviceName,
                                                       java.lang.String operationName,
                                                       java.lang.String version)
Sets a response callback.


createFaultCallBackInfo

public FaultCallBackInfo createFaultCallBackInfo(java.lang.String serviceName,
                                                 java.lang.String operationName,
                                                 java.lang.String version)
Sets a fault callback.


setProviderId

public void setProviderId(java.lang.String aConnectorId,
                          java.lang.String aEndpointPublicId)

getDocumentPassivationClient

public com.adobe.idp.DocumentPassivationClient getDocumentPassivationClient(java.lang.String scheme,
                                                                            java.lang.String uri)
Specified by:
getDocumentPassivationClient in interface com.adobe.idp.DocumentPassivationClientFactory