summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShireesh Anjal <shireesh@gluster.com>2011-02-08 21:09:29 +0530
committerShireesh Anjal <shireesh@gluster.com>2011-02-08 21:09:29 +0530
commit9438d94101e33638affc463953bd22d18ca0c6d6 (patch)
tree8f25d09622ef0f628bea92f7c52c7dd4f9e738a9
parentcf9c3498b400ea5b04a2d93e019e94c85759ea8a (diff)
Introduced server discovery task
-rw-r--r--com.gluster.storage.management.gui.feature.webstart/feature.xml6
-rw-r--r--com.gluster.storage.management.gui.feature/feature.xml44
-rw-r--r--com.gluster.storage.management.server/WebContent/WEB-INF/lib/aopalliance-1.0.jarbin0 -> 4467 bytes
-rw-r--r--com.gluster.storage.management.server/src/applicationContext.xml16
-rw-r--r--com.gluster.storage.management.server/src/com/gluster/storage/management/server/tasks/ServerDiscoveryTask.java51
5 files changed, 110 insertions, 7 deletions
diff --git a/com.gluster.storage.management.gui.feature.webstart/feature.xml b/com.gluster.storage.management.gui.feature.webstart/feature.xml
index 4d43f5c0..21aed36a 100644
--- a/com.gluster.storage.management.gui.feature.webstart/feature.xml
+++ b/com.gluster.storage.management.gui.feature.webstart/feature.xml
@@ -4,9 +4,9 @@
label="Gluster Management Console - GUI Feature for Webstart"
version="1.0.0"
provider-name="Gluster Inc."
- os="linux,win32"
- ws="gtk,win32"
- arch="x86,x86_64">
+ os="linux,macosx,win32"
+ ws="cocoa,gtk,win32"
+ arch="x86,x86_64,amd64">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
diff --git a/com.gluster.storage.management.gui.feature/feature.xml b/com.gluster.storage.management.gui.feature/feature.xml
index 70b73c7d..6b384e7b 100644
--- a/com.gluster.storage.management.gui.feature/feature.xml
+++ b/com.gluster.storage.management.gui.feature/feature.xml
@@ -4,9 +4,9 @@
label="Gluster Storage Platform - GUI Feature"
version="1.0.0"
provider-name="GLUSTER"
- os="linux,win32"
- ws="gtk,win32"
- arch="x86,x86_64">
+ os="linux,macosx,win32"
+ ws="cocoa,gtk,win32"
+ arch="x86,x86_64,amd64">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
@@ -741,4 +741,42 @@
fragment="true"
unpack="false"/>
+ <plugin
+ id="org.eclipse.equinox.launcher.cocoa.macosx"
+ os="macosx"
+ arch="x86"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"/>
+
+ <plugin
+ id="org.eclipse.equinox.launcher.cocoa.macosx.x86_64"
+ os="macosx"
+ arch="x86_64, amd64"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"/>
+
+ <plugin
+ id="org.eclipse.swt.cocoa.macosx"
+ os="macosx"
+ arch="x86"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
+ <plugin
+ id="org.eclipse.swt.cocoa.macosx.x86_64"
+ os="macosx"
+ arch="x86_64, amd64"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
</feature>
diff --git a/com.gluster.storage.management.server/WebContent/WEB-INF/lib/aopalliance-1.0.jar b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/aopalliance-1.0.jar
new file mode 100644
index 00000000..578b1a0c
--- /dev/null
+++ b/com.gluster.storage.management.server/WebContent/WEB-INF/lib/aopalliance-1.0.jar
Binary files differ
diff --git a/com.gluster.storage.management.server/src/applicationContext.xml b/com.gluster.storage.management.server/src/applicationContext.xml
index 4167b5cd..90566c7f 100644
--- a/com.gluster.storage.management.server/src/applicationContext.xml
+++ b/com.gluster.storage.management.server/src/applicationContext.xml
@@ -1,8 +1,22 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+ xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+ http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd">
<context:component-scan base-package="com.gluster.storage.management.server" />
+ <task:scheduler id="taskScheduler" />
+ <task:executor id="taskExecutor" pool-size="1" />
+ <task:annotation-driven executor="taskExecutor"
+ scheduler="taskScheduler" />
+
+ <task:scheduled-tasks>
+ <task:scheduled ref="serverDiscoveryTask" method="discoverServers" fixed-delay="60000"/>
+ </task:scheduled-tasks>
+
+ <bean id="environment" class="java.lang.String">
+ <constructor-arg value="aws"/>
+ </bean>
</beans> \ No newline at end of file
diff --git a/com.gluster.storage.management.server/src/com/gluster/storage/management/server/tasks/ServerDiscoveryTask.java b/com.gluster.storage.management.server/src/com/gluster/storage/management/server/tasks/ServerDiscoveryTask.java
new file mode 100644
index 00000000..6bc25e81
--- /dev/null
+++ b/com.gluster.storage.management.server/src/com/gluster/storage/management/server/tasks/ServerDiscoveryTask.java
@@ -0,0 +1,51 @@
+/**
+ * ServerDiscoveryTask.java
+ *
+ * Copyright (c) 2011 Gluster, Inc. <http://www.gluster.com>
+ * This file is part of Gluster Management Console.
+ *
+ * Gluster Management Console is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Gluster Management Console is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see
+ * <http://www.gnu.org/licenses/>.
+ */
+package com.gluster.storage.management.server.tasks;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * Task for auto-discovery of servers eligible to be added to the Gluster cluster. This task runs periodically and keeps
+ * the discovered server list at a common place. The server resource can then pick it and send to client whenever
+ * demanded.
+ */
+@Component
+public class ServerDiscoveryTask {
+ private static final String ENV_AWS = "aws";
+ private static final String ENV_VMWARE = "vmware";
+ private static final String ENV_PHYCAL = "physical";
+
+ @Autowired
+ private String environment;
+
+ public void discoverServers() {
+ System.out.println("Starting discovery in [" + environment + "]");
+
+ /**
+ * TODO: Flow should be as follows <br>
+ * 1) Get the discovery policy specific for the environment <br>
+ * 2) Execute discovery to get list of auto-discovered server <br>
+ * 3) Probe each one of them to fetch server details <br>
+ * 4) Store the details in a common place which can be read by the server resource <br>
+ */
+ }
+} \ No newline at end of file