public final class JdcpUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_PORT
The default port that a JDCP server listens on.
|
static UUID |
PROTOCOL_VERSION_ID
Uniquely identifies the protocol used for communication between clients
and a server.
|
| Modifier and Type | Method and Description |
|---|---|
static JobService |
connect(String host,
String username,
String password)
Connects to a JDCP server.
|
static File |
getHomeDirectory()
Gets the folder at which JDCP application data is stored.
|
static HostService |
getHostService()
Gets the currently active
HostService. |
static void |
initialize()
Performs initialization for the currently running JDCP
application.
|
static void |
registerTaskService(String name,
TaskService taskService,
String host,
String username,
String password)
Connects to a job server and provides a source of tasks to be processed.
|
static UUID |
submitJob(ParallelizableJob job,
String description,
String host,
String username,
String password)
Submits a job to a server for processing.
|
public static final int DEFAULT_PORT
public static final UUID PROTOCOL_VERSION_ID
public static JobService connect(String host, String username, String password) throws RemoteException, NotBoundException, LoginException, ProtocolVersionException
host - The host name of the server to send the job to.username - The user name to use to authenticate with the server.password - The password to use to authenticate with the server.JobService to use to communicate with the
server.RemoteException - If a failure occurs in attempting to communicate
with the server.LoginException - If the login attempt fails.NotBoundException - If the AuthenticationService
could not be found at the server.ProtocolVersionException - If this client is incompatible with the
server.public static UUID submitJob(ParallelizableJob job, String description, String host, String username, String password) throws SecurityException, RemoteException, ClassNotFoundException, JobExecutionException, LoginException, NotBoundException, ProtocolVersionException
job - The ParallelizableJob to be processed.description - A description of the job.host - The host name of the server to send the job to.username - The user name to use to authenticate with the server.password - The password to use to authenticate with the server.UUID assigned to the job.SecurityException - If the user does not have access to perform
the requested action on the server.RemoteException - If a failure occurs in attempting to communicate
with the server.ClassNotFoundException - If deserialization of the job at the
server requires a class that could not be found on the server.JobExecutionException - If the submitted job threw an exception at
the server during initialization.LoginException - If the login attempt fails.NotBoundException - If the AuthenticationService
could not be found at the server.ProtocolVersionException - If this client is incompatible with the
server.public static void registerTaskService(String name, TaskService taskService, String host, String username, String password) throws SecurityException, RemoteException, ClassNotFoundException, JobExecutionException, LoginException, NotBoundException, ProtocolVersionException
name - The name to assign to the TaskService. This may
be used to manage this TaskService in later calls.taskService - The TaskService to submit.host - The host name of the server to send the job to.username - The user name to use to authenticate with the server.password - The password to use to authenticate with the server.SecurityException - If the user does not have access to perform
the requested action on the server.RemoteException - If a failure occurs in attempting to communicate
with the server.ClassNotFoundException - If deserialization of the job at the
server requires a class that could not be found on the server.JobExecutionException - If the submitted job threw an exception at
the server during initialization.LoginException - If the login attempt fails.NotBoundException - If the AuthenticationService
could not be found at the server.ProtocolVersionException - If this client is incompatible with the
server.public static HostService getHostService()
HostService.HostService if the current thread is
executing on a job server, null otherwise.public static File getHomeDirectory()
File representing the folder at which JDCP
application data is stored.public static void initialize()
Copyright © 2016. All rights reserved.