Class RotatingServerAdvice
java.lang.Object
org.springframework.integration.file.remote.aop.RotatingServerAdvice
- All Implemented Interfaces:
- Advice,- Interceptor,- MethodInterceptor,- MessageSourceMutator,- ReceiveMessageAdvice
A smart poller advice that rotates across multiple remote servers/directories.
- Since:
- 5.0.7
- Author:
- Gary Russell, Michael Forstner, Artem Bilan, David Turanski
- 
Constructor SummaryConstructorsConstructorDescriptionRotatingServerAdvice(RotationPolicy rotationPolicy) Construct an instance that rotates according to the suppliedRotationPolicy.RotatingServerAdvice(DelegatingSessionFactory<?> factory, List<RotationPolicy.KeyDirectory> keyDirectories) Create an instance that rotates to the next server/directory if no message is received.RotatingServerAdvice(DelegatingSessionFactory<?> factory, List<RotationPolicy.KeyDirectory> keyDirectories, boolean fair) Create an instance that rotates to the next server/directory depending on the fair argument.
- 
Method SummaryModifier and TypeMethodDescriptionMessage<?> afterReceive(Message<?> result, MessageSource<?> source) Subclasses can take actions based on the result of the poll; e.g.booleanbeforeReceive(MessageSource<?> source) Subclasses can decide whether to proceed with this poll.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.aop.MessageSourceMutatorafterReceive, beforeReceiveMethods inherited from interface org.springframework.integration.aop.ReceiveMessageAdviceinvoke
- 
Constructor Details- 
RotatingServerAdvicepublic RotatingServerAdvice(DelegatingSessionFactory<?> factory, List<RotationPolicy.KeyDirectory> keyDirectories) Create an instance that rotates to the next server/directory if no message is received.- Parameters:
- factory- the- DelegatingSessionFactory.
- keyDirectories- a list of- RotationPolicy.KeyDirectory.
 
- 
RotatingServerAdvicepublic RotatingServerAdvice(DelegatingSessionFactory<?> factory, List<RotationPolicy.KeyDirectory> keyDirectories, boolean fair) Create an instance that rotates to the next server/directory depending on the fair argument.- Parameters:
- factory- the- DelegatingSessionFactory.
- keyDirectories- a list of- RotationPolicy.KeyDirectory.
- fair- true to rotate on every poll, false to rotate when no message is received.
 
- 
RotatingServerAdviceConstruct an instance that rotates according to the suppliedRotationPolicy.- Parameters:
- rotationPolicy- the policy.
 
 
- 
- 
Method Details- 
beforeReceiveDescription copied from interface:MessageSourceMutatorSubclasses can decide whether to proceed with this poll.- Specified by:
- beforeReceivein interface- MessageSourceMutator
- Parameters:
- source- the message source.
- Returns:
- true to proceed (default).
 
- 
afterReceiveDescription copied from interface:MessageSourceMutatorSubclasses can take actions based on the result of the poll; e.g. adjust thetrigger. The message can also be replaced with a new one.- Specified by:
- afterReceivein interface- MessageSourceMutator
- Parameters:
- result- the received message.
- source- the message source.
- Returns:
- a message to continue to process the result, null to discard whatever the poll returned.
 
 
-