com.adobe.idp.dsc.registry.service.client
Class ServiceRegistryClient

java.lang.Object
  extended by com.adobe.idp.dsc.registry.service.client.ServiceRegistryClient
All Implemented Interfaces:
ServiceRegistry

public class ServiceRegistryClient
extends java.lang.Object
implements ServiceRegistry

The client implementation of the Service Registry. It provides clients the ability to query the metadata and state of a service, deploy and undeploy services, and toggle the state of a service from RUNNING to STOPPED.


Field Summary
 
Fields inherited from interface com.adobe.idp.dsc.registry.service.ServiceRegistry
DEFAULT_CATEGORY_ID, SERVICE_ID
 
Constructor Summary
ServiceRegistryClient(ServiceClientFactory clientServiceFactory)
          The constructor for creating a Service Registry client instance.
ServiceRegistryClient(ServiceClientFactory clientServiceFactory, boolean verifyCache)
          The constructor for creating a Service Registry client instance.
 
Method Summary
 void clearCache()
          Clears any caching of services.
 ServiceConfiguration createAndDeploy(Component aComponent, java.lang.String aServiceId, int aMajorVersion, int aMinorVersion, java.lang.String aDescriptor, java.util.Map aConfigParameters)
          Creates and deploys a new service, leaving it in a STOPPED state.
 ServiceConfiguration createAndDeploy(Component aComponent, java.lang.String aCategoryId, java.lang.String aServiceId, int aMajorVersion, int aMinorVersion, java.lang.String aType, java.lang.String aDescriptor, java.util.Map aConfigParamsAsStrings)
          Creates and deploys a new service configuration, leaving it in a STOPPED state.
 ServiceConfiguration createAndDeploy(CreateServiceConfigurationInfo aInfo, java.util.Map aConfigParamsAsStrings)
          Creates and deploys a new service configuration, leaving it in a STOPPED state.
 ServiceConfiguration createAndDeploy(CreateServiceConfigurationInfo aInfo, java.util.Map aConfigValuesAsStrings, boolean aOverrideEndpointCreation)
          Creates and deploys a new service configuration, leaving it in a STOPPED state.
 ServiceCategory createCategory(CreateServiceCategoryInfo aCat)
          Creates a service category with the specified category information.
 ServiceConfiguration createConfiguration(CreateServiceConfigurationInfo aInfo)
          Creates a service configuration with the specified configuration information values.
 Service createService(CreateServiceInfo aInfo)
          Creates a new Service object with the values specified in the CreateServiceInfo object.
 ServiceConfiguration deploy(ServiceConfiguration aConfig)
          Transitions an Inactive service configuration into an Active, but STOPPED state.
 void forceRemovalOfConfiguration(ServiceConfiguration aConfig)
          Forces the removal of the specified service configuration.
 ServiceConfiguration forceUndeploy(ServiceConfiguration aServiceConfig)
          Forces the undeploy of a service (ignoring exceptions for callback methods), transitioning it to an Inactive state.
 java.lang.ClassLoader getClientClassLoader(java.lang.ClassLoader aParent, ServiceConfiguration aConfig)
          Retrieves the client class loader, which can be used to load the necessary types needed to invoke a service's operations.
 java.util.Map getClientLibAsMap(java.lang.String aServiceId, int aMajorVersion, int aMinorVersion)
          This method returns a java.util.Map of classes and resources needed by clients to interact with this service.
 ServiceConfiguration getCompatibleServiceConfiguration(java.lang.String aServiceId, int aMajorVersion, int aMinorVersion)
          Retrieves a service with the specified service identifier that is compatible with the specified version.
 ServiceConfiguration getHeadActiveConfiguration(java.lang.String aServiceId)
          Retrieves a service with the specified service identifier.
 ServiceConfiguration getHeadServiceConfiguration(java.lang.String aServiceId)
          Retrieves a service with the specified service identifier.
 Service getService(java.lang.String aServiceId)
          Retrieves the specified service.
 java.util.List getServiceCategories()
          Retrieves all of the service categories in the container.
 com.adobe.idp.dsc.filter.FilterResult getServiceCategories(com.adobe.idp.dsc.filter.PagingFilter aFilter)
          Retrieves all the service configurations within the container with the specified paging criteria.
 ServiceCategory getServiceCategory(java.lang.String aId)
          Retrieves the specified service category.
 ServiceConfiguration getServiceConfiguration(java.lang.String aServiceId, int aMajorVersion, int aMinorVersion)
          Retrieves a single service configuration with the specified service identifier and version information.
 java.util.List getServiceConfigurations()
          Retrieves a list of all the services within the container.
 java.util.List getServiceConfigurations(Component aComponent)
          Retrieves a list of all the service configurations within the container that are deployed against the specified component.
 com.adobe.idp.dsc.filter.FilterResult getServiceConfigurations(com.adobe.idp.dsc.filter.PagingFilter aFilter)
          Retrieves a list of all the service configurations, within the container, having the specified paging criteria.
 java.util.List getServiceConfigurations(Service aService)
          Retrieves a list of all the service configurations within the container that are created for the specified service.
 java.util.List getServiceConfigurationsForSpecificationId(java.lang.String aSpecificationId)
          Retrieves a list of all the service configurations within the container that implement the specification identifier.
 java.util.List getServices()
          Retrieves all the services.
 java.util.List getServices(ServiceCategory aCategory)
          Retrieves the services belonging to the specified category.
 ServiceConfiguration lock(ServiceConfiguration aConfig)
          Locks a service configuration so that it can only be modified by the "LockedByUser".
 ServiceCategory modifyCategory(ModifyServiceCategoryInfo aInfo)
          Modifies a service category by applying the specified properties.
 ServiceConfiguration modifyConfiguration(ModifyServiceConfigurationInfo aInfo)
          Modifies the specified service configuration with the properties that have been set in the ModifyServiceConfigurationInfo object.
 Service modifyService(ModifyServiceInfo aService)
          Modifies the specified Service object with the values specified in the ModifyServiceInfo object.
 void removeCategory(ServiceCategory aCat)
          Removes the specified service category.
 void removeConfiguration(ServiceConfiguration aConfig)
          Removes the specified service configuration.
 void removeService(Service aService)
          Removes the specified service.
 ServiceConfiguration start(ServiceConfiguration aService)
          Starts the specified document service, transitioning the state of the service from STOPPED to RUNNING.
 ServiceConfiguration stop(ServiceConfiguration aService)
          Stops the specified document service, tansitioning the state of the service from RUNNING to STOPPED.
 ServiceConfiguration undeploy(ServiceConfiguration aServiceConfig)
          Undeploys a service, transitioning it to an Inactive state.
 ServiceConfiguration unlock(ServiceConfiguration aConfig)
          Releases the lock held by the "LockedByUser".
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceRegistryClient

public ServiceRegistryClient(ServiceClientFactory clientServiceFactory)
The constructor for creating a Service Registry client instance.

Parameters:
clientServiceFactory - A ServiceClientFactory instance with valid credentials of the server where the service is deployed.

ServiceRegistryClient

public ServiceRegistryClient(ServiceClientFactory clientServiceFactory,
                             boolean verifyCache)
The constructor for creating a Service Registry client instance.

Parameters:
clientServiceFactory - A ServiceClientFactory instance with valid credentials of the server where the service is deployed.
verifyCache - a boolean that when set to true will reverify the validity of cached ClassLoader instances returned from getClientClassLoader method. Verification is performed by comparing the ServiceConfiguration's last update time. A value of false will cause the first Classloader for the service to be recycled, it is necessary to retrieve a new ServiceRegistryClient instance in order to access the updated Classloader.
Method Detail

createService

public Service createService(CreateServiceInfo aInfo)
                      throws RegistryException
Creates a new Service object with the values specified in the CreateServiceInfo object.

Specified by:
createService in interface ServiceRegistry
Parameters:
aInfo - Values to be applied to the new Service object.
Returns:
A new Service object containing the specified information.
Throws:
RegistryException

getService

public Service getService(java.lang.String aServiceId)
                   throws RegistryException
Retrieves the specified service.

Specified by:
getService in interface ServiceRegistry
Parameters:
aServiceId - The service identifier.
Returns:
The service.
Throws:
RegistryException

getServices

public java.util.List getServices(ServiceCategory aCategory)
Retrieves the services belonging to the specified category.

Specified by:
getServices in interface ServiceRegistry
Parameters:
aCategory - The service category.
Returns:
The services belonging to the specified category.

getServices

public java.util.List getServices()
Retrieves all the services.

Specified by:
getServices in interface ServiceRegistry
Returns:
All the services.

modifyService

public Service modifyService(ModifyServiceInfo aService)
                      throws RegistryException
Modifies the specified Service object with the values specified in the ModifyServiceInfo object.

Specified by:
modifyService in interface ServiceRegistry
Parameters:
aService - Property values to be applied to the specified Service object.
Returns:
A copy of the modified service.
Throws:
RegistryException

removeService

public void removeService(Service aService)
                   throws RegistryException
Removes the specified service.

Specified by:
removeService in interface ServiceRegistry
Parameters:
aService - The service to remove.
Throws:
RegistryException

createConfiguration

public ServiceConfiguration createConfiguration(CreateServiceConfigurationInfo aInfo)
                                         throws RegistryException
Creates a service configuration with the specified configuration information values.

Specified by:
createConfiguration in interface ServiceRegistry
Parameters:
aInfo - The configuration information values.
Returns:
The service configuration with the specified configuration information values.
Throws:
RegistryException

removeConfiguration

public void removeConfiguration(ServiceConfiguration aConfig)
                         throws RegistryException
Removes the specified service configuration.

Specified by:
removeConfiguration in interface ServiceRegistry
Parameters:
aConfig - The service configuration to be removed.
Throws:
RegistryException

forceRemovalOfConfiguration

public void forceRemovalOfConfiguration(ServiceConfiguration aConfig)
                                 throws RegistryException
Forces the removal of the specified service configuration.

Specified by:
forceRemovalOfConfiguration in interface ServiceRegistry
Parameters:
aConfig - The service configuration to be removed.
Throws:
RegistryException

createCategory

public ServiceCategory createCategory(CreateServiceCategoryInfo aCat)
                               throws RegistryException
Creates a service category with the specified category information.

Specified by:
createCategory in interface ServiceRegistry
Parameters:
aCat - The category information.
Returns:
The new service category.
Throws:
RegistryException

getServiceCategory

public ServiceCategory getServiceCategory(java.lang.String aId)
                                   throws RegistryException
Retrieves the specified service category.

Specified by:
getServiceCategory in interface ServiceRegistry
Parameters:
aId - The category identifier.
Returns:
The service category.
Throws:
RegistryException

modifyCategory

public ServiceCategory modifyCategory(ModifyServiceCategoryInfo aInfo)
                               throws RegistryException
Modifies a service category by applying the specified properties.

Specified by:
modifyCategory in interface ServiceRegistry
Parameters:
aInfo - Values to be applied to the service category.
Returns:
The modified service category.
Throws:
RegistryException

removeCategory

public void removeCategory(ServiceCategory aCat)
                    throws RegistryException
Removes the specified service category.

Specified by:
removeCategory in interface ServiceRegistry
Parameters:
aCat - The service category to be removed.
Throws:
RegistryException

getServiceCategories

public java.util.List getServiceCategories()
Retrieves all of the service categories in the container.

Specified by:
getServiceCategories in interface ServiceRegistry
Returns:
All of the service categories in the container.

getServiceConfigurations

public java.util.List getServiceConfigurations()
Retrieves a list of all the services within the container.

Specified by:
getServiceConfigurations in interface ServiceRegistry
Returns:
A list of all the services within the container.

getServiceConfigurationsForSpecificationId

public java.util.List getServiceConfigurationsForSpecificationId(java.lang.String aSpecificationId)
Retrieves a list of all the service configurations within the container that implement the specification identifier.

Specified by:
getServiceConfigurationsForSpecificationId in interface ServiceRegistry
Parameters:
aSpecificationId - The specification identifier.
Returns:
A list of all the service configurations within the container that implement the specification identifier.

getServiceConfigurations

public com.adobe.idp.dsc.filter.FilterResult getServiceConfigurations(com.adobe.idp.dsc.filter.PagingFilter aFilter)
Retrieves a list of all the service configurations, within the container, having the specified paging criteria.

Specified by:
getServiceConfigurations in interface ServiceRegistry
Parameters:
aFilter - The paging criteria.
Returns:
A list of all the service configurations, within the container, having the specified paging criteria.

getServiceCategories

public com.adobe.idp.dsc.filter.FilterResult getServiceCategories(com.adobe.idp.dsc.filter.PagingFilter aFilter)
Retrieves all the service configurations within the container with the specified paging criteria.

Specified by:
getServiceCategories in interface ServiceRegistry
Parameters:
aFilter - The paging criteria.
Returns:
All the service configurations within the container with the specified paging criteria.

getServiceConfigurations

public java.util.List getServiceConfigurations(Component aComponent)
Retrieves a list of all the service configurations within the container that are deployed against the specified component.

Specified by:
getServiceConfigurations in interface ServiceRegistry
Parameters:
aComponent - The component for which to list its related services.
Returns:
A list of all the service configurations within the container that are deployed against the specified component.

getServiceConfigurations

public java.util.List getServiceConfigurations(Service aService)
Retrieves a list of all the service configurations within the container that are created for the specified service.

Specified by:
getServiceConfigurations in interface ServiceRegistry
Parameters:
aService - The component for which to list its related services.
Returns:
A list of service configurations within the container that are created for the specified service.

getHeadServiceConfiguration

public ServiceConfiguration getHeadServiceConfiguration(java.lang.String aServiceId)
                                                 throws RegistryException
Retrieves a service with the specified service identifier. If multiple versions exist, the latest or head version is returned.

Specified by:
getHeadServiceConfiguration in interface ServiceRegistry
Parameters:
aServiceId - The name of the service.
Returns:
The service.
Throws:
RegistryException

getHeadActiveConfiguration

public ServiceConfiguration getHeadActiveConfiguration(java.lang.String aServiceId)
                                                throws RegistryException
Retrieves a service with the specified service identifier. If multiple versions exist, the latest or head version is returned.

Specified by:
getHeadActiveConfiguration in interface ServiceRegistry
Parameters:
aServiceId - The name of the service to be returned.
Returns:
The service.
Throws:
RegistryException

getCompatibleServiceConfiguration

public ServiceConfiguration getCompatibleServiceConfiguration(java.lang.String aServiceId,
                                                              int aMajorVersion,
                                                              int aMinorVersion)
                                                       throws RegistryException
Retrieves a service with the specified service identifier that is compatible with the specified version.

Specified by:
getCompatibleServiceConfiguration in interface ServiceRegistry
Parameters:
aServiceId - The name of the service.
aMajorVersion - The major version.
aMinorVersion - The minor version.
Returns:
The service.
Throws:
ServiceNotFoundException
RegistryException

getServiceConfiguration

public ServiceConfiguration getServiceConfiguration(java.lang.String aServiceId,
                                                    int aMajorVersion,
                                                    int aMinorVersion)
                                             throws RegistryException
Retrieves a single service configuration with the specified service identifier and version information.

Specified by:
getServiceConfiguration in interface ServiceRegistry
Parameters:
aServiceId - The name of the service.
aMajorVersion - The major version.
aMinorVersion - The minor version.
Returns:
The service configuration.
Throws:
ServiceConfigurationNotFoundException
RegistryException

start

public ServiceConfiguration start(ServiceConfiguration aService)
                           throws RegistryException
Starts the specified document service, transitioning the state of the service from STOPPED to RUNNING.

Specified by:
start in interface ServiceRegistry
Parameters:
aService - The service to be started.
Returns:
The service.
Throws:
RegistryException

stop

public ServiceConfiguration stop(ServiceConfiguration aService)
                          throws RegistryException
Stops the specified document service, tansitioning the state of the service from RUNNING to STOPPED.

Specified by:
stop in interface ServiceRegistry
Parameters:
aService - The service to be stopped.
Returns:
The service.
Throws:
RegistryException

createAndDeploy

public ServiceConfiguration createAndDeploy(Component aComponent,
                                            java.lang.String aServiceId,
                                            int aMajorVersion,
                                            int aMinorVersion,
                                            java.lang.String aDescriptor,
                                            java.util.Map aConfigParameters)
                                     throws RegistryException
Creates and deploys a new service, leaving it in a STOPPED state.

Specified by:
createAndDeploy in interface ServiceRegistry
Parameters:
aComponent - The component against which the service is being deployed.
aServiceId - The identifier of the service that clients will use to look up and invoke.
aMajorVersion - The major version number of the service.
aMinorVersion - The minor version number of the service.
aDescriptor - The physical descriptor to be processed by the component. In the case of a POJO this is expected to be the service element; however, in the case of an orchestrated service this would be the process template.
aConfigParameters - Configuration parameters, gathered through the deployment tool, that will be stored in the service registry. These values are expected to be the serialized output of a Property Editor.
Returns:
The new service.
Throws:
RegistryException

createAndDeploy

public ServiceConfiguration createAndDeploy(Component aComponent,
                                            java.lang.String aCategoryId,
                                            java.lang.String aServiceId,
                                            int aMajorVersion,
                                            int aMinorVersion,
                                            java.lang.String aType,
                                            java.lang.String aDescriptor,
                                            java.util.Map aConfigParamsAsStrings)
                                     throws RegistryException
Creates and deploys a new service configuration, leaving it in a STOPPED state.

Specified by:
createAndDeploy in interface ServiceRegistry
Parameters:
aComponent - The component against which the service is being deployed.
aCategoryId - The identifier of the category under which the service will be deployed.
aServiceId - The identifier of the service that clients will use to look up and invoke.
aMajorVersion - The major version number of the service.
aMinorVersion - The minor version number of the service.
aType - The type of the service configuration.
aDescriptor - The physical descriptor to be processed by the Component. In the case of a POJO this is expected to be the service element; however, in the case of an orchestrated service this would be the process template.
aConfigParamsAsStrings - Configuration parameters, gathered through the deployment tool, that will be stored in the service registry. These values are expected to be the serialized output of a Property Editor.
Returns:
The new service.
Throws:
RegistryException

createAndDeploy

public ServiceConfiguration createAndDeploy(CreateServiceConfigurationInfo aInfo,
                                            java.util.Map aConfigParamsAsStrings)
                                     throws RegistryException
Creates and deploys a new service configuration, leaving it in a STOPPED state.

Specified by:
createAndDeploy in interface ServiceRegistry
Parameters:
aInfo - An object containing the values used to create and deploy a service configuration.
aConfigParamsAsStrings - Configuration parameters, gathered through the deployment tool, which will be stored in the Service Registry. These values are expected to be the serialized output of a Property Editor.
Returns:
The new service configuration.
Throws:
RegistryException

createAndDeploy

public ServiceConfiguration createAndDeploy(CreateServiceConfigurationInfo aInfo,
                                            java.util.Map aConfigValuesAsStrings,
                                            boolean aOverrideEndpointCreation)
                                     throws RegistryException
Description copied from interface: ServiceRegistry
Creates and deploys a new service configuration, leaving it in a STOPPED state.

Specified by:
createAndDeploy in interface ServiceRegistry
Parameters:
aInfo - An object containing the values used to create and deploy a service configuration.
aConfigValuesAsStrings - Configuration parameters, gathered through the deployment tool, which will be stored in the Service Registry. These values are expected to be the serialized output of a Property Editor.
aOverrideEndpointCreation - specify whether to override the creation of default endpoints, by default endpoints are always created, passing true will override this creation
Returns:
The new service configuration.
Throws:
RegistryException

deploy

public ServiceConfiguration deploy(ServiceConfiguration aConfig)
                            throws RegistryException
Transitions an Inactive service configuration into an Active, but STOPPED state.

Specified by:
deploy in interface ServiceRegistry
Parameters:
aConfig - The service configuration to be transitioned.
Returns:
The Active service configuration.
Throws:
RegistryException

modifyConfiguration

public ServiceConfiguration modifyConfiguration(ModifyServiceConfigurationInfo aInfo)
                                         throws RegistryException
Modifies the specified service configuration with the properties that have been set in the ModifyServiceConfigurationInfo object.

Specified by:
modifyConfiguration in interface ServiceRegistry
Parameters:
aInfo - Contains property values to be set in the specified service configuration.
Returns:
A service configuration.
Throws:
RegistryException

undeploy

public ServiceConfiguration undeploy(ServiceConfiguration aServiceConfig)
                              throws RegistryException
Undeploys a service, transitioning it to an Inactive state.

Specified by:
undeploy in interface ServiceRegistry
Parameters:
aServiceConfig - The service to be undeployed.
Throws:
RegistryException

forceUndeploy

public ServiceConfiguration forceUndeploy(ServiceConfiguration aServiceConfig)
                                   throws RegistryException
Forces the undeploy of a service (ignoring exceptions for callback methods), transitioning it to an Inactive state.

Specified by:
forceUndeploy in interface ServiceRegistry
Parameters:
aServiceConfig - The service to be undeployed.
Throws:
RegistryException

clearCache

public void clearCache()
Clears any caching of services.

Specified by:
clearCache in interface ServiceRegistry

getClientLibAsMap

public java.util.Map getClientLibAsMap(java.lang.String aServiceId,
                                       int aMajorVersion,
                                       int aMinorVersion)
                                throws RegistryException
This method returns a java.util.Map of classes and resources needed by clients to interact with this service. The classes and resources returned are determined by the export specifications in the related component's component.xml.

Specified by:
getClientLibAsMap in interface ServiceRegistry
Parameters:
aServiceId - The service identifier.
aMajorVersion - The major version.
aMinorVersion - The minor version.
Returns:
A java.util.Map of classes and resources needed by clients to interact with this service.
Throws:
RegistryException

getClientClassLoader

public java.lang.ClassLoader getClientClassLoader(java.lang.ClassLoader aParent,
                                                  ServiceConfiguration aConfig)
                                           throws RegistryException
Retrieves the client class loader, which can be used to load the necessary types needed to invoke a service's operations.

Parameters:
aParent - The parent class loader.
aConfig - The service.
Returns:
The client class loader.
Throws:
RegistryException

lock

public ServiceConfiguration lock(ServiceConfiguration aConfig)
                          throws RegistryException
Locks a service configuration so that it can only be modified by the "LockedByUser".

Specified by:
lock in interface ServiceRegistry
Parameters:
aConfig - The service configuration to be locked.
Returns:
The locked service configuration.
Throws:
RegistryException

unlock

public ServiceConfiguration unlock(ServiceConfiguration aConfig)
                            throws RegistryException
Releases the lock held by the "LockedByUser".

Specified by:
unlock in interface ServiceRegistry
Parameters:
aConfig - The service configuration to be unlocked.
Returns:
The unlocked service configuration.
Throws:
RegistryException


[an error occurred while processing this directive] [an error occurred while processing this directive]