activemq-cpp-3.9.5
ConnectionState.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _ACTIVEMQ_STATE_CONNECTIONSTATE_H_
19#define _ACTIVEMQ_STATE_CONNECTIONSTATE_H_
20
33
34#include <decaf/util/StlMap.h>
38#include <decaf/lang/Pointer.h>
39
40#include <string>
41
42namespace activemq {
43namespace state {
44
46 using namespace decaf::util;
47 using namespace activemq::commands;
48
50 private:
51
55 LocalTransactionId::COMPARATOR > transactions;
58 SessionId::COMPARATOR > sessions;
59 LinkedList< Pointer<DestinationInfo> > tempDestinations;
61
62 bool connectionInterruptProcessingComplete;
65 ConsumerId::COMPARATOR > recoveringPullConsumers;
66
67 public:
68
70
72
73 std::string toString() const;
74
76 return this->info;
77 }
78
79 void checkShutdown() const;
80
81 void shutdown();
82
84
86 checkShutdown();
87 tempDestinations.add(info);
88 }
89
91
93 checkShutdown();
94 transactions.put(id.dynamicCast<LocalTransactionId>(), Pointer<TransactionState>(new TransactionState(id)));
95 }
96
98 return transactions.get(id.dynamicCast<LocalTransactionId>());
99 }
100
102 return transactions.values();
103 }
104
106 return transactions.remove(id.dynamicCast<LocalTransactionId>());
107 }
108
110 checkShutdown();
111 sessions.put(info->getSessionId(), Pointer<SessionState>(new SessionState(info)));
112 }
113
115 return sessions.remove(id);
116 }
117
119 return sessions.get(id);
120 }
121
123 return tempDestinations;
124 }
125
127 return sessions.values();
128 }
129
131 return recoveringPullConsumers;
132 }
133
134 void setConnectionInterruptProcessingComplete(bool connectionInterruptProcessingComplete) {
135 this->connectionInterruptProcessingComplete = connectionInterruptProcessingComplete;
136 }
137
139 return this->connectionInterruptProcessingComplete;
140 }
141
142 };
143
144}}
145
146#endif /*_ACTIVEMQ_STATE_CONNECTIONSTATE_H_*/
#define AMQCPP_API
Definition: Config.h:30
Definition: ConnectionState.h:49
const Pointer< commands::ConnectionInfo > getInfo() const
Definition: ConnectionState.h:75
const Pointer< SessionState > getSessionState(Pointer< SessionId > id) const
Definition: ConnectionState.h:118
void addTransactionState(Pointer< TransactionId > id)
Definition: ConnectionState.h:92
bool isConnectionInterruptProcessingComplete()
Definition: ConnectionState.h:138
Pointer< TransactionState > removeTransactionState(Pointer< TransactionId > id)
Definition: ConnectionState.h:105
ConnectionState(Pointer< ConnectionInfo > info)
std::string toString() const
void addTempDestination(Pointer< DestinationInfo > info)
Definition: ConnectionState.h:85
const decaf::util::Collection< Pointer< SessionState > > & getSessionStates() const
Definition: ConnectionState.h:126
void reset(Pointer< ConnectionInfo > info)
const Pointer< TransactionState > & getTransactionState(Pointer< TransactionId > id) const
Definition: ConnectionState.h:97
void addSession(Pointer< SessionInfo > info)
Definition: ConnectionState.h:109
const LinkedList< Pointer< DestinationInfo > > & getTempDesinations() const
Definition: ConnectionState.h:122
void removeTempDestination(Pointer< ActiveMQDestination > destination)
Pointer< SessionState > removeSession(Pointer< SessionId > id)
Definition: ConnectionState.h:114
void setConnectionInterruptProcessingComplete(bool connectionInterruptProcessingComplete)
Definition: ConnectionState.h:134
StlMap< Pointer< ConsumerId >, Pointer< ConsumerInfo >, ConsumerId::COMPARATOR > & getRecoveringPullConsumers()
Definition: ConnectionState.h:130
const decaf::util::Collection< Pointer< TransactionState > > & getTransactionStates() const
Definition: ConnectionState.h:101
Definition: SessionState.h:41
Definition: TransactionState.h:45
This implementation of Comparator is designed to allows objects in a Collection to be sorted or teste...
Definition: Pointer.h:366
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
The root interface in the collection hierarchy.
Definition: Collection.h:69
A complete implementation of the List interface using a doubly linked list data structure.
Definition: LinkedList.h:55
virtual bool add(const E &value)
Returns true if this collection changed as a result of the call.
Definition: LinkedList.h:194
Map template that wraps around a std::map to provide a more user-friendly interface and to provide co...
Definition: StlMap.h:48
Map template that wraps around a std::map to provide a more user-friendly interface and to provide co...
Definition: ConcurrentStlMap.h:51
virtual V remove(const K &key)
Removes the value (key/value pair) for the specified key from the map, returns a copy of the value th...
Definition: ConcurrentStlMap.h:922
virtual V & get(const K &key)
Gets the value mapped to the specified key in the Map.If there is no element in the map whose key is ...
Definition: ConcurrentStlMap.h:831
virtual bool put(const K &key, const V &value)
Associates the specified value with the specified key in this map (optional operation)....
Definition: ConcurrentStlMap.h:867
virtual Collection< V > & values()
Returns a Collection view of the values contained in this map.
Definition: ConcurrentStlMap.h:1100
A boolean value that may be updated atomically.
Definition: AtomicBoolean.h:34
Definition: ActiveMQBlobMessage.h:28
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition: CachedConsumer.h:24
Definition: AbstractCollection.h:33