public class EvcAddCommand extends AbstractCommand<Link> {
- private static final Logger LO = LoggerFactory.getLogger(EvcAddCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EvcAddCommand.class);
public EvcAddCommand(final DataBroker dataBroker, final DataTreeModification<Link> newEvcLink) {
super(dataBroker, newEvcLink);
if (evc != null) {
// For now, we assume that there is 1 uni per source/destination
if ((evc.getUniDest() == null) || evc.getUniDest().isEmpty()) {
- LO.error("Destination UNI cannot be null.");
+ LOG.error("Destination UNI cannot be null.");
return;
}
if ((evc.getUniSource() == null) || evc.getUniSource().isEmpty()) {
- LO.error("Source UNI cannot be null.");
+ LOG.error("Source UNI cannot be null.");
return;
}
- LO.info("New EVC created, source IP: {} destination IP {}.",
+ LOG.info("New EVC created, source IP: {} destination IP {}.",
evc.getUniSource().iterator().next().getIpAddress().getIpv4Address(),
evc.getUniDest().iterator().next().getIpAddress().getIpv4Address());
InstanceIdentifier<Node> sourceUniIid;
destinationUniIid,
dataBroker);
} else {
- LO.info("Unable to retrieve the source and/or destination bridge.");
+ LOG.info("Unable to retrieve the source and/or destination bridge.");
}
} else {
- LO.info("Uname to retrieve the source and/or destination ovsdbNode.");
+ LOG.info("Uname to retrieve the source and/or destination ovsdbNode.");
}
} else {
- LO.info("Unable to retrieve the source and/or destination Uni.");
+ LOG.info("Unable to retrieve the source and/or destination Uni.");
}
}
}
public class EvcRemoveCommand extends AbstractCommand<Link> {
- private static final Logger LO = LoggerFactory.getLogger(EvcRemoveCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EvcRemoveCommand.class);
public EvcRemoveCommand(final DataBroker dataBroker, final DataTreeModification<Link> removedEvcLink) {
super(dataBroker, removedEvcLink);
}
}
} else {
- LO.info("EvcAugmentation is null");
+ LOG.info("EvcAugmentation is null");
}
MdsalUtils.deleteNode(dataBroker, removedEvcIid, LogicalDatastoreType.OPERATIONAL);
}
public class EvcUpdateCommand extends AbstractCommand<Link> {
- private static final Logger LO = LoggerFactory.getLogger(EvcUpdateCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EvcUpdateCommand.class);
public EvcUpdateCommand(final DataBroker dataBroker, final DataTreeModification<Link> updatedEvcLink) {
super(dataBroker, updatedEvcLink);
// FIXME: For now, we assume that there is 1 uni per
// source/destination
if ((evc.getUniDest() == null) || evc.getUniDest().isEmpty()) {
- LO.error("Destination UNI cannot be null.");
+ LOG.error("Destination UNI cannot be null.");
return;
}
if ((evc.getUniSource() == null) || evc.getUniSource().isEmpty()) {
- LO.error("Source UNI cannot be null.");
+ LOG.error("Source UNI cannot be null.");
return;
}
final Ipv4Address laterUni1Ip = evc.getUniSource().iterator().next().getIpAddress().getIpv4Address();
final Ipv4Address laterUni2Ip = evc.getUniDest().iterator().next().getIpAddress().getIpv4Address();
- LO.trace("New EVC created, source IP: {} destination IP {}.", laterUni1Ip, laterUni2Ip);
+ LOG.trace("New EVC created, source IP: {} destination IP {}.", laterUni1Ip, laterUni2Ip);
final ReadTransaction readTransac = dataBroker.newReadOnlyTransaction();
final CheckedFuture<Optional<Link>, ReadFailedException> retFormerEvc =
} else if (formerUni1ip.equals(laterUni2Ip)) {
// do nothing
} else {
- LO.info("{} is not part of the EVC, removing configuration", formerUni1ip);
+ LOG.info("{} is not part of the EVC, removing configuration", formerUni1ip);
final InstanceIdentifier<?> formerUniIID =
UnimgrMapper.getUniIid(dataBroker, new IpAddress(formerUni1ip),
LogicalDatastoreType.OPERATIONAL);
} else if (formerUni2ip.equals(laterUni2Ip)) {
// do nothing
} else {
- LO.info("{} is not part of the EVC, removing configuration", formerUni2ip);
+ LOG.info("{} is not part of the EVC, removing configuration", formerUni2ip);
final InstanceIdentifier<?> formerUniIID =
UnimgrMapper.getUniIid(dataBroker, new IpAddress(formerUni2ip),
LogicalDatastoreType.OPERATIONAL);
}
}
} catch (final InterruptedException | ExecutionException e) {
- LO.error("Failed to retrieve former EVC {}", evcKey, e);
+ LOG.error("Failed to retrieve former EVC {}", evcKey, e);
}
InstanceIdentifier<Node> sourceUniIid;
destinationUniIid,
dataBroker);
} else {
- LO.info("Unable to retrieve the source and/or destination bridge.");
+ LOG.info("Unable to retrieve the source and/or destination bridge.");
}
} else {
- LO.info("Unable to retrieve the source and/or destination ovsdbNode.");
+ LOG.info("Unable to retrieve the source and/or destination ovsdbNode.");
}
} else {
- LO.info("Unable to retrieve the source and/or destination Uni.");
+ LOG.info("Unable to retrieve the source and/or destination Uni.");
}
}
}
public class OvsNodeAddCommand extends AbstractCommand<Node> {
- private static final Logger LO = LoggerFactory.getLogger(OvsNodeAddCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(OvsNodeAddCommand.class);
public OvsNodeAddCommand(final DataBroker dataBroker, final DataTreeModification<Node> newOvsNode) {
super(dataBroker, newOvsNode);
final OvsdbNodeAugmentation ovsdbNodeAugmentation = ovsNode.getAugmentation(OvsdbNodeAugmentation.class);
final InstanceIdentifier<Node> ovsdbIid = dataObject.getRootPath().getRootIdentifier();
if (ovsdbNodeAugmentation != null) {
- LO.info("Received an OVSDB node create {}",
+ LOG.info("Received an OVSDB node create {}",
ovsdbNodeAugmentation.getConnectionInfo()
.getRemoteIp()
.getIpv4Address()
}
}
} else {
- LO.info("Received a new OVSDB node connection from {}"
+ LOG.info("Received a new OVSDB node connection from {}"
+ ovsdbNodeAugmentation.getConnectionInfo()
.getRemoteIp().getIpv4Address());
}
public class UniAddCommand extends AbstractCommand<Node> {
- private static final Logger LO = LoggerFactory.getLogger(UniAddCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(UniAddCommand.class);
public UniAddCommand(final DataBroker dataBroker, final DataTreeModification<Node> newUniNode) {
super(dataBroker, newUniNode);
final Node uniNode = dataObject.getRootNode().getDataAfter();
final UniAugmentation uni = uniNode.getAugmentation(UniAugmentation.class);
if (uni != null) {
- LO.info("New UNI created {}.", uni.getIpAddress().getIpv4Address());
+ LOG.info("New UNI created {}.", uni.getIpAddress().getIpv4Address());
// We assume the ovs is in active mode tcp:ipAddress:6640
if (uni.getOvsdbNodeRef() != null) {
final OvsdbNodeRef ovsdbNodeRef = uni.getOvsdbNodeRef();
LogicalDatastoreType.OPERATIONAL,
ovsdbNodeRef.getValue());
if (!optionalNode.isPresent()) {
- LO.info("Invalid OVSDB node instance identifier specified, "
+ LOG.info("Invalid OVSDB node instance identifier specified, "
+ "attempting to retrieve the node.");
final Optional<Node> optionalOvsdbNode = OvsdbUtils.findOvsdbNode(dataBroker,
uni);
Node ovsdbNode;
if (optionalOvsdbNode.isPresent()) {
ovsdbNode = optionalOvsdbNode.get();
- LO.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
+ LOG.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
// Update QoS entries to ovsdb if speed is configured to UNI node
if (uni.getSpeed() != null) {
OvsdbUtils.createQoSForOvsdbNode(dataBroker, uni);
} else {
ovsdbNode = OvsdbUtils.createOvsdbNode(dataBroker,
uni);
- LO.info("Could not retrieve the OVSDB node,"
+ LOG.info("Could not retrieve the OVSDB node,"
+ " created a new one: {}", ovsdbNode.getNodeId());
UniUtils.updateUniNode(LogicalDatastoreType.CONFIGURATION,
uniKey,
if (optionalOvsdbNode.isPresent()) {
ovsdbNode = optionalOvsdbNode.get();
final InstanceIdentifier<Node> ovsdbIid = UnimgrMapper.getOvsdbNodeIid(ovsdbNode.getNodeId());
- LO.info("Retrieved the OVSDB node");
+ LOG.info("Retrieved the OVSDB node");
// Update QoS entries to ovsdb if speed is configured to UNI node
if (uni.getSpeed() != null) {
OvsdbUtils.createQoSForOvsdbNode(dataBroker, uni);
ovsdbNode = OvsdbUtils.createOvsdbNode(dataBroker,
uni);
if (ovsdbNode != null) {
- LO.info("Could not retrieve the OVSDB node,"
+ LOG.info("Could not retrieve the OVSDB node,"
+ "created a new one: {}", ovsdbNode.getNodeId());
UniUtils.updateUniNode(LogicalDatastoreType.CONFIGURATION,
uniKey,
public class UniRemoveCommand extends AbstractCommand<Node> {
- private static final Logger LO = LoggerFactory.getLogger(UniRemoveCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(UniRemoveCommand.class);
public UniRemoveCommand(final DataBroker dataBroker, final DataTreeModification<Node> removedUniNode) {
super(dataBroker, removedUniNode);
ovsdbNodeIid);
if (optionalNode.isPresent()) {
final Node ovsdbNode = optionalNode.get();
- LO.info("Delete QoS and Queues entries");
+ LOG.info("Delete QoS and Queues entries");
List<QosEntries> qosList = ovsdbNode
.getAugmentation(OvsdbNodeAugmentation.class)
.getQosEntries();
InstanceIdentifier<Queues> queuesIid = UnimgrMapper.getOvsdbQueuesIid(ovsdbNode, queuesKey);
MdsalUtils.deleteNode(dataBroker, queuesIid, LogicalDatastoreType.CONFIGURATION);
}
- LO.info("Delete bride node");
+ LOG.info("Delete bride node");
final InstanceIdentifier<Node> bridgeIid = UnimgrMapper.getOvsdbBridgeNodeIid(ovsdbNode);
MdsalUtils.deleteNode(dataBroker, bridgeIid, LogicalDatastoreType.CONFIGURATION);
}
MdsalUtils.deleteNode(dataBroker, iidUni, LogicalDatastoreType.OPERATIONAL);
}
} else {
- LO.info("Received Uni Augmentation has null ovsdb node ref: {}", removedUniIid);
+ LOG.info("Received Uni Augmentation has null ovsdb node ref: {}", removedUniIid);
}
} else {
- LO.info("Received Uni Augmentation is null: {}", removedUniIid);
+ LOG.info("Received Uni Augmentation is null: {}", removedUniIid);
}
}
}
public class UniUpdateCommand extends AbstractCommand<Node> {
- private static final Logger LO = LoggerFactory.getLogger(UniUpdateCommand.class);
+ private static final Logger LOG = LoggerFactory.getLogger(UniUpdateCommand.class);
public UniUpdateCommand(final DataBroker dataBroker, final DataTreeModification<Node> updatedUniNode) {
super(dataBroker, updatedUniNode);
formerUniIp, updatedUniIp, uniKey);
Node ovsdbNode;
if (updatedUni.getOvsdbNodeRef() != null) {
- LO.info("OVSDB NODE ref retreive for updated UNI {}", updatedUni.getOvsdbNodeRef());
+ LOG.info("OVSDB NODE ref retreive for updated UNI {}", updatedUni.getOvsdbNodeRef());
final OvsdbNodeRef ovsdbNodeRef = updatedUni.getOvsdbNodeRef();
final Optional<Node> optOvsdbNode =
MdsalUtils.readNode(dataBroker,LogicalDatastoreType.OPERATIONAL, ovsdbNodeRef.getValue());
if (optOvsdbNode.isPresent()) {
ovsdbNode = optOvsdbNode.get();
- LO.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
+ LOG.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
// Update QoS entries to ovsdb if speed is configured to UNI node
if (updatedUni.getSpeed() != null) {
OvsdbUtils.createQoSForOvsdbNode(dataBroker, updatedUni);
} else {
// This should never happen, because on creation,
// the UNI is assigned and OVSDB node
- LO.error("OVSDB node not found for UNI {}, but got OVSDB ref {}", uniKey,
+ LOG.error("OVSDB node not found for UNI {}, but got OVSDB ref {}", uniKey,
updatedUni.getOvsdbNodeRef());
return;
}
final Optional<Node> optOvsdbNode = OvsdbUtils.findOvsdbNode(dataBroker, updatedUni);
if (optOvsdbNode.isPresent()) {
ovsdbNode = optOvsdbNode.get();
- LO.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
+ LOG.info("Retrieved the OVSDB node {}", ovsdbNode.getNodeId());
// Update QoS entries to ovsdb if speed is configured to UNI node
if (updatedUni.getSpeed() != null) {
OvsdbUtils.createQoSForOvsdbNode(dataBroker, updatedUni);
} else {
// This should never happen, because on creation,
// the UNI is assigned and OVSDB node
- LO.error("OVSDB node not found for UNI {}", uniKey);
+ LOG.error("OVSDB node not found for UNI {}", uniKey);
return;
}
}
- LO.info("UNI {} updated", uniKey);
+ LOG.info("UNI {} updated", uniKey);
}
}
}
public class EvcDataTreeChangeListener extends UnimgrDataTreeChangeListener<Link> {
- private static final Logger LO = LoggerFactory.getLogger(EvcDataTreeChangeListener.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EvcDataTreeChangeListener.class);
private final ListenerRegistration<EvcDataTreeChangeListener> listener;
public EvcDataTreeChangeListener(final DataBroker dataBroker) {
final DataTreeIdentifier<Link> dataTreeIid =
new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, getEvcTopologyPath());
listener = dataBroker.registerDataTreeChangeListener(dataTreeIid, this);
- LO.info("EvcDataTreeChangeListener created and registered");
+ LOG.info("EvcDataTreeChangeListener created and registered");
}
@Override
public void add(final DataTreeModification<Link> newDataObject) {
if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
- LO.info("evc link {} created", newDataObject.getRootNode().getIdentifier());
+ LOG.info("evc link {} created", newDataObject.getRootNode().getIdentifier());
final EvcAddCommand evcAddCmd = new EvcAddCommand(dataBroker, newDataObject);
evcAddCmd.execute();
}
@Override
public void remove(final DataTreeModification<Link> removedDataObject) {
if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) {
- LO.info("evc link {} deleted", removedDataObject.getRootNode().getIdentifier());
+ LOG.info("evc link {} deleted", removedDataObject.getRootNode().getIdentifier());
final EvcRemoveCommand evcRemovedCmd = new EvcRemoveCommand(dataBroker, removedDataObject);
evcRemovedCmd.execute();
}
@Override
public void update(final DataTreeModification<Link> modifiedDataObject) {
if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) {
- LO.info("evc link {} updated", modifiedDataObject.getRootNode().getIdentifier());
+ LOG.info("evc link {} updated", modifiedDataObject.getRootNode().getIdentifier());
final EvcUpdateCommand evcUpdateCmd = new EvcUpdateCommand(dataBroker, modifiedDataObject);
evcUpdateCmd.execute();
}
public class OvsNodeDataTreeChangeListener extends UnimgrDataTreeChangeListener<Node> {
- private static final Logger LO = LoggerFactory.getLogger(OvsNodeDataTreeChangeListener.class);
+ private static final Logger LOG = LoggerFactory.getLogger(OvsNodeDataTreeChangeListener.class);
private final ListenerRegistration<OvsNodeDataTreeChangeListener> listener;
public OvsNodeDataTreeChangeListener(final DataBroker dataBroker) {
final DataTreeIdentifier<Node> dataTreeIid =
new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, nodePath);
listener = dataBroker.registerDataTreeChangeListener(dataTreeIid, this);
- LO.info("ovsNodeDataTreeChangeListener created and registered");
+ LOG.info("ovsNodeDataTreeChangeListener created and registered");
}
@Override
public void add(final DataTreeModification<Node> newDataObject) {
if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
- LO.info("ovs node {} created", newDataObject.getRootNode().getIdentifier());
+ LOG.info("ovs node {} created", newDataObject.getRootNode().getIdentifier());
final OvsNodeAddCommand ovsNodeAddCmd = new OvsNodeAddCommand(dataBroker, newDataObject);
ovsNodeAddCmd.execute();
}
public class UniDataTreeChangeListener extends UnimgrDataTreeChangeListener<Node> {
- private static final Logger LO = LoggerFactory.getLogger(UniDataTreeChangeListener.class);
+ private static final Logger LOG = LoggerFactory.getLogger(UniDataTreeChangeListener.class);
private final ListenerRegistration<UniDataTreeChangeListener> listener;
final DataTreeIdentifier<Node> dataTreeIid =
new DataTreeIdentifier<>(LogicalDatastoreType.CONFIGURATION, uniPath);
listener = dataBroker.registerDataTreeChangeListener(dataTreeIid, this);
- LO.info("UniDataTreeChangeListener created and registered");
+ LOG.info("UniDataTreeChangeListener created and registered");
}
@Override
public void add(final DataTreeModification<Node> newDataObject) {
if (newDataObject.getRootPath() != null && newDataObject.getRootNode() != null) {
- LO.info("uni node {} created", newDataObject.getRootNode().getIdentifier());
+ LOG.info("uni node {} created", newDataObject.getRootNode().getIdentifier());
final UniAddCommand uniAddCmd = new UniAddCommand(dataBroker, newDataObject);
uniAddCmd.execute();
}
@Override
public void remove(final DataTreeModification<Node> removedDataObject) {
if (removedDataObject.getRootPath() != null && removedDataObject.getRootNode() != null) {
- LO.info("uni node {} deleted", removedDataObject.getRootNode().getIdentifier());
+ LOG.info("uni node {} deleted", removedDataObject.getRootNode().getIdentifier());
final UniRemoveCommand uniRemoveCmd = new UniRemoveCommand(dataBroker, removedDataObject);
uniRemoveCmd.execute();
}
@Override
public void update(final DataTreeModification<Node> modifiedDataObject) {
if (modifiedDataObject.getRootPath() != null && modifiedDataObject.getRootNode() != null) {
- LO.info("uni node {} updated", modifiedDataObject.getRootNode().getIdentifier());
+ LOG.info("uni node {} updated", modifiedDataObject.getRootNode().getIdentifier());
final UniUpdateCommand uniUpdateCmd = new UniUpdateCommand(dataBroker, modifiedDataObject);
uniUpdateCmd.execute();
}
public class UnimgrProvider implements BindingAwareProvider, AutoCloseable, IUnimgrConsoleProvider {
- private static final Logger LO = LoggerFactory.getLogger(UnimgrProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(UnimgrProvider.class);
private DataBroker dataBroker;
private EvcDataTreeChangeListener evcListener;
private OvsNodeDataTreeChangeListener ovsListener;
private UniDataTreeChangeListener uniListener;
public UnimgrProvider(DataBroker dataBroker) {
- LO.info("Unimgr provider initialized");
+ LOG.info("Unimgr provider initialized");
this.dataBroker = dataBroker;
}
transaction.cancel();
}
} catch (final Exception e) {
- LO.error("Error initializing unimgr topology", e);
+ LOG.error("Error initializing unimgr topology", e);
}
}
transaction.cancel();
}
} catch (final Exception e) {
- LO.error("Error initializing unimgr topology {}", e);
+ LOG.error("Error initializing unimgr topology {}", e);
}
}
* Initialization method for UnimgrProvider, used by blueprint.
*/
public void init() {
- LO.info("UnimgrProvider Session Initiated");
+ LOG.info("UnimgrProvider Session Initiated");
// Register the data trees change listener
uniListener = new UniDataTreeChangeListener(dataBroker);
@Override
public void close() throws Exception {
- LO.info("UnimgrProvider Closed");
+ LOG.info("UnimgrProvider Closed");
uniListener.close();
evcListener.close();
ovsListener.close();
public boolean updateUni(final UniAugmentation uni) {
// Remove the old UNI with IpAdress and create a new one with updated informations
if (uni != null) {
- LO.trace("UNI updated {}.", uni.getIpAddress().getIpv4Address());
+ LOG.trace("UNI updated {}.", uni.getIpAddress().getIpv4Address());
final InstanceIdentifier<?> uniIID = UnimgrMapper.getUniIid(dataBroker,
uni.getIpAddress(), LogicalDatastoreType.OPERATIONAL);
Node ovsdbNode;
LogicalDatastoreType.OPERATIONAL, ovsdbNodeRef.getValue()).get();
UniUtils.updateUniNode(LogicalDatastoreType.OPERATIONAL, uniIID, uni, ovsdbNode, dataBroker);
- LO.trace("UNI updated {}.", uni.getIpAddress().getIpv4Address());
+ LOG.trace("UNI updated {}.", uni.getIpAddress().getIpv4Address());
} else {
final Optional<Node> optionalOvsdbNode = OvsdbUtils.findOvsdbNode(dataBroker, uni);
ovsdbNode = optionalOvsdbNode.get();
* @author marek.ryznar@amartus.com
*/
public class AbstractNodeHandler implements DataTreeChangeListener<Topology> {
- private static final Logger LO = LoggerFactory.getLogger(AbstractNodeHandler.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractNodeHandler.class);
private static final InstanceIdentifier NRP_TOPOLOGY_SYSTEM_IID = InstanceIdentifier
.create(Context.class)
.augmentation(Context1.class)
@Override
public void onSuccess(@Nullable Void result) {
- LO.info("Abstract TAPI node upadate successful");
+ LOG.info("Abstract TAPI node upadate successful");
}
@Override
public void onFailure(Throwable t) {
- LO.warn("Abstract TAPI node upadate failed due to an error", t);
+ LOG.warn("Abstract TAPI node upadate failed due to an error", t);
}
});
}
* @author bartosz.michalik@amartus.com [modifications]
*/
public class ActivationDriverRepoServiceImpl implements ActivationDriverRepoService {
- private static final Logger LO = LoggerFactory.getLogger(ActivationDriverRepoServiceImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ActivationDriverRepoServiceImpl.class);
private final Collection<ActivationDriverBuilder> builders;
}
public ActivationDriverRepoServiceImpl(List<ActivationDriverBuilder> builders) {
- LO.debug("Activation drivers initialized");
+ LOG.debug("Activation drivers initialized");
this.builders = builders;
}
}
public void bind(ActivationDriverBuilder builder) {
- LO.debug("builder {} bound", builder);
+ LOG.debug("builder {} bound", builder);
}
public void unbind(ActivationDriverBuilder builder) {
- LO.debug("builder {} unbound", builder);
+ LOG.debug("builder {} unbound", builder);
}
@Override
* @author krzysztof.bijakowski@amartus.com [modifications]
*/
public class ActivationTransaction {
- private static final Logger LO = LoggerFactory.getLogger(ActivationTransaction.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ActivationTransaction.class);
private List<ActivationDriver> drivers = new ArrayList<>();
d.activate();
}
commit();
- LO.info("Activate transaction successful");
+ LOG.info("Activate transaction successful");
return Result.success();
} catch (Exception e) {
//XXX add transaction identification ???
- LO.warn("Rolling back activate transaction ", e);
+ LOG.warn("Rolling back activate transaction ", e);
rollback();
return Result.fail(e.getMessage(), e);
for (ActivationDriver d: drivers) {
d.deactivate();
}
- LO.info("Deactivate transaction successful");
+ LOG.info("Deactivate transaction successful");
commit();
return Result.success();
} catch (Exception e) {
//XXX add transaction identification ???
- LO.warn("Rolling back deactivate transaction ", e);
+ LOG.warn("Rolling back deactivate transaction ", e);
rollback();
return Result.fail(e.getMessage(), e);
}
}
- private static final Logger LO = LoggerFactory.getLogger(CapabilitiesService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(CapabilitiesService.class);
private DataBroker dataBroker;
try {
result = nodeFuture.checkedGet();
} catch (final ReadFailedException e) {
- LO.error("Unable to read node with Iid {}", nodeIid, e);
+ LOG.error("Unable to read node with Iid {}", nodeIid, e);
}
return result;
public class EvcUtils {
- private static final Logger LO = LoggerFactory.getLogger(EvcUtils.class);
+ private static final Logger LOG = LoggerFactory.getLogger(EvcUtils.class);
/**
* Delete EVC data from configuration datastore.
}
}
} else {
- LO.info("Unable to retrieve UNI from the EVC.");
+ LOG.info("Unable to retrieve UNI from the EVC.");
}
}
transaction.submit();
return true;
} else {
- LO.info("EvcLink is not present: " + optionalEvcLink.get().getKey());
+ LOG.info("EvcLink is not present: " + optionalEvcLink.get().getKey());
}
} else {
- LO.info("Invalid instance identifiers for sourceUni and destUni.");
+ LOG.info("Invalid instance identifiers for sourceUni and destUni.");
}
return false;
}
public class MdsalUtils {
- private static final Logger LO = LoggerFactory.getLogger(MdsalUtils.class);
+ private static final Logger LOG = LoggerFactory.getLogger(MdsalUtils.class);
private MdsalUtils() {
throw new AssertionError("Instantiating utility class.");
if (optionalDataObject.isPresent()) {
result = optionalDataObject.get();
} else {
- LO.debug("{}: Failed to read {}",
+ LOG.debug("{}: Failed to read {}",
Thread.currentThread().getStackTrace()[1], path);
}
} catch (final ReadFailedException e) {
- LO.warn("Failed to read {} ", path, e);
+ LOG.warn("Failed to read {} ", path, e);
}
transaction.close();
return result;
try {
optionalDataObject = future.checkedGet();
} catch (final ReadFailedException e) {
- LO.warn("Failed to read {} ", path, e);
+ LOG.warn("Failed to read {} ", path, e);
}
transaction.close();
try {
return nodeFuture.checkedGet();
} catch (final ReadFailedException e) {
- LO.error("Unable to read node with Iid {}", nodeIid, e);
+ LOG.error("Unable to read node with Iid {}", nodeIid, e);
}
return Optional.absent();
}
try {
return nodeFuture.checkedGet();
} catch (final ReadFailedException e) {
- LO.info("Unable to read node with Iid {}", nodeIid, e);
+ LOG.info("Unable to read node with Iid {}", nodeIid, e);
}
return Optional.absent();
}
public static boolean deleteNode(DataBroker dataBroker,
InstanceIdentifier<?> genericNode,
LogicalDatastoreType store) {
- LO.info("Received a request to delete node {}", genericNode);
+ LOG.info("Received a request to delete node {}", genericNode);
boolean result = false;
final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
transaction.delete(store, genericNode);
transaction.submit().checkedGet();
result = true;
} catch (final TransactionCommitFailedException e) {
- LO.error("Unable to remove node with Iid {} from store {}", genericNode, store, e);
+ LOG.error("Unable to remove node with Iid {} from store {}", genericNode, store, e);
}
return result;
}
try {
return linkFuture.checkedGet();
} catch (final ReadFailedException e) {
- LO.info("Unable to read node with Iid {}", linkIid, e);
+ LOG.info("Unable to read node with Iid {}", linkIid, e);
}
return Optional.absent();
}
try {
return topologyFuture.checkedGet();
} catch (final ReadFailedException e) {
- LO.info("Unable to read topology with Iid {}", topologyInstanceId, e);
+ LOG.info("Unable to read topology with Iid {}", topologyInstanceId, e);
}
return Optional.absent();
}
public class NullAwareDatastoreGetter<T> {
- private static final Logger LO = LoggerFactory.getLogger(NullAwareDatastoreGetter.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NullAwareDatastoreGetter.class);
private Optional<T> dataOptional;
private void logDataOptionalStatus(Function <?, ?> function) {
if(dataOptional.isPresent()) {
- LO.trace("Before collection of: " + function.toString() + ", currently collected data is non-null: " + dataOptional.get().toString());
+ LOG.trace("Before collection of: " + function.toString() + ", currently collected data is non-null: " + dataOptional.get().toString());
} else {
- LO.debug("Null value encountered during collection of: " + function.toString());
+ LOG.debug("Null value encountered during collection of: " + function.toString());
}
}
}
public class OvsdbUtils {
- private static final Logger LO = LoggerFactory.getLogger(OvsdbUtils.class);
+ private static final Logger LOG = LoggerFactory.getLogger(OvsdbUtils.class);
private OvsdbUtils() {
throw new AssertionError("Instantiating utility class.");
Node ovsdbNode,
UniAugmentation uni,
String bridgeName) {
- LO.info("Creating a bridge on node {}", ovsdbNode.getNodeId().getValue());
+ LOG.info("Creating a bridge on node {}", ovsdbNode.getNodeId().getValue());
final InstanceIdentifier<Node> ovsdbNodeIid = uni.getOvsdbNodeRef().getValue().firstIdentifierOf(Node.class);
if (ovsdbNodeIid != null) {
final NodeBuilder bridgeNodeBuilder = new NodeBuilder();
transaction.put(LogicalDatastoreType.CONFIGURATION, bridgeIid, bridgeNodeBuilder.build());
transaction.submit();
} else {
- LO.info("OvsdbNodeRef is null");
+ LOG.info("OvsdbNodeRef is null");
}
}
InstanceIdentifier<Node> ovsdbNodeIid,
UniAugmentation uni,
String bridgeName) {
- LO.info("Creating a bridge on node {}", ovsdbNodeIid);
+ LOG.info("Creating a bridge on node {}", ovsdbNodeIid);
if (ovsdbNodeIid != null) {
final NodeBuilder bridgeNodeBuilder = new NodeBuilder();
final Optional<Node> optionalOvsdbNode = MdsalUtils.readNode(dataBroker,
transaction.submit();
}
} else {
- LO.info("OvsdbNodeRef is null");
+ LOG.info("OvsdbNodeRef is null");
}
}
if (source.getSpeed() != null) {
final Uuid qosUuid = getQosUuid(dataBroker, source);
//tpAugmentationBuilder.setQos(getQosUuid(dataBroker, source));
- LO.info("Updating Qos {} to termination point {}", qosUuid , bridgeName);
+ LOG.info("Updating Qos {} to termination point {}", qosUuid , bridgeName);
}
final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
transaction.put(LogicalDatastoreType.CONFIGURATION, ovsdbNodeIid, nodeData);
transaction.submit();
- LO.info("Created and submitted a new OVSDB node {}", nodeData.getNodeId());
+ LOG.info("Created and submitted a new OVSDB node {}", nodeData.getNodeId());
} catch (final Exception e) {
- LO.error("Exception while creating OvsdbNodeAugmentation, Uni is null. Node Id: {}", ovsdbNodeId, e);
+ LOG.error("Exception while creating OvsdbNodeAugmentation, Uni is null. Node Id: {}", ovsdbNodeId, e);
}
}
final WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
transaction.put(LogicalDatastoreType.CONFIGURATION, ovsdbNodeIid, nodeData);
transaction.submit();
- LO.info("Created and submitted a new OVSDB node {}", nodeData.getNodeId());
+ LOG.info("Created and submitted a new OVSDB node {}", nodeData.getNodeId());
return nodeData;
} catch (final Exception e) {
- LO.error("Exception while creating OvsdbNodeAugmentation, Uni is null. Node Id: {}", ovsdbNodeId, e);
+ LOG.error("Exception while creating OvsdbNodeAugmentation, Uni is null. Node Id: {}", ovsdbNodeId, e);
}
return null;
}
try {
Thread.sleep(UnimgrConstants.OVSDB_UPDATE_TIMEOUT);
} catch (final InterruptedException e) {
- LO.warn("Interrupted while waiting after OVSDB node augmentation {}", ovsdbNodeId, e);
+ LOG.warn("Interrupted while waiting after OVSDB node augmentation {}", ovsdbNodeId, e);
}
try {
future.checkedGet();
- LO.trace("Update qos and queues to ovsdb for node {} {}", ovsdbNodeId, ovsdbNodeAugmentationIid);
+ LOG.trace("Update qos and queues to ovsdb for node {} {}", ovsdbNodeId, ovsdbNodeAugmentationIid);
} catch (final TransactionCommitFailedException e) {
- LO.warn("Failed to put {} ", ovsdbNodeAugmentationIid, e);
+ LOG.warn("Failed to put {} ", ovsdbNodeAugmentationIid, e);
}
updateQosEntries(dataBroker, uni);
}
final List<QosEntries> qosList = optionalNode.get()
.getAugmentation(OvsdbNodeAugmentation.class)
.getQosEntries();
- LO.trace("QOS entries list {} for node {}", qosList, ovsdbNodeId);
+ LOG.trace("QOS entries list {} for node {}", qosList, ovsdbNodeId);
QosEntriesKey qosEntryKey = null;
for (final QosEntries qosEntry : qosList) {
qosEntryKey = qosEntry.getKey();
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
future.checkedGet();
- LO.info("Update qos-entries to ovsdb for node {} {}", ovsdbNodeId, queueIid);
+ LOG.info("Update qos-entries to ovsdb for node {} {}", ovsdbNodeId, queueIid);
} catch (final TransactionCommitFailedException e) {
- LO.warn("Failed to put {} ", queueIid, e);
+ LOG.warn("Failed to put {} ", queueIid, e);
}
}
}
Optional<Node> optionalNode;
if (UniUtils.getSpeed(sourceUniAugmentation.getSpeed().getSpeed())
.equals(UniUtils.getSpeed(evc.getIngressBw().getSpeed()))) {
- LO.info("Source UNI speed matches EVC ingress BW");
+ LOG.info("Source UNI speed matches EVC ingress BW");
} else {
// update Uni's ovsdbNodeRef qos-entries and queues for max-rate to match EVC ingress BW
optionalNode = findOvsdbNode(dataBroker, sourceUniAugmentation);
if (UniUtils.getSpeed(destinationUniAugmentation.getSpeed().getSpeed())
.equals(UniUtils.getSpeed(evc.getIngressBw().getSpeed()))) {
- LO.info("Destination UNI speed matches EVC ingress BW");
+ LOG.info("Destination UNI speed matches EVC ingress BW");
} else {
// update Uni's ovsdbNodeRef qos-entries and queues for max-rate to match EVC ingress BW
optionalNode = findOvsdbNode(dataBroker, destinationUniAugmentation);
final List<QosEntries> qosList = optionalOvsdbNode.get()
.getAugmentation(OvsdbNodeAugmentation.class)
.getQosEntries();
- LO.trace("QOS entries list {} for node {}", qosList, ovsdbNodeId);
+ LOG.trace("QOS entries list {} for node {}", qosList, ovsdbNodeId);
QosEntriesKey qosEntryKey = null;
for (final QosEntries qosEntry : qosList) {
qosEntryKey = qosEntry.getKey();
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
future.checkedGet();
- LO.info("Update qos-entries max-rate to ovsdb for node {} {}", ovsdbNodeId, qosOtherConfigIid);
+ LOG.info("Update qos-entries max-rate to ovsdb for node {} {}", ovsdbNodeId, qosOtherConfigIid);
} catch (final TransactionCommitFailedException e) {
- LO.warn("Failed to put {}", qosOtherConfigIid, e);
+ LOG.warn("Failed to put {}", qosOtherConfigIid, e);
}
}
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
try {
future.checkedGet();
- LO.info("Update queues max-rate to ovsdb for node {} {}", ovsdbNodeId, queuesOtherConfigIid);
+ LOG.info("Update queues max-rate to ovsdb for node {} {}", ovsdbNodeId, queuesOtherConfigIid);
} catch (final TransactionCommitFailedException e) {
- LO.warn("Failed to put {} ", queuesOtherConfigIid, e);
+ LOG.warn("Failed to put {} ", queuesOtherConfigIid, e);
}
}
if (uni.getSpeed() != null) {
final Uuid qosUuid = getQosUuid(dataBroker, uni);
//tpAugmentationBuilder.setQos(getQosUuid(dataBroker, uni));
- LO.info("Updating Qos {} to termination point {}", qosUuid , bridgeName);
+ LOG.info("Updating Qos {} to termination point {}", qosUuid , bridgeName);
}
final TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
tpBuilder.setKey(InstanceIdentifier.keyOf(tpIid));
future.checkedGet();
result = true;
} catch (final TransactionCommitFailedException e) {
- LO.warn("Failed to delete {} ", path, e);
+ LOG.warn("Failed to delete {} ", path, e);
}
return result;
}
.getRemoteIp()
.getIpv4Address()
.equals(uni.getIpAddress().getIpv4Address())) {
- LO.info("Found ovsdb node");
+ LOG.info("Found ovsdb node");
optionalOvsdb = Optional.of(ovsdbNode);
return optionalOvsdb;
}
final Ipv4Address ipv4 = new Ipv4Address(ip);
return new IpAddress(ipv4);
} catch (final UnknownHostException e) {
- LO.info("Unable to retrieve controller's ip address, using loopback. {}", e);
+ LOG.info("Unable to retrieve controller's ip address, using loopback. {}", e);
}
return new IpAddress(UnimgrConstants.LOCAL_IP);
}
public class UniUtils {
- private static final Logger LO = LoggerFactory.getLogger(UniUtils.class);
+ private static final Logger LOG = LoggerFactory.getLogger(UniUtils.class);
private UniUtils() {
throw new AssertionError("Instantiating utility class.");
final CheckedFuture<Void, TransactionCommitFailedException> future = transaction.submit();
future.checkedGet();
result = true;
- LO.info("Created and submitted a new Uni node {}", nodeData.getNodeId());
+ LOG.info("Created and submitted a new Uni node {}", nodeData.getNodeId());
} catch (final Exception e) {
- LO.error("Exception while creating Uni Node, Uni Node Id: {}", uniNodeId, e);
+ LOG.error("Exception while creating Uni Node, Uni Node Id: {}", uniNodeId, e);
}
return result;
}
for (final Node uniNode : uniNodes) {
final UniAugmentation uniAugmentation = uniNode.getAugmentation(UniAugmentation.class);
if (uniAugmentation.getIpAddress().equals(ipAddress)) {
- LO.info("Found Uni node");
+ LOG.info("Found Uni node");
return Optional.of(uniNode);
}
}