version 1.5, 2003/03/11 21:26:54
|
version 1.13, 2006/01/30 16:17:58
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
|
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
|
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
// Author: Dong Xiang, EMC Corporation (xiang_dong@emc.com) |
// | // |
// Modified By: |
// Modified By: David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3604 |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#define Pegasus_Listener_h | #define Pegasus_Listener_h |
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/Exception.h> |
|
#include <Pegasus/Listener/Linkage.h> | #include <Pegasus/Listener/Linkage.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
struct ListenerRep; |
class SSLContext; |
|
class CIMIndicationConsumer; |
| |
class Monitor; |
|
class CIMExportRequestDispatcher; |
|
class CIMExportResponseEncoder; |
|
class CIMExportRequestDecoder; |
|
class HTTPAcceptor; |
|
| |
|
/** CIMListener provides the interfaces that allows CIMListeners to be |
|
created and managed. CIMListeners are the receivers for cim/xml indications. |
|
ATTN: KS needs to be completed.TBD |
|
*/ |
class PEGASUS_LISTENER_LINKAGE CIMListener | class PEGASUS_LISTENER_LINKAGE CIMListener |
{ | { |
public: | public: |
|
/** |
|
* Constructs a CIMListener object. |
|
* |
|
* @param portNumber the specified socket port the listener will listen to |
|
* @param sslContext the specifed SSL context |
|
*/ |
|
CIMListener(Uint32 portNumber, SSLContext* sslContext=NULL); |
| |
enum Protocol { PROPRIETARY, STANDARD }; |
/** |
|
* Destructor of a CIMLIstener object. |
/** Constructor - Creates a CIMListener object. |
*/ |
The CIM Listener objects establishes a repository object, |
|
a dispatcher object, and creates a channnel factory and |
|
acceptor for the Listener. |
|
@param monitor monitor object for the server. |
|
@param rootPath Directory path to the repository. |
|
*/ |
|
|
|
CIMListener( |
|
Monitor* monitor, |
|
const String& rootPath, |
|
Boolean dynamicReg, |
|
Boolean staticConsumers, |
|
Boolean persistence, |
|
Uint32 portNumber); |
|
|
|
~CIMListener(); | ~CIMListener(); |
| |
/** bind Binds the port address to the Listener. |
/** |
@param address char* to the port address for TCP. |
* Returns the socket port number |
@exception - This function may receive exceptions from |
* |
Channel specific subfunctions. |
* @return the socket port number. |
*/ | */ |
void bind(); |
Uint32 getPortNumber() const; |
| |
/** runForever Main runloop for the server. |
/** |
|
* Returns the SSL context |
|
* |
|
* @return the SSL context. |
*/ | */ |
void runForever(); |
SSLContext* getSSLContext() const; |
| |
/** Call to gracefully shutdown the server. The server connection socket |
/** |
will be closed to disable new connections from clients. |
* Sets the SSL context |
|
* |
|
* @param the SSL context. |
*/ | */ |
void stopClientConnection(); |
void setSSLContext(SSLContext* sslContext); |
| |
/** Call to gracefully shutdown the server. It is called when the server |
/** |
has been stopped and is ready to be shutdown. Next time runForever() |
* Starts for listening. |
is called, the server shuts down. |
|
*/ | */ |
void shutdown(); |
void start(); |
| |
/** Return true if the server has shutdown, false otherwise. |
/** |
|
* Stops listening |
*/ | */ |
Boolean terminated() { return _dieNow; }; |
void stop(); |
| |
/** Call to resume the sever. |
/** |
|
* Returns if the listener is active |
|
* |
|
* @return true if the listener is active; |
|
* false otherwise. |
*/ | */ |
void resume(); |
Boolean isAlive() const; |
|
|
Uint32 getOutstandingRequestCount(); |
|
|
|
private: |
|
| |
Boolean _dieNow; |
/** |
|
* Adds a CIMIndicationConsumer to the listener |
String _rootPath; |
* |
String _repositoryRootPath; |
* @param consumer the CIMIndicationConsumer to add. |
|
* @return true if the indication consumer has been added successfully |
Boolean _dynamicReg; |
* false otherwise. |
Boolean _staticConsumers; |
*/ |
Boolean _persistence; |
Boolean addConsumer(CIMIndicationConsumer* consumer); |
| |
Monitor* _monitor; |
/** |
|
* Removes a CIMIndicationConsumer from the listener. |
|
* |
|
* @param the CIMIndicationConsumer to remove. |
|
* @return true if the indication consumer has been removed successfully |
|
* false otherwise. |
|
*/ |
|
Boolean removeConsumer(CIMIndicationConsumer* consumer); |
| |
CIMExportRequestDispatcher* _cimExportRequestDispatcher; |
private: |
CIMExportResponseEncoder* _cimExportResponseEncoder; |
/* |
CIMExportRequestDecoder* _cimExportRequestDecoder; |
* Copy constructor - not implemented |
|
*/ |
|
CIMListener(const CIMListener &); |
| |
HTTPAcceptor* _acceptor; |
/* |
|
* Assignment operator - not implemented |
|
*/ |
|
CIMListener &operator=(const CIMListener &); |
| |
Uint32 _portNumber; |
/* |
|
* rep object |
|
*/ |
|
void* _rep; |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |