public interface CheckAdminSession extends OsidSession
This session creates, updates, and deletes Checks.
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
Check,
a CheckForm
is requested using
getCheckFormForCreate()
specifying the desired record Types
or none if no record Types
are needed. The returned
CheckForm
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 CheckForm
is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CheckForm
corresponds to an attempted transaction.
For updates, CheckForms
are requested to the
Check
Id
that is to be updated using
getCheckFormForUpdate().
Similarly, the CheckForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The CheckForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Checks.
To unmap a
Check
from the current Engine,
the
CheckEngineAssignmentSession
should be used. These delete
operations attempt to remove the Check
itself thus removing
it from all known Engine
catalogs.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasCheck(Id checkId,
Id aliasId)
Adds an
Id to a Check for the purpose of
creating compatibility. |
boolean |
canCreateChecks()
Tests if this user can create
Checks. |
boolean |
canCreateCheckWithRecordTypes(Type[] checkRecordTypes)
Tests if this user can create a single
Check using the
desired record types. |
boolean |
canDeleteChecks()
Tests if this user can delete
Checks. |
boolean |
canManageCheckAliases()
Tests if this user can manage
Id aliases for
Checks. |
boolean |
canUpdateChecks()
Tests if this user can update
Checks. |
Check |
createCheck(CheckForm checkForm)
Creates a new
Check. |
void |
deleteCheck(Id checkId)
Deletes a
Check. |
CheckForm |
getCheckFormForUpdate(Id checkId)
Gets the check form for updating an existing hold.
|
Engine |
getEngine()
Gets the
Engine associated with this session. |
Id |
getEngineId()
Gets the
Engine Id associated with this
session. |
void |
updateCheck(CheckForm checkForm)
Updates an existing hold.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getEngineId()
Engine
Id
associated with this
session. Engine Id
associated with this sessionmandatory
- This method must be implemented. Engine getEngine() throws OperationFailedException, PermissionDeniedException
Engine
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateChecks()
Checks.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Check
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer create operations to an
unauthorized user. false
if Check
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateCheckWithRecordTypes(Type[] checkRecordTypes)
Check
using the
desired record types. While
RulesCheckManager.getCheckRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Check.
Providing an
empty array tests if a Check
can be created with no
records.checkRecordTypes
- array of check record types true
if Check
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- checkRecordTypes
is null
mandatory
- This method must be implemented. Check createCheck(CheckForm checkForm) throws OperationFailedException, PermissionDeniedException
Check.
checkForm
- the form for this Check
Check
IllegalStateException
- checkForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- checkForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- checkForm
did not
originat from getCheckFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateChecks()
Checks.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Check
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer update operations to an
unauthorized user. false
if Check
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. CheckForm getCheckFormForUpdate(Id checkId) throws NotFoundException, OperationFailedException
checkId
- the Id
of the Check
NotFoundException
- checkId
is not foundNullArgumentException
- checkId
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void updateCheck(CheckForm checkForm) throws OperationFailedException, PermissionDeniedException
checkForm
- the form containing the elements to be updatedIllegalStateException
- checkForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- checkId
or
checkForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- checkForm
did not
originat from getCheckFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteChecks()
Checks.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Check
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may opt not to offer delete operations to an
unauthorized user. false
if Check
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteCheck(Id checkId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Check.
checkId
- the Id
of the Check
to
removeNotFoundException
- checkId
not foundNullArgumentException
- checkId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageCheckAliases()
Id
aliases for
Checks.
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 Check
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasCheck(Id checkId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Check
for the purpose of
creating compatibility. The primary Id
of the
Check
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another check, it is reassigned to the given check
Id.
checkId
- the Id
of a Check
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- checkId
not foundNullArgumentException
- checkId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.