DetachableStorageOption

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

All Superinterfaces:
  StorageOption

    public interface DetachableStorageOption

extends StorageOption

This interface represents an external device that can be detached. The methods on this interface allow a detachable device to be detached safely. In addition, when a detachable storage device is attached for the first time, its StorageProxy provides a means to initialize the device. If initialization is needed, the StorageProxy will be in one of two states: `UNSUPPORTED_FORMAT` or `UNINITIALIZED`. When the StorageProxy is in one of these two states, the initialize method must be called before the device can be used.

Method Summary
`boolean` | `isDetachable()` Determines whether the device associated with this storage proxy is ready to be detached.
`void` | `makeDetachable()` Makes the device safe to be detached.
`void` | `makeReady()` Makes the device ready for use.

Method Detail

### isDetachable

    boolean isDetachable()

  Determines whether the device associated with this storage proxy is ready to be detached.

  Returns:
    Returns true when the device is currently ready to be detached, otherwise returns false.

### makeDetachable

    void makeDetachable()
                        throws IOException

  Makes the device safe to be detached. Calling this method has extensive impact on applications that may currently be using the associated storage device.
  1. Any in progress java.io operations that are not completed SHALL fail as appropriate (e.g., throw IOExceptions).
  2. Any java.io operations that are attempted after this method is invoked SHALL fail as appropriate (e.g., throw IOExceptions).
  3. The corresponding storage proxy is either removed from the database or remains with a status of `OFFLINE`. The latter indicates that the device may be brought back online. If it is removed from the database, subsequent attempts to use the storage proxy SHALL fail as appropriate for the given API methods.
  This call may block until the filesystem can be put into a consistent state.

  Throws:
    `SecurityException` - if the calling application does not have MonitorAppPermission("storage").
    `IOException` - if the system is unable to make the device safe to detach.

### makeReady

    void makeReady()
                   throws IOException

  Makes the device ready for use. If a detachable device is connected and in the `OFFLINE` state, this method attempts to activate the device and make it available. For example, a device may be left in an OFFLINE state after it has been made ready to detach, but not actually unplugged. This method has no effect if the device is already in the `READY` state.

  Throws:
    `SecurityException` - if the calling application does not have MonitorAppPermission("storage").
    `IOException` - if the device was not in the READY or OFFLINE state when the method was called.

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

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