Commit 1024d760 authored by afreyssin's avatar afreyssin
Browse files

Removes request/reply allowing the creation of temporary destinations.

Adds request/reply allowing to create or retrieve destinations (eventually temporary).
parent 597b0f50
...@@ -79,9 +79,9 @@ public abstract class AbstractJmsMessage implements Externalizable, Streamable { ...@@ -79,9 +79,9 @@ public abstract class AbstractJmsMessage implements Externalizable, Streamable {
protected final static int PING_REQUEST = 25; protected final static int PING_REQUEST = 25;
protected final static int QBROWSE_REPLY = 26; protected final static int QBROWSE_REPLY = 26;
protected final static int QBROWSE_REQUEST = 27; protected final static int QBROWSE_REQUEST = 27;
protected final static int SESS_CREATE_TDREPLY = 28; protected final static int SESS_CREATE_DEST_REPLY = 28;
protected final static int SESS_CREATE_TQREQUEST = 29; protected final static int SESS_CREATE_DEST_REQUEST = 29;
protected final static int SESS_CREATE_TTREQUEST = 30; protected final static int XXX_SESS_CREATE_TTREQUEST = 30;
protected final static int TEMP_DEST_DELETE_REQUEST = 31; protected final static int TEMP_DEST_DELETE_REQUEST = 31;
protected final static int XA_CNX_COMMIT = 32; protected final static int XA_CNX_COMMIT = 32;
protected final static int XA_CNX_PREPARE = 33; protected final static int XA_CNX_PREPARE = 33;
...@@ -92,44 +92,44 @@ public abstract class AbstractJmsMessage implements Externalizable, Streamable { ...@@ -92,44 +92,44 @@ public abstract class AbstractJmsMessage implements Externalizable, Streamable {
protected int classid; protected int classid;
protected static final String[] classnames = { protected static final String[] classnames = {
"org.objectweb.joram.shared.client.CnxConnectRequest", CnxConnectRequest.class.getName(),
"org.objectweb.joram.shared.client.CnxConnectReply", CnxConnectReply.class.getName(),
"org.objectweb.joram.shared.client.CnxStartRequest", CnxStartRequest.class.getName(),
"org.objectweb.joram.shared.client.CnxStopRequest", CnxStopRequest.class.getName(),
"org.objectweb.joram.shared.client.CnxCloseRequest", CnxCloseRequest.class.getName(),
"org.objectweb.joram.shared.client.CnxCloseReply", CnxCloseReply.class.getName(),
"org.objectweb.joram.shared.client.ProducerMessages", ProducerMessages.class.getName(),
"org.objectweb.joram.shared.client.ConsumerReceiveRequest", ConsumerReceiveRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerMessages", ConsumerMessages.class.getName(),
"org.objectweb.joram.shared.client.ConsumerSubRequest", ConsumerSubRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerUnsubRequest", ConsumerUnsubRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerAckRequest", ConsumerAckRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerDenyRequest", ConsumerDenyRequest.class.getName(),
"org.objectweb.joram.shared.client.SessAckRequest", SessAckRequest.class.getName(),
"org.objectweb.joram.shared.client.SessDenyRequest", SessDenyRequest.class.getName(),
"org.objectweb.joram.shared.client.MomExceptionReply", MomExceptionReply.class.getName(),
"org.objectweb.joram.shared.client.ServerReply", ServerReply.class.getName(),
"org.objectweb.joram.shared.client.ActivateConsumerRequest", ActivateConsumerRequest.class.getName(),
"org.objectweb.joram.shared.client.CommitRequest", CommitRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerCloseSubRequest", ConsumerCloseSubRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerSetListRequest", ConsumerSetListRequest.class.getName(),
"org.objectweb.joram.shared.client.ConsumerUnsetListRequest", ConsumerUnsetListRequest.class.getName(),
"org.objectweb.joram.shared.client.GetAdminTopicReply", GetAdminTopicReply.class.getName(),
"org.objectweb.joram.shared.client.GetAdminTopicRequest", GetAdminTopicRequest.class.getName(),
"org.objectweb.joram.shared.client.JmsRequestGroup", JmsRequestGroup.class.getName(),
"org.objectweb.joram.shared.client.PingRequest", PingRequest.class.getName(),
"org.objectweb.joram.shared.client.QBrowseReply", QBrowseReply.class.getName(),
"org.objectweb.joram.shared.client.QBrowseRequest", QBrowseRequest.class.getName(),
"org.objectweb.joram.shared.client.SessCreateTDReply", SessCreateDestReply.class.getName(),
"org.objectweb.joram.shared.client.SessCreateTQRequest", SessCreateDestRequest.class.getName(),
"org.objectweb.joram.shared.client.SessCreateTTRequest", null,
"org.objectweb.joram.shared.client.TempDestDeleteRequest", TempDestDeleteRequest.class.getName(),
"org.objectweb.joram.shared.client.XACnxCommit", XACnxCommit.class.getName(),
"org.objectweb.joram.shared.client.XACnxPrepare", XACnxPrepare.class.getName(),
"org.objectweb.joram.shared.client.XACnxRecoverReply", XACnxRecoverReply.class.getName(),
"org.objectweb.joram.shared.client.XACnxRecoverRequest", XACnxRecoverRequest.class.getName(),
"org.objectweb.joram.shared.client.XACnxRollback" XACnxRollback.class.getName()
}; };
protected abstract int getClassId(); protected abstract int getClassId();
......
...@@ -33,7 +33,7 @@ import fr.dyade.aaa.common.stream.StreamUtil; ...@@ -33,7 +33,7 @@ import fr.dyade.aaa.common.stream.StreamUtil;
* A <code>SessCreateTDReply</code> is used by a JMS proxy for replying * A <code>SessCreateTDReply</code> is used by a JMS proxy for replying
* to a <code>SessCreate&lt;TQ/TT&gt;Request</code>. * to a <code>SessCreate&lt;TQ/TT&gt;Request</code>.
*/ */
public final class SessCreateTDReply extends AbstractJmsReply { public final class SessCreateDestReply extends AbstractJmsReply {
/** define serialVersionUID for interoperability */ /** define serialVersionUID for interoperability */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -51,7 +51,7 @@ public final class SessCreateTDReply extends AbstractJmsReply { ...@@ -51,7 +51,7 @@ public final class SessCreateTDReply extends AbstractJmsReply {
} }
protected int getClassId() { protected int getClassId() {
return SESS_CREATE_TDREPLY; return SESS_CREATE_DEST_REPLY;
} }
/** /**
...@@ -60,7 +60,7 @@ public final class SessCreateTDReply extends AbstractJmsReply { ...@@ -60,7 +60,7 @@ public final class SessCreateTDReply extends AbstractJmsReply {
* @param request The replied request. * @param request The replied request.
* @param agentId String identifier of the destination agent. * @param agentId String identifier of the destination agent.
*/ */
public SessCreateTDReply(AbstractJmsRequest request, String agentId) { public SessCreateDestReply(AbstractJmsRequest request, String agentId) {
super(request.getRequestId()); super(request.getRequestId());
this.agentId = agentId; this.agentId = agentId;
} }
...@@ -68,7 +68,7 @@ public final class SessCreateTDReply extends AbstractJmsReply { ...@@ -68,7 +68,7 @@ public final class SessCreateTDReply extends AbstractJmsReply {
/** /**
* Constructs a <code>SessCreateTDReply</code> instance. * Constructs a <code>SessCreateTDReply</code> instance.
*/ */
public SessCreateTDReply() {} public SessCreateDestReply() {}
/* ***** ***** ***** ***** ***** /* ***** ***** ***** ***** *****
* Streamable interface * Streamable interface
......
/* /*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging * JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2006 ScalAgent Distributed Technologies * Copyright (C) 2010 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade *
* * This library is free software; you can redistribute it and/or
* This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public
* modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either
* License as published by the Free Software Foundation; either * version 2.1 of the License, or any later version.
* version 2.1 of the License, or any later version. *
* * This library is distributed in the hope that it will be useful,
* This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details.
* Lesser General Public License for more details. *
* * You should have received a copy of the GNU Lesser General Public
* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software
* License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA.
* USA. *
* * Initial developer(s): ScalAgent Distributed Technologies
* Initial developer(s): Frederic Maistre (INRIA) * Contributor(s):
* Contributor(s): ScalAgent Distributed Technologies */
*/ package org.objectweb.joram.shared.client;
package org.objectweb.joram.shared.client;
import java.io.IOException;
/** import java.io.InputStream;
* A <code>SessCreateTQRequest</code> is sent by a <code>QueueSession</code> import java.io.OutputStream;
* for creating a <code>TemporaryQueue</code>.
*/ import fr.dyade.aaa.common.stream.StreamUtil;
public final class SessCreateTQRequest extends AbstractJmsRequest {
/** /**
* * A <code>SessCreateDestRequest</code> is sent by a <code>Session</code>
*/ * for creating a destination.
private static final long serialVersionUID = 1L; */
public final class SessCreateDestRequest extends AbstractJmsRequest {
protected int getClassId() { /** define serialVersionUID for interoperability */
return SESS_CREATE_TQREQUEST; private static final long serialVersionUID = 1L;
}
/** Destination type, Queue or Topic, temporary or not. */
/** Constructs a <code>SessCreateTQRequest</code> instance. */ private byte type;
public SessCreateTQRequest() {
super(null); /**
} * Returns the destination type, Queue or Topic, temporary or not.
} *
* @return the destination type, Queue or Topic, temporary or not.
*/
public byte getType() {
return type;
}
/** Name of the destination if any */
private String name;
/**
* Returns the destination name if any.
*
* @return the destination name if any, null if not set.
*/
public String getName() {
return name;
}
/** Constructs a <code>SessCreateTQRequest</code> instance. */
public SessCreateDestRequest(byte type) {
this.type = type;
this.name = null;
}
/** Constructs a <code>SessCreateTQRequest</code> instance. */
public SessCreateDestRequest(byte type, String name) {
this.type = type;
this.name = name;
}
/**
* @see org.objectweb.joram.shared.client.AbstractJmsMessage#getClassId()
*/
protected int getClassId() {
return SESS_CREATE_DEST_REQUEST;
}
/** Constructs a <code>SessCreateTQRequest</code> instance. */
public SessCreateDestRequest() {
super(null);
}
/* ***** ***** ***** ***** *****
* Streamable interface
* ***** ***** ***** ***** ***** */
/**
* The object implements the writeTo method to write its contents to
* the output stream.
*
* @param os the stream to write the object to
*/
public void writeTo(OutputStream os) throws IOException {
super.writeTo(os);
StreamUtil.writeTo(type, os);
StreamUtil.writeTo(name, os);
}
/**
* The object implements the readFrom method to restore its contents from
* the input stream.
*
* @param is the stream to read data from in order to restore the object
*/
public void readFrom(InputStream is) throws IOException {
super.readFrom(is);
type = StreamUtil.readByteFrom(is);
name = StreamUtil.readStringFrom(is);
}
}
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2006 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
*/
package org.objectweb.joram.shared.client;
/**
* A <code>SessCreateTTRequest</code> is sent by a <code>TopicSession</code>
* for creating a <code>TemporaryTopic</code>.
*/
public final class SessCreateTTRequest extends AbstractJmsRequest {
/**
*
*/
private static final long serialVersionUID = 1L;
protected int getClassId() {
return SESS_CREATE_TTREQUEST;
}
/** Constructs a <code>SessCreateTTRequest</code> instance. */
public SessCreateTTRequest() {
super(null);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment