Moved template files to separate directory.

Modified onos.sh and onos_node.conf to be able to config hazelcast.xml.

Modified some of onos.sh parameters to use default value.

Modified ZooKeeper's log dir to be configurable.

Refactored onos.sh.
 - Aggregated parameters' default value to declaration point.
 - Segregate common routines to functions.

Change-Id: Ia1e83fc9666c58b8897d4e2daef0326c400f48bd
diff --git a/conf/template/hazelcast.xml.template b/conf/template/hazelcast.xml.template
new file mode 100644
index 0000000..77db87c
--- /dev/null
+++ b/conf/template/hazelcast.xml.template
@@ -0,0 +1,104 @@
+<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config
+	http://www.hazelcast.com/schema/config/hazelcast-config-3.0.xsd"
+	xmlns="http://www.hazelcast.com/schema/config"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <!-- Configuration of maps used as a data store. -->
+  <map name="datastore://*">
+    <!-- must use 'sync' backup to imitate other data store -->
+    <backup-count>3</backup-count>
+    <async-backup-count>0</async-backup-count>
+    <!-- must be false for strong consistency -->
+    <read-backup-data>false</read-backup-data>
+    <!-- near cache must not be used -->
+  </map>
+
+  <map name="*">
+
+    <!--
+    Number of sync-backups. If 1 is set as the backup-count for example,
+    then all entries of the map will be copied to another JVM for
+    ail-safety. Valid numbers are 0 (no backup), 1, 2, 3.
+    -->
+    <backup-count>0</backup-count>
+
+    <!--
+    Number of async-backups. If 1 is set as the backup-count for example,
+    then all entries of the map will be copied to another JVM for
+    fail-safety. Valid numbers are 0 (no backup), 1, 2, 3.
+    -->
+    <async-backup-count>3</async-backup-count>
+
+    <!--
+    Can we read the local backup entries? Default value is false for
+    strong consistency. Being able to read backup data will give you
+    greater performance.
+    -->
+    <read-backup-data>true</read-backup-data>
+
+    <near-cache>
+      <!--
+	  Maximum size of the near cache. When max size is reached,
+	  cache is evicted based on the policy defined.
+	  Any integer between 0 and Integer.MAX_VALUE. 0 means
+	  Integer.MAX_VALUE. Default is 0.
+      -->
+      <max-size>0</max-size>
+      <!--
+	  Maximum number of seconds for each entry to stay in the near cache.
+	  Entries that are older than <time-to-live-seconds> will get
+	  automatically evicted from the near cache.
+	  Any integer between 0 and Integer.MAX_VALUE. 0 means infinite.
+	  Default is 0.
+      -->
+      <time-to-live-seconds>0</time-to-live-seconds>
+
+      <!--
+	  Maximum number of seconds each entry can stay in the near cache as
+	  untouched (not-read).
+	  Entries that are not read (touched) more than <max-idle-seconds>
+	  value will get removed from the near cache.
+	  Any integer between 0 and Integer.MAX_VALUE. 0 means
+	  Integer.MAX_VALUE. Default is 0.
+      -->
+      <max-idle-seconds>0</max-idle-seconds>
+
+      <!--
+	  Valid values are:
+	  NONE (no extra eviction, <time-to-live-seconds> may still apply),
+	  LRU (Least Recently Used),
+	  LFU (Least Frequently Used).
+	  LRU is the default.
+	  Regardless of the eviction policy used, <time-to-live-seconds> will
+	  still apply.
+      -->
+      <eviction-policy>NONE</eviction-policy>
+
+      <!--
+	  Should the cached entries get evicted if the entries are changed
+	  (updated or removed).
+	  true of false. Default is true.
+      -->
+      <invalidate-on-change>true</invalidate-on-change>
+
+    </near-cache>
+  </map>
+
+  <topic name="*">
+    <global-ordering-enabled>false</global-ordering-enabled>
+  </topic>
+
+  <network>
+    <port auto-increment="true">5701</port>
+    <join>
+__HC_NETWORK__
+      <aws enabled="false">
+      </aws>
+    </join>
+  </network>
+
+  <properties>
+    <property name="hazelcast.logging.type">slf4j</property>
+    <property name="hazelcast.version.check.enabled">false</property>
+  </properties>
+</hazelcast>