Class InaLibraryService
java.lang.Object
fr.gouv.vitam.storage.cold.server.simulator.service.InaLibraryService
Library Service for INA.
Handles robotic commands (move, rewind, load, eject, etc.), virtual tape lifecycle
(capacity, load/unload, slot allocation) and status queries.
Source of truth:
- Slots: TapeCatalogModel collection (tapes with slotIndex != null occupy that slot)
- Drives: TapeDriveModel collection (persisted drive state)
- TapeLibrarySpec is built dynamically on each getLibraryStatus() call; it is never stored in the database.
-
Constructor Summary
ConstructorsConstructorDescriptionInaLibraryService(InaTapeProxyConfiguration configuration, TapeCatalogRepository tapeCatalogRepository, TapeDriveRepository tapeDriveRepository, InaTapeHelper inaTapeHelper) -
Method Summary
Modifier and TypeMethodDescriptionvoideject(int driveIndex) Eject tape (simulated)getDriveStatus(int driveIndex) Retrieves the drive status from the persisted TapeDriveModel.Builds the library status dynamically.voidgoToEnd(int driveIndex) Go to end of data (simulated)voidloadTape(int slotNumber, int driveIndex) Load tape from slot into drive.voidmove(int driveIndex, int position, boolean backward) Move tape position (simulated)voidrewind(int driveIndex) Rewind tape (simulated)voidunloadTape(int slotNumber, int driveIndex) Unload tape from drive back to a slot.
-
Constructor Details
-
InaLibraryService
public InaLibraryService(InaTapeProxyConfiguration configuration, TapeCatalogRepository tapeCatalogRepository, TapeDriveRepository tapeDriveRepository, InaTapeHelper inaTapeHelper)
-
-
Method Details
-
move
Move tape position (simulated)- Throws:
InaTapeProxyException
-
rewind
Rewind tape (simulated)- Throws:
InaTapeProxyException
-
goToEnd
Go to end of data (simulated)- Throws:
InaTapeProxyException
-
eject
Eject tape (simulated)- Throws:
InaTapeProxyException
-
loadTape
Load tape from slot into drive. Looks up the tape currently in the given slot, validates its status, then moves it into the drive (clears slotIndex on the tape, sets tape on drive). Thread-safety is ensured by: - synchronized method to prevent concurrent access - optimistic locking in repositories (version field)- Throws:
InaTapeProxyException
-
unloadTape
Unload tape from drive back to a slot. Assigns the next available slot to the tape, clears the drive. Thread-safety is ensured by: - synchronized method to prevent concurrent access - optimistic locking in repositories (version field)- Throws:
InaTapeProxyException
-
getDriveStatus
Retrieves the drive status from the persisted TapeDriveModel.- Throws:
InaTapeProxyException
-
getLibraryStatus
Builds the library status dynamically.- Throws:
InaTapeProxyException
-