Interface EntryAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
EntryBatchAdminSession
EntryAdminSession creates, updates and deletes dictionary
entries.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasEntry(Id entryId, Id aliasId) Adds anIdto anEntryfor the purpose of creating compatibility.booleanTests if this user can create entries A return of true does not guarantee successful authorization.booleancanCreateEntryWithRecordTypes(Type[] entryRecordTypes) Tests if this user can create a singleEntryusing the desired record types.booleanTests if this user can deleteEntries.booleanTests if this user can manageIdaliases forEntries.booleanTests if this user can update entries.createEntry(EntryForm entryForm) Creates a newEntry.voiddeleteEntry(Id entryId) Updates an existingDictionaryentry identified with the specified key with the given value.Gets theDictionaryassociated with this session.Gets theDictionaryIdassociated with this session.getEntryFormForCreate(Type keyType, Object key, Type valueType, Type[] entryRecordTypes) Gets the entry form for creating new inquiries.getEntryFormForUpdate(Id entryId) Gets the entry form for updating an existing entry.voidupdateEntry(EntryForm entryForm) Updates an existingEntry.Methods 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
-
getDictionaryId
Id getDictionaryId()Gets theDictionaryIdassociated with this session.- Returns:
- the
DictionaryIdassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getDictionary
Gets theDictionaryassociated with this session.- Returns:
- the
Dictionaryassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateEntries
boolean canCreateEntries()Tests if this user can create entries A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseif entry creation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateEntryWithRecordTypes
Tests if this user can create a singleEntryusing the desired record types. WhileDictionaryManager.getEntryRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificEntry. Providing an empty array tests if anEntrycan be created with no records.- Parameters:
entryRecordTypes- array of entry record types- Returns:
trueifEntrycreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-entryRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getEntryFormForCreate
EntryForm getEntryFormForCreate(Type keyType, Object key, Type valueType, Type[] entryRecordTypes) throws AlreadyExistsException, OperationFailedException, PermissionDeniedException Gets the entry form for creating new inquiries. A new form should be requested for each create transaction.- Parameters:
keyType- theTypeof the keykey- the keyvalueType- theTypeof the valueentryRecordTypes- array of entry record types- Returns:
- the entry form
- Throws:
AlreadyExistsException- an entry by thiskey,keyType, andvalueTypealready existsNullArgumentException-keyType, key, valueType, orentryRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested key/value or record types- Compliance:
mandatory- This method must be implemented.
-
createEntry
Creates a newEntry.- Parameters:
entryForm- the form for this entry- Returns:
- the created entry
- Throws:
IllegalStateException-entryFormalready used in a create transaction.InvalidArgumentException- one or more of the form elements is invalidNullArgumentException-entryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-entryFormdid not originate fromgetEntryFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateEntries
boolean canUpdateEntries()Tests if this user can update entries. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif entry modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getEntryFormForUpdate
EntryForm getEntryFormForUpdate(Id entryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the entry form for updating an existing entry. A new entry form should be requested for each update transaction.- Parameters:
entryId- theIdof theEntry- Returns:
- the entry form
- Throws:
NotFoundException-entryIdis not foundNullArgumentException-entryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateEntry
Updates an existingEntry.- Parameters:
entryForm- the form containing the elements to be updated- Throws:
IllegalStateException-entryFormalready used in an update transatcionInvalidArgumentException- the form contains an invalid valueNullArgumentException-entryFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-entryyFormdid not originate fromgetEntryFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteEntries
boolean canDeleteEntries()Tests if this user can deleteEntries. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anEntrywill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifEntrydeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteEntry
void deleteEntry(Id entryId) throws NotFoundException, OperationFailedException, PermissionDeniedException Updates an existingDictionaryentry identified with the specified key with the given value.- Parameters:
entryId- theIdof the entry- Throws:
NotFoundException- entry is not foundNullArgumentException-entryIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageEntryAliases
boolean canManageEntryAliases()Tests if this user can manageIdaliases forEntries. 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:
falseifEntryaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasEntry
void aliasEntry(Id entryId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anEntryfor the purpose of creating compatibility. The primaryIdof theEntryis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another entry, it is reassigned to the given entryId.- Parameters:
entryId- theIdof anEntryaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-entryIdnot foundNullArgumentException-entryIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-