Interface CompetencyAdminSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
CompetencyBatchAdminSession

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.

  • Method Details

    • getJobId

      Id getJobId()
      Gets the Job Id associated with this session.
      Returns:
      the Job Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getJob

      Gets the Job associated with this session.
      Returns:
      the foundry
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 a 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.
      Returns:
      false if Competency creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateCompetencyWithRecordTypes

      boolean canCreateCompetencyWithRecordTypes(Type[] competencyRecordTypes)
      Tests if this user can create a single 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.
      Parameters:
      competencyRecordTypes - array of competency record types
      Returns:
      true if Competency creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - competencyRecordTypes is null
      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 - competencyRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form for requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createCompetency

      Creates a new Competency .
      Parameters:
      competencyForm - the form for this Competency
      Returns:
      the new Competency
      Throws:
      IllegalStateException - competencyForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - competencyForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - competencyForm did not originate from getCompetencyFormForCreate()
      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 a 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.
      Returns:
      false if Competency modification is not authorized, true otherwise
      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 - the Id of the Competency
      Returns:
      the competency form
      Throws:
      NotFoundException - competencyId is not found
      NullArgumentException - competencyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - 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 - competencyForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - competencyId or competencyForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - competencyForm did not originate from getCompetencyFormForUpdate()
      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 a 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.
      Returns:
      false if Competency deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteCompetency

      void deleteCompetency(Id competencyId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Deletes a Competency .
      Parameters:
      competencyId - the Id of the Competency to remove
      Throws:
      NotFoundException - competencyId not found
      NullArgumentException - competencyId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageCompetencyAliases

      boolean canManageCompetencyAliases()
      Tests if this user can manage 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.
      Returns:
      false if Competency aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasCompetency

      void aliasCompetency(Id competencyId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an 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 .
      Parameters:
      competencyId - the Id of a Competency
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - competencyId not found
      NullArgumentException - competencyId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.