Interface PressAdminSession

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

public interface PressAdminSession extends OsidSession

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

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

The delete operations delete Presses .

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

  • Method Details

    • canCreatePresses

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

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

      PressForm getPressFormForCreate(Type[] pressRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the press form for creating new presses. A new form should be requested for each create transidiom.
      Parameters:
      pressRecordTypes - array of press record types
      Returns:
      the press form
      Throws:
      NullArgumentException - pressRecordTypes 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.
    • createPress

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

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

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

      void updatePress(PressForm pressForm) throws OperationFailedException, PermissionDeniedException
      Updates an existing press
      Parameters:
      pressForm - the form containing the elements to be updated
      Throws:
      IllegalStateException - pressForm already used in an update transidiom
      InvalidArgumentException - the form contains an invalid value
      NullArgumentException - pressForm is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - pressForm did not originate from getPressFormForUpdate()
      Compliance:
      mandatory - This method must be implemented.
    • canDeletePresses

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

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

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

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