KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > dyade > aaa > admin > script > StartScript


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

22 package fr.dyade.aaa.admin.script;
23
24 import java.lang.*;
25 import java.io.*;
26 import java.util.*;
27 import fr.dyade.aaa.admin.cmd.*;
28 import fr.dyade.aaa.agent.conf.*;
29
30 /**
31  * StartScript contain a StartAdminCmd vector and a ServerDesc hashtable.
32  * It permits to start networks, servers and services.
33  *
34  * @see fr.dyade.aaa.agent.AgentAdmin
35  * @see fr.dyade.aaa.agent.AgentServer
36  * @see StartAdminCmd
37  * @see A3CMLConfig
38  * @see fr.dyade.aaa.agent.ServerDesc
39  */

40 public class StartScript implements Serializable {
41   /** vector of StartAdminCmd */
42   private Vector commands = null;
43   /** hashtable of server description */
44   public Hashtable serverDesc = null;
45
46  /**
47   * StartScript
48   *
49   * @see AgentAdmin
50   */

51   public StartScript() {
52     commands = new Vector();
53     serverDesc = new Hashtable();
54   }
55
56   public void add(StartAdminCmd cmd) {
57     commands.addElement(cmd);
58   }
59
60   public boolean remove(StartAdminCmd cmd) {
61     return commands.removeElement(cmd);
62   }
63
64   public boolean contains(StartAdminCmd cmd) {
65     return commands.contains(cmd);
66   }
67
68   public Enumeration elements() {
69     return commands.elements();
70   }
71
72   public int size() {
73     return commands.size();
74   }
75
76   public Object JavaDoc elementAt(int i)
77     throws ArrayIndexOutOfBoundsException JavaDoc {
78     return commands.elementAt(i);
79   }
80
81   public String JavaDoc toString() {
82     StringBuffer JavaDoc strBuf = new StringBuffer JavaDoc();
83     strBuf.append(getClass().getName());
84     strBuf.append("@");
85     strBuf.append(Integer.toHexString(hashCode()));
86     strBuf.append("(commands=");
87     strBuf.append(commands);
88     strBuf.append(",serverDesc=");
89     strBuf.append(serverDesc);
90     strBuf.append(")");
91     return strBuf.toString();
92   }
93
94 }
95
Popular Tags