001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: /*
038: * TargetBean.java
039: */
040:
041: package com.sun.jbi.jsf.bean;
042:
043: import com.sun.data.provider.TableDataProvider;
044: import com.sun.data.provider.impl.ObjectListDataProvider;
045: import com.sun.jbi.jsf.util.BeanUtilities;
046: import com.sun.jbi.jsf.util.I18nUtilities;
047: import com.sun.jbi.jsf.util.JBIConstants;
048: import com.sun.jbi.jsf.util.JBILogger;
049: import com.sun.jbi.ui.common.JBIAdminCommands;
050: import com.sun.jbi.ui.common.JBIComponentInfo;
051: import com.sun.jbi.ui.common.ServiceAssemblyInfo;
052: import java.util.ArrayList;
053: import java.util.List;
054: import java.util.logging.Logger;
055:
056: /**
057: * Provides properties used to populate stand-alone instance and cluster JBI view table
058: */
059: public class TargetBean {
060: /**
061: * Controls printing of diagnostic messages to the log
062: */
063: private static Logger sLog = JBILogger.getInstance();
064: /**
065: * default result for queries when no data found
066: */
067: private final static String DEFAULT_RESULT = "";
068:
069: public TargetBean() {
070: mJac = BeanUtilities.getClient();
071: }
072:
073: /**
074: * get the "target" stand-alone instance or cluster name
075: * @return the "target" name
076: */
077: public String getName() {
078: sLog.fine("TargetBean.getName(), mName=" + mName);
079: return mName;
080: }
081:
082: public TableDataProvider getSingleTargetComponentsTableData() {
083: sLog.fine("TargetBean.getSingleTargetComponentsTableData()2");
084:
085: sLog
086: .fine("TargetBean.getSingleTargetComponentsTableData(): mComponentsList="
087: + mComponentsList);
088:
089: TableDataProvider result = new ObjectListDataProvider(
090: mComponentsList);
091:
092: sLog
093: .fine("TargetBean.getSingleTargetComponentsTableData(): result="
094: + result);
095: return result;
096: }
097:
098: public TableDataProvider getSingleTargetDeploymentsTableData() {
099: sLog.fine("TargetBean.getSingleTargetDeploymentsTableData()");
100:
101: TableDataProvider result = new ObjectListDataProvider(
102: mDeploymentsList);
103:
104: sLog
105: .fine("TargetBean.getSingleTargetDeploymentsTableData(): result="
106: + result);
107: return result;
108: }
109:
110: public TableDataProvider getSingleTargetLibrariesTableData() {
111: sLog.fine("TargetBean.getSingleTargetLibrariesTableData()");
112:
113: TableDataProvider result = new ObjectListDataProvider(
114: mLibrariesList);
115:
116: sLog
117: .fine("TargetBean.getSingleTargetLibrariesTableData(): result="
118: + result);
119: return result;
120: }
121:
122: /**
123: * get the components list
124: * @return a List of zero or more components for this target.
125: */
126: public List getComponentsList() {
127: sLog.fine("TargetBean.getComponentsList(), mComponentsList="
128: + mComponentsList);
129: return mComponentsList;
130: }
131:
132: /**
133: * get the deployments list
134: * @return a List of zero or more deployments for this target.
135: */
136: public List getDeploymentsList() {
137: sLog.fine("TargetBean.getDeploymentsList(), mDeploymentsList="
138: + mDeploymentsList);
139: return mDeploymentsList;
140: }
141:
142: /**
143: * get the libraries list
144: * @return a List of zero or more libraries for this target.
145: */
146: public List getLibrariesList() {
147: sLog.fine("TargetBean.getLibrariesList(), mLibrariesList="
148: + mLibrariesList);
149: return mLibrariesList;
150: }
151:
152: /**
153: * set the "target" stand-alone instance or cluster name
154: * @param aName a "target" name
155: */
156: public void setName(String aName) {
157: mName = aName;
158: }
159:
160: /**
161: * set the components list
162: * @param aComponentsList a List of zero or more components for this target.
163: * An empty list implies installed/deployed to 'domain' only.
164: */
165: public void setComponentsList(List aComponentsList) {
166: sLog.fine("TargetBean.setComponentsList(" + aComponentsList
167: + ")");
168: mComponentsList = aComponentsList;
169: }
170:
171: /**
172: * set the deployments list
173: * @param aDeploymentsList a List of zero or more deployments for this target.
174: * An empty list implies installed/deployed to 'domain' only.
175: */
176: public void setDeploymentsList(List aDeploymentsList) {
177: sLog.fine("TargetBean.setDeploymentsList(" + aDeploymentsList
178: + ")");
179: mDeploymentsList = aDeploymentsList;
180: }
181:
182: /**
183: * set the libraries list
184: * @param aLibrariesList a List of zero or more libraries for this target.
185: * An empty list implies installed/deployed to 'domain' only.
186: */
187: public void setLibrariesList(List aLibrariesList) {
188: sLog
189: .fine("TargetBean.setLibrariesList(" + aLibrariesList
190: + ")");
191: mLibrariesList = aLibrariesList;
192: }
193:
194: // private methods
195:
196: // member variables
197:
198: /**
199: * cached JBI Admin Commands client
200: */
201: private JBIAdminCommands mJac;
202:
203: /**
204: * The "target" stand-alone instance or cluster name
205: */
206: private String mName;
207:
208: /**
209: * components for this target
210: */
211: private List mComponentsList = new ArrayList();
212:
213: /**
214: * deployments for this target
215: */
216: private List mDeploymentsList = new ArrayList();
217:
218: /**
219: * libraries for this target
220: */
221: private List mLibrariesList = new ArrayList();
222:
223: }
|