Interface JobAdminSession

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

public interface JobAdminSession extends OsidSession

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

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

The delete operations delete Jobs . To unmap a Job from the current Foundry , the JobFormAssignmentSession should be used. These delete operations attempt to remove the Job 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.
    • canCreateJobs

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

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

      JobForm getJobFormForCreate(Type[] jobRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the job form for creating new jobs. A new form should be requested for each create transaction.
      Parameters:
      jobRecordTypes - array of job record types
      Returns:
      the job form
      Throws:
      NullArgumentException - jobRecordTypes is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - unable to get form with requested record types
      Compliance:
      mandatory - This method must be implemented.
    • createJob

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

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

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

      Updates an existing job.
      Parameters:
      jobForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - jobForm already used in an update transaction
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - jobId or jobForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - jobForm did not orginiate from getJobFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeleteJobs

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

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

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

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