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 {
protected final static int PING_REQUEST = 25;
protected final static int QBROWSE_REPLY = 26;
protected final static int QBROWSE_REQUEST = 27;
protected final static int SESS_CREATE_TDREPLY = 28;
protected final static int SESS_CREATE_TQREQUEST = 29;
protected final static int SESS_CREATE_TTREQUEST = 30;
protected final static int SESS_CREATE_DEST_REPLY = 28;
protected final static int SESS_CREATE_DEST_REQUEST = 29;
protected final static int XXX_SESS_CREATE_TTREQUEST = 30;
protected final static int TEMP_DEST_DELETE_REQUEST = 31;
protected final static int XA_CNX_COMMIT = 32;
protected final static int XA_CNX_PREPARE = 33;
......@@ -92,44 +92,44 @@ public abstract class AbstractJmsMessage implements Externalizable, Streamable {
protected int classid;
protected static final String[] classnames = {
"org.objectweb.joram.shared.client.CnxConnectRequest",
"org.objectweb.joram.shared.client.CnxConnectReply",
"org.objectweb.joram.shared.client.CnxStartRequest",
"org.objectweb.joram.shared.client.CnxStopRequest",
"org.objectweb.joram.shared.client.CnxCloseRequest",
"org.objectweb.joram.shared.client.CnxCloseReply",
"org.objectweb.joram.shared.client.ProducerMessages",
"org.objectweb.joram.shared.client.ConsumerReceiveRequest",
"org.objectweb.joram.shared.client.ConsumerMessages",
"org.objectweb.joram.shared.client.ConsumerSubRequest",
"org.objectweb.joram.shared.client.ConsumerUnsubRequest",
"org.objectweb.joram.shared.client.ConsumerAckRequest",
"org.objectweb.joram.shared.client.ConsumerDenyRequest",
"org.objectweb.joram.shared.client.SessAckRequest",
"org.objectweb.joram.shared.client.SessDenyRequest",
"org.objectweb.joram.shared.client.MomExceptionReply",
"org.objectweb.joram.shared.client.ServerReply",
"org.objectweb.joram.shared.client.ActivateConsumerRequest",
"org.objectweb.joram.shared.client.CommitRequest",
"org.objectweb.joram.shared.client.ConsumerCloseSubRequest",
"org.objectweb.joram.shared.client.ConsumerSetListRequest",
"org.objectweb.joram.shared.client.ConsumerUnsetListRequest",
"org.objectweb.joram.shared.client.GetAdminTopicReply",
"org.objectweb.joram.shared.client.GetAdminTopicRequest",
"org.objectweb.joram.shared.client.JmsRequestGroup",
"org.objectweb.joram.shared.client.PingRequest",
"org.objectweb.joram.shared.client.QBrowseReply",
"org.objectweb.joram.shared.client.QBrowseRequest",
"org.objectweb.joram.shared.client.SessCreateTDReply",
"org.objectweb.joram.shared.client.SessCreateTQRequest",
"org.objectweb.joram.shared.client.SessCreateTTRequest",
"org.objectweb.joram.shared.client.TempDestDeleteRequest",
"org.objectweb.joram.shared.client.XACnxCommit",
"org.objectweb.joram.shared.client.XACnxPrepare",
"org.objectweb.joram.shared.client.XACnxRecoverReply",
"org.objectweb.joram.shared.client.XACnxRecoverRequest",
"org.objectweb.joram.shared.client.XACnxRollback"
CnxConnectRequest.class.getName(),
CnxConnectReply.class.getName(),
CnxStartRequest.class.getName(),
CnxStopRequest.class.getName(),
CnxCloseRequest.class.getName(),
CnxCloseReply.class.getName(),
ProducerMessages.class.getName(),
ConsumerReceiveRequest.class.getName(),
ConsumerMessages.class.getName(),
ConsumerSubRequest.class.getName(),
ConsumerUnsubRequest.class.getName(),
ConsumerAckRequest.class.getName(),
ConsumerDenyRequest.class.getName(),
SessAckRequest.class.getName(),
SessDenyRequest.class.getName(),
MomExceptionReply.class.getName(),
ServerReply.class.getName(),
ActivateConsumerRequest.class.getName(),
CommitRequest.class.getName(),
ConsumerCloseSubRequest.class.getName(),
ConsumerSetListRequest.class.getName(),
ConsumerUnsetListRequest.class.getName(),
GetAdminTopicReply.class.getName(),
GetAdminTopicRequest.class.getName(),
JmsRequestGroup.class.getName(),
PingRequest.class.getName(),
QBrowseReply.class.getName(),
QBrowseRequest.class.getName(),
SessCreateDestReply.class.getName(),
SessCreateDestRequest.class.getName(),
null,
TempDestDeleteRequest.class.getName(),
XACnxCommit.class.getName(),
XACnxPrepare.class.getName(),
XACnxRecoverReply.class.getName(),
XACnxRecoverRequest.class.getName(),
XACnxRollback.class.getName()
};
protected abstract int getClassId();
......
......@@ -33,7 +33,7 @@ import fr.dyade.aaa.common.stream.StreamUtil;
* A <code>SessCreateTDReply</code> is used by a JMS proxy for replying
* 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 */
private static final long serialVersionUID = 1L;
......@@ -51,7 +51,7 @@ public final class SessCreateTDReply extends AbstractJmsReply {
}
protected int getClassId() {
return SESS_CREATE_TDREPLY;
return SESS_CREATE_DEST_REPLY;
}
/**
......@@ -60,7 +60,7 @@ public final class SessCreateTDReply extends AbstractJmsReply {
* @param request The replied request.
* @param agentId String identifier of the destination agent.
*/
public SessCreateTDReply(AbstractJmsRequest request, String agentId) {
public SessCreateDestReply(AbstractJmsRequest request, String agentId) {
super(request.getRequestId());
this.agentId = agentId;
}
......@@ -68,7 +68,7 @@ public final class SessCreateTDReply extends AbstractJmsReply {
/**
* Constructs a <code>SessCreateTDReply</code> instance.
*/
public SessCreateTDReply() {}
public SessCreateDestReply() {}
/* ***** ***** ***** ***** *****
* Streamable interface
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2001 - 2006 ScalAgent Distributed Technologies
* Copyright (C) 1996 - 2000 Dyade
* Copyright (C) 2010 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -18,27 +17,98 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA.
*
* Initial developer(s): Frederic Maistre (INRIA)
* Contributor(s): ScalAgent Distributed Technologies
* Initial developer(s): ScalAgent Distributed Technologies
* Contributor(s):
*/
package org.objectweb.joram.shared.client;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import fr.dyade.aaa.common.stream.StreamUtil;
/**
* A <code>SessCreateTQRequest</code> is sent by a <code>QueueSession</code>
* for creating a <code>TemporaryQueue</code>.
* A <code>SessCreateDestRequest</code> is sent by a <code>Session</code>
* for creating a destination.
*/
public final class SessCreateTQRequest extends AbstractJmsRequest {
public final class SessCreateDestRequest extends AbstractJmsRequest {
/** define serialVersionUID for interoperability */
private static final long serialVersionUID = 1L;
/** Destination type, Queue or Topic, temporary or not. */
private byte type;
/**
* Returns the destination type, Queue or Topic, temporary or not.
*
* @return the destination type, Queue or Topic, temporary or not.
*/
private static final long serialVersionUID = 1L;
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_TQREQUEST;
return SESS_CREATE_DEST_REQUEST;
}
/** Constructs a <code>SessCreateTQRequest</code> instance. */
public SessCreateTQRequest() {
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