Interface JournalAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
JournalBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasJournal(Id journalId, Id aliasId) Adds anIdto aJournalfor the purpose of creating compatibility.booleanTests if this user can createJournals.booleancanCreateJournalWithRecordTypes(Type[] journalRecordTypes) Tests if this user can create a singleJournalusing the desired record interface types.booleanTests if this user can deleteJournalsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forJournals.booleanTests if this user can updateJournals.createJournal(JournalForm journalForm) Creates a newJournal.voiddeleteJournal(Id journalId) Deletes aJournal.getJournalFormForCreate(Type[] journalRecordTypes) Gets the journal form for creating new journals.getJournalFormForUpdate(Id journalId) Gets the journal form for updating an existing journal.voidupdateJournal(JournalForm journalForm) Updates an existing journal.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
canCreateJournals
boolean canCreateJournals()Tests if this user can createJournals. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aJournalwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifJournalcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateJournalWithRecordTypes
Tests if this user can create a singleJournalusing the desired record interface types. WhileJournalingManager.getJournalRecordTypes()can be used to examine which record interfaces are supported, this method tests which record(s) are required for creating a specificJournal. Providing an empty array tests if aJournalcan be created with no records.- Parameters:
journalRecordTypes- array of journal record types- Returns:
trueifJournalcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-journalRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getJournalFormForCreate
JournalForm getJournalFormForCreate(Type[] journalRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the journal form for creating new journals. A new form should be requested for each create transaction.- Parameters:
journalRecordTypes- array of journal record types- Returns:
- the journal form
- Throws:
NullArgumentException-journalRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createJournal
Journal createJournal(JournalForm journalForm) throws OperationFailedException, PermissionDeniedException Creates a newJournal.- Parameters:
journalForm- the form for thisJournal- Returns:
- the new
Journal - Throws:
IllegalStateException-journalFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-journalFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-journalFormdid not originate fromgetJournalFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateJournals
boolean canUpdateJournals()Tests if this user can updateJournals. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aJournalwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifJournalmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getJournalFormForUpdate
Gets the journal form for updating an existing journal. A new journal form should be requested for each update transaction.- Parameters:
journalId- theIdof theJournal- Returns:
- the journal form
- Throws:
NullArgumentException-journalIdisnull- Compliance:
mandatory- This method must be implemented.
-
updateJournal
void updateJournal(JournalForm journalForm) throws OperationFailedException, PermissionDeniedException Updates an existing journal.- Parameters:
journalForm- the form containing the elements to be updated- Throws:
IllegalStateException-journalFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-journalFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-journalFormdid not originate fromgetJournalFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteJournals
boolean canDeleteJournals()Tests if this user can deleteJournalsA return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aJournalwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifJournaldeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteJournal
void deleteJournal(Id journalId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aJournal.- Parameters:
journalId- theIdof theJournalto remove- Throws:
NotFoundException-journalIdnot foundNullArgumentException-journalIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageJournalAliases
boolean canManageJournalAliases()Tests if this user can manageIdaliases forJournals. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifJournalaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasJournal
void aliasJournal(Id journalId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aJournalfor the purpose of creating compatibility. The primaryIdof theJournalis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another journal it is reassigned to the given journalId.- Parameters:
journalId- theIdof aJournalaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-journalIdnot foundNullArgumentException-journalIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-