/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). You
* may not use this file except in compliance with the License. You can
* obtain a copy of the License at
* or packager/legal/LICENSE.txt. See the License for the specific
* language governing permissions and limitations under the License.
*
* When distributing the software, include this License Header Notice in each
* file and include the License file at packager/legal/LICENSE.txt.
*
* GPL Classpath Exception:
* Oracle designates this particular file as subject to the "Classpath"
* exception as provided by Oracle in the GPL Version 2 section of the License
* file that accompanied this code.
*
* Modifications:
* If applicable, add the following below the License Header, with the fields
* enclosed by brackets [] replaced by your own identifying information:
* "Portions Copyright [year] [name of copyright owner]"
*
* Contributor(s):
* If you wish your version of this file to be governed by only the CDDL or
* only the GPL Version 2, indicate your decision by adding "[Contributor]
* elects to include this software in this distribution under the [CDDL or GPL
* Version 2] license." If you don't indicate a single choice of license, a
* recipient has the option to distribute your version of this file under
* either the CDDL, the GPL Version 2 or to extend the choice of license to
* its licensees as provided above. However, if you add GPL Version 2 code
* and therefore, elected the GPL Version 2 license, then the option applies
* only if the new code is made subject to such option by the copyright
* holder.
*/
/**
* Top level Domain Element that includes applications, resources, configs,
* servers, clusters and node-agents, load balancer configurations and load
*
*/
/**
* Gets the value of the applicationRoot property.
*
* For PE this defines the location where applications are deployed
*
* @return possible object is
* {@link String }
*/
/**
* Sets the value of the applicationRoot property.
*
* @param value allowed object is
* {@link String }
*/
/**
* Gets the value of the logRoot property.
*
* Specifies where the server instance's log files are kept, including
* HTTP access logs, server logs, and transaction logs.
* Default is $INSTANCE-ROOT/logs
*
* @return possible object is
* {@link String }
*/
/**
* Sets the value of the logRoot property.
*
* @param value allowed object is
* {@link String }
*/
/**
* Gets the value of the locale property.
*
* @return possible object is
* {@link String }
*/
/**
* Sets the value of the locale property.
*
* @param value allowed object is
* {@link String }
*/
/**
* Gets the value of the version property. It is read-only.
*
* Tools are not to depend on this property. It is only for reference.
*
* @return String representing version of the Domain.
*/
/**
* Gets the SecureAdmin value defined in the domain.
* @return {@link SecureAdmin }
*/
/**
* Sets the SecureAdmin value.
* @param secureAdmin
*/
/**
* Gets the value of the applications property.
*
* @return possible object is
* {@link Applications }
*/
/**
* Sets the value of the system-applications property.
*
* @param value allowed object is
* {@link Applications }
*/
/**
* Sets the value of the system-applications property.
*
* @param value allowed object is
* {@link Applications }
*/
/**
* Gets the value of the resources property.
*
* @return possible object is
* {@link Resources }
*/
/**
* Sets the value of the resources property.
*
* @param value allowed object is
* {@link Resources }
*/
/**
* Gets the value of the configs property.
*
* @return possible object is
* {@link Configs }
*/
/**
* Sets the value of the configs property.
*
* @param value allowed object is
* {@link Configs }
*/
/**
* Gets the value of the servers property.
*
* @return possible object is
* {@link Servers }
*/
/**
* Sets the value of the servers property.
*
* @param value allowed object is
* {@link Servers }
*/
/**
* Gets the value of the clusters property.
*
* @return possible object is
* {@link Clusters }
*/
/**
* Sets the value of the clusters property.
*
* @param value allowed object is
* {@link Clusters }
*/
/**
* Gets the value of the nodes property.
*
* @return possible object is
* {@link Nodes }
*/
/**
* Sets the value of the nodes property.
*
* @param value allowed object is
* {@link Nodes }
*/
/**
* Gets the value of the nodeAgents property.
*
* @return possible object is
* {@link NodeAgents }
*/
/**
* Sets the value of the nodeAgents property.
*
* @param value allowed object is
* {@link NodeAgents }
*/
/**
* Gets the value of the lbConfigs property.
*
* @return possible object is
* {@link LbConfigs }
*/
/**
* Sets the value of the lbConfigs property.
*
* @param value allowed object is
* {@link LbConfigs }
*/
/**
* Gets the value of the loadBalancers property.
*
* @return possible object is
* {@link LoadBalancers }
*/
/**
* Sets the value of the loadBalancers property.
*
* @param value allowed object is
* {@link LoadBalancers }
*/
/**
* Gets the value of the systemProperty property.
* <p/>
* <p/>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the systemProperty property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
* <pre>
* getSystemProperty().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
* Objects of the following type(s) are allowed in the list
* {@link SystemProperty }
*/
systemProperties=true,
props={
description="Operating system dependent. Path to the directory where the server is installed"),
description="Operating system dependent. Path to the top level directory for a server instance"),
description="Operating system dependent. Path to the name of the host (machine)"),
description="Operating system dependent. Path to the library directory for the Sun GlassFish Message Queue software"),
description="Operating system dependent. Path to the installation directory for the Java runtime"),
description="Operating system dependent. Path to the installation directory for the Java runtime"),
description="Name of the <config> used by a server instance"),
description="Name of the server instance. Not used in the default configuration, but can be used to customize configuration"),
description="Name of the domain. Not used in the default configuration, but can be used to customize configuration")
}
)
/**
Properties as per {@link PropertyBag}
*/
@PropertiesDesc(props={})
/**
* Returns the list of system-applications that are referenced from the given server.
* A server references an application, if the server has an element named
* <application-ref> in it that points to given application. The given server
* is a <server> element inside domain.
*
* @param sn the string denoting name of the server
* @return List of system-applications for that server, an empty list in case there is none
*/
class Duck {
}
/* return an empty list if given garbage -- or errors are encountered
* or if no matches
*/
try {
return ret;
}
}
catch(Exception e) {
}
return ret;
}
/* return an empty list if given garbage -- or errors are encountered
* or if no matches
*/
try {
}
}
}
catch(Exception e) {
Logger.getAnonymousLogger().warning("Error when getting clusters on node " + e.getLocalizedMessage());
}
}
if (m instanceof Application)
}
}
}
theServer = s;
break;
}
}
break;
}
}
}
return aref;
}
return server.getApplicationRef();
} else {
return Collections.EMPTY_LIST;
}
}
throw new IllegalArgumentException("Null argument");
return allApps; //if there are no sys-apps, none can reference one :)
//allApps now contains ALL the system applications
}
}
}
}
//returns null in case there is none
return app;
}
}
return null;
}
public static boolean isNamedSystemApplicationReferencedFrom(Domain d, String appName, String serverName) {
return true;
}
return false;
}
throw new IllegalArgumentException ("no <servers> element");
return s;
}
}
return null;
}
throw new IllegalArgumentException ("no <config> element");
return c;
}
}
return null;
}
return null;
}
return c;
}
}
return null;
}
return null;
}
return n;
}
}
return null;
}
return false;
}
} else {
if (referencedTargets == null) {
}
}
// standalone instance case
return true;
}
// cluster instance case
return true;
}
}
}
}
return false;
}
} else {
}
}
return servers;
}
}
} else {
}
} else {
if (includeInstances) {
}
}
}
}
}
return allAppRefs;
}
return ref;
}
}
return null;
}
public static boolean isAppRefEnabledInTarget(
boolean found = false;
if (containingCluster != null) {
// if this is a clustered instance, check the enable
// attribute of its enclosing cluster first
// and return false if the cluster level enable attribute
// is false
if (clusterRef == null ||
return false;
}
}
for (ApplicationRef ref :
found = true;
return false;
}
}
}
if (found) {
return true;
}
return false;
}
public static boolean isAppEnabledInTarget(
appName);
if (application != null &&
} else {
}
return false;
}
}
return true;
}
return false;
}
// only add non-clustered servers as the cluster
// targets will be separately added
}
}
if (d.getClusters() != null) {
}
}
return targets;
}
}
}
return referencedTargets;
}
// special target domain
}
}
}
return apps;
}
return appRef.getVirtualServers();
} else {
return null;
}
}
return appRef.getEnabled();
} else {
return null;
}
}
// Clusters and Servers are ReferenceContainers
if(c != null)
return c;
return getServerNamed(d, name);
}
// Clusters and Servers are ReferenceContainers
// both the config and its name need to be sanity-checked
return sub;
}
return sub;
}
if (d.getClusters() != null) {
}
return ReferenceContainers;
}
return cluster;
}
}
}
return null;
}
}
}
}