public interface ProcedureAdminSession extends OsidSession
This session creates, updates, and deletes Procedures.
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
Procedure,
a ProcedureForm
is requested using
getProcedureFormForCreate()
specifying the desired record
Types
or none if no record Types
are needed.
The returned ProcedureForm
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 ProcedureForm
is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ProcedureForm
corresponds to an attempted transaction.
For updates, ProcedureForms
are requested to the
Procedure
Id
that is to be updated using
getProcedureFormForUpdate().
Similarly, the ProcedureForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ProcedureForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Procedures.
To unmap a
Procedure
from the current Cookbook,
the
ProcedureCookbookAssignmentSession
should be used. These
delete operations attempt to remove the Procedure
itself
thus removing it from all known Cookbook
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 |
aliasProcedure(Id procedureId,
Id aliasId)
Adds an
Id to a Procedure for the
purpose of creating compatibility. |
boolean |
canCreateProcedures()
Tests if this user can create procedures.
|
boolean |
canCreateProcedureWithRecordTypes(Type[] procedureRecordTypes)
Tests if this user can create a single
Procedure using
the desired record types. |
boolean |
canDeleteProcedure(Id procedureId)
Tests if this user can delete a specified
Procedure. |
boolean |
canDeleteProcedures()
Tests if this user can delete procedures.
|
boolean |
canManageProcedureAliases()
Tests if this user can manage
Id aliases for
Comnents. |
boolean |
canUpdateProcedure(Id procedureId)
Tests if this user can update a specified
Procedure. |
boolean |
canUpdateProcedures()
Tests if this user can update procedures.
|
Procedure |
createProcedure(ProcedureForm procedureForm)
Creates a new
Procedure. |
void |
deleteProcedure(Id procedureId)
Deletes a
Procedure. |
void |
deleteProcedures()
Deletes all
Procedures in this Cookbook. |
Cookbook |
getCookbook()
Gets the
Cookbook associated with this session. |
Id |
getCookbookId()
Gets the
Cookbook Id associated with
this session. |
ProcedureForm |
getProcedureFormForCreate(Type[] procedureRecordTypes)
Gets the procedure form for creating new procedures.
|
ProcedureForm |
getProcedureFormForUpdate(Id procedureId)
Gets the procedure form for updating an existing procedure.
|
void |
updateProcedure(ProcedureForm procedureForm)
Updates an existing procedure.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getCookbookId()
Cookbook
Id
associated with
this session. Cookbook Id
associated with this sessionmandatory
- This method must be implemented. Cookbook getCookbook() throws OperationFailedException, PermissionDeniedException
Cookbook
associated with this session.OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateProcedures()
Procedure
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 Procedure
creation is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateProcedureWithRecordTypes(Type[] procedureRecordTypes)
Procedure
using
the desired record types. While
RecipeManager.getProcedureRecordTypes()
can be used to examine
which records are supported, this method tests which record(s) are
required for creating a specific Procedure.
Providing
an empty array tests if a Procedure
can be created with
no records.procedureRecordTypes
- array of procedure record types true
if Procedure
creation using
the specified record Types
is supported,
false
otherwiseNullArgumentException
- procedureRecordTypes
is null
mandatory
- This method must be implemented. ProcedureForm getProcedureFormForCreate(Type[] procedureRecordTypes) throws OperationFailedException, PermissionDeniedException
procedureRecordTypes
- array of procedure record typesNullArgumentException
- procedureRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form for requested
record typesmandatory
- This method must be implemented. Procedure createProcedure(ProcedureForm procedureForm) throws OperationFailedException, PermissionDeniedException
Procedure.
procedureForm
- the form for this Procedure
Procedure
IllegalStateException
- procedureForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- procedureForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- procedureForm
did
not originate from getProcedureFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateProcedures()
Procedure
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 Procedure
modification
is not authorized, true
otherwisemandatory
- This method must be implemented. boolean canUpdateProcedure(Id procedureId)
Procedure.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known updating the Procedure
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.procedureId
- the Id
of the Procedure
false
if procedure modification is not
authorized, true
otherwiseNullArgumentException
- procedureId
is
null
mandatory
- This method must be implemented. If
- the procedureId
is not found, then it is
acceptable to return false to indicate the lack of an update
available. ProcedureForm getProcedureFormForUpdate(Id procedureId) throws NotFoundException, OperationFailedException, PermissionDeniedException
procedureId
- the Id
of the Procedure
NotFoundException
- procedureId
is not
foundNullArgumentException
- procedureId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateProcedure(ProcedureForm procedureForm) throws OperationFailedException, PermissionDeniedException
procedureForm
- the form containing the elements to be updatedIllegalStateException
- procedureForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- procedureId
or
procedureForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- procedureForm
did
not originate from getProcedureFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteProcedures()
Procedure
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 Procedure
deletion is
not authorized, true
otherwisemandatory
- This method must be implemented. boolean canDeleteProcedure(Id procedureId)
Procedure.
A
return of true does not guarantee successful authorization. A return
of false indicates that it is known deleting the Procedure
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.procedureId
- the Id
of the Procedure
false
if deletion of this Procedure
is not authorized, true
otherwiseNullArgumentException
- procedureId
is
null
mandatory
- This method must be implemented. If
- the procedureId
is not found, then it is
acceptable to return false to indicate the lack of a delete
available. void deleteProcedure(Id procedureId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Procedure.
procedureId
- the Id
of the Procedure
to removeNotFoundException
- procedureId
not
foundNullArgumentException
- procedureId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void deleteProcedures() throws OperationFailedException, PermissionDeniedException
Procedures
in this Cookbook.
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageProcedureAliases()
Id
aliases for
Comnents.
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 Procedure
aliasing is
not authorized, true
otherwisemandatory
- This method must be implemented. void aliasProcedure(Id procedureId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Procedure
for the
purpose of creating compatibility. The primary Id
of
the Procedure
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another procedure, it is
reassigned to the given procedure Id.
procedureId
- the Id
of a Procedure
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- procedureId
not
foundNullArgumentException
- procedureId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.