Class GetFileIDsEventHandler
- java.lang.Object
-
- dk.netarkivet.common.distribute.bitrepository.action.getfileids.GetFileIDsEventHandler
-
- All Implemented Interfaces:
org.bitrepository.client.eventhandler.EventHandler
public class GetFileIDsEventHandler extends Object implements org.bitrepository.client.eventhandler.EventHandler
-
-
Constructor Summary
Constructors Constructor Description GetFileIDsEventHandler(String pillarID)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.bitrepository.bitrepositoryelements.FileIDsData
getFileIDsData()
Method to obtain the received fileids data.void
handleEvent(org.bitrepository.client.eventhandler.OperationEvent event)
boolean
hasFailed()
Method to determine if the operation was successful.boolean
partialResults()
Method to determine if the received results is a partial result set.void
waitForFinish()
Method to wait for the operation to complete.
-
-
-
Constructor Detail
-
GetFileIDsEventHandler
public GetFileIDsEventHandler(String pillarID)
Constructor- Parameters:
pillarID
- The pillar which is expected to deliver the results.
-
-
Method Detail
-
handleEvent
public void handleEvent(org.bitrepository.client.eventhandler.OperationEvent event)
- Specified by:
handleEvent
in interfaceorg.bitrepository.client.eventhandler.EventHandler
-
getFileIDsData
public org.bitrepository.bitrepositoryelements.FileIDsData getFileIDsData()
Method to obtain the received fileids data. The method should not be called prior to a call towaitForFinish()
have returned.- Returns:
- The fileids data if it have been returned by the pillar, otherwise null.
-
waitForFinish
public void waitForFinish() throws InterruptedException
Method to wait for the operation to complete. The method is blocking.- Throws:
InterruptedException
- if the thread is interrupted
-
partialResults
public boolean partialResults()
Method to determine if the received results is a partial result set. I.e. should the client send a new request to get more results. The method should not be called prior to a call towaitForFinish()
have returned.- Returns:
- true if the results are partial
-
hasFailed
public boolean hasFailed()
Method to determine if the operation was successful. The method should not be called prior to a call towaitForFinish()
have returned.- Returns:
- true if the operation succeeded, otherwise false.
-
-