Interface LogEntryBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, LogEntryAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes LogEntries in bulk.
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
getLogEntryFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
LogEntryForms 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 a 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.
The LogEntryForms returned from
getLogEntryFormsForCreate() may be linked to the originating request
through the peer Ids of the LogEntryForm . In the case
where there may be duplicates, any LogEntryForm of the same peer
Ids may be used for a create operation.
Once a batch of LogEntryForms are submitted for create, a
CreateResponse is returned for each LogEntryForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createLogEntries() ,
errors specific to an individual LogEntryForm are indicated in the
corresponding CreateResponse . CreateResponses may be
linked to the originating LogEntryForm through the
LogEntryForm Id .
For updates, LogEntryForms are requested to the
LogEntry Id that is to be updated using
getLogEntryFormsForUpdate() where the reference Id in the
LogEntryForm may be used to link the request. 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.
Once a batch of LogEntryForms are submitted for update, an
UpdateResponse is returned for each LogEntryForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateLogEntries() ,
errors specific to an individual LogEntryForm are indicated in the
corresponding UpdateResponse . UpdateResponses may be
linked to the originating LogEntryForm through the
LogEntryForm Id .
The delete operations delete LogEntries in bulk. 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. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasLogEntries(AliasRequestList aliasRequests) Adds anIdto aLogEntryfor the purpose of creating compatibility.createLogEntries(LogEntryBatchFormList logEntryForms) Creates a new set ofLogEntries.Deletes allLogEntriesin thisLog.deleteLogEntries(IdList logEntryIds) Deletes log entries for the givenIds.deleteLogEntriesByDate(DateTime from, DateTime to) Deletes log entries between the given date range inclusive.deleteLogEntriesByResource(Id resourceId) Deletes log entries for the given resource.getLogEntryFormsForCreate(long number, Type[] logEntryRecordTypes) Gets the log entry forms for creating a bunch of new log entries.getLogEntryFormsForUpdate(IdList logEntryIds) Gets the log entry forms for updating an existing set of log entries.updateLogEntries(LogEntryBatchFormList logEntryForms) Updates existing log entries.Methods inherited from interface LogEntryAdminSession
aliasLogEntry, canCreateLogEntries, canCreateLogEntryWithRecordTypes, canDeleteLogEntries, canManageLogEntryAliases, canUpdateLogEntries, createLogEntry, deleteLogEntry, getLog, getLogEntryFormForCreate, getLogEntryFormForUpdate, getLogId, updateLogEntryModifier 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
-
getLogEntryFormsForCreate
LogEntryBatchFormList getLogEntryFormsForCreate(long number, Type[] logEntryRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the log entry forms for creating a bunch of new log entries.- Parameters:
number- the number of forms to retrievelogEntryRecordTypes- array of log entry record types to be included in each create operation or an empty list if none- Returns:
- the log entry forms
- Throws:
NullArgumentException-logEntryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createLogEntries
CreateResponseList createLogEntries(LogEntryBatchFormList logEntryForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofLogEntries. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
logEntryForms- the log entry forms- Returns:
- the create responses
- Throws:
NullArgumentException-logEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getLogEntryFormsForUpdate
LogEntryBatchFormList getLogEntryFormsForUpdate(IdList logEntryIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the log entry forms for updating an existing set of log entries. A new log entry form should be requested for each update transaction.- Parameters:
logEntryIds- theIdsof theLogEntry- Returns:
- the log entry form
- Throws:
NotFoundException- alogEntryIdis not foundNullArgumentException-logEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateLogEntries
UpdateResponseList updateLogEntries(LogEntryBatchFormList logEntryForms) throws OperationFailedException, PermissionDeniedException Updates existing log entries. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
logEntryForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-logEntryFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllLogEntries
Deletes allLogEntriesin thisLog.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteLogEntries
DeleteResponseList deleteLogEntries(IdList logEntryIds) throws OperationFailedException, PermissionDeniedException Deletes log entries for the givenIds.- Parameters:
logEntryIds- theIdsof the log entries to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-logEntryIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteLogEntriesByResource
DeleteResponseList deleteLogEntriesByResource(Id resourceId) throws OperationFailedException, PermissionDeniedException Deletes log entries for the given resource.- Parameters:
resourceId- theIdof a resource- Returns:
- the delete responses
- Throws:
NullArgumentException-resourceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteLogEntriesByDate
DeleteResponseList deleteLogEntriesByDate(DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException Deletes log entries between the given date range inclusive.- Parameters:
from- starting dateto- ending date- Returns:
- the delete responses
- Throws:
InvalidArgumentException-fromis greater thantoNullArgumentException-fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasLogEntries
AliasResponseList aliasLogEntries(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aLogEntryfor the purpose of creating compatibility. The primaryIdof theLogEntryis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another log entry, it is reassigned to the given entryId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-