public interface ProvisionAdminSession extends OsidSession
This session creates, updates, and deletes Provisions.
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 a
Provision,
a ProvisionForm
is requested using
getProvisionFormForCreate()
specifying the desired broker,
provisionable, resource, and record Types
or none if no
record Types
are needed. The returned ProvisionForm
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 ProvisionForm
is submiited to a create operation, it
cannot be reused with another create operation unless the first operation
was unsuccessful. Each ProvisionForm
corresponds to an
attempted transaction.
For updates, ProvisionForms
are requested to the
Provision
Id
that is to be updated using
getProvisionFormForUpdate().
Similarly, the ProvisionForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ProvisionForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Provisions.
To unmap a
Provision
from the current Distributor,
the
ProvisionDistributorAssignmentSession
should be used. These
delete operations attempt to remove the Provision
itself
thus removing it from all known Distributor
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 |
aliasProvision(Id provisionId,
Id aliasId)
Adds an
Id to a Provision for the
purpose of creating compatibility. |
boolean |
canCreateProvisions()
Tests if this user can create
Provisions. |
boolean |
canCreateProvisionWithRecordTypes(Type[] provisionRecordTypes)
Tests if this user can create a single
Provision using
the desired record types. |
boolean |
canDeleteProvisions()
Tests if this user can delete
Provisions. |
boolean |
canManageProvisionAliases()
Tests if this user can manage
Id aliases for
Provisions. |
boolean |
canUpdateProvisions()
Tests if this user can update
Provisions. |
Provision |
createProvision(ProvisionForm provisionForm)
Creates a new
Provision. |
void |
deleteProvision(Id provisionId)
Deletes a
Provision. |
Distributor |
getDistributor()
Gets the
Distributor associated with this session. |
Id |
getDistributorId()
Gets the
Distributor Id associated with
this session. |
ProvisionForm |
getProvisionFormForCreate(Id brokerId,
Id provisionableId,
Id resourceId,
Type[] provisionRecordTypes)
Gets the provision form for creating new provisions.
|
ProvisionForm |
getProvisionFormForUpdate(Id provisionId)
Gets the provision form for updating an existing provision.
|
void |
updateProvision(ProvisionForm provisionForm)
Updates an existing provision.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getDistributorId()
Distributor
Id
associated with
this session. Distributor Id
associated with this sessionmandatory
- This method must be implemented. Distributor getDistributor() throws OperationFailedException, PermissionDeniedException
Distributor
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateProvisions()
Provisions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Provision
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 Provision
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProvisionWithRecordTypes(Type[] provisionRecordTypes)
Provision
using
the desired record types. While
ProvisioningManager.getProvisionRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Provision.
Providing an empty array tests if a Provision
can be
created with no records.provisionRecordTypes
- array of provision record types true
if Provision
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- provisionRecordTypes
is null
mandatory
- This method must be implemented. ProvisionForm getProvisionFormForCreate(Id brokerId, Id provisionableId, Id resourceId, Type[] provisionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
brokerId
- the Id
for the brokerprovisionableId
- the Id
for the provisionableresourceId
- the Id
for the resourceprovisionRecordTypes
- array of provision record typesNotFoundException
- brokerId, provisionableId,
or resourceId
is not foundNullArgumentException
- brokerId,
provisionableId, resourceId,
or
provisionRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Provision createProvision(ProvisionForm provisionForm) throws OperationFailedException, PermissionDeniedException
Provision.
provisionForm
- the form for this Provision
Provision
IllegalStateException
- provisionForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- provisionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- provisionForm
did
not originate from getProvisionFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProvisions()
Provisions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Provision
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 Provision
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. ProvisionForm getProvisionFormForUpdate(Id provisionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
provisionId
- the Id
of the Provision
NotFoundException
- provisionId
is not
foundNullArgumentException
- provisionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateProvision(ProvisionForm provisionForm) throws OperationFailedException, PermissionDeniedException
provisionForm
- the form containing the elements to be updatedIllegalStateException
- provisionForm
already used in an update transatcionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- provisionForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- provisionForm
did
not originate from getProvisionFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProvisions()
Provisions.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Provision
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 Provision
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. void deleteProvision(Id provisionId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Provision.
provisionId
- the Id
of the Provision
to removeNotFoundException
- provisionId
not
foundNullArgumentException
- provisionId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProvisionAliases()
Id
aliases for
Provisions.
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 Provision
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasProvision(Id provisionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Provision
for the
purpose of creating compatibility. The primary Id
of
the Provision
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another provision, it is
reassigned to the given provision Id.
provisionId
- the Id
of a Provision
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- provisionId
not
foundNullArgumentException
- provisionId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.