|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.duracloud.duraservice.mgmt.ServiceManager
public class ServiceManager
Performs management functions over services.
Field Summary | |
---|---|
protected static String |
NEW_HOST_DISPLAY
|
static String |
NEW_SERVICE_HOST
|
protected static String |
PRIMARY_HOST_DISPLAY
|
Constructor Summary | |
---|---|
ServiceManager(ContentStoreManagerUtil contentStoreManagerUtil,
ServiceConfigUtil serviceConfigUtil,
ServiceComputeInstanceUtil serviceComputeInstanceUtil)
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String PRIMARY_HOST_DISPLAY
protected static final String NEW_HOST_DISPLAY
public static final String NEW_SERVICE_HOST
Constructor Detail |
---|
public ServiceManager(ContentStoreManagerUtil contentStoreManagerUtil, ServiceConfigUtil serviceConfigUtil, ServiceComputeInstanceUtil serviceComputeInstanceUtil)
Method Detail |
---|
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 service
NoSuchServiceException
- if there is no service with ID = serviceId
NoSuchServiceComputeInstanceException
- 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 retrieve
NoSuchDeployedServiceException
- 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 retrieve
NoSuchDeployedServiceException
- 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 deployment
NoSuchDeployedServiceException
- 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 retrieved
NoSuchServiceException
- if the service does not existpublic void undeployAllServices()
public void login(Credential credential)
Securable
login
in interface Securable
credential
- of userpublic void logout()
Securable
logout
in interface 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 undeploy
NoSuchDeployedServiceException
- if either service or deployment does not existpublic void lockServiceComputeInstance(String instanceHost) throws NoSuchServiceComputeInstanceException
instanceHost
- the host name of the compute instance to lock
NoSuchServiceComputeInstanceException
- if no such compute instance existspublic void unlockServiceComputeInstance(String instanceHost) throws NoSuchServiceComputeInstanceException
instanceHost
- the host name of the compute instance to unlock
NoSuchServiceComputeInstanceException
- if no such compute instance existspublic String createServiceInstance(String displayName)
displayName
- the name to display to indicate the new instance
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |