com.waveset.object
Class RepositoryProxy

java.lang.Object
  extended bycom.waveset.object.RepositoryProxy

public class RepositoryProxy
extends java.lang.Object

A "special" class that sets PersistentObject attributes that no one but Repository should set. Unfortunately, Repository itself cannot set them, because the Repository resides in a separate package that we do not want to expose to clients. Session also resides in its own package, so we'd need a SessionProxy if it were handled in that layer.

NOTE: This class should _not_ be included in any client-side jar file.


Field Summary
static java.lang.String code_id
           
 
Constructor Summary
RepositoryProxy()
           
 
Method Summary
static void clear(RepositoryResult rr)
          Clear RepositoryResult's row list.
static void clearObjects(RepositoryResult rr)
          Clear RepositoryResult's _po fields
static void ensureCapacity(RepositoryResult rr, int minCapacity)
          Trim RepositoryResult's row list to its current size.
static AttributeExpression getAuthFilter(RepositoryResult rr)
          Get 'authorizationFilter' from a RepositoryResult.
static java.lang.Class getClassForType(Type type)
          Returns the java class for the specified object type NOTE: Type's getClass() method is package-private.
static java.util.List getCurrentRowList(RepositoryResult rr)
          Permit access to RepositoryResult's row list.
static int getCurrentSize(RepositoryResult rr)
          Permit access to the size of RepositoryResult's row list.
static java.lang.String[] getEndBefore(RepositoryResult rr)
          Get 'endBefore' from a RepositoryResult.
static boolean getFetchPrevious(RepositoryResult rr)
          Get 'fetchPrevious' from a RepositoryResult.
static PersistentObject.InitialInstance[] getInitialInstances(Type type)
          Allows Repository to access protected method getInitialInstances()
static boolean getNeedLockInfo(RepositoryResult rr)
          Get 'needLockInfo' from a RepositoryResult.
static boolean getNeedObject(RepositoryResult rr)
          Get 'needObject' from a RepositoryResult.
static boolean getNeedSummary(RepositoryResult rr)
          Get 'needSummary' from a RepositoryResult.
static ObjectLoader getObjectLoader(RepositoryResult rr)
          Get 'objectLoader' handle from a RepositoryResult.
static java.lang.String[] getStartAfter(RepositoryResult rr)
          Get 'startAfter' from a RepositoryResult.
static RepositoryResult makeRepositoryResult(LockInfo[] lockInfoArray)
          Package-private constructor allows Repository to construct a RepositoryResult using an array of LockInfo instances.
static RepositoryResult makeRepositoryResult(PersistentObject[] poArray)
          Package-private constructor allows Repository to construct a RepositoryResult using an array of PersistentObject instances.
static void reverse(RepositoryResult rr)
          Reverse the order of RepositoryResult's row list.
static void setAccountId(Account resoAcct, java.lang.String newAccountId)
          Set the accountId in the specified Account.
static void setAttributeConditions(RepositoryResult rr, AttributeCondition[] attrConds)
          Set 'attributeConditions' in a RepositoryResult.
static void setAttributes(RepositoryResult.Row row, WSAttributes attrs)
          Replace 'attributes' in a RepositoryResult.Row
static void setAuthFilter(RepositoryResult rr, AttributeExpression filter)
          Set 'authorizationFilter' in a RepositoryResult.
static void setBuffered(RepositoryResult rr, boolean b)
          Set 'buffered' in a RepositoryResult.
static void setCounterValue(PersistentObject po, long newValue)
          Replaces the counter value a PersistentObject.
static void setCreateDate(PersistentObject po, java.util.Date createDate)
          Replaces the value of a PersistentObject's CREATE_DATE.
static void setCreateDate(PersistentObject po, PersistentObject persisted)
          Replaces the value of a PersistentObject's CREATE_DATE with the CREATE_DATE from the specified PersistentObject (which is assumed to be the version of this object that is currently persisted in the repository.
static void setCreator(PersistentObject po, java.lang.String creator)
          Replaces the value of a PersistentObject's CREATOR.
static void setCurrentRowList(RepositoryResult rr, java.util.List changed)
           
static void setDataStore(RepositoryResult rr, java.lang.Object dataStore)
          Set 'dataStore' handle in a RepositoryResult.
static void setDisplayName(RepositoryResult.Row row, java.lang.String displayName)
           
static void setEndBefore(RepositoryResult rr, int rowNumber)
          Set 'endBefore' in a RepositoryResult.
static void setEndBefore(RepositoryResult rr, RepositoryResult.Row row)
          Set 'startAfter' in a RepositoryResult.
static void setEndBefore(RepositoryResult rr, java.lang.String[] endBefore)
          Set 'endBefore' in a RepositoryResult.
static void setFetchPrevious(RepositoryResult rr, boolean b)
          Set 'fetchPrevious' in a RepositoryResult.
static void setId(PersistentObject po, java.lang.String idString)
          Replaces the ID string in a PersistentObject.
static void setId(RepositoryResult.Row row, java.lang.String idString)
          Replace 'id' in a RepositoryResult.Row
static void setLastMod(PersistentObject po, long modified)
          Replaces the last modified time of a PersistentObject.
static void setLastModDate(PersistentObject po, java.util.Date lastModDate)
          Replaces the value of a PersistentObject's LAST_MOD_DATE.
static void setLastModifier(PersistentObject po, java.lang.String lastModifier)
          Replaces the value of a PersistentObject's LAST_MODIFIER.
static void setLockInfo(PersistentObject po, LockInfo lockInfo)
          Replaces object lock information.
static void setLockInfo(PersistentObject po, java.lang.String lockInfoString)
          Replaces the lock information taking a String value (such as the serial XML form of lock information).
static void setLockInfo(RepositoryResult.Row row, LockInfo lockInfo)
          Replace 'lockInfo' in a RepositoryResult.Row
static void setName(PersistentObject po, java.lang.String name)
          Replaces the name attribute of a PersistentObject.
static void setName(RepositoryResult.Row row, java.lang.String name)
          Replace 'name' in a RepositoryResult.Row
static void setNeedLockInfo(RepositoryResult rr, boolean needLockInfo)
          Set 'needLockInfo' in a RepositoryResult.
static void setNeedObject(RepositoryResult rr, boolean needObject)
          Set 'needObject' in a RepositoryResult.
static void setNeedSummary(RepositoryResult rr, boolean needSummary)
          Set 'needSummary' in a RepositoryResult.
static void setObject(RepositoryResult.Row row, PersistentObject po)
          Replace 'po' in a RepositoryResult.Row
static void setObjectLoader(RepositoryResult rr, ObjectLoader objectLoader)
          Set 'objectLoader' handle in a RepositoryResult.
static void setOperand(AttributeCondition ac, java.lang.String value)
          Set the operand in the specified AttributeCondition.
static void setOrderBy(RepositoryResult rr, Attribute[] orderBy)
          Set 'orderBy' in a RepositoryResult.
static void setProtected(PersistentObject po, boolean b)
           
static void setStartAfter(RepositoryResult rr, int rowNumber)
          Set 'startAfter' in a RepositoryResult.
static void setStartAfter(RepositoryResult rr, RepositoryResult.Row row)
          Set 'startAfter' in a RepositoryResult.
static void setStartAfter(RepositoryResult rr, java.lang.String[] startAfter)
          Set 'startAfter' in a RepositoryResult.
static void setTargetType(RepositoryResult rr, Type targetType)
          Set 'targetType' in a RepositoryResult.
static void setType(RepositoryResult.Row row, Type type)
          Replace 'type' in a RepositoryResult.Row
static void sort(RepositoryResult rr)
          Sort a RepositoryResult according to 'orderBy'.
static void trimToSize(RepositoryResult rr)
          Trim RepositoryResult's row list to its current size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

RepositoryProxy

public RepositoryProxy()
Method Detail

setId

public static void setId(PersistentObject po,
                         java.lang.String idString)
Replaces the ID string in a PersistentObject.

Parameters:
po - the PersistentObject to be updated
idString - the value to use

NOTE: The repository pokes the ID into a new object when it is first added to a data store. After that, no one should monkey with the ID.

(If someone _did_ monkey with the ID value in an object, it would be very easy to corrupt the database. For example, one could easily overwrite another object of the same type.)


setLockInfo

public static void setLockInfo(PersistentObject po,
                               java.lang.String lockInfoString)
                        throws InvalidArgument
Replaces the lock information taking a String value (such as the serial XML form of lock information).

NOTE: The repository writes lock information into a RepositoryProxy when the object is retrieved. No part of the Waveset system reads the lock information out of a RepositoryProxy. Therefore, clients are permitted to replace the lock information in a RepositoryProxy, but the action is meaningless.

Throws:
InvalidArgument

setLockInfo

public static void setLockInfo(PersistentObject po,
                               LockInfo lockInfo)
                        throws InvalidArgument
Replaces object lock information.

NOTE: The repository writes lock information into a RepositoryProxy when the object is retrieved. No part of the Waveset system reads the lock information out of a RepositoryProxy. Therefore, clients are permitted to replace the lock information in a RepositoryProxy, but the action is meaningless.

Throws:
InvalidArgument

setName

public static void setName(PersistentObject po,
                           java.lang.String name)
Replaces the name attribute of a PersistentObject.

NOTE: A PersistentObject gets a name when it is first constructed, and the Repository pokes a new name into it when it is renamed. Other than that, no one should monkey with the name.

(If someone _did_ monkey with the name value in an object, Repository would need to do the following in order to ensure consistency:

  1. trust only ID
  2. always replace name when it reads an item


setCounterValue

public static void setCounterValue(PersistentObject po,
                                   long newValue)
Replaces the counter value a PersistentObject.


setLastMod

public static void setLastMod(PersistentObject po,
                              long modified)
Replaces the last modified time of a PersistentObject.


setCreateDate

public static void setCreateDate(PersistentObject po,
                                 java.util.Date createDate)
Replaces the value of a PersistentObject's CREATE_DATE.


setCreateDate

public static void setCreateDate(PersistentObject po,
                                 PersistentObject persisted)
Replaces the value of a PersistentObject's CREATE_DATE with the CREATE_DATE from the specified PersistentObject (which is assumed to be the version of this object that is currently persisted in the repository.

Used by Importer and CheckinVisitor.


setLastModDate

public static void setLastModDate(PersistentObject po,
                                  java.util.Date lastModDate)
Replaces the value of a PersistentObject's LAST_MOD_DATE.


setLastModifier

public static void setLastModifier(PersistentObject po,
                                   java.lang.String lastModifier)
Replaces the value of a PersistentObject's LAST_MODIFIER.


setCreator

public static void setCreator(PersistentObject po,
                              java.lang.String creator)
Replaces the value of a PersistentObject's CREATOR.


getClassForType

public static java.lang.Class getClassForType(Type type)
Returns the java class for the specified object type NOTE: Type's getClass() method is package-private.


setOperand

public static void setOperand(AttributeCondition ac,
                              java.lang.String value)
Set the operand in the specified AttributeCondition. NOTE: AttributeCondition#setOperand is package-private.


setAccountId

public static void setAccountId(Account resoAcct,
                                java.lang.String newAccountId)
Set the accountId in the specified Account. NOTE: Account#setAccountId is package-private.


makeRepositoryResult

public static RepositoryResult makeRepositoryResult(PersistentObject[] poArray)
Package-private constructor allows Repository to construct a RepositoryResult using an array of PersistentObject instances.


makeRepositoryResult

public static RepositoryResult makeRepositoryResult(LockInfo[] lockInfoArray)
Package-private constructor allows Repository to construct a RepositoryResult using an array of LockInfo instances.


clear

public static void clear(RepositoryResult rr)
                  throws InvalidArgument
Clear RepositoryResult's row list.

Throws:
InvalidArgument

clearObjects

public static void clearObjects(RepositoryResult rr)
                         throws InvalidArgument
Clear RepositoryResult's _po fields

Throws:
InvalidArgument

reverse

public static void reverse(RepositoryResult rr)
                    throws InvalidArgument
Reverse the order of RepositoryResult's row list.

Throws:
InvalidArgument

getCurrentRowList

public static java.util.List getCurrentRowList(RepositoryResult rr)
                                        throws InvalidArgument
Permit access to RepositoryResult's row list.

Throws:
InvalidArgument

setCurrentRowList

public static void setCurrentRowList(RepositoryResult rr,
                                     java.util.List changed)

getCurrentSize

public static int getCurrentSize(RepositoryResult rr)
                          throws InvalidArgument
Permit access to the size of RepositoryResult's row list. Treat a null result as having size zero.

Throws:
InvalidArgument

ensureCapacity

public static void ensureCapacity(RepositoryResult rr,
                                  int minCapacity)
                           throws InvalidArgument
Trim RepositoryResult's row list to its current size.

Throws:
InvalidArgument

trimToSize

public static void trimToSize(RepositoryResult rr)
                       throws InvalidArgument
Trim RepositoryResult's row list to its current size.

Throws:
InvalidArgument

setAttributeConditions

public static void setAttributeConditions(RepositoryResult rr,
                                          AttributeCondition[] attrConds)
                                   throws InvalidArgument
Set 'attributeConditions' in a RepositoryResult.

Throws:
InvalidArgument

getAuthFilter

public static AttributeExpression getAuthFilter(RepositoryResult rr)
                                         throws InvalidArgument
Get 'authorizationFilter' from a RepositoryResult.

Throws:
InvalidArgument

setAuthFilter

public static void setAuthFilter(RepositoryResult rr,
                                 AttributeExpression filter)
                          throws InvalidArgument
Set 'authorizationFilter' in a RepositoryResult.

Throws:
InvalidArgument

getFetchPrevious

public static boolean getFetchPrevious(RepositoryResult rr)
                                throws InvalidArgument
Get 'fetchPrevious' from a RepositoryResult.

Throws:
InvalidArgument

setFetchPrevious

public static void setFetchPrevious(RepositoryResult rr,
                                    boolean b)
                             throws InvalidArgument
Set 'fetchPrevious' in a RepositoryResult.

Throws:
InvalidArgument

setOrderBy

public static void setOrderBy(RepositoryResult rr,
                              Attribute[] orderBy)
                       throws InvalidArgument
Set 'orderBy' in a RepositoryResult.

Throws:
InvalidArgument

sort

public static void sort(RepositoryResult rr)
                 throws InvalidArgument,
                        InternalError
Sort a RepositoryResult according to 'orderBy'. Sort() has been deprecated as a public method, Careful not to call this on a buffered result.

Throws:
InvalidArgument
InternalError

setProtected

public static void setProtected(PersistentObject po,
                                boolean b)

getStartAfter

public static java.lang.String[] getStartAfter(RepositoryResult rr)
                                        throws InvalidArgument
Get 'startAfter' from a RepositoryResult.

Throws:
InvalidArgument

setStartAfter

public static void setStartAfter(RepositoryResult rr,
                                 java.lang.String[] startAfter)
                          throws InvalidArgument
Set 'startAfter' in a RepositoryResult.

Throws:
InvalidArgument

setStartAfter

public static void setStartAfter(RepositoryResult rr,
                                 int rowNumber)
                          throws InvalidArgument
Set 'startAfter' in a RepositoryResult.

Throws:
InvalidArgument

setStartAfter

public static void setStartAfter(RepositoryResult rr,
                                 RepositoryResult.Row row)
                          throws InvalidArgument
Set 'startAfter' in a RepositoryResult.

Throws:
InvalidArgument

getEndBefore

public static java.lang.String[] getEndBefore(RepositoryResult rr)
                                       throws InvalidArgument
Get 'endBefore' from a RepositoryResult.

Throws:
InvalidArgument

setEndBefore

public static void setEndBefore(RepositoryResult rr,
                                java.lang.String[] endBefore)
                         throws InvalidArgument
Set 'endBefore' in a RepositoryResult.

Throws:
InvalidArgument

setEndBefore

public static void setEndBefore(RepositoryResult rr,
                                int rowNumber)
                         throws InvalidArgument
Set 'endBefore' in a RepositoryResult.

Throws:
InvalidArgument

setEndBefore

public static void setEndBefore(RepositoryResult rr,
                                RepositoryResult.Row row)
                         throws InvalidArgument
Set 'startAfter' in a RepositoryResult.

Throws:
InvalidArgument

setTargetType

public static void setTargetType(RepositoryResult rr,
                                 Type targetType)
                          throws InvalidArgument
Set 'targetType' in a RepositoryResult.

Throws:
InvalidArgument

getNeedObject

public static boolean getNeedObject(RepositoryResult rr)
                             throws InvalidArgument
Get 'needObject' from a RepositoryResult.

Throws:
InvalidArgument

setNeedObject

public static void setNeedObject(RepositoryResult rr,
                                 boolean needObject)
                          throws InvalidArgument
Set 'needObject' in a RepositoryResult.

Throws:
InvalidArgument

getNeedLockInfo

public static boolean getNeedLockInfo(RepositoryResult rr)
                               throws InvalidArgument
Get 'needLockInfo' from a RepositoryResult.

Throws:
InvalidArgument

setNeedLockInfo

public static void setNeedLockInfo(RepositoryResult rr,
                                   boolean needLockInfo)
                            throws InvalidArgument
Set 'needLockInfo' in a RepositoryResult.

Throws:
InvalidArgument

getNeedSummary

public static boolean getNeedSummary(RepositoryResult rr)
                              throws InvalidArgument
Get 'needSummary' from a RepositoryResult.

Throws:
InvalidArgument

setNeedSummary

public static void setNeedSummary(RepositoryResult rr,
                                  boolean needSummary)
                           throws InvalidArgument
Set 'needSummary' in a RepositoryResult.

Throws:
InvalidArgument

getObjectLoader

public static ObjectLoader getObjectLoader(RepositoryResult rr)
                                    throws InvalidArgument
Get 'objectLoader' handle from a RepositoryResult.

Throws:
InvalidArgument

setObjectLoader

public static void setObjectLoader(RepositoryResult rr,
                                   ObjectLoader objectLoader)
                            throws InvalidArgument
Set 'objectLoader' handle in a RepositoryResult.

Throws:
InvalidArgument

setDataStore

public static void setDataStore(RepositoryResult rr,
                                java.lang.Object dataStore)
                         throws InvalidArgument
Set 'dataStore' handle in a RepositoryResult.

Throws:
InvalidArgument

setBuffered

public static void setBuffered(RepositoryResult rr,
                               boolean b)
                        throws InvalidArgument
Set 'buffered' in a RepositoryResult.

Throws:
InvalidArgument

setId

public static void setId(RepositoryResult.Row row,
                         java.lang.String idString)
                  throws InvalidArgument
Replace 'id' in a RepositoryResult.Row

Throws:
InvalidArgument

setType

public static void setType(RepositoryResult.Row row,
                           Type type)
                    throws InvalidArgument
Replace 'type' in a RepositoryResult.Row

Throws:
InvalidArgument

setName

public static void setName(RepositoryResult.Row row,
                           java.lang.String name)
                    throws InvalidArgument
Replace 'name' in a RepositoryResult.Row

Throws:
InvalidArgument

setDisplayName

public static void setDisplayName(RepositoryResult.Row row,
                                  java.lang.String displayName)
                           throws InvalidArgument
Throws:
InvalidArgument

setObject

public static void setObject(RepositoryResult.Row row,
                             PersistentObject po)
                      throws InvalidArgument
Replace 'po' in a RepositoryResult.Row

Throws:
InvalidArgument

setLockInfo

public static void setLockInfo(RepositoryResult.Row row,
                               LockInfo lockInfo)
                        throws InvalidArgument
Replace 'lockInfo' in a RepositoryResult.Row

Throws:
InvalidArgument

setAttributes

public static void setAttributes(RepositoryResult.Row row,
                                 WSAttributes attrs)
                          throws InvalidArgument
Replace 'attributes' in a RepositoryResult.Row

Throws:
InvalidArgument

getInitialInstances

public static PersistentObject.InitialInstance[] getInitialInstances(Type type)
                                                              throws InternalError
Allows Repository to access protected method getInitialInstances()

Throws:
InternalError