Interface ProficiencyAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ProficiencyBatchAdminSession
This session creates, updates, and deletes Proficiencies . 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
Proficiency , a ProficiencyForm is requested using
getProficiencyFormForCreate() specifying the desired relationship peers
and record Types or none if no record Types are needed.
The returned ProficiencyForm 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 ProficiencyForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each ProficiencyForm
corresponds to an attempted transaction.
For updates, ProficiencyForms are requested to the
Proficiency Id that is to be updated using
getProficiencyFormForUpdate() . Similarly, the ProficiencyForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ProficiencyForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Proficiencies . To unmap a
Proficiency from the current ObjectiveBank , the
ProficiencyObjectiveBankAssignmentSession should be used. These delete
operations attempt to remove the Proficiency 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 TypeMethodDescriptionvoidaliasProficiency(Id proficiencyId, Id aliasId) Adds anIdto aProficiencyfor the purpose of creating compatibility.booleanTests if this user can createProficiencies.booleancanCreateProficiencyWithRecordTypes(Type[] proficiencyRecordTypes) Tests if this user can create a singleProficiencyusing the desired record types.booleanTests if this user can deleteProficiencies.booleanTests if this user can manageIdaliases for proficiency entries.booleanTests if this user can updateProficiencies.createProficiency(ProficiencyForm proficiencyForm) Creates a newProficiency.voidDeletes all proficiencies in thisObjectiveBank.voiddeleteProficiency(Id proficiencyId) Deletes aProficiency.Gets theObjectiveBankassociated with this session.Gets theObjectiveBankIdassociated with this session.getProficiencyFormForCreate(Id objectiveId, Id resourceId, Type[] proficiencyRecordTypes) Gets the proficiency form for creating new proficiencies.getProficiencyFormForUpdate(Id proficiencyId) Gets the proficiency form for updating an existing proficiency.voidupdateProficiency(ProficiencyForm proficiencyForm) Updates an existing proficiency.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 obective bank
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateProficiencies
boolean canCreateProficiencies()Tests if this user can createProficiencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aProficiencywill 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:
falseifProficiencycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateProficiencyWithRecordTypes
Tests if this user can create a singleProficiencyusing the desired record types. WhileLearningManager.getProficiencyRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificProficiency. Providing an empty array tests if aProficiencycan be created with no records.- Parameters:
proficiencyRecordTypes- array of proficiency record types- Returns:
trueifProficiencycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-proficiencyRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getProficiencyFormForCreate
ProficiencyForm getProficiencyFormForCreate(Id objectiveId, Id resourceId, Type[] proficiencyRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the proficiency form for creating new proficiencies. A new form should be requested for each create transaction.- Parameters:
objectiveId- theIdof theObjectiveresourceId- theIdof theResourceproficiencyRecordTypes- array of proficiency record types- Returns:
- the proficiency form
- Throws:
NotFoundException-objectiveIdorresourceIdis not foundNullArgumentException-objectiveId, resourceId, orproficienyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createProficiency
Proficiency createProficiency(ProficiencyForm proficiencyForm) throws OperationFailedException, PermissionDeniedException Creates a newProficiency. A new form should be requested for each create transaction.- Parameters:
proficiencyForm- the form for thisProficiency- Returns:
- the new
Proficiency - Throws:
IllegalStateException-proficiencyFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-proficiencyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-proficiencyFormdid not originate fromgetProficiencyFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateProficiencies
boolean canUpdateProficiencies()Tests if this user can updateProficiencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aProficiencywill 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:
falseifProficiencymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getProficiencyFormForUpdate
ProficiencyForm getProficiencyFormForUpdate(Id proficiencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the proficiency form for updating an existing proficiency.- Parameters:
proficiencyId- theIdof theProficiency- Returns:
- the proficiency form
- Throws:
NotFoundException-proficiencyIdis not foundNullArgumentException-proficiencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateProficiency
void updateProficiency(ProficiencyForm proficiencyForm) throws OperationFailedException, PermissionDeniedException Updates an existing proficiency.- Parameters:
proficiencyForm- the form containing the elements to be updated- Throws:
IllegalStateException-proficiencyFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-proficiencyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-proficiencyFormdid not originate fromgetProficiencyFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteProficiencies
boolean canDeleteProficiencies()Tests if this user can deleteProficiencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aProficiencywill 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:
falseifProficiencydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteProficiency
void deleteProficiency(Id proficiencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aProficiency.- Parameters:
proficiencyId- theIdof theProficiencyto remove- Throws:
NotFoundException-proficiencyIdnot foundNullArgumentException-proficiencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteProficiencies
Deletes all proficiencies in thisObjectiveBank.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageProficiencyAliases
boolean canManageProficiencyAliases()Tests if this user can manageIdaliases for proficiency entries. 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:
falseifProficiencyaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasProficiency
void aliasProficiency(Id proficiencyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aProficiencyfor the purpose of creating compatibility. The primaryIdof theProficiencyis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another proficiency, it is reassigned to the given proficiencyId.- Parameters:
proficiencyId- theIdof aProficiencyaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-proficiencyIdnot foundNullArgumentException-proficiencyIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-