Class StorageService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.core.service.udev.storage.StorageService
- All Implemented Interfaces:
CtxEventListener,ContextHandleAware,HandleAware,Ready,ReadyAndReadyListener,ReadyListener
Service that manages storage devices that are detected via udev
events, such as usb drives. Devices are tracked and can be dynamically
mounted and unmounted from the local filesystem. All mounts occur at
/mnt/storage and are placed in directories based on a UUID
assigned to the device. The actual mount path is available in the
StorageDevice when mounted.
Devices should only be mounted while in use to minimize the possibility
of disk corruption as a result of removing the device while in use.
The default mount options use synchronous writes (see MountOption.USB
so that the device can be unmounted after writing without significant
delay. It is possible to define custom mount options, including filesystem
specific options.
- Since:
- 1.0
- Version:
- 2024-04-30
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetDeviceById(String deviceId) Return the storage device with the specified id.Return the list of available storage devices.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefixMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.commons.core.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompletedMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPathMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyAndReadyListener
onBeanReady, onDependenciesReadyMethods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Field Details
-
TOPIC_STORAGE_AVAILABILITY
- See Also:
-
-
Method Details
-
getDevices
Return the list of available storage devices. -
getDeviceById
Return the storage device with the specified id.- Parameters:
deviceId- the id of the device
-