Interface OfficeAdminSession

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

public interface OfficeAdminSession extends OsidSession

This session creates, updates, and deletes Offices . The data for create and update is provided by the consumer via the form. OsidForms are requested for each create or update and may not be reused.

Create and update operations differ in their usage. To create an Office , an OfficeForm is requested using getOfficeFormForCreate() specifying the desired record Types or none if no record Types are needed. The returned OfficeForm 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 OfficeForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each OfficeForm corresponds to an attempted transaction.

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

The delete operations delete Offices .

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

  • Method Details

    • canCreateOffices

      boolean canCreateOffices()
      Tests if this user can create Offices . A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Office . will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.
      Returns:
      false if Office creation is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • canCreateOfficeWithRecordTypes

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

      OfficeForm getOfficeFormForCreate(Type[] officeRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the office form for creating new offices. A new form should be requested for each create transaction.
      Parameters:
      officeRecordTypes - array of office record types
      Returns:
      the office form
      Throws:
      NullArgumentException - officeRecordTypes 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.
    • createOffice

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

      boolean canUpdateOffices()
      Tests if this user can update Offices . A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Office will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.
      Returns:
      false if Office modification is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getOfficeFormForUpdate

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

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

      boolean canDeleteOffices()
      Tests if this user can delete Offices . A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Office will result in a PERMISSION_DENIED . This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.
      Returns:
      false if Office deletion is not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • deleteOffice

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

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

      Adds an Id to an Office for the purpose of creating compatibility. The primary Id of the Office is determined by the provider. The new Id performs as an alias to the primary Id .
      Parameters:
      officeId - the Id of an Office
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is already assigned
      NotFoundException - officeId not found
      NullArgumentException - officeId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.