Interface DeviceEnablerAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates and removes device enablers. The data for create
and update is provided via the DeviceEnablerForm .
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasDeviceEnabler(Id deviceEnablerId, Id aliasId) Adds anIdto aDeviceEnablerfor the purpose of creating compatibility.booleanTests if this user can create device enablers.booleancanCreateDeviceEnablerWithRecordTypes(Type[] deviceEnablerRecordTypes) Tests if this user can create a singleDeviceEnablerusing the desired record types.booleanTests if this user can delete device enablers.booleanTests if this user can manageIdaliases for device enablers.booleanTests if this user can update device enablers.createDeviceEnabler(DeviceEnablerForm deviceEnablerForm) Creates a newDeviceEnabler.voiddeleteDeviceEnabler(Id deviceEnablerId) Deletes aDeviceEnabler.getDeviceEnablerFormForCreate(Type[] deviceEnablerRecordTypes) Gets the device enabler form for creating new device enablers.getDeviceEnablerFormForUpdate(Id deviceEnablerId) Gets the device enabler form for updating an existing device enabler.Gets theSystemassociated with this session.Gets theSystemIdassociated with this session.voidupdateDeviceEnabler(DeviceEnablerForm deviceEnablerForm) Updates an existing device enabler.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
-
getSystemId
Id getSystemId()Gets theSystemIdassociated with this session.- Returns:
- the
System Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getSystem
Gets theSystemassociated with this session.- Returns:
- the system
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateDeviceEnabler
boolean canCreateDeviceEnabler()Tests if this user can create device enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aDeviceEnablerwill 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:
falseifDeviceEnablercreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateDeviceEnablerWithRecordTypes
Tests if this user can create a singleDeviceEnablerusing the desired record types. WhileOfferingRulesManager.getDeviceEnablerRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificDeviceEnabler. Providing an empty array tests if aDeviceEnablercan be created with no records.- Parameters:
deviceEnablerRecordTypes- array of device enabler record types- Returns:
trueifDeviceEnablercreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-deviceEnablerRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getDeviceEnablerFormForCreate
DeviceEnablerForm getDeviceEnablerFormForCreate(Type[] deviceEnablerRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the device enabler form for creating new device enablers. A new form should be requested for each create transaction.- Parameters:
deviceEnablerRecordTypes- array of device enabler record types- Returns:
- the device enabler form
- Throws:
NullArgumentException-deviceEnablerRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createDeviceEnabler
DeviceEnabler createDeviceEnabler(DeviceEnablerForm deviceEnablerForm) throws OperationFailedException, PermissionDeniedException Creates a newDeviceEnabler.- Parameters:
deviceEnablerForm- the form for thisDeviceEnabler- Returns:
- the new
DeviceEnabler - Throws:
IllegalStateException-deviceEnablerFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-deviceEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-deviceEnablerForm did not originate from getDeviceEnablerFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateDeviceEnablers
boolean canUpdateDeviceEnablers()Tests if this user can update device enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aDeviceEnablerwill 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:
falseifDeviceEnablermodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getDeviceEnablerFormForUpdate
DeviceEnablerForm getDeviceEnablerFormForUpdate(Id deviceEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the device enabler form for updating an existing device enabler. A new device enabler form should be requested for each update transaction.- Parameters:
deviceEnablerId- theIdof theDeviceEnabler- Returns:
- the device enabler form
- Throws:
NotFoundException-deviceEnablerIdis not foundNullArgumentException-deviceEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateDeviceEnabler
void updateDeviceEnabler(DeviceEnablerForm deviceEnablerForm) throws OperationFailedException, PermissionDeniedException Updates an existing device enabler.- Parameters:
deviceEnablerForm- the form containing the elements to be updated- Throws:
IllegalStateException-deviceEnablerFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-deviceEnablerFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-deviceEnablerFormdid not originate fromgetDeviceEnablerFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteDeviceEnablers
boolean canDeleteDeviceEnablers()Tests if this user can delete device enablers. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aDeviceEnablerwill 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:
falseifDeviceEnablerdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteDeviceEnabler
void deleteDeviceEnabler(Id deviceEnablerId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aDeviceEnabler.- Parameters:
deviceEnablerId- theIdof theDeviceEnablerto remove- Throws:
NotFoundException-deviceEnablerIdnot foundNullArgumentException-deviceEnablerIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageDeviceEnablerAliases
boolean canManageDeviceEnablerAliases()Tests if this user can manageIdaliases for device enablers. 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:
falseifDeviceEnableraliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasDeviceEnabler
void aliasDeviceEnabler(Id deviceEnablerId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aDeviceEnablerfor the purpose of creating compatibility. The primaryIdof theDeviceEnableris determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another device enabler. it is reassigned to the given device enablerId.- Parameters:
deviceEnablerId- theIdof aDeviceEnableraliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-deviceEnablerIdnot foundNullArgumentException-deviceEnablerIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-