001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 2003-2004 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: JndiResourceForm.java 9608 2006-09-19 14:18:02Z danesa $
023: * --------------------------------------------------------------------------
024: */package org.objectweb.jonas.webapp.jonasadmin.jonasserver;
025:
026: import java.util.ArrayList;
027: import java.util.Collections;
028: import java.util.List;
029: import javax.servlet.http.HttpServletRequest;
030:
031: import org.apache.struts.action.ActionMapping;
032: import org.objectweb.jonas.webapp.jonasadmin.common.BeanComparator;
033:
034: /**
035: * @author Michel-Ange ANTON
036: */
037: public class JndiResourceForm extends BasicJonasServerForm {
038:
039: // --------------------------------------------------------- Properties variables
040: /**
041: * registry protocol from carl.properties
042: */
043: private String registryProtocol = null;
044: /**
045: * Names of registered objects when protocol is not cmi
046: */
047: private ArrayList listNames = new ArrayList();
048: /**
049: * For cmi, in the list we have a 2 elements array were the 1st
050: * element equal the name and the 2nd element equals the nodes list
051: */
052: private ArrayList listNamesAndNodes = new ArrayList();
053:
054: // --------------------------------------------------------- Public Methods
055:
056: public void reset(ActionMapping mapping, HttpServletRequest request) {
057: super .reset(mapping, request);
058: listNames = new ArrayList();
059: listNamesAndNodes = new ArrayList();
060: //v = new Vector();
061: }
062:
063: // --------------------------------------------------------- Properties Methods
064:
065: /**
066: * @return the names of registered objects when protocol is not cmi
067: */
068: public ArrayList getListNames() {
069: return listNames;
070: }
071:
072: /**
073: * @param pList the names of registered objects when protocol is not cmi
074: */
075: public void setListNames(List pList) {
076: listNames.clear();
077: listNames = new ArrayList(pList);
078: Collections.sort(listNames, new BeanComparator());
079: }
080:
081: /**
082: * @return the registry protocol from carl.properties
083: */
084: public String getRegistryProtocol() {
085: return registryProtocol;
086: }
087:
088: /**
089: * @param protocol the registry protocol from carl.properties
090: */
091: public void setRegistryProtocol(String protocol) {
092: this .registryProtocol = protocol;
093: }
094:
095: /**
096: * @param pList for cmi, in the list we have a 2 elements array were the 1st
097: * element equal the name and the 2nd element equals the nodes list
098: */
099: public void setVector(List pList) {
100: listNamesAndNodes.clear();
101: listNamesAndNodes = new ArrayList(pList);
102: Collections.sort(listNamesAndNodes, new BeanComparator());
103: }
104:
105: /**
106: * @return for cmi, a list haveing 2 elements array were the 1st
107: * element equals the name and the 2nd element equals the nodes list
108: */
109: public ArrayList getVector() {
110: return this.listNamesAndNodes;
111: }
112: }
|