Skip to content

Commit

Permalink
Integrate 0.0.11 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fbraem committed Nov 4, 2014
2 parents 81fc70b + cb56908 commit 0fee458
Show file tree
Hide file tree
Showing 144 changed files with 6,576 additions and 1,020 deletions.
11 changes: 11 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
0.0.11
- Add inquire connection (conn)
- Add inquire namelist (nl)
- Add inquire process (process)
- Add inquire service (service)
- Add inquire authentication information (authinfo)
- Add inquire authority record (authrec)
- Support for JSONP
- Allow to run without mq.web.templates / mq.web.static configuration
- Add connection pooling

0.0.10
- queueExcludeSystem/queueExcludeTemp renamed into excludeSystem/excludeTemp
- channelExcludeSystem renamed into excludeSystem
Expand Down
32 changes: 20 additions & 12 deletions MQ/include/MQ/CommandServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,21 @@
#include <cmqc.h>
#include <vector>

#include "MQ/QueueManager.h"
#include "MQ/Queue.h"
#include "MQ/PCF.h"

#include "Poco/SharedPtr.h"

namespace MQ {

class QueueManager;

class CommandServer
/// Class for sending PCF commands to a queuemanager
{
public:
CommandServer(QueueManager::Ptr qmgr, const std::string& modelQueue);
/// Constructor.
std::string commandQName() const;
/// Returns the name of the command queue.

PCF::Ptr createCommand(MQLONG command) const;
/// Returns a shared pointer to a PCF object for the given command.
Expand All @@ -47,26 +48,33 @@ class CommandServer
/// Sends the command to the queuemanager. The response is returned
/// as a vector of PCF objects. Can throw a MQException.

const QueueManager& qmgr() const;
/// Returns the associated queuemanager
std::string replyQName() const;
/// Returns the name of the reply queue.

private:
CommandServer(QueueManager& qmgr, const std::string& modelQueue);
/// Constructor.

typedef Poco::SharedPtr<CommandServer> Ptr;
CommandServer(const CommandServer& copy);
CommandServer& operator = (const CommandServer& copy);


private:
QueueManager::Ptr _qmgr;
QueueManager& _qmgr;

Queue _commandQ;

Queue _replyQ;

friend class QueueManager;
};

inline std::string CommandServer::commandQName() const
{
return _commandQ.name();
}

inline const QueueManager& CommandServer::qmgr() const
inline std::string CommandServer::replyQName() const
{
poco_assert_dbg(!_qmgr.isNull()); // Can't be null
return *_qmgr.get();
return _replyQ.name();
}

} // namespace MQ
Expand Down
2 changes: 1 addition & 1 deletion MQ/include/MQ/MQFunctions.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright 2010 MQWeb - Franky Braem
*
* Licensed under the EUPL, Version 1.1 or – as soon they
* Licensed under the EUPL, Version 1.1 or - as soon they
* will be approved by the European Commission - subsequent
* versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the
Expand Down
2 changes: 1 addition & 1 deletion MQ/include/MQ/MQSubsystem.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright 2010 MQWeb - Franky Braem
*
* Licensed under the EUPL, Version 1.1 or – as soon they
* Licensed under the EUPL, Version 1.1 or - as soon they
* will be approved by the European Commission - subsequent
* versions of the EUPL (the "Licence");
* You may not use this work except in compliance with the
Expand Down
12 changes: 11 additions & 1 deletion MQ/include/MQ/PCF.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ class PCF : public Message
void addParameter(MQLONG parameter, MQLONG value);
/// Add a numeric parameter.

void addParameterList(MQLONG parameter, MQLONG *values);
void addParameter(MQLONG parameter, BufferPtr buffer);
/// Add a byte string parameter.

void addParameterList(MQLONG parameter, MQLONG *values, unsigned int count);
/// Add a numeric list parameter.

void addParameterList(MQLONG parameter, const std::vector<MQLONG>& values);
/// Add a numeric list parameter

void addFilter(MQLONG parameter, MQLONG op, const std::string& value);
/// Add a filter with a string value.

Expand Down Expand Up @@ -171,6 +177,10 @@ class PCF : public Message
/// Returns true when the parameter is of given type.
};

inline void PCF::addParameterList(MQLONG parameter, const std::vector<MQLONG>& values)
{
addParameterList(parameter, (MQLONG*) &values[0], values.size());
}

inline int PCF::getCommand() const
{
Expand Down
4 changes: 2 additions & 2 deletions MQ/include/MQ/Queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Queue
/// Represents a Websphere MQ queue
{
public:
Queue(Poco::SharedPtr<QueueManager> qmgr, const std::string& name);
Queue(QueueManager& qmgr, const std::string& name);
/// Constructor

virtual ~Queue();
Expand All @@ -66,7 +66,7 @@ class Queue

private:

Poco::SharedPtr<QueueManager> _qmgr;
QueueManager& _qmgr;

MQHOBJ _handle;

Expand Down
51 changes: 48 additions & 3 deletions MQ/include/MQ/QueueManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
#include "Poco/SharedPtr.h"
#include "Poco/DateTime.h"

#include "Poco/Util/ConfigurationView.h"
#include "Poco/Dynamic/Struct.h"

#include "MQ/CommandServer.h"

namespace MQ {

Expand All @@ -39,30 +41,48 @@ class QueueManager
public:
typedef Poco::SharedPtr<QueueManager> Ptr;


QueueManager(const std::string& name = "");
/// Constructor.

virtual ~QueueManager();
/// Destructor. Disconnects the queuemanager when it is still connected.

CommandServer* commandServer();
/// Returns the command server for this queuemanager. A command server
/// must be created first with createCommandServer.

void connect();
/// Connects to the queuemanager. Can throw an MQException.

void connect(const std::string& channel, const std::string& server);
/// Connects to the queuemanager. Only use this method when the Websphere
/// MQ system is loaded in client mode. Can throw an MQException.

void connect(const std::string& channel, const std::string& server, const Poco::Util::AbstractConfiguration& ssl);
void connect(const std::string& channel, const std::string& server, const Poco::DynamicStruct& ssl);
/// Connects to the queuemanager using a channel that is protected with SSL.
/// The configuration for SSL is based on the following properties: keyrepos (required),
/// cipherspec, fips, suiteb and certificate_validation_policy (only when
/// MQSCO_VERSION_4 is defined).
/// Only use this method when MQ system is loaded in client mode. Can
/// throw an MQException.

void connect(const Poco::DynamicStruct& connectionInformation);
/// Connect using the information stored in the Poco::Dynamic::Struct object
/// Can throw an MQException

bool connected() const;
/// Returns true when the queuemanager is connected.

CommandServer* createCommandServer(const std::string& replyQ);
/// Create a command server. Once created, you can use commandServer to
/// get the associated command server. Can throw an MQException. The
/// QueueManager instance is responsible for the CommandServer object
/// and will destroy it when the queuemanager is disconnected.

void disconnect();
/// Disconnects from the queuemanager. Can throw an MQException.
/// When a CommandServer object is owned by this queuemanager, it will
/// be destroyed.

std::string name() const;
/// Returns the name of the queuemanager. The name is always inquired
Expand All @@ -84,6 +104,8 @@ class QueueManager

MQHCONN _handle;

MQHCONN handle() const;

std::string _name;

std::string _id;
Expand All @@ -92,6 +114,8 @@ class QueueManager

MQLONG _applicationType;

CommandServer* _commandServer;

void inquireQmgrAttrs();

friend class Queue;
Expand All @@ -115,11 +139,32 @@ inline std::string QueueManager::commandQueue() const
return _commandQueue;
}

inline bool QueueManager::connected() const
{
return _handle != 0L;
}

inline MQHCONN QueueManager::handle() const
{
return _handle;
}

inline bool QueueManager::zos() const
{
return _applicationType == MQPL_ZOS;
}

inline CommandServer* QueueManager::commandServer()
{
return _commandServer;
}

inline CommandServer* QueueManager::createCommandServer(const std::string& replyQ)
{
_commandServer = new CommandServer(*this, replyQ);
return _commandServer;
}

} // Namespace MQ

#endif // _MQ_QueueManager_h
Loading

0 comments on commit 0fee458

Please sign in to comment.