PageRenderTime 26ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/TransportFactory.java

http://github.com/infinispan/infinispan
Java | 91 lines | 49 code | 33 blank | 9 comment | 0 complexity | 90299735d35750b1d1c0037e5051a779 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1
  1. package org.infinispan.client.hotrod.impl.transport;
  2. import java.net.SocketAddress;
  3. import java.util.Collection;
  4. import java.util.Map;
  5. import java.util.Set;
  6. import java.util.concurrent.atomic.AtomicInteger;
  7. import javax.net.ssl.SSLContext;
  8. import org.infinispan.client.hotrod.CacheTopologyInfo;
  9. import org.infinispan.client.hotrod.configuration.Configuration;
  10. import org.infinispan.client.hotrod.event.ClientListenerNotifier;
  11. import org.infinispan.client.hotrod.impl.consistenthash.ConsistentHash;
  12. import org.infinispan.client.hotrod.impl.consistenthash.ConsistentHashFactory;
  13. import org.infinispan.client.hotrod.impl.protocol.Codec;
  14. import org.infinispan.client.hotrod.impl.transport.tcp.TcpTransportFactory.ClusterSwitchStatus;
  15. import org.infinispan.commons.marshall.Marshaller;
  16. /**
  17. * Transport factory for building and managing {@link org.infinispan.client.hotrod.impl.transport.Transport} objects.
  18. *
  19. * @author Mircea.Markus@jboss.com
  20. * @since 4.1
  21. */
  22. public interface TransportFactory {
  23. Transport getTransport(Set<SocketAddress> failedServers, byte[] cacheName);
  24. Transport getAddressTransport(SocketAddress server);
  25. SocketAddress getSocketAddress(Object key, byte[] cacheName);
  26. void releaseTransport(Transport transport);
  27. void start(Codec codec, Configuration configuration, AtomicInteger topologyId, ClientListenerNotifier listenerNotifier);
  28. void updateServers(Collection<SocketAddress> newServers, byte[] cacheName, boolean quiet);
  29. void destroy();
  30. CacheTopologyInfo getCacheTopologyInfo(byte[] cacheName);
  31. /**
  32. * @deprecated Only called for Hot Rod 1.x protocol.
  33. */
  34. @Deprecated
  35. void updateHashFunction(Map<SocketAddress, Set<Integer>> servers2Hash, int numKeyOwners, short hashFunctionVersion, int hashSpace,
  36. byte[] cacheName, AtomicInteger topologyId);
  37. void updateHashFunction(SocketAddress[][] segmentOwners, int numSegments, short hashFunctionVersion,
  38. byte[] cacheName, AtomicInteger topologyId);
  39. ConsistentHash getConsistentHash(byte[] cacheName);
  40. ConsistentHashFactory getConsistentHashFactory();
  41. Transport getTransport(Object key, Set<SocketAddress> failedServers, byte[] cacheName);
  42. boolean isTcpNoDelay();
  43. boolean isTcpKeepAlive();
  44. int getMaxRetries();
  45. int getSoTimeout();
  46. int getConnectTimeout();
  47. void invalidateTransport(SocketAddress serverAddress, Transport transport);
  48. SSLContext getSSLContext();
  49. void reset(byte[] cacheName);
  50. AtomicInteger createTopologyId(byte[] cacheName);
  51. int getTopologyId(byte[] cacheName);
  52. ClusterSwitchStatus trySwitchCluster(String failedClusterName, byte[] cacheName);
  53. Marshaller getMarshaller();
  54. boolean switchToCluster(String clusterName);
  55. String getCurrentClusterName();
  56. int getTopologyAge();
  57. String getSniHostName();
  58. }