Skip to content

Commit 9024cd8

Browse files
committed
Merge pull request #142 from fogbow/develop
Fixing bypass OCCIApplication.
2 parents 89baee2 + 37fc8ef commit 9024cd8

File tree

61 files changed

+3780
-897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3780
-897
lines changed

bin/start-manager

100644100755
File mode changed.

manager.conf.example

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,17 @@ compute_occi_flavor_large=m1-large
2222
compute_occi_os_scheme=http://schemas.openstack.org/template/os#
2323
compute_occi_instance_scheme=http://schemas.openstack.org/compute/instance#
2424
compute_occi_resource_scheme=http://schemas.openstack.org/template/resource#
25-
compute_occi_image_fogbow-linux-x86=cadf2e29-7216-4a5e-9364-cf6513d5f1fd
2625
compute_occi_network_id=ea51ed0c-0e8a-448d-8202-c79777109ffe
2726

27+
image_storage_class=org.fogbowcloud.manager.core.plugins.egi.EgiImageStoragePlugin
28+
image_storage_egi_base_url=http://lsd.ufcg.edu.br/~user/vm/
29+
image_storage_egi_tmp_storage=/tmp/
30+
image_storage_static_fogbow-linux-x86=55d938ef-57d1-44ea-8155-6036d170780a
31+
image_storage_static_fogbow-ubuntu-1204=81765250-a4e4-440d-a215-43c9c0849120
32+
2833
compute_class=org.fogbowcloud.manager.core.plugins.openstack.OpenStackNovaV2ComputePlugin
2934
compute_novav2_url=http://localhost:8774
35+
compute_glancev2_url=http://localhost:9292
3036
compute_novav2_flavor_small=1
3137
compute_novav2_flavor_medium=2
3238
compute_novav2_flavor_large=3
@@ -60,6 +66,6 @@ ssh_tunnel_host_port=2222
6066

6167
my_ip=127.0.0.1
6268

63-
http_port = 8182
69+
http_port=8182
6470

6571
max_whoisalive_manager_count=100

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,12 @@
194194
<groupId>org.apache.ws.commons.util</groupId>
195195
<artifactId>ws-commons-util</artifactId>
196196
<version>1.0.2</version>
197-
</dependency>
197+
</dependency>
198+
<dependency>
199+
<groupId>net.schmizz</groupId>
200+
<artifactId>sshj</artifactId>
201+
<version>0.8.1</version>
202+
</dependency>
198203
</dependencies>
199204

200205
</project>

src/main/java/org/fogbowcloud/manager/Main.java

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
import org.fogbowcloud.manager.core.plugins.AuthorizationPlugin;
1313
import org.fogbowcloud.manager.core.plugins.ComputePlugin;
1414
import org.fogbowcloud.manager.core.plugins.IdentityPlugin;
15-
import org.fogbowcloud.manager.core.plugins.common.AllowAllAuthorizationPlugin;
16-
import org.fogbowcloud.manager.core.plugins.openstack.KeystoneIdentityPlugin;
17-
import org.fogbowcloud.manager.core.plugins.openstack.OpenStackOCCIComputePlugin;
15+
import org.fogbowcloud.manager.core.plugins.ImageStoragePlugin;
16+
import org.fogbowcloud.manager.core.plugins.egi.EgiImageStoragePlugin;
1817
import org.fogbowcloud.manager.occi.OCCIApplication;
1918
import org.fogbowcloud.manager.xmpp.ManagerXmppComponent;
2019
import org.restlet.Component;
@@ -39,7 +38,7 @@ public static void main(String[] args) throws Exception {
3938
computePlugin = (ComputePlugin) createInstance(
4039
ConfigurationConstants.COMPUTE_CLASS_KEY, properties);
4140
} catch (Exception e) {
42-
LOGGER.warn("Compute Plugin not especified in the properties.");
41+
LOGGER.warn("Compute Plugin not especified in the properties.", e);
4342
return;
4443
}
4544

@@ -48,7 +47,7 @@ public static void main(String[] args) throws Exception {
4847
authorizationPlugin = (AuthorizationPlugin) createInstance(
4948
ConfigurationConstants.AUTHORIZATION_CLASS_KEY, properties);
5049
} catch (Exception e) {
51-
LOGGER.warn("Authorization Plugin not especified in the properties.");
50+
LOGGER.warn("Authorization Plugin not especified in the properties.", e);
5251
return;
5352
}
5453

@@ -57,15 +56,16 @@ public static void main(String[] args) throws Exception {
5756
localIdentityPlugin = (IdentityPlugin) getIdentityPluginByPrefix(properties,
5857
ConfigurationConstants.LOCAL_PREFIX);
5958
} catch (Exception e) {
60-
LOGGER.warn("Local Identity Plugin not especified in the properties.");
59+
LOGGER.warn("Local Identity Plugin not especified in the properties.", e);
6160
return;
6261
}
62+
6363
IdentityPlugin federationIdentityPlugin = null;
6464
try {
6565
federationIdentityPlugin = (IdentityPlugin) getIdentityPluginByPrefix(properties,
6666
ConfigurationConstants.FEDERATION_PREFIX);
6767
} catch (Exception e) {
68-
LOGGER.warn("Federation Identity Plugin not especified in the properties.");
68+
LOGGER.warn("Federation Identity Plugin not especified in the properties.", e);
6969
return;
7070
}
7171

@@ -76,12 +76,28 @@ public static void main(String[] args) throws Exception {
7676
} catch (Exception e) {
7777
LOGGER.warn("Member Validator not especified in the properties.");
7878
}
79+
80+
if (properties.get(ConfigurationConstants.RENDEZVOUS_JID_KEY) == null
81+
|| properties.get(ConfigurationConstants.RENDEZVOUS_JID_KEY).toString().isEmpty()) {
82+
LOGGER.warn("Rendezvous (" + ConfigurationConstants.RENDEZVOUS_JID_KEY
83+
+ ") not especified in the properties.");
84+
}
85+
86+
ImageStoragePlugin imageStoragePlugin = null;
87+
try {
88+
imageStoragePlugin = (ImageStoragePlugin) createInstanceWithComputePlugin(
89+
ConfigurationConstants.IMAGE_STORAGE_PLUGIN_CLASS, properties, computePlugin);
90+
} catch (Exception e) {
91+
imageStoragePlugin = new EgiImageStoragePlugin(properties, computePlugin);
92+
LOGGER.warn("Image Storage plugin not specified in properties. Using the default one.", e);
93+
}
7994

8095
ManagerController facade = new ManagerController(properties);
8196
facade.setComputePlugin(computePlugin);
8297
facade.setAuthorizationPlugin(authorizationPlugin);
8398
facade.setLocalIdentityPlugin(localIdentityPlugin);
8499
facade.setFederationIdentityPlugin(federationIdentityPlugin);
100+
facade.setImageStoragePlugin(imageStoragePlugin);
85101
facade.setValidator(validator);
86102

87103
ManagerXmppComponent xmpp = new ManagerXmppComponent(
@@ -131,6 +147,12 @@ private static Object createInstance(String propName, Properties properties) thr
131147
return Class.forName(properties.getProperty(propName)).getConstructor(Properties.class)
132148
.newInstance(properties);
133149
}
150+
151+
private static Object createInstanceWithComputePlugin(String propName,
152+
Properties properties, ComputePlugin computePlugin) throws Exception {
153+
return Class.forName(properties.getProperty(propName)).getConstructor(Properties.class, ComputePlugin.class)
154+
.newInstance(properties, computePlugin);
155+
}
134156

135157
private static void configureLog4j() {
136158
ConsoleAppender console = new ConsoleAppender();
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.fogbowcloud.manager.core;
2+
3+
public interface AsynchronousRequestCallback {
4+
5+
public void success(String instanceId);
6+
7+
public void error(Throwable t);
8+
9+
}

src/main/java/org/fogbowcloud/manager/core/ConfigurationConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,6 @@ public class ConfigurationConstants {
5050

5151
//pagination
5252
public static final String MAX_WHOISALIVE_MANAGER_COUNT = "max_whoisalive_manager_count";
53+
public static final String IMAGE_STORAGE_PLUGIN_CLASS = "image_storage_class";
5354

5455
}

0 commit comments

Comments
 (0)