PageRenderTime 40ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

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

http://github.com/infinispan/infinispan
Java | 77 lines | 29 code | 28 blank | 20 comment | 0 complexity | 9f8180a4ac84aeb0169aee8776477775 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. /**
  4. * Transport abstraction.
  5. *
  6. * @author Mircea.Markus@jboss.com
  7. * @since 4.1
  8. */
  9. public interface Transport {
  10. TransportFactory getTransportFactory();
  11. void writeArray(byte[] toAppend);
  12. void writeOptionalArray(byte[] toAppend);
  13. void writeByte(short toWrite);
  14. void writeVInt(int vint);
  15. void writeSignedVInt(int toWrite);
  16. void writeVLong(long l);
  17. long readVLong();
  18. int readVInt();
  19. void flush();
  20. short readByte();
  21. void release();
  22. /**
  23. * reads an vint which is size; then an array having that size.
  24. */
  25. byte[] readArray();
  26. String readString();
  27. byte[] readByteArray(int size);
  28. long readLong();
  29. void writeLong(long longValue);
  30. int readUnsignedShort();
  31. int read4ByteInt();
  32. void writeString(String string);
  33. void writeOptionalString(String string);
  34. byte[] dumpStream();
  35. /**
  36. * Returns the address of the endpoint this transport is connected to, or
  37. * <code>null</code> if it is unconnected.
  38. *
  39. * @return a <code>SocketAddress</code> reprensenting the remote endpoint
  40. * of this transport, or <code>null</code> if it is not connected
  41. * yet.
  42. */
  43. SocketAddress getRemoteSocketAddress();
  44. /**
  45. * Invalidates transport instance.
  46. */
  47. void invalidate();
  48. boolean isValid();
  49. }