Package org.hobbit.core.rabbit
Class SimpleFileReceiver
- java.lang.Object
-
- org.hobbit.core.rabbit.SimpleFileReceiver
-
public class SimpleFileReceiver extends Object
- Author:
- Michael Röder (roeder@informatik.uni-leipzig.de)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSimpleFileReceiver.MessageProcessing
-
Field Summary
Fields Modifier and Type Field Description protected com.rabbitmq.client.QueueingConsumerconsumerprotected static longDEFAULT_TIMEOUTprotected interrorCountprotected ExecutorServiceexecutorprotected Map<String,FileReceiveState>fileStatesprivate static org.slf4j.LoggerLOGGERprotected RabbitQueuequeueprotected booleanterminatedprotected longwaitingForMsgTimeout
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleFileReceiver(RabbitQueue queue, com.rabbitmq.client.QueueingConsumer consumer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclose()static SimpleFileReceivercreate(RabbitQueue queue)static SimpleFileReceivercreate(RabbitQueueFactory factory, String queueName)voidforceTermination()intgetErrorCount()protected voidincreaseErrorCount()String[]receiveData(String outputDirectory)voidsetWaitingForMsgTimeout(long waitingForMsgTimeout)voidterminate()
-
-
-
Field Detail
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
DEFAULT_TIMEOUT
protected static final long DEFAULT_TIMEOUT
- See Also:
- Constant Field Values
-
queue
protected RabbitQueue queue
-
consumer
protected com.rabbitmq.client.QueueingConsumer consumer
-
fileStates
protected Map<String,FileReceiveState> fileStates
-
terminated
protected boolean terminated
-
errorCount
protected int errorCount
-
executor
protected ExecutorService executor
-
waitingForMsgTimeout
protected long waitingForMsgTimeout
-
-
Constructor Detail
-
SimpleFileReceiver
protected SimpleFileReceiver(RabbitQueue queue, com.rabbitmq.client.QueueingConsumer consumer)
-
-
Method Detail
-
create
public static SimpleFileReceiver create(RabbitQueueFactory factory, String queueName) throws IOException
- Throws:
IOException
-
create
public static SimpleFileReceiver create(RabbitQueue queue) throws IOException
- Throws:
IOException
-
receiveData
public String[] receiveData(String outputDirectory) throws IOException, com.rabbitmq.client.ShutdownSignalException, com.rabbitmq.client.ConsumerCancelledException, InterruptedException
- Throws:
IOExceptioncom.rabbitmq.client.ShutdownSignalExceptioncom.rabbitmq.client.ConsumerCancelledExceptionInterruptedException
-
terminate
public void terminate()
-
forceTermination
public void forceTermination()
-
increaseErrorCount
protected void increaseErrorCount()
-
getErrorCount
public int getErrorCount()
-
setWaitingForMsgTimeout
public void setWaitingForMsgTimeout(long waitingForMsgTimeout)
-
close
protected void close()
-
-