public final class AuthSessionFactory extends Object
The AuthSessionFactory static class is used to create sessions to remote shared resources using the SMB/CIFS protocol. A PCShare object is used to specify the remote node and share details, as well as required access control details.
Constructor and Description |
---|
AuthSessionFactory() |
Modifier and Type | Method and Description |
---|---|
protected static int |
DefaultPacketSize()
Return the default SMB packet size
|
static void |
disableDebug()
Disable session factory debugging.
|
static void |
enableDebug()
Enable session factory debug output.
|
static DialectSelector |
getDefaultDialects()
Return the list of SMB dialects that will be negotiated when a new
session is created.
|
static String |
getDefaultDomain()
Return the default domain name
|
static String |
getDefaultPassword()
Return the default password.
|
static String |
getDefaultUserName()
Return the default user name.
|
static String |
getNetBIOSNameScope()
Return the NetBIOS scope id, or null if not set
|
static int |
getNetBIOSPort()
Return the NetBIOS socket number that new sessions are connected to.
|
static int |
getPrimaryProtocol()
Return the primary connection protocol (either Protocol.TCPNetBIOS or Protocol.NativeSMB)
|
static int |
getSecondaryProtocol()
Return the secondary connection protocol (Protocol.TCPNetBIOS, Protocol.NativeSMB or Protocol.None)
|
static boolean |
hasDebug()
Determine if session factory debugging is enabled.
|
static boolean |
hasNetBIOSNameScope()
Determine if the NetBIOS name scope is set
|
static boolean |
hasSessionDebug()
Determine if SMB session debugging is enabled.
|
static AuthenticateSession |
OpenAuthenticateSession(PCShare shr,
int tmo)
Open a session to a remote server, negotiate an SMB dialect and get the returned challenge key.
|
static AuthenticateSession |
OpenAuthenticateSession(PCShare shr,
int tmo,
DialectSelector dia)
Open a session to a remote server, negotiate an SMB dialect and get the returned challenge key.
|
static void |
setDefaultDomain(String domain)
Set the default domain.
|
static void |
setDefaultPassword(String pwd)
Set the default password.
|
static void |
setDefaultUserName(String user)
Set the default user name.
|
static void |
setNetBIOSNameScope(String scope)
Set the NetBIOS scope id
|
static void |
setNetBIOSPort(int port)
Set the NetBIOS socket number to be used when setting up new sessions.
|
static boolean |
setProtocolOrder(int pri,
int sec)
Set the protocol connection order
|
static void |
setSessionDebug(boolean dbg)
Enable/disable SMB session debugging.
|
static void |
setSubnetMask(String subnet)
Set the subnet mask string for network broadcast requests
If the subnet mask is not set a default broadcast mask for the TCP/IP address
class will be used.
|
protected static final int DefaultPacketSize()
public static final void disableDebug()
public static final void enableDebug()
public static final DialectSelector getDefaultDialects()
public static String getDefaultDomain()
public static String getDefaultPassword()
public static String getDefaultUserName()
public static String getNetBIOSNameScope()
public static int getNetBIOSPort()
public static final int getPrimaryProtocol()
public static final int getSecondaryProtocol()
public static final boolean hasDebug()
public static final boolean hasNetBIOSNameScope()
public static final boolean hasSessionDebug()
public static AuthenticateSession OpenAuthenticateSession(PCShare shr, int tmo) throws IOException, UnknownHostException, SMBException
shr
- Remote server share and access control details.tmo
- Timeout value in millisecondsIOException
- If an I/O error occurs.UnknownHostException
- Remote node is unknown.SMBException
- Failed to setup a new session.public static AuthenticateSession OpenAuthenticateSession(PCShare shr, int tmo, DialectSelector dia) throws IOException, UnknownHostException, SMBException
shr
- Remote server share and access control details.tmo
- Timeout value in millisecondsdia
- SMB dialects to negotiate for this session.IOException
- If an I/O error occurs.UnknownHostException
- Remote node is unknown.SMBException
- Failed to setup a new session.public static void setDefaultDomain(String domain)
domain
- Stringpublic static void setDefaultPassword(String pwd)
pwd
- java.lang.Stringpublic static void setDefaultUserName(String user)
user
- java.lang.Stringpublic static void setNetBIOSPort(int port)
port
- intpublic static void setNetBIOSNameScope(String scope)
scope
- Stringpublic static final boolean setProtocolOrder(int pri, int sec)
pri
- Primary connection protocolsec
- Secondary connection protocol, or nonepublic static final void setSessionDebug(boolean dbg)
dbg
- true to enable SMB session debugging, else false.public static final void setSubnetMask(String subnet)
subnet
- Subnet mask string, in 'nnn.nnn.nnn.nnn' format.Copyright © 2005–2017 Alfresco Software. All rights reserved.