KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > joram > mom > notifications > AdminReply


1 /*
2  * JORAM: Java(TM) Open Reliable Asynchronous Messaging
3  * Copyright (C) 2003 - ScalAgent Distributed Technologies
4  * Copyright (C) 2004 - France Telecom R&D
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 org.objectweb.joram.mom.notifications;
25
26 /**
27  * An <code>AdminReply</code> is used by a destination agent for replying to
28  * a client administration request.
29  */

30 public class AdminReply extends AbstractNotification
31 {
32   /** Field identifying the original request. */
33   private String JavaDoc requestId;
34   /** <code>true</code> if the request succeeded. */
35   private boolean success;
36   /** Info related to the processing of the request. */
37   private String JavaDoc info;
38   /** possible return object */
39   private Object JavaDoc replyObj;
40
41   /**
42    * Constructs an <code>AdminReply</code>.
43    */

44   public AdminReply(AdminRequest request,
45                     boolean success,
46                     String JavaDoc info) {
47     this(request,success,info,null);
48   }
49
50   /**
51    * Constructs an <code>AdminReply</code>.
52    */

53   public AdminReply(AdminRequest request,
54                     boolean success,
55                     String JavaDoc info,
56                     Object JavaDoc replyObj)
57   {
58     requestId = request.getId();
59     this.success = success;
60     this.info = info;
61     this.replyObj = replyObj;
62   }
63
64
65   /** Returns the request identifier. */
66   public String JavaDoc getRequestId()
67   {
68     return requestId;
69   }
70
71   /** Returns <code>true</code> if the request was successful. */
72   public boolean getSuccess()
73   {
74     return success;
75   }
76
77   /** Returns the info related to the processing of the request. */
78   public String JavaDoc getInfo()
79   {
80     return info;
81   }
82
83   /** Returns an object related to the processing of the request. */
84   public Object JavaDoc getReplyObject() {
85     return replyObj;
86   }
87 }
88
Popular Tags