version 1.4.6.1, 2002/12/04 17:54:04
|
version 1.17, 2015/06/10 12:36:02
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%LICENSE//////////////////////////////////////////////////////////////// |
// |
|
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
|
// |
|
// Permission is hereby granted, free of charge, to any person obtaining a copy |
|
// of this software and associated documentation files (the "Software"), to |
|
// deal in the Software without restriction, including without limitation the |
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
|
// sell copies of the Software, and to permit persons to whom the Software is |
|
// furnished to do so, subject to the following conditions: |
|
// |
|
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
|
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
|
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
|
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
|
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
|
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
// | // |
//============================================================================== |
// Licensed to The Open Group (TOG) under one or more contributor license |
// |
// agreements. Refer to the OpenPegasusNOTICE.txt file distributed with |
// Author: Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
// this work for additional information regarding copyright ownership. |
// |
// Each contributor licenses this file to you under the OpenPegasus Open |
// Modified By: |
// Source License; you may not use this file except in compliance with the |
|
// License. |
|
// |
|
// Permission is hereby granted, free of charge, to any person obtaining a |
|
// copy of this software and associated documentation files (the "Software"), |
|
// to deal in the Software without restriction, including without limitation |
|
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
|
// and/or sell copies of the Software, and to permit persons to whom the |
|
// Software is furnished to do so, subject to the following conditions: |
|
// |
|
// The above copyright notice and this permission notice shall be included |
|
// in all copies or substantial portions of the Software. |
|
// |
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
|
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
|
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
// |
|
////////////////////////////////////////////////////////////////////////// |
|
// |
|
// Author: Dong Xiang, EMC Corporation (xiang_dong@emc.com) |
|
// |
|
// 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/Common/String.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: |
|
/** |
enum Protocol { PROPRIETARY, STANDARD }; |
* Constructs a CIMListener object. |
|
* |
/** Constructor - Creates a CIMListener object. |
* @param address the specified address to be bound to |
The CIM Listener objects establishes a repository object, |
* @param portNumber the specified socket port the listener will listen to |
a dispatcher object, and creates a channnel factory and |
* @param sslContext the specifed SSL context |
acceptor for the Listener. |
|
@param monitor monitor object for the server. |
|
@param rootPath Directory path to the repository. |
|
*/ | */ |
|
|
CIMListener( | CIMListener( |
Monitor* monitor, |
const String &listenAddress, |
const String& rootPath, |
Uint32 portNumber, |
Boolean dynamicReg, |
SSLContext* sslContext=NULL); |
Boolean staticConsumers, |
|
Boolean persistence, |
/** |
Uint32 portNumber); |
* 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); |
| |
|
/** |
|
* Destructor of a CIMLIstener object. |
|
*/ |
~CIMListener(); | ~CIMListener(); |
| |
/** bind Binds the port address to the Listener. |
/** |
@param address char* to the port address for TCP. |
* Returns the bind address. |
@exception - This function may receive exceptions from |
* |
Channel specific subfunctions. |
* @return the bind address. |
*/ | */ |
void bind(); |
String getListenAddress() const; |
| |
/** runForever Main runloop for the server. |
/** |
|
* Returns the socket port number |
|
* |
|
* @return the socket port number. |
*/ | */ |
void runForever(); |
Uint32 getPortNumber() const; |
| |
/** Call to gracefully shutdown the server. The server connection socket |
/** |
will be closed to disable new connections from clients. |
* Returns the SSL context |
|
* |
|
* @return the SSL context. |
*/ | */ |
void stopClientConnection(); |
SSLContext* getSSLContext() const; |
| |
/** Call to gracefully shutdown the server. It is called when the server |
/** |
has been stopped and is ready to be shutdown. Next time runForever() |
* Sets the SSL context |
is called, the server shuts down. |
* |
|
* @param the SSL context. |
*/ | */ |
void shutdown(); |
void setSSLContext(SSLContext* sslContext); |
| |
/** Return true if the server has shutdown, false otherwise. |
/** |
|
* Starts for listening. |
*/ | */ |
Boolean terminated() { return _dieNow; }; |
void start(); |
| |
/** Call to resume the sever. |
/** |
|
* Stops listening |
*/ | */ |
void resume(); |
void stop(); |
| |
Uint32 getOutstandingRequestCount(); |
/** |
|
* Returns if the listener is active |
private: |
* |
|
* @return true if the listener is active; |
Boolean _dieNow; |
* false otherwise. |
|
*/ |
String _rootPath; |
Boolean isAlive() const; |
String _repositoryRootPath; |
|
| |
Boolean _dynamicReg; |
/** |
Boolean _staticConsumers; |
* Adds a CIMIndicationConsumer to the listener |
Boolean _persistence; |
* |
|
* @param consumer the CIMIndicationConsumer to add. |
|
* @return true if the indication consumer has been added successfully |
|
* false otherwise. |
|
*/ |
|
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 |