blob: 0045b4931eafdcfc0c4f18074ed2e6290a56a9c4 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_80) on Tue Aug 30 09:58:50 EDT 2016 -->
<title>SystemConfiguration</title>
<meta name="date" content="2016-08-30">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SystemConfiguration";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SystemConfiguration.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/pirk/utils/StringUtils.html" title="class in org.apache.pirk.utils"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/pirk/utils/SystemConfiguration.html" target="_top">Frames</a></li>
<li><a href="SystemConfiguration.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.pirk.utils</div>
<h2 title="Class SystemConfiguration" class="title">Class SystemConfiguration</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.pirk.utils.SystemConfiguration</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">SystemConfiguration</span>
extends java.lang.Object</pre>
<div class="block">Manages system properties. At first loading of this class, it will:
<p>
1) Load in the DEFAULT_PROPERTY_FILE, if found on the classpath. (Currently 'pirk.properties')
<p>
2) Load in any properties files in the LOCAL_PROPERTIES_DIR. The filenames must end with '.properties'
<p>
3) Load in properties from the QUERIER_PROPERTIES_FILE and RESPONDER_PROPERTIES_FILE</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#SystemConfiguration()">SystemConfiguration</a></strong>()</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#appendProperty(java.lang.String,%20java.lang.String)">appendProperty</a></strong>(java.lang.String&nbsp;propertyName,
java.lang.String&nbsp;value)</code>
<div class="block">Appends a property via a comma separated list</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#getBooleanProperty(java.lang.String,%20boolean)">getBooleanProperty</a></strong>(java.lang.String&nbsp;propertyName,
boolean&nbsp;defaultValue)</code>
<div class="block">Gets the specified property as a <code>boolean</code>, or the default value if the property isn't defined.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static int</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#getIntProperty(java.lang.String,%20int)">getIntProperty</a></strong>(java.lang.String&nbsp;propertyName,
int&nbsp;defaultValue)</code>
<div class="block">Gets the specified property as an <code>int</code>, or the default value if the property isn't found.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#getProperty(java.lang.String)">getProperty</a></strong>(java.lang.String&nbsp;propertyName)</code>
<div class="block">Gets the specified property; returns <code>null</code> if the property isn't found.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#getProperty(java.lang.String,%20java.lang.String)">getProperty</a></strong>(java.lang.String&nbsp;propertyName,
java.lang.String&nbsp;defaultValue)</code>
<div class="block">Gets the specified property as a <code>String</code>, or the default value if the property isn't found.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#hasProperty(java.lang.String)">hasProperty</a></strong>(java.lang.String&nbsp;propertyName)</code>
<div class="block">Returns true iff the given property name is defined.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#initialize()">initialize</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#isSetTrue(java.lang.String)">isSetTrue</a></strong>(java.lang.String&nbsp;propertyName)</code>
<div class="block">Returns <code>true</code> iff the specified boolean property value is "true".</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#loadPropsFromDir(java.lang.String)">loadPropsFromDir</a></strong>(java.lang.String&nbsp;dirName)</code>
<div class="block">Loads the properties from local properties file in the specified directory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#loadPropsFromFile(java.io.File)">loadPropsFromFile</a></strong>(java.io.File&nbsp;file)</code>
<div class="block">Loads the properties from the specified file.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#loadPropsFromResource(java.lang.String)">loadPropsFromResource</a></strong>(java.lang.String&nbsp;name)</code>
<div class="block">Loads the properties from the specified resource on the current classloader.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/pirk/utils/SystemConfiguration.html#setProperty(java.lang.String,%20java.lang.String)">setProperty</a></strong>(java.lang.String&nbsp;propertyName,
java.lang.String&nbsp;value)</code>
<div class="block">Sets the property to the given value.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="SystemConfiguration()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SystemConfiguration</h4>
<pre>public&nbsp;SystemConfiguration()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="initialize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initialize</h4>
<pre>public static&nbsp;void&nbsp;initialize()</pre>
</li>
</ul>
<a name="getProperty(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProperty</h4>
<pre>public static&nbsp;java.lang.String&nbsp;getProperty(java.lang.String&nbsp;propertyName)</pre>
<div class="block">Gets the specified property; returns <code>null</code> if the property isn't found.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The name of the requested property.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The value of the property, or <code>null</code> if the property cannot be found.</dd></dl>
</li>
</ul>
<a name="getProperty(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getProperty</h4>
<pre>public static&nbsp;java.lang.String&nbsp;getProperty(java.lang.String&nbsp;propertyName,
java.lang.String&nbsp;defaultValue)</pre>
<div class="block">Gets the specified property as a <code>String</code>, or the default value if the property isn't found.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The name of the requested string property value.</dd><dd><code>defaultValue</code> - The value to return if the property is undefined.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The value of the requested property, or the default value if the property is undefined.</dd></dl>
</li>
</ul>
<a name="getIntProperty(java.lang.String, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIntProperty</h4>
<pre>public static&nbsp;int&nbsp;getIntProperty(java.lang.String&nbsp;propertyName,
int&nbsp;defaultValue)</pre>
<div class="block">Gets the specified property as an <code>int</code>, or the default value if the property isn't found.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The name of the requested int property value.</dd><dd><code>defaultValue</code> - The value to return if the property is undefined.</dd>
<dt><span class="strong">Returns:</span></dt><dd>The value of the requested property, or the default value if the property is undefined.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.lang.NumberFormatException</code> - If the property does not contain a parsable <code>int</code> value.</dd></dl>
</li>
</ul>
<a name="getBooleanProperty(java.lang.String, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBooleanProperty</h4>
<pre>public static&nbsp;boolean&nbsp;getBooleanProperty(java.lang.String&nbsp;propertyName,
boolean&nbsp;defaultValue)</pre>
<div class="block">Gets the specified property as a <code>boolean</code>, or the default value if the property isn't defined.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The name of the requested boolean property value.</dd><dd><code>defaultValue</code> - The value to return if the property is undefined.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the property is defined and has the value "true", otherwise <code>defaultValue</code>.</dd></dl>
</li>
</ul>
<a name="isSetTrue(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSetTrue</h4>
<pre>public static&nbsp;boolean&nbsp;isSetTrue(java.lang.String&nbsp;propertyName)</pre>
<div class="block">Returns <code>true</code> iff the specified boolean property value is "true".
<p>
If the property is not found, or it's value is not "true" then the method will return <code>false</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The name of the requested boolean property value.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the property is defined and has the value "true", otherwise <code>false</code>.</dd></dl>
</li>
</ul>
<a name="setProperty(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setProperty</h4>
<pre>public static&nbsp;void&nbsp;setProperty(java.lang.String&nbsp;propertyName,
java.lang.String&nbsp;value)</pre>
<div class="block">Sets the property to the given value.
<p>
Any previous values stored at the same property name are replaced.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The name of the property to set.</dd><dd><code>value</code> - The property value.</dd></dl>
</li>
</ul>
<a name="hasProperty(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasProperty</h4>
<pre>public static&nbsp;boolean&nbsp;hasProperty(java.lang.String&nbsp;propertyName)</pre>
<div class="block">Returns true iff the given property name is defined.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The property name to test.</dd>
<dt><span class="strong">Returns:</span></dt><dd><code>true</code> if the property is found in the configuration, or <code>false</code> otherwise.</dd></dl>
</li>
</ul>
<a name="appendProperty(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>appendProperty</h4>
<pre>public static&nbsp;void&nbsp;appendProperty(java.lang.String&nbsp;propertyName,
java.lang.String&nbsp;value)</pre>
<div class="block">Appends a property via a comma separated list
<p>
If the property does not exist, it adds it.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>propertyName</code> - The property whose value is to be appended with the given value.</dd><dd><code>value</code> - The value to be stored, or appended to the current value.</dd></dl>
</li>
</ul>
<a name="loadPropsFromDir(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>loadPropsFromDir</h4>
<pre>public static&nbsp;void&nbsp;loadPropsFromDir(java.lang.String&nbsp;dirName)</pre>
<div class="block">Loads the properties from local properties file in the specified directory.
<p>
All files ending in '.properties' will be loaded. The new properties are added to the current system configuration.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dirName</code> - The directory to search for the new properties files.</dd></dl>
</li>
</ul>
<a name="loadPropsFromFile(java.io.File)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>loadPropsFromFile</h4>
<pre>public static&nbsp;void&nbsp;loadPropsFromFile(java.io.File&nbsp;file)</pre>
<div class="block">Loads the properties from the specified file.
<p>
The new properties are added to the current system configuration.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - The properties file containing the system properties to add.</dd></dl>
</li>
</ul>
<a name="loadPropsFromResource(java.lang.String)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>loadPropsFromResource</h4>
<pre>public static&nbsp;void&nbsp;loadPropsFromResource(java.lang.String&nbsp;name)</pre>
<div class="block">Loads the properties from the specified resource on the current classloader.
<p>
The new properties are added to the current system configuration.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - The name of the resource defining the properties.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/SystemConfiguration.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/pirk/utils/StringUtils.html" title="class in org.apache.pirk.utils"><span class="strong">Prev Class</span></a></li>
<li>Next Class</li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/pirk/utils/SystemConfiguration.html" target="_top">Frames</a></li>
<li><a href="SystemConfiguration.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>