Package com.redwood.scheduler.api.tool
Class ToolConnectionFactory
- java.lang.Object
-
- com.redwood.scheduler.api.tool.ToolConnectionFactory
-
public class ToolConnectionFactory extends Object
Factory for ToolConnection instances.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONNECTIONFILE_HOSTNAME
static String
CONNECTIONFILE_ISOLATION_GROUP
static String
CONNECTIONFILE_NAME
static String
CONNECTIONFILE_PASSWORD
static String
CONNECTIONFILE_PORT
static String
CONNECTIONFILE_PROTOCOL
static String
CONNECTIONFILE_SECRET
static String
CONNECTIONFILE_SERVER
static String
CONNECTIONFILE_SUFFIX
static String
CONNECTIONFILE_TIMEOUT
static String
CONNECTIONFILE_USERNAME
static String
CONNECTIONFILE_VERSION
static String
CONTENT_DISPOSITION_HEADER
static Object
DATE_NEVER
static Object
DATE_RECALCULATE
static String
OCTET_CONTENT_TYPE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ToolConnection
createConnection(InputStream connectionStream)
Create a ToolConnection from an input stream representing a version 1 connection file, created using the command line jsecret tool.static ToolConnection
createConnection(String connectionFile, int timeout)
Create a ToolConnection from a version 1 connection file, created using the command line jsecret tool.static ToolConnection
createConnection(String url, String username, String isolationGroup, String password, int timeout)
Create a ToolConnection.static ToolConnection
createConnection(String url, String username, String isolationGroup, String password, Map<String,Object> options)
Create a ToolConnection.static ToolConnection
createConnection(Map<String,Object> connectionProperties)
Create a ToolConnection from a Map representing a version 1 connection file, created using the command line jsecret tool.static ToolConnection
createConnection(Properties connectionProperties)
Create a ToolConnection from a Properties object representing a version 1 connection file, created using the command line jsecret tool.
-
-
-
Field Detail
-
CONNECTIONFILE_VERSION
public static final String CONNECTIONFILE_VERSION
- See Also:
- Constant Field Values
-
CONNECTIONFILE_NAME
public static final String CONNECTIONFILE_NAME
- See Also:
- Constant Field Values
-
CONNECTIONFILE_USERNAME
public static final String CONNECTIONFILE_USERNAME
- See Also:
- Constant Field Values
-
CONNECTIONFILE_PASSWORD
public static final String CONNECTIONFILE_PASSWORD
- See Also:
- Constant Field Values
-
CONNECTIONFILE_SECRET
public static final String CONNECTIONFILE_SECRET
- See Also:
- Constant Field Values
-
CONNECTIONFILE_HOSTNAME
public static final String CONNECTIONFILE_HOSTNAME
- See Also:
- Constant Field Values
-
CONNECTIONFILE_PORT
public static final String CONNECTIONFILE_PORT
- See Also:
- Constant Field Values
-
CONNECTIONFILE_ISOLATION_GROUP
public static final String CONNECTIONFILE_ISOLATION_GROUP
- See Also:
- Constant Field Values
-
CONNECTIONFILE_PROTOCOL
public static final String CONNECTIONFILE_PROTOCOL
- See Also:
- Constant Field Values
-
CONNECTIONFILE_TIMEOUT
public static final String CONNECTIONFILE_TIMEOUT
- See Also:
- Constant Field Values
-
CONNECTIONFILE_SERVER
public static final String CONNECTIONFILE_SERVER
- See Also:
- Constant Field Values
-
CONNECTIONFILE_SUFFIX
public static final String CONNECTIONFILE_SUFFIX
- See Also:
- Constant Field Values
-
CONTENT_DISPOSITION_HEADER
public static final String CONTENT_DISPOSITION_HEADER
- See Also:
- Constant Field Values
-
OCTET_CONTENT_TYPE
public static final String OCTET_CONTENT_TYPE
- See Also:
- Constant Field Values
-
DATE_NEVER
public static final Object DATE_NEVER
-
DATE_RECALCULATE
public static final Object DATE_RECALCULATE
-
-
Method Detail
-
createConnection
public static ToolConnection createConnection(String url, String username, String isolationGroup, String password, int timeout) throws ToolException, LoginException
Create a ToolConnection.- Parameters:
url
- URL to connect to, eg. http://host:port/schedulerusername
- username to connect withisolationGroup
- isolation group to connect to (specify GLOBAL if you are not sure).password
- password to connect with. This will handle encrypted passwords from the Credential object.timeout
- socket timeout (specify 0 for none).- Returns:
- a ToolConnection instance.
- Throws:
ToolException
- if an error occurs in communication.LoginException
- if the login fails.
-
createConnection
public static ToolConnection createConnection(String connectionFile, int timeout) throws IOException, ToolException, LoginException
Create a ToolConnection from a version 1 connection file, created using the command line jsecret tool.- Parameters:
connectionFile
- the filename of the connection file.timeout
- socket timeout (specify 0 for none).- Returns:
- a ToolConnection instance. This must be closed after use.
- Throws:
IOException
- if the connection file cannot be opened.ToolException
- if an error occurs in communication.LoginException
- if the login fails.
-
createConnection
public static ToolConnection createConnection(String url, String username, String isolationGroup, String password, Map<String,Object> options) throws ToolException, LoginException
Create a ToolConnection.- Parameters:
url
- URL to connect to, eg. http://host:port/schedulerusername
- username to connect withisolationGroup
- isolation group to connect to (specify GLOBAL if you are not sure).password
- password to connect with. This will handle encrypted passwords from the Credential object.options
- connection specific options (may be null).- Returns:
- a ToolConnection instance.
- Throws:
ToolException
- if an error occurs in communication.LoginException
- if the login fails.
-
createConnection
public static ToolConnection createConnection(InputStream connectionStream) throws IOException, ToolException, LoginException
Create a ToolConnection from an input stream representing a version 1 connection file, created using the command line jsecret tool. The input stream will be closed when complete.- Parameters:
connectionStream
- the input stream for the connection file.- Returns:
- a ToolConnection instance. This must be closed after use.
- Throws:
IOException
- if the connection file cannot be opened.ToolException
- if an error occurs in communication.LoginException
- if the login fails.
-
createConnection
public static ToolConnection createConnection(Properties connectionProperties) throws ToolException, LoginException
Create a ToolConnection from a Properties object representing a version 1 connection file, created using the command line jsecret tool.- Parameters:
connectionProperties
- a Properties object containing the connection- Returns:
- a ToolConnection instance. This must be closed after use.
- Throws:
ToolException
- if an error occurs in communication.LoginException
- if the login fails.
-
createConnection
public static ToolConnection createConnection(Map<String,Object> connectionProperties) throws ToolException, LoginException
Create a ToolConnection from a Map representing a version 1 connection file, created using the command line jsecret tool.- Parameters:
connectionProperties
- a Properties object containing the connection- Returns:
- a ToolConnection instance. This must be closed after use.
- Throws:
ToolException
- if an error occurs in communication.LoginException
- if the login fails.
-
-