activemq-cpp-3.9.5
ActiveMQConstants.h
Go to the documentation of this file.
1/*
2 * Copyright 2006 The Apache Software Foundation or its licensors, as
3 * applicable.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * 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#ifndef _ACTIVEMQ_CORE_ACTIVEMQCONSTANTS_H_
18#define _ACTIVEMQ_CORE_ACTIVEMQCONSTANTS_H_
19
20#include <string>
21#include <map>
23
24namespace activemq {
25namespace core {
26
33 public:
34
35 // Flags to indicate Transaction States.
46
47 // Flags to be applied when sending the Destination Info Command.
52
53 // Represents the Acknowledgment types that are supported for the
54 // Message Ack Command.
55 enum AckType {
56 ACK_TYPE_DELIVERED = 0, // Message delivered but not consumed
57 ACK_TYPE_POISON = 1, // Message could not be processed due to
58 // poison pill but discard anyway
59 ACK_TYPE_CONSUMED = 2, // Message consumed, discard
60 ACK_TYPE_REDELIVERED = 3, // Message has been re-delivered.
61 ACK_TYPE_INDIVIDUAL = 4, // Acks a single message at a time.
62 ACK_TYPE_UNMATCHED = 5, // Durable sub doesn't match selector
63 ACK_TYPE_EXPIRED = 6 // Message expired.
64 };
65
81
100
101 static const std::string& toString(const DestinationOption option) {
102 return StaticInitializer::destOptions[option];
103 }
104
105 static DestinationOption toDestinationOption(const std::string& option) {
106 std::map<std::string, DestinationOption>::iterator iter = StaticInitializer::destOptionMap.find(option);
107
108 if (iter == StaticInitializer::destOptionMap.end()) {
109 return NUM_OPTIONS;
110 }
111
112 return iter->second;
113 }
114
115 static const std::string& toString(const URIParam option) {
116 return StaticInitializer::uriParams[option];
117 }
118
119 static URIParam toURIOption(const std::string& option) {
120 std::map<std::string, URIParam>::iterator iter = StaticInitializer::uriParamsMap.find(option);
121
122 if (iter == StaticInitializer::uriParamsMap.end()) {
123 return NUM_PARAMS;
124 }
125
126 return iter->second;
127 }
128
130 public:
133
134 static std::string destOptions[NUM_OPTIONS];
135 static std::string uriParams[NUM_PARAMS];
136 static std::map<std::string, DestinationOption> destOptionMap;
137 static std::map<std::string, URIParam> uriParamsMap;
138 };
139
140 private:
141
142 static StaticInitializer staticInits;
143
144 };
145
146}}
147
148#endif /*_ACTIVEMQ_CORE_ACTIVEMQCONSTANTS_H_*/
#define AMQCPP_API
Definition Config.h:30
virtual ~StaticInitializer()
Definition ActiveMQConstants.h:132
static std::string destOptions[NUM_OPTIONS]
Definition ActiveMQConstants.h:134
static std::map< std::string, DestinationOption > destOptionMap
Definition ActiveMQConstants.h:136
static std::string uriParams[NUM_PARAMS]
Definition ActiveMQConstants.h:135
static std::map< std::string, URIParam > uriParamsMap
Definition ActiveMQConstants.h:137
Class holding constant values for various ActiveMQ specific things Each constant is defined as an enu...
Definition ActiveMQConstants.h:32
DestinationOption
These values represent the options that can be appended to an Destination name, i....
Definition ActiveMQConstants.h:70
@ CONSUMER_DISPATCHASYNC
Definition ActiveMQConstants.h:74
@ CUNSUMER_MAXPENDINGMSGLIMIT
Definition ActiveMQConstants.h:72
@ CONSUMER_EXCLUSIVE
Definition ActiveMQConstants.h:77
@ CONSUMER_PRIORITY
Definition ActiveMQConstants.h:78
@ CONSUMER_NOLOCAL
Definition ActiveMQConstants.h:73
@ CONSUMER_SELECTOR
Definition ActiveMQConstants.h:76
@ NUM_OPTIONS
Definition ActiveMQConstants.h:79
@ CONSUMER_PREFECTCHSIZE
Definition ActiveMQConstants.h:71
@ CONSUMER_RETROACTIVE
Definition ActiveMQConstants.h:75
static const std::string & toString(const URIParam option)
Definition ActiveMQConstants.h:115
AckType
Definition ActiveMQConstants.h:55
@ ACK_TYPE_REDELIVERED
Definition ActiveMQConstants.h:60
@ ACK_TYPE_POISON
Definition ActiveMQConstants.h:57
@ ACK_TYPE_UNMATCHED
Definition ActiveMQConstants.h:62
@ ACK_TYPE_CONSUMED
Definition ActiveMQConstants.h:59
@ ACK_TYPE_DELIVERED
Definition ActiveMQConstants.h:56
@ ACK_TYPE_INDIVIDUAL
Definition ActiveMQConstants.h:61
@ ACK_TYPE_EXPIRED
Definition ActiveMQConstants.h:63
static DestinationOption toDestinationOption(const std::string &option)
Definition ActiveMQConstants.h:105
static const std::string & toString(const DestinationOption option)
Definition ActiveMQConstants.h:101
static URIParam toURIOption(const std::string &option)
Definition ActiveMQConstants.h:119
TransactionState
Definition ActiveMQConstants.h:36
@ TRANSACTION_STATE_RECOVER
Definition ActiveMQConstants.h:42
@ TRANSACTION_STATE_BEGIN
Definition ActiveMQConstants.h:37
@ TRANSACTION_STATE_PREPARE
Definition ActiveMQConstants.h:38
@ TRANSACTION_STATE_END
Definition ActiveMQConstants.h:44
@ TRANSACTION_STATE_ROLLBACK
Definition ActiveMQConstants.h:41
@ TRANSACTION_STATE_COMMITTWOPHASE
Definition ActiveMQConstants.h:40
@ TRANSACTION_STATE_COMMITONEPHASE
Definition ActiveMQConstants.h:39
@ TRANSACTION_STATE_FORGET
Definition ActiveMQConstants.h:43
DestinationActions
Definition ActiveMQConstants.h:48
@ DESTINATION_REMOVE_OPERATION
Definition ActiveMQConstants.h:50
@ DESTINATION_ADD_OPERATION
Definition ActiveMQConstants.h:49
URIParam
These values represent the parameters that can be added to the connection URI that affect the ActiveM...
Definition ActiveMQConstants.h:86
@ CONNECTION_SENDTIMEOUT
Definition ActiveMQConstants.h:87
@ CONNECTION_DISPATCHASYNC
Definition ActiveMQConstants.h:93
@ CONNECTION_CLOSETIMEOUT
Definition ActiveMQConstants.h:89
@ NUM_PARAMS
Definition ActiveMQConstants.h:98
@ CONNECTION_ALWAYSSYNCSEND
Definition ActiveMQConstants.h:90
@ PARAM_CLIENTID
Definition ActiveMQConstants.h:96
@ CONNECTION_USECOMPRESSION
Definition ActiveMQConstants.h:92
@ PARAM_PASSWORD
Definition ActiveMQConstants.h:95
@ CONNECTION_CONNECTRESPONSETIMEOUT
Definition ActiveMQConstants.h:97
@ CONNECTION_PRODUCERWINDOWSIZE
Definition ActiveMQConstants.h:88
@ PARAM_USERNAME
Definition ActiveMQConstants.h:94
@ CONNECTION_USEASYNCSEND
Definition ActiveMQConstants.h:91
Definition ActiveMQTempDestination.h:29
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24