public interface JournalHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of
Journal
objects. Each node in the hierarchy is a unique
Journal.
The hierarchy may be traversed recursively to establish
the tree structure through getParentJournals()
and
getChildJournals().
To relate these Ids
to another
OSID, getJournalNodes()
can be used for retrievals that can
be used for bulk lookups in other OSIDs. Any Journal
available in the Journaling OSID is known to this hierarchy but does not
appear in the hierarchy traversal until added as a root node or a child of
another node.
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 getParentJournals()
or getChildJournals()
in lieu of a PERMISSION_DENIED
error that may disrupt the
traversal through authorized pathways.
This session defines views that offer differing behaviors when retrieving multiple objects.
Modifier and Type | Method and Description |
---|---|
boolean |
canAccessJournalHierarchy()
Tests if this user can perform hierarchy queries.
|
IdList |
getChildJournalIds(Id journalId)
Gets the child
Ids of the given journal. |
JournalList |
getChildJournals(Id journalId)
Gets the child journals of the given
id. |
Hierarchy |
getJournalHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getJournalHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getJournalNodeIds(Id journalId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given journal.
|
JournalNode |
getJournalNodes(Id journalId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given journal.
|
IdList |
getParentJournalIds(Id journalId)
Gets the parent
Ids of the given journal. |
JournalList |
getParentJournals(Id journalId)
Gets the parent journals of the given
id. |
IdList |
getRootJournalIds()
Gets the root journal
Ids in this hierarchy. |
JournalList |
getRootJournals()
Gets the root journals in the journal hierarchy.
|
boolean |
hasChildJournals(Id journalId)
Tests if a journal has any children.
|
boolean |
hasParentJournals(Id journalId)
Tests if the
Journal has any parents. |
boolean |
isAncestorOfJournal(Id id,
Id journalId)
Tests if an
Id is an ancestor of a journal. |
boolean |
isChildOfJournal(Id id,
Id journalId)
Tests if a journal is a direct child of another.
|
boolean |
isDescendantOfJournal(Id id,
Id journalId)
Tests if an
Id is a descendant of a journal. |
boolean |
isParentOfJournal(Id id,
Id journalId)
Tests if an
Id is a direct parent of journal. |
void |
useComparativeJournalView()
The returns from the journal methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
usePlenaryJournalView()
A complete view of the
Journal returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getJournalHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getJournalHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessJournalHierarchy()
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 useComparativeJournalView()
mandatory
- This method is must be implemented. void usePlenaryJournalView()
Journal
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 getRootJournalIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. JournalList getRootJournals() throws OperationFailedException, PermissionDeniedException
Ids
are known
to the hierarchy, an orphan does not appear in the hierarchy unless
explicitly added as a root node or child of another node.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. boolean hasParentJournals(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Journal
has any parents.journalId
- a journal Id
true
if the journal has parents, f alse
otherwiseNotFoundException
- journalId
is not
foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfJournal(Id id, Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of journal.id
- an Id
journalId
- the Id
of a journal true
if this id
is a parent of
journalId,
f alse
otherwiseNotFoundException
- journalId
is not
foundNullArgumentException
- id
or
journalId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentJournalIds(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given journal.journalId
- a journal Id
Ids
of the journalNotFoundException
- journalId
is not
foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. JournalList getParentJournals(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id.
journalId
- the Id
of the Journal
to query id
NotFoundException
- a Journal
identified
by Id is
not foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfJournal(Id id, Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a journal.id
- an Id
journalId
- the Id
of a journal tru
e if this id
is an ancestor
of journalId,
false
otherwiseNotFoundException
- journalId
is not
foundNullArgumentException
- id
or
journalId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildJournals(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
journalId
- a journal Id
true
if the journalId
has
children, false
otherwiseNotFoundException
- journalId
is not
foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfJournal(Id id, Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
journalId
- the Id
of a journal true
if the id
is a child of
journalId,
false
otherwiseNotFoundException
- journalId
is not
foundNullArgumentException
- id
or
journalId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildJournalIds(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given journal.journalId
- the Id
to queryNotFoundException
- journalId
is not
foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. JournalList getChildJournals(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id.
journalId
- the Id
of the Journal
to query id
NotFoundException
- a Journal
identified
by Id is
not foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfJournal(Id id, Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a journal.id
- an Id
journalId
- the Id
of a journal true
if the id
is a descendant
of the journalId,
false
otherwiseNotFoundException
- journalId
is not
foundNullArgumentException
- id
or
journalId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getJournalNodeIds(Id journalId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
journalId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings
- true
to include the siblings of
the given node, false
to omit the siblingsNotFoundException
- journalId
is not
foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. JournalNode getJournalNodes(Id journalId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
journalId
- the Id
to queryancestorLevels
- the maximum number of ancestor levels to
include. A value of 0 returns no parents in the node.descendantLevels
- the maximum number of descendant levels to
include. A value of 0 returns no children in the node.includeSiblings
- true
to include the siblings of
the given node, false
to omit the siblingsNotFoundException
- journalId
is not
foundNullArgumentException
- journalId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.