.MultipartReply.class.cast(message).getMultipartReplyBody());
}
- LOG.debug("Failed to translate {} for node {}.", message.getImplementedInterface(), deviceInfo.getLOGValue());
+ LOG.debug("Failed to translate {} for node {}.", message.getImplementedInterface(), deviceInfo);
return Optional.empty();
}
submitTransaction();
} catch (final Exception e) {
LOG.warn("Error processing port status message for port {} on device {}",
- portStatus.getPortNo(), getDeviceInfo().getLOGValue(), e);
+ portStatus.getPortNo(), getDeviceInfo(), e);
}
} else if (!hasState.get()) {
primaryConnectionContext.handlePortStatusMessage(portStatus);
void lazyTransactionManagerInitialization() {
if (!this.initialized.get()) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Transaction chain manager for node {} created", deviceInfo.getLOGValue());
+ LOG.debug("Transaction chain manager for node {} created", deviceInfo);
}
this.transactionChainManager = new TransactionChainManager(dataBroker, deviceInfo);
this.deviceFlowRegistry = new DeviceFlowRegistryImpl(deviceInfo.getVersion(), dataBroker, deviceInfo
.count();
LOG.debug("Finished filling flow registry with {} flows for node: {}", flowCount, deviceInfo
- .getLOGValue());
+ );
}
this.contextChainMastershipWatcher.onMasterRoleAcquired(deviceInfo, ContextChainMastershipState
.INITIAL_FLOW_REGISTRY_FILL);
public void onFailure(Throwable throwable) {
if (deviceFlowRegistryFill.isCancelled()) {
if (LOG.isDebugEnabled()) {
- LOG.debug("Cancelled filling flow registry with flows for node: {}", deviceInfo.getLOGValue());
+ LOG.debug("Cancelled filling flow registry with flows for node: {}", deviceInfo);
}
} else {
LOG.warn("Failed filling flow registry with flows for node: {} with exception: {}", deviceInfo
- .getLOGValue(), throwable);
+ , throwable);
}
contextChainMastershipWatcher.onNotAbleToStartMastership(
deviceInfo,
TransactionChainManager(@Nonnull final DataBroker dataBroker,
@Nonnull final DeviceInfo deviceInfo) {
this.dataBroker = dataBroker;
- this.nodeId = deviceInfo.getLOGValue();
+ this.nodeId = deviceInfo.toString();
this.lastSubmittedFuture = Futures.immediateFuture(null);
}
Preconditions.checkNotNull(deviceContext);
// Write node to datastore
- LOG.debug("Initializing node information for node {}", deviceContext.getDeviceInfo().getLOGValue());
+ LOG.debug("Initializing node information for node {}", deviceContext.getDeviceInfo());
try {
deviceContext.writeToTransaction(LogicalDatastoreType.OPERATIONAL, deviceContext
.getDeviceInfo()
final DeviceState deviceState = Preconditions.checkNotNull(deviceContext.getDeviceState());
final DeviceInfo deviceInfo = Preconditions.checkNotNull(deviceContext.getDeviceInfo());
final Capabilities capabilities = connectionContext.getFeatures().getCapabilities();
- LOG.debug("Setting capabilities for device {}", deviceInfo.getLOGValue());
+ LOG.debug("Setting capabilities for device {}", deviceInfo);
DeviceStateUtil.setDeviceStateBasedOnV13Capabilities(deviceState, capabilities);
// First process description reply, write data to DS and write consequent data if successful
@Override
public Void apply(@Nullable final List<RpcResult<List<OfHeader>>> input) {
LOG.info("Static node {} successfully finished collecting",
- deviceContext.getDeviceInfo().getLOGValue());
+ deviceContext.getDeviceInfo());
return null;
}
});
@Override
public void onSuccess(final RpcResult<List<OfHeader>> result) {
if (Objects.nonNull(result.getResult())) {
- LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo().getLOGValue(), type);
+ LOG.info("Static node {} info: {} collected", deviceContext.getDeviceInfo(), type);
translateAndWriteResult(
type,
result.getResult(),
@Override
public void onFailure(@Nonnull final Throwable throwable) {
LOG.warn("Request of type {} for static info of node {} failed.",
- type, deviceContext.getDeviceInfo().getLOGValue());
+ type, deviceContext.getDeviceInfo());
}
});
}
});
});
} catch (final Exception e) {
- LOG.warn("Failed to write node {} to DS ", deviceContext.getDeviceInfo().getLOGValue(), e);
+ LOG.warn("Failed to write node {} to DS ", deviceContext.getDeviceInfo(), e);
}
} else {
LOG.warn("Failed to write node {} to DS because we failed to gather device info.",
- deviceContext.getDeviceInfo().getLOGValue());
+ deviceContext.getDeviceInfo());
}
}
public void onDeviceRemoved(final DeviceInfo deviceInfo) {
contexts.remove(deviceInfo);
if (LOG.isDebugEnabled()) {
- LOG.debug("Rpc context removed for node {}", deviceInfo.getLOGValue());
+ LOG.debug("Rpc context removed for node {}", deviceInfo);
}
}
}
.ifPresent(writer -> writer.write(reply, false));
} catch (final Exception ex) {
LOG.warn("Stats processing of type {} for node {} failed during write-to-tx step",
- getMultipartType(), deviceInfo.getLOGValue(), ex);
+ getMultipartType(), deviceInfo, ex);
}
});
} catch (final Exception ex) {
}
return Futures.transformAsync(prevFuture, result -> {
- LOG.debug("Status of previous stat iteration for node {}: {}", deviceInfo.getLOGValue(), result);
+ LOG.debug("Status of previous stat iteration for node {}: {}", deviceInfo, result);
LOG.debug("Stats iterating to next type for node {} of type {}", deviceInfo, multipartType);
final boolean onTheFly = MultipartType.OFPMPFLOW.equals(multipartType);
final boolean supported = collectingStatType.contains(multipartType);
} catch (final Exception e) {
LOG.warn("Stats processing of type {} for node {} "
+ "failed during transformation step",
- type, deviceInfo.getLOGValue(), e);
+ type, deviceInfo, e);
return Futures.immediateFailedFuture(e);
}
}
LOG.warn("Stats processing of type {} for node {} "
- + "failed during write-to-tx step", type, deviceInfo.getLOGValue());
+ + "failed during write-to-tx step", type, deviceInfo);
return false;
}
}));
} catch (final Exception ex) {
LOG.warn("Stats processing of type {} for node {} "
- + "failed during write-to-tx step", type, deviceInfo.getLOGValue(), ex);
+ + "failed during write-to-tx step", type, deviceInfo, ex);
}
return result.get();
*/
public static void makeEmptyTables(final TxFacade txFacade, final DeviceInfo deviceInfo, final short nrOfTables) {
if (LOG.isDebugEnabled()) {
- LOG.debug("About to create {} empty tables for node {}.", nrOfTables, deviceInfo.getLOGValue());
+ LOG.debug("About to create {} empty tables for node {}.", nrOfTables, deviceInfo);
}
for (int i = 0; i < nrOfTables; i++) {
public void removeDeviceFromOperationalDSException() throws Exception {
final CheckedFuture<Void, TransactionCommitFailedException> failedFuture =
Futures.immediateFailedCheckedFuture(
- new TransactionCommitFailedException("Test failed transaction", null, null));
+ new TransactionCommitFailedException("Test failed transaction"));
Mockito.when(writeTransaction.submit()).thenReturn(failedFuture);
final ListenableFuture<Void> future = deviceManager
.removeDeviceFromOperationalDS(DUMMY_IDENTIFIER);
DeviceInfo deviceInfo = mock(DeviceInfo.class);
when(deviceInfo.getVersion()).thenReturn(OFConstants.OFP_VERSION_1_3);
when(deviceInfo.getDatapathId()).thenReturn(DUMMY_DATAPATH_ID);
- when(deviceInfo.getLOGValue()).thenReturn(DUMMY_DATAPATH_ID.toString());
when(mockedDeviceContext.getDeviceInfo()).thenReturn(deviceInfo);
when(mockedConnectionContext.getFeatures()).thenReturn(mockedFeaturesReply);