Interface LogEntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
LogEntryBatchAdminSession
This session creates, updates, and deletes LogEntries . 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
LogEntry , a LogEntryForm is requested using
getLogEntryFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned
LogEntryForm 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 LogEntryForm is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each LogEntryForm corresponds to an attempted
transaction.
For updates, LogEntryForms are requested to the
LogEntry Id that is to be updated using
getLogEntryFormForUpdate() . Similarly, the LogEntryForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The LogEntryForm can only be used
once for a successful update and cannot be reused.
The delete operations delete LogEntries . To unmap a
LogEntry from the current Log , the
LogEntryLogAssignmentSession should be used. These delete operations
attempt to remove the LogEntry itself thus removing it from all
known Log catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasLogEntry(Id logEntryId, Id aliasId) Adds anIdto aLogEntryfor the purpose of creating compatibility.booleanTests if this user can create log entries.booleancanCreateLogEntryWithRecordTypes(Type[] logEntryRecordTypes) Tests if this user can create a singleLogEntryusing the desired record types.booleanTests if this user can delete log entries.booleanTests if this user can manageIdaliases for log entries.booleanTests if this user can update log entries.createLogEntry(LogEntryForm logEntryForm) Creates a newLogEntry.voiddeleteLogEntry(Id logEntryId) Deletes aLogEntry.getLog()Gets theLogassociated with this session.getLogEntryFormForCreate(Type[] logEntryRecordTypes) Gets the log entry form for creating new log entries.getLogEntryFormForUpdate(Id logEntryId) Gets the log entry form for updating an existing log.getLogId()Gets theLogIdassociated with this session.voidupdateLogEntry(LogEntryForm logEntryForm) Updates an existing log entry.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
-
getLogId
Id getLogId()Gets theLogIdassociated with this session.- Returns:
- the
Log Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getLog
Gets theLogassociated with this session.- Returns:
- the
Logassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateLogEntries
boolean canCreateLogEntries()Tests if this user can create log entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aLogEntrywill 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:
falseifLogEntrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateLogEntryWithRecordTypes
Tests if this user can create a singleLogEntryusing the desired record types. WhileLoggingManager.getLogEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificLogEntry. Providing an empty array tests if aLogEntrycan be created with no records.- Parameters:
logEntryRecordTypes- array of log entry record types- Returns:
trueifLogEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-logEntryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getLogEntryFormForCreate
LogEntryForm getLogEntryFormForCreate(Type[] logEntryRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the log entry form for creating new log entries. A new form should be requested for each create transaction.- Parameters:
logEntryRecordTypes- array of log entry record types- Returns:
- the log entry form
- Throws:
NullArgumentException-logEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createLogEntry
LogEntry createLogEntry(LogEntryForm logEntryForm) throws OperationFailedException, PermissionDeniedException Creates a newLogEntry.- Parameters:
logEntryForm- the form for thisLogEntry- Returns:
- the new
LogEntry - Throws:
IllegalStateException-logEntryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-logEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-logEntryFormdid not originate fromgetLogEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateLogEntries
boolean canUpdateLogEntries()Tests if this user can update log entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aLogwill 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:
falseifLogEntrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getLogEntryFormForUpdate
LogEntryForm getLogEntryFormForUpdate(Id logEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the log entry form for updating an existing log. A new log entry form should be requested for each update transaction.- Parameters:
logEntryId- theIdof theLogEntry- Returns:
- the log entry form
- Throws:
NotFoundException-logEntryIdis not foundNullArgumentException-logEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateLogEntry
void updateLogEntry(LogEntryForm logEntryForm) throws OperationFailedException, PermissionDeniedException Updates an existing log entry.- Parameters:
logEntryForm- the form containing the elements to be updated- Throws:
IllegalStateException-logEntryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-logEntryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-logEntryFormdid not originate fromgetLogEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteLogEntries
boolean canDeleteLogEntries()Tests if this user can delete log entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aLogEntrywill 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:
falseifLogEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteLogEntry
void deleteLogEntry(Id logEntryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aLogEntry.- Parameters:
logEntryId- theIdof thelogEntryIdto remove- Throws:
NotFoundException-logEntryIdnot foundNullArgumentException-logEntryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageLogEntryAliases
boolean canManageLogEntryAliases()Tests if this user can manageIdaliases for log 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 aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifLogEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasLogEntry
void aliasLogEntry(Id logEntryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aLogEntryfor the purpose of creating compatibility. The primaryIdof theLogEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another log entry, it is reassigned to the given log entryId.- Parameters:
logEntryId- theIdof aLogEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-logEntryIdnot foundNullArgumentException-logEntryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-