Interface CompetencyAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
CompetencyBatchAdminSession
This session creates, updates, and deletes Competencies . 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
Competency , a CompetencyForm is requested using
getCompetencyFormForCreate() specifying the desired relationship peers
and record Types or none if no record Types are needed.
The returned CompetencyForm 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 CompetencyForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each CompetencyForm
corresponds to an attempted transaction.
For updates, CompetencyForms are requested to the
Competency Id that is to be updated using
getCompetencyFormForUpdate() . Similarly, the CompetencyForm has
metadata about the data that can be updated and it can perform validation
before submitting the update. The CompetencyForm can only be used
once for a successful update and cannot be reused.
The delete operations delete Competencies . To unmap a
Competency from the current Foundry , the
CompetencyFoundryAssignmentSession should be used. These delete
operations attempt to remove the Competency itself thus removing
it from all known Foundry catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasCompetency(Id competencyId, Id aliasId) Adds anIdto aCompetencyfor the purpose of creating compatibility.booleanTests if this user can create competencies.booleancanCreateCompetencyWithRecordTypes(Type[] competencyRecordTypes) Tests if this user can create a singleCompetencyusing the desired record types.booleanTests if this user can delete competencies.booleanTests if this user can manageIdaliases for competencies.booleanTests if this user can update competencies.createCompetency(CompetencyForm competencyForm) Creates a newCompetency.voiddeleteCompetency(Id competencyId) Deletes aCompetency.getCompetencyFormForCreate(Type[] competencyRecordTypes) Gets the competency form for creating new competencies.getCompetencyFormForUpdate(Id competencyId) Gets the competency form for updating an existing competency.getJob()Gets theJobassociated with this session.getJobId()Gets theJobIdassociated with this session.voidupdateCompetency(CompetencyForm competencyForm) Updates an existing competency.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
-
getJobId
Id getJobId()Gets theJobIdassociated with this session.- Returns:
- the
Job Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getJob
Gets theJobassociated with this session.- Returns:
- the foundry
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateCompetency
boolean canCreateCompetency()Tests if this user can create competencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aCompetencywill 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:
falseifCompetencycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateCompetencyWithRecordTypes
Tests if this user can create a singleCompetencyusing the desired record types. WhileResourcingManager.getCompetencyRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificCompetency. Providing an empty array tests if aCompetencycan be created with no records.- Parameters:
competencyRecordTypes- array of competency record types- Returns:
trueifCompetencycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-competencyRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getCompetencyFormForCreate
CompetencyForm getCompetencyFormForCreate(Type[] competencyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the competency form for creating new competencies. A new form should be requested for each create transaction.- Parameters:
competencyRecordTypes- array of competency record types- Returns:
- the competency form
- Throws:
NullArgumentException-competencyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createCompetency
Competency createCompetency(CompetencyForm competencyForm) throws OperationFailedException, PermissionDeniedException Creates a newCompetency.- Parameters:
competencyForm- the form for thisCompetency- Returns:
- the new
Competency - Throws:
IllegalStateException-competencyFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-competencyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-competencyFormdid not originate fromgetCompetencyFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateCompetencies
boolean canUpdateCompetencies()Tests if this user can update competencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aCompetencywill 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:
falseifCompetencymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getCompetencyFormForUpdate
CompetencyForm getCompetencyFormForUpdate(Id competencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the competency form for updating an existing competency. A new competency form should be requested for each update transaction.- Parameters:
competencyId- theIdof theCompetency- Returns:
- the competency form
- Throws:
NotFoundException-competencyIdis not foundNullArgumentException-competencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCompetency
void updateCompetency(CompetencyForm competencyForm) throws OperationFailedException, PermissionDeniedException Updates an existing competency.- Parameters:
competencyForm- the form containing the elements to be updated- Throws:
IllegalStateException-competencyFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-competencyIdorcompetencyFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-competencyFormdid not originate fromgetCompetencyFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteCompetencies
boolean canDeleteCompetencies()Tests if this user can delete competencies. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aCompetencywill 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:
falseifCompetencydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteCompetency
void deleteCompetency(Id competencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aCompetency.- Parameters:
competencyId- theIdof theCompetencyto remove- Throws:
NotFoundException-competencyIdnot foundNullArgumentException-competencyIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageCompetencyAliases
boolean canManageCompetencyAliases()Tests if this user can manageIdaliases for competencies. 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:
falseifCompetencyaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasCompetency
void aliasCompetency(Id competencyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aCompetencyfor the purpose of creating compatibility. The primaryIdof theCompetencyis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another competency, it is reassigned to the given competencyId.- Parameters:
competencyId- theIdof aCompetencyaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-competencyIdnot foundNullArgumentException-competencyIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-