com.ptc.core.command.common.bean.repository
Class AbstractRepositoryCommand

java.lang.Object
  extended by com.ptc.core.command.common.bean.AbstractCommand
      extended by com.ptc.core.command.common.bean.AbstractServerCommand
          extended by com.ptc.core.command.common.bean.repository.AbstractRepositoryCommand
All Implemented Interfaces:
PageRequest, RepositoryCommand, com.ptc.core.command.common.Command, com.ptc.core.command.common.ServerCommand, Externalizable, Serializable
Direct Known Subclasses:
AbstractQueryCommand

public abstract class AbstractRepositoryCommand
extends com.ptc.core.command.common.bean.AbstractServerCommand
implements RepositoryCommand, Externalizable

This is an abstract representation of a command that can act upon a repository in the system. A repository is the notion of a container of objects that can be a database, flat file, file system, etc. This abstract class specializes the notion of a general command for a repository.

From this abstract class it's expected that all repositories can be acted upon in a both common and specialized commands. For instance, a query could be thought of as a general inquiry into a repository to "find" objects. The objects themselves could live in a database or file system. It would be up to the specific command delegate to realize the implementaton.

Additionally, as part of doing a general inquiry there could exist the notion of server-side paging where only a single page, size specified by the user, is returned to the client. Then the client could iterate through pages as applicable, and ultimately close the paging session when done.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.ptc.core.command.common.bean.repository.RepositoryCommand
PAGE_MODE, RESULT_CONTAINER, RESULT_SESSION, SORT
 
Fields inherited from interface com.ptc.core.command.common.bean.repository.PageRequest
COUNT, OFFSET
 
Method Summary
 int getCount()
          Gets the value of the attribute: count; Number of items for the page.
 int getOffset()
          Gets the value of the attribute: offset; Offset of the page.
 PageMode getPageMode()
          Gets the value of the attribute: pageMode; This attribute is an input that specifies the paging mode.
 ResultContainer getResultContainer()
          Gets the value of the attribute: resultContainer; The container of type instances that are a result of a command being executed against a repository.
 TypeInstance[] getResultList()
          Provides an implementation to get the resultContainer and return it uniformly as a single-to-multi element TypeInstance array.
 RepositoryPagingSession getResultSession()
          Gets the value of the attribute: resultSession; The Paging Session, if one has been established.
 com.ptc.core.meta.common.SortSpec getSort()
          Gets the value of the attribute: sort; This attribute is an input that specifies the sort order of the result TypeInstances.
 void setCount(int a_Count)
          Sets the value of the attribute: count; Number of items for the page.
 void setOffset(int a_Offset)
          Sets the value of the attribute: offset; Offset of the page.
 void setPageMode(PageMode a_PageMode)
          Sets the value of the attribute: pageMode; This attribute is an input that specifies the paging mode.
 void setSort(com.ptc.core.meta.common.SortSpec a_Sort)
          Sets the value of the attribute: sort; This attribute is an input that specifies the sort order of the result TypeInstances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getOffset

public int getOffset()
Gets the value of the attribute: offset; Offset of the page.

Supported API: true

Specified by:
getOffset in interface PageRequest
Returns:
int

setOffset

public void setOffset(int a_Offset)
               throws WTPropertyVetoException
Sets the value of the attribute: offset; Offset of the page.

Supported API: true

Specified by:
setOffset in interface PageRequest
Parameters:
a_Offset -
Throws:
WTPropertyVetoException

getCount

public int getCount()
Gets the value of the attribute: count; Number of items for the page.

Supported API: true

Specified by:
getCount in interface PageRequest
Returns:
int

setCount

public void setCount(int a_Count)
              throws WTPropertyVetoException
Sets the value of the attribute: count; Number of items for the page.

Supported API: true

Specified by:
setCount in interface PageRequest
Parameters:
a_Count -
Throws:
WTPropertyVetoException

getResultContainer

public ResultContainer getResultContainer()
Gets the value of the attribute: resultContainer; The container of type instances that are a result of a command being executed against a repository.

Supported API: true

Specified by:
getResultContainer in interface RepositoryCommand
Returns:
ResultContainer

getResultSession

public RepositoryPagingSession getResultSession()
                                         throws UnsupportedOperationException
Gets the value of the attribute: resultSession; The Paging Session, if one has been established.

Supported API: true

Specified by:
getResultSession in interface RepositoryCommand
Returns:
RepositoryPagingSession
Throws:
UnsupportedOperationException

getResultList

public TypeInstance[] getResultList()
                             throws WTException
Provides an implementation to get the resultContainer and return it uniformly as a single-to-multi element TypeInstance array.

Supported API: true

Returns:
TypeInstance[]
Throws:
WTException

getSort

public com.ptc.core.meta.common.SortSpec getSort()
                                          throws UnsupportedOperationException,
                                                 WTException
Gets the value of the attribute: sort; This attribute is an input that specifies the sort order of the result TypeInstances. Its implementation is derived by more specialized commands that extend this class.

Supported API: true

Specified by:
getSort in interface RepositoryCommand
Returns:
SortSpec
Throws:
UnsupportedOperationException
WTException

setSort

public void setSort(com.ptc.core.meta.common.SortSpec a_Sort)
             throws UnsupportedOperationException,
                    WTPropertyVetoException
Sets the value of the attribute: sort; This attribute is an input that specifies the sort order of the result TypeInstances. Its implementation is derived by more specialized commands that extend this class.

Supported API: true

Specified by:
setSort in interface RepositoryCommand
Parameters:
a_Sort -
Throws:
UnsupportedOperationException
WTPropertyVetoException

getPageMode

public PageMode getPageMode()
                     throws UnsupportedOperationException
Gets the value of the attribute: pageMode; This attribute is an input that specifies the paging mode. Its implementation is derived by more specialized commands that extend this class.

Supported API: true

Specified by:
getPageMode in interface RepositoryCommand
Returns:
PageMode
Throws:
UnsupportedOperationException

setPageMode

public void setPageMode(PageMode a_PageMode)
                 throws UnsupportedOperationException,
                        WTPropertyVetoException
Sets the value of the attribute: pageMode; This attribute is an input that specifies the paging mode. Its implementation is derived by more specialized commands that extend this class.

Supported API: true

Specified by:
setPageMode in interface RepositoryCommand
Parameters:
a_PageMode -
Throws:
UnsupportedOperationException
WTPropertyVetoException