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 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
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasFiscalPeriod(Id fiscalPeriodId,
Id aliasId)
Adds an
Id to a FiscalPeriod for the
purpose of creating compatibility. |
boolean |
canCreateFiscalPeriods()
Tests if this user can create
FiscalPeriods. |
boolean |
canCreateFiscalPeriodWithRecordTypes(Type[] fiscalPeriodRecordTypes)
Tests if this user can create a single
FiscalPeriod
using the desired record types. |
boolean |
canDeleteFiscalPeriods()
Tests if this user can delete
FiscalPeriods. |
boolean |
canManageFiscalPeriodAliases()
Tests if this user can manage
Id aliases for
FiscalPeriods. |
boolean |
canUpdateFiscalPeriods()
Tests if this user can update
FiscalPeriods. |
FiscalPeriod |
createFiscalPeriod(FiscalPeriodForm fiscalPeriodForm)
Creates a new
FiscalPeriod. |
void |
deleteFiscalPeriod(Id fiscalPeriodId)
Deletes a
FiscalPeriod. |
Business |
getBusiness()
Gets the
Business associated with this session. |
Id |
getBusinessId()
Gets the
Business Id associated with
this session. |
FiscalPeriodForm |
getFiscalPeriodFormForCreate(Type[] fiscalPeriodRecordTypes)
Gets the fiscal period form for creating new fiscal periods.
|
FiscalPeriodForm |
getFiscalPeriodFormForUpdate(Id fiscalPeriodId)
Gets the fiscal period form for updating an existing fiscal period.
|
void |
updateFiscalPeriod(FiscalPeriodForm fiscalPeriodForm)
Updates an existing fiscal period.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getBusinessId()
Business
Id
associated with
this session. Business Id
associated with this sessionmandatory
- This method must be implemented. Business getBusiness() throws OperationFailedException, PermissionDeniedException
Business
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateFiscalPeriods()
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. false
if FiscalPeriod
creation
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateFiscalPeriodWithRecordTypes(Type[] fiscalPeriodRecordTypes)
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.fiscalPeriodRecordTypes
- array of fiscal period record types true
if FiscalPeriod
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- fiscalPeriodRecordTypes
is null
mandatory
- This method must be implemented. FiscalPeriodForm getFiscalPeriodFormForCreate(Type[] fiscalPeriodRecordTypes) throws OperationFailedException, PermissionDeniedException
fiscalPeriodRecordTypes
- array of fiscal period record typesNullArgumentException
- fiscalPeriodRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. FiscalPeriod createFiscalPeriod(FiscalPeriodForm fiscalPeriodForm) throws NotFoundException, OperationFailedException, PermissionDeniedException
FiscalPeriod.
fiscalPeriodForm
- the form for this FiscalPeriod
FiscalPeriod
IllegalStateException
- fiscalPeriodForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNotFoundException
- fiscalPeriodForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- fiscalPeriodForm
did not originate from getFiscalPeriodFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateFiscalPeriods()
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. false
if FiscalPeriod
modification is not authorized, true
otherwisemandatory
- This method must be implemented. FiscalPeriodForm getFiscalPeriodFormForUpdate(Id fiscalPeriodId) throws NotFoundException, OperationFailedException, PermissionDeniedException
fiscalPeriodId
- the Id
of the
FiscalPeriod
NotFoundException
- fiscalPeriodId
is
not foundNullArgumentException
- fiscalPeriodId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateFiscalPeriod(FiscalPeriodForm fiscalPeriodForm) throws OperationFailedException, PermissionDeniedException
fiscalPeriodForm
- the form containing the elements to be
updatedIllegalStateException
- fiscalPeriodForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- fiscalPeriodForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- fiscalPeriodForm
did not originate from getFiscalPeriodFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteFiscalPeriods()
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. false
if FiscalPeriod
deletion
is not authorized, true
otherwisemandatory
- This method must be implemented. void deleteFiscalPeriod(Id fiscalPeriodId) throws NotFoundException, OperationFailedException, PermissionDeniedException
FiscalPeriod.
fiscalPeriodId
- the Id
of the
FiscalPeriod
to removeNotFoundException
- fiscalPeriodId
not
foundNullArgumentException
- fiscalPeriodId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageFiscalPeriodAliases()
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. false
if FiscalPeriod
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasFiscalPeriod(Id fiscalPeriodId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
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.
fiscalPeriodId
- the Id
of a FiscalPeriod
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is in
use as a primary Id
NotFoundException
- fiscalPeriodId
not
foundNullArgumentException
- fiscalPeriodId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.