public interface TriggerAdminSession extends OsidSession
This session creates, updates, and deletes Triggers.
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
Trigger,
a TriggerForm
is requested using
getTriggerFormForCreate()
specifying the desired controller and
record Types
or none if no record Types
are
needed. The returned TriggerForm
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 TriggerForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
TriggerForm
corresponds to an attempted transaction.
For updates, TriggerForms
are requested to the
Trigger
Id
that is to be updated using
getTriggerFormForUpdate().
Similarly, the TriggerForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The TriggerForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Triggers.
To unmap a
Trigger
from the current System,
the
TriggerSystemAssignmentSession
should be used. These delete
operations attempt to remove the Trigger
itself thus
removing it from all known System
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 |
aliasTrigger(Id triggerId,
Id aliasId)
Adds an
Id to a Trigger for the purpose
of creating compatibility. |
boolean |
canCreateTriggers()
Tests if this user can create
Triggers. |
boolean |
canCreateTriggerWithRecordTypes(Type[] triggerRecordTypes)
Tests if this user can create a single
Trigger using
the desired record types. |
boolean |
canDeleteTriggers()
Tests if this user can delete
Triggers. |
boolean |
canManageTriggerAliases()
Tests if this user can manage
Id aliases for
Triggers. |
boolean |
canUpdateTriggers()
Tests if this user can update
Triggers. |
Trigger |
createTrigger(TriggerForm triggerForm)
Creates a new
Trigger. |
void |
deleteTrigger(Id triggerId)
Deletes a
Trigger. |
System |
getSystem()
Gets the
System associated with this session. |
Id |
getSystemId()
Gets the
System Id associated with this
session. |
TriggerForm |
getTriggerFormForCreate(Id controllerId,
Type[] triggerRecordTypes)
Gets the trigger form for creating new triggers.
|
TriggerForm |
getTriggerFormForUpdate(Id triggerId)
Gets the trigger form for updating an existing trigger.
|
void |
updateTrigger(TriggerForm triggerForm)
Updates an existing trigger.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getSystemId()
System
Id
associated with this
session. System Id
associated with this sessionmandatory
- This method must be implemented. System getSystem() throws OperationFailedException, PermissionDeniedException
System
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateTriggers()
Triggers.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Trigger
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 Trigger
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateTriggerWithRecordTypes(Type[] triggerRecordTypes)
Trigger
using
the desired record types. While
ControlManager.getTriggerRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Trigger.
Providing an
empty array tests if a Trigger
can be created with no
records.triggerRecordTypes
- array of trigger record types true
if Trigger
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- triggerRecordTypes
is null
mandatory
- This method must be implemented. TriggerForm getTriggerFormForCreate(Id controllerId, Type[] triggerRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
controllerId
- a controller Id
triggerRecordTypes
- array of trigger record typesNotFoundException
- controllerId
is not
foundNullArgumentException
- controllerId
or
triggerRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Trigger createTrigger(TriggerForm triggerForm) throws OperationFailedException, PermissionDeniedException
Trigger.
triggerForm
- the form for this Trigger
Trigger
IllegalStateException
- triggerForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- triggerForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- triggerForm
did
not originate from getTriggerFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateTriggers()
Triggers.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Trigger
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 Trigger
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. TriggerForm getTriggerFormForUpdate(Id triggerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
triggerId
- the Id
of the Trigger
NotFoundException
- triggerId
is not
foundNullArgumentException
- triggerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateTrigger(TriggerForm triggerForm) throws OperationFailedException, PermissionDeniedException
triggerForm
- the form containing the elements to be updatedIllegalStateException
- triggerForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- triggerForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- triggerForm
did
not originate from getTriggerFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteTriggers()
Triggers.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Trigger
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 Trigger
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteTrigger(Id triggerId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Trigger.
triggerId
- the Id
of the Trigger
to removeNotFoundException
- triggerId
not foundNullArgumentException
- triggerId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageTriggerAliases()
Id
aliases for
Triggers.
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 Trigger
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasTrigger(Id triggerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Trigger
for the purpose
of creating compatibility. The primary Id
of the
Trigger
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another trigger, it is reassigned to the given
trigger Id.
triggerId
- the Id
of a Trigger
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- triggerId
not foundNullArgumentException
- triggerId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.