2017-08-03 12:43:53 +02:00
|
|
|
package org.gcube.spatial.data.sdi.test.factories;
|
2017-04-11 18:07:58 +02:00
|
|
|
|
|
|
|
import org.gcube.spatial.data.sdi.engine.ThreddsManager;
|
|
|
|
import org.gcube.spatial.data.sdi.engine.impl.ThreddsManagerImpl;
|
|
|
|
import org.gcube.spatial.data.sdi.engine.impl.faults.ConfigurationNotFoundException;
|
2017-08-03 12:43:53 +02:00
|
|
|
import org.gcube.spatial.data.sdi.model.health.ServiceHealthReport;
|
2017-04-11 18:07:58 +02:00
|
|
|
import org.gcube.spatial.data.sdi.model.service.ThreddsConfiguration;
|
2017-08-03 12:43:53 +02:00
|
|
|
import org.gcube.spatial.data.sdi.test.TestCommon;
|
|
|
|
import org.gcube.spatial.data.sdi.test.TokenSetter;
|
2017-04-11 18:07:58 +02:00
|
|
|
import org.glassfish.hk2.api.Factory;
|
|
|
|
|
|
|
|
public class ThreddsManagerFactory implements Factory<ThreddsManager>{
|
|
|
|
|
|
|
|
private ThreddsManager manager;
|
|
|
|
|
|
|
|
|
|
|
|
public ThreddsManagerFactory() {
|
|
|
|
manager=new ThreddsManagerImpl(){
|
|
|
|
@Override
|
|
|
|
public ThreddsConfiguration getConfiguration() throws ConfigurationNotFoundException {
|
|
|
|
TokenSetter.set(TestCommon.TEST_SCOPE);
|
|
|
|
return super.getConfiguration();
|
|
|
|
}
|
2017-08-03 12:43:53 +02:00
|
|
|
@Override
|
|
|
|
public ServiceHealthReport getHealthReport() {
|
|
|
|
TokenSetter.set(TestCommon.TEST_SCOPE);
|
|
|
|
return super.getHealthReport();
|
|
|
|
}
|
2017-04-11 18:07:58 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public ThreddsManager provide() {
|
|
|
|
return manager;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void dispose(ThreddsManager arg0) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|