/client/hotrod-client/src/main/java/org/infinispan/client/hotrod/impl/transport/Transport.java
Java | 77 lines | 29 code | 28 blank | 20 comment | 0 complexity | 9f8180a4ac84aeb0169aee8776477775 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1
- package org.infinispan.client.hotrod.impl.transport;
- import java.net.SocketAddress;
- /**
- * Transport abstraction.
- *
- * @author Mircea.Markus@jboss.com
- * @since 4.1
- */
- public interface Transport {
- TransportFactory getTransportFactory();
- void writeArray(byte[] toAppend);
- void writeOptionalArray(byte[] toAppend);
- void writeByte(short toWrite);
- void writeVInt(int vint);
- void writeSignedVInt(int toWrite);
- void writeVLong(long l);
- long readVLong();
- int readVInt();
- void flush();
- short readByte();
- void release();
- /**
- * reads an vint which is size; then an array having that size.
- */
- byte[] readArray();
- String readString();
- byte[] readByteArray(int size);
- long readLong();
- void writeLong(long longValue);
- int readUnsignedShort();
- int read4ByteInt();
- void writeString(String string);
- void writeOptionalString(String string);
- byte[] dumpStream();
- /**
- * Returns the address of the endpoint this transport is connected to, or
- * <code>null</code> if it is unconnected.
- *
- * @return a <code>SocketAddress</code> reprensenting the remote endpoint
- * of this transport, or <code>null</code> if it is not connected
- * yet.
- */
- SocketAddress getRemoteSocketAddress();
- /**
- * Invalidates transport instance.
- */
- void invalidate();
- boolean isValid();
- }