public interface JournalEntryAdminSession extends OsidSession
This session creates, updates, and deletes JournalEntries.
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
JournalEntry,
a JournalEntryForm
is requested using
getJournalEntryFormForCreate()
specifying the desired
record Types
or none if no record Types
are
needed. The returned JournalEntryForm
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 JournalEntryForm
is submiited to a create operation, it cannot be reused with
another create operation unless the first operation was unsuccessful. Each
JournalEntryForm
corresponds to an attempted transaction.
For updates, JournalEntryForms
are requested to the
JournalEntry
Id
that is to be updated using
getJournalEntryFormForUpdate().
Similarly, the
JournalEntryForm
has metadata about the data that can be updated
and it can perform validation before submitting the update. The
JournalEntryForm
can only be used once for a successful update and
cannot be reused.
The delete operations delete JournalEntries.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasJournalEntry(Id journalEntryId,
Id aliasId)
Adds an
Id to a JournalEntry for the
purpose of creating compatibility. |
boolean |
canCreateJournalEntries()
Tests if this user can create journal entries.
|
boolean |
canCreateJournalEntryWithRecordTypes(Type[] journalEntryRecordTypes)
Tests if this user can create a single
JournalEntry
using the desired record interface types. |
boolean |
canDeleteJournalEntries()
Tests if this user can delete journal entries.
|
boolean |
canManageJournalEntryAliases()
Tests if this user can manage
Id aliases for journal
entries. |
boolean |
canUpdateJournalEntries()
Tests if this user can update journal entries.
|
JournalEntry |
createJournalEntry(JournalEntryForm journalEntryForm)
Creates a new
JournalEntry. |
void |
deleteJournalEntry(Id journalEntryId)
Deletes a
JournalEntry. |
Journal |
getJournal()
Gets the
Journal associated with this session. |
JournalEntryForm |
getJournalEntryFormForCreate(Id branchId,
Id sourceId,
Type[] journalEntryRecordTypes)
Gets the journal entry form for creating new entries.
|
JournalEntryForm |
getJournalEntryFormForUpdate(Id journalEntryId)
Gets the journal entry form for updating an existing entry.
|
Id |
getJournalId()
Gets the
Journal Id associated with this
session. |
void |
updateJournalEntry(JournalEntryForm journalEntryForm)
Updates an existing journal entry.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getJournalId()
Journal
Id
associated with this
session. Journal Id
associated with this sessionmandatory
- This method must be implemented. Journal getJournal() throws OperationFailedException, PermissionDeniedException
Journal
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateJournalEntries()
JournalEntry
will result in
a PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer create operations to
unauthorized users. false
if JournalEntry
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateJournalEntryWithRecordTypes(Type[] journalEntryRecordTypes)
JournalEntry
using the desired record interface types. While
JournalingManager.getJournalEntryRecordTypes()
can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific JournalEntry.
Providing an empty array tests if a JournalEntry
can be created with no records.journalEntryRecordTypes
- array of journal entry record types true
if JournalEntry
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- journalEntryRecordTypes
is null
mandatory
- This method must be implemented. JournalEntryForm getJournalEntryFormForCreate(Id branchId, Id sourceId, Type[] journalEntryRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
branchId
- the Id
for the branchsourceId
- the Id
for the journaled objectjournalEntryRecordTypes
- array of journal entry record typesNotFoundException
- branchId
is not
foundNullArgumentException
- branchId, sourceId,
or journalEntryRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. JournalEntry createJournalEntry(JournalEntryForm journalEntryForm) throws OperationFailedException, PermissionDeniedException
JournalEntry.
journalEntryForm
- the form for this JournalEntry
JournalEntry
IllegalStateException
- journalEntryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- journalEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- journalEntryForm
did not originate from getJournalEntryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateJournalEntries()
JournalEntry
will result in
a PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer update operations to
unauthorized users. false
if JournalEntry
modification is not authorized, true
otherwisemandatory
- This method must be implemented. JournalEntryForm getJournalEntryFormForUpdate(Id journalEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
journalEntryId
- the Id
of the
JournalEntry
NotFoundException
- journalEntryId
is
not foundNullArgumentException
- journalEntryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateJournalEntry(JournalEntryForm journalEntryForm) throws OperationFailedException, PermissionDeniedException
journalEntryForm
- the form containing the elements to be
updatedIllegalStateException
- journalEntryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- journalEntryForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- journalEntryForm
did not originate from getJournalEntryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteJournalEntries()
JournalEntry
will result in
a PERMISSION_DENIED.
This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false
if JournalEntry
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteJournalEntry(Id journalEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
JournalEntry.
journalEntryId
- the Id
of the
JournalEntry
to removeNotFoundException
- journalEntryId
not
foundNullArgumentException
- journalEntryId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageJournalEntryAliases()
Id
aliases for journal
entries. 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 JournalEntry
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasJournalEntry(Id journalEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a JournalEntry
for the
purpose of creating compatibility. The primary Id
of
the JournalEntry
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another journal entry it is
reassigned to the given journal entry Id.
journalEntryId
- the Id
of a JournalEntry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- journalEntryId
not
foundNullArgumentException
- journalEntryId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.