KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > scalagent > kjoram > jms > SessCreateTDReply


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2001 - ScalAgent Distributed Technologies
4  * Copyright (C) 1996 - Dyade
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA.
20  *
21  * Initial developer(s): Frederic Maistre (INRIA)
22  * Contributor(s): Nicolas Tachker (ScalAgent)
23  */

24 package com.scalagent.kjoram.jms;
25
26 import java.util.Hashtable JavaDoc;
27 import java.util.Enumeration JavaDoc;
28
29 /**
30  * A <code>SessCreateTDReply</code> is used by a JMS proxy for replying
31  * to a <code>SessCreate&lt;TQ/TT&gt;Request</code>.
32  */

33 public class SessCreateTDReply extends AbstractJmsReply
34 {
35   /** The string identifier of the temporary destination agent. */
36   private String JavaDoc agentId;
37
38
39   /**
40    * Constructs a <code>SessCreateTDReply</code> instance.
41    *
42    * @param request The replied request.
43    * @param agentId String identifier of the destination agent.
44    */

45   public SessCreateTDReply(AbstractJmsRequest request, String JavaDoc agentId)
46   {
47     super(request.getRequestId());
48     this.agentId = agentId;
49   }
50
51   /**
52    * Constructs a <code>SessCreateTDReply</code> instance.
53    */

54   public SessCreateTDReply()
55   {}
56
57
58   /** Sets the destination identifier. */
59   public void setAgentId(String JavaDoc agentId)
60   {
61     this.agentId = agentId;
62   }
63
64   /** Returns the temporary destination's agent identifier. */
65   public String JavaDoc getAgentId()
66   {
67     return agentId;
68   }
69
70   public Hashtable JavaDoc soapCode() {
71     Hashtable JavaDoc h = super.soapCode();
72     if (agentId != null)
73       h.put("agentId",agentId);
74     return h;
75   }
76
77   public static Object JavaDoc soapDecode(Hashtable JavaDoc h) {
78     SessCreateTDReply req = new SessCreateTDReply();
79     req.setCorrelationId(((Integer JavaDoc) h.get("correlationId")).intValue());
80     req.setAgentId((String JavaDoc) h.get("agentId"));
81     return req;
82   }
83 }
84
Popular Tags