|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.indiana.extreme.lead.resource_catalog.client.util.ServiceCatalogUtil
public class ServiceCatalogUtil
Utility for a client to invoke methods in the resource catalog to manage workflow and web-service related entries. The resource catalog stores 3 types of documents related to registered web-services: the Service Map (SM), the Abstract WSDL (AWSDL) and the Concrete WSDL (CWSDL).
The resource catalog service uses an XML database to store the SM, AWSDL, and CWSDL documents. It provides wrapper APIs for standard functions such as adding, removing, and querying for these documents using their QNames. It also provides an XQuery API for performing more complex queries. The catalog stores these 3 types of documents in 3 separate collections within the XML database. These collections can be refered to in the XQuery using the special strings $SM_COLLECTION, $AWSDL_COLLECTION, and $CWSDL_COLLECTION respectively for the SM, AWSDL, and CWSDL documents.
The resource catalog supports lifetime management of the CWSDL documents stored in it. Every CWSDL document registered in the catalog requests a lifetime for the document. If the requested lifetime is outside the catalog's bounds, it assigns a lifetime greater than or less than the requested lifetime and returns this with the call to register the CWSDL. The client is responsible for renewing this lifetime of the CWSDL while the service is valid. Once the lifetime of the CWSDL expires, the resource catalog is free to delete this CWSDL when it next runs its garbage collector. The renewal should be done a couple of minutes before the assigned lifetime expires to account for transport and processing time. Note that the lifetime calculation is free from clock skew or timezones since it is always calculated with relative to the current time.
| Nested Class Summary | |
|---|---|
static class |
ServiceCatalogUtil.CollectionHolder
|
| Field Summary | |
|---|---|
static java.lang.String |
RESCAT_NS
|
static java.lang.String |
WSDL_NS
|
| Constructor Summary | |
|---|---|
ServiceCatalogUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getAbstractWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method getAbstractWsdl. |
static java.lang.String |
getAppDesc(ResourceCatalogPortType stub,
javax.xml.namespace.QName appName,
java.lang.String hostName)
Method getAppDesc. |
static java.lang.String |
getConcreteWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method getGetConcreteWsdl. |
static java.lang.String[] |
getConcreteWsdlByAbstractWsdlQName(ResourceCatalogPortType stub,
javax.xml.namespace.QName awsdlQName)
Method getConcreteWsdlByAbstractWsdlQName. |
static java.lang.String |
getHostDesc(ResourceCatalogPortType stub,
java.lang.String hostName)
Method getHostDesc. |
static java.lang.String |
getServiceMap(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method getServiceMap. |
static WsdlSummaryDocument.WsdlSummary[] |
listAbstractWsdls(ResourceCatalogPortType stub)
Method listAbstractWsdls. |
static java.lang.String[] |
performXQuery(ResourceCatalogPortType stub,
java.lang.String xquery)
Method performXQuery. |
static void |
registerAbstractWsdl(ResourceCatalogPortType stub,
java.lang.String awsdlStr)
Method registerAbstractWsdl. |
static void |
registerAppDesc(ResourceCatalogPortType stub,
java.lang.String appDescStr)
Method registerAppDesc. |
static long |
registerConcreteWsdl(ResourceCatalogPortType stub,
java.lang.String cwsdlStr,
long lifetimeMins)
Method registerConcreteWsdl. |
static void |
registerHostDesc(ResourceCatalogPortType stub,
java.lang.String hostDescStr)
Method registerHostDesc. |
static void |
registerServiceMap(ResourceCatalogPortType stub,
java.lang.String smStr,
java.lang.String awsdlStr)
Method registerServiceMap. |
static void |
removeAbstractWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method removeAbstractWsdl. |
static void |
removeAppDesc(ResourceCatalogPortType stub,
javax.xml.namespace.QName appName,
java.lang.String hostName)
Method removeAppDesc. |
static void |
removeConcreteWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method removeConcreteWsdl. |
static void |
removeConcreteWsdlByAbstractWsdlQName(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method removeConcreteWsdlByAbstractWsdlQName. |
static void |
removeHostDesc(ResourceCatalogPortType stub,
java.lang.String hostName)
Method removeHostDesc. |
static void |
removeServiceMap(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
Method removeServiceMap. |
static long |
renewConcreteWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query,
long lifetimeMins)
Method renewConcreteWsdl. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String WSDL_NS
public static final java.lang.String RESCAT_NS
| Constructor Detail |
|---|
public ServiceCatalogUtil()
| Method Detail |
|---|
public static void registerServiceMap(ResourceCatalogPortType stub,
java.lang.String smStr,
java.lang.String awsdlStr)
stub - a wrapper to a ResourceCatalog webservicesmStr - a ServiceMap doc as StringawsdlStr - a AWSDL document as String
public static java.lang.String getServiceMap(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a the QName uniquely identifying a SM doc. This is
given by the namespace /ServiceMap/service/serviceName/@targetNamespace and local name
/ServiceMap/service/serviceName
public static void removeServiceMap(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a the QName uniquely identifying a SM doc. This is
given by the namespace /ServiceMap/service/serviceName/@targetNamespace and local name
/ServiceMap/service/serviceName
public static void registerHostDesc(ResourceCatalogPortType stub,
java.lang.String hostDescStr)
stub - a wrapper to a ResourceCatalog webservicehostDescStr - a HostDescription XML document as a string
public static java.lang.String getHostDesc(ResourceCatalogPortType stub,
java.lang.String hostName)
stub - a wrapper to a ResourceCatalog webservicehostName - the hostname that uniquely identifies the hostDecs doc. This is
the /HostDescription/hostName element in the HostDesc doc.
public static void removeHostDesc(ResourceCatalogPortType stub,
java.lang.String hostName)
stub - a wrapper to a ResourceCatalog webservicehostName - the hostname that uniquely identifies the hostDecs doc. This is
the /HostDescription/hostName element in the HostDesc doc.
public static void registerAppDesc(ResourceCatalogPortType stub,
java.lang.String appDescStr)
stub - a wrapper to a ResourceCatalog webserviceappDescStr - a ApplicationDescription XML document as a string
public static java.lang.String getAppDesc(ResourceCatalogPortType stub,
javax.xml.namespace.QName appName,
java.lang.String hostName)
stub - a wrapper to a ResourceCatalog webserviceappName - the appName that partly identifies the appDesc doc. This is
the {/ApplicationDescription/applicationName/@targetNamespace}/ApplicationDescription/applicationName
element in the AppDesc doc.hostName - the hostname that partly identifies the appDesc doc. This is
the /ApplicationDescription/deploymentDescription/hostName element in the AppDesc doc.
public static void removeAppDesc(ResourceCatalogPortType stub,
javax.xml.namespace.QName appName,
java.lang.String hostName)
stub - a wrapper to a ResourceCatalog webserviceappName - the appName that partly identifies the appDesc doc. This is
the {/ApplicationDescription/applicationName/@targetNamespace}/ApplicationDescription/applicationName
element in the AppDesc doc.hostName - the hostname that partly identifies the appDesc doc. This is
the /ApplicationDescription/deploymentDescription/hostName element in the AppDesc doc.
public static void registerAbstractWsdl(ResourceCatalogPortType stub,
java.lang.String awsdlStr)
stub - a wrapper to a ResourceCatalog webserviceawsdlStr - a String containg the AWSDL XML doc.
public static java.lang.String getAbstractWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a AWSDL doc. This is
given by the namespace /definitions/@targetNamespace and local name
/definitions/@name
public static WsdlSummaryDocument.WsdlSummary[] listAbstractWsdls(ResourceCatalogPortType stub)
stub - a wrapper to a ResourceCatalog webservice
public static void removeAbstractWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a AWSDL doc. This is
given by the namespace /definitions/@targetNamespace and local name
/definitions/@name
public static long registerConcreteWsdl(ResourceCatalogPortType stub,
java.lang.String cwsdlStr,
long lifetimeMins)
stub - a wrapper to a ResourceCatalog webservicecwsdlStr - a String representing the CWSL Xml doclifetimeMins - the lifetime (in minutes from current time) requested for the
cwsdl document. The actual lifetime assigned is returned. Unless renewed,
after the expiration of this assigned lifetime, the cwsdl document will be deleted
when the next garbage collection run takes place in the resource catalog.
public static long renewConcreteWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query,
long lifetimeMins)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a CWSDL doc. This is
given by the namespace /definitions/@targetNamespace and local name
/definitions/@namelifetimeMins - the lifetime (in minutes from current time) requested for the
cwsdl document. The actual lifetime assigned is returned. Unless renewed again,
after the expiration of this assigned lifetime, the cwsdl document will be deleted
when the next garbage collection run takes place in the resource catalog.
public static java.lang.String getConcreteWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a CWSDL doc. This is
given by the namespace /definitions/@targetNamespace and local name
/definitions/@name
public static java.lang.String[] getConcreteWsdlByAbstractWsdlQName(ResourceCatalogPortType stub,
javax.xml.namespace.QName awsdlQName)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a AWSDL doc whose CWSDLs need to
be returned. This is QName is matched in the CWSDLs with the namespace in
/definitions/@targetNamespace and the local name in /definitions/portType/@name
public static void removeConcreteWsdl(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a CWSDL doc to be deleted. This is
given by the namespace /definitions/@targetNamespace and local name
/definitions/@name
public static void removeConcreteWsdlByAbstractWsdlQName(ResourceCatalogPortType stub,
javax.xml.namespace.QName query)
stub - a wrapper to a ResourceCatalog webservicequery - a QName uniquely identifying a AWSDL doc whose CWSDLs need to
be deleted. This is QName is matched in the CWSDLs with the namespace in
/definitions/@targetNamespace and the local name in /definitions/portType/@name
public static java.lang.String[] performXQuery(ResourceCatalogPortType stub,
java.lang.String xquery)
declare namespace wsdl='http://schemas.xmlsoap.org/wsdl/';
for $cwsdl_doc in collection('$CWSDL_COLLECTION')/wsdl:definitions
where $cwsdl_doc/@targetNamespace='http://tempuri.org' and $cwsdl_doc/@name='TestService'
return $cwsdl_doc
XQuery functions such as contains, matches, starts-with, ends-with, lower-case, upper-case,
etc. can also be used, either prefized by the "fn" namespace prefix, or without a namespace
prefix. For more examples of XQueries, see ResourceCatalogClient.testXQueryAPI().
stub - a wrapper to a ResourceCatalog webservicexquery - a String containing the XQuery to execute at on the resource
catalog
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||