Interface FiscalPeriodAdminSession

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

public interface FiscalPeriodAdminSession extends OsidSession

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

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

The delete operations delete FiscalPeriods . To unmap a FiscalPeriod from the current Business , the FiscalPeriodBusinessAssignmentSession should be used. These delete operations attempt to remove the FiscalPeriod itself thus removing it from all known Business catalogs.

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

  • Method Details

    • getBusinessId

      Id getBusinessId()
      Gets the Business Id associated with this session.
      Returns:
      the Business Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBusiness

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

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

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

      FiscalPeriodForm getFiscalPeriodFormForCreate(Type[] fiscalPeriodRecordTypes) throws OperationFailedException, PermissionDeniedException
      Gets the fiscal period form for creating new fiscal periods. A new form should be requested for each create transaction.
      Parameters:
      fiscalPeriodRecordTypes - array of fiscal period record types
      Returns:
      the fiscal period form
      Throws:
      NullArgumentException - fiscalPeriodRecordTypes 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.
    • createFiscalPeriod

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

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

      FiscalPeriodForm getFiscalPeriodFormForUpdate(Id fiscalPeriodId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets the fiscal period form for updating an existing fiscal period. A new fiscal period form should be requested for each update transaction.
      Parameters:
      fiscalPeriodId - the Id of the FiscalPeriod
      Returns:
      the fiscal period form
      Throws:
      NotFoundException - fiscalPeriodId is not found
      NullArgumentException - fiscalPeriodId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • updateFiscalPeriod

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

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

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

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

      void aliasFiscalPeriod(Id fiscalPeriodId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
      Adds an Id to a FiscalPeriod for the purpose of creating compatibility. The primary Id of the FiscalPeriod is determined by the provider. The new Id performs as an alias to the primary Id . If the alias is a pointer to another fiscal period, it is reassigned to the given fiscal period Id .
      Parameters:
      fiscalPeriodId - the Id of a FiscalPeriod
      aliasId - the alias Id
      Throws:
      AlreadyExistsException - aliasId is in use as a primary Id
      NotFoundException - fiscalPeriodId not found
      NullArgumentException - fiscalPeriodId or aliasId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.