public final class JISession extends Object
IJIComObject is associated with
a single session only. Sessions are also responsible for the clean up once
the system shuts down or IJIComObject go out of reference
scope.
Please make sure that you call destroySession(JISession) after you
are done using the session. This will ensure that any open sockets to COM
server are closed.
| Modifier and Type | Method and Description |
|---|---|
static JISession |
createSession()
Native Single Sign On capable session.
|
static JISession |
createSession(IJIAuthInfo authInfo)
Creates a session with the
authInfo of the user. |
static JISession |
createSession(JISession session)
Creates a new session using credentials of the
sessionparameter. |
static JISession |
createSession(String domain,
String username,
String password)
Creates a session.
|
static void |
destroySession(JISession session)
< p>
Used to destroy the
session, this release all references of
the COM server and it's interfaces. |
boolean |
equals(Object obj) |
protected void |
finalize() |
IJIAuthInfo |
getAuthInfo()
Returns the
IJIAuthInfo (if any) associated with this
session. |
String |
getDomain()
Gets the domain of the user associated with this session.
|
int |
getGlobalSocketTimeout()
Returns the global timeout applied to all sockets opened from this
session to COM Server.
|
int |
getSessionIdentifier()
Returns a unique identifier for this session.
|
String |
getUserName()
Gets the user name associated with this session.
|
int |
hashCode() |
boolean |
isNTLMv2Enabled()
Flag indicating whether NTLMv2 security is enabled.
|
boolean |
isSessionSecurityEnabled()
Flag indicating whether session security is enabled.
|
boolean |
isSSOEnabled()
Returns whether this session is SSO or not.
|
void |
setGlobalSocketTimeout(int timeout)
< p>
Sets the timeout for all sockets opened to (not fro) the COM server for this session.
|
void |
useNTLMv2(boolean enable)
< p>
Sets the use of NTLMv2 Security (default is NTLM1).
|
void |
useSessionSecurity(boolean enable)
< p>
Sets the use of NTLM2 Session Security.
|
public IJIAuthInfo getAuthInfo()
IJIAuthInfo (if any) associated with this
session.public static JISession createSession(IJIAuthInfo authInfo)
authInfo of the user. This
session is not yet attached to a COM server.authInfo - IllegalArgumentException - if authInfo is
null.JIComServer(JIClsid, JISession),
JIComServer(JIProgId, JISession)public static JISession createSession(String domain, String username, String password)
domain - domain of the user.username - name of the userpassword - password of the user.IllegalArgumentException - if any parameter is null.JIComServer(JIClsid, JISession),
JIComServer(JIProgId, JISession)public static JISession createSession(JISession session)
sessionparameter. The new session is not yet attached to a
COM server.session - JIComServer(JIClsid, JISession),
JIComServer(JIProgId, JISession)public static JISession createSession()
JIComServer(ProgId,...) ctors. JCIFS will fail to setup a
connection with Windows Registry if GUEST account is disabled.JIComServer(JIClsid, JISession),
JIComServer(JIProgId, JISession)public boolean isSSOEnabled()
public static void destroySession(JISession session) throws JIException
session, this release all references of
the COM server and it's interfaces. It should be called in the end after
the developer is done with the COM server.
Note that all interface references belonging to sessions linked to this session will also be destroyed.
session - JIExceptionJIObjectFactory.narrowObject(org.jinterop.dcom.core.IJIComObject)public String getUserName()
public String getDomain()
public int getSessionIdentifier()
protected void finalize()
throws Throwable
public void setGlobalSocketTimeout(int timeout)
IJIComObject override this timeout.timeout - in millisecsIJIComObject.setInstanceLevelSocketTimeout(int),
IJIComObject.call(JICallBuilder, int)public int getGlobalSocketTimeout()
public void useSessionSecurity(boolean enable)
JIComServer is bound to this session (using any of the
JIComServer constructors) the use of session security
cannot be enabled or disabled.
Please note that session security can come at any available level of authentication (LM\NTLM\LMv2\NTLMv2). The framework currently only supports sign and seal at NTLMv1 level.
Whether to use NTLM1 or not is dictated by this field in the Windows Registry.
HKLM\System\CurrentControlSet\Control\Lsa\LmCompatibilityLevel
This article on MSDN talks more about it
http://support.microsoft.com/default.aspx?scid=KB;en-us;239869
enable - true to enable, false to disable.public void useNTLMv2(boolean enable)
useSessionSecurity method. Once the
JIComServer is bound to this session (using any of the
JIComServer constructors) the use of NTLMv2 security
cannot be enabled or disabled.
enable - true to enable.public boolean isSessionSecurityEnabled()
true for enabled.public boolean isNTLMv2Enabled()
true for enabled.Copyright © 2022. All rights reserved.