org.openspml.message
Class AddRequest

java.lang.Object
  |
  +--org.openspml.message.SpmlRequest
        |
        +--org.openspml.message.AddRequest

public class AddRequest
extends SpmlRequest

A class used to represent an addRequest element.

An add request essentially just provides a list of arbitrary attribute values for the new object. The objectclass attribute is however special in that it may specify the class of the object being created. If not specified, the provider may use a default object class, but this is not required.


Fields inherited from class org.openspml.message.SpmlRequest
EXEC_ASYNCHRONOUS, EXEC_SYNCHRONOUS
 
Constructor Summary
AddRequest()
          Construct an object representing an SPML addRequest message.
 
Method Summary
 SpmlResponse createResponse()
          Build an empty SpmlRequest object that corresponds to this request.
 Attribute getAttribute(java.lang.String name)
          Retrieve an attribute by name.
 java.util.List getAttributes()
          Retrieve the list of attributes.
 java.lang.Object getAttributeValue(java.lang.String name)
          Retrieve the value of an attribute.
 java.lang.String getElementName()
          Return the tag name for the request element.
 java.lang.String getObjectClass()
          Retrieve the value of the "objectclass" attribute.
 void setAttribute(Attribute a)
          Sets one attribute.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Sets one attribute as a name/value pair.
 void setAttributes(java.util.List l)
          Sets the list of attributes.
 void setAttributes(java.util.Map map)
          Sets the attributes from a map of name/value pairs.
 void setObjectClass(java.lang.String s)
          Sets the class of the object being added.
 
Methods inherited from class org.openspml.message.SpmlRequest
dumpFile, getIdentifier, getIdentifierString, getOperationalAttribute, getOperationalAttributes, getOperationalAttributeValue, getRequestId, isAsynchronous, parseRequest, parseRequest, setAsynchronous, setIdentifier, setIdentifier, setOperationalAttribute, setOperationalAttribute, setOperationalAttributes, setRequestId, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddRequest

public AddRequest()
Construct an object representing an SPML addRequest message.
Method Detail

createResponse

public SpmlResponse createResponse()
Description copied from class: SpmlRequest
Build an empty SpmlRequest object that corresponds to this request. Used in a few error conditions to return the expected response object when one was not actually sent back from the server.
Overrides:
createResponse in class SpmlRequest

setAttributes

public void setAttributes(java.util.List l)
Sets the list of attributes. The list is expected to contain Attribute objects.

setAttributes

public void setAttributes(java.util.Map map)
Sets the attributes from a map of name/value pairs.

setAttribute

public void setAttribute(Attribute a)
Sets one attribute.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Sets one attribute as a name/value pair.

setObjectClass

public void setObjectClass(java.lang.String s)
Sets the class of the object being added.

This is just represented as an Attribute, but since it is has specified semantics, we give it its own method.


getAttributes

public java.util.List getAttributes()
Retrieve the list of attributes.

getAttribute

public Attribute getAttribute(java.lang.String name)
Retrieve an attribute by name.

getAttributeValue

public java.lang.Object getAttributeValue(java.lang.String name)
Retrieve the value of an attribute.

getObjectClass

public java.lang.String getObjectClass()
Retrieve the value of the "objectclass" attribute.

getElementName

public java.lang.String getElementName()
Description copied from class: SpmlRequest
Return the tag name for the request element.
Overrides:
getElementName in class SpmlRequest