Interface EffortAdminSession

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

public interface EffortAdminSession extends OsidSession

This session creates, updates, and deletes Efforts . 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 Effort , an EffortForm is requested using getEffortFormForCreate() specifying the desired resource, commission, and record Types or none if no record Types are needed. The returned EffortForm 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 EffortForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each EffortForm corresponds to an attempted transaction.

For updates, EffortForms are requested to the Effort Id that is to be updated using getEffortFormForUpdate() . Similarly, the EffortForm has metadata about the data that can be updated and it can perform validation before submitting the update. The EffortForm can only be used once for a successful update and cannot be reused.

The delete operations delete Efforts . To unmap an Effort from the current Foundry , the EffortFoundryAssignmentSession should be used. These delete operations attempt to remove the Effort 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

    • getFoundryId

      Id getFoundryId()
      Gets the Foundry Id associated with this session.
      Returns:
      the Foundry Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getFoundry

      Gets the Foundry associated with this session.
      Returns:
      the foundry
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canCreateEfforts

      boolean canCreateEfforts()
      Tests if this user can create Efforts . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Effort 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 Effort creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateEffortWithRecordTypes

      boolean canCreateEffortWithRecordTypes(Type[] effortRecordTypes)
      Tests if this user can create a single Effort using the desired record types. While ResourcingManager.getEffortRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Effort . Providing an empty array tests if an Effort can be created with no records.
      Parameters:
      effortRecordTypes - array of effort record types
      Returns:
      true if Effort creation using the specified record Types is supported, false otherwise
      Throws:
      NullArgumentException - effortRecordTypes is null
      Compliance:
      mandatory - This method must be implemented.
    • getEffortFormForCreate

      EffortForm getEffortFormForCreate(Id resourceId, Id commissionId, Type[] effortRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the effort form for creating new efforts. A new form should be requested for each create transaction.
      Parameters:
      resourceId - the Id for the resource
      commissionId - the Id for the commission
      effortRecordTypes - array of effort record types
      Returns:
      the effort form
      Throws:
      NotFoundException - resourceId or commissionId is not found
      NullArgumentException - resourceId, commissionId , or effortRecordTypes 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.
    • createEffort

      Creates a new Effort .
      Parameters:
      effortForm - the form for this Effort
      Returns:
      the new Effort
      Throws:
      IllegalStateException - effortForm already used in a create transaction
      InvalidArgumentException - one or more of the form elements is invalid
      NullArgumentException - effortForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - effortForm did not originate from getEffortFormForCreate()
      Compliance:
      mandatory - This method must be implemented.
    • canUpdateEfforts

      boolean canUpdateEfforts()
      Tests if this user can update Efforts . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Effort 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 Effort modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getEffortFormForUpdate

      Gets the effort form for updating an existing effort. A new effort form should be requested for each update transaction.
      Parameters:
      effortId - the Id of the Effort
      Returns:
      the effort form
      Throws:
      NotFoundException - effortId is not found
      NullArgumentException - effortId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateEffort

      void updateEffort(EffortForm effortForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing effort.
      Parameters:
      effortForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - effortForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - effortForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - effortForm did not originate from getEffortFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteEfforts

      boolean canDeleteEfforts()
      Tests if this user can delete Efforts . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Effort 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 Effort deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteEffort

      Deletes an Effort .
      Parameters:
      effortId - the Id of the Effort to remove
      Throws:
      NotFoundException - effortId not found
      NullArgumentException - effortId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canManageEffortAliases

      boolean canManageEffortAliases()
      Tests if this user can manage Id aliases for Efforts . 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 Effort aliasing is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • aliasEffort

      Adds an Id to an Effort for the purpose of creating compatibility. The primary Id of the Effort is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another effort, it is reassigned to the given effort Id .
      Parameters:
      effortId - the Id of an Effort
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - effortId not found
      NullArgumentException - effortId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.