public interface ExchangeSession extends 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.
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateRequestsInExchange(Id provisionId)
Tests if this user can create
Requests. |
boolean |
canCreateRequestWithRecordTypesInExchange(Id provisionId,
Type[] requestRecordTypes)
Tests if this user can create a single
Request using
the desired record types. |
Request |
createRequestInExchange(RequestForm requestForm)
Creates a new
Request. |
Queue |
getQueue()
Gets the
Queue associated with this session. |
Id |
getQueueId()
Gets the
Queue Id associated with this
session. |
RequestForm |
getRequestFormForCreate(Id provisionId,
Type[] requestRecordTypes)
Gets the request form for creating new requests for the exchange.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getQueueId()
Queue
Id
associated with this
session. Queue Id
associated with this sessionmandatory
- This method must be implemented. Queue getQueue() throws OperationFailedException, PermissionDeniedException
Queue
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateRequestsInExchange(Id provisionId)
Requests.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Request
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.provisionId
- the Id
of the provision to exchange false
if Request
creation is not
authorized, true
otherwiseNullArgumentException
- provisionId
is
null
mandatory
- This method must be implemented. boolean canCreateRequestWithRecordTypesInExchange(Id provisionId, Type[] requestRecordTypes)
Request
using
the desired record types. While
ProvisioningManager.getRequestRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Request.
Providing
an empty array tests if a Request
can be created with
no records.provisionId
- the Id
of the provision to exchangerequestRecordTypes
- array of request record types true
if Request
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- provisionId
or
requestRecordTypes
is null
mandatory
- This method must be implemented. RequestForm getRequestFormForCreate(Id provisionId, Type[] requestRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
provisionId
- the Id
of the provision to exchangerequestRecordTypes
- array of request record typesNotFoundException
- provisionId
is not
foundNullArgumentException
- provisionId
or
requestRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Request createRequestInExchange(RequestForm requestForm) throws OperationFailedException, PermissionDeniedException
Request.
requestForm
- the form for this Request
Request
IllegalStateException
- requestForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- requestForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- requestForm
did
not originate from getRequestFormForCreate()
mandatory
- This method must be implemented.