Skip to content
Snippets Groups Projects
Commit 5e767dcb authored by Alexandre TISON's avatar Alexandre TISON
Browse files

Added shiftArchiver impl

parent 4c8701b3
No related branches found
No related tags found
1 merge request!3TANGOARCH-895 : Added shiftArchiver command
......@@ -220,6 +220,23 @@ public class HDBTDBAccess implements IArchivingAccess {
@Override
public void shiftArchiver(final String attributeName, final String archiverName) throws DevFailed {
return; // TODO: implement
Mode m;
final ArchivingMessConfig archivingMessConfig = ArchivingMessConfig.basicObjectCreation();
try {
m = dbManager.getArchivingMode(attributeName);
} catch (ArchivingException e) {
throw e.toTangoException();
}
AttributeLightMode mode = new AttributeLightMode();
mode.setDevice_in_charge(archiverName);
mode.setAttributeCompleteName(attributeName);
mode.setMode(m);
archivingMessConfig.add(mode);
try {
dbManager.archivingStopConf(attributeName);
dbManager.archivingStart(archivingMessConfig);
} catch (ArchivingException e) {
throw e.toTangoException();
}
}
}
......@@ -201,6 +201,15 @@ public class TimeseriesAccess implements IArchivingAccess {
@Override
public void shiftArchiver(final String attributeName, final String archiverName) throws DevFailed {
return; // TODO: implement
ArchivingConfigs configs = new ArchivingConfigs();
ArchivingConfig archivingConfig = new ArchivingConfig();
archivingConfig.setArchiver(archiverName);
configService.getAttributeConfig(attributeName).ifPresent(attributeConfig -> {
archivingConfig.setAttributeConfig(attributeConfig);
archivingConfig.setModes(configService.getCurrentInsertionModes(attributeConfig.getId()).orElse(null));
configs.addConfiguration(archivingConfig);
service.stopArchiving(attributeName);
service.startArchiving(configs);
});
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment