|
|
|
@ -1,8 +1,11 @@
|
|
|
|
|
package org.gcube.smartgears.configuration.application;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
|
|
import org.gcube.smartgears.configuration.ProxyAddress;
|
|
|
|
|
import org.gcube.smartgears.configuration.container.ContainerConfiguration;
|
|
|
|
|
import org.gcube.smartgears.persistence.LocalPersistence;
|
|
|
|
|
import org.gcube.smartgears.persistence.PersistenceWriter;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
@ -25,11 +28,20 @@ public class BridgedApplicationConfiguration implements ApplicationConfiguration
|
|
|
|
|
|
|
|
|
|
if (application.persistence()==null) {
|
|
|
|
|
|
|
|
|
|
application.persistence(container.persistence());
|
|
|
|
|
String location = container.persistence().getLocation()+"/"+application.name();
|
|
|
|
|
File dir = new File(location);
|
|
|
|
|
if (!dir.exists())
|
|
|
|
|
dir.mkdirs();
|
|
|
|
|
|
|
|
|
|
application.persistence(new LocalPersistence(location));
|
|
|
|
|
|
|
|
|
|
log.trace("setting persistence location for {} @ {}",application.name(), dir.getAbsolutePath());
|
|
|
|
|
|
|
|
|
|
log.trace("setting persistence location for {} the same as the container persistence",application.name());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (application.proxable() && container.proxy()!=null)
|
|
|
|
|
application.proxyAddress(container.proxy());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ApplicationConfiguration inner() {
|
|
|
|
@ -110,8 +122,8 @@ public class BridgedApplicationConfiguration implements ApplicationConfiguration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean proxied() {
|
|
|
|
|
return application.proxied();
|
|
|
|
|
public boolean proxable() {
|
|
|
|
|
return application.proxable();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -124,4 +136,14 @@ public class BridgedApplicationConfiguration implements ApplicationConfiguration
|
|
|
|
|
return application.includes(includes);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ProxyAddress proxyAddress() {
|
|
|
|
|
return application.proxyAddress();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ApplicationConfiguration proxyAddress(ProxyAddress proxy) {
|
|
|
|
|
return proxyAddress(proxy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|