Skip to content
Snippets Groups Projects
Commit a1525f13 authored by Gwenaelle ABEILLE's avatar Gwenaelle ABEILLE
Browse files

stop_archive_conf state management

parent ef50c244
Branches
Tags
No related merge requests found
......@@ -690,6 +690,7 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
this.updateAMTTable = updateAMTTable;
}
@Override
public void run() {
try {
......@@ -1059,7 +1060,8 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
logger.trace(ILogger.LEVEL_INFO, "insertModeRecord - out");
}
// update period in dbProxy, used in cmd retry_for_ko_attributes
// update period in dbProxy, used in cmd
// retry_for_ko_attributes
final int period = attributeLightMode.getMode().getModeP().getPeriod();
logger.trace(ILogger.LEVEL_INFO, attCompleteName + "'s period is " + period);
dbProxy.setPeriodForAttribute(attCompleteName, period);
......@@ -1096,13 +1098,14 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
archivingException.addStack(message, reason, ErrSeverity.PANIC, desc, "", e);
logger.trace(ILogger.LEVEL_ERROR, reason + " " + desc);
archivingStatus.put(attCompleteName, false);
logger.trace(ILogger.LEVEL_INFO, "KO: " + attCompleteName);
}
}
computeLoads();
TangoStateUtils.setOn(this, archivingStatus);
if (!archivingException.getMessage().equals("")) {
logger.trace(ILogger.LEVEL_INFO, "trigger_archive_conf - out");
logger.trace(ILogger.LEVEL_INFO, "trigger_archive_conf ERROR - out");
throw archivingException.toTangoException();
}
......@@ -1162,20 +1165,17 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
*/
// =========================================================
public void stop_archive_conf(final String[] argin) throws DevFailed {
TangoStateUtils.isAllowed(this);
TangoStateUtils.setRunning(this);
// TangoStateUtils.isAllowed(this);
// TangoStateUtils.setRunning(this);
try {
get_logger().info("Entering stop_archive_conf()");
logger.trace(ILogger.LEVEL_INFO, "===> Entering stop_archive_conf()");
logger.trace(ILogger.LEVEL_INFO, "stop_archive_conf - in");
final Vector<AttributeLightMode> myConf = ArchivingManagerApiRef.stoppingVector(argin);
for (int i = 0; i < myConf.size(); i++) {
stop_archive_att(myConf.elementAt(i).toArray());
}
get_logger().info("Exiting stop_archive_conf()");
logger.trace(ILogger.LEVEL_INFO, "===> Exiting stop_archive_conf()");
} finally {
logger.trace(ILogger.LEVEL_INFO, "stop_archive_conf - out");
TangoStateUtils.setOn(this, archivingStatus);
}
}
......@@ -1699,15 +1699,12 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
public void stop_archive_att(final String[] argin) throws DevFailed {
TangoStateUtils.isAllowed(this);
TangoStateUtils.setRunning(this);
get_logger().info("Entering stop_archive_att()");
logger.trace(ILogger.LEVEL_INFO, "===> Entering stop_archive_att()");
logger.trace(ILogger.LEVEL_INFO, "stop_archive_att - in");
final AttributeLightMode attributeLightMode = AttributeLightMode.creationWithFullInformation(argin);
HdbCollector hdbCollector = null;
try {
logger
.trace(ILogger.LEVEL_INFO, "===> Attribute Name = "
+ attributeLightMode.getAttribute_complete_name());
logger.trace(ILogger.LEVEL_INFO, "attribute: " + attributeLightMode.getAttribute_complete_name());
dbProxy.updateModeRecord(attributeLightMode);
......@@ -1742,12 +1739,10 @@ public class HdbArchiver extends DeviceImpl implements TangoConst {
e.printStackTrace();
throw e.toTangoException();
} finally {
logger.trace(ILogger.LEVEL_INFO, "===> Exiting stop_archive_att()");
logger.trace(ILogger.LEVEL_INFO, "stop_archive_att - out");
TangoStateUtils.setOn(this, archivingStatus);
}
get_logger().info("Exiting stop_archive_att()");
}
// private void throwDevFailed() throws DevFailed {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment