1212import org .fogbowcloud .manager .core .plugins .AuthorizationPlugin ;
1313import org .fogbowcloud .manager .core .plugins .ComputePlugin ;
1414import 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 ;
1817import org .fogbowcloud .manager .occi .OCCIApplication ;
1918import org .fogbowcloud .manager .xmpp .ManagerXmppComponent ;
2019import 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 ();
0 commit comments