Interface EffortAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
EffortBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasEffort(Id effortId, Id aliasId) Adds anIdto anEffortfor the purpose of creating compatibility.booleanTests if this user can createEfforts.booleancanCreateEffortWithRecordTypes(Type[] effortRecordTypes) Tests if this user can create a singleEffortusing the desired record types.booleanTests if this user can deleteEfforts.booleanTests if this user can manageIdaliases forEfforts.booleanTests if this user can updateEfforts.createEffort(EffortForm effortForm) Creates a newEffort.voiddeleteEffort(Id effortId) Deletes anEffort.getEffortFormForCreate(Id resourceId, Id commissionId, Type[] effortRecordTypes) Gets the effort form for creating new efforts.getEffortFormForUpdate(Id effortId) Gets the effort form for updating an existing effort.Gets theFoundryassociated with this session.Gets theFoundryIdassociated with this session.voidupdateEffort(EffortForm effortForm) Updates an existing effort.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getFoundryId
Id getFoundryId()Gets theFoundryIdassociated with this session.- Returns:
- the
Foundry Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getFoundry
Gets theFoundryassociated with this session.- Returns:
- the foundry
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateEfforts
boolean canCreateEfforts()Tests if this user can createEfforts. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anEffortwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifEffortcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateEffortWithRecordTypes
Tests if this user can create a singleEffortusing the desired record types. WhileResourcingManager.getEffortRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificEffort. Providing an empty array tests if anEffortcan be created with no records.- Parameters:
effortRecordTypes- array of effort record types- Returns:
trueifEffortcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-effortRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getEffortFormForCreate
EffortForm getEffortFormForCreate(Id resourceId, Id commissionId, Type[] effortRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the effort form for creating new efforts. A new form should be requested for each create transaction.- Parameters:
resourceId- theIdfor the resourcecommissionId- theIdfor the commissioneffortRecordTypes- array of effort record types- Returns:
- the effort form
- Throws:
NotFoundException-resourceIdorcommissionIdis not foundNullArgumentException-resourceId, commissionId, oreffortRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createEffort
Effort createEffort(EffortForm effortForm) throws OperationFailedException, PermissionDeniedException Creates a newEffort.- Parameters:
effortForm- the form for thisEffort- Returns:
- the new
Effort - Throws:
IllegalStateException-effortFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-effortFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-effortFormdid not originate fromgetEffortFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateEfforts
boolean canUpdateEfforts()Tests if this user can updateEfforts. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anEffortwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifEffortmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getEffortFormForUpdate
EffortForm getEffortFormForUpdate(Id effortId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the effort form for updating an existing effort. A new effort form should be requested for each update transaction.- Parameters:
effortId- theIdof theEffort- Returns:
- the effort form
- Throws:
NotFoundException-effortIdis not foundNullArgumentException-effortIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEffort
Updates an existing effort.- Parameters:
effortForm- the form containing the elements to be updated- Throws:
IllegalStateException-effortFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-effortFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-effortFormdid not originate fromgetEffortFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteEfforts
boolean canDeleteEfforts()Tests if this user can deleteEfforts. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anEffortwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifEffortdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteEffort
void deleteEffort(Id effortId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anEffort.- Parameters:
effortId- theIdof theEffortto remove- Throws:
NotFoundException-effortIdnot foundNullArgumentException-effortIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageEffortAliases
boolean canManageEffortAliases()Tests if this user can manageIdaliases forEfforts. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifEffortaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasEffort
void aliasEffort(Id effortId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anEffortfor the purpose of creating compatibility. The primaryIdof theEffortis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another effort, it is reassigned to the given effortId.- Parameters:
effortId- theIdof anEffortaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-effortIdnot foundNullArgumentException-effortIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-