ToiStorageService Interface Reference


Description

Service:
This is a service and can be accessed through toi.storageService

The ToiStorageService interface provides access to any internal and external storage devices.

For an internal HDD the temperature can be monitored, while USB connected devices do not support this feature.

import "ToiStorageService.idl";

List of all members.

Public Member Functions

ToiOperationManager getStorageOperationManager ()
TToiStorageDeviceIdSequence getStorageDeviceIds ()
ToiStorageDevice getStorageDevice (in ToiStorageDevice::TToiStorageDeviceId id) raises (TToiInvalidArgumentException)
ToiStorageFile createFile (in string fileName, in ToiStorageFile::TToiStorageFileType fileType) raises (TToiInvalidArgumentException, TToiFileException)
void addEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)
void removeEventListener (in long type, in ToiEventListener listener) raises (TToiInvalidArgumentException)

Public Attributes

Events

const long ON_DEVICE_CONNECTED = 2600
const long ON_DEVICE_DISCONNECTED = 2601
const long ON_DEVICE_SPINNING_CHANGED = 2602
const long ON_DEVICE_PARTITIONS_CHANGED = 2603
const long ON_DEVICE_PARTITION_MOUNT_CHANGED = 2604
const long ON_DEVICE_PARTITION_FULL = 2605
const long ON_DEVICE_TEMPERATURE_THRESHOLD_REACHED = 2606

Public Types

typedef sequence
< ToiStorageDevice::TToiStorageDeviceId
TToiStorageDeviceIdSequence

Member Typedef Documentation

Sequence of storage identifiers.


Member Function Documentation

void ToiEventTarget::addEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method registers an event listener for a specific event. Multiple listeners can be added for the same event. Events are broadcast to all registered listeners.

Parameters:
type The event type of the event to subscribe to.
listener The JavaScript function that will receive events.
Exceptions:
TInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the application calls addEventListener with the same combination of type and listener twice.
ToiStorageFile ToiStorageService::createFile ( in string  fileName,
in ToiStorageFile::TToiStorageFileType  fileType 
) raises (TToiInvalidArgumentException, TToiFileException)

Creates a file. A limited number of simultaneous ToiStorageFile objects are allowed. This functionality is primarily interesting for non C++ appliations (such as portal) that do not have access to the file system directly.

Parameters:
fileName The name of the file. Note: If the filetype is ToiStorageFile::FILE_TYPE_TEMPORARY, a unique random string is automatically added to the end of the filename (but before any extension). The purpose of the filename in such case would merely be to describe its file-extension (e.g. '.jpeg').
fileType The type of file to be created.
Return values:
IToiStorageFile 
address The address to the ToiStorageFile instance.
Exceptions:
TToiInvalidArgumentException Raised if the fileType is invalid.
TToiFileException Raised if files cannot be created, i.e. no internal drive, no directory set up for temporary files, or the maximum number of simultaneous file objects is exceeded.
ToiStorageDevice ToiStorageService::getStorageDevice ( in ToiStorageDevice::TToiStorageDeviceId  id  )  raises (TToiInvalidArgumentException)

Returns the address to the storage device handler for a given storage identifier.

Parameters:
id Storage identifier.
Return values:
IToiStorageDevice 
address Address to the ToiStorageDevice.
TToiStorageDeviceIdSequence ToiStorageService::getStorageDeviceIds (  ) 

Returns the identifiers for the currently connected storage devices.

Return values:
identifiers The storage identifiers.
ToiOperationManager ToiStorageService::getStorageOperationManager (  ) 

Returns the operation manager that handles asynchronous operations for this storage device.

Return values:
IToiOperationManager 
address Address to the ToiOperationManager.
void ToiEventTarget::removeEventListener ( in long  type,
in ToiEventListener  listener 
) raises (TToiInvalidArgumentException) [inherited]

This method removes an event listener for a specific event.

Parameters:
type The event type of the event to remove the listener from.
listener The JavaScript function that was previously added as an event listener.
Exceptions:
TInvalidArgumentException Raised if the event type is not supported by this object or if the listener is not a valid JavaScript function. This exception is also raised if the listener had not previously been added.

Member Data Documentation

This is an Event identifier for ToiStorageDeviceConnectedEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_CONNECTED.

This is an Event identifier for ToiStorageDeviceDisconnectedEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_DISCONNECTED.

This is an Event identifier for ToiStorageDevicePartitionFullEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_PARTITION_FULL.

This is an Event identifier for ToiStorageDevicePartitionMountChangedEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_PARTITION_MOUNT_CHANGED.

This is an Event identifier for ToiStorageDevicePartitionsChangedEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_PARTITIONS_CHANGED.

This is an Event identifier for ToiStorageDeviceSpinningChangedEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_SPINNING_CHANGED.

This is an Event identifier for ToiStorageDeviceTemperatureThresholdReachedEvent.

This constant can also be accessed from toi.consts.ToiStorageService.ON_DEVICE_TEMPERATURE_THRESHOLD_REACHED.