* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.applications.southboundcli.alarm;
import java.lang.management.ManagementFactory;
* @param nodeId Source of the alarm nodeId
* @param event reason for alarm invoke/clear
*/
- private String getAlarmText(final Long nodeId, final String event) {
+ private static String getAlarmText(final Long nodeId, final String event) {
return new StringBuilder("OF Switch ").append(nodeId).append(event).toString();
}
*
* @param nodeId Source of the alarm nodeId
*/
- private String getSourceText(final Long nodeId) {
+ private static String getSourceText(final Long nodeId) {
return "Dpn=" + nodeId;
}
}
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.openflowplugin.applications.southboundcli.cli;
import java.util.Formatter;
return null;
}
- private String getAllLocalNodesHeaderOutput() {
+ private static String getAllLocalNodesHeaderOutput() {
Formatter formatter = new Formatter();
String header = formatter.format("%-15s %3s %-15s", "NodeId", "", "NodeName").toString();
formatter.close();
@Option(name = "-d", description = "Node Id")
String dpnId;
- private FlowGroupCacheManager flowGroupCacheManager;
+ private final FlowGroupCacheManager flowGroupCacheManager;
public GetFlowGroupCacheProvider(final FlowGroupCacheManager flowGroupCacheManager) {
this.flowGroupCacheManager = flowGroupCacheManager;
return null;
}
- private String getLocalNodeHeaderOutput() {
+ private static String getLocalNodeHeaderOutput() {
Formatter formatter = new Formatter();
String header = formatter.format("%-10s %1s %-8s %1s %-23s %1s %-60s",
"TableId", "", "Status", "", "Time", "", "Flow/Group Id").toString();
return header;
}
- private String getAllLocalNodesHeaderOutput() {
+ private static String getAllLocalNodesHeaderOutput() {
Formatter formatter = new Formatter();
String header = formatter.format("%-15s %1s %-10s %1s %-8s %1s %-23s %1s %-60s",
"DpnId", "", "TableId", "", "Status", "", "Time", "", "Flow/Group Id").toString();
return header;
}
- private String getLineSeparator() {
+ private static String getLineSeparator() {
return "---------------------------------------------------------------------------------------------"
+ "-----------------------------------------------";
}
= "org.opendaylight.openflowplugin.frm:type=ReconciliationState";
private static final String JMX_ATTRIBUTE_NAME = "acquireReconciliationStates";
private static final String JMX_REST_HTTP_AUTH_UNAME_PWD = "admin:admin";
- private ReconciliationJMXServiceMBean reconciliationJMXServiceMBean;
- private ClusterMemberInfo clusterMemberInfoProvider;
+ private final ReconciliationJMXServiceMBean reconciliationJMXServiceMBean;
+ private final ClusterMemberInfo clusterMemberInfoProvider;
public GetReconciliationStateProvider(final ReconciliationJMXServiceMBean reconciliationJMXServiceMBean,
result.stream().forEach(p -> session.getConsole().println(p));
}
- private String getHeaderOutput() {
+ private static String getHeaderOutput() {
String header = String.format("%-17s %-25s %-25s", "DatapathId", "Reconciliation Status",
"Reconciliation Time");
return header;
}
- private String getLineSeparator() {
+ private static String getLineSeparator() {
return "-------------------------------------------------------------------";
}
LOG.debug("The ip address of nodes in the cluster : {}", clusterIPAddresses);
if (!clusterIPAddresses.isEmpty()) {
String selfAddress = clusterMemberInfoProvider.getSelfAddress() != null
- ? clusterMemberInfoProvider.getSelfAddress().getHostAddress() : ("localhost");
+ ? clusterMemberInfoProvider.getSelfAddress().getHostAddress() : "localhost";
LOG.trace("The ip address of local node is {}", selfAddress);
for (String memberAddress : clusterIPAddresses) {
try {
}
@SuppressWarnings("checkstyle:RegexpSinglelineJava")
- private void printInProgressNodes(ReconcileOutput reconcileOutput) {
+ private static void printInProgressNodes(ReconcileOutput reconcileOutput) {
List<Uint64> inprogressNodes = reconcileOutput.getInprogressNodes();
if (inprogressNodes.size() > 0) {
StringBuilder stringBuilder = new StringBuilder();
}
}
- private String getReconcileHeaderOutput() {
+ private static String getReconcileHeaderOutput() {
final Formatter formatter = new Formatter();
String header = formatter.format("%-15s %n", "Reconciliation already InProgress for below node(s)").toString();
formatter.close();
return null;
}
- private String getReconcileCountHeaderOutput() {
+ private static String getReconcileCountHeaderOutput() {
final Formatter formatter = new Formatter();
String header = formatter.format("%-15s %3s %-15s %3s %-15s %3s %-15s %n", "NodeId", "",
"ReconcileSuccessCount", "", "ReconcileFailureCount", "", "LastReconcileTime").toString();
}
@SuppressWarnings("checkstyle:RegexpSinglelineJava")
- private void printNodeHeaderOutput() {
+ private static void printNodeHeaderOutput() {
Formatter formatter = new Formatter();
String header = formatter.format(OUTPUT_FORMAT, "NodeId", "Name", "Ports").toString();
formatter.close();
}
@SuppressWarnings("checkstyle:RegexpSinglelineJava")
- private void printHeaderSeparator() {
+ private static void printHeaderSeparator() {
System.out.println(HEADER_SEPARATOR);
}
@SuppressWarnings("checkstyle:RegexpSinglelineJava")
- private void printNodeOutput(final OFNode ofNode) {
+ private static void printNodeOutput(final OFNode ofNode) {
String ofNodeId = ofNode.getNodeId().toString();
String ofNodeName = ofNode.getNodeName();
System.out.print(new Formatter().format(NEW_LINE, ofNodeId, ofNodeName, ofNode.getPorts()).toString());