ToiStorageDevice Interface Reference

Description

The ToiStorageDevice interface provides access to a storage device.

import "ToiStorageDevice.idl";

List of all members.

Public Member Functions

ToiStorageDeviceStorageInfo getStorageInfo ()
ToiStorageDevicePartitionInfo getPartitionInfo (in TToiPartitionId partitionId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void mountPartition (in ToiOperationManager::TToiOperationId operationId, in TToiPartitionId partitionId, in string mountPoint) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void unmountPartition (in ToiOperationManager::TToiOperationId operationId, in TToiPartitionId partitionId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)
void runPerformanceCheck (in ToiOperationManager::TToiOperationId operationId, in TToiPartitionId partitionId, in TToiPropertySequence properties) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException, TToiOperationNotSupportedException)
TToiPropertySequence getPropertyResult (in ToiOperationManager::TToiOperationId operationId) raises (TToiInvalidArgumentException, TToiNoDataException)
void setEnabledFeatures (in TToiPartitionId partitionId, in long features) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException, TToiOperationNotSupportedException)
void reformat (in ToiOperationManager::TToiOperationId operationId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException, TToiOperationNotSupportedException)
void scheduleReformatOnNextReboot (in TToiPartitionId partitionId) raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)
void scheduleFileSystemRepairOnNextReboot (in TToiPartitionId partitionId) raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)
void spinDown () raises (TToiInvalidPreconditionException)
void spinUp () raises (TToiInvalidPreconditionException)

Public Attributes

const TToiPropertyId PROPERTY_BITRATE = 1
TToiFileSystemStatus
const TToiFileSystemStatus FS_STATUS_OK = 0
const TToiFileSystemStatus FS_STATUS_ERRORS_CORRECTED = 1
const TToiFileSystemStatus FS_STATUS_ERRORS_LEFT_UNCORRECTED = 2
const TToiFileSystemStatus FS_STATUS_MAJOR_FAILURE = 3
TToiPartitionFeature
const TToiPartitionFeature PARTITION_FEATURE_DVR = 0x1
const TToiPartitionFeature PARTITION_FEATURE_TIMESHIFT = 0x2
const TToiPartitionFeature PARTITION_FEATURE_ACCESS_USER_CONTENT = 0x4
Operation results

The result types defined for storage device operation. See ToiOperationManager for generic result types.

const
ToiOperationManager::TToiOperationResult 
OP_RESULT_PROPERTY = 1

Public Types

typedef unsigned long TToiStorageDeviceId
typedef unsigned long TToiPartitionId
typedef sequence< TToiPartitionIdTToiPartitionIdSequence
typedef long TToiFileSystemStatus
typedef long TToiPartitionFeature
typedef TToiFileSystemStatus TFileSystemStatus
typedef long TToiPropertyId
typedef string TToiPropertyValue
typedef sequence
< ToiStorageDeviceProperty
TToiPropertySequence

Member Typedef Documentation

Typedef for backward compatibility when corrected naming typo of previous enum TFileSystemStatus.

The different kind of file system status values.

Technical Preview:
This enum is a TECHNICAL PREVIEW, it may change. Information about a specific partition features (ToiStorageDevice::TToiPartitionFeature).
typedef unsigned long ToiStorageDevice::TToiPartitionId

Type for partition identifier.

The sequence of partition identifiers.

Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Identifier for a property. This with ToiStorageDevice::TToiPropertyValue forms a key-value pair.
Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Sequence of property tags.
Technical Preview:
This typedef is a TECHNICAL PREVIEW, it may change. Value for a property. This with ToiStorageDevice::TToiPropertyId forms a key-value pair.

Type for storage identifier.


Member Function Documentation

ToiStorageDevicePartitionInfo ToiStorageDevice::getPartitionInfo ( in TToiPartitionId  partitionId) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Returns partition info for a partition.

Parameters:
partitionIdPartition identifier.
Return values:
infoThe partition info.
Exceptions:
TToiInvalidArgumentExceptionRaised if the partitionId is wrong.
TToiInvalidPreconditionExceptionRaised if the storage is disconnected.
TToiPropertySequence ToiStorageDevice::getPropertyResult ( in ToiOperationManager::TToiOperationId  operationId) raises (TToiInvalidArgumentException, TToiNoDataException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. Used to get the performance check results once the applications receive ToiOperationOperationResultEvent and the result parameter is equal to ToiStorageDevice::OP_RESULT_PROPERTY.
Parameters:
operationIdThe operation identifier used when calling ToiStorageDevice::runPerformanceCheck().
Return values:
resultsThe result properties.
Exceptions:
TToiInvalidArgumentExceptionRaised if the operation identifier is invalid
TToiNoDataExceptionRaised if no result is available.
ToiStorageDeviceStorageInfo ToiStorageDevice::getStorageInfo ( )

Returns storage info for this device.

Return values:
infoThe storage info.
void ToiStorageDevice::mountPartition ( in ToiOperationManager::TToiOperationId  operationId,
in TToiPartitionId  partitionId,
in string  mountPoint 
) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Mounts a partition at a specified path.

Parameters:
operationIdOperation identifier for this operation.
partitionIdPartition identifier.
mountPointMount point path.
Exceptions:
TToiInvalidArgumentExceptionRaised if the operationId or partitionId is wrong.
TToiInvalidPreconditionExceptionRaised if the partition is already mounted or the storage is disconnected.

Reformat a device. This operation is only supported for external storage devices.

Parameters:
operationIdOperation identifier for this operation.
Exceptions:
TToiInvalidArgumentExceptionRaised if the operationId is wrong.
TToiInvalidPreconditionExceptionRaised if the storage is disconnected.
TToiOperationNotSupportedExceptionRaised if the operation is not supported on this device.
void ToiStorageDevice::runPerformanceCheck ( in ToiOperationManager::TToiOperationId  operationId,
in TToiPartitionId  partitionId,
in TToiPropertySequence  properties 
) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException, TToiOperationNotSupportedException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. Execute the performance test for the mounted device partition. This is an asynchronous operation. When the application receives a ToiOperationOperationResultEvent call with the operation result ToiStorageDevice::OP_RESULT_PROPERTY, then the application may get the results by calling the ToiStorageDevice::getPropertyResult() function. The resulting ToiStorageDevice::TToiPropertySequence will contain property values for the selected partition.
Parameters:
operationIdOperation identifier for this operation.
partitionIdPartition identifier.
propertiesProperty sequence, like which capability to check or requested bitrate.
Exceptions:
TToiInvalidArgumentExceptionRaised if the partitionId is wrong or operationId is invalid. Raised if an unsupported property is provided.
TToiInvalidPreconditionExceptionRaised if the storage is disconnected or partition not mounted.
TToiOperationNotSupportedExceptionRaised if performance test functionality not supported.
void ToiStorageDevice::scheduleFileSystemRepairOnNextReboot ( in TToiPartitionId  partitionId) raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)

Schedule a forced file system check of a partition and repair it at next reboot. This operation is only supported for internal storage devices.

Parameters:
partitionIdThe partition to be checked and repaired.
Exceptions:
TToiInvalidArgumentExceptionRaised if the partition does not exist.
TToiOperationNotSupportedExceptionRaised if the operation is not supported on this device.
void ToiStorageDevice::scheduleReformatOnNextReboot ( in TToiPartitionId  partitionId) raises (TToiOperationNotSupportedException, TToiInvalidArgumentException)

Schedule a reformat of a partition at next reboot. This operation is only supported for internal storage devices.

Parameters:
partitionIdThe partition to format.
Exceptions:
TToiInvalidArgumentExceptionRaised if the partition does not exist.
TToiOperationNotSupportedExceptionRaised if the operation is not supported on this device.
void ToiStorageDevice::setEnabledFeatures ( in TToiPartitionId  partitionId,
in long  features 
) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException, TToiOperationNotSupportedException)
Technical Preview:
This method is a TECHNICAL PREVIEW, it may change. Enable storage features for partition. Reformatting a partition will clear the enabled features for that partition.
Parameters:
partitionIdPartition identifier.
featuresThe list of features (ToiStorageDevice::TToiPartitionFeature)
Exceptions:
TToiInvalidArgumentExceptionRaised if the partitionId is wrong. Raised if any of the features are wrong.
TToiInvalidPreconditionExceptionRaised if the storage is disconnected.
TToiOperationNotSupportedExceptionRaised if the partition does not support one of the feature.
void ToiStorageDevice::spinDown ( ) raises (TToiInvalidPreconditionException)

Requests a spin down of a disk device. The platform may decide not to do this if the disk is used by platform.

Exceptions:
TToiInvalidPreconditionExceptionRaised if the storage is disconnected, already in spindown mode or if the device is not approved.
void ToiStorageDevice::spinUp ( ) raises (TToiInvalidPreconditionException)

Spins up a disk device.

Exceptions:
TToiInvalidPreconditionExceptionRaised if the storage is disconnected, already in spinup mode or if the device is not approved.
void ToiStorageDevice::unmountPartition ( in ToiOperationManager::TToiOperationId  operationId,
in TToiPartitionId  partitionId 
) raises (TToiInvalidArgumentException, TToiInvalidPreconditionException)

Unmounts a partition.

Parameters:
operationIdOperation identifier for this operation.
partitionIdPartition identifier.
Exceptions:
TToiInvalidArgumentExceptionRaised if the operationId or partitionId is wrong.
TToiInvalidPreconditionExceptionRaised if the partition has not been mounted or the storage is disconnected.

Member Data Documentation

The file system had errors but they have been corrected (jfs_fsck return code 1 or 2).

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_ERRORS_CORRECTED.

The file system had errors that could not be corrected (jfs_fsck return code 4). A reformat is required to get the file system working.

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_ERRORS_LEFT_UNCORRECTED.

The file system is completely broken (all other return codes from jfs_fsck). Could also be that the partition has another file system than jfs. If the internal storage device has this status is should be reformated to get it working.

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_MAJOR_FAILURE.

No errors discovered on the file system (jfs_fsck return code 0).

This constant can also be accessed from toi.consts.ToiStorageDevice.FS_STATUS_OK.

Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. The asynchronous operation has partition performance properties ToiStorageDevice::TToiPropertySequence as a result. See ToiStorageDevice::getPropertyResult().

This constant can also be accessed from toi.consts.ToiStorageDevice.OP_RESULT_PROPERTY.

Enable access to user data on external storage.

This constant can also be accessed from toi.consts.ToiStorageDevice.PARTITION_FEATURE_ACCESS_USER_CONTENT.

DVR support for external storage.

This constant can also be accessed from toi.consts.ToiStorageDevice.PARTITION_FEATURE_DVR.

Timeshift support for external storage.

This constant can also be accessed from toi.consts.ToiStorageDevice.PARTITION_FEATURE_TIMESHIFT.

Technical Preview:
This constant is a TECHNICAL PREVIEW, it may change. Integer value. Bitrate in KiB

This constant can also be accessed from toi.consts.ToiStorageDevice.PROPERTY_BITRATE.