org.systinet.wasp.mgmt
Interface ServiceAdministration

All Known Subinterfaces:
AdminService

public interface ServiceAdministration

This interface represents component which is able to manipulate with services.

Using ServiceAdministration is possible to get list of running services, start/stop service, for specified service get its package, manage state, IP Filter interceptor, message size interceptor and other custom interceptors.

Since:
4.5
Component:
Mgmt-Services

Method Summary
 void disableServiceInstance(ServiceInstance serviceInstance)
          Disable given service instance.
 void enableServiceInstance(ServiceInstance serviceInstance)
          Enable given service instance.
 java.lang.String[] getEndpointOperations(java.lang.String endpointPath)
          Gets names of WSDL operations available for given web service endpoint path.
 Package getPackage(ServiceInstance serviceInstance)
          Get package for given service instance.
 Version getServerVersion()
          Get WSO2 SOA Enablement Server version.
 ServiceEndpointInfo getServiceEndpoint(ServiceEndpoint serviceEndpoint)
          Gets service endpoint info.
 ServiceInstanceInfo getServiceInstance(ServiceInstance serviceInstance)
          Gets service instance info.
 ServiceEndpointInfo[] getServiceInstanceEndpoints(ServiceInstance serviceInstance)
          Gets service endpoints for given service instance in runtime.
 ServiceInstanceInfo[] getServiceInstances()
          Gets all services instances in runtime.
 ServiceEndpointInfo[] getServiceInstancesEndpoints(ServiceInstance[] serviceInstances)
          Gets services endpoints for given service instances in runtime.
 InterceptorInfo[] interceptorControl(ServiceEndpoint serviceEndpoint, int controlOperation, InterceptorInfo interceptorInfo)
          Control service endpoint interceptors.
 IpFilterInfo ipFilterInterceptorControl(ServiceEndpoint serviceEndpoint, int controlOperation, boolean allowedByDefault, IpFilterRule[] ipFilterRules)
          Block or allow requests depending on the requestor's IP address for particular service endpoint.
 int messageSizeInterceptorControl(ServiceEndpoint serviceEndpoint, int controlOperation, int maxMessageLength)
          Control message size checker interceptor.
 boolean polymorphismControl(ServiceEndpoint serviceEndpoint, int controlOperation)
          Control service endpoint polymorphism support.
 int serviceInstanceStateControl(ServiceInstance serviceInstance, int controlOperation)
          Control service instance state.
 void startServiceInstance(ServiceInstance serviceInstance)
          Deprecated. since 4.5 use enableServiceInstance(org.systinet.wasp.admin.ServiceInstance) instead.
 void stopServiceInstance(ServiceInstance serviceInstance)
          Forces service instance to go to Disabled without waiting for the active request to complete.
 

Method Detail

getServerVersion

public Version getServerVersion()
Get WSO2 SOA Enablement Server version.
Secure mode: you don't have to be authorized to invoke this method.

Returns:
version structure.

getServiceInstances

public ServiceInstanceInfo[] getServiceInstances()
                                          throws AdminServiceException
Gets all services instances in runtime.
Secure mode: you get only service instances for which you have WSConfigPermission/get permission.

Returns:
an array of service instance infos.
Throws:
AdminServiceException

getServiceInstance

public ServiceInstanceInfo getServiceInstance(ServiceInstance serviceInstance)
                                       throws AdminServiceException
Gets service instance info.
Secure mode: you get the service instance only if you have WSConfigPermission/get for it.

Parameters:
serviceInstance - a service instance descriptor.
Returns:
service instance info, null if the service instance doesn't exist.
Throws:
AdminServiceException

serviceInstanceStateControl

public int serviceInstanceStateControl(ServiceInstance serviceInstance,
                                       int controlOperation)
                                throws AdminServiceException
Control service instance state.

Parameters:
serviceInstance - a service instance.
controlOperation - may be one of the following:
  • START: start the service instance.
    Secure mode: you must have WSStatePermission/start permission for target service instance to perform this operation.
  • STOP: stop the service instance.
    Secure mode: you must have WSStatePermission/stop permission for target service instance to perform this operation.
  • ENABLE: enable the service instance.
    Secure mode: you must have WSStatePermission/enable permission for target service instance to perform this operation.
  • DISABLE: disable the service instance.
    Secure mode: you must have WSStatePermission/disable permission for target service instance to perform this operation.
  • GET: get the service instance state.
    Secure mode: you must have WSStatePermission/get permission for target service instance to perform this operation.
Returns:
On GET operation returns service instance state, else returns -1.
Throws:
AdminServiceException
See Also:
ControlOperations

enableServiceInstance

public void enableServiceInstance(ServiceInstance serviceInstance)
                           throws AdminServiceException
Enable given service instance.
Secure mode: you must have WSStatePermission/enable permission for target service instance to perform this operation.

Parameters:
serviceInstance - a service instance descriptor.
Throws:
AdminServiceException

disableServiceInstance

public void disableServiceInstance(ServiceInstance serviceInstance)
                            throws AdminServiceException
Disable given service instance.
Secure mode: you must have WSStatePermission/disable permission for target service instance to perform this operation.

Parameters:
serviceInstance - a service instance descriptor.
Throws:
AdminServiceException

startServiceInstance

public void startServiceInstance(ServiceInstance serviceInstance)
                          throws AdminServiceException
Deprecated. since 4.5 use enableServiceInstance(org.systinet.wasp.admin.ServiceInstance) instead.

Start given service instance.
Secure mode: you must have WSStatePermission/start permission for target service instance to perform this operation.

Parameters:
serviceInstance - a service instance descriptor.
Throws:
AdminServiceException

stopServiceInstance

public void stopServiceInstance(ServiceInstance serviceInstance)
                         throws AdminServiceException
Forces service instance to go to Disabled without waiting for the active request to complete. The active connections are abandoned. Furthermore, if service instance implements Initializable, destroy is NOT processed.

This method is legal only for service instance in the Enabled and Active states.

Note: use with care - this method is unsafe and does not terminate active connections properly. It can thus lead to unpredictable behavior. This method is blocking.

Throws:
AdminServiceException

getServiceInstanceEndpoints

public ServiceEndpointInfo[] getServiceInstanceEndpoints(ServiceInstance serviceInstance)
                                                  throws AdminServiceException
Gets service endpoints for given service instance in runtime.
Secure mode: you get only service endpoints for which you have WSConfigPermission/get permission.

Parameters:
serviceInstance - a service instance descriptor.
Returns:
an array of service endpoint infos.
Throws:
AdminServiceException

getEndpointOperations

public java.lang.String[] getEndpointOperations(java.lang.String endpointPath)
                                         throws AdminServiceException
Gets names of WSDL operations available for given web service endpoint path.

Parameters:
endpointPath - endpoint path, like "/HelloWorldService"
Returns:
names of WSDL operations
Throws:
AdminServiceException

getServiceInstancesEndpoints

public ServiceEndpointInfo[] getServiceInstancesEndpoints(ServiceInstance[] serviceInstances)
                                                   throws AdminServiceException
Gets services endpoints for given service instances in runtime.
Secure mode: you get only service endpoints for which you have WSConfigPermission/get permission.

Parameters:
serviceInstances - a service instance descriptor.
Returns:
an array of service endpoint infos.
Throws:
AdminServiceException

getServiceEndpoint

public ServiceEndpointInfo getServiceEndpoint(ServiceEndpoint serviceEndpoint)
                                       throws AdminServiceException
Gets service endpoint info.
Secure mode: you get the service endpoint only if you have WSConfigPermission/get for it.

Parameters:
serviceEndpoint - given service endpoint descriptor.
Throws:
AdminServiceException

interceptorControl

public InterceptorInfo[] interceptorControl(ServiceEndpoint serviceEndpoint,
                                            int controlOperation,
                                            InterceptorInfo interceptorInfo)
                                     throws AdminServiceException
Control service endpoint interceptors.

Parameters:
serviceEndpoint - target service endpoint.
controlOperation - may be one of the following:
  • GET_ALL: returns list of known interceptors managed by interceptor repository (service endpoint parameter is ignored) which are loaded into runtime.
    Secure mode: you must have WSMonitoringPermission/get permission for target service endpoint to perform this operation.
  • GET: returns list of interceptors assigned to given service endpoint.
    Secure mode: you must have WSMonitoringPermission/get permission for target service endpoint to perform this operation.
  • ADD: interceptor to given position (default 0), intercepting in given directions.
    Secure mode: you must have WSMonitoringPermission/set permission for target service endpoint to perform this operation.
  • REMOVE: remove interceptor.
    Secure mode: you must have WSMonitoringPermission/set permission for target service endpoint to perform this operation.
  • REMOVE_ALL: remove all the application level interceptors.
    Secure mode: you must have WSMonitoringPermission/set permission for target service endpoint to perform this operation.
  • STORE: store current interceptor chain of the endpoint into configuration (persistence).
    Secure mode: you must have WSConfigPermission/set permission for target service endpoint to perform this operation.
interceptorInfo - interceptor info structure which holds interceptor name, position within interceptor chain and directions.
On ADD operation interceptor name must be specified; position and direction are optional fields. Default value (0) for position is to intercept in both direction, and for position means the first position in interceptor chain.

On REMOVE operation interceptor name must be specified and directions and position fields are ignored (it is presumed that interceptor name is unique).
On GET, GET_ALL and REMOVE_ALL operations is this parameter ignored.
Returns:
On GET operation returns interceptor list for the service endpoint; on GET_ALL operation returns a list of InterceptorInfo structures where is only the name valid. For other operations returns null.
Throws:
AdminServiceException
See Also:
ControlOperations, InterceptorInfo

messageSizeInterceptorControl

public int messageSizeInterceptorControl(ServiceEndpoint serviceEndpoint,
                                         int controlOperation,
                                         int maxMessageLength)
                                  throws AdminServiceException
Control message size checker interceptor.

Changes made using this method to the service endpoint interceptor chain are transient. To make the use of message size interceptor permanent, you must store the interceptor chain for the service endpoint using the interceptorControl(org.systinet.wasp.admin.ServiceEndpoint, int, org.systinet.wasp.admin.InterceptorInfo) method.

Parameters:
serviceEndpoint - target service endpoint.
controlOperation - may be one of the following:
  • GET: returns the message size checker interceptor limit. If the interceptor is not present within the chain, -1 is returned.
    Secure mode: you must have WSBManagePermission/get permission for target service endpoint to perform this operation.
  • ADD: set the message size length interceptor for this service endpoint.
    Secure mode: you must have WSBManagePermission/set permission for target service endpoint to perform this operation.
  • REMOVE: remove the message length interceptor.
    Secure mode: you must have WSBManagePermission/set permission for target service endpoint to perform this operation.
Returns:
message size limit for this service endpoint, -1 if limit is unknown.
Throws:
AdminServiceException
See Also:
ControlOperations

ipFilterInterceptorControl

public IpFilterInfo ipFilterInterceptorControl(ServiceEndpoint serviceEndpoint,
                                               int controlOperation,
                                               boolean allowedByDefault,
                                               IpFilterRule[] ipFilterRules)
                                        throws AdminServiceException
Block or allow requests depending on the requestor's IP address for particular service endpoint.

Parameters:
serviceEndpoint - target service endpoint.
controlOperation - may be one of the following:
    GET: return interceptor's default behaviour and the list of filtering rules for target service endpoint.
    Secure mode: you must have WSBManagePermission/get permission for target service endpoint to perform this operation.
  • ADD: set the IP filter interceptor for the target service endpoint. If the IP filter interceptor was already used by this service endpoint in the past, then its original configuration - filtering rules - are reused when rules provided on ADD operation are not specified (ipFilterRules parameter is null).
    Secure mode: you must have WSBManagePermission/set permission for target service endpoint to perform this operation.
  • REMOVE: remove the IP filter interceptor. Note that the interceptor configuration remains in the config and can be resurrected on ADD operation.
    Secure mode: you must have WSBManagePermission/set permission for target service endpoint to perform this operation.
  • ADD_RULE: add the filtering rule.
    Secure mode: you must have WSBManagePermission/set permission for target service endpoint to perform this operation.
  • REMOVE_RULE: remove the filtering rule.
    Secure mode: you must have WSBManagePermission/set permission for target service endpoint to perform this operation.
allowedByDefault - decide whether all request are allowed or forbidden by default.
ipFilterRules - filtering rules used by the interceptor. On ADD operation you may pass an array of rules or just leave it null. When performing ADD_RULE or REMOVE_RULE operations just one rule can be passed to this method.
Returns:
on GET operation IP filter info for interceptor associated with target service endpoint is returned. If IP filter interceptor is not installed, then null is returned.
Throws:
AdminServiceException
See Also:
ControlOperations, IPFilterInterceptor

getPackage

public Package getPackage(ServiceInstance serviceInstance)
                   throws AdminServiceException
Get package for given service instance.
Secure mode: you get the package for given service instance only if you have WSConfigPermission/get for that package.

Parameters:
serviceInstance - source service instance.
Returns:
package which hosts the service instance.
Throws:
AdminServiceException

polymorphismControl

public boolean polymorphismControl(ServiceEndpoint serviceEndpoint,
                                   int controlOperation)
                            throws AdminServiceException
Control service endpoint polymorphism support.

Parameters:
serviceEndpoint - target service endpoint.
controlOperation - may be one of the following:
  • GET: determine whether endpoint polymorphism support is enabled.
    Secure mode: you must have WSConfigPermission/get permission for target service endpoint to perform this operation.
  • ENABLE: enable polymorphism support for this endpoint.
    Secure mode: you must have WSConfigPermission/set permission for target service endpoint to perform this operation.
  • DISABLE: disable polymorphism support for this endpoint.
    Secure mode: you must have WSConfigPermission/set permission for target service endpoint to perform this operation.
Returns:
on GET operation returns true if service endpoint polymorphism support is enabled, else it returns false.
Throws:
AdminServiceException
See Also:
ControlOperations