bharat saraswal
Committed by Gerrit Code Review

Removed print method from implementation.

Change-Id: I0bf4238e03c8b6d4aa21c6641f0c0abca855dc11
Showing 78 changed files with 234 additions and 790 deletions
......@@ -95,11 +95,6 @@ public interface PcInitiatedLspRequest {
void setPcepAttribute(PcepAttribute pcepAttribute);
/**
* Prints the attribute of PC-INITIATED LSP INITIATION REQUEST.
*/
void print();
/**
* Builder interface with get and set functions to build PcInitiatedLspRequest.
*/
interface Builder {
......
......@@ -92,12 +92,6 @@ public interface PcepAttribute {
void setMetricObjectList(LinkedList<PcepMetricObject> llMetricList);
/**
* Prints the attributes of AttributeList.
*/
void print();
/**
* Builder interface with get and set functions to build PcepAttribute.
*/
interface Builder {
......
......@@ -39,11 +39,6 @@ public interface PcepBandwidthObject {
void setBandwidth(int iBandwidth);
/**
* Prints attributes of bandwidth object.
*/
void print();
/**
* Writes the BandwidthObject into channel buffer.
*
* @param bb channel buffer
......
......@@ -54,11 +54,6 @@ public interface PcepEndPointsObject {
void setDestIpAddress(int destIpAddress);
/**
* Prints attributes of EndPoints object.
*/
void print();
/**
* Writes the EndPointsObject into channel buffer.
*
* @param bb channel buffer
......
......@@ -52,11 +52,6 @@ public interface PcepEroObject {
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints attributes of ERO object.
*/
void print();
/**
* Builder interface with get and set functions to build ERO object.
*/
interface Builder {
......
......@@ -77,11 +77,6 @@ public interface PcepError {
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of PCEP Error.
*/
void print();
/**
* Builder interface with get and set functions to build PcepError.
*/
interface Builder {
......
......@@ -50,11 +50,6 @@ public interface PcepErrorInfo {
void write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of error info list.
*/
void print();
/**
* Returns Error Value in PCEP-ERROR Object.
*
* @return list of Error Value in PCEP-ERROR Object
......
/*
* Copyright 2015 Open Networking Laboratory
*
* 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 org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.ErrorObjListWithOpen;
/**
......@@ -43,7 +60,7 @@ public interface PcepErrorMsg extends PcepMessage {
void setPcepErrorInfo(PcepErrorInfo errInfo);
@Override
void writeTo(ChannelBuffer channelBuffer);
void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
/**
* Builder interface with get and set functions to build PCEP Error message.
......
/*
* Copyright 2015 Open Networking Laboratory
*
* 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 org.onosproject.pcepio.protocol;
import java.util.LinkedList;
......@@ -55,11 +70,6 @@ public interface PcepErrorObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of Error object.
*/
void print();
/**
* Writes the Error Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -33,7 +33,7 @@ public final class PcepFactories {
private PcepFactories() {
}
/*
/**
* Returns the instance of PCEP Version.
*
* @param version PCEP version
......@@ -84,7 +84,7 @@ public final class PcepFactories {
}
}
/*
/**
* Returns GENERIC_READER.
*
* @return GENERIC_READER
......
......@@ -238,4 +238,18 @@ public interface PcepFactory {
* @return Builder Object for PcepError
*/
PcepError.Builder buildPcepError();
/**
* To get Builder Object for PcepLabelRangeObject.
*
* @return Builder Object for PcepLabelRangeObject
*/
PcepLabelRangeObject.Builder buildPcepLabelRangeObject();
/**
* To get Builder Object for PcepLabelRangeResvMsg.
*
* @return Builder Object for PcepLabelRangeResvMsg
*/
PcepLabelRangeResvMsg.Builder buildPcepLabelRangeResvMsg();
}
......
......@@ -46,9 +46,4 @@ public interface PcepFecObject {
* @throws PcepParseException while writing FEC Object into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints attributes of FEC object.
*/
void print();
}
......
......@@ -40,9 +40,6 @@ public interface PcepFecObjectIPv4 extends PcepFecObject {
void setNodeID(int value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
......
......@@ -54,9 +54,6 @@ public interface PcepFecObjectIPv4Adjacency extends PcepFecObject {
void seRemoteIPv4Address(int value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
......
......@@ -82,9 +82,6 @@ public interface PcepFecObjectIPv4UnnumberedAdjacency extends PcepFecObject {
void setRemoteInterfaceID(int value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
......
......@@ -40,9 +40,6 @@ public interface PcepFecObjectIPv6 extends PcepFecObject {
void setNodeID(byte[] value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
......
......@@ -54,9 +54,6 @@ public interface PcepFecObjectIPv6Adjacency extends PcepFecObject {
void seRemoteIPv6Address(byte[] value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
......
......@@ -53,11 +53,6 @@ public interface PcepInterLayerObject {
void setbIFlag(boolean value);
/**
* Prints attributes of INTER Layer object.
*/
void print();
/**
* Writes the INTER Layer Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -41,11 +41,6 @@ public interface PcepIroObject {
void setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Prints attributes of IRO object.
*/
void print();
/**
* Writes the IRO into channel buffer.
*
* @param bb channel buffer
......
......@@ -71,11 +71,6 @@ public interface PcepLabelObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of Label object.
*/
void print();
/**
* Writes the Label Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -62,9 +62,4 @@ public interface PcepLabelRange {
* @throws PcepParseException while writing LABEL RANGE into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints Attributes of PcepLabelRange.
*/
void print();
}
......
......@@ -82,11 +82,6 @@ public interface PcepLabelRangeObject {
int getLabelBase();
/**
* Prints attributes of LabelRange object.
*/
void print();
/**
* Writes the LabelRange Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -62,11 +62,6 @@ public interface PcepLabelUpdate {
PcepLabelMap getLabelMap();
/**
* Prints the attributes of PCEP Label update.
*/
void print();
/**
* Builder interface with get and set functions to build Label Update message.
*/
interface Builder {
......
......@@ -127,11 +127,6 @@ public interface PcepLspObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of LSP object.
*/
void print();
/**
* Writes the LSP Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -126,11 +126,6 @@ public interface PcepLspaObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of LSPA object.
*/
void print();
/**
* Writes the LSPA Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -34,11 +34,6 @@ public interface PcepMessage extends PcepObject {
*/
PcepType getType();
/**
* Prints attributes of PCEP Messages.
*/
void print();
@Override
void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
......
......@@ -95,11 +95,6 @@ public interface PcepMetricObject {
void setBType(byte value);
/**
* Prints attributes of Metric object.
*/
void print();
/**
* Writes the Metric Object into channel buffer.
*
* @param bb channel buffer
......
/*
* Copyright 2015 Open Networking Laboratory
*
* 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 org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
......@@ -57,11 +72,6 @@ public interface PcepMsgPath {
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of PCEP message path.
*/
void print();
/**
* Builder interface with get and set functions to build PcepMsgPath.
*/
interface Builder {
......
......@@ -45,7 +45,7 @@ public interface PcepOpenMsg extends PcepObject, PcepMessage {
PcepOpenObject getPcepOpenObject();
@Override
void writeTo(ChannelBuffer channelBuffer);
void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
/**
* Builder interface with get and set functions to build Open message.
......
......@@ -106,11 +106,6 @@ public interface PcepOpenObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of Open object.
*/
void print();
/**
* Writes the Open into channel buffer.
*
* @param bb channel buffer
......
......@@ -112,11 +112,6 @@ public interface PcepRPObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of RP object.
*/
void print();
/**
* Writes the RP Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -42,11 +42,6 @@ public interface PcepRroObject {
void setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Prints attributes of RRO object.
*/
void print();
/**
* Writes the RRO Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -71,11 +71,6 @@ public interface PcepSrpObject {
LinkedList<PcepValueType> getOptionalTlv();
/**
* Prints attributes of SRP object.
*/
void print();
/**
* Writes the SRP Object into channel buffer.
*
* @param bb channel buffer
......@@ -172,6 +167,5 @@ public interface PcepSrpObject {
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
......
......@@ -102,12 +102,6 @@ public interface PcepStateReport {
* @throws PcepParseException when mandatory object is not set
*/
int write(ChannelBuffer bb) throws PcepParseException;
/***
* Prints the attribute of PCEP Message Path.
*/
void print();
}
/**
......@@ -153,11 +147,6 @@ public interface PcepStateReport {
void setMsgPath(PcepMsgPath msgPath);
/**
* Prints the attribute of PCEP state report.
*/
public void print();
/**
* Builder interface with get and set functions to build PcepStateReport.
*/
public interface Builder {
......
......@@ -112,11 +112,6 @@ public interface PcepTEObject {
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of TE object.
*/
void print();
/**
* Writes the TE Object into channel buffer.
*
* @param bb channel buffer
......
......@@ -18,7 +18,6 @@ package org.onosproject.pcepio.protocol;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP Update Request List.
*/
......@@ -67,11 +66,6 @@ public interface PcepUpdateRequest {
void setMsgPath(PcepMsgPath msgPath);
/**
* Prints the attributes of PCEP Update Request.
*/
void print();
/**
* Builder interface with get and set functions to build PcepUpdateRequest.
*/
interface Builder {
......
......@@ -276,47 +276,21 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
this.bIsPcepAttributeSet = true;
return this;
}
}
@Override
public void print() {
log.debug(" PC-INITIATED LSP INITIATION REQUEST");
srpObject.print();
lspObject.print();
//if PC initiate then print end point and ero object [pcepattribute].
if (endPointsObject instanceof PcepEndPointsObject) {
endPointsObject.print();
}
if (eroObject instanceof PcepEroObject) {
eroObject.print();
}
if (pcepAttribute instanceof PcepAttribute) {
pcepAttribute.print();
}
}
@Override
public String toString() {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
toStrHelper
.add("SRP Object", srpObject)
.add("LSP object", lspObject);
toStrHelper.add("SrpObject", srpObject).add("LspObject", lspObject);
if (endPointsObject instanceof PcepEndPointsObject) {
toStrHelper
.add("End Point Object", endPointsObject);
toStrHelper.add("EndPointObject", endPointsObject);
}
if (eroObject instanceof PcepEroObject) {
toStrHelper
.add("ERO Object", eroObject);
toStrHelper.add("EroObject", eroObject);
}
if (pcepAttribute instanceof PcepAttribute) {
toStrHelper
.add("Pcep Attribute", pcepAttribute);
toStrHelper.add("PcepAttribute", pcepAttribute);
}
return toStrHelper.toString();
}
......
......@@ -421,48 +421,20 @@ public class PcepAttributeVer1 implements PcepAttribute {
}
@Override
public void print() {
log.debug("ATTRIBUTE LIST");
if (lspaObject instanceof PcepLspaObject) {
lspaObject.print();
}
if (bandwidthObject instanceof PcepBandwidthObject) {
bandwidthObject.print();
}
if (llMetricList != null) {
log.debug("METRIC LIST");
ListIterator<PcepMetricObject> listIterator = llMetricList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
if (iroObject instanceof PcepIroObject) {
iroObject.print();
}
}
@Override
public String toString() {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
if (lspaObject instanceof PcepLspaObject) {
toStrHelper
.add("PCEP lspa Object", lspaObject);
toStrHelper.add("lspaObject", lspaObject);
}
if (bandwidthObject instanceof PcepBandwidthObject) {
toStrHelper
.add("bandwidth Object", bandwidthObject);
toStrHelper.add("bandwidthObject", bandwidthObject);
}
if (llMetricList instanceof PcepMetricObject) {
toStrHelper
.add("Pcep Metric object List", llMetricList);
toStrHelper.add("MetricObjectList", llMetricList);
}
if (iroObject instanceof PcepIroObject) {
toStrHelper
.add("iro Object", iroObject);
toStrHelper.add("IroObject", iroObject);
}
return toStrHelper.toString();
}
......
......@@ -225,18 +225,8 @@ public class PcepBandwidthObjectVer1 implements PcepBandwidthObject {
}
@Override
public void print() {
log.debug("BANDWIDTH OBJECT");
bandwidthObjHeader.print();
log.debug("Bandwidth: " + iBandwidth);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("bandwidth Object Header", bandwidthObjHeader)
.add("Bandwidth", iBandwidth)
.toString();
return MoreObjects.toStringHelper(getClass()).add("BandwidthObjectHeader", bandwidthObjHeader)
.add("Bandwidth", iBandwidth).toString();
}
}
......
......@@ -157,7 +157,7 @@ class PcepCloseMsgVer1 implements PcepCloseMsg {
private PcepObjectHeader closeObjHeader;
private boolean bIsReasonSet = false;
private byte yReason;
LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
private LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
private boolean bIsPFlagSet = false;
private boolean bPFlag;
......@@ -333,24 +333,8 @@ class PcepCloseMsgVer1 implements PcepCloseMsg {
}
@Override
public void print() {
log.debug("CLOSE MESSAGE");
closeObjHeader.print();
int x = yReason & 0xFF;
log.debug("Reason: " + x);
log.debug("OPTINAL TLV:");
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("close Object Header", closeObjHeader)
.add("Reason", yReason)
.add("Optional Tlv list", llOptionalTlv)
.toString();
return MoreObjects.toStringHelper(getClass()).add("closeObjectHeader", closeObjHeader).add("Reason", yReason)
.add("OptionalTlvlist", llOptionalTlv).toString();
}
}
......
......@@ -241,28 +241,12 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject {
this.bIsIFlagSet = true;
return this;
}
}
@Override
public void print() {
log.debug("ENDPOINT OBJECT");
long lTemp;
lTemp = sourceIpAddress & 0xFFFFFFFF;
String str = "Source IP Address: " + lTemp;
log.debug(str);
lTemp = destIpAddress & 0xFFFFFFFF;
str = "destination IP Address: " + lTemp;
log.debug(str);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("sourceIpAddress", sourceIpAddress)
.add("destIpAddress", destIpAddress)
.toString();
return MoreObjects.toStringHelper(getClass()).add("sourceIpAddress", sourceIpAddress)
.add("destIpAddress", destIpAddress).toString();
}
}
......
......@@ -393,26 +393,11 @@ public class PcepEroObjectVer1 implements PcepEroObject {
this.bIsIFlagSet = true;
return this;
}
}
@Override
public void print() {
log.debug("ERO OBJECT");
eroObjHeader.print();
log.debug("SUBOBJECTS:");
ListIterator<PcepValueType> listIterator = llSubObjects.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("ero obj Header", eroObjHeader)
.add("Sub-Objects", llSubObjects)
return MoreObjects.toStringHelper(getClass()).add("EroObjHeader", eroObjHeader).add("SubObjects", llSubObjects)
.toString();
}
}
......
......@@ -31,7 +31,6 @@ import org.onosproject.pcepio.protocol.PcepMessage;
import org.onosproject.pcepio.protocol.PcepMessageReader;
import org.onosproject.pcepio.protocol.PcepMetricObject;
import org.onosproject.pcepio.protocol.PcepMsgPath;
import org.onosproject.pcepio.protocol.PcepSrpObject;
import org.onosproject.pcepio.protocol.PcepUpdateMsg;
import org.onosproject.pcepio.protocol.PcepUpdateRequest;
......@@ -210,4 +209,16 @@ public class PcepFactoryVer1 implements PcepFactory {
return null;
}
@Override
public org.onosproject.pcepio.protocol.PcepLabelRangeObject.Builder buildPcepLabelRangeObject() {
// TODO Auto-generated method stub
return null;
}
@Override
public org.onosproject.pcepio.protocol.PcepLabelRangeResvMsg.Builder buildPcepLabelRangeResvMsg() {
// TODO Auto-generated method stub
return null;
}
}
......
......@@ -316,19 +316,8 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg {
}
@Override
public void print() {
log.debug("PCEP INITIATE MESSAGE");
ListIterator<PcInitiatedLspRequest> listIterator = llPcInitiatedLspRequestList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("PC initiaited lsp request list", llPcInitiatedLspRequestList)
return MoreObjects.toStringHelper(getClass()).add("PcInitiaitedLspRequestList", llPcInitiatedLspRequestList)
.toString();
}
}
......
......@@ -282,25 +282,11 @@ public class PcepIroObjectVer1 implements PcepIroObject {
this.bIsIFlagSet = true;
return this;
}
}
@Override
public void print() {
log.debug("IRO OBJECT");
iroObjHeader.print();
log.debug("SUBOBJECTS:");
ListIterator<PcepValueType> listIterator = llSubObjects.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("IRO object header", iroObjHeader)
.add("List of sub object", llSubObjects)
.toString();
return MoreObjects.toStringHelper(getClass()).add("IroObjectHeader", iroObjHeader)
.add("SubObjects", llSubObjects).toString();
}
}
......
......@@ -26,6 +26,8 @@ import org.onosproject.pcepio.protocol.PcepVersion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
class PcepKeepaliveMsgVer1 implements PcepKeepaliveMsg {
/*
......@@ -134,7 +136,7 @@ class PcepKeepaliveMsgVer1 implements PcepKeepaliveMsg {
}
@Override
public void print() {
log.debug("KEEPALIVE MESSAGE");
public String toString() {
return MoreObjects.toStringHelper(getClass()).toString();
}
}
......
......@@ -555,39 +555,9 @@ public class PcepLspObjectVer1 implements PcepLspObject {
}
@Override
public void print() {
log.debug("LSP OBJECT");
long lTemp = iPlspId & 0xFFFFFFFF;
log.debug("PLSP Id: " + lTemp);
lTemp = yOFlag & 0xFFFF;
log.debug("O Flag: " + lTemp);
lTemp = (bAFlag) ? 1 : 0;
log.debug("A Flag: " + lTemp);
lTemp = (bRFlag) ? 1 : 0;
log.debug("R Flag: " + lTemp);
lTemp = (bSFlag) ? 1 : 0;
log.debug("S Flag: " + lTemp);
lTemp = (bDFlag) ? 1 : 0;
log.debug("D Flag: " + lTemp);
log.debug("OPTIONAL TLV:");
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Plsp ID value", iPlspId)
.add("o flag", yOFlag)
.add("A flag", bAFlag)
.add("R flag", bRFlag)
.add("S flag", bSFlag)
.add("D flag", bDFlag)
.add("List of optional tlv", llOptionalTlv)
.toString();
return MoreObjects.toStringHelper(getClass()).add("PlspIDValue", iPlspId).add("OFlag", yOFlag)
.add("AFlag", bAFlag).add("RFlag", bRFlag).add("SFlag", bSFlag).add("DFlag", bDFlag)
.add("OptionalTlvList", llOptionalTlv).toString();
}
}
......
......@@ -514,39 +514,9 @@ public class PcepLspaObjectVer1 implements PcepLspaObject {
}
@Override
public void print() {
log.debug("LSPA OBJECT");
long lTemp = flags & 0xFF;
lTemp = (bLFlag) ? 1 : 0;
log.debug("l Flag: " + lTemp);
lTemp = cSetupPriority & 0xFF;
log.debug("SetupPriority: " + lTemp);
lTemp = cHoldPriority & 0xFF;
log.debug("HoldPriority: " + lTemp);
lTemp = iIncludeAll & 0xFFFFFFFF;
log.debug("IncludeAll: " + lTemp);
lTemp = iIncludeAny & 0xFFFFFFFF;
log.debug("IncludeAny: " + lTemp);
lTemp = iExcludeAny & 0xFFFFFFFF;
log.debug("iExcludeAny: " + lTemp);
log.debug("OPTIONAL TLV:");
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("L flag", bLFlag)
.add("Setup priority", cSetupPriority)
.add("hold priority", cHoldPriority)
.add("Include all", iIncludeAll)
.add("Include any", iIncludeAny)
.add("Exclude any", iExcludeAny)
.add("List of optional tlv", llOptionalTlv)
.toString();
return MoreObjects.toStringHelper(getClass()).add("LFlag", bLFlag).add("SetupPriority", cSetupPriority)
.add("HoldPriority", cHoldPriority).add("IncludeAll", iIncludeAll).add("IncludeAny", iIncludeAny)
.add("ExcludeAny", iExcludeAny).add("OptionalTlvList", llOptionalTlv).toString();
}
}
......
......@@ -362,26 +362,8 @@ public class PcepMetricObjectVer1 implements PcepMetricObject {
}
@Override
public void print() {
log.debug("METRIC OBJECT");
long lTemp = iMetricVal & 0xFFFFFFFF;
log.debug("iMetricVal: " + lTemp);
lTemp = (bBFlag) ? 1 : 0;
log.debug("B Flag: " + lTemp);
lTemp = (bCFlag) ? 1 : 0;
log.debug("C Flag: " + lTemp);
lTemp = bType & 0xFF;
log.debug("Type: " + lTemp);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Metric value", iMetricVal)
.add("B flag", bBFlag)
.add("C flag", bCFlag)
.add("B-type", bType)
.toString();
return MoreObjects.toStringHelper(getClass()).add("MetricValue", iMetricVal).add("BFlag", bBFlag)
.add("CFlag", bCFlag).add("BType", bType).toString();
}
}
......
......@@ -163,18 +163,8 @@ public class PcepMsgPathVer1 implements PcepMsgPath {
}
@Override
public void print() {
log.debug("PcepMsgPath");
eroObj.print();
attrList.print();
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("ERO object", eroObj)
.add("Attribute list", attrList)
return MoreObjects.toStringHelper(getClass()).add("EroObject", eroObj).add("AttributeList", attrList)
.toString();
}
}
\ No newline at end of file
......
......@@ -379,25 +379,8 @@ public class PcepSrpObjectVer1 implements PcepSrpObject {
}
@Override
public void print() {
log.debug("SRP OBJECT");
long lTemp = (bRFlag) ? 1 : 0;
log.debug("r Flag: " + lTemp);
log.debug("SrpID: " + srpId);
log.debug("OPTIONAL TLV");
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("R flag", bRFlag)
.add("SRP ID", srpId)
.add("Optional tlv list", llOptionalTlv)
.toString();
return MoreObjects.toStringHelper(getClass()).add("RFlag", bRFlag).add("SRPID", srpId)
.add("OptionalTlvList", llOptionalTlv).toString();
}
}
......
......@@ -290,19 +290,7 @@ class PcepUpdateMsgVer1 implements PcepUpdateMsg {
}
@Override
public void print() {
log.debug("PCEP UPDATE MESSAGE");
ListIterator<PcepUpdateRequest> listIterator = llUpdateRequestList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Update Request list", llUpdateRequestList)
.toString();
return MoreObjects.toStringHelper(getClass()).add("UpdateRequestList", llUpdateRequestList).toString();
}
}
......
......@@ -189,19 +189,8 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest {
}
@Override
public void print() {
log.debug("UPDATE REQUEST");
srpObject.print();
lspObject.print();
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("SRP Object", srpObject)
.add("LSP object", lspObject)
.add("message path object", msgPath)
.toString();
return MoreObjects.toStringHelper(getClass()).add("SrpObject", srpObject).add("LspObject", lspObject)
.add("MsgPath", msgPath).toString();
}
}
\ No newline at end of file
......
......@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
/**
* Provides Autonomous System Tlv which contains opaque value (32 Bit AS Number).
* Provides Autonomous-System-Tlv which contains opaque value (32 Bit AS Number).
*/
public class AutonomousSystemTlv implements PcepValueType {
......@@ -47,28 +47,28 @@ public class AutonomousSystemTlv implements PcepValueType {
private final int rawValue;
/**
* constructor to initialize Autonomous system tlv value.
* Constructor to initialize rawValue.
*
* @param rawValue value of Autonomous system tlv
* @param rawValue Autonomous-System-Tlv
*/
public AutonomousSystemTlv(int rawValue) {
this.rawValue = rawValue;
}
/**
* To create instance of AutonomousSystemTlv.
* Returns newly created AutonomousSystemTlv object.
*
* @param raw opaque value ofc 32 Bit AS Number
* @return object of AutonomousSystemTlv
* @param raw value of opaque.
* @return object of Autonomous-System-Tlv
*/
public static AutonomousSystemTlv of(final int raw) {
return new AutonomousSystemTlv(raw);
}
/**
* Returns opaque value of 32 Bit AS Number.
* Returns opaque value.
*
* @return int value of rawValue
* @return rawValue opaque value.
*/
public int getInt() {
return rawValue;
......@@ -118,22 +118,14 @@ public class AutonomousSystemTlv implements PcepValueType {
/**
* Reads the channel buffer and returns object of AutonomousSystemTlv.
*
* @param c type of channel buffer
* @return object of AutonomousSystemTlv
* @param c input channel buffer
* @return object of Autonomous-System-Tlv
*/
public static AutonomousSystemTlv read(ChannelBuffer c) {
return AutonomousSystemTlv.of(c.readInt());
}
@Override
public void print() {
log.debug("AutonomousSystemTlv");
log.debug("Type: " + TYPE);
log.debug("Length: " + LENGTH);
log.debug("Value: " + rawValue);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("TYPE", TYPE)
......
......@@ -13,7 +13,7 @@ import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
/*
/**
* Provide the error object list with open object.
*/
public class ErrorObjListWithOpen {
......@@ -22,14 +22,14 @@ public class ErrorObjListWithOpen {
// openObject is optional
private PcepOpenObject openObject;
// flag to check if open object is set or not
public boolean isOpenObjectSet;
private boolean isOpenObjectSet;
protected static final Logger log = LoggerFactory.getLogger(ErrorObjListWithOpen.class);
/*
* constructor to initialize errObj,openObj.
/**
* Constructor to initialize Error and OPEN object.
*
* @param errObj error object list
* @param openObj open object
* @param errObj ERROR object list
* @param openObj OPEN object
*/
public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) {
this.llerrorObjList = errObj;
......@@ -41,10 +41,10 @@ public class ErrorObjListWithOpen {
}
}
/*
* constructor to initialize errObj.
/**
* Constructor to initialize ERROR Object.
*
* @param errObj error object list
* @param errObj ERROR Object list
*/
public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) {
this.llerrorObjList = errObj;
......@@ -53,9 +53,9 @@ public class ErrorObjListWithOpen {
}
/**
* Returns error type.
* Return list of Error Types.
*
* @return error type
* @return error types list
*/
public LinkedList<Integer> getErrorType() {
LinkedList<Integer> errorType = new LinkedList<Integer>();
......@@ -73,9 +73,9 @@ public class ErrorObjListWithOpen {
}
/**
* Returns error value.
* Return list of Error Values.
*
* @return error value
* @return error values list
*/
public LinkedList<Integer> getErrorValue() {
LinkedList<Integer> errorValue = new LinkedList<Integer>();
......@@ -87,16 +87,15 @@ public class ErrorObjListWithOpen {
errorObj = errObjListIterator.next();
error = errorObj.getErrorValue();
errorValue.add(error);
}
}
return errorValue;
}
/**
* Checks whether error object list is empty or not.
* Checks whether ERROR Object list is empty or not.
*
* @return whether error object list is empty or not
* @return true if ERROR Object list is empty otherwise false
*/
public boolean isErrorObjListWithOpenPresent() {
// ( <error-obj-list> [<Open>]
......@@ -107,62 +106,44 @@ public class ErrorObjListWithOpen {
/**
* Write Error Object List and Open Object to channel buffer.
*
* @param bb of type channel buffer
* @param cb output channel buffer
* @return length of written Error object list with open
* @throws PcepParseException when mandatory fields are not set
*/
public int write(ChannelBuffer bb) throws PcepParseException {
int iLenStartIndex = bb.writerIndex();
public int write(ChannelBuffer cb) throws PcepParseException {
int iLenStartIndex = cb.writerIndex();
boolean bIsErrObjListFound = false;
//<error-obj-list> is mandatory , if not present throw exception.
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
while (errObjListIterator.hasNext()) {
errObjListIterator.next().write(bb);
errObjListIterator.next().write(cb);
bIsErrObjListFound = true;
}
}
if (!bIsErrObjListFound) {
throw new PcepParseException("Error: [ErrorObjListWithOpen::write] <error-obj-list> is mandatory.");
throw new PcepParseException("<error-obj-list> is mandatory.");
}
//Open Object is optional , if present write.
if (openObject != null) {
openObject.write(bb);
}
return bb.writerIndex() - iLenStartIndex;
}
/**
* Prints the attributes of ErrorObject List with open Object.
*/
public void print() {
log.debug("ErrorObjListWithOpen:");
ListIterator<PcepErrorObject> pcepErrorObjIterator = llerrorObjList.listIterator();
log.debug("<error-obj-list> :");
while (pcepErrorObjIterator.hasNext()) {
pcepErrorObjIterator.next().print();
openObject.write(cb);
}
log.debug("OpenObject:");
if (openObject != null) {
openObject.print();
}
return cb.writerIndex() - iLenStartIndex;
}
@Override
public String toString() {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
if (openObject == null) {
toStrHelper
.add("error Obj List", llerrorObjList);
} else {
toStrHelper
.add("error Obj List", llerrorObjList)
.add("open Object", openObject);
toStrHelper.add("ErrorObjList", llerrorObjList);
// OPEN Object is optional
if (openObject != null) {
toStrHelper.add("Open", openObject);
}
return toStrHelper.toString();
}
......
......@@ -169,21 +169,12 @@ public class IPv4SubObject implements PcepValueType {
}
@Override
public void print() {
log.debug("IPv4SubObject");
log.debug("Type: " + TYPE);
log.debug("Length: " + LENGTH);
log.debug("IPv4 address: " + String.format("%08X", ipAddress));
log.debug("Prefix Length: " + prefixLen);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
.add("Length", LENGTH)
.add("IPv4 Address", ipAddress)
.add("Prefix Length", prefixLen)
.add("IPv4Address", ipAddress)
.add("PrefixLength", prefixLen)
.toString();
}
}
......
......@@ -24,6 +24,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
import com.google.common.base.MoreObjects.ToStringHelper;
/**
* Provides IPv6 Sub Object.
......@@ -204,25 +205,18 @@ public class IPv6SubObject implements PcepValueType {
}
@Override
public void print() {
log.debug("IPv6SubObject");
log.debug("Type: ", TYPE);
log.debug("Length: ", LENGTH);
if (null != rawValue) {
public String toString() {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
toStrHelper.add("Type", TYPE);
toStrHelper.add("Length", LENGTH);
StringBuffer result = new StringBuffer();
for (byte b : rawValue) {
result.append(String.format("%02X ", b));
}
log.debug(result.toString());
}
}
toStrHelper.add("Value", result);
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
.add("Length", LENGTH)
.add("IPv6 Address", rawValue)
.toString();
return toStrHelper.toString();
}
}
......
......@@ -148,20 +148,12 @@ public class PathKeySubObject implements PcepValueType {
}
@Override
public void print() {
log.debug("PathKeySubObject");
log.debug("Type: " + TYPE);
log.debug("Length: " + LENGTH);
log.debug("Path Key: " + pathKey);
log.debug("PCEID: " + pceID);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE).add("Length", LENGTH)
.add("Path Key", pathKey)
.add("PCE ID", pceID)
.add("Type", TYPE)
.add("Length", LENGTH)
.add("PathKey", pathKey)
.add("PceID", pceID)
.toString();
}
}
......
package org.onosproject.pcepio.types;
import java.util.LinkedList;
import java.util.ListIterator;
import org.onosproject.pcepio.protocol.PcepLabelObject;
import org.onosproject.pcepio.protocol.PcepLspObject;
......@@ -36,7 +35,7 @@ public class PcepLabelDownload {
}
/**
* Sets the Pcep Srp Object.
* Sets the Pcep SRP Object.
*
* @param srpobj PCEP SRP Object
*/
......@@ -80,27 +79,9 @@ public class PcepLabelDownload {
this.llLabelList = llLabelList;
}
/**
* Prints the attribute of PcepLableObject.
*/
public void print() {
log.debug("LABEL DOWNLOAD:");
srpObject.print();
lspObject.print();
log.debug("label-list:");
ListIterator<PcepLabelObject> listIterator = llLabelList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("SRP object", srpObject)
.add("LSP object", lspObject)
.add("label object list", llLabelList)
.toString();
return MoreObjects.toStringHelper(getClass()).add("SrpObject", srpObject).add("LspObject", lspObject)
.add("LabelObjectList", llLabelList).toString();
}
}
......
......@@ -92,22 +92,12 @@ public class PcepLabelMap {
this.labelObject = labelObject;
}
/**
* Prints the attribute of PcepLabelMap.
*/
public void print() {
log.debug("LABEL MAP:");
srpObject.print();
labelObject.print();
fecObject.print();
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("SRP object", srpObject)
.add("Label object", labelObject)
.add("Fec object", fecObject)
.add("SrpObject", srpObject)
.add("LabelObject", labelObject)
.add("FecObject", fecObject)
.toString();
}
}
......
......@@ -86,8 +86,8 @@ public class PcepNaiIpv4Adjacency implements PcepNai {
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("local IPv4 Address", localIpv4Addr)
.add("remote IPv4 Address", remoteIpv4Addr)
.add("localIPv4Address", localIpv4Addr)
.add("remoteIPv4Address", remoteIpv4Addr)
.toString();
}
}
......
......@@ -89,8 +89,6 @@ public class PcepNaiIpv4NodeId implements PcepNai {
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("IPv4 Node Id", ipv4NodeId)
.toString();
return MoreObjects.toStringHelper(getClass()).add("IPv4NodeId", ipv4NodeId).toString();
}
}
......
......@@ -102,8 +102,8 @@ public class PcepNaiIpv6Adjacency implements PcepNai {
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("local IPV6 address", localIpv6Addr)
.add("remote IPV6 address", remoteIpv6Addr)
.add("localIPV6Address", localIpv6Addr)
.add("remoteIPV6Address", remoteIpv6Addr)
.toString();
}
......
......@@ -82,8 +82,6 @@ public class PcepNaiIpv6NodeId implements PcepNai {
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("IPV6 node ID", ipv6NodeId)
.toString();
return MoreObjects.toStringHelper(getClass()).add("IPV6NodeID", ipv6NodeId).toString();
}
}
......
......@@ -104,10 +104,10 @@ public class PcepNaiUnnumberedAdjacencyIpv4 implements PcepNai {
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("local Node Id", localNodeId)
.add("local Interface Id", localInterfaceId)
.add("remote Node Id", remoteNodeId)
.add("remote Interface Id:", remoteInterfaceId)
.add("localNodeId", localNodeId)
.add("localInterfaceId", localInterfaceId)
.add("remoteNodeId", remoteNodeId)
.add("remoteInterfaceId:", remoteInterfaceId)
.toString();
}
}
......
......@@ -68,6 +68,7 @@ public class PcepObjectHeader {
* @param bIFlag I flag
* @param objLen PCEP object length
*/
public PcepObjectHeader(byte objClass, byte objType, boolean bPFlag, boolean bIFlag, short objLen) {
this.objClass = objClass;
this.objType = objType;
......@@ -169,12 +170,12 @@ public class PcepObjectHeader {
/**
* Writes Byte stream of PCEP object header to channel buffer.
*
* @param bb of type channel buffer
* @param cb output channel buffer
* @return objLenIndex object length index in channel buffer
*/
public int write(ChannelBuffer bb) {
public int write(ChannelBuffer cb) {
bb.writeByte(this.objClass);
cb.writeByte(this.objClass);
byte temp = (byte) (this.objType << OBJECT_TYPE_SHIFT_VALUE);
if (this.bPFlag) {
temp = (byte) (temp | PFLAG_SET);
......@@ -182,55 +183,38 @@ public class PcepObjectHeader {
if (this.bIFlag) {
temp = (byte) (temp | IFLAG_SET);
}
bb.writeByte(temp);
int objLenIndex = bb.writerIndex();
bb.writeShort((short) 0);
cb.writeByte(temp);
int objLenIndex = cb.writerIndex();
cb.writeShort((short) 0);
return objLenIndex;
}
/**
* Read from channel buffer and Returns PCEP Objects header.
*
* @param bb of type channel buffer
* @param cb of type channel buffer
* @return PCEP Object header
*/
public static PcepObjectHeader read(ChannelBuffer bb) {
public static PcepObjectHeader read(ChannelBuffer cb) {
byte objClass;
byte objType;
boolean bPFlag;
boolean bIFlag;
short objLen;
objClass = bb.readByte();
byte temp = bb.readByte();
objClass = cb.readByte();
byte temp = cb.readByte();
bIFlag = ((temp & IFLAG_SET) == IFLAG_SET) ? true : false;
bPFlag = ((temp & PFLAG_SET) == PFLAG_SET) ? true : false;
objType = (byte) (temp >> OBJECT_TYPE_SHIFT_VALUE);
objLen = bb.readShort();
objLen = cb.readShort();
return new PcepObjectHeader(objClass, objType, bPFlag, bIFlag, objLen);
}
/**
* Prints the Attributes of PCEP Object header.
*/
public void print() {
log.debug("PcepObjectHeader");
log.debug("Object Class: " + objClass);
log.debug("Object Type: " + objType);
log.debug("Object Length: " + objLen);
log.debug("P flag: " + bPFlag);
log.debug("I flag: " + bIFlag);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Object class:", objClass)
.add("Object type:", objType)
.add("Object length:", objLen)
.add("P flag:", bPFlag)
.add("I flag:", bIFlag)
return MoreObjects.toStringHelper(getClass()).add("ObjectClass", objClass).add("ObjectType", objType)
.add("ObjectLength", objLen).add("PFlag", (bPFlag) ? 1 : 0).add("IFlag", (bIFlag) ? 1 : 0)
.toString();
}
}
......
......@@ -40,8 +40,4 @@ public interface PcepRsvpErrorSpec extends PcepValueType {
* @return class type
*/
byte getClassType();
@Override
String toString();
}
......
......@@ -146,17 +146,12 @@ public class PcepRsvpIpv4ErrorSpec implements PcepRsvpErrorSpec {
}
@Override
public void print() {
// TODO Auto-generated method stub
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("IPv4 Address:", ipv4Addr)
.add("IPv4Address:", ipv4Addr)
.add("flags:", flags)
.add("error Code:", errCode)
.add("error Value:", errValue)
.add("errorCode:", errCode)
.add("errorValue:", errValue)
.toString();
}
}
......
......@@ -136,17 +136,12 @@ public class PcepRsvpIpv6ErrorSpec implements PcepRsvpErrorSpec {
}
@Override
public void print() {
// TODO Auto-generated method stub
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("IPv6 Address:", ipv6Addr)
.add("IPv6Address:", ipv6Addr)
.add("flags:", flags)
.add("error Code:", errCode)
.add("error Value:", errValue)
.add("errorCode:", errCode)
.add("errorValue:", errValue)
.toString();
}
}
......
......@@ -52,7 +52,7 @@ public class PcepRsvpObjectHeader {
private short objLen;
/**
* Constructor to initialize class num , length and type.
* Constructor to initialize class num, length and type.
*
* @param objClassNum object class number
* @param objClassType object class type
......@@ -65,7 +65,7 @@ public class PcepRsvpObjectHeader {
}
/**
* Sets the Class num.
* Sets the Class-Num.
*
* @param value object class number
*/
......@@ -121,52 +121,38 @@ public class PcepRsvpObjectHeader {
/**
* Writes the byte stream of PcepRsvpObjectHeader to channel buffer.
*
* @param bb of type channel buffer
* @param cb of type channel buffer
* @return object length index in channel buffer
*/
public int write(ChannelBuffer bb) {
int iLenStartIndex = bb.writerIndex();
bb.writeShort((short) 0);
bb.writeByte(this.objClassNum);
bb.writeByte(this.objClassType);
return bb.writerIndex() - iLenStartIndex;
public int write(ChannelBuffer cb) {
int iLenStartIndex = cb.writerIndex();
cb.writeShort((short) 0);
cb.writeByte(this.objClassNum);
cb.writeByte(this.objClassType);
return cb.writerIndex() - iLenStartIndex;
}
/**
* Reads the PcepRsvpObjectHeader.
*
* @param bb of type channel buffer
* @param cb input channel buffer
* @return PcepRsvpObjectHeader
*/
public static PcepRsvpObjectHeader read(ChannelBuffer bb) {
log.debug("PcepRsvpObjectHeader ::read ");
public static PcepRsvpObjectHeader read(ChannelBuffer cb) {
log.debug("read ");
byte objClassNum;
byte objClassType;
short objLen;
objLen = bb.readShort();
objClassNum = bb.readByte();
objClassType = bb.readByte();
objLen = cb.readShort();
objClassNum = cb.readByte();
objClassType = cb.readByte();
return new PcepRsvpObjectHeader(objClassNum, objClassType, objLen);
}
/**
* Prints the attribute of PcepRsvpObjectHeader.
*/
public void print() {
log.debug("PcepObjectHeader");
log.debug("Object Class-Num: " + objClassNum);
log.debug("Object C-Type: " + objClassType);
log.debug("Object Length: " + objLen);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Object Class-Num: " , objClassNum)
.add("Object C-Type: " , objClassType)
.add("Object Length: " , objLen)
.toString();
return MoreObjects.toStringHelper(getClass()).add("ObjectClassNum", objClassNum)
.add("ObjectCType", objClassType).add("ObjectLength", objLen).toString();
}
}
......
......@@ -144,22 +144,12 @@ public class PcepRsvpSpecObjHeader {
return new PcepRsvpSpecObjHeader(objLen, objClassNum, objClassType);
}
/**
* Prints the attribute of PcepRsvpObjectHeader.
*/
public void print() {
log.debug("PcepObjectHeader");
log.debug("Object Class-Num: " + objClassNum);
log.debug("Object C-Type: " + objClassType);
log.debug("Object Length: " + objLen);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Object Class-Num: " , objClassNum)
.add("Object C-Type: " , objClassType)
.add("Object Length: " , objLen)
.add("ObjectClassNum: " , objClassNum)
.add("ObjectCType: " , objClassType)
.add("ObjectLength: " , objLen)
.toString();
}
}
......
......@@ -204,19 +204,14 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
}
@Override
public void print() {
// TODO Auto-generated method stub
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("enterprise Number:", enterpriseNum)
.add("sub Organization:", subOrg)
.add("err Desc Length:", errDescLen)
.add("user Error Value:", userErrorValue)
.add("err Desc:", errDesc)
.add("Rsvp User Spec Sub Object:", llRsvpUserSpecSubObj)
.add("enterpriseNumber:", enterpriseNum)
.add("subOrganization:", subOrg)
.add("errDescLength:", errDescLen)
.add("userErrorValue:", userErrorValue)
.add("errDesc:", errDesc)
.add("RsvpUserSpecSubObject:", llRsvpUserSpecSubObj)
.toString();
}
}
......
......@@ -52,9 +52,4 @@ public interface PcepValueType {
* @return length of bytes written to channel buffer
*/
public int write(ChannelBuffer bb);
/**
* Prints the Attributes of PCEP Message.
*/
public void print();
}
......
......@@ -308,17 +308,6 @@ public class SrEroSubObject implements PcepValueType {
}
@Override
public void print() {
log.debug("SrEroSubObject");
log.debug("Type: " + TYPE);
log.debug("Length: " + LENGTH);
log.debug("st:" + st + " bFFlag:" + bFFlag + " bSFlag:" + bSFlag + " bCFlag:" + bCFlag + " bMFlag:" + bMFlag
+ " sID:" + sID + " nAI:" + nai);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type", TYPE)
......@@ -332,5 +321,4 @@ public class SrEroSubObject implements PcepValueType {
.add("nAI", nai)
.toString();
}
}
......
......@@ -198,28 +198,13 @@ public class StatefulIPv4LspIdentidiersTlv implements PcepValueType {
}
@Override
public void print() {
log.debug("StatefulIPv4LspIdentidiersTlv");
log.debug("Type: " + TYPE);
log.debug("Length: " + LENGTH);
log.debug("Ipv4IngressAddress: " + ipv4IngressAddress);
log.debug("LspId: " + lspId);
log.debug("TunnelId: " + tunnelId);
log.debug("ExtendedTunnelId: " + extendedTunnelId);
log.debug("Ipv4EgressAddress: " + ipv4EgressAddress);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("Type:", TYPE)
.add("Length:", LENGTH)
.add("Ipv4IngressAddress:", ipv4IngressAddress)
.add("LspId:", lspId)
.add("TunnelId:", tunnelId)
.add("LspId:", lspId).add("TunnelId:", tunnelId)
.add("ExtendedTunnelId:", extendedTunnelId)
.add("Ipv4EgressAddress:", ipv4EgressAddress)
.toString();
.add("Ipv4EgressAddress:", ipv4EgressAddress).toString();
}
}
......
......@@ -131,15 +131,6 @@ public class StatefulLspErrorCodeTlv implements PcepValueType {
}
@Override
public void print() {
log.debug("StatefulLspErrorCodeTlv");
log.debug("Type: " + TYPE);
log.debug("Length: " + LENGTH);
log.debug("Value: " + rawValue);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass()).add("Type", TYPE).add("Length", LENGTH).add("Value", rawValue)
.toString();
......
......@@ -206,29 +206,13 @@ public class StatefulRsvpErrorSpecTlv implements PcepValueType {
}
@Override
public void print() {
log.debug("StatefulRsvpErrorSpecTlv");
log.debug("Type: " + TYPE);
log.debug("Length: " + hLength);
if (isErrSpceObjSet) {
rsvpErrSpecObj.print();
}
}
@Override
public String toString() {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
if (!isErrSpceObjSet) {
toStrHelper
.add("Type", TYPE)
.add("Length", hLength);
toStrHelper.add("Type", TYPE).add("Length", hLength);
} else {
toStrHelper
.add("Type", TYPE)
.add("Length", hLength)
.add("RSVP Error Spec Object", rsvpErrSpecObj);
toStrHelper.add("Type", TYPE).add("Length", hLength).add("RSVPErrorSpecObject", rsvpErrSpecObj);
}
return toStrHelper.toString();
}
......
......@@ -151,15 +151,7 @@ public class SymbolicPathNameTlv implements PcepValueType {
}
@Override
public void print() {
log.debug("SymbolicPathNameTlv");
log.debug("Type: " + TYPE);
log.debug("Length: " + hLength);
log.debug("Symbolic Path Name : " + rawValue);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass()).add("Symbolic Path Name ", rawValue).toString();
return MoreObjects.toStringHelper(getClass()).add("SymbolicPathName ", rawValue).toString();
}
}
......