StorageManager

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ocap.storage
Class StorageManager

    java.lang.Object
      org.ocap.storage.StorageManager

    public abstract class StorageManager

extends Object

This class represents the storage manager which keeps track of the storage devices attached to the system.

Method Summary
`abstract void` | `addAvailableStorageListener(AvailableStorageListener listener, int highWaterMark)` Adds a listener for high water mark reached in available persistent storage indicated by the dvb.persistent.root property.
`abstract void` | `addStorageManagerListener(StorageManagerListener listener)` Adds a listener to receive StorageManagerEvents when a storage proxy is added, removed or changes state.
`abstract long` | `getAvailablePersistentStorage()` Gets the available amount of persistent storage under the location indicated by the dvb.persistent.root property that is available to all OCAP-J applications.
`static StorageManager` | `getInstance()` Gets the singleton instance of the storage manager.
`abstract StorageProxy[]` | `getStorageProxies()` Gets the set of `StorageProxy` instances representing all of the currently attached or embedded storage devices.
`abstract long` | `getTotalPersistentStorage()` Gets the total amount of persistent storage under the location indicated by the dvb.persistent.root property and that is usable by all OCAP-J applications.
`abstract void` | `removeAvailableStorageListener(AvailableStorageListener listener)` Removes an available storage listener that was registered using the `addAvailableStorageListener` method.
`abstract void` | `removeStorageManagerListener(StorageManagerListener listener)` Removes a listener so that it no longer receives StorageManagerEvents when storage proxies change.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getInstance

    public static StorageManager getInstance()

  Gets the singleton instance of the storage manager. The singleton MAY be implemented using application or implementation scope.

  Returns:
    The storage manager.

### getStorageProxies

    public abstract StorageProxy[] getStorageProxies()

  Gets the set of `StorageProxy` instances representing all of the currently attached or embedded storage devices.

  Returns:
    An array of StorageProxy objects. If no application accessible storage proxies are available, returns a 0 length array.

### addStorageManagerListener

    public abstract void addStorageManagerListener(StorageManagerListener listener)
                                            throws IllegalArgumentException

  Adds a listener to receive StorageManagerEvents when a storage proxy is added, removed or changes state.

  Parameters:
    `listener` - The storage manager listener to be added.
  Throws:
    `IllegalArgumentException` - if the listener parameter is null.

### removeStorageManagerListener

    public abstract void removeStorageManagerListener(StorageManagerListener listener)
                                               throws IllegalArgumentException

  Removes a listener so that it no longer receives StorageManagerEvents when storage proxies change. This method has no effect if the given listener had not been added.

  Parameters:
    `listener` - The storage manager listener to be removed.
  Throws:
    `IllegalArgumentException` - if the listener parameter is null.

### getTotalPersistentStorage

    public abstract long getTotalPersistentStorage()

  Gets the total amount of persistent storage under the location indicated by the dvb.persistent.root property and that is usable by all OCAP-J applications. This value SHALL remain constant.

  Returns:
    Amount of total persistent storage in bytes.

### getAvailablePersistentStorage

    public abstract long getAvailablePersistentStorage()

  Gets the available amount of persistent storage under the location indicated by the dvb.persistent.root property that is available to all OCAP-J applications. The value returned by this method can be incorrect as soon as this method returns and SHOULD be interpreted by applications as an approximation.

  Returns:
    Amount of available persistent storage in bytes.

### addAvailableStorageListener

    public abstract void addAvailableStorageListener(AvailableStorageListener listener,
                                                     int highWaterMark)

  Adds a listener for high water mark reached in available persistent storage indicated by the dvb.persistent.root property. This is a system wide indication. Listeners are informed when a percentage of the total persistent storage has been allocated for application use. Listeners are only informed when the high water mark is reached or exceeded.

  Parameters:
    `listener` - The listener to add.
    `highWaterMark` - Percentage of the available persistent storage remaining when the listener is to be informed. For instance, if the total available persistent storage is 1MB and the high water mark is 75 then high water listeners will be informed when 750KB have been allocated for application use.
  Throws:
    `IllegalArgumentException` - if the listener parameter could not be added or is null.

### removeAvailableStorageListener

    public abstract void removeAvailableStorageListener(AvailableStorageListener listener)

  Removes an available storage listener that was registered using the `addAvailableStorageListener` method. If the parameter is not currently registered this method does nothing successfully.

  Parameters:
    `listener` - The listener to remove.
  Throws:
    `IllegalArgumentException` - if the parameter is null.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD