at.gv.egovernment.moa.spss.server.invoke
Class DataObjectFactory

java.lang.Object
  |
  +--at.gv.egovernment.moa.spss.server.invoke.DataObjectFactory

public class DataObjectFactory
extends Object

A class to create DataObjects contained in different locations of the MOA XML request format.

Version:
$Id$
Author:
Patrick Peck

Constructor Summary
protected DataObjectFactory()
          Create a new DataObjectFactory.
 
Method Summary
 iaik.server.modules.xml.DataObject createFromContentOptionalRefType(at.gv.egovernment.moa.spss.api.common.Content content, String referenceID, boolean allowContentAndReference, boolean binaryAsXml, boolean xmlAsNodeList, boolean referenceAsXml)
          Create a DataObject from a Content object.
 iaik.server.modules.xml.DataObject createFromSignatureEnvironment(org.w3c.dom.Element signatureEnvironment, String uri, String referenceID)
          Create an XMLDataObject from the given signature environment.
 iaik.server.modules.xml.DataObject createFromTransformParameter(at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter transformParameter)
          Create a DataObject from a TransformParameter object.
 iaik.server.modules.xml.DataObject createFromURI(String uri, boolean asXml)
          Create a DataObject from data located at the given URI.
 iaik.server.modules.xml.DataObject createFromXmlDataObjectAssociation(at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation xmlDataObjAssoc, boolean xmlContentAllowed, boolean binaryContentRepeatable)
          Create a DataObject from a XMLDataObjectAssociation object.
 iaik.server.modules.xml.XMLDataObject createSignatureEnvironment(at.gv.egovernment.moa.spss.api.common.Content content, List supplements)
          Return the signature environment, i.e., the root element of the document, into which the signature will be inserted (if created) or which contains the signature (if verified).
static DataObjectFactory getInstance()
          Return the only instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataObjectFactory

protected DataObjectFactory()
Create a new DataObjectFactory. Protected to disallow multiple instances.
Method Detail

getInstance

public static DataObjectFactory getInstance()
Return the only instance of this class.
Returns:
The only instance of this class.

createSignatureEnvironment

public iaik.server.modules.xml.XMLDataObject createSignatureEnvironment(at.gv.egovernment.moa.spss.api.common.Content content,
                                                                        List supplements)
                                                                 throws MOASystemException,
                                                                        MOAApplicationException
Return the signature environment, i.e., the root element of the document, into which the signature will be inserted (if created) or which contains the signature (if verified).
Parameters:
content - The Content object containing the signature environment.
supplements - Additional schema or DTD information.
Returns:
The signature environment or null, if no signature environment exists.
Throws:
MOASystemException - A system error occurred building the signature environment (see message for details).
MOAApplicationException - An error occurred building the signature environment (see message for details).

createFromSignatureEnvironment

public iaik.server.modules.xml.DataObject createFromSignatureEnvironment(org.w3c.dom.Element signatureEnvironment,
                                                                         String uri,
                                                                         String referenceID)
                                                                  throws MOAApplicationException
Create an XMLDataObject from the given signature environment.
Parameters:
signatureEnvironment - The signature environment contained in the result.
uri - The URI identifying the data. This must be either the empty URI, an URI starting with "#xpointer", "#xmlns" or "#element"; or an URI starting with "#" and followed by an element ID.
referenceID - The reference ID to set for the data object.
Returns:
A data object containing the signature environment.

createFromContentOptionalRefType

public iaik.server.modules.xml.DataObject createFromContentOptionalRefType(at.gv.egovernment.moa.spss.api.common.Content content,
                                                                           String referenceID,
                                                                           boolean allowContentAndReference,
                                                                           boolean binaryAsXml,
                                                                           boolean xmlAsNodeList,
                                                                           boolean referenceAsXml)
                                                                    throws MOASystemException,
                                                                           MOAApplicationException
Create a DataObject from a Content object.
Parameters:
content - The Content object containing the data.
referenceID - The reference ID to set in the resulting DataObject. May be null.
allowContentAndReference - If true, then content is allowed to contain both a Reference attribute and content. Otherwise, either a Reference attribute or content must be set.
binaryAsXml - If true, a content child given as Base64Content must contain XML data.
xmlAsNodeList - If true, the children of a XMLContent child element are returned as a XMLNodeListDataObject. Otherwise, XMLContent may only contain a single child node, which must be an element and which is returned as an XMLDataObject.
referenceAsXml - If true, then content loaded from the URI given as the Reference attribute must be XML data. If false, an attempt is made to parse the data as XML and return an XMLDataObject but if this fails, a BinaryDataObject is returned containing a byte stream to the data.
Returns:
A DataObject representing the data in content. If base64AsXml==true and xmlAsNodeList==false and referenceAsXml==true, then the result can safely be cast to an XMLDataObject.
Throws:
MOASystemException - An error indicating an internal problem. See the wrapped exception for details.
MOAApplicationException - An error occurred handling the content (probably while opening a reference or parsing the data). See the wrapped exception for details.

createFromXmlDataObjectAssociation

public iaik.server.modules.xml.DataObject createFromXmlDataObjectAssociation(at.gv.egovernment.moa.spss.api.common.XMLDataObjectAssociation xmlDataObjAssoc,
                                                                             boolean xmlContentAllowed,
                                                                             boolean binaryContentRepeatable)
                                                                      throws MOASystemException,
                                                                             MOAApplicationException
Create a DataObject from a XMLDataObjectAssociation object.
Parameters:
xmlDataObjAssoc - The XMLDataObjectAssociation object.
xmlContentAllowed - Whether the content contained in the xmlDataObjAssoc is allowed to be of type XML_CONTENT.
binaryContentRepeatable - If binary content must be provided as a DataObject that can be read multiple times.
Returns:
A DataObject representing the data in xmlDataObjAssoc.
Throws:
MOASystemException - An error indicating an internal problem. See the wrapped exception for details.
MOAApplicationException - An error occurred handling the content (probably while parsing the data). See the wrapped exception for details.

createFromTransformParameter

public iaik.server.modules.xml.DataObject createFromTransformParameter(at.gv.egovernment.moa.spss.api.xmlverify.TransformParameter transformParameter)
                                                                throws MOASystemException,
                                                                       MOAApplicationException
Create a DataObject from a TransformParameter object.
Parameters:
transformParameter - The TransformParameter object containing the data.
Returns:
A DataObject representing the data in root.
Throws:
MOASystemException - An error indicating an internal problem. See the wrapped exception for details.
MOAApplicationException - An error occurred handling the content (probably while opening a reference or parsing the data). See the wrapped exception for details.

createFromURI

public iaik.server.modules.xml.DataObject createFromURI(String uri,
                                                        boolean asXml)
                                                 throws MOASystemException,
                                                        MOAApplicationException
Create a DataObject from data located at the given URI.
Parameters:
uri - The URI where the data is located. This method uses an ExternalURIResolver to resolve URIs.
asXml - If true, a DataObject is only returned, if the content consists of XML data. If it does not consist of XML data, an MOAApplicationException will be thrown. If this parameter is false and the content consists of XML data, this method will still attempt to parse it.
Returns:
The DataObject contained at the URI.
Throws:
MOASystemException - A system error parsing the XML content.
MOAApplicationException - An error occurred on opening, reading or parsing the data behind the URI.