|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.gnu.jcifs.SessionImpl
Abstract base class of all service sessions
Field Summary | |
(package private) static int |
CAP_BULK_TRANSFER
|
(package private) static int |
CAP_COMPRESSED_DATA
|
(package private) static int |
CAP_DFS
|
(package private) static int |
CAP_EXTENDED_SECURITY
|
(package private) static int |
CAP_LARGE_FILES
|
(package private) static int |
CAP_LEVEL_II_OPLOCKS
|
(package private) static int |
CAP_LOCK_AND_READ
|
(package private) static int |
CAP_MPX_MODE
|
(package private) static int |
CAP_NT_FIND
|
(package private) static int |
CAP_NT_SMBS
|
(package private) static int |
CAP_RAW_MODE
|
(package private) static int |
CAP_RPC_REMOTE_APIS
|
(package private) static int |
CAP_STATUS32
|
(package private) static int |
CAP_UNICODE
|
protected java.util.Hashtable |
fCallerProperties
|
protected int |
fCapabilities
|
protected int |
fEncryptionKeyLen
|
protected boolean |
fExtendedSecurity
|
protected boolean |
fLoggedAsGuest
|
protected int |
fMaxBufferSize
|
protected int |
fMaxPendingMPRequests
|
protected int |
fMaxRawSize
|
protected int |
fMaxVCs
|
protected SMBMessage |
fMsg
|
protected NBTSession |
fNBTSession
|
protected static int |
fPID
|
protected int |
fProtocol
|
protected byte |
fSecurityMode
|
protected java.lang.String |
fServerLanMan
|
protected java.lang.String |
fServerOS
|
protected java.lang.String |
fServerPrimaryDomain
|
protected int |
fSessionKey
|
protected java.lang.String |
fSessionName
|
protected Share |
fShare
|
protected long |
fSystemTime
|
protected int |
fTID
|
protected int |
fTimeZone
|
protected int |
fUID
|
(package private) static int |
LANMAN_1_0
|
(package private) static int |
LM_1_2X002
|
(package private) static int |
NT_LM_0_12
|
(package private) static int |
SMB_CORE
|
(package private) static java.lang.String[] |
SUPPORTED_DIALECTS
|
Constructor Summary | |
(package private) |
SessionImpl(java.lang.String sessionname,
int protocol,
Share share,
NBTSession nbt,
SMBMessage msg)
Constructor |
Method Summary | |
(package private) static void |
addSession(java.lang.String sessionname,
CifsSession session)
|
(package private) static SMBMessage |
allocateSMBMessage()
Allocates SMB message buffer |
protected void |
checkConnection()
|
(package private) void |
connect()
session setup and tree connect |
void |
disconnect()
Disconnect the connection |
java.lang.String |
echo(java.lang.String text)
Ping the server to test the connection to the server and to see if the server is still responding |
(package private) static java.util.Enumeration |
enumerateSessions()
Enumerates sessions |
void |
finalize()
Finalization: disconnect |
long |
getConnectTime()
Returns the connect time in milliseconds (base: January 1, 1970 UTC ) |
java.lang.String |
getNetBIOSName()
Gets NetBIOS name |
java.lang.Object |
getProperty(java.lang.String key)
Gets an API-user property |
java.net.InetAddress |
getServerAddress()
Gets the address of the server |
java.lang.String |
getServerLanMan()
Returns LAN Manager of the server |
java.lang.String |
getServerOS()
Returns server OS name |
java.lang.String |
getServerPrimaryDomain()
Returns the primary domain of the server |
long |
getServerTime()
Returns the server time (from 1970 in msec) |
int |
getServerTimeZone()
Time zone of server (min from UTC) |
java.lang.String |
getSessionName()
Returns share name |
(package private) static CifsSession[] |
getSessions()
|
java.lang.String |
getShareName()
Returns the name of this session |
(package private) abstract int |
getSortPosition()
|
(package private) int |
howManyBytesCanWeSend()
Returns the max number of bytes which can be sent |
boolean |
isConnected()
Checks if the server is connected |
boolean |
isUserLevelSecurity()
Returns true if the share has user level security |
(package private) static CifsSession |
lookupSession(java.lang.String sessionname)
|
(package private) static int |
negotiate(NBTSession nbt,
java.lang.String nbtname,
SMBMessage msg)
Negotiates protocol (we support only NT_LM_0_12). |
(package private) boolean |
promptLogin()
Prompts for login dialog |
protected void |
receiveTransaction(MarshalBuffer param,
MarshalBuffer data)
Receives SMB_COM_TRANSACTION reply message |
void |
reconnect()
Reconnects server if disconnected |
(package private) static void |
removeSession(java.lang.String sessionname)
|
protected void |
sendTransaction(short[] setup,
java.lang.String name,
MarshalBuffer param,
byte[] data,
int ldata)
Sends SMB_COM_TRANSACTION message |
protected void |
sendTransaction2(short setup,
MarshalBuffer param,
byte[] data,
int ldata,
int fid)
Sends SMB_COM_TRANSACTION2 message |
void |
setAllowAutoReconnection(boolean on)
Sets automatic reconnection |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Sets an API-user property. |
protected void |
setupSMBMessage(SMBMessage msg,
byte cmd)
Inititializes SMB message |
protected void |
setupSMBMessageSecondary(SMBMessage msg,
byte cmd)
Inititializes SMB message for SMB_COM_TRANSACTION_SECONDARY |
Methods inherited from class java.lang.Object |
|
Field Detail |
static final int SMB_CORE
static final int LANMAN_1_0
static final int LM_1_2X002
static final int NT_LM_0_12
static final java.lang.String[] SUPPORTED_DIALECTS
static final int CAP_RAW_MODE
static final int CAP_MPX_MODE
static final int CAP_UNICODE
static final int CAP_LARGE_FILES
static final int CAP_NT_SMBS
static final int CAP_RPC_REMOTE_APIS
static final int CAP_STATUS32
static final int CAP_LEVEL_II_OPLOCKS
static final int CAP_LOCK_AND_READ
static final int CAP_NT_FIND
static final int CAP_DFS
static final int CAP_BULK_TRANSFER
static final int CAP_COMPRESSED_DATA
static final int CAP_EXTENDED_SECURITY
protected Share fShare
protected NBTSession fNBTSession
protected SMBMessage fMsg
protected int fUID
protected int fTID
protected static int fPID
protected byte fSecurityMode
protected int fMaxPendingMPRequests
protected int fMaxVCs
protected int fMaxBufferSize
protected int fMaxRawSize
protected int fSessionKey
protected int fCapabilities
protected long fSystemTime
protected int fTimeZone
protected int fEncryptionKeyLen
protected boolean fExtendedSecurity
protected boolean fLoggedAsGuest
protected java.lang.String fServerOS
protected java.lang.String fServerLanMan
protected java.lang.String fServerPrimaryDomain
protected java.util.Hashtable fCallerProperties
protected int fProtocol
protected java.lang.String fSessionName
Constructor Detail |
SessionImpl(java.lang.String sessionname, int protocol, Share share, NBTSession nbt, SMBMessage msg) throws java.io.IOException
share
- share objectmsg
- message containing negotiated datanbt
- NetBios sessionMethod Detail |
public void setAllowAutoReconnection(boolean on)
setAllowAutoReconnection
in interface CifsSession
on
- true if automatic reconnection allowedpublic final java.lang.String getShareName()
getShareName
in interface CifsSession
public final java.lang.String getSessionName()
getSessionName
in interface CifsSession
public final java.lang.String getServerOS()
getServerOS
in interface CifsSession
public final java.lang.String getServerLanMan()
getServerLanMan
in interface CifsSession
public final java.lang.String getServerPrimaryDomain()
getServerPrimaryDomain
in interface CifsSession
public final java.lang.String getNetBIOSName()
getNetBIOSName
in interface CifsSession
public final java.net.InetAddress getServerAddress()
getServerAddress
in interface CifsSession
public final int getServerTimeZone()
getServerTimeZone
in interface CifsSession
public final long getServerTime()
getServerTime
in interface CifsSession
public boolean isConnected()
isConnected
in interface CifsSession
public final void setProperty(java.lang.String key, java.lang.Object value)
setProperty
in interface CifsSession
key
- property namevalue
- property value;getProperty(String)
public final java.lang.Object getProperty(java.lang.String key)
getProperty
in interface CifsSession
key
- property name#setProperty(String)
public final boolean isUserLevelSecurity()
isUserLevelSecurity
in interface CifsSession
public final long getConnectTime()
getConnectTime
in interface CifsSession
public void reconnect() throws java.io.IOException
reconnect
in interface CifsSession
java.io.IOException
- if an I/O error occursprotected void checkConnection() throws java.io.IOException
void connect() throws java.io.IOException
java.io.IOException
- if an I/O error occurspublic void disconnect()
disconnect
in interface CifsSession
public void finalize()
finalize
in class java.lang.Object
static SMBMessage allocateSMBMessage()
static int negotiate(NBTSession nbt, java.lang.String nbtname, SMBMessage msg) throws java.io.IOException
nbt
- NetBios sessionnbtname
- NetBIOS namemsg
- SMB messagejava.io.IOException
- if an I/O error occurspublic java.lang.String echo(java.lang.String text) throws java.io.IOException
echo
in interface CifsSession
text
- text to sendjava.io.IOException
- if an I/O error occurs.protected void sendTransaction(short[] setup, java.lang.String name, MarshalBuffer param, byte[] data, int ldata) throws java.io.IOException
setup
- setup wordsname
- name stringparam
- parameter bufferdata
- data to sendldata
- length of datajava.io.IOException
- if an I/O error occursprotected final void sendTransaction2(short setup, MarshalBuffer param, byte[] data, int ldata, int fid) throws java.io.IOException
setup
- setup wordsname
- name stringparam
- parameter bufferdata
- data to sendldata
- length of datafid
- file idjava.io.IOException
- if an I/O error occursprotected final void receiveTransaction(MarshalBuffer param, MarshalBuffer data) throws java.io.IOException
param
- parametersdata
- data bufferjava.io.IOException
- if an I/O error occursprotected final void setupSMBMessage(SMBMessage msg, byte cmd) throws java.io.IOException
msg
- SMB messagecmd
- commandprotected final void setupSMBMessageSecondary(SMBMessage msg, byte cmd)
msg
- SMB messagecmd
- commandfinal boolean promptLogin()
final int howManyBytesCanWeSend()
static java.util.Enumeration enumerateSessions()
static CifsSession[] getSessions()
static CifsSession lookupSession(java.lang.String sessionname)
static void addSession(java.lang.String sessionname, CifsSession session)
static void removeSession(java.lang.String sessionname)
abstract int getSortPosition()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |