2017-08-03 12:43:53 +02:00
|
|
|
package org.gcube.spatial.data.sdi.test.factories;
|
2017-03-30 15:31:39 +02:00
|
|
|
|
|
|
|
import org.gcube.spatial.data.sdi.engine.SDIManager;
|
|
|
|
import org.gcube.spatial.data.sdi.engine.impl.SDIManagerImpl;
|
2017-04-11 18:07:58 +02:00
|
|
|
import org.gcube.spatial.data.sdi.model.ScopeConfiguration;
|
2017-08-03 12:43:53 +02:00
|
|
|
import org.gcube.spatial.data.sdi.model.health.HealthReport;
|
|
|
|
import org.gcube.spatial.data.sdi.test.TestCommon;
|
|
|
|
import org.gcube.spatial.data.sdi.test.TokenSetter;
|
2017-03-30 15:31:39 +02:00
|
|
|
import org.glassfish.hk2.api.Factory;
|
|
|
|
|
|
|
|
public class SDIManagerFactory implements Factory<SDIManager>{
|
|
|
|
|
2017-04-11 18:07:58 +02:00
|
|
|
SDIManager manager=null;
|
|
|
|
|
|
|
|
|
2017-03-30 15:31:39 +02:00
|
|
|
public SDIManagerFactory() {
|
2017-04-11 18:07:58 +02:00
|
|
|
manager=new SDIManagerImpl(new GeoNetworkManagerFactory().provide(),new ThreddsManagerFactory().provide(),new GISManagerFactory().provide()){
|
|
|
|
@Override
|
|
|
|
public ScopeConfiguration getContextConfiguration() {
|
|
|
|
TokenSetter.set(TestCommon.TEST_SCOPE);
|
|
|
|
return super.getContextConfiguration();
|
|
|
|
}
|
2017-08-03 12:43:53 +02:00
|
|
|
@Override
|
|
|
|
public HealthReport getHealthReport() {
|
|
|
|
TokenSetter.set(TestCommon.TEST_SCOPE);
|
|
|
|
return super.getHealthReport();
|
|
|
|
}
|
2017-04-11 18:07:58 +02:00
|
|
|
};
|
2017-03-30 15:31:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void dispose(SDIManager arg0) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public SDIManager provide() {
|
2017-04-11 18:07:58 +02:00
|
|
|
return manager;
|
2017-03-30 15:31:39 +02:00
|
|
|
}
|
|
|
|
}
|