com.cyclonecommerce.cybervan.api
Class DefaultDocument

java.lang.Object
  |
  +--com.cyclonecommerce.cybervan.api.DefaultDocument
All Implemented Interfaces:
IntegrationDocument, java.io.Serializable

public class DefaultDocument
extends java.lang.Object
implements IntegrationDocument, java.io.Serializable

Provides a means for an Interchange Server to instantiate an IntegrationDocument. Used for outbound documents Only the IntegrationDocument interface methods are intended for use by a client.

See Also:
Serialized Form

Fields inherited from interface com.cyclonecommerce.cybervan.api.IntegrationDocument
MAX_REFERENCES, NA, NA_LIT
 
Constructor Summary
DefaultDocument()
           
 
Method Summary
 void addSecurityLevel(int securityLevel)
          Internal server use only
 java.lang.String getControlId()
          Get the document's control id.
 java.lang.String getCorrelationId()
          Get the document's correlation id.
 java.lang.String getDirectory()
          Get the directory that the document is located in.
 java.lang.String getEbXmlAction()
          Get the ebXmlAction of the document was transfered using ebXml
 java.lang.String getEbXmlService()
          Get the ebXmlService if the document was transfered using ebXml.
 java.lang.String getFingerprint()
          Get the documents fingerprint.
 InterchangeURL getInterchangeHttpsURL()
          HTTPS URL to use to retrieve the raw document content.
 InterchangeURL getInterchangeURL()
          HTTP URL to use to retrieve the raw document content.
 int getMaxReferences()
          Deprecated.  
 java.lang.String getName()
          Get the filename used when backing up the file.
 java.lang.String getOriginalName()
          Get the document's original filename.
 int getOriginalSize()
          Get the original document size.
 java.lang.String getPackagingType()
          Get the packaging type (AKA: BusinessProtocol) to used transfering sending a document.
 java.lang.String getPackagingVersion()
          Get the packaging version (AKA: BusinessProtocol) used when transfering a document.
 java.lang.String getPath()
          Return the path to the document content.
 java.lang.String getPersistedName()
          Return the name as stored on disk (Inbound Transport).
 CompanyId getReceiverId()
          Get the Receiver CompanyId object.
 java.lang.String getReference(int aReferenceNumber)
          Deprecated. Use getUserData instead.
 java.lang.String getRefToMessageId()
          Get the document's RefToMessageId.
 SecurityLevel getSecurityLevel()
          Get the security level used to exchange the document.
 CompanyId getSenderId()
          Get the Sender CompanyId object.
 int getSequenceId()
          Get the document sequence id.
 java.lang.String getTransport()
          Method getTransport - return the transport the document was sent or received on.
 int getTransportSize()
          Get the packaged size of the document.
 DocumentType getType()
          Get the document type.
 java.lang.String getUniqueId()
          Get the document's unique id.
 java.util.Properties getUserData()
          Get the additional user defined data.
 void setContent(java.lang.String path)
          setContent - Sets the raw data of the document.
 void setControlId(java.lang.String aControlId)
          Set the document's control id.
 void setCorrelationId(java.lang.String id)
          Set the document's correlation id.
 void setDirectory(java.lang.String aDirectory)
          Set the directory to the location of the raw document content.
 void setEbXmlAction(java.lang.String ebXmlAction)
          Set the ebXmlAction if MCD free trading is enabled.
 void setEbXmlService(java.lang.String ebXmlService)
          Set the ebXmlService if MCD free ebXml trading is enabled.
 void setEncrypted(boolean isEncrypted)
          Set if the document is encrypted Internal server use only
 void setFileExt(java.lang.String fileExt)
          Internal server use only
 void setFingerprint(java.lang.String aFingerprint)
          Internal server use only
 void setInterchangeHttpsURL(InterchangeURL url)
          setInterchangeHttpsURL - Sets URL to use when communicating with Interchange.
 void setInterchangeURL(InterchangeURL url)
          Internal server use only
 void setName(java.lang.String aName)
          Set the backup filename.
 void setOriginalName(java.lang.String anOriginalName)
          Set the original filename of the document.
 void setOriginalSize(int anOriginalSize)
          Internal server use only
 void setPackagingType(java.lang.String packagingType)
          Set the packaging type (AKA: BusinessProtocol) to used when transfering a document.
 void setPackagingVersion(java.lang.String packagingVersion)
          Set the packaging version (AKA: BusinessProtocol) to used when transfering a document.
 void setPath(java.lang.String aPath)
          Set the path the document content.
 void setPersistedName(java.lang.String persistedName)
          Sets the name of the document as stored on disk (Inbound Transport).
 void setReceiverId(CompanyId id)
          Set the Receiver CompanyId object.
 void setReceiverId(java.lang.String id)
          Set the Receiver CompanyId.
 void setReceiverName(java.lang.String name)
          Set the Receiver's Partner Name.
 void setReference(int aReferenceNumber, java.lang.String aReference)
          Deprecated. Use setUserData instead.
 void setRefToMessageId(java.lang.String id)
          Set the document's RefToMessageId.
 void setSecurityLevel(int securityLevel)
          Internal server use only
 void setSenderId(CompanyId id)
          Set the Sender CompanyId.
 void setSenderId(java.lang.String id)
          Set the Sender CompanyId.
 void setSenderName(java.lang.String name)
          Set the Sender's Company Name.
 void setSequenceId(int id)
          Internal server use only
 void setSigned(boolean isSigned)
          Set if the document is signed or not Internal server use only
 void setSubtype(java.lang.String subtype)
          Set the document subtype.
 void setTransport(java.lang.String transport)
          Internal server use only
 void setTransportSize(int aSize)
          Internal server use only
 void setType(DocumentType type)
          Set the document type - EDI, X12, EDIFACT, XML, etc.
 void setType(java.lang.String type)
          Set the document type - EDI, X12, EDIFACT, XML, etc.
 void setUniqueId(java.lang.String aUniqueId)
          Set the document's unique id.
 void setUserData(java.util.Properties userProperties)
          Sets additional user defined data that may be used by the packager when constructing the packaged document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDocument

public DefaultDocument()
Method Detail

getSenderId

public CompanyId getSenderId()
Get the Sender CompanyId object.
Specified by:
getSenderId in interface IntegrationDocument
Returns:
Returns the Sender's CompanyId object. An uninitialized CompanyId object is returned if setSenderId has not yet been called.

setSenderId

public void setSenderId(CompanyId id)
Set the Sender CompanyId.
Specified by:
setSenderId in interface IntegrationDocument
Parameters:
id - CompanyId object initialized to the Sender's ID.

setSenderId

public void setSenderId(java.lang.String id)
Set the Sender CompanyId. Will set the EdiID property of the Sender CompanyID
Parameters:
id -  
See Also:
CompanyId

setSenderName

public void setSenderName(java.lang.String name)
Set the Sender's Company Name.
Parameters:
name - Company Name.
See Also:
CompanyId

getReceiverId

public CompanyId getReceiverId()
Get the Receiver CompanyId object.
Specified by:
getReceiverId in interface IntegrationDocument
Returns:
Returns the Receiver's CompanyId object. An uninitialized CompanyId object is returned if setReceiverId has not yet been called.

setReceiverId

public void setReceiverId(CompanyId id)
Set the Receiver CompanyId object.
Specified by:
setReceiverId in interface IntegrationDocument
Parameters:
id - CompanyId object initialized to the Receivers's ID.

setReceiverId

public void setReceiverId(java.lang.String id)
Set the Receiver CompanyId. Will set the EdiID property of the Receiver CompanyID.
Parameters:
id -  
See Also:
CompanyId

setReceiverName

public void setReceiverName(java.lang.String name)
Set the Receiver's Partner Name.
Parameters:
name - Name of the Receiving partner.

getControlId

public java.lang.String getControlId()
Get the document's control id.
Specified by:
getControlId in interface IntegrationDocument
Returns:
Returns the document's control id. Will be initialized to XML for XML documents. Binary for Binary documents. And, a EDI control id defined in the document for X12 and EDIFACT documents.

setControlId

public void setControlId(java.lang.String aControlId)
Set the document's control id.
Parameters:
aControlId -  

getUniqueId

public java.lang.String getUniqueId()
Get the document's unique id. Normally assigned by Interchange.
Specified by:
getUniqueId in interface IntegrationDocument
Returns:
Return the document's uniqueid.

setUniqueId

public void setUniqueId(java.lang.String aUniqueId)
Set the document's unique id. Internal server used only.
Specified by:
setUniqueId in interface IntegrationDocument
Parameters:
aUniqueId - Globally unique id for the document.

setCorrelationId

public void setCorrelationId(java.lang.String id)
Set the document's correlation id.
Specified by:
setCorrelationId in interface IntegrationDocument
Parameters:
id - The document Correlation Id. This id can be generated by Interchange, or generated by applications integrating with Interchange. The id is used to tie together multiple documents into a conversation. Multiple documents can have the same Correlation Id.

getCorrelationId

public java.lang.String getCorrelationId()
Get the document's correlation id.
Specified by:
getCorrelationId in interface IntegrationDocument
Returns:
Returns the document Correlation Id. This id can be generated by Interchange, or generated by applications integrating with Interchange. The id is used to tie together multiple documents into a conversation. Multiple documents can have the same Correlation Id.

getRefToMessageId

public java.lang.String getRefToMessageId()
Get the document's RefToMessageId.
For RosettaNet and ebXML ACKs this value is set to to unique id of the corresponding document. For both RosettaNet and ebXML the document message id and the unique id are equivalent.
For EDIINT MDNs this value is going to be set to the message id of the corresponding document. The EDIINT message id is in the form "<#CompanyId#ControlId#UniqueId#>". Where CompanyId is the Id of the sending company. ControlId is the X12/EDIFACT document control id. And, UniqueId is the Interchange unique document id. For EDIINT the Interchange unique id is not equivalent to the message id.
Specified by:
getRefToMessageId in interface IntegrationDocument
Returns:
Returns the document RefToMessageId. The MessageId in which this (current) document refers to (or is a response to).

setRefToMessageId

public void setRefToMessageId(java.lang.String id)
Set the document's RefToMessageId. Typically used internally by the server. Can be used by a backend system to set a reference to a previously sent or received document.
Specified by:
setRefToMessageId in interface IntegrationDocument
Parameters:
id - The document RefToMessageId.

getType

public DocumentType getType()
Get the document type.
Specified by:
getType in interface IntegrationDocument
Returns:
Returns the document type - X12, EDIFACT, XML, etc.

setSubtype

public void setSubtype(java.lang.String subtype)
Set the document subtype. Internal server use only
Parameters:
subtype -  

setType

public void setType(DocumentType type)
Set the document type - EDI, X12, EDIFACT, XML, etc.
Parameters:
type -  

setType

public void setType(java.lang.String type)
Set the document type - EDI, X12, EDIFACT, XML, etc.
Parameters:
type -  

setFileExt

public void setFileExt(java.lang.String fileExt)
Internal server use only
Parameters:
fileExt -  

getPath

public java.lang.String getPath()
Return the path to the document content. For use by local clients only
Specified by:
getPath in interface IntegrationDocument
Returns:
Return the path to the document content. For use by local clients only

setPath

public void setPath(java.lang.String aPath)
Set the path the document content.
Specified by:
setPath in interface IntegrationDocument
Parameters:
aPath - to the raw document content.

getDirectory

public java.lang.String getDirectory()
Get the directory that the document is located in.
Returns:
Return the directory to the raw document content. For use by local clients only

setDirectory

public void setDirectory(java.lang.String aDirectory)
Set the directory to the location of the raw document content.
Parameters:
aDirectory -  

getName

public java.lang.String getName()
Get the filename used when backing up the file.
Specified by:
getName in interface IntegrationDocument
Returns:
Returns the backup filename.

setName

public void setName(java.lang.String aName)
Set the backup filename. Internal server use only
Parameters:
aName - Backup filename.

getOriginalName

public java.lang.String getOriginalName()
Get the document's original filename.
Specified by:
getOriginalName in interface IntegrationDocument
Returns:
Original filename of the document.

setOriginalName

public void setOriginalName(java.lang.String anOriginalName)
Set the original filename of the document.
Parameters:
anOriginalName -  

getTransportSize

public int getTransportSize()
Get the packaged size of the document.
Specified by:
getTransportSize in interface IntegrationDocument
Returns:
Packaged size of the document.

setTransportSize

public void setTransportSize(int aSize)
Internal server use only
Parameters:
aSize -  

getOriginalSize

public int getOriginalSize()
Get the original document size.
Specified by:
getOriginalSize in interface IntegrationDocument
Returns:
Return the unpackaged document size.

setOriginalSize

public void setOriginalSize(int anOriginalSize)
Internal server use only
Parameters:
anOriginalSize -  

getReference

public java.lang.String getReference(int aReferenceNumber)
Deprecated. Use getUserData instead.

Get a document reference value.
Specified by:
getReference in interface IntegrationDocument
Parameters:
aReferenceNumber - Reference index to return. 0 based. Must be less than the getMaxReferences value/
Returns:
Returns the specified user defined reference. Returns null if not available

setReference

public void setReference(int aReferenceNumber,
                         java.lang.String aReference)
Deprecated. Use setUserData instead.

Method setReference
Specified by:
setReference in interface IntegrationDocument
Parameters:
aReferenceNumber - The reference index
aReference - The user specifed reference

getSecurityLevel

public SecurityLevel getSecurityLevel()
Get the security level used to exchange the document.
Specified by:
getSecurityLevel in interface IntegrationDocument
Returns:
Security level used when the document was packaged.

setSecurityLevel

public void setSecurityLevel(int securityLevel)
Internal server use only
Parameters:
securityLevel -  

addSecurityLevel

public void addSecurityLevel(int securityLevel)
Internal server use only
Parameters:
securityLevel -  

getFingerprint

public java.lang.String getFingerprint()
Get the documents fingerprint.
Specified by:
getFingerprint in interface IntegrationDocument
Returns:
Returns the fingerprint of the signed data. Returns null if not available.

setFingerprint

public void setFingerprint(java.lang.String aFingerprint)
Internal server use only
Parameters:
aFingerprint -  

getMaxReferences

public int getMaxReferences()
Deprecated.  

Get the maximum number of references that can be added through setReference.
Specified by:
getMaxReferences in interface IntegrationDocument
Returns:
Return the maximum number of references that can be added through setReference.

getInterchangeURL

public InterchangeURL getInterchangeURL()
HTTP URL to use to retrieve the raw document content. Only used when HTTP API support is enabled. For use by remote clients only
Specified by:
getInterchangeURL in interface IntegrationDocument
Returns:
Returns the HTTP url to use to retreive the raw document content. Returns null if not available

setInterchangeURL

public void setInterchangeURL(InterchangeURL url)
Internal server use only
Specified by:
setInterchangeURL in interface IntegrationDocument
Parameters:
url -  

getInterchangeHttpsURL

public InterchangeURL getInterchangeHttpsURL()
HTTPS URL to use to retrieve the raw document content. Only used when HTTPS API support is enabled. For use by remote clients only
Specified by:
getInterchangeHttpsURL in interface IntegrationDocument
Returns:
Returns the HTTPS URL to use to retreive the raw document content. Returns null if not available

setInterchangeHttpsURL

public void setInterchangeHttpsURL(InterchangeURL url)
setInterchangeHttpsURL - Sets URL to use when communicating with Interchange. Cyclone Internal use only
Specified by:
setInterchangeHttpsURL in interface IntegrationDocument
Parameters:
url -  

setContent

public void setContent(java.lang.String path)
setContent - Sets the raw data of the document. For use by local clients only
Specified by:
setContent in interface IntegrationDocument
Parameters:
path - The full path of the file containing the raw data

setTransport

public void setTransport(java.lang.String transport)
Internal server use only
Parameters:
transport -  

getTransport

public java.lang.String getTransport()
Method getTransport - return the transport the document was sent or received on.
Specified by:
getTransport in interface IntegrationDocument
Returns:
Transport used to transfer the document.

setPersistedName

public void setPersistedName(java.lang.String persistedName)
Sets the name of the document as stored on disk (Inbound Transport). Internal server use only
Parameters:
persistedName - java.lang.String

getPersistedName

public java.lang.String getPersistedName()
Return the name as stored on disk (Inbound Transport). If document sequencing is false, will always return original name.
Specified by:
getPersistedName in interface IntegrationDocument
Returns:
java.lang.String

setSequenceId

public void setSequenceId(int id)
Internal server use only
Parameters:
id - int

getSequenceId

public int getSequenceId()
Get the document sequence id.
Specified by:
getSequenceId in interface IntegrationDocument
Returns:
Returns a unique document sequence ID. This ID is generated by Inbound Agent and is only set when sequencing is turned on by partner's inbound configuration. Only relevant for Inbound documents.

setEncrypted

public void setEncrypted(boolean isEncrypted)
Set if the document is encrypted Internal server use only
Parameters:
isEncrypted - a boolean

setSigned

public void setSigned(boolean isSigned)
Set if the document is signed or not Internal server use only
Parameters:
isSigned - a boolean

getEbXmlService

public java.lang.String getEbXmlService()
Get the ebXmlService if the document was transfered using ebXml.
Specified by:
getEbXmlService in interface IntegrationDocument
Returns:
Returns the ebXmlService if the document was transfered using ebXml.

setEbXmlService

public void setEbXmlService(java.lang.String ebXmlService)
Set the ebXmlService if MCD free ebXml trading is enabled. The ebXmlService must be set if trading ebXml without using a MCD.
Specified by:
setEbXmlService in interface IntegrationDocument
Parameters:
ebXmlService - ebXML Service to use when packaging a ebXML document if MCD Free mode is being utilized.

getEbXmlAction

public java.lang.String getEbXmlAction()
Get the ebXmlAction of the document was transfered using ebXml
Specified by:
getEbXmlAction in interface IntegrationDocument
Returns:
Returns the ebXmlAction of the document was transfered using ebXml

setEbXmlAction

public void setEbXmlAction(java.lang.String ebXmlAction)
Set the ebXmlAction if MCD free trading is enabled. The ebXmlAction must be set if trading ebXml without using a MCD.
Specified by:
setEbXmlAction in interface IntegrationDocument
Parameters:
ebXmlAction - ebXML Action to use when packaging a ebXML document if MCD Free mode is being utilized.

getPackagingType

public java.lang.String getPackagingType()
Get the packaging type (AKA: BusinessProtocol) to used transfering sending a document.
Specified by:
getPackagingType in interface IntegrationDocument
Returns:
Returns Packaging Type used when packaging the document.
See Also:
PackagingTypes

setPackagingType

public void setPackagingType(java.lang.String packagingType)
Set the packaging type (AKA: BusinessProtocol) to used when transfering a document. The packaging type only needs to be set if trading ebXml without using a MCD. Only should be set for ebXML packaging when MCD free trading is being utilized. do not set this value at any other time.
Specified by:
setPackagingType in interface IntegrationDocument
Parameters:
packagingType - The packaging type to use to package the document.
See Also:
PackagingTypes

getPackagingVersion

public java.lang.String getPackagingVersion()
Get the packaging version (AKA: BusinessProtocol) used when transfering a document.
Specified by:
getPackagingVersion in interface IntegrationDocument
Returns:
Packaging version used when packaging the document.

setPackagingVersion

public void setPackagingVersion(java.lang.String packagingVersion)
Set the packaging version (AKA: BusinessProtocol) to used when transfering a document. The packaging version only needs to be set if trading ebXml without using a MCD. Only should be set for ebXML packaging when MCD free trading is being utilized. do not set this value at any other time.
Specified by:
setPackagingVersion in interface IntegrationDocument
Parameters:
packagingVersion - The packaging version

setUserData

public void setUserData(java.util.Properties userProperties)
Sets additional user defined data that may be used by the packager when constructing the packaged document. Currently the properties are only utilized when packaging ebXML documents. setUserData can be called for outbound documents. The properties will be used to populate the ebXML #wildcard element.
Specified by:
setUserData in interface IntegrationDocument
Parameters:
userProperties - Initialized with user defined data.

getUserData

public java.util.Properties getUserData()
Get the additional user defined data. Currently the properties are only supported for ebXML documents. getUserData can be called for Inbound Documents. The properties will be read from the inbound ebXML document's #wildcard element.
Specified by:
getUserData in interface IntegrationDocument
Returns:
Additional user data transfered within the headers of a inbound document.