public class ServiceManager extends Object implements LocalServicesManager
Modifier and Type | Field and Description |
---|---|
protected static String |
NEW_HOST_DISPLAY |
static String |
NEW_SERVICE_HOST |
protected static String |
PRIMARY_HOST_DISPLAY |
Constructor and Description |
---|
ServiceManager(ContentStoreManagerUtil contentStoreManagerUtil,
ServiceConfigUtil serviceConfigUtil,
ServiceComputeInstanceUtil serviceComputeInstanceUtil) |
Modifier and Type | Method and Description |
---|---|
void |
clearCache() |
void |
configure(InputStream configXml)
Initializes the service manager with the provided XML document so
that the service manager is able to connect to all services
service compute instances, and user storage.
|
String |
createServiceInstance(String displayName)
Starts up a new services compute instance.
|
int |
deployService(int serviceId,
String serviceHost,
String userConfigVersion,
List<UserConfigModeSet> userConfigModeSets)
Attempts to deploy the service with the given ID the the server
at the given host.
|
List<ServiceInfo> |
getAvailableServices()
Retrieves a listing of services which are available for deployment
along with the description and user configuration for each service
|
ServiceInfo |
getDeployedService(int serviceId,
int deploymentId)
Gets a service which has been deployed.
|
Map<String,String> |
getDeployedServiceProps(int serviceId,
int deploymentId)
Gets the properties of a service which has been deployed.
|
List<ServiceInfo> |
getDeployedServices()
Retrieves a listing of services which have been deployed.
|
ServiceInfo |
getService(int serviceId)
Gets a service.
|
protected void |
initialize() |
boolean |
isConfigured()
Determines if the service manager has been configured
|
void |
lockServiceComputeInstance(String instanceHost)
Locks a service compute instance, meaning that no further services
should be deployed on this instance until the lock is removed.
|
void |
login(Credential credential)
This method supplies user credentials to the application.
|
void |
logout()
This method clears any previously logged-in credentials.
|
void |
undeployAllServices()
Undeploys all of the deployed services.
|
void |
undeployService(int serviceId,
int deploymentId)
Stops and un-deploys a service
|
void |
unlockServiceComputeInstance(String instanceHost)
Unlocks a services compute instance, indicating that the instance is
available for further service deployments.
|
void |
updateServiceConfig(int serviceId,
int deploymentId,
String userConfigVersion,
List<UserConfigModeSet> userConfigModeSets)
Updates the configuration of a service which has already been deployed
|
protected static final String PRIMARY_HOST_DISPLAY
protected static final String NEW_HOST_DISPLAY
public static final String NEW_SERVICE_HOST
public ServiceManager(ContentStoreManagerUtil contentStoreManagerUtil, ServiceConfigUtil serviceConfigUtil, ServiceComputeInstanceUtil serviceComputeInstanceUtil)
public void configure(InputStream configXml)
configure
in interface LocalServicesManager
configXml
- the xml used to initialize the service managerpublic boolean isConfigured()
LocalServicesManager
isConfigured
in interface LocalServicesManager
protected void initialize()
public List<ServiceInfo> getAvailableServices()
getAvailableServices
in interface ServicesManager
public List<ServiceInfo> getDeployedServices()
getDeployedServices
in interface ServicesManager
public void clearCache()
public int deployService(int serviceId, String serviceHost, String userConfigVersion, List<UserConfigModeSet> userConfigModeSets) throws NoSuchServiceException, NoSuchServiceComputeInstanceException
deployService
in interface ServicesManager
serviceId
- the ID of the service to be deployedserviceHost
- the server host on which the service is to be deployeduserConfigVersion
- version of the user configurationuserConfigModeSets
- user configuration settings for the serviceNoSuchServiceException
- if there is no service with ID = serviceIdNoSuchServiceComputeInstanceException
- if there is no services compute instance at serviceHostpublic ServiceInfo getDeployedService(int serviceId, int deploymentId) throws NoSuchDeployedServiceException
getDeployedService
in interface ServicesManager
serviceId
- the ID of the service to retrievedeploymentId
- the ID of the service deployment to retrieveNoSuchDeployedServiceException
- if either service or deployment does not existpublic Map<String,String> getDeployedServiceProps(int serviceId, int deploymentId) throws NoSuchDeployedServiceException
getDeployedServiceProps
in interface ServicesManager
serviceId
- the ID of the service to retrievedeploymentId
- the ID of the service deployment to retrieveNoSuchDeployedServiceException
- if either service or deployment does not existpublic void updateServiceConfig(int serviceId, int deploymentId, String userConfigVersion, List<UserConfigModeSet> userConfigModeSets) throws NoSuchDeployedServiceException
updateServiceConfig
in interface ServicesManager
serviceId
- the ID of the service to updatedeploymentId
- the ID of the service deployment to updateuserConfigVersion
- version of the user configurationuserConfigModeSets
- the updated user configuration for this service deploymentNoSuchDeployedServiceException
- if either service or deployment does not existpublic ServiceInfo getService(int serviceId) throws NoSuchServiceException
getService
in interface ServicesManager
serviceId
- the ID of the service to be retrievedNoSuchServiceException
- if the service does not existpublic void undeployAllServices()
public void login(Credential credential)
Securable
public void logout()
Securable
public void undeployService(int serviceId, int deploymentId) throws NoSuchDeployedServiceException
undeployService
in interface ServicesManager
serviceId
- the ID of the service to undeploydeploymentId
- the ID of the service deployment to undeployNoSuchDeployedServiceException
- if either service or deployment does not existpublic void lockServiceComputeInstance(String instanceHost) throws NoSuchServiceComputeInstanceException
instanceHost
- the host name of the compute instance to lockNoSuchServiceComputeInstanceException
- if no such compute instance existspublic void unlockServiceComputeInstance(String instanceHost) throws NoSuchServiceComputeInstanceException
instanceHost
- the host name of the compute instance to unlockNoSuchServiceComputeInstanceException
- if no such compute instance existsCopyright © 2009-2013 DuraSpace. All Rights Reserved.