Package org.wso2.carbon.service.mgt
Class ServiceAdmin
java.lang.Object
org.wso2.carbon.core.AbstractAdmin
org.wso2.carbon.service.mgt.ServiceAdmin
- All Implemented Interfaces:
ServiceAdminMBean
-
Field Summary
FieldsFields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPoliciesToService(String serviceName, org.apache.neethi.Policy policy, int policyType, String[] modulePaths) This method add Policy to service at the Registry.addTransportBinding(String serviceId, String transportProtocol) voidchangeServiceState(String serviceName, boolean isActive) booleancheckForGroupedServices(String[] serviceGroupsList) Check the service group list for service groups which has more than one servicevoidconfigureMTOM(String flag, String serviceName) set the service parameter enableMTOM to manipulate MTOM flag true/false/optionalvoidvoidbooleandeleteFaultyServiceGroup(String archiveName) voiddeleteFaultyServiceGroups(String[] fileNames) voiddeleteServiceGroups(String[] serviceGroups) downloadServiceArchive(String serviceGroupName) Downloads service archive filesvoidengageModuleToService(String serviceName, String moduleName, String version) getBindingOperationMessagePolicy(String serviceName, String bindingName, String operationName, String messageType) Returns the policy of a given message for a given service binding's operationgetBindingOperationPolicy(String serviceName, String bindingName, String operationName) Returns a policy for an operation of a given service bindinggetBindingPolicy(String serviceName, String bindingName) Returns the policy for a given service bindingString[]getExposedTransports(String serviceId) getFaultyServiceArchives(int pageNumber) getModulePolicy(String moduleName, String moduleVersion) Retrieves the merged policy from a given modiuleintGet the currently active number of servicesintGet the number of faulty servicesintGet the currently inactive number of servicesintgetOperationMessagePolicy(String serviceName, String operationName, String messageType) Returns the policy for a given messagegetOperationPolicy(String serviceName, String operationName) Returns the policy for a given service and it's operationgetPolicies(String serviceName) Returns the Service Policy for a given service.String[]getServiceBindings(String serviceName) getServiceData(String serviceName) String[]getServiceParameters(String serviceName) org.apache.axiom.om.OMElementlistServiceGroup(String serviceGroupName) Return service group details for a given service grouplistServices(String serviceTypeFilter, String serviceSearchString, int pageNumber) List all the available servicesvoidremoveBindingPolicy(String serviceName, String policyKey, String[] moduleNames) Removes policy given the keyvoidremoveServiceParameter(String serviceName, String parameterName) voidremoveServicePoliciesByNamespace(String serviceName, String namesapce) removeTransportBinding(String serviceId, String transportProtocol) voidsetBindingOperationMessagePolicy(String serviceName, String bindingName, String operationName, String messageType, String policyString) voidsetBindingOperationPolicy(String serviceName, String bindingName, String operationName, String policyString) voidsetBindingPolicy(String serviceName, String bindingName, String policyString) voidsetConfigurationContext(org.apache.axis2.context.ConfigurationContext configurationContext) voidsetModulePolicy(String moduleName, String moduleVersion, String policyString) voidvoidsetServiceOperationMessagePolicy(String serviceName, String operationName, String messageType, String policyString) voidsetServiceOperationPolicy(String serviceName, String operationName, String policyString) voidsetServiceParameters(String serviceName, String[] parameters) voidsetServicePolicy(String serviceName, String policyString) voidstartService(String serviceName) Start the service specified byserviceNamevoidstopService(String serviceName) Stop the service specified byserviceNameMethods inherited from class org.wso2.carbon.core.AbstractAdmin
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUsername, getUserRealm, setPermissionUpdateTimestamp
-
Field Details
-
DISABLE_TRY_IT_PARAM
- See Also:
-
DISABLE_DELETION_PARAM
- See Also:
-
-
Constructor Details
-
Method Details
-
setConfigurationContext
public void setConfigurationContext(org.apache.axis2.context.ConfigurationContext configurationContext) - Overrides:
setConfigurationContextin classorg.wso2.carbon.core.AbstractAdmin
-
addPoliciesToService
public void addPoliciesToService(String serviceName, org.apache.neethi.Policy policy, int policyType, String[] modulePaths) throws Exception This method add Policy to service at the Registry. Does not add the policy to Axis2. To all Bindings available todo find from where addPoliciesToService is invoked and make sure the returned modulePaths conform to new persistence logic - kasung Make it look Strings like name-version- Parameters:
serviceName-policy-policyType-- Throws:
Exception
-
removeServicePoliciesByNamespace
- Throws:
Exception
-
engageModuleToService
public void engageModuleToService(String serviceName, String moduleName, String version) throws Exception - Throws:
Exception
-
listServiceGroup
public ServiceGroupMetaData listServiceGroup(String serviceGroupName) throws org.apache.axis2.AxisFault Return service group details for a given service group- Parameters:
serviceGroupName-- Returns:
- ServiceGroupMetaData
- Throws:
org.apache.axis2.AxisFault- TODO: Do we need this in ServiceAdmin?
-
listServices
public ServiceMetaDataWrapper listServices(String serviceTypeFilter, String serviceSearchString, int pageNumber) throws org.apache.axis2.AxisFault List all the available services- Parameters:
serviceTypeFilter- Service type of services to be returnedserviceSearchString- Service name or part of a service namepageNumber- The number of the page to be retrieved- Returns:
- The service metadata
- Throws:
org.apache.axis2.AxisFault- If an error occurs while retrieving services
-
getNumberOfServiceGroups
public int getNumberOfServiceGroups() throws org.apache.axis2.AxisFault- Throws:
org.apache.axis2.AxisFault
-
getNumberOfActiveServices
public int getNumberOfActiveServices() throws org.apache.axis2.AxisFaultDescription copied from interface:ServiceAdminMBeanGet the currently active number of services- Specified by:
getNumberOfActiveServicesin interfaceServiceAdminMBean- Returns:
- Currently active number of services
- Throws:
org.apache.axis2.AxisFault
-
getNumberOfInactiveServices
Description copied from interface:ServiceAdminMBeanGet the currently inactive number of services- Specified by:
getNumberOfInactiveServicesin interfaceServiceAdminMBean- Returns:
- Currently inactive number of services
- Throws:
Exception- If an error occurs while getting the service count
-
getNumberOfFaultyServices
public int getNumberOfFaultyServices()Description copied from interface:ServiceAdminMBeanGet the number of faulty services- Specified by:
getNumberOfFaultyServicesin interfaceServiceAdminMBean- Returns:
- number of faulty services
-
getFaultyServiceArchives
public FaultyServicesWrapper getFaultyServiceArchives(int pageNumber) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
deleteFaultyServiceGroup
- Throws:
org.apache.axis2.AxisFault
-
deleteAllNonAdminServiceGroups
public void deleteAllNonAdminServiceGroups() throws org.apache.axis2.AxisFault- Throws:
org.apache.axis2.AxisFault
-
deleteAllFaultyServiceGroups
public void deleteAllFaultyServiceGroups() throws org.apache.axis2.AxisFault- Throws:
org.apache.axis2.AxisFault
-
checkForGroupedServices
public boolean checkForGroupedServices(String[] serviceGroupsList) throws org.apache.axis2.AxisFault Check the service group list for service groups which has more than one service- Parameters:
serviceGroupsList- - list of service groups- Returns:
- true if found
- Throws:
org.apache.axis2.AxisFault- on error
-
deleteServiceGroups
- Throws:
org.apache.axis2.AxisFault
-
deleteFaultyServiceGroups
- Throws:
org.apache.axis2.AxisFault
-
getServiceData
- Throws:
Exception
-
changeServiceState
public void changeServiceState(String serviceName, boolean isActive) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
configureMTOM
set the service parameter enableMTOM to manipulate MTOM flag true/false/optional- Parameters:
flag-serviceName-- Throws:
org.apache.axis2.AxisFault
-
startService
Description copied from interface:ServiceAdminMBeanStart the service specified byserviceName- Specified by:
startServicein interfaceServiceAdminMBean- Parameters:
serviceName- Name of the service to be restarted- Throws:
Exception- If an error occurs while starting the service
-
stopService
Description copied from interface:ServiceAdminMBeanStop the service specified byserviceName- Specified by:
stopServicein interfaceServiceAdminMBean- Parameters:
serviceName- Name of the service to be restarted- Throws:
Exception- If an error occurs while stopping the service
-
getExposedTransports
- Throws:
org.apache.axis2.AxisFault
-
addTransportBinding
- Throws:
Exception
-
removeTransportBinding
- Throws:
Exception
-
removeBindingPolicy
public void removeBindingPolicy(String serviceName, String policyKey, String[] moduleNames) throws org.wso2.carbon.utils.ServerException Removes policy given the key- Parameters:
serviceName- Name of the servicepolicyKey- Key of the policy to be removedmoduleNames- Array of module names- Throws:
org.wso2.carbon.utils.ServerException- on error
-
setServiceParameters
public void setServiceParameters(String serviceName, String[] parameters) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
removeServiceParameter
public void removeServiceParameter(String serviceName, String parameterName) throws org.apache.axis2.AxisFault - Throws:
org.apache.axis2.AxisFault
-
getServiceParameters
public String[] getServiceParameters(String serviceName) throws org.wso2.carbon.utils.ServerException - Throws:
org.wso2.carbon.utils.ServerException
-
getPolicy
Returns the Service Policy for a given service.- Parameters:
serviceName- The name of the service- Returns:
- A string representing the Policy XML
- Throws:
org.apache.axis2.AxisFault- on error
-
getModulePolicy
public String getModulePolicy(String moduleName, String moduleVersion) throws org.apache.axis2.AxisFault Retrieves the merged policy from a given modiule- Parameters:
moduleName- Name of the modulemoduleVersion- Version string of the string- Returns:
- A string representaiton of the policy
- Throws:
org.apache.axis2.AxisFault- on error
-
setModulePolicy
public void setModulePolicy(String moduleName, String moduleVersion, String policyString) throws Exception - Throws:
Exception
-
getOperationPolicy
public String getOperationPolicy(String serviceName, String operationName) throws org.apache.axis2.AxisFault Returns the policy for a given service and it's operation- Parameters:
serviceName- The name of the serviceoperationName- The operation- Returns:
- a String representing the Policy XML
- Throws:
org.apache.axis2.AxisFault- on error
-
getOperationMessagePolicy
public String getOperationMessagePolicy(String serviceName, String operationName, String messageType) throws org.apache.axis2.AxisFault Returns the policy for a given message- Parameters:
serviceName- The name of the serviceoperationName- The name of the operationmessageType- The type of message- Returns:
- A string representation of the Policy XML
- Throws:
org.apache.axis2.AxisFault- on error
-
getPolicies
- Throws:
org.apache.axis2.AxisFault
-
getBindingPolicy
public String getBindingPolicy(String serviceName, String bindingName) throws org.apache.axis2.AxisFault Returns the policy for a given service binding- Parameters:
serviceName- The name of the servicebindingName- The name of the binding in question- Returns:
- A String representing the Policy XML
- Throws:
org.apache.axis2.AxisFault- on error
-
getBindingOperationPolicy
public String getBindingOperationPolicy(String serviceName, String bindingName, String operationName) throws org.apache.axis2.AxisFault Returns a policy for an operation of a given service binding- Parameters:
serviceName- Name of the servicebindingName- Name of the service bindingoperationName- Name of the service operation- Returns:
- A policy
- Throws:
org.apache.axis2.AxisFault- on error
-
getBindingOperationMessagePolicy
public String getBindingOperationMessagePolicy(String serviceName, String bindingName, String operationName, String messageType) throws org.apache.axis2.AxisFault Returns the policy of a given message for a given service binding's operation- Parameters:
serviceName- Service namebindingName- Service binding nameoperationName- Service operation namemessageType- Message type- Returns:
- Policy key
- Throws:
org.apache.axis2.AxisFault- on error
-
setPolicy
- Throws:
Exception
-
setServicePolicy
- Throws:
Exception
-
setServiceOperationPolicy
public void setServiceOperationPolicy(String serviceName, String operationName, String policyString) throws Exception - Throws:
Exception
-
setServiceOperationMessagePolicy
public void setServiceOperationMessagePolicy(String serviceName, String operationName, String messageType, String policyString) throws Exception - Throws:
Exception
-
setBindingPolicy
public void setBindingPolicy(String serviceName, String bindingName, String policyString) throws Exception - Throws:
Exception
-
setBindingOperationPolicy
public void setBindingOperationPolicy(String serviceName, String bindingName, String operationName, String policyString) throws Exception - Throws:
Exception
-
setBindingOperationMessagePolicy
public void setBindingOperationMessagePolicy(String serviceName, String bindingName, String operationName, String messageType, String policyString) throws Exception - Throws:
Exception
-
getWSDL
- Throws:
org.apache.axis2.AxisFault
-
getServiceBindings
- Throws:
Exception
-
downloadServiceArchive
Downloads service archive files- Parameters:
serviceGroupName- name of the service group needs to be downloaded- Returns:
- the corresponding data handler and the name of the service archive / file that's downloaded
-