Interface FoundryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
FoundryBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasFoundry(Id foundryId, Id aliasId) Adds anIdto aFoundryfor the purpose of creating compatibility.booleanTests if this user can createFoundries.booleancanCreateFoundryWithRecordTypes(Type[] foundryRecordTypes) Tests if this user can create a singleFoundryusing the desired record types.booleanTests if this user can deleteFoundries.booleanTests if this user can manageIdaliases forFoundries.booleanTests if this user can updateFoundries.createFoundry(FoundryForm foundryForm) Creates a newFoundry.voiddeleteFoundry(Id foundryId) Deletes aFoundry.getFoundryFormForCreate(Type[] foundryRecordTypes) Gets the foundry form for creating new foundries.getFoundryFormForUpdate(Id foundryId) Gets the foundry form for updating an existing foundry.voidupdateFoundry(FoundryForm foundryForm) Updates an existing foundryMethods 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
-
canCreateFoundries
boolean canCreateFoundries()Tests if this user can createFoundries. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aFoundry. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifFoundrycreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateFoundryWithRecordTypes
Tests if this user can create a singleFoundryusing the desired record types. WhileResourcingManager.getFoundryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificFoundry. Providing an empty array tests if aFoundrycan be created with no records.- Parameters:
foundryRecordTypes- array of foundry record types- Returns:
trueifFoundrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-foundryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getFoundryFormForCreate
FoundryForm getFoundryFormForCreate(Type[] foundryRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the foundry form for creating new foundries. A new form should be requested for each create transaction.- Parameters:
foundryRecordTypes- array of foundry record types- Returns:
- the foundry form
- Throws:
NullArgumentException-foundryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createFoundry
Foundry createFoundry(FoundryForm foundryForm) throws OperationFailedException, PermissionDeniedException Creates a newFoundry.- Parameters:
foundryForm- the form for thisFoundry- Returns:
- the new
Foundry - Throws:
IllegalStateException-foundryFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-foundryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-foundryFormdid not originate fromgetFoundryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateFoundries
boolean canUpdateFoundries()Tests if this user can updateFoundries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aFoundrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifFoundrymodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getFoundryFormForUpdate
FoundryForm getFoundryFormForUpdate(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the foundry form for updating an existing foundry. A new foundry form should be requested for each update transaction.- Parameters:
foundryId- theIdof theFoundry- Returns:
- the foundry form
- Throws:
NotFoundException-foundryIdis not foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateFoundry
void updateFoundry(FoundryForm foundryForm) throws OperationFailedException, PermissionDeniedException Updates an existing foundry- Parameters:
foundryForm- the form containing the elements to be updated- Throws:
IllegalStateException-foundryFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-foundryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-foundryFormdid not originate fromgetFoundryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteFoundries
boolean canDeleteFoundries()Tests if this user can deleteFoundries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aFoundrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifFoundrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteFoundry
void deleteFoundry(Id foundryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aFoundry.- Parameters:
foundryId- theIdof theFoundryto remove- Throws:
NotFoundException-foundryIdnot foundNullArgumentException-foundryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageFoundryAliases
boolean canManageFoundryAliases()Tests if this user can manageIdaliases forFoundries. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifFoundryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasFoundry
void aliasFoundry(Id foundryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aFoundryfor the purpose of creating compatibility. The primaryIdof theFoundryis determined by the provider. The newIdperforms as an alias to the primaryId.- Parameters:
foundryId- theIdof aFoundryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-foundryIdnot foundNullArgumentException-foundryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-