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 TapeDriveService
checkoutDriveService(java.lang.Integer driveIndex)
Retrieves and removes the head of this pool, waiting if necessary until an element becomes available.TapeRobotService
checkoutRobotService()
Retrieves and removes the head of this pool, waiting if necessary until an element becomes available.TapeRobotService
checkoutRobotService(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.String
getLibraryIdentifier()
void
pushDriveService(TapeDriveService tapeDriveService)
Return or add TapeDriveService to the poolvoid
pushRobotService(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:TapeRobotPool
Retrieves and removes the head of this pool, waiting if necessary until an element becomes available.- Specified by:
checkoutRobotService
in 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:TapeRobotPool
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
checkoutRobotService
in interfaceTapeRobotPool
- Returns:
- TapeRobotService
- Throws:
java.lang.InterruptedException
-
checkoutDriveService
public TapeDriveService checkoutDriveService(java.lang.Integer driveIndex)
Description copied from interface:TapeDrivePool
Retrieves and removes the head of this pool, waiting if necessary until an element becomes available.- Specified by:
checkoutDriveService
in interfaceTapeDrivePool
- Returns:
- TapeDriveService
-
pushRobotService
public void pushRobotService(TapeRobotService tapeRobotService) throws java.lang.InterruptedException
Description copied from interface:TapeRobotPool
Return or add TapeRobotService to the pool- Specified by:
pushRobotService
in interfaceTapeRobotPool
- Throws:
java.lang.InterruptedException
-
pushDriveService
public void pushDriveService(TapeDriveService tapeDriveService)
Description copied from interface:TapeDrivePool
Return or add TapeDriveService to the pool- Specified by:
pushDriveService
in interfaceTapeDrivePool
-
drives
public java.util.Set<java.util.Map.Entry<java.lang.Integer,TapeDriveService>> drives()
- Specified by:
drives
in interfaceTapeDrivePool
-
getLibraryIdentifier
public java.lang.String getLibraryIdentifier()
- Specified by:
getLibraryIdentifier
in interfaceTapeRobotPool
-
-