maci::SimpleClient Class Reference
#include <maciSimpleClient.h>
List of all members.
Public Member Functions |
| SimpleClient () |
virtual | ~SimpleClient () |
int | destroy () |
int | initCORBA (int argc, char *argv[]) |
CORBA::ORB_ptr | getORB () |
int | doneCORBA () |
int | login () |
int | logout () |
int | init (int argc, char *argv[]) |
int | run (ACE_Time_Value &tv) |
int | run () |
maci::Manager_ptr | manager () |
maci::Handle | handle () |
CORBA::Object_ptr | getComponent (const char *name, const char *domain, bool activate) |
CORBA::Object_ptr | get_object (const char *name, const char *domain, bool activate) |
template<class T > |
T * | getComponent (const char *name, const char *domain, bool activate) |
CORBA::Object * | getDynamicComponent (maci::ComponentSpec compSpec, bool markAsDefault) |
template<class T > |
T * | getDynamicComponent (maci::ComponentSpec compSpec, bool markAsDefault) |
template<class T > |
ComponentSmartPtr< T > | getComponentSmartPtr (const char *name, const char *domain, bool activate) |
template<class T > |
ComponentSmartPtr< T > | getDynamicComponentSmartPtr (maci::ComponentSpec compSpec, bool markAsDefault) |
template<class T > |
T * | get_object (const char *name, const char *domain, bool activate) |
CORBA::Object * | getComponentNonSticky (const char *name) |
template<class T > |
T * | getComponentNonSticky (const char *name) |
template<class T > |
ComponentSmartPtr< T > | getComponentNonStickySmartPtr (const char *name) |
long | releaseComponent (const char *name) |
virtual char * | name () |
virtual void | disconnect () |
virtual
::maci::AuthenticationData * | authenticate (::maci::ExecutionId execution_id, const char *question) |
virtual void | message (CORBA::Short type, const char *message) |
virtual void | taggedmessage (CORBA::Short type, CORBA::Short tag, const char *message) |
virtual void | components_available (const maci::ComponentInfoSeq &cobs) |
virtual void | components_unavailable (const maci::stringSeq &cob_names) |
virtual CORBA::Boolean | ping () |
Static Public Member Functions |
static void | initThread (const char *threadName) |
static void | doneThread () |
static LoggingProxy * | getLoggerProxy () |
static const char * | getProcessName () |
Private Attributes |
maci::Manager_var | m_manager |
| Reference to the Manager.
|
maci::Handle | m_handle |
| Handle.
|
bool | m_initialized |
| Initialization status.
|
bool | m_loggedin |
| Manager Logging status.
|
PortableServer::POA_var | m_poaRoot |
| Root POA.
|
PortableServer::POA_var | m_poaPersistent |
| Persistent POA.
|
PortableServer::POA_var | m_poaTransient |
| Persistent POA.
|
CORBA::ORB_var | m_orb |
| The CORBA ORB.
|
maci::SimpleClientThreadHook | m_simpleClientThreadHook |
| threads' standard start-up hook
|
maci::ExecutionId | m_executionId |
| execution id
|
ACS::Time | m_startTime |
| client start time
|
Static Private Attributes |
static LoggingProxy * | m_logger |
| Logger.
|
static ACE_CString | m_processName |
| The name of the process.
|
Detailed Description
The class SimpleClient is the base class for a ACS C++ client. It hides most of the CORBA interface to the implementation of the real client.
Constructor & Destructor Documentation
maci::SimpleClient::SimpleClient |
( |
|
) |
|
virtual maci::SimpleClient::~SimpleClient |
( |
|
) |
[virtual] |
Member Function Documentation
virtual ::maci::AuthenticationData* maci::SimpleClient::authenticate |
( |
::maci::ExecutionId |
execution_id, |
|
|
const char * |
question | |
|
) |
| | |
Authentication method. Method authenticate is the challenge issued to the client after it tries to login. The login will be successful if the client's authenticate() produces the expected result. Only in this case will the Manager's login method return a valid handle, which the client will later use as the id parameter with all calls to the Manager.
- Parameters:
-
| The | question posed by the Manager. |
- Returns:
- Answer to the question. The first character of the answer identifies the type of the client:
A
An container (implements the Container interface) C
A client (implements the Client interface) S
A supervisor (implements the Administrator interface)
virtual void maci::SimpleClient::components_available |
( |
const maci::ComponentInfoSeq & |
cobs |
) |
[virtual] |
Notify client about the change (availability) of the components currently in use by this client. For administrative clients, notification is issued for the change of availability of any component in the domain.
- Parameters:
-
| cobs | A sequence of ComponentInfo structures identifying the affected components. Regular clients receive the name, the type, the handle and the reference of the newly activated component. Administrative clients also receive the handle of the Container where the component was activated. |
virtual void maci::SimpleClient::components_unavailable |
( |
const maci::stringSeq & |
cob_names |
) |
[virtual] |
Notify client that some of the components currently in use by client have become unavailable.
- Parameters:
-
| cob_names | CURLs of the unavailable components |
int maci::SimpleClient::destroy |
( |
|
) |
|
Destroys Client.
- Returns:
- 0 on failure
virtual void maci::SimpleClient::disconnect |
( |
|
) |
[virtual] |
Disconnect notification. The disconnect method is called by the Manager to notify the client that it will be unavailable and that the client should log off.
int maci::SimpleClient::doneCORBA |
( |
|
) |
|
Finalizes CORBA.
- Returns:
- 0 on failure
static void maci::SimpleClient::doneThread |
( |
|
) |
[static] |
template<class T >
T* maci::SimpleClient::get_object |
( |
const char * |
name, |
|
|
const char * |
domain, |
|
|
bool |
activate | |
|
) |
| | [inline] |
It just redirected call to getComponent (template version)
- Deprecated:
- the method is deprecated and will be removed in future version of ACS
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | |
CORBA::Object_ptr maci::SimpleClient::get_object |
( |
const char * |
name, |
|
|
const char * |
domain, |
|
|
bool |
activate | |
|
) |
| | [inline] |
It just redirect call to the getComponent
- Deprecated:
- get_object is deprecated and will be removed in future version of ACS
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | |
template<class T >
T* maci::SimpleClient::getComponent |
( |
const char * |
name, |
|
|
const char * |
domain, |
|
|
bool |
activate | |
|
) |
| | [inline] |
Get a component, activating it if necessary and directly narrows it to the type declared in the template definition. The client must have adequate access rights to access the component. This is untrue of components: NameService, Log, LogFactory, NotifyEventChannelFactory, ArchivingChannel, LoggingChannel, InterfaceRepository, CDB and PDB.
- Parameters:
-
| name | name of the component (e.g. MOUNT1) |
| domain | domain name, 0 for default domain |
| activate | true to activate component, false to leave it in the current state |
- Returns:
- reference to the component.
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | If the component could not be activated For example:
MACI_TEST::MaciTestClass_var maciTestDO = client.getComponent<MACI_TEST::MaciTestClass>(argv[1], 0, true);
|
- See also:
- getComponent()
T * maci::SimpleClient::getComponent |
( |
const char * |
name, |
|
|
const char * |
domain, |
|
|
bool |
activate | |
|
) |
| | [inline] |
Get a component, activating it if necessary. The client must have adequate access rights to access the component. This is untrue of components: NameService, Log, LogFactory, NotifyEventChannelFactory, ArchivingChannel, LoggingChannel, InterfaceRepository, CDB and PDB.
- Parameters:
-
| name | name of the component (e.g. MOUTN1) |
| domain | domain name, 0 for default domain |
| activate | true to activate component, false to leave it in the current state |
- Returns:
- reference to the component.
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | If the component could not be activated |
- See also:
- template<class T> T* getComponent
First creates the CURL, if not already a CURL, and query the Manager for the component
- Todo:
- why here is using get_service and not get_component ?
References ACS_SHORT_LOG, m_handle, m_initialized, manager(), name(), and releaseComponent().
template<class T >
T* maci::SimpleClient::getComponentNonSticky |
( |
const char * |
name |
) |
[inline] |
template version of getComponentNonSticky Returns a non-sticky reference to a component
- Parameters:
-
| name | name (CURL) of the component |
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | |
- Returns:
- reference to the component for details see get_component_non_sticky
T * maci::SimpleClient::getComponentNonSticky |
( |
const char * |
name |
) |
[inline] |
Returns a non-sticky reference to a component
- Parameters:
-
| name | name (CURL) of the component |
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | |
- Returns:
- reference to the component for details see get_component_non_sticky
References ACS_SHORT_LOG, m_handle, m_initialized, manager(), and name().
template<class T >
ComponentSmartPtr< T > maci::SimpleClient::getComponentNonStickySmartPtr |
( |
const char * |
name |
) |
[inline] |
template version of getComponentNonSticky Returns a SmartPointer to a component
- Parameters:
-
| name | name (CURL) of the component |
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | |
- Returns:
- reference to the component for details see get_component_non_sticky
template<class T >
ComponentSmartPtr< T > maci::SimpleClient::getComponentSmartPtr |
( |
const char * |
name, |
|
|
const char * |
domain, |
|
|
bool |
activate | |
|
) |
| | [inline] |
Get a SmartPointer to a component, activating it if necessary and directly narrows it to the type declared in the template definition. The client must have adequate access rights to access the component. This is untrue of components: NameService, Log, LogFactory, NotifyEventChannelFactory, ArchivingChannel, LoggingChannel, InterfaceRepository, CDB and PDB.
- Parameters:
-
| name | name of the component (e.g. MOUNT1) |
| domain | domain name, 0 for default domain |
| activate | true to activate component, false to leave it in the current state |
- Returns:
- Smart Pointer to the component.
- Exceptions:
-
| maciErrType::CannotGetComponentExImpl | If the component could not be activated For example:
ComponentSmartPtr<MACI_TEST::MaciTestClass> maciTestDO = client.getComponentSmartPtr<MACI_TEST::MaciTestClass>(argv[1], 0, true);
|
- See also:
- getComponent()
template<class T >
T* maci::SimpleClient::getDynamicComponent |
( |
maci::ComponentSpec |
compSpec, |
|
|
bool |
markAsDefault | |
|
) |
| | [inline] |
- Exceptions:
-
| maciErrType::NoPermissionExImpl | |
| maciErrType::IncompleteComponentSpecExImpl | |
| maciErrType::InvalidComponentSpecExImpl | |
| maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl | |
| maciErrType::CannotGetComponentExImpl | |
T * maci::SimpleClient::getDynamicComponent |
( |
maci::ComponentSpec |
compSpec, |
|
|
bool |
markAsDefault | |
|
) |
| | [inline] |
- Exceptions:
-
| maciErrType::NoPermissionExImpl | |
| maciErrType::IncompleteComponentSpecExImpl | |
| maciErrType::InvalidComponentSpecExImpl | |
| maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl | |
| maciErrType::CannotGetComponentExImpl | |
References ACS_TRACE, m_handle, and m_manager.
template<class T >
ComponentSmartPtr< T > maci::SimpleClient::getDynamicComponentSmartPtr |
( |
maci::ComponentSpec |
compSpec, |
|
|
bool |
markAsDefault | |
|
) |
| | [inline] |
- Exceptions:
-
| maciErrType::NoPermissionExImpl | |
| maciErrType::IncompleteComponentSpecExImpl | |
| maciErrType::InvalidComponentSpecExImpl | |
| maciErrType::ComponentSpecIncompatibleWithActiveComponentExImpl | |
| maciErrType::CannotGetComponentExImpl | |
static LoggingProxy* maci::SimpleClient::getLoggerProxy |
( |
|
) |
[inline, static] |
Get logging proxy instance
- Returns:
- logging proxy instance
CORBA::ORB_ptr maci::SimpleClient::getORB |
( |
|
) |
|
static const char* maci::SimpleClient::getProcessName |
( |
|
) |
[inline, static] |
Get SimpleClient's proces name
- Returns:
- SimpleClient's proces name
maci::Handle maci::SimpleClient::handle |
( |
|
) |
|
Get handle of the client.
- Returns:
- handle
int maci::SimpleClient::init |
( |
int |
argc, |
|
|
char * |
argv[] | |
|
) |
| | |
The init method logs in to the requested manager. Default is the local manager (if no arguments are given). To specify a remote manager give the parameter -m corbaloc::<host name>="">:<port number>="">/<manager>
example: -m corbaloc::te1.hq.eso.org:xxxx/Manager
- Returns:
- 0 on failure
int maci::SimpleClient::initCORBA |
( |
int |
argc, |
|
|
char * |
argv[] | |
|
) |
| | |
Initializes CORBA.
- Returns:
- 0 on failure
static void maci::SimpleClient::initThread |
( |
const char * |
threadName |
) |
[static] |
int maci::SimpleClient::login |
( |
|
) |
|
Login method Logins client to the manager.
- Returns:
- 0 on failure
int maci::SimpleClient::logout |
( |
|
) |
|
Logout method.
- Returns:
- 0 on failure
maci::Manager_ptr maci::SimpleClient::manager |
( |
|
) |
|
virtual void maci::SimpleClient::message |
( |
CORBA::Short |
type, |
|
|
const char * |
message | |
|
) |
| | [virtual] |
The Manager and administrators use this method for sending textual messages to the client.
- Parameters:
-
| type | Can be either MSG_ERROR or MSG_INFORMATION. |
| message | Contents of the message. The contents are human readable. |
virtual char* maci::SimpleClient::name |
( |
|
) |
[virtual] |
virtual CORBA::Boolean maci::SimpleClient::ping |
( |
|
) |
[virtual] |
Manager pings its clients (both GUI clients, as well as Containers) repeatedly to verify that they still exist. The return value can be either true
, indicating that everything is OK with the client, of false
, indicating that client is malfunctioning. If CORBA::TRANSIENT exception is thrown, the Manager should retry the ping several times, and only then shall the client be assumed to be malfunctioning. If another exception is thrown, the client may be immediately assumed to be malfunctioning. Once the client is found to be malfunctioning, the Manager makes an implicit logout of the client.
- Returns:
true
, indicating that everything is OK with the client, of false
, indicating that client is malfunctioning.
long maci::SimpleClient::releaseComponent |
( |
const char * |
name |
) |
|
Releases the componet.
- Parameters:
-
- Returns:
- Number of clients that are still using the component after the operation completed.
- Exceptions:
-
| maciErrType::CannotReleaseComponentExImpl | when there is a problem |
Referenced by getComponent().
int maci::SimpleClient::run |
( |
|
) |
|
Run the ORB event loop until terminated or shutdown.
- Returns:
- 0 on failure
int maci::SimpleClient::run |
( |
ACE_Time_Value & |
tv |
) |
|
Run the ORB event loop with the specified <tv> time value.
- Parameters:
-
- Returns:
- 0 on failure
virtual void maci::SimpleClient::taggedmessage |
( |
CORBA::Short |
type, |
|
|
CORBA::Short |
tag, |
|
|
const char * |
message | |
|
) |
| | [virtual] |
The Manager and administrators use this method for sending tagged textual messages to the client.
- Parameters:
-
| type | Can be either MSG_ERROR or MSG_INFORMATION. |
| tag | Additional information about the message |
| message | Contents of the message. The contents are human readable. |
Member Data Documentation
threads' standard start-up hook
The documentation for this class was generated from the following file: