cern.cmw.adm
Class ServerAdmin

java.lang.Object
  extended by cern.cmw.adm.ServerAdmin

public class ServerAdmin
extends Object

A wrapper class for the admin::ServerAdmin interface.


Constructor Summary
ServerAdmin(String name)
          Constructs a ServerAdmin object for the specified server.
 
Method Summary
static boolean cacheEnabled()
           
 String command(String operation, Data params)
          A wrapper function for admin::ServerAdmin::Command.
static void disableCache()
           
static void enableCache()
           
 Data getConfiguration()
          Returns the server configuration properties in a Data object.
 Data getDetailedState()
          Returns the detailed state of the server.
 cern.cmw.corba.admin.ServerAdminPackage.DetailedStatus[] getDetailedStatus()
          Returns the detailed status of the server.
 LoggerInfo[] getLoggerInfos()
          Returns information on all message loggers in the server.
 String getLogType()
          Returns the identifier of the logging mechanism used by message loggers in the server.
 ServerInformation getServerInformation()
          Returns the static server info.
 Data getState()
          Returns the server state data.
 int getStatus()
          Returns the general status of the server.
 void kill(String password)
          A wrapper function for admin::ServerAdmin::kill_server.
static void main(String[] args)
          For tests.
 int restart(String password)
          A wrapper function for admin::ServerAdmin::restart_server.
 void setLogLevel(String logger, int level)
          Sets the log level in the specified logger.
 void setLogLevels(int level)
          Sets the log level in all loggers in the server.
static void setTimeout(int timeout)
           
 void shutdown(String password)
          A wrapper function for admin::ServerAdmin::shutdown_server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerAdmin

public ServerAdmin(String name)
            throws BadParameter,
                   NoConnection,
                   InternalException
Constructs a ServerAdmin object for the specified server.

Throws:
BadParameter - indicates that the server does not implement the ServerAdmin interface
NoConnection - thrown if the server cannot be located, or is down or unreachable
InternalException - thrown if the CORBA Naming Service cannot be resolved
Method Detail

enableCache

public static void enableCache()

disableCache

public static void disableCache()

cacheEnabled

public static boolean cacheEnabled()

setTimeout

public static void setTimeout(int timeout)
                       throws InternalException
Throws:
InternalException

getServerInformation

public ServerInformation getServerInformation()
Returns the static server info.

See Also:
admin::ServerAdmin::getServerInformation

getStatus

public int getStatus()
Returns the general status of the server.

See Also:
Status

getDetailedStatus

public cern.cmw.corba.admin.ServerAdminPackage.DetailedStatus[] getDetailedStatus()
Returns the detailed status of the server.

See Also:
DetailedStatus

getState

public Data getState()
Returns the server state data.

See Also:
admin::ServerAdmin::getState

getDetailedState

public Data getDetailedState()
Returns the detailed state of the server.

See Also:
admin::ServerAdmin::getDetailedState

getConfiguration

public Data getConfiguration()
Returns the server configuration properties in a Data object.

See Also:
admin::ServerAdmin::getServerConfig

getLoggerInfos

public LoggerInfo[] getLoggerInfos()
Returns information on all message loggers in the server.

See Also:
admin::ServerAdmin::getLoggerInfos

getLogType

public String getLogType()
                  throws NoConnection
Returns the identifier of the logging mechanism used by message loggers in the server.

Throws:
NoConnection
See Also:
admin::ServerAdmin::getLogType

setLogLevel

public void setLogLevel(String logger,
                        int level)
Sets the log level in the specified logger.

See Also:
LogLevel, admin::ServerAdmin::setLogLevel

setLogLevels

public void setLogLevels(int level)
Sets the log level in all loggers in the server.

See Also:
LogLevel, admin::ServerAdmin::setLogLevels

shutdown

public void shutdown(String password)
A wrapper function for admin::ServerAdmin::shutdown_server.


restart

public int restart(String password)
A wrapper function for admin::ServerAdmin::restart_server.


kill

public void kill(String password)
A wrapper function for admin::ServerAdmin::kill_server.


command

public String command(String operation,
                      Data params)
A wrapper function for admin::ServerAdmin::Command.


main

public static void main(String[] args)
                 throws IOException
For tests. Accepts text commands from System.in and prints on System.out requested information on a remote server. The server name must be specified as the first argument in the command line. For example:
> java cern.cmw.adm.ServerAdmin mtgAll
Commands:
   help     - prints this message
   info     - prints static info about the server
   status   - prints current status of the server
   state    - prints the server state variables
   config   - prints the server config properties
   clients  - prints info about clients connected to the server
   logtype  - prints logging type identifier
   loggers  - prints list of all loggers available in the server
   levels   - sets specified log level in all loggers
              arguments: 
   level    - sets specified level in specified logger
              arguments:  
   quit     - terminates this application
=> info
host ......... dmcrpls
OS ........... LynxOS 4.0.0 PowerPC
user ......... root
up since ..... 10:08:35 16/03/04
process ID ... 37
=> config
cmw.rda.server.timoTwoway = 10000
cmw.rda.server.timoOneway = 1000
cmw.names = pslxmcr:5020
=> clients
1 client(s)

host ......... abpcl30
user ......... trofimov
OS ........... Linux 2.4.20-30.7.cern
process ID ... UNKNOWN
connected .... 10:02:30 26/03/04

=> status
GREEN
=> quit

Throws:
IOException


Copyright © 2007 CERN. All Rights Reserved.