edu.indiana.dde.mylead.client
Class LeadXMLRequest

java.lang.Object
  extended by edu.indiana.dde.mylead.client.LeadXMLRequest

public class LeadXMLRequest
extends java.lang.Object

This class contains methods to build the OGSA-DAI perform documents for the methods contained in the LeadClient class. The parameters included in the body of the perform document are generally passed as parameters and the methods in this class then wrap them in the necessary tags and include the header and footer of the perform document (such as namespace declarations).
The perform documents generated in this class all conform to the leadActivity.xsd schema. Some of the perform document creation has been migrated to the LeadClient class.


Field Summary
static java.lang.String LEAD_XML_HEADER
           
static LeadXMLRequest singletonrequest
           
 
Method Summary
 java.lang.String getAttrDefRequest(java.lang.String dn)
          Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the Lead Attribute definitions query.
 java.lang.String getCreateLeadRequest(java.lang.String dn, java.lang.String leadItem, java.lang.String parentName, java.lang.String parentType)
          Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the Lead create API.
 java.lang.String getCreateReplicaRequest(java.lang.String dn, java.lang.String leadReplica)
          Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the Lead create API.
 java.lang.String getCreateUserRequest(java.lang.String dn, java.lang.String leadUser)
          Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the myLEAD API.
 java.lang.String getDeleteObjectRequest(java.lang.String dn, java.lang.String objectGuid)
          Generate an XML OGSA-DAI perform document conforming to the mylead_delete.xsd schema for the Lead delete API.
 java.lang.String getDeleteReplicaRequest(java.lang.String dn, java.lang.String nickName)
          Generate an XML OGSA-DAI perform document conforming to the mylead_deletereplica.xsd schema for the Lead delete replica API.
 java.lang.String getDeleteReplicaRequest(java.lang.String dn, java.lang.String[] nickNames)
          Generate an XML OGSA-DAI perform document conforming to the mylead_deletereplica.xsd schema for the Lead delete replica API.
 java.lang.String getDeleteUserRequest(java.lang.String dn, java.lang.String userDn)
          Generate an XML OGSA-DAI perform document conforming to the mylead_deleteuser.xsd schema for the Lead delete user API.
static LeadXMLRequest getInstance()
          Get the instance of this singleton object.
 java.lang.String getLeadAddAttrRequest(java.lang.String dn, java.lang.String leadItem, java.lang.String parentName, java.lang.String parentType)
          Generate an XML OGSA-DAI perform document conforming to the code>leadActivity.xsd schema for adding an attribute to an existing myLEAD object.
 java.lang.String getLeadGetNotificationRequest(java.lang.String dn, java.lang.String expName)
          Deprecated. As of version 0.3 Alpha the more general leadQuery method should be used with the TARGET_ATTR filter.
 java.lang.String getLeadGetWorkflowInstRequest(java.lang.String dn, java.lang.String expName)
          Deprecated. As of version 0.3 Alpha the more general leadQuery method should be used with the TARGET_ATTR filter.
 java.lang.String getLeadGetWorkflowTempRequest(java.lang.String dn, java.lang.String invName)
          Deprecated. As of version 0.3 Alpha the more general leadQuery method should be used with the TARGET_ATTR filter.
 java.lang.String getQueryLeadReplicaRequest(java.lang.String dn)
          Generate an XML OGSA-DAI perform document for the replica query API.
 java.lang.String getQueryLeadUserRequest(java.lang.String dn)
          Generate an XML OGSA-DAI perform document conforming to the mylead_queryuser.xsd schema for the user query API.
 java.lang.String getUpdateReplicaRequest(java.lang.String dn, java.lang.String leadReplica)
          Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the replica update API.
 java.lang.String getUpdateUserRequest(java.lang.String dn, java.lang.String leadUser)
          Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for updating a user's profile.
 java.lang.String getUserExistsRequest(java.lang.String dn)
          Generate an XML request for the myLEAD user exists query in the API.
 void init()
          Intializes the singleton LeadXMLRequest object, but the getInstance method should be used to get the request object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEAD_XML_HEADER

public static java.lang.String LEAD_XML_HEADER

singletonrequest

public static LeadXMLRequest singletonrequest
Method Detail

getInstance

public static LeadXMLRequest getInstance()
                                  throws MyLeadException
Get the instance of this singleton object.

Returns:
The singleton instance of LeadXMLRequest generated by the private constructor.
Throws:
MyLeadException

init

public void init()
Intializes the singleton LeadXMLRequest object, but the getInstance method should be used to get the request object.


getUserExistsRequest

public java.lang.String getUserExistsRequest(java.lang.String dn)
Generate an XML request for the myLEAD user exists query in the API. This method wraps the distinguished name of the user in a perform document.

Parameters:
dn - String with the distinguished name of the user.
Returns:
String with the OGSA-DAI perform document.

getQueryLeadReplicaRequest

public java.lang.String getQueryLeadReplicaRequest(java.lang.String dn)
Generate an XML OGSA-DAI perform document for the replica query API. The query can be based on the distinguished name of a specific user to get the myLEAD replica they are assigned to, or an asterisk can be passed to get metadata on all replicas listed in the myLEAD catalog.

Parameters:
dn - String with the user's distinguished name.
Returns:
String containing the OGSA-DAI perform document for this query.

getQueryLeadUserRequest

public java.lang.String getQueryLeadUserRequest(java.lang.String dn)
Generate an XML OGSA-DAI perform document conforming to the mylead_queryuser.xsd schema for the user query API. This query can either return the user-specific contact information for a single user based on the distinguished name passed as a parameter or information on all users if an asterisk is passed for the dn parameter.

Parameters:
dn - String with the user's distinguished name.
Returns:
String containing the OGSA-DAI perform document for this query.

getAttrDefRequest

public java.lang.String getAttrDefRequest(java.lang.String dn)
Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the Lead Attribute definitions query. The attribute definition query will return an XML document that contains the hierarchy of all attributes and elements defined in the myLEAD catalog.

Parameters:
dn - String with the distinguished name of the user making the request.
Returns:
String containing the OGSA-DAI perform document.

getDeleteObjectRequest

public java.lang.String getDeleteObjectRequest(java.lang.String dn,
                                               java.lang.String objectGuid)
Generate an XML OGSA-DAI perform document conforming to the mylead_delete.xsd schema for the Lead delete API.

Parameters:
dn - String with distinguished name of the user deleting the object.
objectGuid - String with the global ID of the collection or file to be deleted (along with any subtree under them).
Returns:
String with the perform document

getDeleteReplicaRequest

public java.lang.String getDeleteReplicaRequest(java.lang.String dn,
                                                java.lang.String nickName)
Generate an XML OGSA-DAI perform document conforming to the mylead_deletereplica.xsd schema for the Lead delete replica API.

Parameters:
dn - String with distinguished name of the user deleting the replica.
nickName - String with the nickname of the replica to be deleted.
Returns:
String with the perform document

getDeleteReplicaRequest

public java.lang.String getDeleteReplicaRequest(java.lang.String dn,
                                                java.lang.String[] nickNames)
Generate an XML OGSA-DAI perform document conforming to the mylead_deletereplica.xsd schema for the Lead delete replica API.

Parameters:
dn - String with distinguished name of the user deleting the replica.
nickNames - Array of Strings with the nicknames of the replica to be deleted.
Returns:
String with the perform document

getDeleteUserRequest

public java.lang.String getDeleteUserRequest(java.lang.String dn,
                                             java.lang.String userDn)
Generate an XML OGSA-DAI perform document conforming to the mylead_deleteuser.xsd schema for the Lead delete user API.

Parameters:
dn - String with distinguished name of the user requesting the deletion.
userDn - String with the dn of the user to be deleted.
Returns:
String with the perform document

getCreateLeadRequest

public java.lang.String getCreateLeadRequest(java.lang.String dn,
                                             java.lang.String leadItem,
                                             java.lang.String parentName,
                                             java.lang.String parentType)
Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the Lead create API. The create method is overloaded to be used for creating myLEAD objects such as files and collections, user profiles, and myLEAD replica definitions. This method generates the perform document for the create method used to add myLEAD objects.

Parameters:
dn - String with distinguished name of the user adding the object.
leadItem - String with wrapped up parameters for the object.
parentName - String with the unique name of the parent of the experiment, collection, or file.
parentType - String with the parent type as defined in the lead_type_definition table.
Returns:
String containing the OGSA-DAI perform document.

getCreateReplicaRequest

public java.lang.String getCreateReplicaRequest(java.lang.String dn,
                                                java.lang.String leadReplica)
Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the Lead create API. The create method is overloaded to be used for creating myLEAD objects such as files and collections, user profiles, and myLEAD replica definitions. This method generates the perform document for the create method used to add a replica definition to the myLEAD catalog.

Parameters:
dn - String with distinguished name of the user defining the replica.
leadReplica - String with wrapped up parameters for the replica record.
Returns:
String containing the OGSA-DAI perform document.
See Also:
MyLeadReplica

getUpdateReplicaRequest

public java.lang.String getUpdateReplicaRequest(java.lang.String dn,
                                                java.lang.String leadReplica)
Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the replica update API.

Parameters:
dn - String with distinguished name of the user updating the replica definition.
leadReplica - String with wrapped up parameters for the replica record.
Returns:
String containing the OGSA-DAI perform document.
See Also:
MyLeadReplica

getCreateUserRequest

public java.lang.String getCreateUserRequest(java.lang.String dn,
                                             java.lang.String leadUser)
Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for the myLEAD API. The create method is overloaded to be used for creating myLEAD objects such as files and collections, user profiles, and myLEAD replica definitions. This method generates the perform document for the create method used to add a user profile to the myLEAD catalog.

Parameters:
dn - String with distinguished name of the existing user who is creating the new user.
leadUser - String with wrapped up parameters for the new user's profile.
Returns:
String containing the OGSA-DAI perform document.
See Also:
MyLeadUser

getUpdateUserRequest

public java.lang.String getUpdateUserRequest(java.lang.String dn,
                                             java.lang.String leadUser)
Generate an XML OGSA-DAI perform document conforming to the leadActivity.xsd schema for updating a user's profile.

Parameters:
dn - String with distinguished name of the user doing the update.
leadUser - String with wrapped up parameters for the user profile.
Returns:
String containing the OGSA-DAI perform document.
See Also:
MyLeadUser

getLeadAddAttrRequest

public java.lang.String getLeadAddAttrRequest(java.lang.String dn,
                                              java.lang.String leadItem,
                                              java.lang.String parentName,
                                              java.lang.String parentType)
Generate an XML OGSA-DAI perform document conforming to the code>leadActivity.xsd schema for adding an attribute to an existing myLEAD object.

Parameters:
dn - String with distinguished name of the user adding the attribute.
leadItem - String with wrapped up attrribute parameters.
parentName - String with the name of the parent object containing the attribute.
parentType - String with the type for the parent as defined in the lead_type_definition table.
Returns:
String containing the OGSA-DAI perform document.
See Also:
MyLeadAttrData

getLeadGetWorkflowTempRequest

public java.lang.String getLeadGetWorkflowTempRequest(java.lang.String dn,
                                                      java.lang.String invName)
Deprecated. As of version 0.3 Alpha the more general leadQuery method should be used with the TARGET_ATTR filter.

Generate an XML request for the myLEAD get workflow template API.

Parameters:
dn - String with distinguished name of the user.
invName - String with the name of the investigation.
Returns:
String

getLeadGetWorkflowInstRequest

public java.lang.String getLeadGetWorkflowInstRequest(java.lang.String dn,
                                                      java.lang.String expName)
Deprecated. As of version 0.3 Alpha the more general leadQuery method should be used with the TARGET_ATTR filter.

Generate an XML request for the myLEAD get workflow instance API.

Parameters:
dn - String with distinguished name of the user.
expName - String with the name of the experiment.
Returns:
String

getLeadGetNotificationRequest

public java.lang.String getLeadGetNotificationRequest(java.lang.String dn,
                                                      java.lang.String expName)
Deprecated. As of version 0.3 Alpha the more general leadQuery method should be used with the TARGET_ATTR filter.

Generate an XML request for the myLEAD get notification API.

Parameters:
dn - String with distinguished name of the user.
expName - String with the name of the experiment.
Returns:
String