public interface EffortAdminSession extends OsidSession
This session creates, updates, and deletes Efforts.
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 an
Effort,
an EffortForm
is requested using
getEffortFormForCreate()
specifying the desired resource,
commission, and record Types
or none if no record
Types
are needed. The returned EffortForm
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
EffortForm
is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each EffortForm
corresponds to an attempted transaction.
For updates, EffortForms
are requested to the
Effort
Id
that is to be updated using
getEffortFormForUpdate().
Similarly, the EffortForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The EffortForm
can
only be used once for a successful update and cannot be reused.
The delete operations delete Efforts.
To unmap an
Effort
from the current Foundry,
the
EffortFoundryAssignmentSession
should be used. These delete
operations attempt to remove the Effort
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasEffort(Id effortId,
Id aliasId)
Adds an
Id to an Effort for the purpose
of creating compatibility. |
boolean |
canCreateEfforts()
Tests if this user can create
Efforts. |
boolean |
canCreateEffortWithRecordTypes(Type[] effortRecordTypes)
Tests if this user can create a single
Effort using the
desired record types. |
boolean |
canDeleteEfforts()
Tests if this user can delete
Efforts. |
boolean |
canManageEffortAliases()
Tests if this user can manage
Id aliases for
Efforts. |
boolean |
canUpdateEfforts()
Tests if this user can update
Efforts. |
Effort |
createEffort(EffortForm effortForm)
Creates a new
Effort. |
void |
deleteEffort(Id effortId)
Deletes an
Effort. |
EffortForm |
getEffortFormForCreate(Id resourceId,
Id commissionId,
Type[] effortRecordTypes)
Gets the effort form for creating new efforts.
|
EffortForm |
getEffortFormForUpdate(Id effortId)
Gets the effort form for updating an existing effort.
|
Foundry |
getFoundry()
Gets the
Foundry associated with this session. |
Id |
getFoundryId()
Gets the
Foundry Id associated with this
session. |
void |
updateEffort(EffortForm effortForm)
Updates an existing effort.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getFoundryId()
Foundry
Id
associated with this
session. Foundry Id
associated with this sessionmandatory
- This method must be implemented. Foundry getFoundry() throws OperationFailedException, PermissionDeniedException
Foundry
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateEfforts()
Efforts.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating an Effort
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 Effort
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateEffortWithRecordTypes(Type[] effortRecordTypes)
Effort
using the
desired record types. While
ResourcingManager.getEffortRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Effort.
Providing
an empty array tests if an Effort
can be created with
no records.effortRecordTypes
- array of effort record types true
if Effort
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- effortRecordTypes
is null
mandatory
- This method must be implemented. EffortForm getEffortFormForCreate(Id resourceId, Id commissionId, Type[] effortRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
resourceId
- the Id
for the resourcecommissionId
- the Id
for the commissioneffortRecordTypes
- array of effort record typesNotFoundException
- resourceId
or
commissionId
is not foundNullArgumentException
- resourceId,
commissionId,
or effortRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Effort createEffort(EffortForm effortForm) throws OperationFailedException, PermissionDeniedException
Effort.
effortForm
- the form for this Effort
Effort
IllegalStateException
- effortForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- effortForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- effortForm
did
not originate from getEffortFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateEfforts()
Efforts.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating an Effort
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 Effort
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. EffortForm getEffortFormForUpdate(Id effortId) throws NotFoundException, OperationFailedException, PermissionDeniedException
effortId
- the Id
of the Effort
NotFoundException
- effortId
is not
foundNullArgumentException
- effortId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateEffort(EffortForm effortForm) throws OperationFailedException, PermissionDeniedException
effortForm
- the form containing the elements to be updatedIllegalStateException
- effortForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- effortForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- effortForm
did
not originate from getEffortFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteEfforts()
Efforts.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting an Effort
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 Effort
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteEffort(Id effortId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Effort.
effortId
- the Id
of the Effort
to
removeNotFoundException
- effortId
not foundNullArgumentException
- effortId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageEffortAliases()
Id
aliases for
Efforts.
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 Effort
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasEffort(Id effortId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to an Effort
for the purpose
of creating compatibility. The primary Id
of the
Effort
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the
alias is a pointer to another effort, it is reassigned to the given
effort Id.
effortId
- the Id
of an Effort
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- effortId
not foundNullArgumentException
- effortId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.