Interface ObjectiveAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ObjectiveBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasObjective(Id objectiveId, Id aliasId) Adds anIdto anObjectivefor the purpose of creating compatibility.booleanTests if this user can createObjectives.booleancanCreateObjectiveWithRecordTypes(Type[] objectiveRecordTypes) Tests if this user can create a singleObjectiveusing the desired record types.booleanTests if this user can deleteObjectives.booleanTests if this user can manageIdaliases forObjectives.booleanTests if this user can updateObjectives.createObjective(ObjectiveForm objectiveForm) Creates a newObjective.voiddeleteObjective(Id objectiveId) Deletes theObjectiveidentified by the givenId.Gets theObjectiveBankassociated with this session.Gets theObjectiveBankIdassociated with this session.getObjectiveFormForCreate(Type[] objectiveRecordTypes) Gets the objective form for creating new objectives.getObjectiveFormForUpdate(Id objectiveId) Gets the objective form for updating an existing objective.voidupdateObjective(ObjectiveForm objectiveForm) Updates an existing objective.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
-
getObjectiveBankId
Id getObjectiveBankId()Gets theObjectiveBankIdassociated with this session.- Returns:
- the
ObjectiveBank Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getObjectiveBank
Gets theObjectiveBankassociated with this session.- Returns:
- the
ObjectiveBankassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateObjectives
boolean canCreateObjectives()Tests if this user can createObjectives. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Objective will 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:
falseifObjectivecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateObjectiveWithRecordTypes
Tests if this user can create a singleObjectiveusing the desired record types. WhileLearningManager.getObjectiveRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificObjective. Providing an empty array tests if anObjectivecan be created with no records.- Parameters:
objectiveRecordTypes- array of objective record types- Returns:
trueifObjectivecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-objectiveRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getObjectiveFormForCreate
ObjectiveForm getObjectiveFormForCreate(Type[] objectiveRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the objective form for creating new objectives. A new form should be requested for each create transaction.- Parameters:
objectiveRecordTypes- array of objective record types- Returns:
- the objective form
- Throws:
NullArgumentException-objectiveRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createObjective
Objective createObjective(ObjectiveForm objectiveForm) throws OperationFailedException, PermissionDeniedException Creates a newObjective.- Parameters:
objectiveForm- the form for thisObjective- Returns:
- the new
Objective - Throws:
IllegalStateException-objectiveFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-objectiveFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-objectiveFormdid not originate fromgetObjectiveFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateObjectives
boolean canUpdateObjectives()Tests if this user can updateObjectives. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anObjectivewill 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:
falseif objective modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getObjectiveFormForUpdate
ObjectiveForm getObjectiveFormForUpdate(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the objective form for updating an existing objective. A new objective form should be requested for each update transaction.- Parameters:
objectiveId- theIdof theObjective- Returns:
- the objective form
- Throws:
NotFoundException-objectiveIdis not foundNullArgumentException-objectiveIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateObjective
void updateObjective(ObjectiveForm objectiveForm) throws OperationFailedException, PermissionDeniedException Updates an existing objective.- Parameters:
objectiveForm- the form containing the elements to be updated- Throws:
IllegalStateException-objectiveFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-objectiveFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-objectiveFormdid not originate fromgetObjectiveFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteObjectives
boolean canDeleteObjectives()Tests if this user can deleteObjectives. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anObjectivewill 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:
falseifObjectivedeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteObjective
void deleteObjective(Id objectiveId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theObjectiveidentified by the givenId.- Parameters:
objectiveId- theIdof theObjectiveto delete- Throws:
NotFoundException- anObjectivewas not found identified by the givenIdNullArgumentException-objectiveIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageObjectiveAliases
boolean canManageObjectiveAliases()Tests if this user can manageIdaliases forObjectives. 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:
falseifObjectivealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasObjective
void aliasObjective(Id objectiveId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anObjectivefor the purpose of creating compatibility. The primaryIdof theObjectiveis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another objective, it is reassigned to the given objectiveId.- Parameters:
objectiveId- theIdof anObjectivealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-objectiveIdnot foundNullArgumentException-objectiveIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-