uk.ac.soton.itinnovation.grid.types
Class ConversationID
java.lang.Object
uk.ac.soton.itinnovation.grid.types.ConversationID
public abstract class ConversationID
- extends Object
Utility class for handling EPRs.
This class contains methods to create, update and query EPRs. In particular, it
handles the label and resource ID elements used by the GRIA services.
|
Method Summary |
static void |
addAdditionalToken(org.apache.axis.message.addressing.EndpointReferenceType EPR,
Element token)
Add a security token to the EPR's metadata. |
static void |
addKeyInfo(org.apache.axis.message.addressing.EndpointReferenceType EPR,
X509Certificate serverCert)
Add the service's key information. |
static void |
cleanMetadata(org.apache.axis.message.addressing.EndpointReferenceType epr)
|
static MessageElement[] |
getAdditionalTokens(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get all extra security tokens. |
static String |
getConversationFromEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Returns the ConversationID from an EPR, or null if there isn't one. |
static String |
getConversationFromParameters(org.apache.axis.message.addressing.ReferenceParametersType refParams)
Get a resource ID. |
static String |
getDefaultSLA(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the resource default sla (if any) from the EPR's metadata. |
static org.apache.axis.message.addressing.EndpointReferenceType |
getEPR(org.apache.axis.message.addressing.AttributedURI endpoint,
String conversationID)
Construct an EPR with the given address and resource ID. |
static org.apache.axis.message.addressing.EndpointReferenceType |
getEPR(String URLreference)
Split URLreference at the '#' and use the fragment as the resource ID. |
static org.apache.axis.message.addressing.EndpointReferenceType |
getEPR(URL endpoint,
String conversationID)
Construct an EPR with the given address and resource ID. |
static org.apache.axis.message.addressing.EndpointReferenceType |
getEPR(URL endpoint,
String conversationID,
String label)
Create a new EPR. |
static X509Certificate |
getKeyInfo(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the service's certificate. |
static MessageElement |
getKeyInfo(X509Certificate serverCert)
Gets a MessageElement containing the service provider's key information. |
static String |
getLabel(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the human-readable label (if any) from the EPR's metadata. |
static String |
getManagingResource(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the managing resource (if any) from the EPR's metadata. |
static String |
getMeta(org.apache.axis.message.addressing.EndpointReferenceType EPR,
QName key)
Return the string contents of the first metadata element with the
given name. |
static URL |
getParent(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the parent object's URL |
static String |
getPullPoint(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the pull-point (if any) from the EPR's metadata. |
static String |
getResourceStatus(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the resource status (if any) from the EPR's metadata. |
static String |
getResourceType(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the resource type (if any) from the EPR's metadata. |
static String |
getType(org.apache.axis.message.addressing.EndpointReferenceType EPR)
Get the resource type (if any) from the EPR's metadata. |
static String |
getURLFromEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
|
static String |
getURLReferenceFromEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
|
static org.apache.axis.message.addressing.EndpointReferenceType |
sanitised(org.apache.axis.message.addressing.EndpointReferenceType source)
Return a minimal EPR with just the endpoint, conversation ID and KeyInfo fields. |
static void |
setDefaultSLA(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String sla)
Set the default SLA in the EPR's metadata. |
static void |
setLabel(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String label)
|
static void |
setManagingResource(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String managingResource)
Set the managing resource in the EPR's metadata. |
static void |
setMeta(org.apache.axis.message.addressing.EndpointReferenceType EPR,
QName key,
String value)
Set a meta-data element to the given value. |
static void |
setParent(org.apache.axis.message.addressing.EndpointReferenceType EPR,
URL parent)
Set the RESOURCE_PARENT metadata element to this value. |
static void |
setPullPoint(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String pullpoint)
Set the pull-point in the EPR's metadata. |
static void |
setResourceStatus(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String type)
Set the resource status in the EPR's metadata. |
static void |
setResourceType(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String type)
Set the resource type in the EPR's metadata. |
static void |
setType(org.apache.axis.message.addressing.EndpointReferenceType EPR,
Class type)
Set the resource type in the EPR's metadata. |
static void |
setType(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String type)
Set the type in the EPR's metadata. |
static boolean |
updateMetadata(org.apache.axis.message.addressing.EndpointReferenceType EPR,
org.apache.axis.message.addressing.EndpointReferenceType newEPR)
Updates an EPR with values from newEPR. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GRID_NS
public static final String GRID_NS
- XML namespace for some of our elements.
- See Also:
- Constant Field Values
GRID_NS_2007
public static final String GRID_NS_2007
- See Also:
- Constant Field Values
XMLNS_OGSA_BP
public static final String XMLNS_OGSA_BP
- OGSA Basic Profile.
Basic Security Profile 1.0 - Core
January 31, 2006
- See Also:
- Constant Field Values
ADDITIONAL_SECURITY_TOKEN
public static final QName ADDITIONAL_SECURITY_TOKEN
- Used in EPR's Metadata and in
SubjectDescription to hold a security token.
BILLING_INFO
public static final QName BILLING_INFO
- The name of the SOAP header containing an account or SLA. This is typically used
when creating a new resource, to indicate where usage of the resource should be reported.
ITI_CONVERSATION_NAME
public static final PrefixedQName ITI_CONVERSATION_NAME
- The SOAP header element that identifies the primary context.
getConversationFromEPR
public static String getConversationFromEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Returns the ConversationID from an EPR, or null if there isn't one.
getURLFromEPR
public static String getURLFromEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
getURLReferenceFromEPR
public static String getURLReferenceFromEPR(org.apache.axis.message.addressing.EndpointReferenceType EPR)
getConversationFromParameters
public static String getConversationFromParameters(org.apache.axis.message.addressing.ReferenceParametersType refParams)
- Get a resource ID.
- Parameters:
refParams - the reference parameters from an EPR to check
- Returns:
- the value of the first
ITI_CONVERSATION_NAME reference parameter, or
null if there isn't one
getEPR
public static org.apache.axis.message.addressing.EndpointReferenceType getEPR(URL endpoint,
String conversationID)
- Construct an EPR with the given address and resource ID.
- Parameters:
endpoint - the service endpoint addressconversationID - the value for the resource ID reference parameter
getEPR
public static org.apache.axis.message.addressing.EndpointReferenceType getEPR(org.apache.axis.message.addressing.AttributedURI endpoint,
String conversationID)
- Construct an EPR with the given address and resource ID.
- Parameters:
endpoint - the service endpoint addressconversationID - the value for the resource ID reference parameter
getEPR
public static org.apache.axis.message.addressing.EndpointReferenceType getEPR(String URLreference)
- Split URLreference at the '#' and use the fragment as the resource ID.
If there is no '#' in the URL, the resulting EPR won't contain a resource ID.
getEPR
public static org.apache.axis.message.addressing.EndpointReferenceType getEPR(URL endpoint,
String conversationID,
String label)
- Create a new EPR.
The conversationID is stored as a reference parameter.
If label is given, it is stored as a Dublin Core Title element in the EPR's
metadata.
- Parameters:
endpoint - the address of the service endpointconversationID - the unique ID identifying this resourcelabel - a human-readable name for the resource, or null.
getLabel
public static String getLabel(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the human-readable label (if any) from the EPR's metadata.
- Returns:
- the label, or null if there isn't one.
setLabel
public static void setLabel(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String label)
getParent
public static URL getParent(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the parent object's URL
- Returns:
- the parent's URL, or null if there isn't one.
setParent
public static void setParent(org.apache.axis.message.addressing.EndpointReferenceType EPR,
URL parent)
- Set the
RESOURCE_PARENT metadata element to this value.
Used by the GRIA client to record parent-child relationships between EPRs,
for example.
- Parameters:
EPR - the EPR to modifyparent - the URL Reference of the parent (in the form "service#resource")- See Also:
getEPR(String)
getDefaultSLA
public static String getDefaultSLA(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the resource default sla (if any) from the EPR's metadata.
- Returns:
- the type, or null if there isn't one.
setDefaultSLA
public static void setDefaultSLA(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String sla)
- Set the default SLA in the EPR's metadata.
getResourceStatus
public static String getResourceStatus(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the resource status (if any) from the EPR's metadata.
- Returns:
- the status, or null if there isn't one.
setResourceStatus
public static void setResourceStatus(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String type)
- Set the resource status in the EPR's metadata.
getResourceType
public static String getResourceType(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the resource type (if any) from the EPR's metadata.
- Returns:
- the type, or null if there isn't one.
setResourceType
public static void setResourceType(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String type)
- Set the resource type in the EPR's metadata.
getType
public static String getType(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the resource type (if any) from the EPR's metadata.
This type is used only by the client.
- Returns:
- the type, or null if there isn't one.
setType
public static void setType(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String type)
- Set the type in the EPR's metadata.
setType
public static void setType(org.apache.axis.message.addressing.EndpointReferenceType EPR,
Class type)
- Set the resource type in the EPR's metadata.
getManagingResource
public static String getManagingResource(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the managing resource (if any) from the EPR's metadata.
- Returns:
- the URI-reference for the resource, or null if there isn't one.
setManagingResource
public static void setManagingResource(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String managingResource)
- Set the managing resource in the EPR's metadata.
- Parameters:
managingResource - the ID (in the form http://service/...#ConversationID) of the managing resource
getKeyInfo
public static X509Certificate getKeyInfo(org.apache.axis.message.addressing.EndpointReferenceType EPR)
throws org.apache.ws.security.WSSecurityException
- Get the service's certificate.
- Returns:
- the certificate, or null if the EPR doesn't give it
- Throws:
org.apache.ws.security.WSSecurityException
getKeyInfo
public static MessageElement getKeyInfo(X509Certificate serverCert)
- Gets a MessageElement containing the service provider's key information.
- Parameters:
serverCert - the servers X509 Certificate
- Returns:
- a MessageElement containing the service provider's key
addKeyInfo
public static void addKeyInfo(org.apache.axis.message.addressing.EndpointReferenceType EPR,
X509Certificate serverCert)
- Add the service's key information.
This is used to store the X.509 certificate of the service, so that clients
can check the signature, even if the service's certificate isn't globally trusted
by them.
getPullPoint
public static String getPullPoint(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get the pull-point (if any) from the EPR's metadata.
- Returns:
- the type, or null if there isn't one.
setPullPoint
public static void setPullPoint(org.apache.axis.message.addressing.EndpointReferenceType EPR,
String pullpoint)
- Set the pull-point in the EPR's metadata.
getAdditionalTokens
public static MessageElement[] getAdditionalTokens(org.apache.axis.message.addressing.EndpointReferenceType EPR)
- Get all extra security tokens.
Returns an array of metadata elements with the QName
ADDITIONAL_SECURITY_TOKEN.
- Returns:
- an array containing all metadata elements which are additional tokens
- See Also:
addAdditionalToken(org.apache.axis.message.addressing.EndpointReferenceType, org.w3c.dom.Element)
addAdditionalToken
public static void addAdditionalToken(org.apache.axis.message.addressing.EndpointReferenceType EPR,
Element token)
- Add a security token to the EPR's metadata.
This token may be useful to security systems checking a user's
access to the EPR.
getMeta
public static String getMeta(org.apache.axis.message.addressing.EndpointReferenceType EPR,
QName key)
- Return the string contents of the first metadata element with the
given name.
- Parameters:
EPR - the EPR to searchkey - the name of the meta-data element
updateMetadata
public static boolean updateMetadata(org.apache.axis.message.addressing.EndpointReferenceType EPR,
org.apache.axis.message.addressing.EndpointReferenceType newEPR)
- Updates an EPR with values from newEPR.
If an element doesnt exist in the EPR metadata and exists in the newERP it is added,
If an element exists in both EPR, the newEPR value is used
- Parameters:
EPR - the EPR to updatenewEPR - the EndpointReferenceType with new values
- Returns:
- boolean value if the EPR was updated
setMeta
public static void setMeta(org.apache.axis.message.addressing.EndpointReferenceType EPR,
QName key,
String value)
- Set a meta-data element to the given value.
If an element with this key already exists, its contents are replaced with this value.
- Parameters:
EPR - the EPR to modifykey - the name of the meta-data element to create or updatevalue - the new value for the element
cleanMetadata
public static void cleanMetadata(org.apache.axis.message.addressing.EndpointReferenceType epr)
sanitised
public static org.apache.axis.message.addressing.EndpointReferenceType sanitised(org.apache.axis.message.addressing.EndpointReferenceType source)
- Return a minimal EPR with just the endpoint, conversation ID and KeyInfo fields.
Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.