public final class ConnectionManager extends Object
connections
.Modifier and Type | Class and Description |
---|---|
static class |
ConnectionManager.ClientJarInputStream |
static class |
ConnectionManager.SocketParam |
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_ADMIN |
static String |
AUTH_CLIENT |
static String |
AUTH_DEFAULT |
static String |
AUTH_SYSTEM |
static String |
AUTH_WEB_NONSSO |
static String |
AUTH_WEB_SSO |
static byte |
COMPRESSION_DEFLATE
Default compression level.
|
static byte |
COMPRESSION_DEFLATE_BEST
Compression level for best compression.
|
static byte |
COMPRESSION_DEFLATE_SPEED
Compression level for fastest compression.
|
static byte |
COMPRESSION_NONE
Use this value to use communication without compression.
|
static byte |
COMPRESSION_SNAPPY
Snappy compression
|
static byte |
ENCRYPTION_DH_ARC4 |
static byte |
ENCRYPTION_NONE
Use this value to use communication without encryption.
|
static byte |
ENCRYPTION_TLS |
static byte |
HTTP_DEFAULT_COMPRESSION
Default compression level for HTTP-mode.
|
static byte |
HTTP_DEFAULT_ENCRYPTION
Default encryption level for HTTP-mode.
|
static int |
HTTP_MODE
User HTTP-mode for communication
|
static String |
REVISION |
static byte |
SOCKET_DEFAULT_COMPRESSION
Default compression level for SOCKET-mode.
|
static byte |
SOCKET_DEFAULT_ENCRYPTION
Default encryption level for SOCKET-mode.
|
static int |
SOCKET_MODE
Use Socket-Mode for communication
|
Modifier and Type | Method and Description |
---|---|
static de.espirit.firstspirit.client.io.ServerCaller<?> |
createCaller(String host,
int port,
int mode,
String servletZone) |
static Map<String,String> |
createLoginParams(String user,
String plainPassword) |
static ConnectionManager.ClientJarInputStream |
downloadClientJar(String host,
int port,
int mode)
Download fs-client.jar from server
|
static ConnectionManager.ClientJarInputStream |
downloadClientJar(String host,
int port,
int mode,
String servletZone)
Download fs-client.jar from server
|
static byte |
getCompression(int mode)
Get the used compression for the specified connection mode.
|
static Connection |
getConnection(String host,
int port,
int mode,
String login,
Map<?,?> loginParams)
Create a connection to a FIRSTspirit server instance, the physical connection is not already established after
this call.
|
static Connection |
getConnection(String host,
int port,
int mode,
String login,
String password)
Create a connection to a FIRSTspirit server instance, the physical connection is not already established after
this call.
|
static Connection |
getConnection(String host,
int port,
int mode,
String servletzone,
String module,
CallbackHandler cbHandler) |
static Connection |
getConnection(String host,
int port,
int mode,
String servletZone,
String login,
Map<?,?> loginParams)
Create a connection to a FIRSTspirit server instance, the physical connection is not already established after
this call.
|
static Connection |
getConnection(String host,
int port,
int mode,
String servletZone,
String login,
String password)
Create a connection to a FIRSTspirit server instance, the physical connection is not already established after
this call.
|
static ExceptionHandler |
getDefaultExceptionHandler()
Returns current default
IOErrorHandler . |
static byte |
getEncryption(int mode)
Get the used encryption for the specified connection mode.
|
static boolean |
getForceConnect() |
static Proxy |
getProxy()
Get the proxy used for new connections.
|
static boolean |
getUseHttps()
Should https protocol be used for servlet communication.
|
static void |
resetCompression()
Reset the used compression to default values.
|
static void |
resetEncryption()
Reset the used encryption to default values.
|
static void |
setCompression(byte compression)
Set the used compression.
|
static void |
setDefaultExceptionHandler(ExceptionHandler handler)
Sets the default
IOErrorHandler for all connections without an own handler. |
static void |
setEncryption(byte encryption)
Set the used encryption.
|
static void |
setProxy(Proxy proxy)
Set the proxy used for creating new connections.
|
static void |
setUseHttps(boolean useHttps)
Set if https protocol should be used for servlet communication.
|
static void |
testConnection(String host,
int port,
int mode)
Test connection parameters
|
static void |
testConnection(String host,
int port,
int mode,
String servletZone)
Test connection parameters
|
public static final String AUTH_DEFAULT
public static final String AUTH_CLIENT
public static final String AUTH_ADMIN
public static final String AUTH_SYSTEM
public static final String AUTH_WEB_SSO
public static final String AUTH_WEB_NONSSO
public static final byte ENCRYPTION_NONE
setEncryption(byte)
,
Constant Field Valuespublic static final byte ENCRYPTION_TLS
setEncryption(byte)
,
Constant Field Valuespublic static final byte ENCRYPTION_DH_ARC4
setEncryption(byte)
,
Constant Field Valuespublic static final byte COMPRESSION_NONE
setCompression(byte)
,
Constant Field Valuespublic static final byte COMPRESSION_DEFLATE
setCompression(byte)
,
Constant Field Valuespublic static final byte COMPRESSION_DEFLATE_SPEED
setCompression(byte)
,
Constant Field Valuespublic static final byte COMPRESSION_DEFLATE_BEST
setCompression(byte)
,
Constant Field Valuespublic static final byte COMPRESSION_SNAPPY
setCompression(byte)
,
Constant Field Valuespublic static final String REVISION
public static final int HTTP_MODE
public static final int SOCKET_MODE
public static byte SOCKET_DEFAULT_COMPRESSION
public static byte SOCKET_DEFAULT_ENCRYPTION
public static byte HTTP_DEFAULT_COMPRESSION
public static byte HTTP_DEFAULT_ENCRYPTION
public static Connection getConnection(String host, int port, int mode, String servletzone, String module, CallbackHandler cbHandler)
public static Connection getConnection(String host, int port, int mode, String login, Map<?,?> loginParams)
Connection.connect()
.host
- hostnameport
- portmode
- connection mode, one of HTTP_MODE
, or SOCKET_MODE
login
- login method (AuthenticationModule
).loginParams
- login parameters.Connection.connect()
topublic static Connection getConnection(String host, int port, int mode, String servletZone, String login, Map<?,?> loginParams)
Connection.connect()
.host
- hostnameport
- portmode
- connection mode, one of HTTP_MODE
, or SOCKET_MODE
servletZone
- servletzone, only used when mode is HTTP_MODE
login
- login method (AuthenticationModule
).loginParams
- login parameters.Connection.connect()
before you can use the connectionpublic static Connection getConnection(String host, int port, int mode, String login, String password)
Connection.connect()
.host
- hostnameport
- portmode
- connection mode, one of HTTP_MODE
, or SOCKET_MODE
login
- unsernamepassword
- passwordConnection.connect()
topublic static Connection getConnection(String host, int port, int mode, String servletZone, String login, String password)
Connection.connect()
.host
- hostnameport
- portmode
- connection mode, one of HTTP_MODE
, or SOCKET_MODE
servletZone
- servletzone, only used when mode is HTTP_MODE
login
- usernamepassword
- passwordConnection.connect()
before you can use the connectionpublic static Proxy getProxy()
public static void setProxy(Proxy proxy)
proxy
- The proxypublic static byte getEncryption(int mode)
mode
- connection mode, one of HTTP_MODE
, or SOCKET_MODE
ENCRYPTION_NONE
, ENCRYPTION_TLS
, ENCRYPTION_DH_ARC4
public static void setEncryption(byte encryption)
encryption
- the used encryption, one of ENCRYPTION_NONE
, ENCRYPTION_TLS
, ENCRYPTION_DH_ARC4
public static void resetEncryption()
public static void setCompression(byte compression)
compression
- the used compression, one of COMPRESSION_NONE
, COMPRESSION_DEFLATE
, COMPRESSION_DEFLATE_BEST
, COMPRESSION_DEFLATE_SPEED
public static void resetCompression()
public static boolean getUseHttps()
public static void setUseHttps(boolean useHttps)
public static byte getCompression(int mode)
mode
- connection mode, one of HTTP_MODE
, or SOCKET_MODE
COMPRESSION_NONE
, COMPRESSION_DEFLATE
, COMPRESSION_DEFLATE_BEST
, COMPRESSION_DEFLATE_SPEED
public static void testConnection(String host, int port, int mode) throws IOException
host
- The host o connect toport
- The server portmode
- The connection modeVersionMismatchException
- Throw if client has wrong versionIOException
- Thrown if there is a communication problempublic static void testConnection(String host, int port, int mode, String servletZone) throws IOException
host
- The host to connect toport
- The server portmode
- The connection modeservletZone
- The servletzoneVersionMismatchException
- Throw if client has wrong versionIOException
- Thrown if there is a communication problempublic static ConnectionManager.ClientJarInputStream downloadClientJar(String host, int port, int mode) throws IOException
host
- The server host nameport
- The server portmode
- The connection modeIOException
- Thrown if there is a communication problempublic static ConnectionManager.ClientJarInputStream downloadClientJar(String host, int port, int mode, String servletZone) throws IOException
host
- The server host nameport
- The server portmode
- The connection modeservletZone
- The servletzoneIOException
- Thrown if there is a communication problem@NotNull public static de.espirit.firstspirit.client.io.ServerCaller<?> createCaller(String host, int port, int mode, String servletZone)
public static boolean getForceConnect()
public static Map<String,String> createLoginParams(String user, String plainPassword)
public static ExceptionHandler getDefaultExceptionHandler()
IOErrorHandler
.IOErrorHandler
.public static void setDefaultExceptionHandler(ExceptionHandler handler)
IOErrorHandler
for all connections without an own handler.handler
- new default handler.Copyright © 2015 e-Spirit AG. All Rights Reserved. Build 5.1.408