public interface BlogHierarchySession extends OsidSession
This session defines methods for traversing a hierarchy of Blog
objects. Each node in the hierarchy is a unique Blog.
The hierarchy may be traversed recursively to establish the tree
structure through getParentBlogs()
and
getChildBlogs().
To relate these Ids
to another
OSID, getBlogNodes()
can be used for retrievals that can be
used for bulk lookups in other OSIDs. Any Blog
available in
the Blog 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 getParentBlogs()
or getChildBlogs()
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 |
canAccessBlogHierarchy()
Tests if this user can perform hierarchy queries.
|
Hierarchy |
getBlogHierarchy()
Gets the hierarchy associated with this session.
|
Id |
getBlogHierarchyId()
Gets the hierarchy
Id associated with this session. |
Node |
getBlogNodeIds(Id blogId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given blog.
|
BlogNode |
getBlogNodes(Id blogId,
long ancestorLevels,
long descendantLevels,
boolean includeSiblings)
Gets a portion of the hierarchy for the given blog.
|
IdList |
getChildBlogIds(Id blogId)
Gets the child
Ids of the given blog. |
BlogList |
getChildBlogs(Id blogId)
Gets the children of the given blog.
|
IdList |
getParentBlogIds(Id blogId)
Gets the parent
Ids of the given blog. |
BlogList |
getParentBlogs(Id blogId)
Gets the parents of the given blog.
|
IdList |
getRootBlogIds()
Gets the root blog
Ids in this hierarchy. |
BlogList |
getRootBlogs()
Gets the root blogs in the blog hierarchy.
|
boolean |
hasChildBlogs(Id blogId)
Tests if a blog has any children.
|
boolean |
hasParentBlogs(Id blogId)
Tests if the
Blog has any parents. |
boolean |
isAncestorOfBlog(Id id,
Id blogId)
Tests if an
Id is an ancestor of a blog. |
boolean |
isChildOfBlog(Id id,
Id blogId)
Tests if a blog is a direct child of another.
|
boolean |
isDescendantOfBlog(Id id,
Id blogId)
Tests if an
Id is a descendant of a blog. |
boolean |
isParentOfBlog(Id id,
Id blogId)
Tests if an
Id is a direct parent of a blog. |
void |
useComparativeBlogView()
The returns from the blog methods may omit or translate elements based
on this session, such as authorization, and not result in an error.
|
void |
usePlenaryBlogView()
A complete view of the
Blog returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBlogHierarchyId()
Id
associated with this session. Id
associated with this sessionmandatory
- This method must be implemented. Hierarchy getBlogHierarchy() throws OperationFailedException, PermissionDeniedException
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canAccessBlogHierarchy()
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 useComparativeBlogView()
mandatory
- This method is must be implemented. void usePlenaryBlogView()
Blog
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 getRootBlogIds() throws OperationFailedException, PermissionDeniedException
Ids
in this hierarchy. Ids
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BlogList getRootBlogs() 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 hasParentBlogs(Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Blog
has any parents.blogId
- a blog Id
true
if the blog has parents, false
otherwiseNotFoundException
- blogId
is not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isParentOfBlog(Id id, Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a direct parent of a blog.id
- an Id
blogId
- a blog Id
true
if this id
is a parent of
blogId,
false
otherwiseNotFoundException
- blogId
is not foundNullArgumentException
- id
or
blogId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getParentBlogIds(Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given blog.blogId
- a blog Id
Ids
of the blogNotFoundException
- blogId
is not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BlogList getParentBlogs(Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
blogId
- the Id
to queryNotFoundException
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isAncestorOfBlog(Id id, Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is an ancestor of a blog.id
- an Id
blogId
- the Id
of a blog true
if this id
is an ancestor
of blogId,
false
otherwiseNotFoundException
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
boolean hasChildBlogs(Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
blogId
- a blogId
true
if the blogId
has children,
false
otherwiseNotFoundException
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isChildOfBlog(Id id, Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
id
- an Id
blogId
- the Id
of a blog true
if the id
is a child of
blogId,
false
otherwiseNotFoundException
- blogId
not foundNullArgumentException
- blogId
or
id
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
not found return false.
IdList getChildBlogIds(Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Ids
of the given blog.blogId
- the Id
to queryNotFoundException
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BlogList getChildBlogs(Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
blogId
- the Id
to queryNotFoundException
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean isDescendantOfBlog(Id id, Id blogId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id
is a descendant of a blog.id
- an Id
blogId
- the Id
of a blog true
if the id
is a descendant
of the blogId,
false
otherwiseNotFoundException
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. If
- id
is not found return false.
Node getBlogNodeIds(Id blogId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
blogId
- 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
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. BlogNode getBlogNodes(Id blogId, long ancestorLevels, long descendantLevels, boolean includeSiblings) throws NotFoundException, OperationFailedException, PermissionDeniedException
blogId
- 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
- blogId
not foundNullArgumentException
- blogId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.