public abstract class PacketHandler extends Object
Constructor and Description |
---|
PacketHandler(int typ,
String name,
String shortName,
CIFSPacketPool packetPool)
Class constructor
|
PacketHandler(int typ,
String name,
String shortName,
String clientName,
CIFSPacketPool packetPool)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
abstract int |
availableBytes()
Return the count of available bytes in the receive input stream
|
void |
closeHandler()
Close the protocol handler
|
abstract void |
flushPacket()
Flush the output socket
|
String |
getClientName()
Return the client name
|
CIFSPacketPool |
getPacketPool()
Return the packet pool
|
InetAddress |
getRemoteAddress()
Return the remote address for the connection
|
String |
getShortName()
Return the short protocol name
|
boolean |
hasClientName()
Determine if the client name is available
|
boolean |
hasDebug()
Check if debug output is enabled
|
boolean |
hasRemoteAddress()
Check if there is a remote address available
|
int |
isProtocol()
Return the protocol type
|
String |
isProtocolName()
Return the protocol name
|
abstract SMBSrvPacket |
readPacket()
Read a packet
|
protected void |
rethrowException(Throwable t)
Rethrow an exception, allow for logging
|
protected void |
setClientName(String name)
Set the client name
|
void |
setDebug(boolean ena)
Set/clear the debug enable flag
|
protected void |
setRemoteAddress(InetAddress addr)
Set the remote address
|
void |
writePacket(SMBSrvPacket pkt)
Send an SMB response packet
|
void |
writePacket(SMBSrvPacket pkt,
int len)
Send an SMB response packet
|
abstract void |
writePacket(SMBSrvPacket pkt,
int len,
boolean writeRaw)
Send an SMB response packet
|
public PacketHandler(int typ, String name, String shortName, CIFSPacketPool packetPool) throws IOException
typ
- intname
- StringshortName
- StringpacketPool
- CIFSPacketPoolIOException
- If a network error occurspublic PacketHandler(int typ, String name, String shortName, String clientName, CIFSPacketPool packetPool)
typ
- intname
- StringshortName
- Stringpublic final int isProtocol()
public final String isProtocolName()
public final String getShortName()
public final boolean hasRemoteAddress()
public final InetAddress getRemoteAddress()
public final boolean hasClientName()
public final String getClientName()
public final CIFSPacketPool getPacketPool()
public final boolean hasDebug()
public final void setDebug(boolean ena)
ena
- booleanpublic abstract int availableBytes() throws IOException
IOException
- If a network error occurs.public abstract SMBSrvPacket readPacket() throws IOException
IOException
- If a network error occurs.public abstract void writePacket(SMBSrvPacket pkt, int len, boolean writeRaw) throws IOException
pkt
- SMBSrvPacketlen
- intwriteRaw
- booleanIOException
- If a network error occurs.public final void writePacket(SMBSrvPacket pkt, int len) throws IOException
pkt
- SMBSrvPacketIOException
- If a network error occurs.public final void writePacket(SMBSrvPacket pkt) throws IOException
pkt
- SMBSrvPacketIOException
- If a network error occurs.public abstract void flushPacket() throws IOException
IOException
- If a network error occurspublic void closeHandler()
protected void rethrowException(Throwable t) throws IOException
t
- ThrowableIOException
protected final void setClientName(String name)
name
- Stringprotected final void setRemoteAddress(InetAddress addr)
addr
- InetAddressCopyright © 2005–2017 Alfresco Software. All rights reserved.