public interface CompetencyAdminSession extends OsidSession
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.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasCompetency(Id competencyId,
Id aliasId)
Adds an
Id to a Competency for the
purpose of creating compatibility. |
boolean |
canCreateCompetency()
Tests if this user can create competencies.
|
boolean |
canCreateCompetencyWithRecordTypes(Type[] competencyRecordTypes)
Tests if this user can create a single
Competency using
the desired record types. |
boolean |
canDeleteCompetencies()
Tests if this user can delete competencies.
|
boolean |
canManageCompetencyAliases()
Tests if this user can manage
Id aliases for
competencies. |
boolean |
canUpdateCompetencies()
Tests if this user can update competencies.
|
Competency |
createCompetency(CompetencyForm competencyForm)
Creates a new
Competency. |
void |
deleteCompetency(Id competencyId)
Deletes a
Competency. |
CompetencyForm |
getCompetencyFormForCreate(Type[] competencyRecordTypes)
Gets the competency form for creating new competencies.
|
CompetencyForm |
getCompetencyFormForUpdate(Id competencyId)
Gets the competency form for updating an existing competency.
|
Foundry |
getJob()
Gets the
Job associated with this session. |
Id |
getJobId()
Gets the
Job Id associated with this
session. |
void |
updateCompetency(CompetencyForm competencyForm)
Updates an existing competency.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getJobId()
Job Id associated with this
session. Job Id associated with this sessionmandatory - This method must be implemented. Foundry getJob() throws OperationFailedException, PermissionDeniedException
Job associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateCompetency()
Competency 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 Competency creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateCompetencyWithRecordTypes(Type[] competencyRecordTypes)
Competency using
the desired record types. While
ResourcingManager.getCompetencyRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Competency.
Providing an empty array tests if a Competency can be
created with no records.competencyRecordTypes - array of competency record types true if Competency creation
using the specified record Types is supported,
false otherwiseNullArgumentException - competencyRecordTypes
is null mandatory - This method must be implemented. CompetencyForm getCompetencyFormForCreate(Type[] competencyRecordTypes) throws OperationFailedException, PermissionDeniedException
competencyRecordTypes - array of competency record typesNullArgumentException - competencyRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. Competency createCompetency(CompetencyForm competencyForm) throws OperationFailedException, PermissionDeniedException
Competency. competencyForm - the form for this Competency Competency IllegalStateException - competencyForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - competencyForm
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - competencyForm
did not originate from getCompetencyFormForCreate()
mandatory - This method must be implemented. boolean canUpdateCompetencies()
Competency 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 Competency modification
is not authorized, true otherwisemandatory - This method must be implemented. CompetencyForm getCompetencyFormForUpdate(Id competencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
competencyId - the Id of the Competency
NotFoundException - competencyId is not
foundNullArgumentException - competencyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateCompetency(CompetencyForm competencyForm) throws OperationFailedException, PermissionDeniedException
competencyForm - the form containing the elements to be updatedIllegalStateException - competencyForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - competencyId or
competencyForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - competencyForm
did not originate from getCompetencyFormForUpdate()
mandatory - This method must be implemented. boolean canDeleteCompetencies()
Competency 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 Competency deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteCompetency(Id competencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Competency. competencyId - the Id of the Competency
to removeNotFoundException - competencyId not
foundNullArgumentException - competencyId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageCompetencyAliases()
Id aliases 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 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 Competency aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasCompetency(Id competencyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Competency for the
purpose of creating compatibility. The primary Id of
the Competency is determined by the provider. The new
Id performs as an alias to the primary Id
. If the alias is a pointer to another competency, it is
reassigned to the given competency Id. competencyId - the Id of a Competency
aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - competencyId not
foundNullArgumentException - competencyId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.