Used a constant to define connection strategy
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@146955 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
0bd37933bc
commit
583c63797a
|
@ -12,7 +12,6 @@ import org.gcube.informationsystem.resourceregistry.dbinitialization.DatabaseInt
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.orientechnologies.orient.client.remote.OStorageRemote;
|
||||
import com.tinkerpop.blueprints.impls.orient.OrientGraph;
|
||||
import com.tinkerpop.blueprints.impls.orient.OrientGraphFactory;
|
||||
|
||||
|
@ -51,8 +50,7 @@ public abstract class SecurityContextMapper {
|
|||
DatabaseEnvironment.CHANGED_ADMIN_PASSWORD)
|
||||
.setupPool(1, 10);
|
||||
|
||||
factory.setConnectionStrategy(OStorageRemote.CONNECTION_STRATEGY
|
||||
.ROUND_ROBIN_CONNECT.toString());
|
||||
factory.setConnectionStrategy(DatabaseIntializator.CONNECTION_STRATEGY_PARAMETER.toString());
|
||||
|
||||
for (PermissionMode p : PermissionMode.values()) {
|
||||
OrientGraphFactory f = new OrientGraphFactory(
|
||||
|
@ -61,8 +59,7 @@ public abstract class SecurityContextMapper {
|
|||
DatabaseEnvironment.CHANGED_ADMIN_PASSWORD)
|
||||
.setupPool(1, 10);
|
||||
|
||||
f.setConnectionStrategy(OStorageRemote.CONNECTION_STRATEGY
|
||||
.ROUND_ROBIN_CONNECT.toString());
|
||||
f.setConnectionStrategy(DatabaseIntializator.CONNECTION_STRATEGY_PARAMETER.toString());
|
||||
|
||||
Map<UUID, OrientGraphFactory> map = new HashMap<>();
|
||||
map.put(ADMIN_SECURITY_CONTEXT_UUID, f);
|
||||
|
@ -140,8 +137,7 @@ public abstract class SecurityContextMapper {
|
|||
|
||||
factory = new OrientGraphFactory(DatabaseEnvironment.DB_URI,
|
||||
username, password).setupPool(1, 10);
|
||||
factory.setConnectionStrategy(OStorageRemote.CONNECTION_STRATEGY
|
||||
.ROUND_ROBIN_CONNECT.toString());
|
||||
factory.setConnectionStrategy(DatabaseIntializator.CONNECTION_STRATEGY_PARAMETER.toString());
|
||||
|
||||
permissionSecurityContextFactories.put(context, factory);
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import com.orientechnologies.common.log.OLogManager;
|
||||
import com.orientechnologies.orient.client.remote.OServerAdmin;
|
||||
import com.orientechnologies.orient.client.remote.OStorageRemote.CONNECTION_STRATEGY;
|
||||
import com.orientechnologies.orient.core.metadata.OMetadata;
|
||||
import com.orientechnologies.orient.core.metadata.schema.OClass;
|
||||
import com.orientechnologies.orient.core.metadata.schema.OSchema;
|
||||
|
@ -26,7 +27,6 @@ import com.tinkerpop.blueprints.impls.orient.OrientVertexType;
|
|||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*
|
||||
*/
|
||||
public class DatabaseIntializator {
|
||||
|
||||
|
@ -38,6 +38,8 @@ public class DatabaseIntializator {
|
|||
|
||||
public static final String O_RESTRICTED_CLASS = "ORestricted";
|
||||
|
||||
public static final CONNECTION_STRATEGY CONNECTION_STRATEGY_PARAMETER = CONNECTION_STRATEGY.ROUND_ROBIN_CONNECT;
|
||||
|
||||
public static boolean initGraphDB() throws Exception {
|
||||
|
||||
OLogManager.instance().setWarnEnabled(false);
|
||||
|
|
Loading…
Reference in New Issue