Class TapeLibraryPoolImpl
- java.lang.Object
-
- fr.gouv.vitam.storage.offers.tape.pool.TapeLibraryPoolImpl
-
- All Implemented Interfaces:
TapeDrivePool,TapeLibraryPool,TapeRobotPool
public class TapeLibraryPoolImpl extends java.lang.Object implements TapeLibraryPool
-
-
Constructor Summary
Constructors Constructor Description TapeLibraryPoolImpl(java.lang.String libraryIdentifier, java.util.concurrent.BlockingQueue<TapeRobotService> tapeRobotServicePool, java.util.concurrent.ConcurrentHashMap<java.lang.Integer,TapeDriveService> tapeDriveServicePool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TapeDriveServicecheckoutDriveService(java.lang.Integer driveIndex)Retrieves and removes the head of this pool, waiting if necessary until an element becomes available.TapeRobotServicecheckoutRobotService()Retrieves and removes the head of this pool, waiting if necessary until an element becomes available.TapeRobotServicecheckoutRobotService(long timeout, java.util.concurrent.TimeUnit unit)Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.java.util.Set<java.util.Map.Entry<java.lang.Integer,TapeDriveService>>drives()java.lang.StringgetLibraryIdentifier()voidpushDriveService(TapeDriveService tapeDriveService)Return or add TapeDriveService to the poolvoidpushRobotService(TapeRobotService tapeRobotService)Return or add TapeRobotService to the pool
-
-
-
Constructor Detail
-
TapeLibraryPoolImpl
public TapeLibraryPoolImpl(java.lang.String libraryIdentifier, java.util.concurrent.BlockingQueue<TapeRobotService> tapeRobotServicePool, java.util.concurrent.ConcurrentHashMap<java.lang.Integer,TapeDriveService> tapeDriveServicePool)
-
-
Method Detail
-
checkoutRobotService
public TapeRobotService checkoutRobotService() throws java.lang.InterruptedException
Description copied from interface:TapeRobotPoolRetrieves and removes the head of this pool, waiting if necessary until an element becomes available.- Specified by:
checkoutRobotServicein interfaceTapeRobotPool- Returns:
- TapeRobotService
- Throws:
java.lang.InterruptedException
-
checkoutRobotService
public TapeRobotService checkoutRobotService(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
Description copied from interface:TapeRobotPoolRetrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
checkoutRobotServicein interfaceTapeRobotPool- Returns:
- TapeRobotService
- Throws:
java.lang.InterruptedException
-
checkoutDriveService
public TapeDriveService checkoutDriveService(java.lang.Integer driveIndex)
Description copied from interface:TapeDrivePoolRetrieves and removes the head of this pool, waiting if necessary until an element becomes available.- Specified by:
checkoutDriveServicein interfaceTapeDrivePool- Returns:
- TapeDriveService
-
pushRobotService
public void pushRobotService(TapeRobotService tapeRobotService) throws java.lang.InterruptedException
Description copied from interface:TapeRobotPoolReturn or add TapeRobotService to the pool- Specified by:
pushRobotServicein interfaceTapeRobotPool- Throws:
java.lang.InterruptedException
-
pushDriveService
public void pushDriveService(TapeDriveService tapeDriveService)
Description copied from interface:TapeDrivePoolReturn or add TapeDriveService to the pool- Specified by:
pushDriveServicein interfaceTapeDrivePool
-
drives
public java.util.Set<java.util.Map.Entry<java.lang.Integer,TapeDriveService>> drives()
- Specified by:
drivesin interfaceTapeDrivePool
-
getLibraryIdentifier
public java.lang.String getLibraryIdentifier()
- Specified by:
getLibraryIdentifierin interfaceTapeRobotPool
-
-