Interface ExchangeSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session exchanges an existing provision for a request for another
provision via the queue. The data for create and update is provided via
the RequestForm .
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanCreateRequestsInExchange(Id provisionId) Tests if this user can createRequests.booleancanCreateRequestWithRecordTypesInExchange(Id provisionId, Type[] requestRecordTypes) Tests if this user can create a singleRequestusing the desired record types.createRequestInExchange(RequestForm requestForm) Creates a newRequest.getQueue()Gets theQueueassociated with this session.Gets theQueueIdassociated with this session.getRequestFormForCreate(Id provisionId, Type[] requestRecordTypes) Gets the request form for creating new requests for the exchange.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
-
getQueueId
Id getQueueId()Gets theQueueIdassociated with this session.- Returns:
- the
Queue Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getQueue
Gets theQueueassociated with this session.- Returns:
- the queue
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRequestsInExchange
Tests if this user can createRequests. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRequestwill 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.- Parameters:
provisionId- theIdof the provision to exchange- Returns:
falseifRequestcreation is not authorized,trueotherwise- Throws:
NullArgumentException-provisionIdisnull- Compliance:
mandatory- This method must be implemented.
-
canCreateRequestWithRecordTypesInExchange
Tests if this user can create a singleRequestusing the desired record types. WhileProvisioningManager.getRequestRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRequest. Providing an empty array tests if aRequestcan be created with no records.- Parameters:
provisionId- theIdof the provision to exchangerequestRecordTypes- array of request record types- Returns:
trueifRequestcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-provisionIdorrequestRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRequestFormForCreate
RequestForm getRequestFormForCreate(Id provisionId, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the request form for creating new requests for the exchange. A new form should be requested for each create transaction.- Parameters:
provisionId- theIdof the provision to exchangerequestRecordTypes- array of request record types- Returns:
- the request form
- Throws:
NotFoundException-provisionIdis not foundNullArgumentException-provisionIdorrequestRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRequestInExchange
Request createRequestInExchange(RequestForm requestForm) throws OperationFailedException, PermissionDeniedException Creates a newRequest.- Parameters:
requestForm- the form for thisRequest- Returns:
- the new
Request - Throws:
IllegalStateException-requestFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-requestFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-requestFormdid not originate fromgetRequestFormForCreate()- Compliance:
mandatory- This method must be implemented.
-