com.starla.smb
Class SMBSession

java.lang.Object
  |
  +--com.starla.smb.SMBSession
Direct Known Subclasses:
SMBDiskSession, com.starla.smb.SMBIPCSession, SMBPrintSession

public class SMBSession
extends java.lang.Object

SMB session class


Field Summary
static int DBGDumpPacket
          Debug option to enable dump of tx/rx packets
static int DBGHexDump
          Debug option to hex dump packet data
static int DBGPacketType
          Debug option to dump tx/rx packet type
static int DEFAULT_BUFSIZE
          Default SMB packet size to allocate
static int EncryptPass
           
static int RawRead
          Various session status flags
static int RawWrite
           
static int UserMode
           
 
Constructor Summary
SMBSession(PCShare shr, int dialect)
          Construct an SMB session
 
Method Summary
 void CloseSession()
          Close this connection with the remote server.
 int getDeviceType()
          Get the device type that this session is connected to.
 int getDialect()
          Get the SMB dialect property
 java.lang.String getDomain()
          Get the servers primary domain name
 byte[] getEncryptionKey()
          This method was created in VisualAge.
 java.lang.String getLANManagerType()
          Get the servers LAN manager type
 int getMaximumPacketSize()
          Get the maximum packet size allowed for this session
 java.lang.String getOperatingSystem()
          Get the servers operating system type
 java.lang.String getPassword()
          Get the remote share password string
 java.lang.String getServer()
          Get the remote server name
 boolean getSessionFlag(int flg)
          This method was created in VisualAge.
 int getSessionId()
          Get the session identifier property
 java.lang.String getShareName()
          Get the remote share name
 int getUserId()
          Return the assigned use id for this SMB session
 java.lang.String getUserName()
          Get the remote share user name string
static boolean hasDebugOption(int opt)
          Determine if the specified debugging option is enabled
 boolean isActive()
          Determine if the session is valid, ie.
static boolean isDebug()
          Determine if SMB session debugging is enabled
static void print(java.lang.String dbgstr)
          Output a string to the session debug stream
static void println()
          Output a newline to the session debug stream
static void println(java.lang.String dbgstr)
          Output a string to the session debug stream
static void setDebug(int dbg)
          Enable/disable SMB session debugging
 void setEncryptionKey(byte[] key)
          This method was created in VisualAge.
 void setRawMode(int rawMode)
          This method was created in VisualAge.
 void setSecurityMode(int secMode)
          This method was created in VisualAge.
 java.lang.String toString()
          Output the session details as a string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DBGPacketType

public static final int DBGPacketType
Debug option to dump tx/rx packet type

DBGDumpPacket

public static final int DBGDumpPacket
Debug option to enable dump of tx/rx packets

DBGHexDump

public static final int DBGHexDump
Debug option to hex dump packet data

DEFAULT_BUFSIZE

public static final int DEFAULT_BUFSIZE
Default SMB packet size to allocate

RawRead

public static final int RawRead
Various session status flags

RawWrite

public static final int RawWrite

UserMode

public static final int UserMode

EncryptPass

public static final int EncryptPass
Constructor Detail

SMBSession

public SMBSession(PCShare shr,
                  int dialect)
Construct an SMB session
Parameters:
shr - Remote server details.
dialect - SMB dialect for this session.
Method Detail

CloseSession

public void CloseSession()
                  throws java.io.IOException
Close this connection with the remote server.
Throws:
java.io.IOException - If an I/O error occurs.

getDeviceType

public final int getDeviceType()
Get the device type that this session is connected to.
Returns:
Device type for this session.

getDialect

public final int getDialect()
Get the SMB dialect property
Returns:
SMB dialect that this session has negotiated.

getDomain

public final java.lang.String getDomain()
Get the servers primary domain name
Returns:
Servers primary domain name, if knwon, else null.

getEncryptionKey

public final byte[] getEncryptionKey()
This method was created in VisualAge.
Returns:
byte[]

getLANManagerType

public final java.lang.String getLANManagerType()
Get the servers LAN manager type
Returns:
Servers LAN manager type, if known, else null.

getMaximumPacketSize

public final int getMaximumPacketSize()
Get the maximum packet size allowed for this session
Returns:
Maximum packet size, in bytes.

getOperatingSystem

public final java.lang.String getOperatingSystem()
Get the servers operating system type
Returns:
Servers operating system, if known, else null.

getPassword

public final java.lang.String getPassword()
Get the remote share password string
Returns:
Remote share password string

getServer

public final java.lang.String getServer()
Get the remote server name
Returns:
Remote server name

getSessionFlag

public final boolean getSessionFlag(int flg)
This method was created in VisualAge.
Parameters:
flg - int
Returns:
boolean

getSessionId

public final int getSessionId()
Get the session identifier property
Returns:
Session identifier

getShareName

public final java.lang.String getShareName()
Get the remote share name
Returns:
Remote share name string

getUserId

public final int getUserId()
Return the assigned use id for this SMB session
Returns:
Assigned user id

getUserName

public final java.lang.String getUserName()
Get the remote share user name string
Returns:
Remote share user name string

hasDebugOption

public static boolean hasDebugOption(int opt)
Determine if the specified debugging option is enabled
Parameters:
opt - Debug option bit mask
Returns:
true if the debug option is enabled, else false

isActive

public final boolean isActive()
Determine if the session is valid, ie. still open.
Returns:
true if the session is still active, else false.

isDebug

public static boolean isDebug()
Determine if SMB session debugging is enabled
Returns:
true if debugging is enabled, else false.

print

public static void print(java.lang.String dbgstr)
Output a string to the session debug stream
Parameters:
dbgstr - Debug string

println

public static void println()
Output a newline to the session debug stream

println

public static void println(java.lang.String dbgstr)
Output a string to the session debug stream
Parameters:
dbgstr - Debug string

setDebug

public static void setDebug(int dbg)
Enable/disable SMB session debugging
Parameters:
dbg - Bit mask of debug options to enable, or zero to disable

setEncryptionKey

public final void setEncryptionKey(byte[] key)
This method was created in VisualAge.
Parameters:
key - byte[]

setRawMode

public final void setRawMode(int rawMode)
This method was created in VisualAge.
Parameters:
flg - int

setSecurityMode

public final void setSecurityMode(int secMode)
This method was created in VisualAge.
Parameters:
secMode - int

toString

public java.lang.String toString()
Output the session details as a string
Returns:
Session details string
Overrides:
toString in class java.lang.Object