public interface PostEntryAdminSession extends OsidSession
This session creates, updates, and deletes PostEntries.
The data for create and update is provided by the consumer via the form
object. OsidForms
are requested for each create or update
and may not be reused.
Create and update operations differ in their usage. To create a
PostEntry,
a PostEntryForm
is requested using
getPostEntryFormForCreate()
specifying the desired post and
record Types
or none if no record Types
are
needed. The returned PostEntryForm
will indicate that it is
to be used with a create operation and can be used to examine metdata or
validate data prior to creation. Once the PostEntryForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
PostEntryForm
corresponds to an attempted transaction.
For updates, PostEntryForms
are requested to the
PostEntry
Id
that is to be updated using
getPostEntryFormForUpdate().
Similarly, the PostEntryForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The PostEntryForm
can only be used once for a successful update and cannot be reused.
The delete operations delete PostEntryForms.
To unmap a
PostEntry
from the current Business,
the
PostEntryBusinessAssignmentSession
should be used. These
delete operations attempt to remove the PostEntryForm
itself thus removing it from all known Business
catalogs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasPostEntry(Id postEntryId,
Id aliasId)
Adds an
Id to a PostEntry for the
purpose of creating compatibility. |
boolean |
canCreatePostEntries()
Tests if this user can create
PostEntries. |
boolean |
canCreatePostEntryWithRecordTypes(Type[] postEntryRecordTypes)
Tests if this user can create a single
PostEntry using
the desired record types. |
boolean |
canDeletePostEntries()
Tests if this user can delete
PostEntries. |
boolean |
canManagePostEntryAliases()
Tests if this user can manage
Id aliases for
PostEntries. |
boolean |
canUpdatePostEntries()
Tests if this user can update
PostEntries. |
PostEntry |
createPostEntry(PostEntryForm entryForm)
Creates a new
PostEntry. |
void |
deletePostEntry(Id postEntryId)
Deletes a
PostEntry. |
Business |
getBusiness()
Gets the
Business associated with this session. |
Id |
getBusinessId()
Gets the
Business Id associated with
this session. |
PostEntryForm |
getPostEntryFormForCreate(Id postId,
Type[] postEntryRecordTypes)
Gets the post entry form for creating new post entries.
|
PostEntryForm |
getPostEntryFormForUpdate(Id postEntryId)
Gets the post entry form for updating an existing post entries.
|
void |
updatePostEntry(PostEntryForm entryForm)
Updates an existing post entries.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBusinessId()
Business
Id
associated with
this session. Business Id
associated with this sessionmandatory
- This method must be implemented. Business getBusiness() throws OperationFailedException, PermissionDeniedException
Business
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreatePostEntries()
PostEntries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a PostEntry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer create operations to
an unauthorized user. false
if PostEntry
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreatePostEntryWithRecordTypes(Type[] postEntryRecordTypes)
PostEntry
using
the desired record types. While
FinancialsPostingManager.getPostEntryRecordTypes()
can be used
to examine which records are supported, this method tests which
record(s) are required for creating a specific PostEntry.
Providing an empty array tests if a PostEntry
can be created with no records.postEntryRecordTypes
- array of post entry record types true
if PostEntry
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- postEntryRecordTypes
is null
mandatory
- This method must be implemented. PostEntryForm getPostEntryFormForCreate(Id postId, Type[] postEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
postId
- a post Id
postEntryRecordTypes
- array of post entry record typesNotFoundException
- postId
is not foundNullArgumentException
- postId
or
postEntryRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. PostEntry createPostEntry(PostEntryForm entryForm) throws OperationFailedException, PermissionDeniedException
PostEntry.
entryForm
- the form for this PostEntry
PostEntry
IllegalStateException
- entryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- entryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- entryForm
did not
originate from getPostEntryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdatePostEntries()
PostEntries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a PostEntry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer update operations to
an unauthorized user. false
if PostEntry
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. PostEntryForm getPostEntryFormForUpdate(Id postEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
postEntryId
- the Id
of the PostEntry
NotFoundException
- postEntryId
is not
foundNullArgumentException
- postEntryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updatePostEntry(PostEntryForm entryForm) throws OperationFailedException, PermissionDeniedException
entryForm
- the form containing the elements to be updatedIllegalStateException
- entryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- entryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- entryForm
did not
originate from getPostEntryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeletePostEntries()
PostEntries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a PostEntry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may opt not to offer delete operations to
an unauthorized user. false
if PostEntry
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deletePostEntry(Id postEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
PostEntry.
postEntryId
- the Id
of the PostEntry
to removeNotFoundException
- postEntryId
not
foundNullArgumentException
- postEntryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManagePostEntryAliases()
Id
aliases for
PostEntries.
A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED.
This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false
if PostEntry
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasPostEntry(Id postEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a PostEntry
for the
purpose of creating compatibility. The primary Id
of
the PostEntry
is deentryined by the provider. The new
Id
performs as an alias to the primary Id
. If the alias is a pointer to another post entry, it is
reassigned to the given post entry Id.
postEntryId
- the Id
of a PostEntry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- postEntryId
not
foundNullArgumentException
- postEntryId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.