public interface OfficeHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Office
objects. Each node in the hierarchy is a unique
Office.
The hierarchy may be traversed recursively to establish
the tree structure through getParentOffices()
and
getChildOffices().
To relate these Ids
to another
OSID, getOfficeNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Office
available in the Workflow OSID is known to this hierarchy but does not
appear in the hierarchy traversal until added as a root availability or a
child of another availability.
A user may not be authorized to traverse the entire hierarchy. Parts
of the hierarchy may be made invisible through omission from the returns
of getParentOffices()
or getChildOffices()
in lieu of a PERMISSION_DENIED
error that may disrupt the
traversal through authorized stepways.
This session defines views that offer differing behaviors when retrieving multiple objects.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccessOfficeHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildOfficeIds(Id officeId)
Gets the child
Ids of the given office. |
OfficeList |
getChildOffices(Id officeId)
Gets the children of the given office.
|
Hierarchy |
getOfficeHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getOfficeHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getOfficeNodeIds(Id officeId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given office.
|
OfficeNode |
getOfficeNodes(Id officeId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given office.
|
IdList |
getParentOfficeIds(Id officeId)
Gets the parent
Ids of the given office. |
OfficeList |
getParentOffices(Id officeId)
Gets the parents of the given office.
|
IdList |
getRootOfficeIds()
Gets the root office
Ids in this hierarchy. |
OfficeList |
getRootOffices()
Gets the root office in the office hierarchy.
|
boolean |
hasChildOffices(Id officeId)
Tests if an office has any children.
|
boolean |
hasParentOffices(Id officeId)
Tests if the
Office has any parents. |
boolean |
isAncestorOfOffice(Id id,
Id officeId)
Tests if an
Id is an ancestor of an office. |
boolean |
isChildOfOffice(Id id,
Id officeId)
Tests if an office is a direct child of another.
|
boolean |
isDescendantOfOffice(Id id,
Id officeId)
Tests if an
Id is a descendant of an office. |
boolean |
isParentOfOffice(Id id,
Id officeId)
Tests if an
Id is a direct parent of office. |
void |
useComparativeOfficeView()
The returns from the office methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryOfficeView()
A complete view of the
Offices returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getOfficeHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getOfficeHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessOfficeHierarchy()
PERMISSION_DENIED.
This is intended as a hint to an
application that may opt not to offer lookup operations. false
if hierarchy traversal methods are not
authorized, true
otherwisemandatory
- This method must be implemented. void useComparativeOfficeView()
mandatory
- This method is must be implemented. void usePlenaryOfficeView()
Offices
returns is desired.
Methods will return what is requested or result in an error. This view
is used when greater precision is desired at the expense of
interoperability.mandatory
- This method is must be implemented. IdList getRootOfficeIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. OfficeList getRootOffices() throws OperationFailedException, PermissionDeniedException
Ids
are known to
the hierarchy, an orphan does not appear in the hierarchy unless
explicitly added as a root availability or child of another
availability.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Office
has any parents.officeId
- an office Id
true
if the office has parents, f alse
otherwiseNotFoundException
- officeId
is not
foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of office.id
- an Id
officeId
- the Id
of an office true
if this id
is a parent of
officeId,
f alse
otherwiseNotFoundException
- officeId
is not
foundNullArgumentException
- id
or
officeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentOfficeIds(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given office.officeId
- an office Id
Ids
of the officeNotFoundException
- officeId
is not
foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. OfficeList getParentOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
officeId
- the Id
to queryNotFoundException
- officeId
not foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of an office.id
- an Id
officeId
- the Id
of an office tru
e if this id
is an ancestor
of officeId,
false
otherwiseNotFoundException
- officeId
not foundNullArgumentException
- officeId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
officeId
- an office Id
true
if the officeId
has
children, false
otherwiseNotFoundException
- officeId
not foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
officeId
- the Id
of an office true
if the Id
is a child of
officeId,
false
otherwiseNotFoundException
- officeId
not foundNullArgumentException
- id
or
officeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildOfficeIds(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given office.officeId
- the Id
to queryNotFoundException
- officeId
not foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. OfficeList getChildOffices(Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
officeId
- the Id
to queryNotFoundException
- officeId
not foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfOffice(Id id, Id officeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of an office.id
- an Id
officeId
- the Id
of an office true
if the id
is a descendant
of the officeId,
false
otherwiseNotFoundException
- officeId
not foundNullArgumentException
- id
or
officeId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getOfficeNodeIds(Id officeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
officeId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the availability.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the availability.includeSiblings
- true
to include the siblings of
the given availability, false
to omit the
siblingsNotFoundException
- officeId
not foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. OfficeNode getOfficeNodes(Id officeId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
officeId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the availability.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the availability.includeSiblings
- true
to include the siblings of
the given availability, false
to omit the
siblingsNotFoundException
- officeId
not foundNullArgumentException
- officeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.