<version>${project.version}</version>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
</project>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>blueprint-maven-plugin</artifactId>
</plugin>
-
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
</plugins>
</build>
-
</project>
</dependency>
</dependencies>
- <build>
- <plugins>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<scm>
<connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>
<url>https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main</url>
<tag>HEAD</tag>
</scm>
-
</project>
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutionException;
private final BundleId bundleId;
private final Message message;
private final NodeId nodeId;
- private ListenableFuture<RpcResult<AddBundleMessagesOutput>> flowFuture;
BundleFlowCallBack(InstanceIdentifier<FlowCapableNode> nodeIdent, BundleId bundleId, Message message,
ListenableFuture<RpcResult<AddFlowOutput>> flowFuture) {
}
@Override
+ @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED")
public void onSuccess(RpcResult<AddBundleMessagesOutput> rpcResult) {
if (rpcResult.isSuccessful()) {
List<Message> messages = new ArrayList<>(1);
.setFlags(BUNDLE_FLAGS).setMessages(new MessagesBuilder().setMessage(messages).build()).build();
LOG.trace("Pushing flow add message {} to bundle {} for device {}", addBundleMessagesInput,
bundleId.getValue(), nodeId.getValue());
- flowFuture = forwardingRulesManager.getSalBundleService().addBundleMessages(addBundleMessagesInput);
- } else {
- flowFuture = Futures.immediateFuture(null);
+ forwardingRulesManager.getSalBundleService().addBundleMessages(addBundleMessagesInput);
}
}
@Override
public void onFailure(Throwable throwable) {
- flowFuture = Futures.immediateFailedFuture(null);
LOG.error("Error while pushing flow add bundle {} for device {}", message, nodeId);
}
}
this.nodeId = nodeId;
}
+ @Override
public void onSuccess(RpcResult<AddBundleMessagesOutput> result) {
if (result.isSuccessful()) {
forwardingRulesManager.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
@Override
public void onFailure(Throwable throwable) {
- LOG.error("Service call for updating group {} failed for node {} with error {}", groupId, nodeId,
- throwable);
+ LOG.error("Service call for updating group {} failed for node {}", groupId, nodeId, throwable);
}
}
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.StaleFlowKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowTableRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
builder.setFlowTable(new FlowTableRef(nodeIdent.child(Table.class, tableKey)));
builder.setTransactionUri(new Uri(provider.getNewTransactionId()));
Long groupId = isFlowDependentOnGroup(addDataObj);
- ListenableFuture<RpcResult<AddFlowOutput>> future = SettableFuture.create();
if (groupId != null) {
LOG.trace("The flow {} is dependent on group {}. Checking if the group is already present",
getFlowId(new FlowRef(identifier)), groupId);
if (isGroupExistsOnDevice(nodeIdent, groupId, provider)) {
LOG.trace("The dependent group {} is already programmed. Adding the flow {}", groupId,
getFlowId(new FlowRef(identifier)));
- future = provider.getSalFlowService().addFlow(builder.build());
+ return provider.getSalFlowService().addFlow(builder.build());
} else {
LOG.trace("The dependent group {} isn't programmed yet. Pushing the group", groupId);
ListenableFuture<RpcResult<AddGroupOutput>> groupFuture = pushDependentGroup(nodeIdent,
groupId);
- Futures.addCallback(groupFuture, new AddFlowCallBack(builder.build(), nodeId, future,
- groupId),
+ Futures.addCallback(groupFuture, new AddFlowCallBack(builder.build(), nodeId, groupId),
MoreExecutors.directExecutor());
+ // TODO This makes new sense and seems just wrong...
+ return SettableFuture.create();
}
} else {
LOG.trace("The flow {} is not dependent on any group. Adding the flow",
getFlowId(new FlowRef(identifier)));
- future = provider.getSalFlowService().addFlow(builder.build());
+ return provider.getSalFlowService().addFlow(builder.build());
}
- return future;
});
}
}
private final class AddFlowCallBack implements FutureCallback<RpcResult<AddGroupOutput>> {
private final AddFlowInput addFlowInput;
private final NodeId nodeId;
- private ListenableFuture<RpcResult<AddFlowOutput>> future;
private final Long groupId;
- private AddFlowCallBack(final AddFlowInput addFlowInput, final NodeId nodeId,
- ListenableFuture<RpcResult<AddFlowOutput>> future, Long groupId) {
+ // TODO
+ private AddFlowCallBack(final AddFlowInput addFlowInput, final NodeId nodeId, Long groupId) {
this.addFlowInput = addFlowInput;
this.nodeId = nodeId;
- this.future = future;
this.groupId = groupId;
}
@Override
+ @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED")
public void onSuccess(RpcResult<AddGroupOutput> rpcResult) {
if (rpcResult.isSuccessful()) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
- future = provider.getSalFlowService().addFlow(addFlowInput);
+ provider.getSalFlowService().addFlow(addFlowInput);
LOG.debug("Flow add with id {} finished without error for node {}",
getFlowId(addFlowInput.getFlowRef()), nodeId);
} else {
&& rpcResult.getErrors().iterator().next().getMessage()
.contains(GROUP_EXISTS_IN_DEVICE_ERROR)) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
- future = provider.getSalFlowService().addFlow(addFlowInput);
+ provider.getSalFlowService().addFlow(addFlowInput);
LOG.debug("Group {} already programmed in the device. Adding the flow {}", groupId,
getFlowId(addFlowInput.getFlowRef()));
} else {
LOG.error("Flow add with id {} failed for node {} with error {}",
getFlowId(addFlowInput.getFlowRef()), nodeId, rpcResult.getErrors().toString());
- future = Futures.immediateFuture(null);
}
}
}
@Override
public void onFailure(Throwable throwable) {
- LOG.error("Service call for adding flow with id {} failed for node {} with error {}",
- getFlowId(addFlowInput.getFlowRef()), nodeId, throwable.getCause());
- Futures.immediateFailedFuture(null);
+ LOG.error("Service call for adding flow with id {} failed for node {}",
+ getFlowId(addFlowInput.getFlowRef()), nodeId, throwable);
}
}
private final class UpdateFlowCallBack implements FutureCallback<RpcResult<AddGroupOutput>> {
private final UpdateFlowInput updateFlowInput;
private final NodeId nodeId;
- private ListenableFuture<RpcResult<UpdateFlowOutput>> future;
private final Long groupId;
private UpdateFlowCallBack(final UpdateFlowInput updateFlowInput, final NodeId nodeId,
ListenableFuture<RpcResult<UpdateFlowOutput>> future, Long groupId) {
this.updateFlowInput = updateFlowInput;
this.nodeId = nodeId;
- this.future = future;
this.groupId = groupId;
}
@Override
+ @SuppressFBWarnings("RV_RETURN_VALUE_IGNORED")
public void onSuccess(RpcResult<AddGroupOutput> rpcResult) {
if (rpcResult.isSuccessful()) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
- future = provider.getSalFlowService().updateFlow(updateFlowInput);
+ provider.getSalFlowService().updateFlow(updateFlowInput);
LOG.debug("Flow update with id {} finished without error for node {}",
getFlowId(updateFlowInput.getFlowRef()), nodeId);
} else {
&& rpcResult.getErrors().iterator().next().getMessage()
.contains(GROUP_EXISTS_IN_DEVICE_ERROR)) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
- future = provider.getSalFlowService().updateFlow(updateFlowInput);
+ provider.getSalFlowService().updateFlow(updateFlowInput);
LOG.debug("Group {} already programmed in the device. Updating the flow {}", groupId,
getFlowId(updateFlowInput.getFlowRef()));
} else {
LOG.error("Flow update with id {} failed for node {} with error {}",
getFlowId(updateFlowInput.getFlowRef()), nodeId, rpcResult.getErrors().toString());
- future = Futures.immediateFuture(null);
}
}
}
@Override
public void onFailure(Throwable throwable) {
- LOG.error("Service call for updating flow with id {} failed for node {} with error {}",
+ LOG.error("Service call for updating flow with id {} failed for node {}",
getFlowId(updateFlowInput.getFlowRef()), nodeId, throwable);
- future = Futures.immediateFailedFuture(null);
}
}
}
@Override
public void onFailure(Throwable cause) {
- String msg = "add-group RPC failed: node=" + nodeIdentity.firstKeyOf(Node.class).getId().getValue()
- + ", id=" + groupId;
- LOG.debug(msg, cause);
+ LOG.debug("add-group RPC failed: node={}, id={}",
+ nodeIdentity.firstKeyOf(Node.class).getId().getValue(), groupId, cause);
}
}, MoreExecutors.directExecutor());
LOG.debug("Group add with id {} finished without error for node {}", groupId, nodeId);
} else {
LOG.debug("Group add with id {} failed for node {} with error {}", groupId, nodeId,
- result.getErrors().toString());
+ result.getErrors());
}
}
this.nodeId = nodeId;
}
+ @Override
public void onSuccess(RpcResult<UpdateGroupOutput> result) {
if (result.isSuccessful()) {
provider.getDevicesGroupRegistry().storeGroup(nodeId, groupId);
@Override
public void onFailure(Throwable throwable) {
- LOG.error("Service call for updating group {} failed for node {} with error {}", groupId, nodeId,
+ LOG.error("Service call for updating group {} failed for node {} with", groupId, nodeId,
throwable);
}
}
@Override
public void update(final InstanceIdentifier<TableFeatures> identifier, final TableFeatures original,
final TableFeatures update, final InstanceIdentifier<FlowCapableNode> nodeIdent) {
- LOG.debug("Received the Table Update request [Tbl id, node Id, original, upd" + " " + identifier + " "
- + nodeIdent + " " + original + " " + update);
+ LOG.debug("Received the Table Update request [Tbl id, node Id, original, upd {} {} {} {}", identifier,
+ nodeIdent, original, update);
final TableFeatures originalTableFeatures = original;
TableFeatures updatedTableFeatures;
LOG.debug("Invoking SalTableService ");
if (this.provider.getSalTableService() != null) {
- LOG.debug(" Handle to SalTableServices" + this.provider.getSalTableService());
+ LOG.debug(" Handle to SalTableServices {}", this.provider.getSalTableService());
}
final Future<RpcResult<UpdateTableOutput>> resultFuture =
return resultFuture;
}
- public void setResultFuture(T result) {
+ public void setResultFuture(@Nullable T result) {
this.resultFuture.set(result);
}
List<Action> actions = Collections.emptyList();
if (instruction.getInstruction().getImplementedInterface()
.equals(ActionType.APPLY_ACTION.getActionType())) {
- actions = ((ApplyActionsCase) (instruction.getInstruction()))
+ actions = ((ApplyActionsCase) instruction.getInstruction())
.getApplyActions().getAction();
}
for (Action action : actions) {
BigInteger dpId = getDpnIdFromNodeName(nodeIdent);
final NodeRef nodeRef = new NodeRef(nodeIdent.firstIdentifierOf(Node.class));
GetActiveBundleInputBuilder input = new GetActiveBundleInputBuilder().setNodeId(dpId).setNode(nodeRef);
- RpcResult<GetActiveBundleOutput> result = null;
try {
- result = provider.getArbitratorReconciliationManager()
+ RpcResult<GetActiveBundleOutput> result = provider.getArbitratorReconciliationManager()
.getActiveBundle(input.build()).get(RPC_RESULT_TIMEOUT, TimeUnit.MILLISECONDS);
+ if (!result.isSuccessful()) {
+ LOG.trace("Error while retrieving active bundle present for node {}", dpId);
+ } else {
+ return result.getResult().getResult();
+ }
} catch (InterruptedException | ExecutionException | TimeoutException e) {
LOG.error("Error while retrieving active bundle present for node {}", dpId , e);
}
- if (!result.isSuccessful()) {
- LOG.trace("Error while retrieving active bundle present for node {}", dpId);
- } else {
- return result.getResult().getResult();
- }
return null;
}
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
</plugins>
</build>
NODES_IID.child(Node.class, new NodeKey(nodeId)).augmentation(FlowCapableNode.class);
return roTx.read(logicalDatastoreType, path).checkedGet(5000, TimeUnit.MILLISECONDS);
} catch (ReadFailedException | TimeoutException e) {
- LOG.error("error reading {} -> {}", nodeId.getValue(), e);
+ LOG.error("error reading {}", nodeId.getValue(), e);
}
return Optional.absent();
}
}
} catch (InterruptedException | ExecutionException | TimeoutException e) {
- LOG.error("Error processing inventory node modification: {}, {}", nodeId.getValue(), e);
+ LOG.error("Error processing inventory node modification: {}", nodeId.getValue(), e);
}
}
}
try {
clusterSingletonServiceRegistration.close();
} catch (Exception e) {
- LOG.error("FRS cluster service close fail: {} {}", nodeId.getValue(), e);
+ LOG.error("FRS cluster service close fail: {}", nodeId.getValue(), e);
}
}
}
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import com.google.common.util.concurrent.FutureCallback;
-import java.util.Arrays;
import java.util.Collection;
import javax.annotation.Nullable;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
public void onSuccess(@Nullable final RpcResult<Void> result) {
if (result != null) {
if (result.isSuccessful()) {
- LOG.debug(prefix + " finished successfully: {}", nodeId.getValue());
+ LOG.debug("{} finished successfully: {}", prefix, nodeId.getValue());
} else {
final Collection<RpcError> errors = MoreObjects.firstNonNull(result.getErrors(),
ImmutableList.<RpcError>of());
- LOG.debug(prefix + " failed: {} -> {}", nodeId.getValue(), Arrays.toString(errors.toArray()));
+ LOG.debug("{} failed: {} -> {}", prefix, nodeId.getValue(), errors);
}
} else {
- LOG.debug(prefix + " reconciliation failed: {} -> null result", nodeId.getValue());
+ LOG.debug("{} reconciliation failed: {} -> null result", prefix, nodeId.getValue());
}
}
@Override
public void onFailure(final Throwable failure) {
- LOG.debug(prefix + " reconciliation failed seriously: {}", nodeId.getValue(), failure);
+ LOG.debug("{} reconciliation failed seriously: {}", prefix, nodeId.getValue(), failure);
}
};
}
try {
guard.acquire();
} catch (InterruptedException e) {
- LOG.warn("Could not acquire guard for {}, {}", key, e);
+ LOG.warn("Could not acquire guard for {}", key, e);
return null;
}
return guard;
</dependency>
</dependencies>
- <build>
- <plugins>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
<scm>
<connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>
<url>https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Main</url>
<tag>HEAD</tag>
</scm>
-
</project>
</execution>
</executions>
</plugin>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
</plugins>
</build>
public void channelRead0(final ChannelHandlerContext ctx, final VersionMessageUdpWrapper msg)
throws Exception {
if (LOG.isDebugEnabled()) {
- LOG.debug("UdpVersionMessageWrapper received");
- LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
+ LOG.debug("UdpVersionMessageWrapper received: {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
}
try {
protected void decode(ChannelHandlerContext ctx, VersionMessageWrapper msg, List<Object> out) throws Exception {
statisticsCounter.incrementCounter(CounterEventTypes.US_RECEIVED_IN_OFJAVA);
if (LOG.isDebugEnabled()) {
- LOG.debug("VersionMessageWrapper received");
- LOG.debug("<< {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
+ LOG.debug("VersionMessageWrapper received: {}", ByteBufUtils.byteBufToHexString(msg.getMessageBuffer()));
}
try {
private static final Logger LOG = LoggerFactory.getLogger(SslKeyStore.class);
private SslKeyStore() {
- throw new UnsupportedOperationException("Utility class shouldn't be instantiated");
}
/**
}
break;
case PATH:
- LOG.debug("Current dir using System:"
- + System.getProperty("user.dir"));
+ LOG.debug("Current dir using System: {}",
+ System.getProperty("user.dir"));
File keystorefile = new File(filename);
try {
in = new FileInputStream(keystorefile);
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.FutureCallback;
-
+import edu.umd.cs.findbugs.annotations.Nullable;
import java.util.function.Function;
import org.opendaylight.openflowjava.protocol.api.connection.OutboundQueueException;
final class OutboundQueueEntry {
private static final Logger LOG = LoggerFactory.getLogger(OutboundQueueEntry.class);
- public static final Function<OfHeader, Boolean> DEFAULT_IS_COMPLETE = new Function<OfHeader, Boolean>() {
-
- @Override
- public Boolean apply(final OfHeader message) {
- if (message instanceof MultipartReplyMessage) {
- return !((MultipartReplyMessage) message).getFlags().isOFPMPFREQMORE();
- }
-
- return true;
+ public static final Function<OfHeader, Boolean> DEFAULT_IS_COMPLETE = message -> {
+ if (message instanceof MultipartReplyMessage) {
+ return !((MultipartReplyMessage) message).getFlags().isOFPMPFREQMORE();
}
+ return true;
};
private FutureCallback<OfHeader> callback;
}
private void checkCompletionNeed() {
- if (callback == null || (message instanceof PacketOutInput)) {
+ if (callback == null || message instanceof PacketOutInput) {
completed = true;
if (callback != null) {
callback.onSuccess(null);
}
}
- boolean complete(final OfHeader response) {
+ boolean complete(@Nullable final OfHeader response) {
Preconditions.checkState(!completed, "Attempted to complete a completed message with response %s", response);
// Multipart requests are special, we have to look at them to see
@VisibleForTesting
/** This method is only for testing to prove that after queue entry is completed there is not callback future */
boolean hasCallback() {
- return (callback != null);
+ return callback != null;
}
}
EncodeConstants.OF13_VERSION_ID, expId, meterBandSubType));
serializer.serialize(experimenterBandCase, outBuffer);
} catch (final IllegalStateException e) {
- LOG.warn("Serializer for key: {} wasn't found, exception {}",
+ LOG.warn("Serializer for key: {} wasn't found",
ExperimenterSerializerKeyFactory.createMeterBandSerializerKey(
- EncodeConstants.OF13_VERSION_ID, expId, meterBandSubType), e);
+ EncodeConstants.OF13_VERSION_ID, expId, meterBandSubType));
}
}
}
// TODO - simplify to correctly report exception during deserialization
if (!exceptionLogged) {
LOG.warn("Problem during reading table feature property. Skipping unknown feature property: {}."
- + "If more information is needed, set org.opendaylight.openflowjava do DEBUG log level.",
- key, e.getMessage());
+ + "If more information is needed, set org.opendaylight.openflowjava do DEBUG log level "
+ + " ({}).", key, e.getMessage());
if (LOG.isDebugEnabled()) {
- LOG.debug("Detailed exception: {}", e);
- LOG.debug("This exception is logged only once for each multipart reply (table features) to "
- + "prevent log flooding. There might be more of table features related exceptions.");
+ LOG.debug("Detailed exception is logged only once for each multipart reply (table features)"
+ + "to prevent log flooding. There might be more of table features related exceptions.",
+ e);
}
exceptionLogged = true;
}
@Override
public void run() {
for (CounterEventTypes cet : sc.getEnabledCounters()) {
- LOG.debug("{}: {}", cet.name(), sc.getCountersMap().get(cet).getStat());
+ LOG.debug("Event {}: {}", cet.name(), sc.getCountersMap().get(cet).getStat());
}
}
}
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
try {
Thread.sleep(tick);
} catch (InterruptedException e) {
- LOG.debug("interrupted: {}", e.getMessage(), e);
+ LOG.debug("interrupted", e);
Thread.currentThread().interrupt();
}
}
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
</plugin>
- <!-- TODO Remove this when we upgrade to odlparent with a fix for ODLPARENT-146 -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>findbugs-maven-plugin</artifactId>
- <configuration>
- <failOnError>false</failOnError>
- </configuration>
- </plugin>
</plugins>
</build>
</project>
try {
shutdownSwitchConnections().get(10, TimeUnit.SECONDS);
} catch (InterruptedException | ExecutionException | TimeoutException e) {
- LOG.warn("Failed to shut down switch connections in time {}s, error: {}", 10, e);
+ LOG.warn("Failed to shut down switch connections in time {}s", 10, e);
}
gracefulShutdown(contextChainHolder);
import org.slf4j.LoggerFactory;
public class ConfigurationServiceFactoryImpl implements ConfigurationServiceFactory {
- private static final Logger LOG = LoggerFactory.getLogger(ConfigurationServiceFactory.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ConfigurationServiceFactoryImpl.class);
@Override
public ConfigurationService newInstance(
configurationService.update(mapProperties);
});
} catch (IOException e) {
- LOG.debug("Failed to load {} configuration file. Error {}", OFConstants.CONFIG_FILE_ID, e);
+ LOG.debug("Failed to load {} configuration file", OFConstants.CONFIG_FILE_ID);
}
});
}
@Override
public void handleException(Throwable throwable) {
if (throwable instanceof ConnectionException) {
- LOG.warn("exception -> {}", throwable.getMessage(), throwable);
+ LOG.warn("Exception", throwable);
} else {
- LOG.error("exception -> {}", throwable.getMessage(), throwable);
+ LOG.error("Exception", throwable);
}
}
}
private static final Logger LOG = LoggerFactory.getLogger(ConnectionReadyListenerImpl.class);
- private ConnectionContext connectionContext;
- private HandshakeContext handshakeContext;
+ private final ConnectionContext connectionContext;
+ private final HandshakeContext handshakeContext;
/**
* Constructor.
// need to remain in sync lock until initial handshake step processed.
handshakeResult.get();
} catch (Exception e) {
- LOG.error("failed to process onConnectionReady event on device {}, reason {}",
+ LOG.error("failed to process onConnectionReady event on device {}",
connectionContext.getConnectionAdapter().getRemoteAddress(),
e);
connectionContext.closeConnection(false);
}
if (LOG.isTraceEnabled()) {
- LOG.trace("Exception while waiting for echoReply from [{}] in TIMEOUTING state: {}",
+ LOG.trace("Exception while waiting for echoReply from [{}] in TIMEOUTING state",
remoteAddress, e);
}
}
if (LOG.isTraceEnabled()) {
- LOG.trace("Received EchoReply from [{}] in TIMEOUTING state, Error:{}", remoteAddress, cause);
+ LOG.trace("Received EchoReply from [{}] in TIMEOUTING state", remoteAddress, cause);
}
-
}
}
}
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.openflowplugin.api.openflow.device.TxFacade;
-import org.opendaylight.openflowplugin.impl.services.AbstractMultipartService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.opendaylight.yangtools.yang.binding.DataObject;
public abstract class AbstractMultipartWriter<T extends DataContainer> {
- private static final Logger LOG = LoggerFactory.getLogger(AbstractMultipartService.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractMultipartWriter.class);
private final TxFacade txFacade;
private final InstanceIdentifier<Node> instanceIdentifier;
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,
- throwable);
+ LOG.warn("Failed filling flow registry with flows for node: {}", deviceInfo, throwable);
}
contextChainMastershipWatcher.onNotAbleToStartMastership(
deviceInfo,
final OFSerializer<Experimenter> serializer = registry.getSerializer(key);
serializer.serialize(band, outBuffer);
} catch (final IllegalStateException e) {
- LOG.warn("Serializer for key: {} wasn't found, exception {}", key, e);
+ LOG.warn("Serializer for key: {} wasn't found", key, e);
}
}
})));
}
} else {
- LOG.error("getGenerationIdFromDevice RPC error "
- + roleRequestOutputRpcResult.getErrors().iterator().next().getInfo());
+ LOG.error("getGenerationIdFromDevice RPC error {}",
+ roleRequestOutputRpcResult.getErrors().iterator().next().getInfo());
finalFuture.setException(new RoleChangeException(ErrorUtil
.errorsToString(roleRequestOutputRpcResult.getErrors())));
}
@Override
public void onFailure(final Throwable throwable) {
- LOG.warn("Service call for adding flow={} failed, reason: {}", input, throwable);
+ LOG.warn("Service call for adding flow={} failed", input, throwable);
}
}
@Override
public void onFailure(final Throwable throwable) {
- LOG.warn("Service call for removing flow={} failed, reason: {}", input, throwable);
+ LOG.warn("Service call for removing flow={} failed", input, throwable);
}
}
@Override
public void onFailure(final Throwable throwable) {
- LOG.warn("Service call for updating flow={} failed, reason: {}", input, throwable);
+ LOG.warn("Service call for updating flow={} failed", input, throwable);
}
}
}
@Override
public void onFailure(Throwable throwable) {
- LOG.warn("Service call for adding group={} failed, reason: {}",
+ LOG.warn("Service call for adding group={} failed",
input.getGroupId().getValue(),
throwable);
}
@Override
public void onFailure(Throwable throwable) {
- LOG.warn("Service call for updating group={} failed, reason: {}",
+ LOG.warn("Service call for updating group={} failed",
input.getOriginalGroup().getGroupId(), throwable);
}
}, MoreExecutors.directExecutor());
@Override
public void onFailure(Throwable throwable) {
- LOG.warn("Service call for removing group={} failed, reason: {}",
+ LOG.warn("Service call for removing group={} failed",
input.getGroupId().getValue(), throwable);
}
}, MoreExecutors.directExecutor());
@Override
public void onFailure(Throwable throwable) {
- LOG.warn("Service call for adding meter={} failed, reason: {}", input.getMeterId(), throwable);
+ LOG.warn("Service call for adding meter={} failed", input.getMeterId(), throwable);
}
}, MoreExecutors.directExecutor());
return resultFuture;
@Override
public void onFailure(Throwable throwable) {
- LOG.warn("Service call for updating meter={} failed, reason: {}",
+ LOG.warn("Service call for updating meter={} failed",
input.getOriginalMeter().getMeterId(), throwable);
}
}, MoreExecutors.directExecutor());
@Override
public void onFailure(Throwable throwable) {
- LOG.warn("Service call for removing meter={} failed, reason: {}", input.getMeterId(), throwable);
+ LOG.warn("Service call for removing meter={} failed", input.getMeterId(), throwable);
}
}, MoreExecutors.directExecutor());
return resultFuture;
return null;
}, MoreExecutors.directExecutor()).get();
} catch (InterruptedException | ExecutionException ex) {
- LOG.debug("Failed to delete {} flows, exception: {}", deviceFlowRegistry.size(), ex);
+ LOG.debug("Failed to delete {} flows", deviceFlowRegistry.size(), ex);
}
}
// log current counters and cleans it
if (LOG.isDebugEnabled()) {
for (String counterItem : provideIntelligence()) {
- LOG.debug(counterItem);
+ LOG.debug("Counter: {}", counterItem);
}
}
}
}
private RemovedFlowReason translateReason(FlowRemoved removedFlow) {
- LOG.debug("--Entering translateReason within FlowRemovedTranslator with reason:{} " + removedFlow.getReason());
+ LOG.debug("--Entering translateReason within FlowRemovedTranslator with reason: {}", removedFlow.getReason());
switch (removedFlow.getReason()) {
case OFPRRIDLETIMEOUT:
return RemovedFlowReason.OFPRRIDLETIMEOUT;
</scm>
<properties>
- <project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<exi.nagasena.version>0000.0002.0053.0</exi.nagasena.version>
<infrautils.version>1.5.0-SNAPSHOT</infrautils.version>
<serviceutils.version>0.3.0-SNAPSHOT</serviceutils.version>