org.wso2.carbon.discovery.proxy.util
Class DiscoveryServiceUtils

java.lang.Object
  extended by org.wso2.carbon.discovery.proxy.util.DiscoveryServiceUtils

public class DiscoveryServiceUtils
extends Object

Utility class for adding, updating and removing service artifacts stored in the governance registry. This class directly interacts with the governance API of the Carbon governance components create and manage services discovered through WS-D.


Constructor Summary
DiscoveryServiceUtils()
           
 
Method Summary
static void addService(org.wso2.carbon.discovery.messages.TargetService service, Map<String,String> headerMap)
          Add a discovered target service to the governance registry.
static void deactivateService(org.wso2.carbon.discovery.messages.TargetService targetService)
           
static org.wso2.carbon.discovery.messages.TargetService[] findServices(org.wso2.carbon.discovery.messages.Probe probe)
          Search the service artifacts stored in the registry and find the set of services that satisfy the conditions stated in the given WS-D probe.
static org.wso2.carbon.discovery.messages.TargetService getService(org.apache.axis2.addressing.EndpointReference epr)
          Find the WS-D target service identified by the given WS-D identifier.
static void remove(org.wso2.carbon.discovery.messages.TargetService service)
           
static void removeServiceEndpoints(org.wso2.carbon.discovery.messages.TargetService service)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiscoveryServiceUtils

public DiscoveryServiceUtils()
Method Detail

addService

public static void addService(org.wso2.carbon.discovery.messages.TargetService service,
                              Map<String,String> headerMap)
                       throws Exception
Add a discovered target service to the governance registry. This method will also create the endpoint artifacts for the service and attach them with the related service artifacts. The service artifact will be given an auto generated name.

Parameters:
service - WS-D target service to be added to the registry
Throws:
Exception - if an error occurs while saving the artifacts to the registry

deactivateService

public static void deactivateService(org.wso2.carbon.discovery.messages.TargetService targetService)
                              throws Exception
Throws:
Exception

removeServiceEndpoints

public static void removeServiceEndpoints(org.wso2.carbon.discovery.messages.TargetService service)
                                   throws Exception
Throws:
Exception

remove

public static void remove(org.wso2.carbon.discovery.messages.TargetService service)
                   throws Exception
Throws:
Exception

getService

public static org.wso2.carbon.discovery.messages.TargetService getService(org.apache.axis2.addressing.EndpointReference epr)
                                                                   throws Exception
Find the WS-D target service identified by the given WS-D identifier.

Parameters:
epr - WS-D service identifier
Returns:
a TargetService instance with the given ID or null if no such service exists
Throws:
Exception - if an error occurs while accessing the registry

findServices

public static org.wso2.carbon.discovery.messages.TargetService[] findServices(org.wso2.carbon.discovery.messages.Probe probe)
                                                                       throws Exception
Search the service artifacts stored in the registry and find the set of services that satisfy the conditions stated in the given WS-D probe. If the probe does not impose any restrictions on the result set, all the services in the registry will be returned.

Parameters:
probe - a WS-D probe describing the search criteria
Returns:
an array of TargetService instances matching the probe or null
Throws:
Exception - if an error occurs while accessing the registry


Copyright © 2015 WSO2. All rights reserved.