Skip to content
Snippets Groups Projects
Commit fdc63bbd authored by gwen-soleil's avatar gwen-soleil
Browse files

add logging

parent d6b1d008
Branches
No related tags found
No related merge requests found
package org.tango.archiving.collector.mode;
import fr.soleil.tango.archiving.infra.tango.ArchivingConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Collection;
import java.util.HashSet;
......@@ -9,28 +11,30 @@ import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
public class ArchivingContextList {
private final Logger logger = LoggerFactory.getLogger(ArchivingContextList.class);
private final Map<Integer, ArchivingContext> contextList = new ConcurrentHashMap<>();
public final Set<String> pauseContext(int contextId) {
Set<String> attributes = new HashSet<>();
if (contextList.containsKey(contextId)) {
ArchivingContext context = contextList.get(contextId);
context.setActive(true);
return context.getAttributeConfigMap().keySet();
} else {
return new HashSet<>();
attributes = context.getAttributeConfigMap().keySet();
logger.debug("pausing context {} for {}", contextList, attributes);
}
return attributes;
}
public final Collection<ArchivingConfig> resumeContext(int contextId) {
Collection<ArchivingConfig> attributes = new HashSet<>();
if (contextList.containsKey(contextId)) {
ArchivingContext context = contextList.get(contextId);
context.setActive(false);
return context.getAttributeConfigMap().values();
} else {
return new HashSet<>();
attributes = context.getAttributeConfigMap().values();
logger.debug("resuming context {} for {}", contextList, attributes);
}
return attributes;
}
public final void removeAttribute(String attributeName) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment