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 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

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

Public Types

typedef unsigned long TToiStorageDeviceId
typedef unsigned long TToiPartitionId
typedef sequence< TToiPartitionIdTToiPartitionIdSequence
typedef long TToiFileSystemStatus
typedef long TToiPartitionFeature
typedef TToiFileSystemStatus TFileSystemStatus

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.

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.
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::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.

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.