public interface AdministrationClient extends BaseClient
ClientFactory
class.
Obtaining an Instance of a Given Client
The Java client API implements a standard Factory design pattern for client
instance creation. ClientFactory
is the class that implements a
factory and provides a way to obtain a client object of a given type by
calling a relavant method. For example:
string serviceUrl = "http://localhost:8080/SplusServer";
string username = "myusername";
string password = "mypassword";
AdministrationClient api = ClientFactory.getAdministrationClient(serviceUrl, username, password);
Use this API to:
Manage jobs that you created using the other service APIs.
Retrieve information about cluster nodes.
Manage developer packages in the package repository.
When you create a Java application to run against a server where
authentication is activated, you should provide authentication with your
application. That is, when you create an AdministrationClient
object, you add the parameters for authenticating the user's name and
password. If the user's credentials cannot be validated, then the server
returns a NotAuthenticatedException
. To check if authentication
is enabled on the server, you can call isAuthenticationEnabled
.
Note: If you plan to call the Java APIs on an https server, the client machine calling the APIs must first import the SSL certificate for that server machine. For more information about importing the certificate, see SSL Configuration HOW-TO on the Apache Tomcat Web site (external link).
TIBCO_STATSVCS_SSL_ALLOW_ANY_CERTIFICATE
Modifier and Type | Method and Description |
---|---|
boolean |
deleteJob(java.lang.String jobId)
Removes the specified job from the server.
|
JobAdminResult |
deleteJobs(java.lang.String[] jobIds)
Deletes a lists of jobs.
|
JobAdminResult |
deleteJobs(java.lang.String userName,
SplusStatus status)
Removes all jobs from the server.
|
JobAdminResult |
deleteJobs(java.lang.String userName,
java.lang.String status)
Removes all jobs from the server.
|
void |
deletePackage(java.lang.String packageName)
Deletes the specified package from repository.
|
PackageRepositoryEntryList |
getAllPackages()
Retrieves the list of all packages deployed to the central repository.
|
ClusterNodeDetails |
getClusterNode(NodeType nodeType,
java.lang.String nodeName)
Retrieve the cluster node details.
|
ClusterNodeList |
getClusterNodes()
Retrieves the list of current cluster nodes.
|
ClusterNodeList |
getClusterNodes(NodeType nodeType)
Retrieve the list of current cluster nodes by type.
|
SplusJobs |
getJobs()
Returns an
SplusJobs object that contains all jobs currently on
the server as SplusDataResult objects. |
SplusJobs |
getJobs(java.lang.String userId)
Returns all
SplusJobs object that contains all jobs currently on
the server as SplusDataResult objects for the specified user. |
SplusJobs |
getJobs(java.lang.String[] jobIds)
Retrieves a
SplusJobs object that contains all jobs currently on
the server as SplusDataResult objects with jobId s
that match the contents of the supplied jobIds array. |
SplusJobs |
getJobs(java.lang.String userName,
java.lang.String status)
Returns all
SplusJobs object that contains all jobs currently on
the server as SplusDataResult objects created by the specified
user and in the given status . |
java.lang.String |
getJobTextOutput(java.lang.String jobId,
long startPosition)
Retrieves the job text output, beginning at the specified starting
position.
|
java.lang.String |
getServerName()
Deprecated.
This is redundant because the client must know the URL to access this API.
|
java.util.Date |
getServerTime()
Retrieves the current server time.
|
java.lang.String |
getServerVersion()
Retrieves the current server version.
|
boolean |
interrupt(java.lang.String jobId)
Interrupts the specified job.
|
java.lang.Boolean |
isAuthenticationEnabled()
Checks to see if authentication is required when calling the server.
|
boolean |
rescheduleJob(java.lang.String jobId,
NodeType fromNodeType,
java.lang.String fromNodeName,
NodeType toNodeType,
java.lang.String toNodeName)
Reschedule a job to a different node in a cluster.
|
void |
uploadPackageVersion(java.lang.String packageName,
java.lang.String version,
ProtectionLevel protectionLevel,
java.lang.String filePath)
Uploads a new version of a package into the package repository.
|
getConfigurationInfo, getExtendedServerInfo, getJobDetails, getNotificationListener, getNotificationListener, getPassword, getUserName, receiveBinaryObject, removeNotificationListener, removeNotificationListener, setNotificationListener, setNotificationListener, startSession, stopSession
SplusJobs getJobs() throws NotAuthenticatedException
SplusJobs
object that contains all jobs currently on
the server as SplusDataResult
objects. This is the same as
calling getJobs(String)
using null
for
userId
.
The SplusDataResult
object returned by getJobs
returns
only a subset of the information. (This is by design, for performance reasons.) As
a result, the following fields in the SplusDataResult
are always null
when accessed from getJobs
.
To get all the information about a specific job, use BaseClient#getJobDetails(string)
.
The following code demonstrates how to use this API method:
AdministrationClient api = ClientFactory.getAdministrationClient(serviceURL, username, password); SplusJobs jobs = api.getJobs(); List<SplusDataResult> jobList = jobs.getJobs(); System.out.println("Job List Contains: " + jobs.size()); for (SplusDataResult job : jobList){ System.out.println("JobId: " + job.getJobId() + ", Status: " + job.getStatus()) };
SplusJobs
object that contains all jobs currently on
the server as SplusDataResult
objects.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.SplusDataResult
,
SplusJobs
SplusJobs getJobs(java.lang.String userId) throws NotAuthenticatedException
SplusJobs
object that contains all jobs currently on
the server as SplusDataResult
objects for the specified user.
If you supply the userId
, the list is filtered to display
only the jobs created by the specified user. This is the same as calling
getJobs(String, String)
using null
for
status
.
The SplusDataResult
object returned by getJobs
returns
only a subset of the information. (This is by design, for performance reasons.) As
a result, the following fields in the SplusDataResult
are always null
when accessed from getJobs
.
To get all the information about a specific job, use BaseClient#getJobDetails(string)
.
The following code demonstrates how to use this API method:
AdministrationClient api = ClientFactory.getAdministrationClient(serviceURL, username, password); SplusJobs jobs = api.getJobs("username"); List<SplusDataResult> jobList = jobs.getJobs(); System.out.println("Job List Contains: " + jobs.size()); for (SplusDataResult job : jobList){ System.out.println("JobId: " + job.getJobId() + ", Status: " + job.getStatus()) };
userId
- The identifier (login name) of the user whose jobs you want to
see. If null
, all jobs are returned.SplusJobs
object containing all jobs currently on the
server as SplusDataResult
objects for the specified user.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- If the client is unable to communicate with the server.getJobs(String, String)
,
SplusDataResult
,
SplusJobs
SplusJobs getJobs(java.lang.String userName, java.lang.String status) throws NotAuthenticatedException
SplusJobs
object that contains all jobs currently on
the server as SplusDataResult
objects created by the specified
user and in the given status
.
If you supply the userId
, the list is filtered to display
only the jobs created by the specified user. If you supply the
status
, the list is filtered to display only the jobs of the
specified status
.
An existing job can be one with a SplusStatus
of:
Deleted jobs are not considered existing jobs.
The SplusDataResult
object returned by getJobs
returns
only a subset of the information. (This is by design, for performance reasons.) As
a result, the following fields in the SplusDataResult
are always null
when accessed from getJobs
.
To get all the information about a specific job, use BaseClient#getJobDetails(string)
.
The following code demonstrates how to use this API method:
AdministrationClient api = ClientFactory.getAdministrationClient(serviceURL, username, password); SplusJobs jobs = api.getJobs("username"); List<SplusDataResult> jobList = jobs.getJobs(); System.out.println("Job List Contains: " + jobs.size()); for (SplusDataResult job : jobList){ System.out.println("JobId: " + job.getJobId() + ", Status: " + job.getStatus()) };
userName
- The login name of the user whose jobs you want to
see. If null
, all jobs are returned.status
- The status of the jobs to find. See the above for a description of possible statuses.SplusJobs
object containing all jobs currently on the
server as SplusDataResult
objects created by the
specified user and in the given status.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- If the client is unable to communicate with the server.getJobs(String, String)
,
SplusDataResult
,
SplusJobs
SplusJobs getJobs(java.lang.String[] jobIds) throws NotAuthenticatedException
SplusJobs
object that contains all jobs currently on
the server as SplusDataResult
objects with jobId
s
that match the contents of the supplied jobIds
array.
An existing job can be one with a SplusStatus
of:Deleted jobs are not considered existing jobs.
The SplusDataResult
object returned by getJobs
returns
only a subset of the information. (This is by design, for performance reasons.) As
a result, the following fields in the SplusDataResult
are always null
when accessed from getJobs
.
To get all the information about a specific job, use BaseClient#getJobDetails(string)
.
The following code demonstrates the use of this API method:
AdministrationClient api = ClientFactory.getAdministrationClient(serviceURL, username, password); String [] jobIds = { "123" }; List<SplusDataResult> jobList = jobs.getJobs(jobIds); System.out.println("Job List Contains: " + jobs.size()); for (SplusDataResult job : jobList){ System.out.println("JobId: " + job.getJobId() + ", Status: " + job.getStatus()) };
jobIds
- The specified list of jobId
s.SplusJobs
object containing a list of
SplusDataResult
objects on the server.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- If the client is unable to communicate with the server.getJobs()
,
SplusDataResult
,
SplusJobs
java.lang.String getJobTextOutput(java.lang.String jobId, long startPosition) throws NotAuthenticatedException, JobDoesNotExistException
jobId
- The identifier for the job. Should never be null
.startPosition
- The starting position of the text output.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.JobDoesNotExistException
- If a job with the java.lang.IllegalArgumentException
- The jobId format is invalid (not a number).BridgeException
- If the client is unable to communicate with the server.FunctionClient
,
ExpressionClient
,
SplusDataResult
java.lang.String getServerName() throws NotAuthenticatedException
NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.ExpressionClient
,
FunctionClient
java.util.Date getServerTime() throws NotAuthenticatedException
NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.ExpressionClient
,
FunctionClient
java.lang.String getServerVersion() throws NotAuthenticatedException
NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.ExpressionClient
,
FunctionClient
boolean interrupt(java.lang.String jobId) throws NotAuthenticatedException, JobDoesNotExistException, java.lang.IllegalArgumentException
jobId
- A string identifying the job to interrupt. (jobId
is a property of SplusDataResult
). Should never be
null
.status
- The job status to match.true
if the job is interrupted. false
if otherwise.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.JobDoesNotExistException
- if the job with the jobId
could not be found.java.lang.IllegalArgumentException
- if the jobId
format is invalid (not a number).BridgeException
- if the client is unable to communicate with the server.SplusDataResult
boolean deleteJob(java.lang.String jobId) throws NotAuthenticatedException, JobDoesNotExistException, java.lang.IllegalArgumentException
jobId
- A string identifying the job to interrupt. (jobId
is a property of SplusDataResult
). Should never be
null
.status
- The job status to match.true
if the job is deleted. false
if
otherwise.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.JobDoesNotExistException
- if a job with the java.lang.IllegalArgumentException
- if the jobId
is null
or empty or
the jobId
format is invalid (not a number).SplusDataResult
JobAdminResult deleteJobs(java.lang.String userName, SplusStatus status) throws NotAuthenticatedException
userName
and/or ,
status
, the list is filtered to delete only the jobs created by the specified
user and/or status.
*
An existing job can be one with a SplusStatus
of:
userName
- A string identifying the user that submitted a given job.status
- The job status to match. A SplusStatus
identifying the
status for the jobs to be deleted. (status
is a
property of SplusDataResult
).JobAdminResult
that has the outcome of the operation.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.SplusDataResult
,
JobAdminResult
JobAdminResult deleteJobs(java.lang.String userName, java.lang.String status) throws NotAuthenticatedException, JobDoesNotExistException
userName
and/or
status
, the list is filtered to delete only the jobs created by the specified
user and/or with the specified status.
An existing job can be one with a SplusStatus
of:
userName
- A string identifying the user that submitted a given job.status
- The job status to match. A string identifying the status for
the jobs to be deleted. (status
is a property of
SplusDataResult
). If null
, all jobs for
the specified user are deleted.JobAdminResult
that has the outcome of the operation.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.JobDoesNotExistException
SplusDataResult
,
JobAdminResult
JobAdminResult deleteJobs(java.lang.String[] jobIds) throws NotAuthenticatedException
jobIds
- The list of IDs of jobs to be deleted. Should never be
null
.JobAdminResult
, which indicates the status and the list
of deleted jobs.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.BridgeException
- if the client is unable to communicate with the server.java.lang.IllegalArgumentException
- if the jobIds
is null
.SplusDataResult
,
JobAdminResult
java.lang.Boolean isAuthenticationEnabled()
true
if it is required; otherwise false
.BridgeException
- if the client is unable to communicate with the server.ClusterNodeList getClusterNodes() throws NotAuthenticatedException
NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.getClusterNodes(NodeType nodeType)
,
getClusterNode(NodeType nodeType, String nodeName)
ClusterNodeList getClusterNodes(NodeType nodeType) throws NotAuthenticatedException
nodeType
- The type of nodes to get. Can be Manager or Worker. If null
, all
nodes are returned.NotAuthenticatedException
getClusterNodes()
,
getClusterNode(NodeType nodeType, String nodeName)
ClusterNodeDetails getClusterNode(NodeType nodeType, java.lang.String nodeName) throws NotAuthenticatedException
nodeType
- The type of node for which to get the details. Can be Manager or Worker.nodeName
- The name of the node for which to get the details.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.getClusterNodes()
boolean rescheduleJob(java.lang.String jobId, NodeType fromNodeType, java.lang.String fromNodeName, NodeType toNodeType, java.lang.String toNodeName) throws NotAuthenticatedException, JobDoesNotExistException, java.lang.IllegalArgumentException
jobId
- The ID of the job to reschedule.fromNodeType
- The type of node from which to transfer the job. Can be Manager or Worker.fromNodeName
- The name of the node from which to transfer the job.toNodeType
- The type of node to which to transfer the job. Can be Manager or Worker.toNodeName
- The name of the node to which to transfer the job.true
if successful; otherwise false
NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.JobDoesNotExistException
- If a job with the java.lang.IllegalArgumentException
getClusterNodes()
,
getClusterNode(NodeType nodeType, String nodeName)
void uploadPackageVersion(java.lang.String packageName, java.lang.String version, ProtectionLevel protectionLevel, java.lang.String filePath) throws NotAuthenticatedException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.io.FileNotFoundException
packageName
- The name of the package to upload.version
- The version of the package.protectionLevel
- The package's protection level. Can be either Protected or Unprotected.filePath
- file path to a file containing the package.java.lang.IllegalArgumentException
- if arguments are invalid or unspecified.java.lang.IllegalStateException
- if the upload failed due to internal failure.NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.java.lang.IllegalArgumentException
- if any arguments are invalid or unspecified.java.lang.IllegalStateException
- if the upload failed due to an internal failure.java.io.FileNotFoundException
- if the package specified could not be found.java.lang.IllegalArgumentException
- if arguments are invalid or unspecified.java.lang.IllegalStateException
- if the upload failed due to internal failure.java.io.FileNotFoundException
- if the file could not be found.ProtectionLevel
void deletePackage(java.lang.String packageName) throws NotAuthenticatedException, java.lang.IllegalArgumentException, java.lang.IllegalStateException
packageName
- The name of the package to delete.NotAuthenticatedException
- if authentication is enabled on the server.
and the user and/or password cannot be authenticated.java.lang.IllegalArgumentException
- if package name is invalid or the package does not exist.java.lang.IllegalStateException
- if the specified package cannot be deleted because it is protected.PackageRepositoryEntryList getAllPackages() throws NotAuthenticatedException, java.lang.IllegalStateException
NotAuthenticatedException
- if authentication is enabled on the server
and the user and/or password cannot be authenticated.java.lang.IllegalStateException
- - if getting the list failed due to internal failure.