Skip to content
Snippets Groups Projects
Commit 050af60b authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

- added the possibility to connect to another port (TANGOARCH-833)

- some code refactoring
parent 6769333b
No related branches found
No related tags found
No related merge requests found
Showing with 385 additions and 285 deletions
package fr.soleil.mambo.api;
import java.util.Arrays;
import java.util.Collection;
import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;
import fr.esrf.Tango.DevFailed;
import fr.soleil.archiving.common.api.exception.ArchivingException;
import fr.soleil.archiving.hdbtdb.api.ConfigConst;
import fr.soleil.archiving.hdbtdb.api.HdbTdbConnectionParameters;
import fr.soleil.comete.swing.util.CometeConstants;
import fr.soleil.database.connection.DataBaseParameters;
import fr.soleil.database.connection.DataBaseParameters.DataBaseType;
import fr.soleil.mambo.api.db.DbConnectionParameters;
/**
* Utility class for api.
*
* @author GIRARDOT
*/
public class ApiUtils implements MamboApiConstants {
private static final String SEPARATOR = ": ";
private static final String SEPARATOR_ERROR = ": error";
private static final String INVALID = "Invalid ";
private ApiUtils() {
// hide constructor
}
/**
* Extracts an <code>int</code> value from a {@link Map} supposed to contain its {@link String} representation,
* throwing an {@link ArchivingException} if the value was not found or if a problem occurred.
*
* @param accumulated The {@link Map}.
* @param key The key to recover the value.
* @param keyName The name that helps identifying the key in potential error message.
* @return An <code>int</code>.
* @throws ArchivingException If the value was not found or if a problem occurred.
*/
public static int getInt(Map<String, String> accumulated, String key, String keyName) throws ArchivingException {
String val = accumulated.get(key);
int value;
try {
value = Integer.parseInt(val);
} catch (Exception e) {
throw new ArchivingException(INVALID + keyName);
}
return value;
}
/**
* Extracts an <code>double</code> value from a {@link Map} supposed to contain its {@link String} representation,
* throwing an {@link ArchivingException} if the value was not found or if a problem occurred.
*
* @param accumulated The {@link Map}.
* @param key The key to recover the value.
* @param keyName The name that helps identifying the key in potential error message.
* @return An <code>double</code>.
* @throws ArchivingException If the value was not found or if a problem occurred.
*/
public static double getDouble(Map<String, String> accumulated, String key, String keyName)
throws ArchivingException {
String val = accumulated.get(key);
double value;
try {
value = Double.parseDouble(val);
} catch (Exception e) {
throw new ArchivingException(INVALID + keyName);
}
return value;
}
/**
* Utility method to recover a <code>boolean</code> value from its {@link String} representation.
*
* @param val The {@link String}.
* @param defaultValue The default boolean value to return if a problem occurred while parsing the {@link String}.
* @return A <code>boolean</code>.
*/
public static boolean parseBoolean(String val, boolean defaultValue) {
return val == null ? defaultValue : CometeConstants.TRUE.equalsIgnoreCase(val.trim());
}
/**
* Utility method to recover a <code>boolean</code> value from its {@link String} representation.
*
* @param val The {@link String}.
* @return A <code>boolean</code>.
*/
public static boolean parseBoolean(String val) {
return parseBoolean(val, false);
}
public static String getProperty(String property, String env, String defaultValue) {
String result;
try {
result = System.getProperty(property);
if (result == null) {
result = System.getenv(env);
if (result == null) {
result = defaultValue;
}
}
} catch (Exception e) {
result = defaultValue;
}
return result;
}
/**
* Parses a system property, or an environment variable if the property doesn't exist, as an <code>int</code> value.
*
* @param property The property key.
* @param env The environment variable
* @param defaultValue The default <code>int</code> value to return (if property is not found or can't be parsed as
* an <code>int</code>).
* @return An <code>int</code>.
*/
public static int getIntProperty(String property, String env, int defaultValue) {
int result;
try {
String sreadConf = getProperty(property, env, Integer.toString(defaultValue));
result = Integer.parseInt(sreadConf);
} catch (Exception e) {
result = defaultValue;
}
return result;
}
/**
* Parses a system property, or an environment variable if the property doesn't exist, as a <code>boolean</code>
* value.
*
* @param property The property key.
* @param env The environment variable
* @param defaultValue The default <code>boolean</code> value to return (if property is not found or can't be parsed
* as a <code>boolean</code>).
* @return A <code>boolean</code>.
*/
public static boolean getBooleanProperty(String property, String env, boolean defaultValue) {
boolean result;
try {
String sreadConf = getProperty(property, env, Boolean.toString(defaultValue));
result = parseBoolean(sreadConf, defaultValue);
} catch (Exception e) {
result = defaultValue;
}
return result;
}
/**
* Applies a {@link String} value to a setter according to 2 getters. It will try to get it from 1st one.
* If obtained value is <code>null</code> or empty after trim, it will obtain it from second one.
*
* @param getter1 The 1st getter.
* @param getter2 The 2nd getter.
* @param setter The setter.
*/
protected static void applyConfiguration(Supplier<String> getter1, Supplier<String> getter2,
Consumer<String> setter) {
String param = getter1.get();
if ((param == null) || param.trim().isEmpty()) {
param = getter2.get();
}
setter.accept(param);
}
/**
* Returns an array containing all of the elements in given {@link Collection}, cleaning that {@link Collection}
* after array extraction.
*
* @param accumulator The {@link Collection}.
* @return A {@link String} array.
*/
public static String[] cleanToStringArray(Collection<String> accumulator) {
String[] result;
if (accumulator == null) {
result = null;
} else {
result = accumulator.toArray(new String[accumulator.size()]);
accumulator.clear();
}
return result;
}
/**
* Puts the {@link String} array representation of an {@link Object} in a {@link Collection}.
*
* @param accumulator The {@link Collection}.
* @param toConvert The {@link Object}.
* @return <code>accumulator</code>, in order to help chaining methods.
*/
public static Collection<String> toStringArray(Collection<String> accumulator, Object toConvert) {
if ((accumulator != null) && (toConvert != null)) {
Arrays.stream(toConvert.getClass().getDeclaredFields()).forEach(f -> {
try {
f.setAccessible(true);
Object value = f.get(toConvert);
if (value != null) {
accumulator.add(f.getName() + SEPARATOR + f.get(toConvert));
}
} catch (IllegalAccessException e) {
accumulator.add(f.getName() + SEPARATOR_ERROR);
}
});
}
return accumulator;
}
/**
* Recovers the {@link DataBaseParameters} to use for given database.
*
* @param historic The {@link Boolean} that determines which database is concerned.
* @return A {@link DataBaseParameters} object, never <code>null</code>.
* @throws ArchivingException If a problem occurred while trying to read parameters from Tango.
*/
public static DataBaseParameters getDataBaseParameters(Boolean historic) throws ArchivingException {
final DataBaseParameters params = new DataBaseParameters();
try {
if (historic == null) {
params.setParametersFromTango(TTS_DEVICE_CLASS);
String host = System.getProperty(TTS_HOST_PROPERTY);
params.setHost(host);
params.setName(System.getProperty(TTS_NAME_PROPERTY, params.getName()));
params.setDbType(DataBaseType.parseDataBaseType(
ApiUtils.getProperty(TTS_DB_TYPE_PROPERTY, TTS_DB_TYPE_ENV, params.getDbType().toString())));
params.setMinPoolSize((short) ApiUtils.getIntProperty(TTS_MIN_POOL_SIZE_PROPERTY, TTS_MIN_POOL_SIZE_ENV,
params.getMinPoolSize()));
params.setMaxPoolSize((short) ApiUtils.getIntProperty(TTS_MAX_POOL_SIZE_PROPERTY, TTS_MAX_POOL_SIZE_ENV,
params.getMaxPoolSize()));
params.setInactivityTimeout(ApiUtils.getIntProperty(TTS_INACTIVITY_TIMEOUT_PROPERTY,
TTS_INACTIVITY_TIMEOUT_ENV, params.getInactivityTimeout()));
applyConfiguration(DbConnectionParameters::getUser, params::getUser, params::setUser);
applyConfiguration(DbConnectionParameters::getPassword, params::getPassword, params::setPassword);
} else if (historic.booleanValue()) {
params.setParametersFromTango(ConfigConst.HDB_CLASS_DEVICE);
params.setUser(HdbTdbConnectionParameters.getHDBUser());
params.setPassword(HdbTdbConnectionParameters.getHDBPassword());
params.setName(HdbTdbConnectionParameters.getHDbName());
params.setSchema(HdbTdbConnectionParameters.getHDbSchema());
} else {
// prefix = TDB;
params.setParametersFromTango(ConfigConst.TDB_CLASS_DEVICE);
params.setUser(HdbTdbConnectionParameters.getTDBUser());
params.setPassword(HdbTdbConnectionParameters.getTDBPassword());
params.setName(HdbTdbConnectionParameters.getTDbName());
params.setSchema(HdbTdbConnectionParameters.getTDbSchema());
}
} catch (DevFailed df) {
throw ArchivingException.toArchivingException(df);
}
return params;
}
/**
* Splits a {@link String} into a key and a value, and puts them in a {@link Map}.
*
* @param val The {@link String}.
* @param accumulated The {@link Map}
* @return <code>accumulated</code>, in order to help chaining methods.
*/
private static Map<String, String> split(String val, Map<String, String> accumulated) {
if (val != null) {
int index = val.indexOf(SEPARATOR);
if (index > -1) {
index += SEPARATOR.length();
accumulated.put(val.substring(0, index), val.substring(index));
}
}
return accumulated;
}
/**
* Extracts key-value pairs from a {@link String} array and puts them in a {@link Map}.
*
* @param values The {@link String} array.
* @param accumulated The {@link Map}.
* @return <code>accumulated</code>, in order to help chaining methods.
*/
public static Map<String, String> split(String[] values, Map<String, String> accumulated) {
if ((values != null) && (values.length > 0) && (accumulated != null)) {
for (String val : values) {
split(val, accumulated);
}
}
return accumulated;
}
/**
* Extracts key-value pairs from a {@link String} {@link Collection} and puts them in a {@link Map}.
*
* @param values The {@link Collection}.
* @param accumulated The {@link Map}.
* @return <code>accumulated</code>, in order to help chaining methods.
*/
public static Map<String, String> split(Collection<String> values, Map<String, String> accumulated) {
if ((values != null) && (!values.isEmpty()) && (accumulated != null)) {
for (String val : values) {
split(val, accumulated);
}
}
return accumulated;
}
}
...@@ -2,18 +2,28 @@ package fr.soleil.mambo.api; ...@@ -2,18 +2,28 @@ package fr.soleil.mambo.api;
public interface MamboApiConstants { public interface MamboApiConstants {
public static final String[] EMPTY = new String[0];
public static final String HDB = "HDB"; public static final String HDB = "HDB";
public static final String TDB = "TDB"; public static final String TDB = "TDB";
public static final String TTS = "TTS"; public static final String TTS = "TTS";
public static final String[] EMPTY = new String[0];
public static final String TTS_AVAILABLE = "ttsAvailable";
public static final String TTS_DEVICE_CLASS = "TimeseriesArchiver"; public static final String TTS_DEVICE_CLASS = "TimeseriesArchiver";
public static final String TTS_AVAILABLE_PROPERTY = "ttsAvailable";
public static final String TTS_AVAILABLE_ENV = "TTS_AVAILABLE";
public static final String TTS_HOST_PROPERTY = "ttsHost"; public static final String TTS_HOST_PROPERTY = "ttsHost";
public static final String TTS_HOST_ENV = "TTS_HOST";
public static final String TTS_PORT_PROPERTY = "ttPort";
public static final String TTS_PORT_ENV = "TTS_PORT";
public static final String TTS_DB_TYPE_PROPERTY = "ttsDbType"; public static final String TTS_DB_TYPE_PROPERTY = "ttsDbType";
public static final String TTS_DB_TYPE_ENV = "TTS_DB_TYPE";
public static final String TTS_NAME_PROPERTY = "ttsName"; public static final String TTS_NAME_PROPERTY = "ttsName";
public static final String TTS_NAME_ENV = "TTS_NAME";
public static final String TTS_SCHEMA_PROPERTY = "ttsSchema"; public static final String TTS_SCHEMA_PROPERTY = "ttsSchema";
public static final String TTS_SCHEMA_ENV = "TTS_SCHEMA";
public static final String TTS_MIN_POOL_SIZE_PROPERTY = "ttsMinPoolSize"; public static final String TTS_MIN_POOL_SIZE_PROPERTY = "ttsMinPoolSize";
public static final String TTS_MIN_POOL_SIZE_ENV = "TTS_MIN_POOL_SIZE";
public static final String TTS_MAX_POOL_SIZE_PROPERTY = "ttsMaxPoolSize"; public static final String TTS_MAX_POOL_SIZE_PROPERTY = "ttsMaxPoolSize";
public static final String TTS_INACTIVITY_TIMEOUT = "ttsInactivityTimeout"; public static final String TTS_MAX_POOL_SIZE_ENV = "TTS_MAX_POOL_SIZE";
public static final String TTS_INACTIVITY_TIMEOUT_PROPERTY = "ttsInactivityTimeout";
public static final String TTS_INACTIVITY_TIMEOUT_ENV = "TTS_INACTIVITY_TIMEOUT";
} }
...@@ -9,6 +9,7 @@ import fr.soleil.archiving.hdbtdb.api.tools.ArchivingMessConfig; ...@@ -9,6 +9,7 @@ import fr.soleil.archiving.hdbtdb.api.tools.ArchivingMessConfig;
import fr.soleil.archiving.hdbtdb.api.tools.AttributeLightMode; import fr.soleil.archiving.hdbtdb.api.tools.AttributeLightMode;
import fr.soleil.archiving.hdbtdb.api.tools.mode.Mode; import fr.soleil.archiving.hdbtdb.api.tools.mode.Mode;
import fr.soleil.lib.project.ObjectUtils; import fr.soleil.lib.project.ObjectUtils;
import fr.soleil.mambo.api.ApiUtils;
import fr.soleil.mambo.api.db.IDataBaseAcess; import fr.soleil.mambo.api.db.IDataBaseAcess;
import fr.soleil.mambo.data.archiving.ArchivingConfigurationAttribute; import fr.soleil.mambo.data.archiving.ArchivingConfigurationAttribute;
import fr.soleil.mambo.data.archiving.ArchivingConfigurationAttributeDBProperties; import fr.soleil.mambo.data.archiving.ArchivingConfigurationAttributeDBProperties;
...@@ -112,7 +113,7 @@ public class LegacyArchivingManagerApi implements IArchivingManagerApi { ...@@ -112,7 +113,7 @@ public class LegacyArchivingManagerApi implements IArchivingManagerApi {
@Override @Override
public String[] getArchivingMode(String attributeName) throws ArchivingException { public String[] getArchivingMode(String attributeName) throws ArchivingException {
return manager == null ? null return manager == null ? null
: ArchivingUtils.cleanToStringArray( : ApiUtils.cleanToStringArray(
ArchivingUtils.modeToStringArray(new ArrayList<>(), manager.getArchivingMode(attributeName))); ArchivingUtils.modeToStringArray(new ArrayList<>(), manager.getArchivingMode(attributeName)));
} }
......
...@@ -35,6 +35,7 @@ import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper; ...@@ -35,6 +35,7 @@ import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper;
import fr.soleil.comete.tango.data.service.helper.TangoExceptionHelper; import fr.soleil.comete.tango.data.service.helper.TangoExceptionHelper;
import fr.soleil.database.connection.DataBaseParameters; import fr.soleil.database.connection.DataBaseParameters;
import fr.soleil.lib.project.ObjectUtils; import fr.soleil.lib.project.ObjectUtils;
import fr.soleil.mambo.api.ApiUtils;
import fr.soleil.mambo.api.MamboApiConstants; import fr.soleil.mambo.api.MamboApiConstants;
import fr.soleil.mambo.api.db.IDataBaseAcess; import fr.soleil.mambo.api.db.IDataBaseAcess;
import fr.soleil.mambo.api.db.TTSDataBaseAccess; import fr.soleil.mambo.api.db.TTSDataBaseAccess;
...@@ -358,7 +359,7 @@ public class TTSArchivingManagerApi implements IArchivingManagerApi { ...@@ -358,7 +359,7 @@ public class TTSArchivingManagerApi implements IArchivingManagerApi {
@Override @Override
public String[] getArchivingMode(String attributeName) throws ArchivingException { public String[] getArchivingMode(String attributeName) throws ArchivingException {
InsertionModes modes = getInsertionModes(attributeName); InsertionModes modes = getInsertionModes(attributeName);
return ArchivingUtils.cleanToStringArray(ArchivingUtils.insertionModesToStringArray(new ArrayList<>(), modes)); return ApiUtils.cleanToStringArray(ArchivingUtils.insertionModesToStringArray(new ArrayList<>(), modes));
} }
@Override @Override
......
...@@ -11,7 +11,7 @@ import fr.soleil.mambo.api.MamboApiConstants; ...@@ -11,7 +11,7 @@ import fr.soleil.mambo.api.MamboApiConstants;
public class DbConnectionParameters implements MamboApiConstants { public class DbConnectionParameters implements MamboApiConstants {
private static boolean ttsAvailable = CometeConstants.TRUE private static boolean ttsAvailable = CometeConstants.TRUE
.equalsIgnoreCase(System.getProperty(TTS_AVAILABLE, CometeConstants.FALSE)); .equalsIgnoreCase(System.getProperty(TTS_AVAILABLE_PROPERTY, CometeConstants.FALSE));
private static String user, password; private static String user, password;
private DbConnectionParameters() { private DbConnectionParameters() {
......
...@@ -13,6 +13,8 @@ import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper; ...@@ -13,6 +13,8 @@ import fr.soleil.comete.tango.data.service.helper.TangoDeviceHelper;
import fr.soleil.database.connection.DataBaseParameters; import fr.soleil.database.connection.DataBaseParameters;
import fr.soleil.lib.project.ICancelable; import fr.soleil.lib.project.ICancelable;
import fr.soleil.lib.project.ObjectUtils; import fr.soleil.lib.project.ObjectUtils;
import fr.soleil.mambo.api.ApiUtils;
import fr.soleil.mambo.api.MamboApiConstants;
import fr.soleil.mambo.api.archiving.TTSArchivingManagerApi; import fr.soleil.mambo.api.archiving.TTSArchivingManagerApi;
import fr.soleil.mambo.api.extract.ExtractionUtils; import fr.soleil.mambo.api.extract.ExtractionUtils;
import fr.soleil.mambo.api.extract.IAttributeExtractor; import fr.soleil.mambo.api.extract.IAttributeExtractor;
...@@ -24,7 +26,7 @@ import fr.soleil.tango.archiving.config.AttributeParameters; ...@@ -24,7 +26,7 @@ import fr.soleil.tango.archiving.config.AttributeParameters;
import fr.soleil.tango.archiving.services.TangoArchivingConfigService; import fr.soleil.tango.archiving.services.TangoArchivingConfigService;
import fr.soleil.tango.archiving.services.TangoArchivingFetcherService; import fr.soleil.tango.archiving.services.TangoArchivingFetcherService;
public class TTSDataBaseAccess implements IDataBaseAcess { public class TTSDataBaseAccess implements IDataBaseAcess, MamboApiConstants {
private static final Logger LOGGER = LoggerFactory.getLogger(TTSDataBaseAccess.class); private static final Logger LOGGER = LoggerFactory.getLogger(TTSDataBaseAccess.class);
private static final String FAILED_TO_GET_ATTRIBUTE_CONFIG_FOR = "Failed to get AttributeConfig for "; private static final String FAILED_TO_GET_ATTRIBUTE_CONFIG_FOR = "Failed to get AttributeConfig for ";
...@@ -37,6 +39,8 @@ public class TTSDataBaseAccess implements IDataBaseAcess { ...@@ -37,6 +39,8 @@ public class TTSDataBaseAccess implements IDataBaseAcess {
config.setDbType(DatabaseConnectionConfig.DataBaseType.parseDataBaseType(params.getDbType().name())); config.setDbType(DatabaseConnectionConfig.DataBaseType.parseDataBaseType(params.getDbType().name()));
config.setName(params.getName()); config.setName(params.getName());
config.setHost(params.getHost()); config.setHost(params.getHost());
// TANGOARCH-833: possibility to connect to another port
config.setPort(ApiUtils.getProperty(TTS_PORT_PROPERTY, TTS_PORT_ENV, config.getPort()));
config.setUser(params.getUser()); config.setUser(params.getUser());
config.setPassword(params.getPassword()); config.setPassword(params.getPassword());
config.setIdleTimeout(params.getInactivityTimeout()); config.setIdleTimeout(params.getInactivityTimeout());
......
...@@ -16,6 +16,7 @@ import fr.soleil.archiving.hdbtdb.api.manager.TdbArchivingManagerApiRef; ...@@ -16,6 +16,7 @@ import fr.soleil.archiving.hdbtdb.api.manager.TdbArchivingManagerApiRef;
import fr.soleil.database.connection.AbstractDataBaseConnector; import fr.soleil.database.connection.AbstractDataBaseConnector;
import fr.soleil.database.connection.DataBaseParameters; import fr.soleil.database.connection.DataBaseParameters;
import fr.soleil.mambo.Mambo; import fr.soleil.mambo.Mambo;
import fr.soleil.mambo.api.ApiUtils;
import fr.soleil.mambo.api.MamboApiConstants; import fr.soleil.mambo.api.MamboApiConstants;
import fr.soleil.mambo.api.archiving.ArchivingUtils; import fr.soleil.mambo.api.archiving.ArchivingUtils;
import fr.soleil.mambo.api.archiving.IArchivingManagerApi; import fr.soleil.mambo.api.archiving.IArchivingManagerApi;
...@@ -82,7 +83,7 @@ public class DbConnectionManager { ...@@ -82,7 +83,7 @@ public class DbConnectionManager {
if (historic == null) { if (historic == null) {
// TTS // TTS
try { try {
params = ArchivingUtils.getDataBaseParameters(historic); params = ApiUtils.getDataBaseParameters(historic);
TTSDataBaseAccess ttsAccess = new TTSDataBaseAccess(params); TTSDataBaseAccess ttsAccess = new TTSDataBaseAccess(params);
DbConnectionManager.ttsAccess = ttsAccess; DbConnectionManager.ttsAccess = ttsAccess;
ttsManager = new TTSArchivingManagerApi(ttsAccess, params, ArchivingUtils.TTS_DEVICE_CLASS); ttsManager = new TTSArchivingManagerApi(ttsAccess, params, ArchivingUtils.TTS_DEVICE_CLASS);
...@@ -98,7 +99,7 @@ public class DbConnectionManager { ...@@ -98,7 +99,7 @@ public class DbConnectionManager {
} }
} else if (historic.booleanValue()) { } else if (historic.booleanValue()) {
// HDB // HDB
params = ArchivingUtils.getDataBaseParameters(historic); params = ApiUtils.getDataBaseParameters(historic);
final AbstractDataBaseConnector connector = ConnectionFactory.connect(params); final AbstractDataBaseConnector connector = ConnectionFactory.connect(params);
IArchivingManagerApiRef managerRef = ArchivingManagerApiRefFactory.getInstance(true, connector); IArchivingManagerApiRef managerRef = ArchivingManagerApiRefFactory.getInstance(true, connector);
hdbAccess = new HDBDataBaseAccess((HdbArchivingManagerApiRef) managerRef, connector); hdbAccess = new HDBDataBaseAccess((HdbArchivingManagerApiRef) managerRef, connector);
...@@ -107,7 +108,7 @@ public class DbConnectionManager { ...@@ -107,7 +108,7 @@ public class DbConnectionManager {
HdbTdbConnectionParameters.printHDBConnectionInfoLog(); HdbTdbConnectionParameters.printHDBConnectionInfoLog();
} else { } else {
// TDB // TDB
params = ArchivingUtils.getDataBaseParameters(historic); params = ApiUtils.getDataBaseParameters(historic);
final AbstractDataBaseConnector connector = ConnectionFactory.connect(params); final AbstractDataBaseConnector connector = ConnectionFactory.connect(params);
IArchivingManagerApiRef managerRef = ArchivingManagerApiRefFactory.getInstance(false, connector); IArchivingManagerApiRef managerRef = ArchivingManagerApiRefFactory.getInstance(false, connector);
tdbAccess = new TDBDataBaseAccess((TdbArchivingManagerApiRef) managerRef, connector); tdbAccess = new TDBDataBaseAccess((TdbArchivingManagerApiRef) managerRef, connector);
......
...@@ -11,6 +11,7 @@ import fr.soleil.archiving.common.api.exception.ArchivingException; ...@@ -11,6 +11,7 @@ import fr.soleil.archiving.common.api.exception.ArchivingException;
import fr.soleil.archiving.hdbtdb.api.tools.AttributesArchivingException; import fr.soleil.archiving.hdbtdb.api.tools.AttributesArchivingException;
import fr.soleil.archiving.hdbtdb.api.tools.mode.Mode; import fr.soleil.archiving.hdbtdb.api.tools.mode.Mode;
import fr.soleil.lib.project.ObjectUtils; import fr.soleil.lib.project.ObjectUtils;
import fr.soleil.mambo.api.ApiUtils;
import fr.soleil.mambo.api.MamboApiConstants; import fr.soleil.mambo.api.MamboApiConstants;
import fr.soleil.mambo.api.archiving.ArchiverFactory; import fr.soleil.mambo.api.archiving.ArchiverFactory;
import fr.soleil.mambo.api.archiving.ArchivingUtils; import fr.soleil.mambo.api.archiving.ArchivingUtils;
...@@ -138,7 +139,7 @@ public class BasicArchivingManager extends DbConnectionManager implements IArchi ...@@ -138,7 +139,7 @@ public class BasicArchivingManager extends DbConnectionManager implements IArchi
mode = null; mode = null;
} else { } else {
Map<String, String> accumulator = new HashMap<>(); Map<String, String> accumulator = new HashMap<>();
mode = ArchivingUtils.toMode(ArchivingUtils.split(modeStr, accumulator)); mode = ArchivingUtils.toMode(ApiUtils.split(modeStr, accumulator));
accumulator.clear(); accumulator.clear();
} }
return mode; return mode;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment