BEA Systems, Inc.

com.beasys.commerce.axiom.document.fast
Class FastDocumentImpl

java.lang.Object
  |
  +--com.beasys.commerce.axiom.document.fast.FastContentImpl
        |
        +--com.beasys.commerce.axiom.document.fast.FastDocumentImpl

public class FastDocumentImpl
extends FastContentImpl
implements Document

An implementation of the Document interface that is not an EJB.

When creating these, do not use the setProperty() methods, as those either raise an UnsupportedException or no-op. Instead, use the FastContentImpl.putProperty(java.lang.String, java.lang.Object) method, using the String name of the attribute (i.e. "identifier", "size", "modifiedDate", etc.) as the key and the appropiate data type as the value. Additionally, for getContent() and getContentBlock() to work, be sure to set the DocumentManagerHome handle with setDocumentManagerHomeHandle().

See Also:
Serialized Form

Inner Class Summary
static class FastDocumentImpl.PublicDocumentValue
          A little inner class because DocumentValue constructor is protected.
 
Inner classes inherited from class com.beasys.commerce.axiom.document.fast.FastContentImpl
FastContentImpl.PublicContentValue
 
Field Summary
protected  java.lang.ref.Reference docBytesRef
          A Reference cache of the Document's full bytes.
protected  javax.ejb.HomeHandle docMgrHomeHandle
          The HomeHandle to the DocumentManagerHome to use to get a DocumentManager.
static int MAX_CACHE_SIZE
          The max document size we will cache in a SoftReference.
 
Fields inherited from class com.beasys.commerce.axiom.document.fast.FastContentImpl
properties, PROPERTY_CASE_LOWER, PROPERTY_CASE_NONE, PROPERTY_CASE_UPPER, propertyCase
 
Fields inherited from interface com.beasys.commerce.foundation.ConfigurableEntity
RESERVED_SCOPE_NAME
 
Constructor Summary
FastDocumentImpl()
          Constructor.
FastDocumentImpl(int propertyCase)
          Constructor.
 
Method Summary
protected  void finalize()
          A finalize method which clears our doc bytes reference.
 java.lang.String getAuthor()
          Get the author of the document.
 java.lang.String getComments()
          Get the document comments.
 byte[] getContent()
          Get the raw bytes of the document.
 byte[] getContentBlock(long start, long size)
          Get the raw bytes of the document.
 java.sql.Timestamp getCreationDate()
          Get the date the document was created.
 java.lang.String getDescription()
          Get the description.
 DocumentValue getDocumentByValue()
          Get the document value for this.
 DocumentManager getDocumentManager()
          Get the DocumentManager this should use to get stuff.
 java.lang.String getLockedBy()
          Get the locker of the document.
 java.lang.String getModifiedBy()
          Get last modifier of the document.
 java.sql.Timestamp getModifiedDate()
          Get the date the document was last modified.
 java.lang.String getName()
          Get the document name.
 java.lang.Object getPrimaryKey()
          Create a DocumentPk from the identifier.
 long getSize()
          Get the size of the document.
 long getVersion()
          Get the document version number.
 void setAuthor(java.lang.String author)
          This method does nothing
 void setComments(java.lang.String s)
          This method does nothing
 void setCreationDate(java.sql.Timestamp date)
          This method does nothing
 void setDescription(java.lang.String s)
          This method does nothing
 void setDocumentByValue(DocumentValue val)
          This method does nothing
 void setDocumentManagerHomeHandle(javax.ejb.HomeHandle h)
          Set the Handle to the DocumentManager this should use if needed.
 void setLockedBy(java.lang.String s)
          This method does nothing
 void setModifiedBy(java.lang.String s)
          This method does nothing
 void setModifiedDate(java.sql.Timestamp d)
          This method does nothing
 void setName(java.lang.String s)
          This method does nothing
 void setSize(long size)
          This method does nothing
 void setVersion(long ver)
          This method does nothing
 
Methods inherited from class com.beasys.commerce.axiom.document.fast.FastContentImpl
addBusinessPolicy, addPropertyValue, addPropertyValueMapped, get__classIdentifier, get__containingBelonging, get__containingEntity, get__mapKey, get__sequenceNumber, getBusinessPolicy, getContentByValue, getEJBHome, getHandle, getIdentifier, getMimeType, getPersistableHandle, getProperty, getProperty, getPropertyAsString, getPropertyAsString, getPropertyCase, getPropertyDefault, getPropertyNoDefault, getSuccessor, getUniqueId, isIdentical, putProperty, remove, removeBusinessPolicy, removeProperty, removeProperty, removePropertyValue, removePropertyValueMapped, removeSuccessor, set__containingBelonging, set__containingEntity, set__mapKey, setContentByValue, setMimeType, setProperty, setProperty, setPropertyCase, setSuccessor
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_CACHE_SIZE

public static final int MAX_CACHE_SIZE
The max document size we will cache in a SoftReference.

docMgrHomeHandle

protected javax.ejb.HomeHandle docMgrHomeHandle
The HomeHandle to the DocumentManagerHome to use to get a DocumentManager.

docBytesRef

protected java.lang.ref.Reference docBytesRef
A Reference cache of the Document's full bytes.
Constructor Detail

FastDocumentImpl

public FastDocumentImpl()
Constructor.

FastDocumentImpl

public FastDocumentImpl(int propertyCase)
Constructor.
Parameters:
propertyCase - the case of property key for this (PROPERTY_CASE_NONE, PROPERTY_CASE_LOWER, PROPERTY_CASE_UPPER).
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
A finalize method which clears our doc bytes reference.
Overrides:
finalize in class java.lang.Object

getDocumentByValue

public DocumentValue getDocumentByValue()
Get the document value for this.
Specified by:
getDocumentByValue in interface Document
Tags copied from interface: Document
Returns:
DocumentValue the Document value object
Throws:
java.rmi.RemoteException - thrown on an error.

getPrimaryKey

public java.lang.Object getPrimaryKey()
Create a DocumentPk from the identifier.
Overrides:
getPrimaryKey in class FastContentImpl

setDocumentByValue

public void setDocumentByValue(DocumentValue val)
This method does nothing
Specified by:
setDocumentByValue in interface Document
Tags copied from interface: Document
Parameters:
DocumentValue - the Document value object
Throws:
java.rmi.RemoteException - thrown on an error.

getDescription

public java.lang.String getDescription()
Get the description.
Specified by:
getDescription in interface Document
Tags copied from interface: Document
Returns:
the description or null if none.
Throws:
java.rmi.RemoteException - thrown on an error.

setDescription

public void setDescription(java.lang.String s)
This method does nothing
Specified by:
setDescription in interface Document
Tags copied from interface: Document
Parameters:
description - description to be added
Throws:
java.rmi.RemoteException - thrown on an error.

getSize

public long getSize()
Get the size of the document.
Specified by:
getSize in interface Document
Tags copied from interface: Document
Returns:
the size, 0 or less if no bytes associated with the document.
Throws:
java.rmi.RemoteException - thrown on an error.

setSize

public void setSize(long size)
This method does nothing
Specified by:
setSize in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getModifiedBy

public java.lang.String getModifiedBy()
Get last modifier of the document.
Specified by:
getModifiedBy in interface Document
Tags copied from interface: Document
Returns:
the identifier of the modifier, null if none.
Throws:
java.rmi.RemoteException - thrown on an error.

setModifiedBy

public void setModifiedBy(java.lang.String s)
This method does nothing
Specified by:
setModifiedBy in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getModifiedDate

public java.sql.Timestamp getModifiedDate()
Get the date the document was last modified.
Specified by:
getModifiedDate in interface Document
Tags copied from interface: Document
Returns:
the modified date, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setModifiedDate

public void setModifiedDate(java.sql.Timestamp d)
This method does nothing
Specified by:
setModifiedDate in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getCreationDate

public java.sql.Timestamp getCreationDate()
Get the date the document was created.
Specified by:
getCreationDate in interface Document
Tags copied from interface: Document
Returns:
the creation date, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setCreationDate

public void setCreationDate(java.sql.Timestamp date)
This method does nothing
Specified by:
setCreationDate in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getVersion

public long getVersion()
Get the document version number.
Specified by:
getVersion in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

setVersion

public void setVersion(long ver)
This method does nothing
Specified by:
setVersion in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getAuthor

public java.lang.String getAuthor()
Get the author of the document.
Specified by:
getAuthor in interface Document
Tags copied from interface: Document
Returns:
the author, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setAuthor

public void setAuthor(java.lang.String author)
This method does nothing
Specified by:
setAuthor in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getLockedBy

public java.lang.String getLockedBy()
Get the locker of the document.
Specified by:
getLockedBy in interface Document
Tags copied from interface: Document
Returns:
the locker's identifier, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setLockedBy

public void setLockedBy(java.lang.String s)
This method does nothing
Specified by:
setLockedBy in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getComments

public java.lang.String getComments()
Get the document comments.
Specified by:
getComments in interface Document
Tags copied from interface: Document
Returns:
the comments, or null if none.
Throws:
java.rmi.RemoteException - thrown on an error.

setComments

public void setComments(java.lang.String s)
This method does nothing
Specified by:
setComments in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getName

public java.lang.String getName()
Get the document name.
Specified by:
getName in interface Document
Tags copied from interface: Document
Returns:
the name, or null if unknown.
Throws:
java.rmi.RemoteException - thrown on an error.

setName

public void setName(java.lang.String s)
This method does nothing
Specified by:
setName in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

getContentBlock

public byte[] getContentBlock(long start,
                              long size)
                       throws java.rmi.RemoteException
Get the raw bytes of the document.
Specified by:
getContentBlock in interface Document
Tags copied from interface: Document
Parameters:
start - the starting index in the byte array.
size - the number of bytes to retrieve.
Throws:
java.rmi.RemoteException - thrown on an error.

getContent

public byte[] getContent()
                  throws java.rmi.RemoteException
Get the raw bytes of the document.
Specified by:
getContent in interface Document
Tags copied from interface: Document
Throws:
java.rmi.RemoteException - thrown on an error.

setDocumentManagerHomeHandle

public void setDocumentManagerHomeHandle(javax.ejb.HomeHandle h)
Set the Handle to the DocumentManager this should use if needed.

getDocumentManager

public DocumentManager getDocumentManager()
                                   throws java.rmi.RemoteException
Get the DocumentManager this should use to get stuff.

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved