public interface PostLookupSession extends OsidSession
This session provides methods for retrieving Post
objects. The Post
represents a collection of replies.
This session defines views that offer differing behaviors when retrieving multiple objects.
PostAdminSession.
The methods useFederatedForumView() and useIsolatedForumView() behave as a radio group and one should be selected before invoking any lookup methods.
Modifier and Type | Method and Description |
---|---|
boolean |
canLookupPosts()
Tests if this user can perform
Post lookups. |
Forum |
getForum()
Gets the
Forum associated with this session. |
Id |
getForumId()
Gets the
Forum Id associated with this
session. |
Post |
getPost(Id postId)
Gets the
Post specified by its Id. |
PostList |
getPosts()
Gets all
Posts. |
PostList |
getPostsByDate(DateTime from,
DateTime to)
Gets a
PostList in the given date range inclusive. |
PostList |
getPostsByDateForPoster(Id resourceId,
DateTime from,
DateTime to)
Gets a
PostList by the given poster and in the given
date range inclusive. |
PostList |
getPostsByGenusType(Type postGenusType)
Gets a
PostList corresponding to the given post genus
Type which does not include posts of genus types
derived from the specified Type. |
PostList |
getPostsByIds(IdList postIds)
Gets a
PostList corresponding to the given
IdList. |
PostList |
getPostsByParentGenusType(Type postGenusType)
Gets a
PostList corresponding to the given post genus
Type and include any additional posts with genus types
derived from the specified Type. |
PostList |
getPostsByRecordType(Type postRecordType)
Gets a
PostList containing the given post record
Type. |
PostList |
getPostsForPoster(Id resourceId)
Gets a
PostList for the given poster. |
void |
useComparativePostView()
The returns from the lookup methods may omit or translate elements
based on this session, such as authorization, and not result in an
error.
|
void |
useFederatedForumView()
Federates the view for methods in this session.
|
void |
useIsolatedForumView()
Isolates the view for methods in this session.
|
void |
usePlenaryPostView()
A complete view of the
Post returns is desired. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getForumId()
Forum
Id
associated with this
session. Forum Id
associated with this sessionmandatory
- This method must be implemented. Forum getForum() throws OperationFailedException, PermissionDeniedException
Forum
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canLookupPosts()
Post
lookups. A return
of true does not guarantee successful authorization. A return of false
indicates that it is known all methods in this session will result in
a PERMISSION_DENIED.
This is intended as a hint to an
application that may not offer lookup operations to unauthorized
users. false
if lookup methods are not authorized,
true
otherwisemandatory
- This method must be implemented. void useComparativePostView()
mandatory
- This method is must be implemented. void usePlenaryPostView()
Post
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. void useFederatedForumView()
mandatory
- This method is must be implemented. void useIsolatedForumView()
mandatory
- This method is must be implemented. Post getPost(Id postId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Post
specified by its Id.
In
plenary mode, the exact Id
is found or a
NOT_FOUND
results. Otherwise, the returned Post
may have a different Id
than requested, such as the
case where a duplicate Id
was assigned to a Post
and retained for compatibility.postId
- Id
of the Post
NotFoundException
- postId
not foundNullArgumentException
- postId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method is must be implemented. PostList getPostsByIds(IdList postIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
PostList
corresponding to the given
IdList.
In plenary mode, the returned list contains all of the
posts specified in the Id
list, in the order of the
list, including duplicates, or an error results if an Id
in the supplied list is not found or inaccessible. Otherwise,
inaccessible Posts
may be omitted from the list and may
present the elements in any order including returning a unique set.postIds
- the list of Ids
to retrieve Post
listNotFoundException
- an Id was
not foundNullArgumentException
- postIds
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPostsByGenusType(Type postGenusType) throws OperationFailedException, PermissionDeniedException
PostList
corresponding to the given post genus
Type
which does not include posts of genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known posts or an error results. Otherwise,
the returned list may contain only those posts that are accessible
through this session.postGenusType
- a post genus type Post
listNullArgumentException
- postGenusType
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPostsByParentGenusType(Type postGenusType) throws OperationFailedException, PermissionDeniedException
PostList
corresponding to the given post genus
Type
and include any additional posts with genus types
derived from the specified Type.
In plenary mode, the
returned list contains all known posts or an error results. Otherwise,
the returned list may contain only those posts that are accessible
through this session.postGenusType
- a post genus type Post
listNullArgumentException
- postGenusType
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPostsByRecordType(Type postRecordType) throws OperationFailedException, PermissionDeniedException
PostList
containing the given post record
Type.
In plenary mode, the returned list contains all known
posts or an error results. Otherwise, the returned list may contain
only those posts that are accessible through this session.postRecordType
- a post record type Post
listNullArgumentException
- postRecordType
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPostsByDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
PostList
in the given date range inclusive.
In plenary mode, the returned list contains all known
posts or an error results. Otherwise, the returned list may contain
only those posts that are accessible through this session.from
- start of date rangeto
- end of date range Post
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- from
or
to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPostsForPoster(Id resourceId) throws OperationFailedException, PermissionDeniedException
PostList
for the given poster.
In
plenary mode, the returned list contains all known posts or an error
results. Otherwise, the returned list may contain only those posts
that are accessible through this session.resourceId
- a resource Id
Post
listNullArgumentException
- resourceId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPostsByDateForPoster(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
PostList
by the given poster and in the given
date range inclusive.
In plenary mode, the returned
list contains all known posts or an error results. Otherwise, the
returned list may contain only those posts that are accessible through
this session.resourceId
- a resource Id
from
- start of date rangeto
- end of date range Post
listInvalidArgumentException
- from
is
greater than to
NullArgumentException
- resourceId, from
or to
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. PostList getPosts() throws OperationFailedException, PermissionDeniedException
Posts.
In plenary mode, the returned list
contains all known posts or an error results. Otherwise, the returned
list may contain only those posts that are accessible through this
session. Posts
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.