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.GISManager;
|
|
|
|
import org.gcube.spatial.data.sdi.engine.impl.GISManagerImpl;
|
|
|
|
import org.gcube.spatial.data.sdi.engine.impl.faults.ConfigurationNotFoundException;
|
|
|
|
import org.gcube.spatial.data.sdi.model.service.GeoServerClusterConfiguration;
|
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 GISManagerFactory implements Factory<GISManager>{
|
|
|
|
|
|
|
|
private GISManager manager;
|
|
|
|
|
|
|
|
public GISManagerFactory() {
|
|
|
|
manager=new GISManagerImpl(){
|
|
|
|
@Override
|
|
|
|
public GeoServerClusterConfiguration getConfiguration() throws ConfigurationNotFoundException {
|
|
|
|
TokenSetter.set(TestCommon.TEST_SCOPE);
|
|
|
|
return super.getConfiguration();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void dispose(GISManager arg0) {
|
|
|
|
// TODO Auto-generated method stub
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public GISManager provide() {
|
|
|
|
return manager;
|
|
|
|
}
|
|
|
|
}
|