Interface InstructionAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Instructions . 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 an
Instruction , an InstructionForm is requested using
getInstructionFormForCreate() specifying the desired agenda, check, and
record Types or none if no record Types are needed. The
returned InstructionForm 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 InstructionForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each InstructionForm
corresponds to an attempted transaction.
For updates, InstructionForms are requested to the
Instruction Id that is to be updated using
getInstructionFormForUpdate() . Similarly, the InstructionForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The InstructionForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Instructions . To unmap an
Instruction from the current Engine , the
InstructionEngineAssignmentSession should be used. These delete
operations attempt to remove the Instruction 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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasInstruction(Id instructionId, Id aliasId) Adds anIdto anInstructionfor the purpose of creating compatibility.booleanTests if this user can createInstructions.booleancanCreateInstructionWithRecordTypes(Type[] instructionRecordTypes) Tests if this user can create a singleInstructionusing the desired record types.booleanTests if this user can deleteInstructions.booleanTests if this user can manageIdaliases forInstructions.booleanTests if this user can orderInstructions.booleanTests if this user can updateInstructions.createInstruction(InstructionForm instructionForm) Creates a newInstruction.voiddeleteInstruction(Id instructionId) Deletes anInstruction.Gets theEngineassociated with this session.Gets theEngineIdassociated with this session.getInstructionFormForCreate(Id agendaId, Id checkId, Type[] instructionRecordTypes) Gets the instruction form for creating new instructions.getInstructionFormForUpdate(Id instructionId) Gets the instruction form for updating an existing instruction.voidmoveInstructionAhead(Id instructionId, Id agendaId, Id referenceId) Reorders instructions in an agenda by moving the specified instruction in front of a reference instruction.voidmoveInstructionBehind(Id instructionId, Id agendaId, Id referenceId) Reorders instructions in an agenda by moving the specified instruction behind a reference instruction.voidorderInstructions(Id[] instructionIds, Id agendaId) Reorders a set of instructions in an agenda.voidupdateInstruction(InstructionForm instructionForm) Updates an existing instruction.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
-
getEngineId
Id getEngineId()Gets theEngineIdassociated with this session.- Returns:
- the
Engine Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getEngine
Gets theEngineassociated with this session.- Returns:
- the engine
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateInstructions
boolean canCreateInstructions()Tests if this user can createInstructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anInstructionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifInstructioncreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateInstructionWithRecordTypes
Tests if this user can create a singleInstructionusing the desired record types. WhileRulesCheckManager.getInstructionRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificInstruction. Providing an empty array tests if anInstructioncan be created with no records.- Parameters:
instructionRecordTypes- array of instruction record types- Returns:
trueifInstructioncreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-instructionRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getInstructionFormForCreate
InstructionForm getInstructionFormForCreate(Id agendaId, Id checkId, Type[] instructionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the instruction form for creating new instructions. A new form should be requested for each create transaction.- Parameters:
agendaId- an agendaIdcheckId- a checkIdinstructionRecordTypes- array of instruction record types- Returns:
- the instruction form
- Throws:
NotFoundException-agendaIdorcheckIdis not foundNullArgumentException-agendaId, checkId, orinstructionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createInstruction
Instruction createInstruction(InstructionForm instructionForm) throws OperationFailedException, PermissionDeniedException Creates a newInstruction.- Parameters:
instructionForm- the form for thisInstruction- Returns:
- the new
Instruction - Throws:
IllegalStateException-instructionFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException- instructionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-instructionFormdid not orginate fromgetInstructionFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateInstructions
boolean canUpdateInstructions()Tests if this user can updateInstructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anInstructionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifInstructionmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getInstructionFormForUpdate
InstructionForm getInstructionFormForUpdate(Id instructionId) throws NotFoundException, OperationFailedException Gets the instruction form for updating an existing instruction. A new instruction form should be requested for each update transaction.- Parameters:
instructionId- theIdof theInstruction- Returns:
- the instruction form
- Throws:
NotFoundException-instructionIdis not foundNullArgumentException-instructionIdisnullOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-
updateInstruction
void updateInstruction(InstructionForm instructionForm) throws OperationFailedException, PermissionDeniedException Updates an existing instruction.- Parameters:
instructionForm- the form containing the elements to be updated- Throws:
IllegalStateException-instructionFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-instructionIdorinstructionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-instructionFormdid not orginate fromgetInstructionFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteInstructions
boolean canDeleteInstructions()Tests if this user can deleteInstructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anInstructionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifInstructiondeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteInstruction
void deleteInstruction(Id instructionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anInstruction.- Parameters:
instructionId- theIdof theInstructionto remove- Throws:
NotFoundException-instructionIdnot foundNullArgumentException-instructionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageInstructionAliases
boolean canManageInstructionAliases()Tests if this user can manageIdaliases forInstructions. 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:
falseifInstructionaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasInstruction
void aliasInstruction(Id instructionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anInstructionfor the purpose of creating compatibility. The primaryIdof theInstructionis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another instruction, it is reassigned to the given instructionId.- Parameters:
instructionId- theIdof anInstructionaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-instructionIdnot foundNullArgumentException-instructionIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canSequenceInstructions
boolean canSequenceInstructions()Tests if this user can orderInstructions. A return of true does not guarantee successful authorization. A return of false indicates that it is known sequencing operations will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer sequencing operations to an unauthorized user.- Returns:
falseifInstructionordering is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
moveInstructionAhead
void moveInstructionAhead(Id instructionId, Id agendaId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders instructions in an agenda by moving the specified instruction in front of a reference instruction.- Parameters:
instructionId- theIdof anInstructionagendaId- theIdof anAgendareferenceId- the reference instructionId- Throws:
NotFoundException-instructionId, agendaId, orreferenceIdnot found or,instructionIdorreferenceIdnot related toagendaIdNullArgumentException-instructionId, agendaIdorreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
moveInstructionBehind
void moveInstructionBehind(Id instructionId, Id agendaId, Id referenceId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders instructions in an agenda by moving the specified instruction behind a reference instruction.- Parameters:
instructionId- theIdof anInstructionagendaId- theIdof anAgendareferenceId- the reference instructionId- Throws:
NotFoundException-instructionId, agendaId, orreferenceIdnot found or,instructionIdorreferenceIdnot related toagendaIdNullArgumentException-instructionId, agendaIdorreferenceIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
orderInstructions
void orderInstructions(Id[] instructionIds, Id agendaId) throws NotFoundException, OperationFailedException, PermissionDeniedException Reorders a set of instructions in an agenda.- Parameters:
instructionIds- theIdsfor a set ofInstructionsagendaId- theIdof anAgenda- Throws:
NotFoundException-agendaIdnot found or, aninstructionIdnot related toagendaIdNullArgumentException-instructionIdsoragendaIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-