Package jcifs.util.transport
Class Transport
- java.lang.Object
-
- jcifs.util.transport.Transport
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
SmbTransport
public abstract class Transport extends java.lang.Object implements java.lang.RunnableThis class simplifies communication for protocols that support multiplexing requests. It encapsulates a stream and some protocol knowledge (provided by a concrete subclass) so that connecting, disconnecting, sending, and receiving can be syncronized properly. Apparatus is provided to send and receive requests concurrently.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.HashMapresponse_mapjava.lang.ObjectsetupDiscoLock
-
Constructor Summary
Constructors Constructor Description Transport()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconnect(long timeout)voiddisconnect(boolean hard)protected abstract voiddoConnect()protected abstract voiddoDisconnect(boolean hard)protected abstract voiddoRecv(Response response)protected abstract voiddoSend(Request request)protected abstract voiddoSkip()protected abstract voidmakeKey(Request request)protected abstract RequestpeekKey()static intreadn(java.io.InputStream in, byte[] b, int off, int len)voidrun()voidsendrecv(Request request, Response response, long timeout)java.lang.StringtoString()
-
-
-
Method Detail
-
readn
public static int readn(java.io.InputStream in, byte[] b, int off, int len) throws java.io.IOException- Throws:
java.io.IOException
-
makeKey
protected abstract void makeKey(Request request) throws java.io.IOException
- Throws:
java.io.IOException
-
peekKey
protected abstract Request peekKey() throws java.io.IOException
- Throws:
java.io.IOException
-
doSend
protected abstract void doSend(Request request) throws java.io.IOException
- Throws:
java.io.IOException
-
doRecv
protected abstract void doRecv(Response response) throws java.io.IOException
- Throws:
java.io.IOException
-
doSkip
protected abstract void doSkip() throws java.io.IOException- Throws:
java.io.IOException
-
sendrecv
public void sendrecv(Request request, Response response, long timeout) throws java.io.IOException
- Throws:
java.io.IOException
-
doConnect
protected abstract void doConnect() throws java.lang.Exception- Throws:
java.lang.Exception
-
doDisconnect
protected abstract void doDisconnect(boolean hard) throws java.io.IOException- Throws:
java.io.IOException
-
connect
public void connect(long timeout) throws TransportException- Throws:
TransportException
-
disconnect
public void disconnect(boolean hard) throws java.io.IOException- Throws:
java.io.IOException
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-