/*
* 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.
*/
/**
* Bunch of utility methods for the new serverbeans config api based on jaxb
*/
public final class ConfigBeansUtilities {
// dochez : this class needs to be killed but I have no time to do it now
// I am making it a singleton, will force its initialization early enough so
// users can continue using the static method. Eventually all these methods will
// need to be moved to @DuckTyped methods on the interfaces directory.
public ConfigBeansUtilities() {
}
/**
* Get the default value of Format from dtd
*/
return "%client.name% %auth-user-name% %datetime% %request% %status% %response.length%";
}
/**
* Get the default value of RotationPolicy from dtd
*/
return "time";
}
/**
* Get the default value of RotationEnabled from dtd
*/
return "true";
}
/**
* Get the default value of RotationIntervalInMinutes from dtd
*/
return "1440";
}
/**
* Get the default value of QueueSizeInBytes from dtd
*/
return "4096";
}
/**
* This method is used to convert a string value to boolean.
*
* @return true if the value is one of true, on, yes, 1. Note
* that the values are case sensitive. If it is not one of these
* values, then, it returns false.
*/
return "true".equals(v)
|| "yes".equals(v)
|| "on".equals(v)
|| "1".equals(v);
} else {
return false;
}
}
/** 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
*/
throw new IllegalArgumentException("Null argument");
return allApps; //if there are no sys-apps, none can reference one :)
}
//allApps now contains ALL the system applications
}
}
}
return referencedApps;
}
//returns null in case there is none
return app;
}
}
return null;
}
return true;
}
return false;
}
throw new IllegalArgumentException ("Either domain is null or no <servers> element");
}
throw new IllegalArgumentException ("Either domain is null or no <servers> element");
return s;
}
}
return null;
}
if (m instanceof Application)
}
}
return allSysApps;
}
/**
* Lists the app refs for non-system apps assigned to the specified server
* @param sn server name
* @return List of ApplicationRef for non-system apps assigned to the specified server
*/
return getApplicationRefsInServer(sn, true);
}
/**
* Lists the app refs for apps assigned to the specified server, excluding
* system apps from the result if requested.
* @param sn server name to check
* @param excludeSystemApps whether system apps should be excluded
* @return List of ApplicationRef for apps assigned to the specified server
*/
public static List<ApplicationRef> getApplicationRefsInServer(String sn, boolean excludeSystemApps) {
theServer = s;
break;
}
}
boolean isSystem = false;
isSystem = true;
break;
}
}
if (!isSystem) {
}
}
return result;
} else {
}
}
theServer = s;
break;
}
}
break;
}
}
}
return aref;
}
return module;
}
}
return null;
}
return appRef.getEnabled();
} else {
return null;
}
}
return appRef.getVirtualServers();
} else {
return null;
}
}
return null;
}
if (module instanceof Application) {
} else {
return null;
}
}
return null;
}
if (module instanceof Application) {
} else if (module instanceof J2eeApplication) {
} else {
return null;
}
}
return null;
}
if (module instanceof Application) {
} else if (module instanceof ConnectorModule) {
} else if (module instanceof AppclientModule) {
} else if (module instanceof J2eeApplication) {
}
try {
} else {
return null;
}
} catch (URISyntaxException e) {
return null;
}
}
return null;
}
if (module instanceof Application) {
} else if (module instanceof ConnectorModule) {
} else if (module instanceof AppclientModule) {
} else if (module instanceof J2eeApplication) {
} else {
return null;
}
}
}
}
}
}
return domain;
}
}