KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > clif > scenario > util > isac > engine > behavior > node > description > ActionDescription


1 /*
2 * CLIF is a Load Injection Framework
3 * Copyright (C) 2004 France Telecom R&D
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * CLIF
20 *
21 * Contact: clif@objectweb.org
22 */

23 package org.objectweb.clif.scenario.util.isac.engine.behavior.node.description;
24
25 import java.util.Hashtable JavaDoc;
26
27 /**
28  * This class will store the description of a classic plugin action
29  *
30  * @author JC Meillaud
31  * @author A Peyrard
32  */

33 public class ActionDescription {
34     // attributes
35
private String JavaDoc sessionObjectId ;
36     private int methodNumber ;
37     private Hashtable JavaDoc params ;
38
39     /**
40      * Constructor, build a new Action description
41      */

42     public ActionDescription() {
43         this.sessionObjectId = null ;
44         this.methodNumber = -1 ;
45         this.params = new Hashtable JavaDoc() ;
46     }
47     
48     /**
49      * Constructor, build a new Action description
50      * with the specified parameters
51      * @param so The sessionObject id
52      * @param mn The methodNumber
53      */

54     public ActionDescription(String JavaDoc so, int mn) {
55         this.sessionObjectId = so ;
56         this.methodNumber = mn ;
57         this.params = new Hashtable JavaDoc() ;
58     }
59     
60     /**
61      * Constructor, build a new Action description
62      * with the specified parameters
63      * @param so The sessionObject id
64      * @param mn The methodNumber
65      * @param p The parameters
66      */

67     public ActionDescription(String JavaDoc so, int mn, Hashtable JavaDoc p) {
68         this.sessionObjectId = so ;
69         this.methodNumber = mn ;
70         this.params = p ;
71     }
72     
73     /**
74      * this method adds a new parameter value in the table
75      * @param name the name of the parameter
76      * @param value The value to add
77      */

78     public void addParamsValue(String JavaDoc name, String JavaDoc value) {
79         this.params.put(name, value) ;
80     }
81     
82     /////////////////////////////////////
83
// Attributes getters and setters
84
/////////////////////////////////////
85

86     /**
87      * @return Returns the methodNumber.
88      */

89     public int getMethodNumber() {
90         return methodNumber;
91     }
92     /**
93      * @return Returns the params.
94      */

95     public Hashtable JavaDoc getParams() {
96         return params;
97     }
98     /**
99      * @return Returns the sessionObject.
100      */

101     public String JavaDoc getSessionObjectId() {
102         return sessionObjectId;
103     }
104     /**
105      * @param params The params to set.
106      */

107     public void setParams(Hashtable JavaDoc params) {
108         this.params = params;
109     }
110     /**
111      * @param methodNumber The methodNumber to set.
112      */

113     public void setMethodNumber(int methodNumber) {
114         this.methodNumber = methodNumber;
115     }
116     /**
117      * @param sessionObjectId The sessionObject to set.
118      */

119     public void setSessionObject(String JavaDoc sessionObjectId) {
120         this.sessionObjectId = sessionObjectId;
121     }
122     
123     ////////////////////////////////////////////////////////
124
// Debugging methods...
125
////////////////////////////////////////////////////////
126

127     public String JavaDoc toString() {
128         String JavaDoc result = "" ;
129         result = result.concat("mn : "+methodNumber+"\n") ;
130         result = result.concat("so :"+sessionObjectId+" \n") ;
131         result = result.concat("params = " + this.params) ;
132         return result ;
133     }
134
135 }
136
Popular Tags