public interface LogAdminSession extends OsidSession
This session creates, updates, and deletes Logs.
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
Log,
a LogForm
is requested using
getLogFormForCreate()
specifying the desired record Types
or none if no record Types
are needed. The returned
LogForm
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 LogForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each LogForm
corresponds
to an attempted transaction.
For updates, LogForms
are requested to the Log
Id
that is to be updated using
getLogFormForUpdate().
Similarly, the LogForm
has
metadata about the data that can be updated and it can perform validation
before submitting the update. The LogForm
can only be used
once for a successful update and cannot be reused.
The delete operations delete Logs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasLog(Id logId,
Id aliasId)
Adds an
Id to a Log for the purpose of
creating compatibility. |
boolean |
canCreateLogs()
Tests if this user can create
Logs. |
boolean |
canCreateLogWithRecordTypes(Type[] logRecordTypes)
Tests if this user can create a single
Log using the
desired record types. |
boolean |
canDeleteLogs()
Tests if this user can delete
Logs. |
boolean |
canManageLogAliases()
Tests if this user can manage
Id aliases for
Logs. |
boolean |
canUpdateLogs()
Tests if this user can update
Logs. |
Log |
createLog(LogForm logForm)
Creates a new
Log. |
void |
deleteLog(Id logId)
Deletes a
Log. |
LogForm |
getLogFormForCreate(Type[] logRecordTypes)
Gets the log form for creating new logs.
|
LogForm |
getLogFormForUpdate(Id logId)
Gets the log form for updating an existing log.
|
void |
updateLog(LogForm logForm)
Updates an existing log.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateLogs()
Logs.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Log
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 Log
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateLogWithRecordTypes(Type[] logRecordTypes)
Log
using the
desired record types. While LoggingManager.getLogRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Log.
Providing an empty array tests if a Log
can be created with no records.logRecordTypes
- array of log record types true
if Log
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- logRecordTypes
is null
mandatory
- This method must be implemented. LogForm getLogFormForCreate(Type[] logRecordTypes) throws OperationFailedException, PermissionDeniedException
logRecordTypes
- array of log record typesNullArgumentException
- logRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form with
requested record typesmandatory
- This method must be implemented. Log createLog(LogForm logForm) throws OperationFailedException, PermissionDeniedException
Log.
logForm
- the form for this Log
Log
IllegalStateException
- logForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- logForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- logForm
did not
originate from getLogFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateLogs()
Logs.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Log
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 Log
modification is not
authorized, true
otherwisemandatory
- This method must be implemented. LogForm getLogFormForUpdate(Id logId) throws NotFoundException, OperationFailedException, PermissionDeniedException
logId
- the Id
of the Log
NotFoundException
- logId
is not foundNullArgumentException
- logId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateLog(LogForm logForm) throws OperationFailedException, PermissionDeniedException
logForm
- the form containing the elements to be updatedIllegalStateException
- logForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- logId
or
logForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- logForm
did not
originate from getLogFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteLogs()
Logs.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Log
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 Log
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteLog(Id logId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Log.
logId
- the Id
of the Log
to
removeNotFoundException
- logId
not foundNullArgumentException
- logId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageLogAliases()
Id
aliases for
Logs.
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 Log
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasLog(Id logId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Log
for the purpose of
creating compatibility. The primary Id
of the
Log
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another log, it is reassigned to the given log Id.
logId
- the Id
of a Log
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- logId
not foundNullArgumentException
- logId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.