Fix checkstyle whitespace issues - WHITESPACE ONLY
Change-Id: Ic205c1afd639c6008d61d9de95cb764eeb6238ca
diff --git a/src/main/java/net/onrc/onos/core/packet/BSNPROBE.java b/src/main/java/net/onrc/onos/core/packet/BSNPROBE.java
index 24dbe90..e411b7e 100644
--- a/src/main/java/net/onrc/onos/core/packet/BSNPROBE.java
+++ b/src/main/java/net/onrc/onos/core/packet/BSNPROBE.java
@@ -1,21 +1,21 @@
/**
-* Copyright 2012, Big Switch Networks, Inc.
-*
-* Licensed under the Apache License, Version 2.0 (the "License"); you may
-* not use this file except in compliance with the License. You may obtain
-* a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-* License for the specific language governing permissions and limitations
-* under the License.
-**/
+ * Copyright 2012, Big Switch Networks, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License. You may obtain
+ * a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ **/
/**
- *
+ *
*/
package net.onrc.onos.core.packet;
@@ -26,15 +26,14 @@
/**
* @author Shudong Zhou (shudong.zhou@bigswitch.com)
- *
*/
-public class BSNPROBE extends BasePacket {
- protected long controllerId;
- protected int sequenceId;
- protected byte[] srcMac;
- protected byte[] dstMac;
- protected long srcSwDpid;
- protected int srcPortNo;
+public class BSNPROBE extends BasePacket {
+ protected long controllerId;
+ protected int sequenceId;
+ protected byte[] srcMac;
+ protected byte[] dstMac;
+ protected long srcSwDpid;
+ protected int srcPortNo;
public BSNPROBE() {
srcMac = new byte[6];
@@ -42,24 +41,24 @@
}
- public long getControllerId() {
- return this.controllerId;
- }
+ public long getControllerId() {
+ return this.controllerId;
+ }
- public BSNPROBE setControllerId(long controllerId) {
- this.controllerId = controllerId;
- return this;
- }
+ public BSNPROBE setControllerId(long controllerId) {
+ this.controllerId = controllerId;
+ return this;
+ }
- public int getSequenceId() {
- return sequenceId;
- }
+ public int getSequenceId() {
+ return sequenceId;
+ }
- public BSNPROBE setSequenceId(int sequenceId) {
- this.sequenceId = sequenceId;
- return this;
- }
-
+ public BSNPROBE setSequenceId(int sequenceId) {
+ this.sequenceId = sequenceId;
+ return this;
+ }
+
public byte[] getSrcMac() {
return this.srcMac;
}
@@ -68,46 +67,46 @@
this.srcMac = srcMac;
return this;
}
-
- public byte[] getDstMac() {
- return dstMac;
- }
- public BSNPROBE setDstMac(byte[] dstMac) {
- this.dstMac = dstMac;
- return this;
- }
+ public byte[] getDstMac() {
+ return dstMac;
+ }
- public long getSrcSwDpid() {
- return srcSwDpid;
- }
+ public BSNPROBE setDstMac(byte[] dstMac) {
+ this.dstMac = dstMac;
+ return this;
+ }
- public BSNPROBE setSrcSwDpid(long srcSwDpid) {
- this.srcSwDpid = srcSwDpid;
- return this;
- }
+ public long getSrcSwDpid() {
+ return srcSwDpid;
+ }
- public int getSrcPortNo() {
- return srcPortNo;
- }
+ public BSNPROBE setSrcSwDpid(long srcSwDpid) {
+ this.srcSwDpid = srcSwDpid;
+ return this;
+ }
- public BSNPROBE setSrcPortNo(int srcPortNo) {
- this.srcPortNo = srcPortNo;
- return this;
- }
+ public int getSrcPortNo() {
+ return srcPortNo;
+ }
+
+ public BSNPROBE setSrcPortNo(int srcPortNo) {
+ this.srcPortNo = srcPortNo;
+ return this;
+ }
@Override
public byte[] serialize() {
- short length = 8 /* controllerId */ + 4 /* seqId */
- + 12 /* srcMac dstMac */ + 8 /* srcSwDpid */ + 4 /* srcPortNo */;
-
- byte[] payloadData = null;
- if (this.payload != null) {
+ short length = 8 /* controllerId */ + 4 /* seqId */
+ + 12 /* srcMac dstMac */ + 8 /* srcSwDpid */ + 4 /* srcPortNo */;
+
+ byte[] payloadData = null;
+ if (this.payload != null) {
payload.setParent(this);
payloadData = payload.serialize();
length += payloadData.length;
}
-
+
byte[] data = new byte[length];
ByteBuffer bb = ByteBuffer.wrap(data);
bb.putLong(this.controllerId);
@@ -117,10 +116,10 @@
bb.putLong(this.srcSwDpid);
bb.putInt(this.srcPortNo);
if (payloadData != null)
- bb.put(payloadData);
+ bb.put(payloadData);
if (this.parent != null && this.parent instanceof BSN)
- ((BSN)this.parent).setType(BSN.BSN_TYPE_PROBE);
+ ((BSN) this.parent).setType(BSN.BSN_TYPE_PROBE);
return data;
}
@@ -128,20 +127,20 @@
@Override
public IPacket deserialize(byte[] data, int offset, int length) {
ByteBuffer bb = ByteBuffer.wrap(data, offset, length);
-
+
controllerId = bb.getLong();
sequenceId = bb.getInt();
bb.get(this.srcMac, 0, 6);
bb.get(this.dstMac, 0, 6);
this.srcSwDpid = bb.getLong();
this.srcPortNo = bb.getInt();
-
+
if (bb.hasRemaining()) {
- this.payload = new Data();
- this.payload = payload.deserialize(data, bb.position(), bb.limit() - bb.position());
- this.payload.setParent(this);
+ this.payload = new Data();
+ this.payload = payload.deserialize(data, bb.position(), bb.limit() - bb.position());
+ this.payload.setParent(this);
}
-
+
return this;
}
@@ -174,25 +173,25 @@
if (!Arrays.equals(srcMac, other.srcMac))
return false;
if (!Arrays.equals(dstMac, other.dstMac))
- return false;
+ return false;
return (sequenceId == other.sequenceId &&
- srcSwDpid == other.srcSwDpid &&
- srcPortNo == other.srcPortNo
- );
+ srcSwDpid == other.srcSwDpid &&
+ srcPortNo == other.srcPortNo
+ );
}
-
+
public String toString() {
- StringBuffer sb = new StringBuffer("\n");
- sb.append("BSN Probe packet");
- sb.append("\nSource Mac: ");
- sb.append(HexString.toHexString(srcMac));
- sb.append("\nDestination Mac: ");
- sb.append(HexString.toHexString(dstMac));
- sb.append("\nSource Switch: ");
- sb.append(HexString.toHexString(srcSwDpid));
- sb.append(" port: " + srcPortNo);
- sb.append("\nSequence No.:" + sequenceId);
-
- return sb.toString();
+ StringBuffer sb = new StringBuffer("\n");
+ sb.append("BSN Probe packet");
+ sb.append("\nSource Mac: ");
+ sb.append(HexString.toHexString(srcMac));
+ sb.append("\nDestination Mac: ");
+ sb.append(HexString.toHexString(dstMac));
+ sb.append("\nSource Switch: ");
+ sb.append(HexString.toHexString(srcSwDpid));
+ sb.append(" port: " + srcPortNo);
+ sb.append("\nSequence No.:" + sequenceId);
+
+ return sb.toString();
}
}