com.tivoli.pd.jadmin
Class PDServer

java.lang.Object
  extended by com.tivoli.pd.jutil.PDEnvironmentObject
      extended by com.tivoli.pd.jadmin.PDServer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class PDServer
extends com.tivoli.pd.jutil.PDEnvironmentObject
implements java.lang.Cloneable

This class represents a Server in Security Access Manager. A server can be a Security Access Manager policy server, or another type of server, such as an application server (defined and configured in the PDAppSvrConfig class), or a Security Access Manager authorization server. Server methods include requests to replicate data on local replicas, requests to perform specific tasks, and so on.

See Also:
Serialized Form

Constructor Summary
PDServer(PDContext context, java.lang.String serverName, PDMessages messages)
          Creates a PDServer object by retrieving the specified server data from Security Access Manager.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object.
 boolean equals(java.lang.Object obj)
          Determines whether this PDServer object is equivalent to the input object.
 java.util.ArrayList getAdminServices()
          Returns the list of Admininistration Services registered by this server as defined in Security Access Manager.
 java.lang.String getDescription()
          Returns the description of this server as defined in Security Access Manager.
 java.lang.String getHostName()
          Returns the hostname of this server as defined in Security Access Manager.
 java.lang.String getId()
          Returns the identifier of this server as defined in Security Access Manager.
 int getPort()
          Returns the port of this server as defined in Security Access Manager.
static java.util.ArrayList getTaskList(PDContext context, java.lang.String server, PDAttrs inData, PDAttrs outData, PDMessages messages)
          Get the list of tasks that can be executed by this server.
static java.util.ArrayList getTaskList(PDContext context, java.lang.String server, PDAttrs inData, PDAttrs outData, PDMessages messages)
          Deprecated. As of IBM Tivoli Access Manager for e-business v5.1, this method is replaced with the getTaskList(PDContext,String,com.tivoli.pd.jutil.PDAttrs,com.tivoli.pd.jutil.PDAttrs,PDMessages) method.
 java.lang.String getUserId()
          Returns the user identifier of this server as defined in Security Access Manager.
 boolean isListener()
          Returns a boolean indicating whether this server is listening for communications from Security Access Manager servers.
static java.util.ArrayList listServers(PDContext context, PDMessages messages)
          Lists all the registered servers as defined in Security Access Manager.
static void performTask(PDContext context, java.lang.String server, java.lang.String task, PDAttrs inData, PDAttrs outData, PDMessages messages)
          Send a command to the specified server to be executed as a task.
static void performTask(PDContext context, java.lang.String server, java.lang.String task, PDAttrs inData, PDAttrs outData, PDMessages messages)
          Deprecated. As of IBM Tivoli Access Manager for e-business v5.1, this method is replaced with the performTask(PDContext,String,String,com.tivoli.pd.jutil.PDAttrs,com.tivoli.pd.jutil.PDAttrs,PDMessages) method.
static void replicateServer(PDContext context, java.lang.String server, PDMessages messages)
          Notify the specified server to receive updates.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class com.tivoli.pd.jutil.PDEnvironmentObject
getContext, setContext
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDServer

public PDServer(PDContext context,
                java.lang.String serverName,
                PDMessages messages)
         throws PDException
Creates a PDServer object by retrieving the specified server data from Security Access Manager.

This constructor corresponds to the ivadmin_server_get() API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
serverName - the name of the server to instantiate. Cannot be null or zero-length.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.
Method Detail

getId

public java.lang.String getId()
                       throws PDException
Returns the identifier of this server as defined in Security Access Manager.

This method corresponds to the ivadmin_server_getId() C API.

Throws:
PDException

getDescription

public java.lang.String getDescription()
                                throws PDException
Returns the description of this server as defined in Security Access Manager.

This method corresponds to the ivadmin_server_getdescription() C API.

Throws:
PDException

getHostName

public java.lang.String getHostName()
                             throws PDException
Returns the hostname of this server as defined in Security Access Manager.

This method corresponds to the ivadmin_server_gethostname() C API.

Throws:
PDException

getUserId

public java.lang.String getUserId()
                           throws PDException
Returns the user identifier of this server as defined in Security Access Manager.

This method corresponds to the ivadmin_server_getprincipal() C API.

Throws:
PDException

getPort

public int getPort()
            throws PDException
Returns the port of this server as defined in Security Access Manager.

This method corresponds to the ivadmin_server_getport() C API.

Throws:
PDException

isListener

public boolean isListener()
                   throws PDException
Returns a boolean indicating whether this server is listening for communications from Security Access Manager servers.

This method corresponds to the ivadmin_server_islistener() C API.

Throws:
PDException

getAdminServices

public java.util.ArrayList getAdminServices()
                                     throws PDException
Returns the list of Admininistration Services registered by this server as defined in Security Access Manager.

This method corresponds to the ivadmin_server_getadminservices() C API.

Throws:
PDException

toString

public java.lang.String toString()
Returns a String representation of this object.

Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Returns a copy of this object.

Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Determines whether this PDServer object is equivalent to the input object.

Overrides:
equals in class java.lang.Object

performTask

public static void performTask(PDContext context,
                               java.lang.String server,
                               java.lang.String task,
                               PDAttrs inData,
                               PDAttrs outData,
                               PDMessages messages)
                        throws PDException
Send a command to the specified server to be executed as a task. The task must be runnable from one or more of the Administration Services registered by the specified server.

This method corresponds to the ivadmin_server_performtask() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
server - the name of the server on which to execute the task. This value cannot be null and must have a nonzero length.
task - the task to perform. This value cannot be null and must have a nonzero length.
inData - a PDAttrs object containing pass-thru data with additional information to be communicated to the server. This value can be null.
outData - in/out parameter; empty PDAttrs on input; may contain passthru data with task execution results on output; can be null.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

performTask

public static void performTask(PDContext context,
                               java.lang.String server,
                               java.lang.String task,
                               PDAttrs inData,
                               PDAttrs outData,
                               PDMessages messages)
                        throws PDException
Deprecated. As of IBM Tivoli Access Manager for e-business v5.1, this method is replaced with the performTask(PDContext,String,String,com.tivoli.pd.jutil.PDAttrs,com.tivoli.pd.jutil.PDAttrs,PDMessages) method.

Send a command to the specified server to be executed as a task. The task must be runnable from one or more of the Administration Services registered by the specified server.

This method corresponds to the ivadmin_server_performtask() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
server - the name of the server on which to execute the task. This value cannot be null and must have a nonzero length.
task - the task to perform. This value cannot be null and must have a nonzero length.
inData - a PDAttrs object containing pass-thru data with additional information to be communicated to the server. This value can be null.
outData - in/out parameter; empty PDAttrs on input; may contain passthru data with task execution results on output; can be null.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

getTaskList

public static java.util.ArrayList getTaskList(PDContext context,
                                              java.lang.String server,
                                              PDAttrs inData,
                                              PDAttrs outData,
                                              PDMessages messages)
                                       throws PDException
Get the list of tasks that can be executed by this server.

This method corresponds to the ivadmin_server_gettasklist() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
server - the name of the server. This value cannot be null and must have a nonzero length.
inData - a PDAttrs object containing pass-thru data with additional information to be communicated to the server. This value can be null.
outData - in/out parameter; empty PDAttrs on input; contains result text and passthru data with information about the server command execution on output; can be null.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Returns:
an ArrayList containing the task strings representing the tasks currently supported by this server.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

getTaskList

public static java.util.ArrayList getTaskList(PDContext context,
                                              java.lang.String server,
                                              PDAttrs inData,
                                              PDAttrs outData,
                                              PDMessages messages)
                                       throws PDException
Deprecated. As of IBM Tivoli Access Manager for e-business v5.1, this method is replaced with the getTaskList(PDContext,String,com.tivoli.pd.jutil.PDAttrs,com.tivoli.pd.jutil.PDAttrs,PDMessages) method.

Get the list of tasks that can be executed by this server.

This method corresponds to the ivadmin_server_gettasklist() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
server - the name of the server. This value cannot be null and must have a nonzero length.
inData - a PDAttrs object containing pass-thru data with additional information to be communicated to the server. This value can be null.
outData - in/out parameter; empty PDAttrs on input; contains result text and passthru data with information about the server command execution on output; can be null.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Returns:
an ArrayList containing the task strings representing the tasks currently supported by this server.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

replicateServer

public static void replicateServer(PDContext context,
                                   java.lang.String server,
                                   PDMessages messages)
                            throws PDException
Notify the specified server to receive updates.

This method corresponds to the ivadmin_server_replicate() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
server - the name of the server to notify of updates. If null is specified, all servers configured to receive updates are notified.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.

listServers

public static java.util.ArrayList listServers(PDContext context,
                                              PDMessages messages)
                                       throws PDException
Lists all the registered servers as defined in Security Access Manager.

This method corresponds to the ivadmin_server_list() C API.

Parameters:
context - the context for communicating with the Security Access Manager policy server.
messages - in/out parameter; empty PDMessages on input; may contain zero or more informational or warning messages on output.
Returns:
an ArrayList of server names
Throws:
PDException - if an error occurs. This exception may contain error and message codes defined in the product Error Message Reference document.