Change-Id: If961a029b48d85b58ca10b9b71f5fc29d41dbe9c
Signed-off-by: Marian Dubai <mdubai@cisco.com>
*/
package org.opendaylight.controller.configpusherfeature.internal;
*/
package org.opendaylight.controller.configpusherfeature.internal;
+import com.google.common.base.Preconditions;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import javax.xml.bind.JAXBException;
import javax.xml.bind.JAXBException;
import org.apache.karaf.features.BundleInfo;
import org.apache.karaf.features.Conditional;
import org.apache.karaf.features.ConfigFileInfo;
import org.apache.karaf.features.BundleInfo;
import org.apache.karaf.features.Conditional;
import org.apache.karaf.features.ConfigFileInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Preconditions;
-
/*
* Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
* its underlying ConfigFileInfo's
/*
* Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
* its underlying ConfigFileInfo's
* Delegates the the contained feature and provides additional methods.
*/
public class AbstractFeatureWrapper implements Feature {
* Delegates the the contained feature and provides additional methods.
*/
public class AbstractFeatureWrapper implements Feature {
- private static final Logger LOGGER = LoggerFactory.getLogger(AbstractFeatureWrapper.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractFeatureWrapper.class);
protected Feature feature = null;
protected AbstractFeatureWrapper() {
protected Feature feature = null;
protected AbstractFeatureWrapper() {
try {
snapShotHolders.add(new FeatureConfigSnapshotHolder(c,this));
} catch (JAXBException e) {
try {
snapShotHolders.add(new FeatureConfigSnapshotHolder(c,this));
} catch (JAXBException e) {
- LOGGER.debug("{} is not a config subsystem config file",c.getFinalname());
+ LOG.debug("{} is not a config subsystem config file",c.getFinalname());
}
}
return snapShotHolders;
}
}
return snapShotHolders;
*/
package org.opendaylight.controller.configpusherfeature.internal;
*/
package org.opendaylight.controller.configpusherfeature.internal;
+import com.google.common.base.Preconditions;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.List;
import javax.xml.bind.JAXBException;
import javax.xml.bind.JAXBException;
import org.apache.felix.utils.version.VersionRange;
import org.apache.felix.utils.version.VersionTable;
import org.apache.karaf.features.Dependency;
import org.apache.felix.utils.version.VersionRange;
import org.apache.felix.utils.version.VersionTable;
import org.apache.karaf.features.Dependency;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Preconditions;
-
/*
* Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
* its underlying ConfigFileInfo's and those of its children recursively
/*
* Wrap a Feature for the purposes of extracting the FeatureConfigSnapshotHolders from
* its underlying ConfigFileInfo's and those of its children recursively
* Delegates the the contained feature and provides additional methods.
*/
public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements Feature {
* Delegates the the contained feature and provides additional methods.
*/
public class ChildAwareFeatureWrapper extends AbstractFeatureWrapper implements Feature {
- private static final Logger LOGGER = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ChildAwareFeatureWrapper.class);
private FeaturesService featuresService= null;
protected ChildAwareFeatureWrapper(Feature f) {
private FeaturesService featuresService= null;
protected ChildAwareFeatureWrapper(Feature f) {
f = new FeatureConfigSnapshotHolder(h,this);
snapShotHolders.add(f);
} catch (JAXBException e) {
f = new FeatureConfigSnapshotHolder(h,this);
snapShotHolders.add(f);
} catch (JAXBException e) {
- LOGGER.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
+ LOG.debug("{} is not a config subsystem config file",h.getFileInfo().getFinalname());
Version v = VersionTable.getVersion(f.getVersion());
if (range.contains(v) &&
(fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0)) {
Version v = VersionTable.getVersion(f.getVersion());
if (range.contains(v) &&
(fi == null || VersionTable.getVersion(fi.getVersion()).compareTo(v) < 0)) {
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import org.apache.karaf.features.FeatureEvent;
import org.apache.karaf.features.FeaturesListener;
import org.apache.karaf.features.FeaturesService;
import org.apache.karaf.features.FeatureEvent;
import org.apache.karaf.features.FeaturesListener;
import org.apache.karaf.features.FeaturesService;
import org.slf4j.LoggerFactory;
public class ConfigFeaturesListener implements FeaturesListener, AutoCloseable {
import org.slf4j.LoggerFactory;
public class ConfigFeaturesListener implements FeaturesListener, AutoCloseable {
- private static final Logger LOGGER = LoggerFactory.getLogger(ConfigFeaturesListener.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ConfigFeaturesListener.class);
private static final int QUEUE_SIZE = 1000;
private BlockingQueue<FeatureEvent> queue = new LinkedBlockingQueue<FeatureEvent>(QUEUE_SIZE);
Thread pushingThread = null;
private static final int QUEUE_SIZE = 1000;
private BlockingQueue<FeatureEvent> queue = new LinkedBlockingQueue<FeatureEvent>(QUEUE_SIZE);
Thread pushingThread = null;
@Override
public void repositoryEvent(RepositoryEvent event) {
@Override
public void repositoryEvent(RepositoryEvent event) {
- LOGGER.debug("Repository: " + event.getType() + " " + event.getRepository());
+ LOG.debug("Repository: {} {}", event.getType(), event.getRepository());
*/
package org.opendaylight.controller.configpusherfeature.internal;
*/
package org.opendaylight.controller.configpusherfeature.internal;
+import com.google.common.collect.LinkedHashMultimap;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.TimeUnit;
import org.apache.karaf.features.Feature;
import org.apache.karaf.features.FeatureEvent;
import org.apache.karaf.features.FeatureEvent.EventType;
import org.apache.karaf.features.Feature;
import org.apache.karaf.features.FeatureEvent;
import org.apache.karaf.features.FeatureEvent.EventType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.collect.LinkedHashMultimap;
-
public class ConfigPushingRunnable implements Runnable {
public class ConfigPushingRunnable implements Runnable {
- private static final Logger LOGGER = LoggerFactory.getLogger(ConfigPushingRunnable.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ConfigPushingRunnable.class);
private static final int POLL_TIME = 1;
private BlockingQueue<FeatureEvent> queue;
private FeatureConfigPusher configPusher;
private static final int POLL_TIME = 1;
private BlockingQueue<FeatureEvent> queue;
private FeatureConfigPusher configPusher;
processFeatureEvent(event,toInstall);
}
} else if(toInstall.isEmpty()) {
processFeatureEvent(event,toInstall);
}
} else if(toInstall.isEmpty()) {
- LOGGER.error("ConfigPushingRunnable - exiting");
+ LOG.error("ConfigPushingRunnable - exiting");
return;
}
} catch (InterruptedException e) {
return;
}
} catch (InterruptedException e) {
- LOGGER.error("ConfigPushingRunnable - interupted");
+ LOG.error("ConfigPushingRunnable - interupted");
interuppted = true;
} catch (Exception e) {
interuppted = true;
} catch (Exception e) {
- LOGGER.error("Exception while processing features {}", e);
+ LOG.error("Exception while processing features ", e);
protected void logPushResult(LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> results) {
for(Feature f:results.keySet()) {
protected void logPushResult(LinkedHashMultimap<Feature,FeatureConfigSnapshotHolder> results) {
for(Feature f:results.keySet()) {
- LOGGER.info("Pushed configs for feature {} {}",f,results.get(f));
+ LOG.info("Pushed configs for feature {} {}",f,results.get(f));
*/
package org.opendaylight.controller.configpusherfeature.internal;
*/
package org.opendaylight.controller.configpusherfeature.internal;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.SortedSet;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import org.apache.karaf.features.ConfigFileInfo;
import org.apache.karaf.features.Feature;
import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigSnapshot;
import org.apache.karaf.features.ConfigFileInfo;
import org.apache.karaf.features.Feature;
import org.opendaylight.controller.config.persist.api.ConfigSnapshotHolder;
import org.opendaylight.controller.config.persist.storage.file.xml.model.ConfigSnapshot;
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
/*
* A ConfigSnapshotHolder that can track all the additional information
* relavent to the fact we are getting these from a Feature.
/*
* A ConfigSnapshotHolder that can track all the additional information
* relavent to the fact we are getting these from a Feature.