org.duracloud.client
Class ServicesManagerImpl

java.lang.Object
  extended by org.duracloud.client.ServicesManagerImpl
All Implemented Interfaces:
org.duracloud.common.model.Securable, org.duracloud.serviceapi.ServicesManager

public class ServicesManagerImpl
extends java.lang.Object
implements org.duracloud.serviceapi.ServicesManager, org.duracloud.common.model.Securable

Allows for communication with DuraService

Author:
Bill Branan

Constructor Summary
ServicesManagerImpl(java.lang.String host, java.lang.String port)
           
ServicesManagerImpl(java.lang.String host, java.lang.String port, java.lang.String context)
           
 
Method Summary
 int deployService(int serviceId, java.lang.String serviceHost, java.lang.String userConfigVersion, java.util.List<org.duracloud.serviceconfig.user.UserConfigModeSet> userConfigModeSets)
          Deploys a service.
 java.util.List<org.duracloud.serviceconfig.ServiceInfo> getAvailableServices()
          Provides a listing of available services, that is, services which can be deployed.
 java.lang.String getBaseURL()
           
 org.duracloud.serviceconfig.ServiceInfo getDeployedService(int serviceId, int deploymentId)
          Gets a deployed service.
 java.util.Map<java.lang.String,java.lang.String> getDeployedServiceProps(int serviceId, int deploymentId)
          Gets runtime properties for a deployed service.
 java.util.List<org.duracloud.serviceconfig.ServiceInfo> getDeployedServices()
          Provides a listing of all deployed services.
 org.duracloud.serviceconfig.ServiceInfo getService(int serviceId)
          Gets a service.
 void login(org.duracloud.common.model.Credential credential)
           
 void logout()
           
 void undeployService(int serviceId, int deploymentId)
          UnDeploys a service.
 void updateServiceConfig(int serviceId, int deploymentId, java.lang.String userConfigVersion, java.util.List<org.duracloud.serviceconfig.user.UserConfigModeSet> userConfigModeSets)
          Updates the configuration of a deployed service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServicesManagerImpl

public ServicesManagerImpl(java.lang.String host,
                           java.lang.String port)

ServicesManagerImpl

public ServicesManagerImpl(java.lang.String host,
                           java.lang.String port,
                           java.lang.String context)
Method Detail

getBaseURL

public java.lang.String getBaseURL()

getAvailableServices

public java.util.List<org.duracloud.serviceconfig.ServiceInfo> getAvailableServices()
                                                                             throws org.duracloud.serviceapi.error.ServicesException
Provides a listing of available services, that is, services which can be deployed.

Specified by:
getAvailableServices in interface org.duracloud.serviceapi.ServicesManager
Returns:
List of available services
Throws:
org.duracloud.serviceapi.error.ServicesException - if available services cannot be retrieved

getDeployedServices

public java.util.List<org.duracloud.serviceconfig.ServiceInfo> getDeployedServices()
                                                                            throws org.duracloud.serviceapi.error.ServicesException
Provides a listing of all deployed services.

Specified by:
getDeployedServices in interface org.duracloud.serviceapi.ServicesManager
Returns:
List of deployed services
Throws:
org.duracloud.serviceapi.error.ServicesException - if deployed services cannot be retrieved

getService

public org.duracloud.serviceconfig.ServiceInfo getService(int serviceId)
                                                   throws org.duracloud.serviceapi.error.NotFoundException,
                                                          org.duracloud.serviceapi.error.ServicesException
Gets a service. This includes configuration options and deployment options for a potential deployment as well as a list of all current deployments of this service. There is no guarantee with this call that the service returned can be deployed. Use getAvailableServices to get the list of services which are available for deployment.

Specified by:
getService in interface org.duracloud.serviceapi.ServicesManager
Parameters:
serviceId - the ID of the service to retrieve
Returns:
a service
Throws:
org.duracloud.serviceapi.error.NotFoundException - if the service cannot be found
org.duracloud.serviceapi.error.ServicesException - if the service cannot be retrieved

getDeployedService

public org.duracloud.serviceconfig.ServiceInfo getDeployedService(int serviceId,
                                                                  int deploymentId)
                                                           throws org.duracloud.serviceapi.error.NotFoundException,
                                                                  org.duracloud.serviceapi.error.ServicesException
Gets a deployed service. This includes the selected configuration for the deployment as well as the user configuration options for potential reconfiguration.

Specified by:
getDeployedService in interface org.duracloud.serviceapi.ServicesManager
Parameters:
serviceId - the ID of the service to retrieve
deploymentId - the ID of the service deployment to retrieve
Returns:
a service which has been deployed
Throws:
org.duracloud.serviceapi.error.NotFoundException - if either the service or deployment cannot be found
org.duracloud.serviceapi.error.ServicesException - if the service cannot be retrieved

getDeployedServiceProps

public java.util.Map<java.lang.String,java.lang.String> getDeployedServiceProps(int serviceId,
                                                                                int deploymentId)
                                                                         throws org.duracloud.serviceapi.error.NotFoundException,
                                                                                org.duracloud.serviceapi.error.ServicesException
Gets runtime properties for a deployed service.

Specified by:
getDeployedServiceProps in interface org.duracloud.serviceapi.ServicesManager
Parameters:
serviceId - the ID of the service to retrieve
deploymentId - the ID of the service deployment to retrieve
Returns:
a map of service properties
Throws:
org.duracloud.serviceapi.error.NotFoundException - if either the service or deployment cannot be found
org.duracloud.serviceapi.error.ServicesException - if the service properties cannot be retrieved

deployService

public int deployService(int serviceId,
                         java.lang.String serviceHost,
                         java.lang.String userConfigVersion,
                         java.util.List<org.duracloud.serviceconfig.user.UserConfigModeSet> userConfigModeSets)
                  throws org.duracloud.serviceapi.error.NotFoundException,
                         org.duracloud.serviceapi.error.ServicesException
Deploys a service.

Specified by:
deployService in interface org.duracloud.serviceapi.ServicesManager
Parameters:
serviceId - the ID of the service to deploy
serviceHost - the selected service host
userConfigVersion - the version of the user configuration
userConfigModeSets - a list of user configuration options
Returns:
the deploymentID of the newly deployed service
Throws:
org.duracloud.serviceapi.error.NotFoundException - if the service cannot be found
org.duracloud.serviceapi.error.ServicesException - if the service cannot be deployed

updateServiceConfig

public void updateServiceConfig(int serviceId,
                                int deploymentId,
                                java.lang.String userConfigVersion,
                                java.util.List<org.duracloud.serviceconfig.user.UserConfigModeSet> userConfigModeSets)
                         throws org.duracloud.serviceapi.error.NotFoundException,
                                org.duracloud.serviceapi.error.ServicesException
Updates the configuration of a deployed service.

Specified by:
updateServiceConfig in interface org.duracloud.serviceapi.ServicesManager
Parameters:
serviceId - the ID of the service to update
deploymentId - the ID of the service deployment to update
userConfigVersion - the version of the user configuration
userConfigModeSets - updated user configuration options
Throws:
org.duracloud.serviceapi.error.NotFoundException - if either the service or deployment cannot be found
org.duracloud.serviceapi.error.ServicesException - if the service configuration cannot be updated

undeployService

public void undeployService(int serviceId,
                            int deploymentId)
                     throws org.duracloud.serviceapi.error.NotFoundException,
                            org.duracloud.serviceapi.error.ServicesException
UnDeploys a service.

Specified by:
undeployService in interface org.duracloud.serviceapi.ServicesManager
Parameters:
serviceId - the ID of the service to undeploy
deploymentId - the ID of the service deployment to undeploy
Throws:
org.duracloud.serviceapi.error.NotFoundException - if either the service or deployment cannot be found
org.duracloud.serviceapi.error.ServicesException - if the service cannot be undeployed

login

public void login(org.duracloud.common.model.Credential credential)
Specified by:
login in interface org.duracloud.common.model.Securable

logout

public void logout()
Specified by:
logout in interface org.duracloud.common.model.Securable


Copyright © 2009-2011 DuraSpace. All Rights Reserved.