public interface JournalAdminSession extends OsidSession
This session creates, updates, and deletes Journals. 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
Journal, a JournalForm is requested using
getJournalFormForCreate() specifying the desired record
Types or none if no record Types are needed. The
returned JournalForm 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 JournalForm is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each JournalForm
corresponds to an attempted transaction.
For updates, JournalForms are requested to the
Journal Id that is to be updated using
getJournalFormForUpdate(). Similarly, the JournalForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The JournalForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Journals.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasJournal(Id journalId,
Id aliasId)
Adds an
Id to a Journal for the purpose
of creating compatibility. |
boolean |
canCreateJournals()
Tests if this user can create
Journals. |
boolean |
canCreateJournalWithRecordTypes(Type[] journalRecordTypes)
Tests if this user can create a single
Journal using
the desired record interface types. |
boolean |
canDeleteJournals()
Tests if this user can delete
Journals A return of true
does not guarantee successful authorization. |
boolean |
canManageJournalAliases()
Tests if this user can manage
Id aliases for
Journals. |
boolean |
canUpdateJournals()
Tests if this user can update
Journals. |
Journal |
createJournal(JournalForm journalForm)
Creates a new
Journal. |
void |
deleteJournal(Id journalId)
Deletes a
Journal. |
JournalForm |
getJournalFormForCreate(Type[] journalRecordTypes)
Gets the journal form for creating new journals.
|
JournalForm |
getJournalFormForUpdate(Id journalId)
Gets the journal form for updating an existing journal.
|
void |
updateJournal(JournalForm journalForm)
Updates an existing journal.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateJournals()
Journals. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Journal 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 Journal creation is not
authorized, true otherwisemandatory - This method must be implemented. boolean canCreateJournalWithRecordTypes(Type[] journalRecordTypes)
Journal using
the desired record interface types. While
JournalingManager.getJournalRecordTypes() can be used to
examine which record interfaces are supported, this method tests which
record(s) are required for creating a specific Journal.
Providing an empty array tests if a Journal can be
created with no records.journalRecordTypes - array of journal record types true if Journal creation using
the specified record Types is supported,
false otherwiseNullArgumentException - journalRecordTypes
is null mandatory - This method must be implemented. JournalForm getJournalFormForCreate(Type[] journalRecordTypes) throws OperationFailedException, PermissionDeniedException
journalRecordTypes - array of journal record typesNullArgumentException - journalRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Journal createJournal(JournalForm journalForm) throws OperationFailedException, PermissionDeniedException
Journal. journalForm - the form for this Journal Journal IllegalStateException - journalForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - journalForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - journalForm did
not originate from getJournalFormForCreate() mandatory - This method must be implemented. boolean canUpdateJournals()
Journals. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Journal 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 Journal modification is
not authorized, true otherwisemandatory - This method must be implemented. JournalForm getJournalFormForUpdate(Id journalId)
journalId - the Id of the Journal NullArgumentException - journalId is
null mandatory - This method must be implemented. void updateJournal(JournalForm journalForm) throws OperationFailedException, PermissionDeniedException
journalForm - the form containing the elements to be updatedIllegalStateException - journalForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - journalForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - journalForm did
not originate from getJournalFormForUpdate() mandatory - This method must be implemented. boolean canDeleteJournals()
Journals A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Journal 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 Journal deletion is not
authorized, true otherwisemandatory - This method must be implemented. void deleteJournal(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Journal. journalId - the Id of the Journal
to removeNotFoundException - journalId not foundNullArgumentException - journalId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageJournalAliases()
Id aliases for
Journals. 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 Journal aliasing is not
authorized, true otherwisemandatory - This method must be implemented. void aliasJournal(Id journalId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Journal for the purpose
of creating compatibility. The primary Id of the
Journal 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 it is reassigned to the given
journal Id. journalId - the Id of a Journal aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - journalId not foundNullArgumentException - journalId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.