remove the old versions of the C# code

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@380657 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2006-02-24 12:47:53 +00:00
parent 15dc02a88d
commit 76494afa3f
24 changed files with 0 additions and 4981 deletions

View File

@ -1,172 +0,0 @@
using System;
using ActiveMQ;
namespace ActiveMQ
{
/// <summary>
/// Summary description for AbstractPacket.
/// </summary>
public abstract class AbstractPacket {
public const int NON_PERSISTENT = 1;
public const int PERSISTENT = 2;
/**
* Message flag indexes (used for writing/reading to/from a Stream
*/
public const int RECEIPT_REQUIRED_INDEX = 0;
public const int BROKERS_VISITED_INDEX =1;
private short id = 0;
protected byte[] data = new byte[100];
private bool receiptRequired;
protected AbstractPacket()
{
}
public short getId()
{
return this.id;
}
public virtual void setId(short newId)
{
this.id = newId;
}
public virtual bool isReceiptRequired()
{
return this.receiptRequired;
}
public virtual bool isReceipt()
{
return false;
}
public void setReceiptRequired(bool value)
{
this.receiptRequired = value;
}
public virtual bool isJMSMessage()
{
return false;
}
public int hashCode()
{
return this.id;
}
public virtual short getPacketType()
{
return id;
}
public String toString()
{
return getPacketTypeAsString(getPacketType()) + ": id = " + getId();
}
public static String getPacketTypeAsString(int type)
{
String packetTypeStr = "";
switch (type)
{
case PacketConstants.ACTIVEMQ_MESSAGE:
packetTypeStr = "ACTIVEMQ_MESSAGE";
break;
case PacketConstants.ACTIVEMQ_TEXT_MESSAGE:
packetTypeStr = "ACTIVEMQ_TEXT_MESSAGE";
break;
case PacketConstants.ACTIVEMQ_OBJECT_MESSAGE:
packetTypeStr = "ACTIVEMQ_OBJECT_MESSAGE";
break;
case PacketConstants.ACTIVEMQ_BYTES_MESSAGE:
packetTypeStr = "ACTIVEMQ_BYTES_MESSAGE";
break;
case PacketConstants.ACTIVEMQ_STREAM_MESSAGE:
packetTypeStr = "ACTIVEMQ_STREAM_MESSAGE";
break;
case PacketConstants.ACTIVEMQ_MAP_MESSAGE:
packetTypeStr = "ACTIVEMQ_MAP_MESSAGE";
break;
case PacketConstants.ACTIVEMQ_MSG_ACK:
packetTypeStr = "ACTIVEMQ_MSG_ACK";
break;
case PacketConstants.RECEIPT_INFO:
packetTypeStr = "RECEIPT_INFO";
break;
case PacketConstants.CONSUMER_INFO:
packetTypeStr = "CONSUMER_INFO";
break;
case PacketConstants.PRODUCER_INFO:
packetTypeStr = "PRODUCER_INFO";
break;
case PacketConstants.TRANSACTION_INFO:
packetTypeStr = "TRANSACTION_INFO";
break;
case PacketConstants.XA_TRANSACTION_INFO:
packetTypeStr = "XA_TRANSACTION_INFO";
break;
case PacketConstants.ACTIVEMQ_BROKER_INFO:
packetTypeStr = "ACTIVEMQ_BROKER_INFO";
break;
case PacketConstants.ACTIVEMQ_CONNECTION_INFO:
packetTypeStr = "ACTIVEMQ_CONNECTION_INFO";
break;
case PacketConstants.SESSION_INFO:
packetTypeStr = "SESSION_INFO";
break;
case PacketConstants.DURABLE_UNSUBSCRIBE:
packetTypeStr = "DURABLE_UNSUBSCRIBE";
break;
case PacketConstants.RESPONSE_RECEIPT_INFO:
packetTypeStr = "RESPONSE_RECEIPT_INFO";
break;
case PacketConstants.INT_RESPONSE_RECEIPT_INFO:
packetTypeStr = "INT_RESPONSE_RECEIPT_INFO";
break;
case PacketConstants.CAPACITY_INFO:
packetTypeStr = "CAPACITY_INFO";
break;
case PacketConstants.CAPACITY_INFO_REQUEST:
packetTypeStr = "CAPACITY_INFO_REQUEST";
break;
case PacketConstants.WIRE_FORMAT_INFO:
packetTypeStr = "WIRE_FORMAT_INFO";
break;
case PacketConstants.KEEP_ALIVE:
packetTypeStr = "KEEP_ALIVE";
break;
case PacketConstants.CACHED_VALUE_COMMAND:
packetTypeStr = "CachedValue";
break;
default :
packetTypeStr = "UNKNOWN PACKET TYPE: " + type;
break;
}
return packetTypeStr;
}
protected virtual bool equals(Object left, Object right)
{
return left == right || (left != null && left.Equals(right));
}
public byte[] getData()
{
return data;
}
public void setBitArray(byte[] data)
{
this.data = data;
}
}
}

View File

@ -1,183 +0,0 @@
<VisualStudioProject>
<CSHARP
ProjectType = "Local"
ProductVersion = "7.0.9466"
SchemaVersion = "1.0"
ProjectGuid = "{8B07A13A-8E84-48F9-A0FE-12715CC4C842}"
>
<Build>
<Settings
ApplicationIcon = ""
AssemblyKeyContainerName = ""
AssemblyName = "ActiveMQ"
AssemblyOriginatorKeyFile = ""
DefaultClientScript = "JScript"
DefaultHTMLPageLayout = "Grid"
DefaultTargetSchema = "IE50"
DelaySign = "false"
OutputType = "Exe"
RootNamespace = "ActiveMQ"
StartupObject = ""
>
<Config
Name = "Debug"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "DEBUG;TRACE"
DocumentationFile = ""
DebugSymbols = "true"
FileAlignment = "4096"
IncrementalBuild = "true"
Optimize = "false"
OutputPath = "bin\Debug\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
<Config
Name = "Release"
AllowUnsafeBlocks = "false"
BaseAddress = "285212672"
CheckForOverflowUnderflow = "false"
ConfigurationOverrideFile = ""
DefineConstants = "TRACE"
DocumentationFile = ""
DebugSymbols = "false"
FileAlignment = "4096"
IncrementalBuild = "false"
Optimize = "true"
OutputPath = "bin\Release\"
RegisterForComInterop = "false"
RemoveIntegerChecks = "false"
TreatWarningsAsErrors = "false"
WarningLevel = "4"
/>
</Settings>
<References>
<Reference
Name = "System"
AssemblyName = "System"
HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.dll"
/>
<Reference
Name = "System.Data"
AssemblyName = "System.Data"
HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.Data.dll"
/>
<Reference
Name = "System.XML"
AssemblyName = "System.Xml"
HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.0.3705\System.XML.dll"
/>
</References>
</Build>
<Files>
<Include>
<File
RelPath = "AbstractPacket.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ActiveMQDestination.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ActiveMQMessage.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ActiveMQQueue.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ActiveMQTopic.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "BrokerInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ConnectionInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ConsumerInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "DestinationFilter.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "IntResponseReceipt.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "MessageAck.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "MessageAcknowledge.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "PacketConstants.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ProducerInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "Receipt.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "ResponseReceipt.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "SessionInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "TransactionConstants.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "TransactionInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
RelPath = "WireFormatInfo.cs"
SubType = "Code"
BuildAction = "Compile"
/>
</Include>
</Files>
</CSHARP>
</VisualStudioProject>

View File

@ -1,48 +0,0 @@
<VisualStudioProject>
<CSHARP>
<Build>
<Settings ReferencePath = "" >
<Config
Name = "Debug"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "true"
/>
<Config
Name = "Release"
EnableASPDebugging = "false"
EnableASPXDebugging = "false"
EnableUnmanagedDebugging = "false"
EnableSQLServerDebugging = "false"
RemoteDebugEnabled = "false"
RemoteDebugMachine = ""
StartAction = "Project"
StartArguments = ""
StartPage = ""
StartProgram = ""
StartURL = ""
StartWorkingDirectory = ""
StartWithIE = "false"
/>
</Settings>
</Build>
<OtherProjectSettings
CopyProjectDestinationFolder = ""
CopyProjectUncPath = ""
CopyProjectOption = "0"
ProjectView = "ProjectFiles"
ProjectTrust = "0"
/>
</CSHARP>
</VisualStudioProject>

View File

@ -1,21 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 7.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ActiveMQ", "ActiveMQ.csproj", "{8B07A13A-8E84-48F9-A0FE-12715CC4C842}"
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
ConfigName.0 = Debug
ConfigName.1 = Release
EndGlobalSection
GlobalSection(ProjectDependencies) = postSolution
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{8B07A13A-8E84-48F9-A0FE-12715CC4C842}.Debug.ActiveCfg = Debug|.NET
{8B07A13A-8E84-48F9-A0FE-12715CC4C842}.Debug.Build.0 = Debug|.NET
{8B07A13A-8E84-48F9-A0FE-12715CC4C842}.Release.ActiveCfg = Release|.NET
{8B07A13A-8E84-48F9-A0FE-12715CC4C842}.Release.Build.0 = Release|.NET
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
EndGlobal

View File

@ -1 +0,0 @@
ÐÏࡱ

View File

@ -1,531 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for ActiveMQDestination.
/// </summary>
public abstract class ActiveMQDestination {
/**
* Topic Destination object
*/
public const int ACTIVEMQ_TOPIC = 1;
/**
* Temporary Topic Destination object
*/
public const int ACTIVEMQ_TEMPORARY_TOPIC = 2;
/**
* Queue Destination object
*/
public const int ACTIVEMQ_QUEUE = 3;
/**
* Temporary Queue Destination object
*/
public const int ACTIVEMQ_TEMPORARY_QUEUE = 4;
/**
* prefix for Advisory message destinations
*/
public const String ADVISORY_PREFIX = "ActiveMQ.Advisory.";
/**
* prefix for consumer advisory destinations
*/
public const String CONSUMER_ADVISORY_PREFIX = ADVISORY_PREFIX + "Consumers.";
/**
* prefix for producer advisory destinations
*/
public const String PRODUCER_ADVISORY_PREFIX = ADVISORY_PREFIX + "Producers.";
/**
* prefix for connection advisory destinations
*/
public const String CONNECTION_ADVISORY_PREFIX = ADVISORY_PREFIX + "Connections.";
/**
* The default target for ordered destinations
*/
public const String DEFAULT_ORDERED_TARGET = "coordinator";
private const int NULL_DESTINATION = 10;
private const String TEMP_PREFIX = "{TD{";
private const String TEMP_POSTFIX = "}TD}";
private const String COMPOSITE_SEPARATOR = ",";
private const String QUEUE_PREFIX = "queue://";
private const String TOPIC_PREFIX = "topic://";
private String physicalName = "";
// Cached transient data
private bool exclusive;
private bool ordered;
private bool advisory;
private String orderedTarget = DEFAULT_ORDERED_TARGET;
/**
* The Default Constructor
*/
protected ActiveMQDestination() {
}
/**
* Construct the ActiveMQDestination with a defined physical name;
*
* @param name
*/
protected ActiveMQDestination(String name) {
this.physicalName = name;
this.advisory = name != null && name.startsWith(ADVISORY_PREFIX);
}
/**
* @return Returns the advisory.
*/
public bool isAdvisory() {
return advisory;
}
/**
* @param advisory The advisory to set.
*/
public void setAdvisory(bool advisory) {
this.advisory = advisory;
}
/**
* @return true if this is a destination for Consumer advisories
*/
public bool isConsumerAdvisory(){
return isAdvisory() && physicalName.startsWith(ActiveMQDestination.CONSUMER_ADVISORY_PREFIX);
}
/**
* @return true if this is a destination for Producer advisories
*/
public bool isProducerAdvisory(){
return isAdvisory() && physicalName.startsWith(ActiveMQDestination.PRODUCER_ADVISORY_PREFIX);
}
/**
* @return true if this is a destination for Connection advisories
*/
public bool isConnectionAdvisory(){
return isAdvisory() && physicalName.startsWith(ActiveMQDestination.CONNECTION_ADVISORY_PREFIX);
}
/**
* @return Returns the exclusive.
*/
public bool isExclusive() {
return exclusive;
}
/**
* @param exclusive The exclusive to set.
*/
public void setExclusive(bool exclusive) {
this.exclusive = exclusive;
}
/**
* @return Returns the ordered.
*/
public bool isOrdered() {
return ordered;
}
/**
* @param ordered The ordered to set.
*/
public void setOrdered(bool ordered) {
this.ordered = ordered;
}
/**
* @return Returns the orderedTarget.
*/
public String getOrderedTarget() {
return orderedTarget;
}
/**
* @param orderedTarget The orderedTarget to set.
*/
public void setOrderedTarget(String orderedTarget) {
this.orderedTarget = orderedTarget;
}
/**
* A helper method to return a descriptive string for the topic or queue
* @param destination
*
* @return a descriptive string for this queue or topic
*/
public static String inspect(ActiveMQDestination destination) {
if (destination is Topic) {
return "Topic(" + destination.toString() + ")";
}
else {
return "Queue(" + destination.toString() + ")";
}
}
/**
* @param destination
* @return @throws JMSException
* @throws javax.jms.JMSException
*/
public static ActiveMQDestination transformDestination(ActiveMQDestination destination) {
ActiveMQDestination result = null;
if (destination != null) {
if (destination is ActiveMQDestination) {
result = (ActiveMQDestination) destination;
}
else {
if (destination is TemporaryQueue) {
result = new ActiveMQTemporaryQueue(((Queue) destination).getQueueName());
}
else if (destination is TemporaryTopic) {
result = new ActiveMQTemporaryTopic(((Topic) destination).getTopicName());
}
else if (destination is Queue) {
result = new ActiveMQTemporaryQueue(((Queue) destination).getQueueName());
}
else if (destination is Topic) {
result = new ActiveMQTemporaryTopic(((Topic) destination).getTopicName());
}
}
}
return result;
}
/**
* Write an ActiveMQDestination to a Stream
*
* @param destination
* @param dataOut
* @throws IOException
*/
public static void writeToStream(ActiveMQDestination destination, Object dataOut) {
//TODO SERILIZATION
}
/**
* Read an ActiveMQDestination from a Stream
*
* @param dataIn
* @return the ActiveMQDestination
* @throws IOException
*/
public static ActiveMQDestination readFromStream(Object dataIn) {
//TODO Serilization
}
/**
* Create a Destination
* @param type
* @param pyhsicalName
* @return
*/
public static ActiveMQDestination createDestination(int type,String pyhsicalName){
ActiveMQDestination result = null;
if (type == ACTIVEMQ_TOPIC) {
result = new ActiveMQTopic(pyhsicalName);
}
else if (type == ACTIVEMQ_TEMPORARY_TOPIC) {
result = new ActiveMQTemporaryTopic(pyhsicalName);
}
else if (type == ACTIVEMQ_QUEUE) {
result = new ActiveMQQueue(pyhsicalName);
}
else {
result = new ActiveMQTemporaryQueue(pyhsicalName);
}
return result;
}
/**
* Create a temporary name from the clientId
*
* @param clientId
* @return
*/
public static String createTemporaryName(String clientId) {
return TEMP_PREFIX + clientId + TEMP_POSTFIX;
}
/**
* From a temporary destination find the clientId of the Connection that created it
*
* @param destination
* @return the clientId or null if not a temporary destination
*/
public static String getClientId(ActiveMQDestination destination) {
String answer = null;
if (destination != null && destination.isTemporary()) {
String name = destination.getPhysicalName();
int start = name.indexOf(TEMP_PREFIX);
if (start >= 0) {
start += TEMP_PREFIX.length();
int stop = name.lastIndexOf(TEMP_POSTFIX);
if (stop > start && stop < name.length()) {
answer = name.substring(start, stop);
}
}
}
return answer;
}
/**
* @param o object to compare
* @return 1 if this > o else 0 if they are equal or -1 if this < o
*/
public int compareTo(Object o) {
if (o is ActiveMQDestination) {
return compareTo((ActiveMQDestination) o);
}
return -1;
}
/**
* Lets sort by name first then lets sort topics greater than queues
*
* @param that another destination to compare against
* @return 1 if this > that else 0 if they are equal or -1 if this < that
*/
public int compareTo(ActiveMQDestination that) {
int answer = 0;
if (physicalName != that.physicalName) {
if (physicalName == null) {
return -1;
}
else if (that.physicalName == null) {
return 1;
}
answer = physicalName.compareTo(that.physicalName);
}
if (answer == 0) {
if (isTopic()) {
if (that.isQueue()) {
return 1;
}
}
else {
if (that.isTopic()) {
return -1;
}
}
}
return answer;
}
/**
* @return Returns the Destination type
*/
public abstract int getDestinationType();
/**
* @return Returns the physicalName.
*/
public String getPhysicalName() {
return this.physicalName;
}
/**
* @param newPhysicalName The physicalName to set.
*/
public void setPhysicalName(String newPhysicalName) {
this.physicalName = newPhysicalName;
}
/**
* Returns true if a temporary Destination
*
* @return true/false
*/
public bool isTemporary() {
return getDestinationType() == ACTIVEMQ_TEMPORARY_TOPIC ||
getDestinationType() == ACTIVEMQ_TEMPORARY_QUEUE;
}
/**
* Returns true if a Topic Destination
*
* @return true/false
*/
public bool isTopic() {
return getDestinationType() == ACTIVEMQ_TOPIC ||
getDestinationType() == ACTIVEMQ_TEMPORARY_TOPIC;
}
/**
* Returns true if a Queue Destination
*
* @return true/false
*/
public bool isQueue() {
return !isTopic();
}
/**
* Returns true if this destination represents a collection of
* destinations; allowing a set of destinations to be published to or subscribed
* from in one JMS operation.
* <p/>
* If this destination is a composite then you can call {@link #getChildDestinations()}
* to return the list of child destinations.
*
* @return true if this destination represents a collection of child destinations.
*/
public bool isComposite() {
return physicalName.indexOf(COMPOSITE_SEPARATOR) > 0;
}
/**
* Returns a list of child destinations if this destination represents a composite
* destination.
*
* @return
*/
/*public List getChildDestinations() {
List answer = new ArrayList();
StringTokenizer iter = new StringTokenizer(physicalName, COMPOSITE_SEPARATOR);
while (iter.hasMoreTokens()) {
String name = iter.nextToken();
Destination child = null;
if (name.startsWith(QUEUE_PREFIX)) {
child = new ActiveMQQueue(name.substring(QUEUE_PREFIX.length()));
}
else if (name.startsWith(TOPIC_PREFIX)) {
child = new ActiveMQTopic(name.substring(TOPIC_PREFIX.length()));
}
else {
child = createDestination(name);
}
answer.add(child);
}
if (answer.size() == 1) {
// lets put ourselves inside the collection
// as we are not really a composite destination
answer.set(0, this);
}
return answer;
}*/
/**
* @return string representation of this instance
*/
public String toString() {
return this.physicalName;
}
/**
* @return hashCode for this instance
*/
public int hashCode() {
int answer = 0xcafebabe;
if (this.physicalName != null) {
answer = physicalName.hashCode();
}
if (isTopic()) {
answer ^= 0xfabfab;
}
return answer;
}
/**
* if the object passed in is equivalent, return true
*
* @param obj the object to compare
* @return true if this instance and obj are equivalent
*/
public bool equals(Object obj) {
bool result = this == obj;
if (!result && obj != null && obj is ActiveMQDestination) {
ActiveMQDestination other = (ActiveMQDestination) obj;
result = this.getDestinationType() == other.getDestinationType() &&
this.physicalName.equals(other.physicalName);
}
return result;
}
/**
* @return true if the destination matches multiple possible destinations
*/
public bool isWildcard() {
if (physicalName != null) {
return physicalName.indexOf(DestinationFilter.ANY_CHILD) >= 0
|| physicalName.indexOf(DestinationFilter.ANY_DESCENDENT) >= 0;
}
return false;
}
/**
* @param destination
* @return true if the given destination matches this destination; including wildcards
*/
public bool matches(ActiveMQDestination destination) {
if (isWildcard()) {
return getDestinationFilter().matches(destination);
}
else {
return equals(destination);
}
}
/**
* @return the DestinationFilter
*/
public DestinationFilter getDestinationFilter() {
if (filter == null) {
filter = DestinationFilter.parseFilter(this);
}
return filter;
}
/**
* @return the associated paths associated with this Destination
*/
public String[] getDestinationPaths() {
if (paths == null) {
paths = DestinationPath.getDestinationPaths(physicalName);
}
return paths;
}
// Implementation methods
//-------------------------------------------------------------------------
/**
* Factory method to create a child destination if this destination is a composite
* @param name
* @return the created Destination
*/
public abstract ActiveMQDestination createDestination(String name);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for ActiveMQQueue.
/// </summary>
public class ActiveMQQueue : ActiveMQDestination {
public ActiveMQQueue() : base(){}
public ActiveMQQueue(String name) : base(name){}
public String getQueueName() {
return base.getPhysicalName();
}
public override int getDestinationType() {
return ACTIVEMQ_QUEUE;
}
public override ActiveMQDestination createDestination(String name) {
return new ActiveMQQueue(name);
}
}
}

View File

@ -1,28 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for ActiveMQTopic.
/// </summary>
public class ActiveMQTopic : ActiveMQDestination
{
public ActiveMQTopic(): base() {}
public ActiveMQTopic(String name):base(name){}
public String getTopicName()
{
return super.getPhysicalName();
}
public override int getDestinationType()
{
return ACTIVEMQ_TOPIC;
}
public override ActiveMQDestination createDestination(String name)
{
return new ActiveMQTopic(name);
}
}
}

View File

@ -1,117 +0,0 @@
using System;
using System.Collections;
namespace ActiveMQ
{
public class BrokerInfo : AbstractPacket {
private String brokerName;
private String clusterName;
private long startTime;
private Hashtable properties;
private bool remote;
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return ACTIVEMQ_BROKER_INFO;
}
/**
* @return Returns the brokerName.
*/
public String getBrokerName()
{
return this.brokerName;
}
/**
* @param newBrokerName The brokerName to set.
*/
public void setBrokerName(String newBrokerName)
{
this.brokerName = newBrokerName;
}
/**
* @return Returns the clusterName.
*/
public String getClusterName()
{
return this.clusterName;
}
/**
* @param newClusterName The clusterName to set.
*/
public void setClusterName(String newClusterName)
{
this.clusterName = newClusterName;
}
/**
* @return Returns the properties.
*/
public Hashtable getProperties()
{
return this.properties;
}
/**
* @param newProperties The properties to set.
*/
public void setProperties(Hashtable newProperties)
{
this.properties = newProperties;
}
/**
* @return Returns the startTime.
*/
public long getStartTime()
{
return this.startTime;
}
/**
* @param newStartTime The startTime to set.
*/
public void setStartTime(long newStartTime)
{
this.startTime = newStartTime;
}
/**
* @return Returns the boondocks.
*/
public bool isRemote()
{
return remote;
}
/**
* @param boondocks The boondocks to set.
*/
public void setRemote(bool boondocks)
{
this.remote = boondocks;
}
public override String ToString()
{
return base.ToString() + " BrokerInfo{ " +
"brokerName = '" + brokerName + "' " +
", clusterName = '" + clusterName + "' " +
", startTime = " + startTime +
", properties = " + properties +
" }";
}
}
}

View File

@ -1,163 +0,0 @@
using System;
using System.Collections;
namespace ActiveMQ
{
public class ConnectionInfo : AbstractPacket
{
public static String NO_DELAY_PROPERTY = "noDelay";
String clientId;
String userName;
String password;
String hostName;
String clientVersion;
int wireFormatVersion;
long startTime;
bool started;
bool closed;
Hashtable properties = new Hashtable();
public override short getPacketType()
{
return PacketConstants.ACTIVEMQ_CONNECTION_INFO;
}
public override bool Equals(Object obj)
{
bool result = false;
if (obj != null && obj is ConnectionInfo)
{
ConnectionInfo info = (ConnectionInfo) obj;
result = this.clientId == info.clientId;
}
return result;
}
public override int GetHashCode()
{
return this.clientId != null ? this.clientId.GetHashCode() : base.GetHashCode();
}
public String getClientId()
{
return this.clientId;
}
public void setClientId(String newClientId)
{
this.clientId = newClientId;
}
public String getHostName()
{
return this.hostName;
}
public void setHostName(String newHostName)
{
this.hostName = newHostName;
}
public String getPassword()
{
return this.password;
}
public void setPassword(String newPassword)
{
this.password = newPassword;
}
public Hashtable getProperties()
{
return this.properties;
}
public void setProperties(Hashtable newProperties)
{
this.properties = newProperties;
}
public long getStartTime()
{
return this.startTime;
}
public void setStartTime(long newStartTime)
{
this.startTime = newStartTime;
}
public String getUserName()
{
return this.userName;
}
public void setUserName(String newUserName)
{
this.userName = newUserName;
}
public bool isStarted()
{
return started;
}
public void setStarted(bool started)
{
this.started = started;
}
public bool isClosed()
{
return closed;
}
public void setClosed(bool closed)
{
this.closed = closed;
}
public String getClientVersion()
{
return clientVersion;
}
public void setClientVersion(String clientVersion)
{
this.clientVersion = clientVersion;
}
public int getWireFormatVersion()
{
return wireFormatVersion;
}
public void setWireFormatVersion(int wireFormatVersion)
{
this.wireFormatVersion = wireFormatVersion;
}
public override String ToString()
{
return base.ToString() + " ConnectionInfo{ " +
"clientId = '" + clientId + "' " +
", userName = '" + userName + "' " +
", hostName = '" + hostName + "' " +
", clientVersion = '" + clientVersion + "' " +
", wireFormatVersion = " + wireFormatVersion +
", startTime = " + startTime +
", started = " + started +
", closed = " + closed +
", properties = " + properties +
" }";
}
}
}

View File

@ -1,325 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for ConsumerInfo.
/// </summary>
public class ConsumerInfo : AbstractPacket {
private ActiveMQDestination destination;
private String clientId;
private short sessionId;
private String consumerName;
private String selector;
private long startTime;
private bool started;
private int consumerNo;
private bool noLocal;
private bool browser;
private int prefetchNumber = 100;
private String consumerId;
/**
* @return Returns the sessionId.
*/
public short getSessionId()
{
return sessionId;
}
/**
* @param sessionId The sessionId to set.
*/
public void setSessionId(short sessionId)
{
this.sessionId = sessionId;
}
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return CONSUMER_INFO;
}
/**
* Test for equality
*
* @param obj object to test
* @return true if equivalent
*/
public bool equals(Object obj)
{
bool result = false;
if (obj != null && obj is ConsumerInfo)
{
ConsumerInfo that = (ConsumerInfo) obj;
result = this.getConsumerId().equals(that.getConsumerId());
}
return result;
}
/**
* @return hash code for instance
*/
public new int hashCode()
{
return getConsumerId().hashCode();
}
/**
* @return Returns the clientId.
*/
public String getClientId()
{
return this.clientId;
}
/**
* @param newClientId The clientId to set.
*/
public void setClientId(String newClientId)
{
this.clientId = newClientId;
}
/**
* @return Returns the destination.
*/
public ActiveMQDestination getDestination()
{
return this.destination;
}
/**
* @param newDestination The destination to set.
*/
public void setDestination(ActiveMQDestination newDestination)
{
this.destination = newDestination;
}
/**
* @return Returns the selector.
*/
public String getSelector()
{
return this.selector;
}
/**
* @param newSelector The selector to set.
*/
public void setSelector(String newSelector)
{
this.selector = newSelector;
}
/**
* @return Returns the started.
*/
public bool isStarted()
{
return this.started;
}
/**
* @param flag to indicate if started
*/
public void setStarted(bool flag)
{
this.started = flag;
}
/**
* @return Returns the startTime.
*/
public long getStartTime()
{
return this.startTime;
}
/**
* @param newStartTime The startTime to set.
*/
public void setStartTime(long newStartTime)
{
this.startTime = newStartTime;
}
/**
* @return Returns the consumerNo.
*/
public int getConsumerNo()
{
return this.consumerNo;
}
/**
* @param newConsumerNo The consumerNo to set.
*/
public void setConsumerNo(int newConsumerNo)
{
this.consumerNo = newConsumerNo;
}
/**
* @return Returns the consumer name.
*/
public String getConsumerName()
{
return this.consumerName;
}
/**
* @param newconsumerName The consumerName to set.
*/
public void setConsumerName(String newconsumerName)
{
this.consumerName = newconsumerName;
}
/**
* @return Returns true if the Consumer is a durable Topic subscriber
*/
public bool isDurableTopic()
{
return this.destination.isTopic() && !this.destination.isTemporary() && this.consumerName != null
&& this.consumerName.length() > 0;
}
/**
* @return Returns the noLocal.
*/
public bool isNoLocal()
{
return noLocal;
}
/**
* @param noLocal The noLocal to set.
*/
public void setNoLocal(bool noLocal)
{
this.noLocal = noLocal;
}
/**
* @return Returns the browser.
*/
public bool isBrowser()
{
return browser;
}
/**
* @param browser The browser to set.
*/
public void setBrowser(bool browser)
{
this.browser = browser;
}
/**
* @return Returns the prefetchNumber.
*/
public int getPrefetchNumber()
{
return prefetchNumber;
}
/**
* @param prefetchNumber The prefetchNumber to set.
*/
public void setPrefetchNumber(int prefetchNumber)
{
this.prefetchNumber = prefetchNumber;
}
/**
* Creates a primary key for the consumer info which uniquely
* describes the consumer using a combination of clientID and
* consumerName
*
* @return the consumerKey
*/
public String getConsumerKey()
{
if (consumerKey == null)
{
consumerKey = generateConsumerKey(clientId,consumerName);
}
return consumerKey;
}
/**
* @return Returns the consumerIdentifier.
*/
public String getConsumerId()
{
if (consumerId == null)
{
consumerId = clientId + "." + sessionId + "." + consumerNo;
}
return consumerId;
}
/**
* @param consumerIdentifier The consumerIdentifier to set.
*/
public void setConsumerId(String consumerIdentifier)
{
this.consumerId = consumerIdentifier;
}
/**
* Generate a primary key for a consumer from the clientId and consumerName
* @param clientId
* @param consumerName
* @return
*/
public static String generateConsumerKey(String clientId, String consumerName)
{
return "[" + clientId + ":" + consumerName + "]";
}
/**
* @return true if the consumer is interested in advisory messages
*/
public bool isAdvisory()
{
return destination != null && destination.isAdvisory();
}
/**
* @return a pretty print
*/
public override String ToString()
{
return super.toString() + " ConsumerInfo{ " +
"browser = " + browser +
", destination = " + destination +
", consumerIdentifier = '" + getConsumerId() + "' " +
", clientId = '" + clientId + "' " +
", sessionId = '" + sessionId + "' " +
", consumerName = '" + consumerName + "' " +
", selector = '" + selector + "' " +
", startTime = " + startTime +
", started = " + started +
", consumerNo = " + consumerNo +
", noLocal = " + noLocal +
", prefetchNumber = " + prefetchNumber +
", consumerKey = '" + getConsumerKey() + "' " +
" }";
}
}
}

View File

@ -1,23 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for DestinationFilter.
/// </summary>
public abstract class DestinationFilter
{
public const String ANY_DESCENDENT = ">";
public const String ANY_CHILD = "*";
public bool matches(ActiveMQMessage message)
{
return matches(message.getJMSDestination());
}
public abstract bool matches(ActiveMQDestination destination);
}
}

View File

@ -1,43 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for IntResponseReceipt.
/// </summary>
public class IntResponseReceipt : Receipt {
private int result;
/**
* @see org.activemq.message.Receipt#getPacketType()
*/
public new int getPacketType()
{
return INT_RESPONSE_RECEIPT_INFO;
}
/**
* @return Returns the result.
*/
public int getResult()
{
return result;
}
/**
* @param result The result to set.
*/
public void setResult(int result)
{
this.result = result;
}
public new String ToString()
{
return super.toString() + " IntResponseReceipt{ " +
"result = " + result +
" }";
}
}
}

View File

@ -1,264 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for MessageAck.
/// </summary>
public class MessageAck : AbstractPacket {
public const int MESSAGE_READ_INDEX = 2;
public const int XA_TRANS_INDEX = 3;
public const int PERSISTENT_INDEX = 4;
public const int EXPIRED_INDEX = 5;
public const int TRANSACTION_ID_INDEX = 6;
public const int EXTERNAL_MESSAGE_ID_INDEX = 7;
public const int CACHED_VALUES_INDEX = 8;
public const int LONG_SEQUENCE_INDEX = 9;
private String consumerId;
private String messageID;
private ActiveMQDestination destination;
private Object transactionId;
private bool messageRead;
private bool xaTransacted;
private bool persistent;
private bool expired;
private short sessionId;
private long sequenceNumber;
private String producerKey;
private bool externalMessageId;
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return ACTIVEMQ_MSG_ACK;
}
/**
* @return pretty print of this Packet
*/
public new String ToString()
{
return super.toString() + " MessageAck{ " +
"consumerId = '" + consumerId + "' " +
", messageID = '" + messageID + "' " +
", destination = " + destination +
", transactionId = '" + transactionId + "' " +
", messageRead = " + messageRead +
", xaTransacted = " + xaTransacted +
", persistent = " + persistent +
", expired = " + expired +
", messageIdentity = " + messageIdentity +
" }";
}
/**
* @return Returns the transactionId.
*/
public Object getTransactionId()
{
return this.transactionId;
}
/**
* @param newTransactionId The transactionId to set.
*/
public void setTransactionId(Object newTransactionId)
{
this.transactionId = newTransactionId;
//this.xaTransacted = newTransactionId!=null && newTransactionId.getClass()==ActiveMQXid.class;
}
/**
* @return Returns true if this message is part of a transaction
*/
public bool isPartOfTransaction()
{
return this.transactionId != null;
}
/**
* @return the messageId
*/
public String getMessageID()
{
if (messageID == null && producerKey != null)
{
messageID = producerKey + sequenceNumber;
}
return messageID;
}
/**
* @param messageID The messageID to set.
*/
public void setMessageID(String messageID)
{
this.messageID = messageID;
}
/**
* @return Returns the messageRead.
*/
public bool isMessageRead()
{
return messageRead;
}
/**
* @param messageRead The messageRead to set.
*/
public void setMessageRead(bool messageRead)
{
this.messageRead = messageRead;
}
/**
* @return Returns the consumerId.
*/
public String getConsumerId()
{
return consumerId;
}
/**
* @param consumerId The consumerId to set.
*/
public void setConsumerId(String consumerId)
{
this.consumerId = consumerId;
}
/**
* @return Returns the xaTransacted.
*/
public bool isXaTransacted()
{
return xaTransacted;
}
/**
* @return Returns the destination.
*/
public ActiveMQDestination getDestination()
{
return destination;
}
/**
* @param destination The destination to set.
*/
public void setDestination(ActiveMQDestination destination)
{
this.destination = destination;
}
/**
* @return Returns the persistent.
*/
public bool isPersistent()
{
return persistent;
}
/**
* @param persistent The persistent to set.
*/
public void setPersistent(bool persistent)
{
this.persistent = persistent;
}
/**
* @return true the delivered message was to a non-persistent destination
*/
public bool isTemporary()
{
return persistent == false || (destination != null && destination.isTemporary());
}
/**
* @return Returns the expired.
*/
public bool isExpired()
{
return expired;
}
/**
* @param expired The expired to set.
*/
public void setExpired(bool expired)
{
this.expired = expired;
}
/**
* @return Returns the producerKey.
*/
public String getProducerKey()
{
return producerKey;
}
/**
* @param producerKey The producerKey to set.
*/
public void setProducerKey(String producerKey)
{
this.producerKey = producerKey;
}
/**
* @return Returns the messageSequence.
*/
public long getSequenceNumber()
{
return sequenceNumber;
}
/**
* @param messageSequence The messageSequence to set.
*/
public void setSequenceNumber(long messageSequence)
{
this.sequenceNumber = messageSequence;
}
/**
* @return Returns the sessionId.
*/
public short getSessionId()
{
return sessionId;
}
/**
* @param sessionId The sessionId to set.
*/
public void setSessionId(short sessionId)
{
this.sessionId = sessionId;
}
/**
* @return Returns the externalMessageId.
*/
public bool isExternalMessageId()
{
return externalMessageId;
}
/**
* @param externalMessageId The externalMessageId to set.
*/
public void setExternalMessageId(bool externalMessageId)
{
this.externalMessageId = externalMessageId;
}
}
}

View File

@ -1,13 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for MessageAcknowledge.
/// </summary>
public interface MessageAcknowledge
{
void acknowledge(ActiveMQMessage caller);
}
}

View File

@ -1,157 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for Packetpublic constants.
/// </summary>
class PacketConstants
{
PacketConstants()
{}
public const int NOT_SET = 0;
/**
* ActiveMQMessage object
*/
public const int ACTIVEMQ_MESSAGE = 6;
/**
* ActiveMQTextMessage object
*/
public const int ACTIVEMQ_TEXT_MESSAGE = 7;
/**
* ActiveMQObjectMessage object
*/
public const int ACTIVEMQ_OBJECT_MESSAGE = 8;
/**
* ActiveMQBytesMessage
*/
public const int ACTIVEMQ_BYTES_MESSAGE = 9;
/**
* ActiveMQStreamMessage object
*/
public const int ACTIVEMQ_STREAM_MESSAGE = 10;
/**
* ActiveMQMapMessage object
*/
public const int ACTIVEMQ_MAP_MESSAGE = 11;
/**
* Message acknowledge
*/
public const int ACTIVEMQ_MSG_ACK = 15;
/**
* Recipt message
*/
public const int RECEIPT_INFO = 16;
/**
* Consumer Infomation
*/
public const int CONSUMER_INFO = 17;
/**
* Producer Info
*/
public const int PRODUCER_INFO = 18;
/**
* Transaction info
*/
public const int TRANSACTION_INFO = 19;
/**
* XA Transaction info
*/
public const int XA_TRANSACTION_INFO = 20;
/**
* Broker infomation message
*/
public const int ACTIVEMQ_BROKER_INFO = 21;
/**
* Connection info message
*/
public const int ACTIVEMQ_CONNECTION_INFO = 22;
/**
* Session Info message
*/
public const int SESSION_INFO = 23;
/**
* Durable Unsubscribe message
*/
public const int DURABLE_UNSUBSCRIBE = 24;
/**
* A receipt with an Object reponse.
*/
public const int RESPONSE_RECEIPT_INFO = 25;
/**
* A receipt with an Integer reponse.
*/
public const int INT_RESPONSE_RECEIPT_INFO = 26;
/**
* Infomation about the Capacity for more Messages for either Connection/Broker
*/
public const int CAPACITY_INFO = 27;
/**
* Request infomation about the current capacity
*/
public const int CAPACITY_INFO_REQUEST = 28;
/**
* Infomation about the wire format expected
*/
public const int WIRE_FORMAT_INFO = 29;
/**
* Keep-alive message
*/
public const int KEEP_ALIVE = 30;
/**
* A command to the Broker Admin
*/
public const int BROKER_ADMIN_COMMAND = 31;
/**
* transmit cached values for the wire format
*/
public const int CACHED_VALUE_COMMAND = 32;
/**
* transmit cached values for the wire format
*/
public const int CLEANUP_CONNECTION_INFO = 33;
}
}

View File

@ -1,175 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for ProducerInfo.
/// </summary>
public class ProducerInfo : AbstractPacket
{
private ActiveMQDestination destination;
private short producerId;
private String clientId;
private short sessionId;
private long startTime;
private bool started;
/**
* Test for equality
*
* @param obj object to test
* @return true if equivalent
*/
public override bool Equals(Object obj)
{
bool result = false;
if (obj != null && obj is ProducerInfo)
{
ProducerInfo info = (ProducerInfo) obj;
result = this.producerId == info.producerId &&
this.sessionId == info.sessionId &&
this.clientId.equals(info.clientId);
}
return result;
}
/**
* @return hash code for instance
*/
public override int GetHashCode()
{
if (cachedHashCode == -1)
{
String hashCodeStr = clientId + sessionId + producerId;
cachedHashCode = hashCodeStr.hashCode();
}
return cachedHashCode;
}
/**
* @return Returns the producerId.
*/
public short getProducerId()
{
return producerId;
}
/**
* @param producerId The producerId to set.
*/
public void setProducerId(short producerId)
{
this.producerId = producerId;
}
/**
* @return Returns the sessionId.
*/
public short getSessionId()
{
return sessionId;
}
/**
* @param sessionId The sessionId to set.
*/
public void setSessionId(short sessionId)
{
this.sessionId = sessionId;
}
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return PRODUCER_INFO;
}
/**
* @return Returns the clientId.
*/
public String getClientId()
{
return this.clientId;
}
/**
* @param newClientId The clientId to set.
*/
public void setClientId(String newClientId)
{
this.clientId = newClientId;
}
/**
* @return Returns the destination.
*/
public ActiveMQDestination getDestination()
{
return this.destination;
}
/**
* @param newDestination The destination to set.
*/
public void setDestination(ActiveMQDestination newDestination)
{
this.destination = newDestination;
}
/**
* @return Returns the started.
*/
public bool isStarted()
{
return this.started;
}
/**
* @param flag to indicate if started
*/
public void setStarted(bool flag)
{
this.started = flag;
}
/**
* @return Returns the startTime.
*/
public long getStartTime()
{
return this.startTime;
}
/**
* @param newStartTime The startTime to set.
*/
public void setStartTime(long newStartTime)
{
this.startTime = newStartTime;
}
public override String ToString()
{
return super.toString() + " ProducerInfo{ " +
"clientId = '" + clientId + "' " +
", destination = " + destination +
", producerId = '" + producerId + "' " +
", sessionId = '" + sessionId + "' " +
", startTime = " + startTime +
", started = " + started +
" }";
}
}
}

View File

@ -1,144 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for Receipt.
/// </summary>
public class Receipt : AbstractPacket
{
private short correlationId;
private String brokerName;
private String clusterName;
private String exception;
private bool failed;
private int brokerMessageCapacity = 100;
/**
* @return Returns the jmsException.
*/
public String getException()
{
return exception;
}
/**
* @param exception The exception to set.
*/
public void setException(String exception)
{
this.exception = exception;
}
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return RECEIPT_INFO;
}
/**
* @return true, this is a receipt packet
*/
public new bool isReceipt()
{
return true;
}
/**
* @return Returns the correlationId.
*/
public short getCorrelationId()
{
return this.correlationId;
}
/**
* @param newCorrelationId The correlationId to set.
*/
public void setCorrelationId(short newCorrelationId)
{
this.correlationId = newCorrelationId;
}
/**
* @return Returns the failed.
*/
public bool isFailed()
{
return this.failed;
}
/**
* @param newFailed The failed to set.
*/
public void setFailed(bool newFailed)
{
this.failed = newFailed;
}
/**
* @return Returns the brokerMessageCapacity.
*/
public int getBrokerMessageCapacity()
{
return brokerMessageCapacity;
}
/**
* @param brokerMessageCapacity The brokerMessageCapacity to set.
*/
public void setBrokerMessageCapacity(int brokerMessageCapacity)
{
this.brokerMessageCapacity = brokerMessageCapacity;
}
/**
* @return Returns the brokerName.
*/
public String getBrokerName()
{
return brokerName;
}
/**
* @param brokerName The brokerName to set.
*/
public void setBrokerName(String brokerName)
{
this.brokerName = brokerName;
}
/**
* @return Returns the clusterName.
*/
public String getClusterName()
{
return clusterName;
}
/**
* @param clusterName The clusterName to set.
*/
public void setClusterName(String clusterName)
{
this.clusterName = clusterName;
}
/**
* @return pretty print of a Receipt
*/
public override String ToString()
{
return super.toString() + " Receipt{ " +
"brokerMessageCapacity = " + brokerMessageCapacity +
", correlationId = '" + correlationId + "' " +
", brokerName = '" + brokerName + "' " +
", clusterName = '" + clusterName + "' " +
", exception = " + exception +
", failed = " + failed +
" }";
}
}
}

View File

@ -1,61 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for ResponseReceipt.
/// </summary>
public class ResponseReceipt : Receipt {
private Object result;
private byte[] resultBytes;
/**
* @see org.activemq.message.Receipt#getPacketType()
*/
public new int getPacketType() {
return RESPONSE_RECEIPT_INFO;
}
/**
* @return Returns the result.
*/
public Object getResult() {
return null;
//TODO Serilization code
}
/**
* @param result The result to set.
*/
public void setResult(Object result) {
this.result = result;
this.resultBytes = null;
}
/**
* @param data
*/
public void setResultBytes(byte[] resultBytes) {
this.resultBytes = resultBytes;
this.result = null;
}
/**
* @return Returns the resultBytes.
*/
public byte[] getResultBytes() {
//TODO SERILIZATION
return null;
}
public override String ToString() {
return base.toString() + " ResponseReceipt{ " +
"result = " + result +
", resultBytes = " + resultBytes +
" }";
}
}
}

View File

@ -1,150 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for SessionInfo.
/// </summary>
public class SessionInfo : AbstractPacket {
private String clientId;
private short sessionId;
private long startTime;
private bool started;
private int sessionMode;
/**
* @return Returns the sessionMode.
*/
public int getSessionMode()
{
return sessionMode;
}
/**
* @param sessionMode The sessionMode to set.
*/
public void setSessionMode(int sessionMode)
{
this.sessionMode = sessionMode;
}
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return SESSION_INFO;
}
/**
* Test for equality
*
* @param obj object to test
* @return true if equivalent
*/
public override bool Equals(Object obj)
{
boolean result = false;
if (obj != null && obj is SessionInfo) {
SessionInfo info = (SessionInfo) obj;
result = this.clientId.equals(info.clientId) && this.sessionId == info.sessionId;
}
return result;
}
/**
* @return hash code for instance
*/
public override int GetHashCode()
{
if (cachedHashCode == -1)
{
String hashCodeStr = clientId + sessionId;
cachedHashCode = hashCodeStr.hashCode();
}
return cachedHashCode;
}
/**
* @return Returns the sessionId.
*/
public short getSessionId()
{
return sessionId;
}
/**
* @param sessionId The sessionId to set.
*/
public void setSessionId(short sessionId)
{
this.sessionId = sessionId;
}
/**
* @return Returns the clientId.
*/
public String getClientId()
{
return this.clientId;
}
/**
* @param newClientId The clientId to set.
*/
public void setClientId(String newClientId)
{
this.clientId = newClientId;
}
/**
* @return Returns the started.
*/
public bool isStarted()
{
return this.started;
}
/**
* @param flag to indicate if started
*/
public void setStarted(bool flag)
{
this.started = flag;
}
/**
* @return Returns the startTime.
*/
public long getStartTime()
{
return this.startTime;
}
/**
* @param newStartTime The startTime to set.
*/
public void setStartTime(long newStartTime)
{
this.startTime = newStartTime;
}
public override String ToString()
{
return super.toString() + " SessionInfo{ " +
"clientId = '" + clientId + "' " +
", sessionId = '" + sessionId + "' " +
", startTime = " + startTime +
", started = " + started +
" }";
}
}
}

View File

@ -1,68 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for TransactionConstants.
/// </summary>
public class TransactionType
{
/**
* Transaction state not set
*/
const int NOT_SET = 0;
/**
* Start a transaction
*/
const int START = 101;
/**
* Pre-commit a transaction
*/
const int PRE_COMMIT = 102;
/**
* Commit a transaction
*/
const int COMMIT = 103;
/**
* Recover a transaction
*/
const int RECOVER = 104;
/**
* Rollback a transaction
*/
const int ROLLBACK = 105;
/**
* End a transaction
*/
const int END = 106;
/**
* Forget a transaction
*/
const int FORGET = 107;
/**
* Join a transaction
*/
const int JOIN = 108;
/**
* Do a one phase commit... No PRE COMMIT has been done.
*/
const int COMMIT_ONE_PHASE = 109;
/**
* Get a list of all the XIDs that are currently prepared.
*/
const int XA_RECOVER = 110;
/**
* Get a the transaction timeout for the RM
*/
const int GET_TX_TIMEOUT = 111;
/**
* Set a the transaction timeout for the RM
*/
const int SET_TX_TIMEOUT = 112;
/**
* Gets the unique id of the resource manager.
*/
const int GET_RM_ID = 113;
}
}

View File

@ -1,90 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for TransactionInfo.
/// </summary>
public class TransactionInfo : AbstractPacket {
private int type;
private String transactionId;
/**
* @return Returns the transactionId.
*/
public String getTransactionId()
{
return transactionId;
}
/**
* @param transactionId The transactionId to set.
*/
public void setTransactionId(String transactionId)
{
this.transactionId = transactionId;
}
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return TRANSACTION_INFO;
}
/**
* Test for equality
*
* @param obj object to test
* @return true if equivalent
*/
public bool equals(Object obj)
{
boolean result = false;
if (obj != null && obj is TransactionInfo) {
TransactionInfo info = (TransactionInfo) obj;
result = this.transactionId == info.transactionId;
}
return result;
}
/**
* @return hash code for instance
*/
public override int GetHashCode()
{
return this.transactionId != null ? this.transactionId.hashCode() : base.hashCode();
}
/**
* @return Returns the type of transacton command.
*/
public int getType()
{
return this.type;
}
/**
* @param newType the type of transaction command The type to set.
*/
public void setType(int newType)
{
this.type = newType;
}
public override String ToString()
{
return base.toString() + " TransactionInfo{ " +
"transactionId = '" + transactionId + "' " +
", type = " + type +
" }";
}
}
}

View File

@ -1,55 +0,0 @@
using System;
namespace ActiveMQ
{
/// <summary>
/// Summary description for WireFormatInfo.
/// </summary>
public class WireFormatInfo : AbstractPacket
{
public char[] MAGIC = new char[]{'A','c','t','i','v','e','M','Q'};
int version;
/**
* Return the type of Packet
*
* @return integer representation of the type of Packet
*/
public new int getPacketType()
{
return WIRE_FORMAT_INFO;
}
/**
* @return pretty print
*/
public override String ToString()
{
return super.toString() + " WireFormatInfo{ " +
"version = " + version +
" }";
}
/**
* @return Returns the version.
*/
public int getVersion()
{
return version;
}
/**
* @param version The version to set.
*/
public void setVersion(int version)
{
this.version = version;
}
}
}