Package org.jclouds.compute.util
Class ConcurrentOpenSocketFinder
- java.lang.Object
-
- org.jclouds.compute.util.ConcurrentOpenSocketFinder
-
- All Implemented Interfaces:
OpenSocketFinder
public class ConcurrentOpenSocketFinder extends Object implements OpenSocketFinder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.net.HostAndPort
findOpenSocketOnNode(NodeMetadata node, int port, long timeout, TimeUnit timeUnits)
protected <T> com.google.common.base.Predicate<T>
retryPredicate(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, TimeUnit timeUnits)
-
-
-
Method Detail
-
findOpenSocketOnNode
public com.google.common.net.HostAndPort findOpenSocketOnNode(NodeMetadata node, int port, long timeout, TimeUnit timeUnits)
- Specified by:
findOpenSocketOnNode
in interfaceOpenSocketFinder
- Parameters:
node
- The node (checking its public and private addresses)port
- The port to try to connect totimeout
- Max time to try to connect to the ip:port- Returns:
- The reachable ip:port
-
retryPredicate
protected <T> com.google.common.base.Predicate<T> retryPredicate(com.google.common.base.Predicate<T> findOrBreak, long timeout, long period, TimeUnit timeUnits)
-
-