Package org.dlese.dpc.ndr.request
Class NdrRequest
java.lang.Object
org.dlese.dpc.ndr.request.SimpleNdrRequest
org.dlese.dpc.ndr.request.NdrRequest
- Direct Known Subclasses:
CountMembersRequest,FindRequest,ListMembersRequest,SignedNdrRequest
Class to communiate directly with NDR via
NDRConnection.
Builds the inputXML parameter that is sent as part a POST request.- Version:
- $Id: NdrRequest.java,v 1.18 2010/05/28 19:16:43 ostwald Exp $
- Author:
- Jonathan Ostwald
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InputXMLNOT YET DOCUMENTEDprotected NDRConstants.NDRObjectTypeNOT YET DOCUMENTEDprotected StringFields inherited from class org.dlese.dpc.ndr.request.SimpleNdrRequest
handle, requestAgent, verb, verbose -
Constructor Summary
ConstructorsConstructorDescriptionConstructor for the NdrRequest objectNdrRequest(String verb) Constructor for the NdrRequest object with specified verb.NdrRequest(String verb, String handle) Constructor for the NdrRequest object with specified verb and handle. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(String type, String prop, String value) Adds a command specified as a prop and value pair of the specified type.voidaddCommand(String type, String prop, String value, String action) Adds a command specified as a prop and value pair of the specified type and action.voidaddCommand(String type, org.dom4j.Element element) Adds a command represented as an Element of the specified type.voidaddCommand(String type, org.dom4j.Element element, String action) Adds a command represented as an Element of the specified type and with the specified action.voidaddDataStreamCmd(String format, org.dom4j.Element content) Adds a datastream command to the data component with given datastream of specified format (e.g., "ndsl_dc");voidaddDataStreamCmd(String format, org.dom4j.Element content, String action) Adds a datastream command to the data component with given datastream of specified format (e.g., "ndsl_dc");voidaddDCStreamCmd(org.dom4j.Element oai_dc) Adds a feature to the DCStreamCmd attribute of the NdrRequest objectvoidaddDleseCommand(String type, String prop, String value) Adds a feature to the DleseCommand attribute of the NdrRequest objectvoidaddDleseCommand(String type, String prop, String value, String action) Adds a feature to the DleseCommand attribute of the NdrRequest objectvoidaddNativeDataStreamCmd(String format, org.dom4j.Element content) voidaddNativeDataStreamCmd(String format, org.dom4j.Element content, String action) voidaddNcsPropertyCmd(String prop, String value) Adds a property command with the specified property belonging to the dlese namespace.voidaddNcsPropertyCmd(String prop, String value, String action) Adds a property command with the specified property belonging to the dlese namespace.voidaddNcsRelationshipCmd(String prop, String value) Adds a feature to the NcsRelationshipCmd attribute of the NdrRequest objectvoidaddNcsRelationshipCmd(String prop, String value, String action) Adds a property command with the specified property belonging to the dlese namespace.voidaddOaiVisibilityCmd(NDRConstants.OAIVisibilty visibility) Adds a feature to the OaiVisibilityCmd attribute of the NdrRequest objectvoidaddOaiVisibilityCmd(NDRConstants.OAIVisibilty visibility, String action) Adds a feature to the OaiVisibilityCmd attribute of the NdrRequest objectvoidaddQualifiedCommand(org.dom4j.Namespace namespace, String type, String prop, String value) Adds a feature to the QualifiedCommand attribute of the NdrRequest objectvoidaddQualifiedCommand(org.dom4j.Namespace namespace, String type, String prop, String value, String action) Adds a feature to the QualifiedCommand attribute of the NdrRequest objectvoidaddServiceDescriptionCmd(org.dom4j.Element content) Adds a serviceDescription command to the data element.voidaddServiceDescriptionCmd(org.dom4j.Element content, String action) Adds a feature to the ServiceDescriptionCmd attribute of the NdrRequest objectvoidAdds a feature to the StateCmd attribute of the NdrRequest objectvoidaddStateCmd(NDRConstants.ObjectState state, String action) Adds a feature to the StateCmd attribute of the NdrRequest objectprotected InputXMLComponentgetComponent(String type) Gets the component of specified type ("property", "data", "relationship" from the InfoXML instance, if it exists.Gets theinputXMLattribute of the NdrRequest object, which stores the commands for this request.protected NDRConnectiongetNDRConnection(String path, String inputXMLStr) Creates connection and adds payload in the form of inputXML parameter.Gets the objectType attribute of the NdrRequest objectprotected StringA human readable representation of the XMLInput payload of the request.voidNOT YET DOCUMENTEDvoidsetDataInfoStream(String format, org.dom4j.Element info) Sets the dataInfoStream attribute of the NdrRequest objectvoidsetObjectType(NDRConstants.NDRObjectType objectType) Sets the objectType attribute of the NdrRequest objectsubmit()NOT YET DOCUMENTEDNOT YET DOCUMENTEDMethods inherited from class org.dlese.dpc.ndr.request.SimpleNdrRequest
getDebug, getHandle, getNDRConnection, getRequestAgent, getVerb, getVerbose, makePath, pp, prtln, prtlnErr, report, setDebug, setHandle, setRequestAgent, setVerb, setVerbose
-
Field Details
-
inputXML
NOT YET DOCUMENTED -
objectType
NOT YET DOCUMENTED -
payload
-
-
Constructor Details
-
NdrRequest
public NdrRequest()Constructor for the NdrRequest object -
NdrRequest
Constructor for the NdrRequest object with specified verb.- Parameters:
verb- NOT YET DOCUMENTED
-
NdrRequest
Constructor for the NdrRequest object with specified verb and handle.- Parameters:
verb- NOT YET DOCUMENTEDhandle- NOT YET DOCUMENTED
-
-
Method Details
-
getInputXML
Gets theinputXMLattribute of the NdrRequest object, which stores the commands for this request.- Returns:
- The inputXML value
-
getPayload
A human readable representation of the XMLInput payload of the request.- Returns:
- The payload value
-
setObjectType
Sets the objectType attribute of the NdrRequest object- Parameters:
objectType- The new objectType value
-
getObjectType
Gets the objectType attribute of the NdrRequest object- Returns:
- The objectType value
-
getComponent
Gets the component of specified type ("property", "data", "relationship" from the InfoXML instance, if it exists.- Parameters:
type- NOT YET DOCUMENTED- Returns:
- The component value
- Throws:
Exception- If inputXML does not exist or the specified type is unknown
-
addCommand
Adds a command represented as an Element of the specified type.- Parameters:
type- command type ("property", "relationship", or "data")element- command represented as Element.
-
addCommand
Adds a command represented as an Element of the specified type and with the specified action.- Parameters:
type- The feature to be added to the Command attributeelement- The feature to be added to the Command attributeaction- specifies command action ("delete", "add")
-
addCommand
Adds a command specified as a prop and value pair of the specified type.- Parameters:
type- The feature to be added to the Command attributeprop- The feature to be added to the Command attributevalue- The feature to be added to the Command attribute
-
addCommand
Adds a command specified as a prop and value pair of the specified type and action.- Parameters:
type- The feature to be added to the Command attributeprop- The feature to be added to the Command attributevalue- The feature to be added to the Command attributeaction- The feature to be added to the Command attribute
-
addNcsPropertyCmd
Adds a property command with the specified property belonging to the dlese namespace.- Parameters:
prop- The feature to be added to the NcsProperty attributevalue- The feature to be added to the NcsProperty attribute
-
addNcsPropertyCmd
Adds a property command with the specified property belonging to the dlese namespace.- Parameters:
prop- The feature to be added to the NcsProperty attributevalue- The feature to be added to the NcsProperty attributeaction- The feature to be added to the NcsProperty attribute
-
addNcsRelationshipCmd
Adds a feature to the NcsRelationshipCmd attribute of the NdrRequest object- Parameters:
prop- The feature to be added to the NcsRelationshipCmd attributevalue- The feature to be added to the NcsRelationshipCmd attribute
-
addNcsRelationshipCmd
Adds a property command with the specified property belonging to the dlese namespace.- Parameters:
prop- The feature to be added to the NcsProperty attributevalue- The feature to be added to the NcsProperty attributeaction- The feature to be added to the NcsProperty attribute
-
addDleseCommand
Adds a feature to the DleseCommand attribute of the NdrRequest object- Parameters:
type- The feature to be added to the DleseCommand attributeprop- The feature to be added to the DleseCommand attributevalue- The feature to be added to the DleseCommand attribute
-
addDleseCommand
Adds a feature to the DleseCommand attribute of the NdrRequest object- Parameters:
type- The feature to be added to the DleseCommand attributeprop- The feature to be added to the DleseCommand attributevalue- The feature to be added to the DleseCommand attributeaction- The feature to be added to the DleseCommand attribute
-
addQualifiedCommand
public void addQualifiedCommand(org.dom4j.Namespace namespace, String type, String prop, String value) Adds a feature to the QualifiedCommand attribute of the NdrRequest object- Parameters:
namespace- The feature to be added to the QualifiedCommand attributetype- The feature to be added to the QualifiedCommand attributeprop- The feature to be added to the QualifiedCommand attributevalue- The feature to be added to the QualifiedCommand attribute
-
addQualifiedCommand
public void addQualifiedCommand(org.dom4j.Namespace namespace, String type, String prop, String value, String action) Adds a feature to the QualifiedCommand attribute of the NdrRequest object- Parameters:
namespace- The feature to be added to the QualifiedCommand attributetype- The feature to be added to the QualifiedCommand attributeprop- The feature to be added to the QualifiedCommand attributevalue- The feature to be added to the QualifiedCommand attributeaction- The feature to be added to the QualifiedCommand attribute
-
addNativeDataStreamCmd
- Throws:
Exception
-
addNativeDataStreamCmd
public void addNativeDataStreamCmd(String format, org.dom4j.Element content, String action) throws Exception - Throws:
Exception
-
addDataStreamCmd
Adds a datastream command to the data component with given datastream of specified format (e.g., "ndsl_dc");- Parameters:
format- format of the datastreamcontent- datastream represented as Element- Throws:
Exception- If inputXML does not exist or content element is null
-
addDataStreamCmd
public void addDataStreamCmd(String format, org.dom4j.Element content, String action) throws Exception Adds a datastream command to the data component with given datastream of specified format (e.g., "ndsl_dc");- Parameters:
format- The feature to be added to the DataStreamCmd attributecontent- The feature to be added to the DataStreamCmd attributeaction- The feature to be added to the DataStreamCmd attribute- Throws:
Exception- If inputXML does not exist or content element is null
-
setDataInfoStream
Sets the dataInfoStream attribute of the NdrRequest object- Parameters:
format- The new dataInfoStream valueinfo- The new dataInfoStream value- Throws:
Exception- NOT YET DOCUMENTED
-
addServiceDescriptionCmd
Adds a serviceDescription command to the data element.- Parameters:
content- ServiceDescription as Element- Throws:
Exception- if inputXML does not exist
-
addStateCmd
Adds a feature to the StateCmd attribute of the NdrRequest object- Parameters:
state- The feature to be added to the StateCmd attribute
-
addStateCmd
Adds a feature to the StateCmd attribute of the NdrRequest object- Parameters:
state- The feature to be added to the StateCmd attributeaction- The feature to be added to the StateCmd attribute
-
addOaiVisibilityCmd
Adds a feature to the OaiVisibilityCmd attribute of the NdrRequest object- Parameters:
visibility- The feature to be added to the OaiVisibilityCmd attribute
-
addOaiVisibilityCmd
Adds a feature to the OaiVisibilityCmd attribute of the NdrRequest object- Parameters:
visibility- The feature to be added to the OaiVisibilityCmd attributeaction- The feature to be added to the OaiVisibilityCmd attribute
-
addServiceDescriptionCmd
Adds a feature to the ServiceDescriptionCmd attribute of the NdrRequest object- Parameters:
content- The feature to be added to the ServiceDescriptionCmd attributeaction- The feature to be added to the ServiceDescriptionCmd attribute- Throws:
Exception- if inputXML does not exist
-
addDCStreamCmd
Adds a feature to the DCStreamCmd attribute of the NdrRequest object- Parameters:
oai_dc- The feature to be added to the DCStreamCmd attribute- Throws:
Exception- NOT YET DOCUMENTED
-
getNDRConnection
Creates connection and adds payload in the form of inputXML parameter.Payload is the request objects's inputXML attribute, which is overidden by the inputXMLStr parameter if present. This allows a caller to create an inputXMLStr external to the request, which is helpful in debugging.
- Parameters:
path- NOT YET DOCUMENTEDinputXMLStr- NOT YET DOCUMENTED- Returns:
- The nDRConnection value
- Throws:
Exception- NOT YET DOCUMENTED
-
submit
NOT YET DOCUMENTED- Overrides:
submitin classSimpleNdrRequest- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
submit
NOT YET DOCUMENTED- Overrides:
submitin classSimpleNdrRequest- Parameters:
inputXMLStr- NOT YET DOCUMENTED- Returns:
- NOT YET DOCUMENTED
- Throws:
Exception- NOT YET DOCUMENTED
-
report
NOT YET DOCUMENTED
-