Public Member Functions | Static Public Member Functions

com.cosylab.acs.maci.plug.ManagerProxyImpl Class Reference

Inherits si::ijs::maci::ManagerPOA.

List of all members.

Public Member Functions

 ManagerProxyImpl (Manager manager, Logger logger)
boolean ping ()
String domain_name ()
ContainerInfo[] get_container_info (int id, int[] h, String name_wc) throws NoPermissionEx
ClientInfo[] get_client_info (int id, int[] h, String name_wc) throws NoPermissionEx
ComponentInfo[] get_component_info (int id, int[] h, String name_wc, String type_wc, boolean active_only) throws NoPermissionEx
Object get_component (int id, String component_url, boolean activate) throws NoPermissionEx, CannotGetComponentEx, ComponentNotAlreadyActivatedEx, ComponentConfigurationNotFoundEx
Object get_component_non_sticky (int id, String component_url) throws NoPermissionEx, CannotGetComponentEx, ComponentNotAlreadyActivatedEx
ClientInfo login (Client reference) throws NoPermissionEx
void logout (int id) throws NoPermissionEx
int register_component (int id, String component_url, String type, Object component) throws NoPermissionEx, CannotRegisterComponentEx
void make_component_immortal (int id, String component_url, boolean immortal_state) throws NoPermissionEx, ComponentNotAlreadyActivatedEx
void release_component_async (int id, String component_url, CBlong callback, CBDescIn desc) throws NoPermissionEx
int release_component (int id, String component_url) throws CannotDeactivateComponentEx, ComponentDeactivationUncleanEx, ComponentDeactivationFailedEx, NoPermissionEx
int force_release_component (int id, String component_url) throws NoPermissionEx
void shutdown (int id, int containers)
void unregister_component (int id, int h) throws NoPermissionEx
ComponentInfo get_default_component (int id, String type) throws NoPermissionEx, NoDefaultComponentEx, CannotGetComponentEx
ComponentInfo get_dynamic_component (int id, si.ijs.maci.ComponentSpec c, boolean mark_as_default) throws NoPermissionEx, IncompleteComponentSpecEx, InvalidComponentSpecEx, ComponentSpecIncompatibleWithActiveComponentEx, CannotGetComponentEx
ComponentInfo get_collocated_component (int id, si.ijs.maci.ComponentSpec c, boolean mark_as_default, String target_component) throws NoPermissionEx, IncompleteComponentSpecEx, InvalidComponentSpecEx, ComponentSpecIncompatibleWithActiveComponentEx, CannotGetComponentEx
Object get_service (int id, String service_url, boolean activate) throws NoPermissionEx, CannotGetComponentEx
Object restart_component (int id, String component_url) throws NoPermissionEx
void shutdown_container (int id, String container_name, int action) throws NoPermissionEx
LogLevels get_default_logLevels ()
void set_default_logLevels (LogLevels levels) throws IllegalArgumentEx
String[] get_logger_names ()
LogLevels get_logLevels (String logger_name)
void set_logLevels (String logger_name, LogLevels levels) throws IllegalArgumentEx
void refresh_logging_config ()
int getNumberOfPendingRequests ()
String toString ()

Static Public Member Functions

static int mapAccessRights (int accessRights)

Detailed Description

Manager is the central point of interaction between the components and the clients that request MACI services. A Manager is responsible for managing a domain. Manager has the following functionality:

This class implements the IDL interface of Manager and acts like a proxy, by delegating all requests to an implementation of the com.cosylab.acs.maci.Manager interface.

Todo:
Now the Manager interface does not use exceptions in many methods when there is a failure, but it returns a nil object. This class will have to be refactored when the Manager implementation (only used internally) will be changed.
Author:
Matej Sekoranja (matej.sekoranja@cosylab.com)
Version:
@VERSION@

Constructor & Destructor Documentation

com.cosylab.acs.maci.plug.ManagerProxyImpl.ManagerProxyImpl ( Manager  manager,
Logger  logger 
)

Construct a new Manager which will manager implementation.

Parameters:
manager implementation of the manager, non-null.
logger logger.

Member Function Documentation

String com.cosylab.acs.maci.plug.ManagerProxyImpl.domain_name (  ) 

Return the fully qualified name of the domain, e.g., "antenna1.alma.nrao".

Returns:
the fully qualified name of the domain

References com.cosylab.acs.maci.Manager.getDomain().

int com.cosylab.acs.maci.plug.ManagerProxyImpl.force_release_component ( int  id,
String  component_url 
) throws NoPermissionEx

Forcefully release a Component.

Parameters:
id Identification of the caller.
component_url The CURL of the Component to be released.
Returns:
Number of clients that are still using the Component after the operation completed. This is a useful debugging tool.

References com.cosylab.acs.maci.Manager.forceReleaseComponent().

ClientInfo [] com.cosylab.acs.maci.plug.ManagerProxyImpl.get_client_info ( int  id,
int[]  h,
String  name_wc 
) throws NoPermissionEx

Get all the information that the Manager has about its known clients. To invoke this method, the caller must have INTROSPECT_MANAGER access rights, or it must be the object whose info it is requesting. Calling this function does not affect the internal state of the Manager.

Parameters:
id Identification of the caller.
h Handles of the clients whose information is requested. If this is an empty sequence, the name_wc parameter is used.
name_wc Wildcard that the clients's name must match in order for its information to be returned.
Returns:
A sequence of ClientInfo structures containing the entire Manager's knowledge about the containers. If access is denied to a subset of objects, the handles to those objects are set to 0.

References com.cosylab.acs.maci.Manager.getClientInfo(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights().

ComponentInfo com.cosylab.acs.maci.plug.ManagerProxyImpl.get_collocated_component ( int  id,
si.ijs.maci.ComponentSpec  c,
boolean  mark_as_default,
String  target_component 
) throws NoPermissionEx, IncompleteComponentSpecEx, InvalidComponentSpecEx, ComponentSpecIncompatibleWithActiveComponentEx, CannotGetComponentEx

Activation of an co-deployed component.

Parameters:
id identification of the caller.
c component to be obtained.
mark_as_default mark component as default component of its type.
target_component target co-deployed component.
Returns:
ComponentInfo of requested co-deployed component.

si.ijs.maci.COMPONENT_SPEC_ANY -> ComponentSpec.COMPSPEC_ANY

References com.cosylab.acs.maci.Manager.getCollocatedComponent(), com.cosylab.acs.maci.ComponentInfo.getComponent(), com.cosylab.acs.maci.Component.getObject(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights().

Object com.cosylab.acs.maci.plug.ManagerProxyImpl.get_component ( int  id,
String  component_url,
boolean  activate 
) throws NoPermissionEx, CannotGetComponentEx, ComponentNotAlreadyActivatedEx, ComponentConfigurationNotFoundEx

Get a Component, activating it if necessary. The client represented by id (the handle) must have adequate access rights to access the Component. This is untrue of components: components always have unlimited access rights to other components.

Parameters:
id Identification of the caller. If this is an invalid handle, or if the caller does not have enough access rights, a maciErrType.NoPermissionEx exception is raised.
component_url CURL of the Component whose reference is to be retrieved.
activate True if the Component is to be activated in case it does not exist. If set to False, and the Component does not exist, a nil reference is returned and status is set to COMPONENT_NOT_ACTIVATED.
Returns:
Reference to the Component. If the Component could not be activated, an exception is throw.

Todo:
GCH 2006.10.11 notice that we can get a ComponentStatus != COMPONENT_ACTIVATED also if the component is properly returned. There is an incoherence here in the interfaces that shall be resolved. We have to cleanup here or go back to return a status to the caller. My point is: the caller is interested in more than just getting the component of an indication of failure if not? Is it interesting to know that the component was not activated, presumably because already active?

References com.cosylab.acs.maci.Manager.getComponent(), and com.cosylab.acs.maci.Component.getObject().

ComponentInfo [] com.cosylab.acs.maci.plug.ManagerProxyImpl.get_component_info ( int  id,
int[]  h,
String  name_wc,
String  type_wc,
boolean  active_only 
) throws NoPermissionEx

Get all the information that the Manager has about components. To invoke this method, the caller must have INTROSPECT_MANAGER access rights, or it must have adequate privileges to access the Component (the same as with the get_component method). Information about all components is returned, unless the active_only parameter is set to true, in which case only information about those components that are currently registered with the Manager and activated is returned. Calling this function does not affect the internal state of the Manager.

Parameters:
id Identification of the caller.
h Handles of the components whose information is requested. If this is an empty sequence, the name_wc and type_wc parameters are used.
name_wc Wildcard that the Component's name must match in order for its information to be returned.
type_wc Wildcard that the Component's type must match in order for its information to be returned.
active_only 
Returns:
A sequence of ComponentInfo structures containing the entire Manager's knowledge about the components. If access is denied to a subset of objects, the handles to those objects are set to 0.

References com.cosylab.acs.maci.Manager.getComponentInfo(), com.cosylab.acs.maci.ComponentInfo.getInterfaces(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights().

Object com.cosylab.acs.maci.plug.ManagerProxyImpl.get_component_non_sticky ( int  id,
String  component_url 
) throws NoPermissionEx, CannotGetComponentEx, ComponentNotAlreadyActivatedEx

Get a component, do not activate it and also do not do any reference counting. The client represented by id (the handle) must have adequate access rights to access the Component. This is untrue of components: components always have unlimited access rights to other components.

Parameters:
id Identification of the caller. If this is an invalid handle, or if the caller does not have enough access rights, a maciErrType.NoPermissionEx exception is raised.
component_url CURL of the Component whose reference is to be retrieved.
Returns:
Reference to the Component.

References com.cosylab.acs.maci.Manager.getComponentNonSticky(), and com.cosylab.acs.maci.Component.getObject().

ContainerInfo [] com.cosylab.acs.maci.plug.ManagerProxyImpl.get_container_info ( int  id,
int[]  h,
String  name_wc 
) throws NoPermissionEx

Get all the information that the Manager has about its known Containers. To invoke this method, the caller must have INTROSPECT_MANAGER access rights, or it must be the object whose info it is requesting. Calling this function does not affect the internal state of the Manager.

Parameters:
id Identification of the caller.
h Handles of the containers whose information is requested. If this is an empty sequence, the name_wc parameter is used.
name_wc Wildcard that the container's name must match in order for its information to be returned.
Returns:
A sequence of ContainerInfo structures containing the entire Manager's knowledge about the containers. If access is denied to a subset of objects, the handles to those objects are set to 0.

References com.cosylab.acs.maci.Manager.getContainerInfo().

ComponentInfo com.cosylab.acs.maci.plug.ManagerProxyImpl.get_default_component ( int  id,
String  type 
) throws NoPermissionEx, NoDefaultComponentEx, CannotGetComponentEx

Returns the default component of specific type.

Parameters:
id identification of the caller.
type component type, IDL ID.
Returns:
ComponentInfo of requested component.

References com.cosylab.acs.maci.ComponentInfo.getComponent(), com.cosylab.acs.maci.Manager.getDefaultComponent(), com.cosylab.acs.maci.Component.getObject(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights().

LogLevels com.cosylab.acs.maci.plug.ManagerProxyImpl.get_default_logLevels (  ) 

Gets the log levels of the default logging configuration. These levels are used by all loggers that have not been configured individually.

References alma.acs.logging.config.LogConfig.getDefaultMinLogLevel(), and alma.acs.logging.config.LogConfig.getDefaultMinLogLevelLocal().

ComponentInfo com.cosylab.acs.maci.plug.ManagerProxyImpl.get_dynamic_component ( int  id,
si.ijs.maci.ComponentSpec  c,
boolean  mark_as_default 
) throws NoPermissionEx, IncompleteComponentSpecEx, InvalidComponentSpecEx, ComponentSpecIncompatibleWithActiveComponentEx, CannotGetComponentEx

Activation of an dynamic component.

Parameters:
id identification of the caller.
c component to be obtained.
mark_as_default mark component as default component of its type.
Returns:
ComponentInfo of requested component.

References com.cosylab.acs.maci.ComponentInfo.getComponent(), com.cosylab.acs.maci.Manager.getDynamicComponent(), com.cosylab.acs.maci.Component.getObject(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights().

String [] com.cosylab.acs.maci.plug.ManagerProxyImpl.get_logger_names (  ) 

Gets the names of all loggers, to allow configuring their levels individually. The names are those that appear in the log records in the field "SourceObject". This includes the container logger, ORB logger, component loggers, and (only C++) GlobalLogger.

References alma.acs.logging.config.LogConfig.getLoggerNames().

LogLevels com.cosylab.acs.maci.plug.ManagerProxyImpl.get_logLevels ( String  logger_name  ) 

Gets log levels for a particular named logger. If the returned field LogLevels.useDefault is true, then the logger uses the default levels, see get_default_logLevels(); otherwise the returned local and remote levels apply.

References alma.acs.logging.config.LogConfig.getNamedLoggerConfig(), and alma.acs.logging.config.LogConfig.hasCustomConfig().

Object com.cosylab.acs.maci.plug.ManagerProxyImpl.get_service ( int  id,
String  service_url,
boolean  activate 
) throws NoPermissionEx, CannotGetComponentEx

Get a service, activating it if necessary (components). The client represented by id (the handle) must have adequate access rights to access the service. NOTE: a component is also a service, i.e. a service activated by a container.

Parameters:
id Identification of the caller. If this is an invalid handle, or if the caller does not have enough access rights, a maciErrType.NoPermissionEx exception is raised.
service_url CURL of the service whose reference is to be retrieved.
activate True if the component is to be activated in case it does not exist. If set to False, and the Component does not exist, a nil reference is returned and status is set to COMPONENT_NOT_ACTIVATED.
status Status of the request. One of COMPONENT_ACTIVATED, COMPONENT_DOES_NO_EXIST and COMPONENT_NOT_ACTIVATED.
Returns:
Reference to the service. If the service could not be obtained, a nil reference is returned, and the status contains an error code detailing the cause of failure (one of the COMPONENT_* constants).
See also:
get_component

References com.cosylab.acs.maci.Component.getObject(), and com.cosylab.acs.maci.Manager.getService().

int com.cosylab.acs.maci.plug.ManagerProxyImpl.getNumberOfPendingRequests (  ) 

Returns number of pending requests.

Returns:
number of pending requests.

Referenced by com.cosylab.acs.maci.manager.app.ManagerEngine.getNumberOfPendingRequests().

ClientInfo com.cosylab.acs.maci.plug.ManagerProxyImpl.login ( Client  reference  )  throws NoPermissionEx

Login to MACI. Containers, Clients and Administrative clients call this function first to identify themselves with the Manager. The Manager authenticates them (through the authenticate function), and assigns them access rights and a handle, through which they will identify themselves at subsequent calls to the Manager.

Parameters:
reference A reference to the Client.
Returns:
A ClientInfo structure with handle (h) and access fields filled-in. If the client with this name did not logout prior to calling login, the components sequence in ClientInfo contains the handles of all components that the client was using. (For Containers, the components sequence contains handles of all components previously hosted by the Container.)

References com.cosylab.acs.maci.Manager.login(), and com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.logout ( int  id  )  throws NoPermissionEx

Logout from MACI.

Parameters:
id Handle of the Client that is logging out

References com.cosylab.acs.maci.Manager.logout().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.make_component_immortal ( int  id,
String  component_url,
boolean  immortal_state 
) throws NoPermissionEx, ComponentNotAlreadyActivatedEx

Change mortality state of an component. Compnent must be already active, otherwise ComponentNotAlreadyActivatedEx exception will be thrown. The caller must be an owner of an component or have administator rights, otherwise NoPermissionEx exception will be thrown.

Parameters:
id Identification of the caller. The caller must be an owner of an component or have administator rights.
component_url The CURL of the component whose mortality to change.
immortal_state New mortality state.

References com.cosylab.acs.maci.Manager.makeComponentImmortal().

static int com.cosylab.acs.maci.plug.ManagerProxyImpl.mapAccessRights ( int  accessRights  )  [static]
boolean com.cosylab.acs.maci.plug.ManagerProxyImpl.ping (  ) 

Ping method so that clients can feel good about having an alive manager.

See also:
si.ijs.maci.ManagerOperations.ping()
void com.cosylab.acs.maci.plug.ManagerProxyImpl.refresh_logging_config (  ) 

Commands the container or manager to read in again the logging configuration from the CDB and to reconfigure the loggers accordingly. This allows for persistent changes in the logging configuration to become effective, and also for changes of more advanced parameters.

References alma.acs.logging.config.LogConfig.initialize().

int com.cosylab.acs.maci.plug.ManagerProxyImpl.register_component ( int  id,
String  component_url,
String  type,
Object  component 
) throws NoPermissionEx, CannotRegisterComponentEx

Register a CORBA object as a Component, assigning it a CURL and making it accessible through the Manager. The Component is treated as an immortal Component.

Parameters:
id Identification of the caller. The caller must have the REGISTER_component access right to perform this operation.
component_url CURL that will be assigned to the object. The CURL must be in the Manager's domain, otherwise a fundamental property of domains that one computer belongs to only one domain would be too easy to violate.
type Type of the Component
Component Reference to the CORBA object (Component).
Returns:
Returns the handle of the newly created Component.

References com.cosylab.acs.maci.Manager.registerComponent().

int com.cosylab.acs.maci.plug.ManagerProxyImpl.release_component ( int  id,
String  component_url 
) throws CannotDeactivateComponentEx, ComponentDeactivationUncleanEx, ComponentDeactivationFailedEx, NoPermissionEx

Release a Component. In order for this operation to be possible, the caller represented by the id must have previously successfully requested the Component via a call to get_component. Releasing a Component more times than requesting it should be avoided, but it produces no errors.

Parameters:
id Identification of the caller. The caller must have previously gotten the Component through get_component.
component_url The CURL of the Component to be released.
Returns:
Number of clients that are still using the Component after the operation completed. This is a useful debugging tool.

References com.cosylab.acs.maci.Manager.releaseComponent().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.release_component_async ( int  id,
String  component_url,
CBlong  callback,
CBDescIn  desc 
) throws NoPermissionEx
Object com.cosylab.acs.maci.plug.ManagerProxyImpl.restart_component ( int  id,
String  component_url 
) throws NoPermissionEx

Restarts an component.

Parameters:
id identification of the caller. Called has to be an owner of the component.
component_url CURL of the component to be restarted.
Returns:
CORBA reference of the restarted component, null if it fails.

References com.cosylab.acs.maci.Component.getObject(), and com.cosylab.acs.maci.Manager.restartComponent().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.set_default_logLevels ( LogLevels  levels  )  throws IllegalArgumentEx

Sets the log levels of the default logging configuration. These levels are used by all loggers that have not been configured individually.

References alma.acs.logging.config.LogConfig.setDefaultMinLogLevel(), and alma.acs.logging.config.LogConfig.setDefaultMinLogLevelLocal().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.set_logLevels ( String  logger_name,
LogLevels  levels 
) throws IllegalArgumentEx

Sets log levels for a particular named logger. If levels.useDefault is true, then the logger will be reset to using default levels; otherwise it will use the supplied local and remote levels.

References alma.acs.logging.config.LogConfig.clearNamedLoggerConfig(), and alma.acs.logging.config.LogConfig.setNamedLoggerConfig().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.shutdown ( int  id,
int  containers 
)

Shutdown the Manager. Warning: This call will also deactivate all components active in the system, including startup and immortal components.

Parameters:
id Identification of the caller. The caller must have the SHUTDOWN_SYSTEM access right.
containers The code to send to shutdown methods of all Containers. If 0, the Container's shutdown methods are not called.

References com.cosylab.acs.maci.Manager.shutdown().

void com.cosylab.acs.maci.plug.ManagerProxyImpl.shutdown_container ( int  id,
String  container_name,
int  action 
) throws NoPermissionEx

Shutdown a container.

Parameters:
id identification of the caller. Called has to be an owner of the component.
container_name name of the container to shutdown.
action The code to send to shutdown method of the container. If 0, the Container's disconnect methods is called instead.

References com.cosylab.acs.maci.Manager.shutdownContainer().

String com.cosylab.acs.maci.plug.ManagerProxyImpl.toString (  ) 

Returns a single-line rendition of this instance into text.

Returns:
internal state of this instance
void com.cosylab.acs.maci.plug.ManagerProxyImpl.unregister_component ( int  id,
int  h 
) throws NoPermissionEx

Unregister a Component from the Manager.

Parameters:
id Identification of the caller. The caller must have the REGISTER_COMPONENT access right to perform this operation.
h Component's handle. The Component must have been previously registered through the call to register_component. If there are clients still using this Component, a components_unavailable notification is issued to all of them, and the Component is unregistered.

References com.cosylab.acs.maci.Manager.unregisterComponent().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties