public interface ObjectiveAdminSession extends OsidSession
This session creates, updates, and deletes Objectives.
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
Objective, a ObjectiveForm is requested
using getObjectiveFormForCreate() specifying the desired
record Types or none if no record Types are
needed. The returned ObjectiveForm 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 ObjectiveForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ObjectiveForm corresponds to an attempted transaction.
For updates, ObjectiveForms are requested to the
Objective Id that is to be updated using
getObjectiveFormForUpdate(). Similarly, the ObjectiveForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ObjectiveForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Objectives. To unmap an
Objective from the current ObjectiveBank,
the ObjectiveObjectiveBankAssignmentSession should be used.
These delete operations attempt to remove the Objective
itself thus removing it from all known ObjectiveBank
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 |
aliasObjective(Id objectiveId,
Id aliasId)
Adds an
Id to an Objective for the
purpose of creating compatibility. |
boolean |
canCreateObjectives()
Tests if this user can create
Objectives. |
boolean |
canCreateObjectiveWithRecordTypes(Type[] objectiveRecordTypes)
Tests if this user can create a single
Objective using
the desired record types. |
boolean |
canDeleteObjectives()
Tests if this user can delete
Objectives. |
boolean |
canManageObjectiveAliases()
Tests if this user can manage
Id aliases for
Objectives. |
boolean |
canUpdateObjectives()
Tests if this user can update
Objectives. |
Objective |
createObjective(ObjectiveForm objectiveForm)
Creates a new
Objective. |
void |
deleteObjective(Id objectiveId)
Deletes the
Objective identified by the given
Id. |
ObjectiveBank |
getObjectiveBank()
Gets the
ObjectiveBank associated with this session. |
Id |
getObjectiveBankId()
Gets the
ObjectiveBank Id associated
with this session. |
ObjectiveForm |
getObjectiveFormForCreate(Type[] objectiveRecordTypes)
Gets the objective form for creating new objectives.
|
ObjectiveForm |
getObjectiveFormForUpdate(Id objectiveId)
Gets the objective form for updating an existing objective.
|
void |
updateObjective(ObjectiveForm objectiveForm)
Updates an existing objective.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getObjectiveBankId()
ObjectiveBank Id associated
with this session. ObjectiveBank Id associated with this
sessionmandatory - This method must be implemented. ObjectiveBank getObjectiveBank() throws OperationFailedException, PermissionDeniedException
ObjectiveBank associated with this session. ObjectiveBank associated with this sessionOperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateObjectives()
Objectives. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Objective 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 Objective creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateObjectiveWithRecordTypes(Type[] objectiveRecordTypes)
Objective using
the desired record types. While
LearningManager.getObjectiveRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Objective.
Providing an empty array tests if an Objective can be
created with no records.objectiveRecordTypes - array of objective record types true if Objective creation using
the specified record Types is supported,
false otherwiseNullArgumentException - objectiveRecordTypes
is null mandatory - This method must be implemented. ObjectiveForm getObjectiveFormForCreate(Type[] objectiveRecordTypes) throws OperationFailedException, PermissionDeniedException
objectiveRecordTypes - array of objective record typesNullArgumentException - objectiveRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Objective createObjective(ObjectiveForm objectiveForm) throws OperationFailedException, PermissionDeniedException
Objective. objectiveForm - the form for this Objective Objective IllegalStateException - objectiveForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - objectiveForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - objectiveForm did
not originate from getObjectiveFormForCreate() mandatory - This method must be implemented. boolean canUpdateObjectives()
Objectives. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Objective 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 objective modification is not
authorized, true otherwisemandatory - This method must be implemented. ObjectiveForm getObjectiveFormForUpdate(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
objectiveId - the Id of the Objective
NotFoundException - objectiveId is not
foundNullArgumentException - objectiveId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateObjective(ObjectiveForm objectiveForm) throws OperationFailedException, PermissionDeniedException
objectiveForm - the form containing the elements to be updatedIllegalStateException - objectiveForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - objectiveForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - objectiveForm did
not originate from getObjectiveFormForUpdate() mandatory - This method must be implemented. boolean canDeleteObjectives()
Objectives. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Objective 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 Objective deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteObjective(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Objective identified by the given
Id. objectiveId - the Id of the Objective
to deleteNotFoundException - an Objective was not
found identified by the given Id NullArgumentException - objectiveId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageObjectiveAliases()
Id aliases for
Objectives. 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 Objective aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasObjective(Id objectiveId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Objective for the
purpose of creating compatibility. The primary Id of
the Objective is determined by the provider. The new
Id performs as an alias to the primary Id.
If the alias is a pointer to another objective, it is
reassigned to the given objective Id. objectiveId - the Id of an Objective
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - objectiveId not
foundNullArgumentException - objectiveId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.