Interface AvailabilityAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
AvailabilityBatchAdminSession
This session creates, updates, and deletes Availabilities . 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
Availability , an AvailabilityForm is requested using
getAvailabilityFormForCreate() specifying the desired relationship
peers and record Types or none if no record Types are
needed. The returned AvailabilityForm 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 AvailabilityForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
AvailabilityForm corresponds to an attempted transaction.
For updates, AvailabilityForms are requested to the
Availability Id that is to be updated using
getAvailabilityFormForUpdate() . Similarly, the AvailabilityForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The AvailabilityForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Availabilities . To unmap an
Availability from the current Foundry , the
AvailabilityFoundryAssignmentSession should be used. These delete
operations attempt to remove the Availability 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 TypeMethodDescriptionvoidaliasAvailability(Id availabilityId, Id aliasId) Adds anIdto anAvailabilityfor the purpose of creating compatibility.booleanTests if this user can createAvailabilities.booleancanCreateAvailabilityWithRecordTypes(Type[] availabilityRecordTypes) Tests if this user can create a singleAvailabilityusing the desired record types.booleanTests if this user can deleteAvailabilities.booleanTests if this user can manageIdaliases forAvailabilities.booleanTests if this user can updateAvailabilities.createAvailability(AvailabilityForm availabilityForm) Creates a newAvailability.voiddeleteAvailability(Id availabilityId) Deletes anAvailability.getAvailabilityFormForCreate(Id resourceId, Id jobId, Type[] availabilityRecordTypes) Gets the availability form for creating new availabilities.getAvailabilityFormForUpdate(Id availabilityId) Gets the availability form for updating an existing availability.Gets theFoundryassociated with this session.Gets theFoundryIdassociated with this session.voidupdateAvailability(AvailabilityForm availabilityForm) Updates an existing availability.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.
-
canCreateAvailabilities
boolean canCreateAvailabilities()Tests if this user can createAvailabilities. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anAvailabilitywill 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:
falseifAvailabilitycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateAvailabilityWithRecordTypes
Tests if this user can create a singleAvailabilityusing the desired record types. WhileResourcingManager.getAvailabilityRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificAvailability. Providing an empty array tests if anAvailabilitycan be created with no records.- Parameters:
availabilityRecordTypes- array of availability record types- Returns:
trueifAvailabilitycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-availabilityRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getAvailabilityFormForCreate
AvailabilityForm getAvailabilityFormForCreate(Id resourceId, Id jobId, Type[] availabilityRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the availability form for creating new availabilities. A new form should be requested for each create transaction.- Parameters:
resourceId- theIdfor the resourcejobId- theIdfor the jobavailabilityRecordTypes- array of availability record types- Returns:
- the availability form
- Throws:
NotFoundException-resourceIdorjobIdis not foundNullArgumentException-resourceId, jobId, oravailabilityRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createAvailability
Availability createAvailability(AvailabilityForm availabilityForm) throws OperationFailedException, PermissionDeniedException Creates a newAvailability.- Parameters:
availabilityForm- the form for thisAvailability- Returns:
- the new
Availability - Throws:
IllegalStateException-availabilityFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-availabilityFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-availabilityFormdid not originate fromgetAvailabilityFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateAvailabilities
boolean canUpdateAvailabilities()Tests if this user can updateAvailabilities. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anAvailabilitywill 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:
falseifAvailabilitymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getAvailabilityFormForUpdate
AvailabilityForm getAvailabilityFormForUpdate(Id availabilityId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the availability form for updating an existing availability. A new availability form should be requested for each update transaction.- Parameters:
availabilityId- theIdof theAvailability- Returns:
- the availability form
- Throws:
NotFoundException-availabilityIdis not foundNullArgumentException-availabilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAvailability
void updateAvailability(AvailabilityForm availabilityForm) throws OperationFailedException, PermissionDeniedException Updates an existing availability.- Parameters:
availabilityForm- the form containing the elements to be updated- Throws:
IllegalStateException-availabilityFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-availabilityFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-availabilityFormdid not originate fromgetAvailabilityFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteAvailabilities
boolean canDeleteAvailabilities()Tests if this user can deleteAvailabilities. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anAvailabilitywill 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:
falseifAvailabilitydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteAvailability
void deleteAvailability(Id availabilityId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anAvailability.- Parameters:
availabilityId- theIdof theAvailabilityto remove- Throws:
NotFoundException-availabilityIdnot foundNullArgumentException-availabilityIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageAvailabilityAliases
boolean canManageAvailabilityAliases()Tests if this user can manageIdaliases forAvailabilities. 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:
falseifAvailabilityaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasAvailability
void aliasAvailability(Id availabilityId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anAvailabilityfor the purpose of creating compatibility. The primaryIdof theAvailabilityis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another availability, it is reassigned to the given availabilityId.- Parameters:
availabilityId- theIdof anAvailabilityaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-availabilityIdnot foundNullArgumentException-availabilityIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-