All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.storage.DetachableStorageOption.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






DetachableStorageOption














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 java.io.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 throw IOExceptions.
  2. 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, attempts to use the storage proxy result in an IOException.
This call may block until the filesystem can be put into a consistent state.

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

makeReady

void makeReady()
               throws java.io.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:
java.lang.SecurityException - if the calling application does not have MonitorAppPermission("storage").
java.io.IOException - if the device was not in the READY or OFFLINE state when the method was called.






© 2015 - 2024 Weber Informatics LLC | Privacy Policy