SilverStream
Application Server 3.5

com.sssw.rts.adminclient
Class AgAdmin

java.lang.Object
 |
 +--com.sssw.rts.adminclient.AgAdmin

public class AgAdmin
extends Object

This class serves as an entry point for the Administration API since it provides factory methods for some important API objects, most notably the Server object. This is a client-side only entry point.


Constructor Summary
AgAdmin()
           
 
Method Summary
static AgiAdmExpressionMgr getExpressionMgrObject()
          Instantiates an Expression Manager object.
static AgiAdmPublishMgr getPublishMgrObject()
          Instantiates a Publish Manager object.
static AgiAdmServer getServer(AgrServerSession session)
          Instantiates a server object.
static AgiAdmServer getServer(String server)
          Get an Admin API server from a string specification.
static AgiAdmServer getServer(String serverName, int port)
          Instantiates a server object.
static AgiAdmServer getServer(String protocol, String serverName, int port)
          Instantiates a server object
static AgiAdmStatContainer getStatCluster(AgiAdmCluster cluster)
          Instantiates a "cluster" type of a statistic container element.
static AgiAdmStatContainer getStatCluster(String protocol, String host, int port)
          Instantiates a "cluster" type of a statistic container element.
static AgiAdmStatElement getStatElement(String path)
          Given a path, instantiate the appropriate statistic element.
static AgiAdmStatContainer getStatServer(AgiAdmServer server)
          Instantiates a "server" type of a statistic container element.
static AgiAdmStatContainer getStatServer(String protocol, String serverName, int port)
          Instantiates a "server" type of a statistic container element.
static AgiAdmStatSet getStatSet(String spec)
          Instantiate a statistics set object.
static AgiAdmStatSet getStatSetFromFile(File file)
          Instantiate a statistics set object.
static AgiAdmStatSet getStatSetFromStream(InputStream in)
          Instantiate a statistics set object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AgAdmin

public AgAdmin()
Method Detail

getServer

public static AgiAdmServer getServer(String serverName,
                                     int port)
                              throws AgoUnrecoverableSystemException
Instantiates a server object.
Parameters:
serverName - the name of the server
port - the port to use; the value of -1 means "use the default port".
Usage:

In the current implementation, this method uses "http" as the protocol.

This method is specific to client-side. On the server side, use the following to get to servers.

From a page:

	AgiHttpServletRequest req = getCurrentRequest();
	AgoHttpRequestEvent evt = (AgoHttpRequestEvent) req;
	AgiServer server = evt.getServer();
 

From a business object:

	AgiServer server = evt.getServer();
 
Example:
AgiAdmServer server1 = AgAdmin.getServer("myserver", 90);
AgiAdmServer server2 = AgAdmin.getServer("myserver", -1);
See Also:
AgiAdmServer

getServer

public static AgiAdmServer getServer(String protocol,
                                     String serverName,
                                     int port)
                              throws AgoUnrecoverableSystemException
Instantiates a server object
Parameters:
protocol - the name of the protocol to use, e.g. "http" or "https".
serverName - the name of the server
port - the port to use; the value of -1 means "use the default port".
Usage:

This method is specific to client-side. On the server side, use the following to get to servers.

From a page:

 	AgiHttpServletRequest req = getCurrentRequest();
	AgoHttpRequestEvent evt = (AgoHttpRequestEvent) req;
	AgiServer server = evt.getServer();
 

From a business object:

	AgiServer server = evt.getServer();
 
Example:
AgiAdmServer server = AgAdmin.getServer("https", "myserver", 88);
See Also:
AgiAdmServer

getServer

public static AgiAdmServer getServer(String server)
                              throws AgoUnrecoverableSystemException
Get an Admin API server from a string specification.
Parameters:
server - string specification of a server, e.g. "myserver:88"
Usage:

This method is specific to client-side. On the server side, use the following to get to servers.

From a page:

 	AgiHttpServletRequest req = getCurrentRequest();
	AgoHttpRequestEvent evt = (AgoHttpRequestEvent) req;
	AgiServer server = evt.getServer();
 

From a business object:

	AgiServer server = evt.getServer();
 
Example:
AgiAdmServer server = AgAdmin.getServer("https://myserver:8080");
 AgiAdmServer server2 = AgAdmin.getServer("abc:90");
See Also:
AgiAdmServer

getServer

public static AgiAdmServer getServer(AgrServerSession session)
                              throws AgoUnrecoverableSystemException
Instantiates a server object.
Parameters:
session - an established server session to the desired server, as obtained by AgRuntime.connect().
Usage:

This method is specific to client-side.

This method is primarily intended for use in non-SilverStream applications, which use AgRuntime initialization

Example:
   AgRuntime.init(null, null, userLogin);
   AgrServerSession session = AgRuntime.connect("https", "myserver", 88);
   AgiAdmServer server = AgAdmin.getServer(session);
See Also:
AgiAdmServer, AgRuntime, AgrServerSession

getPublishMgrObject

public static AgiAdmPublishMgr getPublishMgrObject()
Instantiates a Publish Manager object. You cannot publish in a browser.
Example:
AgiAdmPublishMgr pubmgr = AgAdmin.getPublishMgrObject();
See Also:
AgiAdmPublishMgr

getExpressionMgrObject

public static AgiAdmExpressionMgr getExpressionMgrObject()
Instantiates an Expression Manager object.
Example:
AgiAdmExpressionMgr exprmgr = AgAdmin.getExpressionMgrObject();
See Also:
AgiAdmExpressionMgr

getStatCluster

public static AgiAdmStatContainer getStatCluster(String protocol,
                                                 String host,
                                                 int port)
                                          throws AgoUnrecoverableSystemException,
                                                 AgoSecurityException,
                                                 MalformedURLException
Instantiates a "cluster" type of a statistic container element.
Parameters:
protocol - protocol to use, e.g. "https"
host - host name
port - port, -1 means "use default port"
Returns:
AgiAdmStatContainer whose type is AgiAdmStatContainer.CLUSTER
See Also:
AgiAdmStatContainer

getStatCluster

public static AgiAdmStatContainer getStatCluster(AgiAdmCluster cluster)
                                          throws AgoUnrecoverableSystemException,
                                                 AgoSecurityException,
                                                 MalformedURLException
Instantiates a "cluster" type of a statistic container element.
Parameters:
cluster - Admin Cluster object
Returns:
AgiAdmStatContainer whose type is AgiAdmStatContainer.CLUSTER
See Also:
AgiAdmStatContainer

getStatServer

public static AgiAdmStatContainer getStatServer(String protocol,
                                                String serverName,
                                                int port)
                                         throws AgoUnrecoverableSystemException,
                                                AgoSecurityException,
                                                MalformedURLException
Instantiates a "server" type of a statistic container element.
Parameters:
protocol - protocol to use, e.g. "https"
serverName - host name
port - server port, -1 means "use default port"
Returns:
AgiAdmStatContainer whose type is AgiAdmStatContainer.SERVER
See Also:
AgiAdmStatContainer

getStatServer

public static AgiAdmStatContainer getStatServer(AgiAdmServer server)
                                         throws AgoUnrecoverableSystemException,
                                                AgoSecurityException,
                                                MalformedURLException
Instantiates a "server" type of a statistic container element.
Parameters:
server - an Admin API server admin object
Returns:
AgiAdmStatContainer whose type is AgiAdmStatContainer.SERVER
See Also:
AgiAdmStatContainer

getStatElement

public static AgiAdmStatElement getStatElement(String path)
                                        throws AgoUnrecoverableSystemException
Given a path, instantiate the appropriate statistic element.
Parameters:
path - path to the element
Returns:
AgiAdmStatElement that is represented by the path, null if no element can be associated with the specified path
See Also:
AgiAdmStatElement

getStatSet

public static AgiAdmStatSet getStatSet(String spec)
                                throws AgoUnrecoverableSystemException,
                                       AgoSecurityException
Instantiate a statistics set object.
Parameters:
spec - specifies either a cluster or a server for which this stat set is intended (see below)
Usage:

A cluster spec may be of the form '/protocol://hostname:port'.

  • If the protocol part is missing then "http" is assumed.
  • If the port is missing then the default port is assumed.

A server spec may be of the form 'cluster spec/protocol://hostname:port';

  • If the protocol part is missing then "http" is assumed.
  • If the port is missing then the default port is assumed.

The spec ties a particular set to a particular cluster or server; that means that every statistic added to the set must have its owner path point to an element within the cluster/server or the cluster/server itself.

Example:
 AgiAdmStatSet set1 = AgAdmin.getStatSet("/http://abc:8080");
 AgiAdmStatSet set2 = AgAdmin.getStatSet("/def:8080");
 AgiAdmStatSet set3 = AgAdmin.getStatSet("/ghi");
 AgiAdmStatSet set4 = AgAdmin.getStatSet("/http://abc:8080/http://myserver:80");
 AgiAdmStatSet set5 = AgAdmin.getStatSet("/def:8080/klm:90");
 

getStatSetFromStream

public static AgiAdmStatSet getStatSetFromStream(InputStream in)
                                          throws AgoUnrecoverableSystemException,
                                                 AgoSecurityException,
                                                 IOException
Instantiate a statistics set object.
Parameters:
in - the input stream to read the statistics set from
Usage:
The spec ties a particular set to a particular cluster or server; that means that every statistic mentioned in the set description must have its owner path point to an element within the cluster/server or the cluster/server itself.

You cannnot specify elements whose paths point to different clusters/servers within the same set.


getStatSetFromFile

public static AgiAdmStatSet getStatSetFromFile(File file)
                                        throws AgoUnrecoverableSystemException,
                                               AgoSecurityException,
                                               FileNotFoundException,
                                               IOException
Instantiate a statistics set object.
Parameters:
file - the file to read the statistics set from
Usage:
The spec ties a particular set to a particular cluster or server; that means that every statistic mentioned in the set description must have its owner path point to an element within the cluster/server or the cluster/server itself.

You cannot specify elements whose paths point to different clusters/servers within the same set.


SilverStream
Application Server 3.5