You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2011/07/03 01:34:59 UTC

svn commit: r1142339 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq: commands/ConnectionControl.cpp commands/ConnectionControl.h wireformat/openwire/marshal/generated/ConnectionControlMarshaller.cpp

Author: tabish
Date: Sat Jul  2 23:34:59 2011
New Revision: 1142339

URL: http://svn.apache.org/viewvc?rev=1142339&view=rev
Log:
Update v8 commands with latest changes from AMQ trunk.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionControlMarshaller.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.cpp?rev=1142339&r1=1142338&r2=1142339&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.cpp Sat Jul  2 23:34:59 2011
@@ -40,7 +40,7 @@ using namespace decaf::lang::exceptions;
 ////////////////////////////////////////////////////////////////////////////////
 ConnectionControl::ConnectionControl() 
     : BaseCommand(), close(false), exit(false), faultTolerant(false), resume(false), suspend(false), connectedBrokers(""), reconnectTo(""), 
-      rebalanceConnection(false) {
+      rebalanceConnection(false), token() {
 
 }
 
@@ -85,6 +85,7 @@ void ConnectionControl::copyDataStructur
     this->setConnectedBrokers( srcPtr->getConnectedBrokers() );
     this->setReconnectTo( srcPtr->getReconnectTo() );
     this->setRebalanceConnection( srcPtr->isRebalanceConnection() );
+    this->setToken( srcPtr->getToken() );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -116,6 +117,17 @@ std::string ConnectionControl::toString(
     stream << "ReconnectTo = " << this->getReconnectTo();
     stream << ", ";
     stream << "RebalanceConnection = " << this->isRebalanceConnection();
+    stream << ", ";
+    stream << "Token = ";
+    if( this->getToken().size() > 0 ) {
+        stream << "[";
+        for( size_t itoken = 0; itoken < this->getToken().size(); ++itoken ) {
+            stream << this->getToken()[itoken] << ",";
+        }
+        stream << "]";
+    } else {
+        stream << "NULL";
+    }
     stream << " }";
 
     return stream.str();
@@ -158,6 +170,11 @@ bool ConnectionControl::equals( const Da
     if( this->isRebalanceConnection() != valuePtr->isRebalanceConnection() ) {
         return false;
     }
+    for( size_t itoken = 0; itoken < this->getToken().size(); ++itoken ) {
+        if( this->getToken()[itoken] != valuePtr->getToken()[itoken] ) {
+            return false;
+        }
+    }
     if( !BaseCommand::equals( value ) ) {
         return false;
     }
@@ -255,6 +272,21 @@ void ConnectionControl::setRebalanceConn
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+const std::vector<unsigned char>& ConnectionControl::getToken() const {
+    return token;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<unsigned char>& ConnectionControl::getToken() {
+    return token;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ConnectionControl::setToken( const std::vector<unsigned char>& token ) {
+    this->token = token;
+}
+
+////////////////////////////////////////////////////////////////////////////////
 decaf::lang::Pointer<commands::Command> ConnectionControl::visit( activemq::state::CommandVisitor* visitor ) {
 
     return visitor->processConnectionControl( this );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.h?rev=1142339&r1=1142338&r2=1142339&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/commands/ConnectionControl.h Sat Jul  2 23:34:59 2011
@@ -54,6 +54,7 @@ namespace commands{
         std::string connectedBrokers;
         std::string reconnectTo;
         bool rebalanceConnection;
+        std::vector<unsigned char> token;
 
     public:
 
@@ -106,6 +107,10 @@ namespace commands{
         virtual bool isRebalanceConnection() const;
         virtual void setRebalanceConnection( bool rebalanceConnection );
 
+        virtual const std::vector<unsigned char>& getToken() const;
+        virtual std::vector<unsigned char>& getToken();
+        virtual void setToken( const std::vector<unsigned char>& token );
+
         /**
          * @return an answer of true to the isConnectionControl() query.
          */

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionControlMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionControlMarshaller.cpp?rev=1142339&r1=1142338&r2=1142339&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionControlMarshaller.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ConnectionControlMarshaller.cpp Sat Jul  2 23:34:59 2011
@@ -76,6 +76,9 @@ void ConnectionControlMarshaller::tightU
         if( wireVersion >= 6 ) {
             info->setRebalanceConnection( bs->readBoolean() );
         }
+        if( wireVersion >= 8 ) {
+            info->setToken( tightUnmarshalByteArray( dataIn, bs ) );
+        }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
@@ -108,6 +111,10 @@ int ConnectionControlMarshaller::tightMa
         if( wireVersion >= 6 ) {
             bs->writeBoolean( info->isRebalanceConnection() );
         }
+        if( wireVersion >= 8 ) {
+            bs->writeBoolean( info->getToken().size() != 0 );
+            rc += info->getToken().size() == 0 ? 0 : (int)info->getToken().size() + 4;
+        }
 
         return rc + 0;
     }
@@ -142,6 +149,12 @@ void ConnectionControlMarshaller::tightM
         if( wireVersion >= 6 ) {
             bs->readBoolean();
         }
+        if( wireVersion >= 8 ) {
+            if( bs->readBoolean() ) {
+                dataOut->writeInt( (int)info->getToken().size() );
+                dataOut->write( (const unsigned char*)(&info->getToken()[0]), (int)info->getToken().size(), 0, (int)info->getToken().size() );
+            }
+        }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
@@ -173,6 +186,9 @@ void ConnectionControlMarshaller::looseU
         if( wireVersion >= 6 ) {
             info->setRebalanceConnection( dataIn->readBoolean() );
         }
+        if( wireVersion >= 8 ) {
+            info->setToken( looseUnmarshalByteArray( dataIn ) );
+        }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )
@@ -204,6 +220,13 @@ void ConnectionControlMarshaller::looseM
         if( wireVersion >= 6 ) {
             dataOut->writeBoolean( info->isRebalanceConnection() );
         }
+        if( wireVersion >= 8 ) {
+            dataOut->write( info->getToken().size() != 0 );
+            if( info->getToken().size() != 0 ) {
+                dataOut->writeInt( (int)info->getToken().size() );
+                dataOut->write( (const unsigned char*)(&info->getToken()[0]), (int)info->getToken().size(), 0, (int)info->getToken().size() );
+            }
+        }
     }
     AMQ_CATCH_RETHROW( decaf::io::IOException )
     AMQ_CATCH_EXCEPTION_CONVERT( exceptions::ActiveMQException, decaf::io::IOException )