public interface FoundryAdminSession extends OsidSession
This session creates, updates, and deletes Foundries.
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
Foundry,
a FoundryForm
is requested using
getFoundryFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed. The
returned FoundryForm
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 FoundryForm
is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each FoundryForm
corresponds to an attempted transaction.
For updates, FoundryForms
are requested to the
Foundry
Id
that is to be updated using
getFoundryFormForUpdate().
Similarly, the FoundryForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The FoundryForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Foundries,
It is safer to
remove all mappings to the Foundry
catalogs before
deletion.
This session includes an Id
aliasing mechanism to
assign an external Id
to an internally assigned Id.
Modifier and Type | Method and Description |
---|---|
void |
aliasFoundry(Id foundryId,
Id aliasId)
Adds an
Id to a Foundry for the purpose
of creating compatibility. |
boolean |
canCreateFoundries()
Tests if this user can create
Foundries. |
boolean |
canCreateFoundryWithRecordTypes(Type[] foundryRecordTypes)
Tests if this user can create a single
Foundry using
the desired record types. |
boolean |
canDeleteFoundries()
Tests if this user can delete
Foundries. |
boolean |
canManageFoundryAliases()
Tests if this user can manage
Id aliases for
Foundries. |
boolean |
canUpdateFoundries()
Tests if this user can update
Foundries. |
Foundry |
createFoundry(FoundryForm foundryForm)
Creates a new
Foundry. |
void |
deleteFoundry(Id foundryId)
Deletes a
Foundry. |
FoundryForm |
getFoundryFormForCreate(Type[] foundryRecordTypes)
Gets the foundry form for creating new foundries.
|
FoundryForm |
getFoundryFormForUpdate(Id foundryId)
Gets the foundry form for updating an existing foundry.
|
void |
updateFoundry(FoundryForm foundryForm)
Updates an existing foundry
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateFoundries()
Foundries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Foundry.
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false
if Foundry
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateFoundryWithRecordTypes(Type[] foundryRecordTypes)
Foundry
using
the desired record types. While
ResourcingManager.getFoundryRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Foundry.
Providing
an empty array tests if a Foundry
can be created with
no records.foundryRecordTypes
- array of foundry record types true
if Foundry
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- foundryRecordTypes
is null
mandatory
- This method must be implemented. FoundryForm getFoundryFormForCreate(Type[] foundryRecordTypes) throws OperationFailedException, PermissionDeniedException
foundryRecordTypes
- array of foundry record typesNullArgumentException
- foundryRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Foundry createFoundry(FoundryForm foundryForm) throws OperationFailedException, PermissionDeniedException
Foundry.
foundryForm
- the form for this Foundry
Foundry
IllegalStateException
- foundryForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- foundryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- foundryForm
did
not originate from getFoundryFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateFoundries()
Foundries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Foundry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false
if Foundry
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. FoundryForm getFoundryFormForUpdate(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
foundryId
- the Id
of the Foundry
NotFoundException
- foundryId
is not
foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateFoundry(FoundryForm foundryForm) throws OperationFailedException, PermissionDeniedException
foundryForm
- the form containing the elements to be updatedIllegalStateException
- foundryForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- foundryForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- foundryForm
did
not originate from getFoundryFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteFoundries()
Foundries.
A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting a Foundry
will
result in a PERMISSION_DENIED.
This is intended as a
hint to an application that may not wish to offer delete operations to
unauthorized users. false
if Foundry
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteFoundry(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Foundry.
foundryId
- the Id
of the Foundry
to removeNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageFoundryAliases()
Id
aliases for
Foundries.
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 Foundry
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasFoundry(Id foundryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Foundry
for the purpose
of creating compatibility. The primary Id
of the
Foundry
is determined by the provider. The new Id
performs as an alias to the primary Id.
foundryId
- the Id
of a Foundry
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- foundryId
not foundNullArgumentException
- foundryId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.