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 { ...@@ -95,11 +95,6 @@ public interface PcInitiatedLspRequest {
95 void setPcepAttribute(PcepAttribute pcepAttribute); 95 void setPcepAttribute(PcepAttribute pcepAttribute);
96 96
97 /** 97 /**
98 - * Prints the attribute of PC-INITIATED LSP INITIATION REQUEST.
99 - */
100 - void print();
101 -
102 - /**
103 * Builder interface with get and set functions to build PcInitiatedLspRequest. 98 * Builder interface with get and set functions to build PcInitiatedLspRequest.
104 */ 99 */
105 interface Builder { 100 interface Builder {
......
...@@ -92,12 +92,6 @@ public interface PcepAttribute { ...@@ -92,12 +92,6 @@ public interface PcepAttribute {
92 void setMetricObjectList(LinkedList<PcepMetricObject> llMetricList); 92 void setMetricObjectList(LinkedList<PcepMetricObject> llMetricList);
93 93
94 /** 94 /**
95 - * Prints the attributes of AttributeList.
96 - */
97 -
98 - void print();
99 -
100 - /**
101 * Builder interface with get and set functions to build PcepAttribute. 95 * Builder interface with get and set functions to build PcepAttribute.
102 */ 96 */
103 interface Builder { 97 interface Builder {
......
...@@ -39,11 +39,6 @@ public interface PcepBandwidthObject { ...@@ -39,11 +39,6 @@ public interface PcepBandwidthObject {
39 void setBandwidth(int iBandwidth); 39 void setBandwidth(int iBandwidth);
40 40
41 /** 41 /**
42 - * Prints attributes of bandwidth object.
43 - */
44 - void print();
45 -
46 - /**
47 * Writes the BandwidthObject into channel buffer. 42 * Writes the BandwidthObject into channel buffer.
48 * 43 *
49 * @param bb channel buffer 44 * @param bb channel buffer
......
...@@ -54,11 +54,6 @@ public interface PcepEndPointsObject { ...@@ -54,11 +54,6 @@ public interface PcepEndPointsObject {
54 void setDestIpAddress(int destIpAddress); 54 void setDestIpAddress(int destIpAddress);
55 55
56 /** 56 /**
57 - * Prints attributes of EndPoints object.
58 - */
59 - void print();
60 -
61 - /**
62 * Writes the EndPointsObject into channel buffer. 57 * Writes the EndPointsObject into channel buffer.
63 * 58 *
64 * @param bb channel buffer 59 * @param bb channel buffer
......
...@@ -52,11 +52,6 @@ public interface PcepEroObject { ...@@ -52,11 +52,6 @@ public interface PcepEroObject {
52 int write(ChannelBuffer bb) throws PcepParseException; 52 int write(ChannelBuffer bb) throws PcepParseException;
53 53
54 /** 54 /**
55 - * Prints attributes of ERO object.
56 - */
57 - void print();
58 -
59 - /**
60 * Builder interface with get and set functions to build ERO object. 55 * Builder interface with get and set functions to build ERO object.
61 */ 56 */
62 interface Builder { 57 interface Builder {
......
...@@ -77,11 +77,6 @@ public interface PcepError { ...@@ -77,11 +77,6 @@ public interface PcepError {
77 int write(ChannelBuffer bb) throws PcepParseException; 77 int write(ChannelBuffer bb) throws PcepParseException;
78 78
79 /** 79 /**
80 - * Prints the attributes of PCEP Error.
81 - */
82 - void print();
83 -
84 - /**
85 * Builder interface with get and set functions to build PcepError. 80 * Builder interface with get and set functions to build PcepError.
86 */ 81 */
87 interface Builder { 82 interface Builder {
......
...@@ -50,11 +50,6 @@ public interface PcepErrorInfo { ...@@ -50,11 +50,6 @@ public interface PcepErrorInfo {
50 void write(ChannelBuffer bb) throws PcepParseException; 50 void write(ChannelBuffer bb) throws PcepParseException;
51 51
52 /** 52 /**
53 - * Prints the attributes of error info list.
54 - */
55 - void print();
56 -
57 - /**
58 * Returns Error Value in PCEP-ERROR Object. 53 * Returns Error Value in PCEP-ERROR Object.
59 * 54 *
60 * @return list of Error Value in PCEP-ERROR Object 55 * @return list of Error Value in PCEP-ERROR Object
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
16 +
1 package org.onosproject.pcepio.protocol; 17 package org.onosproject.pcepio.protocol;
2 18
3 import org.jboss.netty.buffer.ChannelBuffer; 19 import org.jboss.netty.buffer.ChannelBuffer;
20 +import org.onosproject.pcepio.exceptions.PcepParseException;
4 import org.onosproject.pcepio.types.ErrorObjListWithOpen; 21 import org.onosproject.pcepio.types.ErrorObjListWithOpen;
5 22
6 /** 23 /**
...@@ -43,7 +60,7 @@ public interface PcepErrorMsg extends PcepMessage { ...@@ -43,7 +60,7 @@ public interface PcepErrorMsg extends PcepMessage {
43 void setPcepErrorInfo(PcepErrorInfo errInfo); 60 void setPcepErrorInfo(PcepErrorInfo errInfo);
44 61
45 @Override 62 @Override
46 - void writeTo(ChannelBuffer channelBuffer); 63 + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
47 64
48 /** 65 /**
49 * Builder interface with get and set functions to build PCEP Error message. 66 * Builder interface with get and set functions to build PCEP Error message.
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
1 package org.onosproject.pcepio.protocol; 16 package org.onosproject.pcepio.protocol;
2 17
3 import java.util.LinkedList; 18 import java.util.LinkedList;
...@@ -55,11 +70,6 @@ public interface PcepErrorObject { ...@@ -55,11 +70,6 @@ public interface PcepErrorObject {
55 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 70 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
56 71
57 /** 72 /**
58 - * Prints attributes of Error object.
59 - */
60 - void print();
61 -
62 - /**
63 * Writes the Error Object into channel buffer. 73 * Writes the Error Object into channel buffer.
64 * 74 *
65 * @param bb channel buffer 75 * @param bb channel buffer
......
...@@ -33,7 +33,7 @@ public final class PcepFactories { ...@@ -33,7 +33,7 @@ public final class PcepFactories {
33 private PcepFactories() { 33 private PcepFactories() {
34 } 34 }
35 35
36 - /* 36 + /**
37 * Returns the instance of PCEP Version. 37 * Returns the instance of PCEP Version.
38 * 38 *
39 * @param version PCEP version 39 * @param version PCEP version
...@@ -84,7 +84,7 @@ public final class PcepFactories { ...@@ -84,7 +84,7 @@ public final class PcepFactories {
84 } 84 }
85 } 85 }
86 86
87 - /* 87 + /**
88 * Returns GENERIC_READER. 88 * Returns GENERIC_READER.
89 * 89 *
90 * @return GENERIC_READER 90 * @return GENERIC_READER
......
...@@ -238,4 +238,18 @@ public interface PcepFactory { ...@@ -238,4 +238,18 @@ public interface PcepFactory {
238 * @return Builder Object for PcepError 238 * @return Builder Object for PcepError
239 */ 239 */
240 PcepError.Builder buildPcepError(); 240 PcepError.Builder buildPcepError();
241 +
242 + /**
243 + * To get Builder Object for PcepLabelRangeObject.
244 + *
245 + * @return Builder Object for PcepLabelRangeObject
246 + */
247 + PcepLabelRangeObject.Builder buildPcepLabelRangeObject();
248 +
249 + /**
250 + * To get Builder Object for PcepLabelRangeResvMsg.
251 + *
252 + * @return Builder Object for PcepLabelRangeResvMsg
253 + */
254 + PcepLabelRangeResvMsg.Builder buildPcepLabelRangeResvMsg();
241 } 255 }
......
...@@ -46,9 +46,4 @@ public interface PcepFecObject { ...@@ -46,9 +46,4 @@ public interface PcepFecObject {
46 * @throws PcepParseException while writing FEC Object into Channel Buffer. 46 * @throws PcepParseException while writing FEC Object into Channel Buffer.
47 */ 47 */
48 int write(ChannelBuffer bb) throws PcepParseException; 48 int write(ChannelBuffer bb) throws PcepParseException;
49 -
50 - /**
51 - * Prints attributes of FEC object.
52 - */
53 - void print();
54 } 49 }
......
...@@ -40,9 +40,6 @@ public interface PcepFecObjectIPv4 extends PcepFecObject { ...@@ -40,9 +40,6 @@ public interface PcepFecObjectIPv4 extends PcepFecObject {
40 void setNodeID(int value); 40 void setNodeID(int value);
41 41
42 @Override 42 @Override
43 - void print();
44 -
45 - @Override
46 int write(ChannelBuffer bb) throws PcepParseException; 43 int write(ChannelBuffer bb) throws PcepParseException;
47 44
48 /** 45 /**
......
...@@ -54,9 +54,6 @@ public interface PcepFecObjectIPv4Adjacency extends PcepFecObject { ...@@ -54,9 +54,6 @@ public interface PcepFecObjectIPv4Adjacency extends PcepFecObject {
54 void seRemoteIPv4Address(int value); 54 void seRemoteIPv4Address(int value);
55 55
56 @Override 56 @Override
57 - void print();
58 -
59 - @Override
60 int write(ChannelBuffer bb) throws PcepParseException; 57 int write(ChannelBuffer bb) throws PcepParseException;
61 58
62 /** 59 /**
......
...@@ -82,9 +82,6 @@ public interface PcepFecObjectIPv4UnnumberedAdjacency extends PcepFecObject { ...@@ -82,9 +82,6 @@ public interface PcepFecObjectIPv4UnnumberedAdjacency extends PcepFecObject {
82 void setRemoteInterfaceID(int value); 82 void setRemoteInterfaceID(int value);
83 83
84 @Override 84 @Override
85 - void print();
86 -
87 - @Override
88 int write(ChannelBuffer bb) throws PcepParseException; 85 int write(ChannelBuffer bb) throws PcepParseException;
89 86
90 /** 87 /**
......
...@@ -40,9 +40,6 @@ public interface PcepFecObjectIPv6 extends PcepFecObject { ...@@ -40,9 +40,6 @@ public interface PcepFecObjectIPv6 extends PcepFecObject {
40 void setNodeID(byte[] value); 40 void setNodeID(byte[] value);
41 41
42 @Override 42 @Override
43 - void print();
44 -
45 - @Override
46 int write(ChannelBuffer bb) throws PcepParseException; 43 int write(ChannelBuffer bb) throws PcepParseException;
47 44
48 /** 45 /**
......
...@@ -54,9 +54,6 @@ public interface PcepFecObjectIPv6Adjacency extends PcepFecObject { ...@@ -54,9 +54,6 @@ public interface PcepFecObjectIPv6Adjacency extends PcepFecObject {
54 void seRemoteIPv6Address(byte[] value); 54 void seRemoteIPv6Address(byte[] value);
55 55
56 @Override 56 @Override
57 - void print();
58 -
59 - @Override
60 int write(ChannelBuffer bb) throws PcepParseException; 57 int write(ChannelBuffer bb) throws PcepParseException;
61 58
62 /** 59 /**
......
...@@ -53,11 +53,6 @@ public interface PcepInterLayerObject { ...@@ -53,11 +53,6 @@ public interface PcepInterLayerObject {
53 void setbIFlag(boolean value); 53 void setbIFlag(boolean value);
54 54
55 /** 55 /**
56 - * Prints attributes of INTER Layer object.
57 - */
58 - void print();
59 -
60 - /**
61 * Writes the INTER Layer Object into channel buffer. 56 * Writes the INTER Layer Object into channel buffer.
62 * 57 *
63 * @param bb channel buffer 58 * @param bb channel buffer
......
...@@ -41,11 +41,6 @@ public interface PcepIroObject { ...@@ -41,11 +41,6 @@ public interface PcepIroObject {
41 void setSubObjects(LinkedList<PcepValueType> llSubObjects); 41 void setSubObjects(LinkedList<PcepValueType> llSubObjects);
42 42
43 /** 43 /**
44 - * Prints attributes of IRO object.
45 - */
46 - void print();
47 -
48 - /**
49 * Writes the IRO into channel buffer. 44 * Writes the IRO into channel buffer.
50 * 45 *
51 * @param bb channel buffer 46 * @param bb channel buffer
......
...@@ -71,11 +71,6 @@ public interface PcepLabelObject { ...@@ -71,11 +71,6 @@ public interface PcepLabelObject {
71 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 71 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
72 72
73 /** 73 /**
74 - * Prints attributes of Label object.
75 - */
76 - void print();
77 -
78 - /**
79 * Writes the Label Object into channel buffer. 74 * Writes the Label Object into channel buffer.
80 * 75 *
81 * @param bb channel buffer 76 * @param bb channel buffer
......
...@@ -62,9 +62,4 @@ public interface PcepLabelRange { ...@@ -62,9 +62,4 @@ public interface PcepLabelRange {
62 * @throws PcepParseException while writing LABEL RANGE into Channel Buffer. 62 * @throws PcepParseException while writing LABEL RANGE into Channel Buffer.
63 */ 63 */
64 int write(ChannelBuffer bb) throws PcepParseException; 64 int write(ChannelBuffer bb) throws PcepParseException;
65 -
66 - /**
67 - * Prints Attributes of PcepLabelRange.
68 - */
69 - void print();
70 } 65 }
......
...@@ -82,11 +82,6 @@ public interface PcepLabelRangeObject { ...@@ -82,11 +82,6 @@ public interface PcepLabelRangeObject {
82 int getLabelBase(); 82 int getLabelBase();
83 83
84 /** 84 /**
85 - * Prints attributes of LabelRange object.
86 - */
87 - void print();
88 -
89 - /**
90 * Writes the LabelRange Object into channel buffer. 85 * Writes the LabelRange Object into channel buffer.
91 * 86 *
92 * @param bb channel buffer 87 * @param bb channel buffer
......
...@@ -62,11 +62,6 @@ public interface PcepLabelUpdate { ...@@ -62,11 +62,6 @@ public interface PcepLabelUpdate {
62 PcepLabelMap getLabelMap(); 62 PcepLabelMap getLabelMap();
63 63
64 /** 64 /**
65 - * Prints the attributes of PCEP Label update.
66 - */
67 - void print();
68 -
69 - /**
70 * Builder interface with get and set functions to build Label Update message. 65 * Builder interface with get and set functions to build Label Update message.
71 */ 66 */
72 interface Builder { 67 interface Builder {
......
...@@ -127,11 +127,6 @@ public interface PcepLspObject { ...@@ -127,11 +127,6 @@ public interface PcepLspObject {
127 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 127 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
128 128
129 /** 129 /**
130 - * Prints attributes of LSP object.
131 - */
132 - void print();
133 -
134 - /**
135 * Writes the LSP Object into channel buffer. 130 * Writes the LSP Object into channel buffer.
136 * 131 *
137 * @param bb channel buffer 132 * @param bb channel buffer
......
...@@ -126,11 +126,6 @@ public interface PcepLspaObject { ...@@ -126,11 +126,6 @@ public interface PcepLspaObject {
126 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 126 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
127 127
128 /** 128 /**
129 - * Prints attributes of LSPA object.
130 - */
131 - void print();
132 -
133 - /**
134 * Writes the LSPA Object into channel buffer. 129 * Writes the LSPA Object into channel buffer.
135 * 130 *
136 * @param bb channel buffer 131 * @param bb channel buffer
......
...@@ -34,11 +34,6 @@ public interface PcepMessage extends PcepObject { ...@@ -34,11 +34,6 @@ public interface PcepMessage extends PcepObject {
34 */ 34 */
35 PcepType getType(); 35 PcepType getType();
36 36
37 - /**
38 - * Prints attributes of PCEP Messages.
39 - */
40 - void print();
41 -
42 @Override 37 @Override
43 void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; 38 void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
44 39
......
...@@ -95,11 +95,6 @@ public interface PcepMetricObject { ...@@ -95,11 +95,6 @@ public interface PcepMetricObject {
95 void setBType(byte value); 95 void setBType(byte value);
96 96
97 /** 97 /**
98 - * Prints attributes of Metric object.
99 - */
100 - void print();
101 -
102 - /**
103 * Writes the Metric Object into channel buffer. 98 * Writes the Metric Object into channel buffer.
104 * 99 *
105 * @param bb channel buffer 100 * @param bb channel buffer
......
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
3 + *
4 + * Licensed under the Apache License, Version 2.0 (the "License");
5 + * you may not use this file except in compliance with the License.
6 + * You may obtain a copy of the License at
7 + *
8 + * http://www.apache.org/licenses/LICENSE-2.0
9 + *
10 + * Unless required by applicable law or agreed to in writing, software
11 + * distributed under the License is distributed on an "AS IS" BASIS,
12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 + * See the License for the specific language governing permissions and
14 + * limitations under the License.
15 + */
1 package org.onosproject.pcepio.protocol; 16 package org.onosproject.pcepio.protocol;
2 17
3 import org.jboss.netty.buffer.ChannelBuffer; 18 import org.jboss.netty.buffer.ChannelBuffer;
...@@ -57,11 +72,6 @@ public interface PcepMsgPath { ...@@ -57,11 +72,6 @@ public interface PcepMsgPath {
57 public int write(ChannelBuffer bb) throws PcepParseException; 72 public int write(ChannelBuffer bb) throws PcepParseException;
58 73
59 /** 74 /**
60 - * Prints the attributes of PCEP message path.
61 - */
62 - void print();
63 -
64 - /**
65 * Builder interface with get and set functions to build PcepMsgPath. 75 * Builder interface with get and set functions to build PcepMsgPath.
66 */ 76 */
67 interface Builder { 77 interface Builder {
......
...@@ -45,7 +45,7 @@ public interface PcepOpenMsg extends PcepObject, PcepMessage { ...@@ -45,7 +45,7 @@ public interface PcepOpenMsg extends PcepObject, PcepMessage {
45 PcepOpenObject getPcepOpenObject(); 45 PcepOpenObject getPcepOpenObject();
46 46
47 @Override 47 @Override
48 - void writeTo(ChannelBuffer channelBuffer); 48 + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
49 49
50 /** 50 /**
51 * Builder interface with get and set functions to build Open message. 51 * Builder interface with get and set functions to build Open message.
......
...@@ -106,11 +106,6 @@ public interface PcepOpenObject { ...@@ -106,11 +106,6 @@ public interface PcepOpenObject {
106 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 106 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
107 107
108 /** 108 /**
109 - * Prints attributes of Open object.
110 - */
111 - void print();
112 -
113 - /**
114 * Writes the Open into channel buffer. 109 * Writes the Open into channel buffer.
115 * 110 *
116 * @param bb channel buffer 111 * @param bb channel buffer
......
...@@ -112,11 +112,6 @@ public interface PcepRPObject { ...@@ -112,11 +112,6 @@ public interface PcepRPObject {
112 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 112 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
113 113
114 /** 114 /**
115 - * Prints attributes of RP object.
116 - */
117 - void print();
118 -
119 - /**
120 * Writes the RP Object into channel buffer. 115 * Writes the RP Object into channel buffer.
121 * 116 *
122 * @param bb channel buffer 117 * @param bb channel buffer
......
...@@ -42,11 +42,6 @@ public interface PcepRroObject { ...@@ -42,11 +42,6 @@ public interface PcepRroObject {
42 void setSubObjects(LinkedList<PcepValueType> llSubObjects); 42 void setSubObjects(LinkedList<PcepValueType> llSubObjects);
43 43
44 /** 44 /**
45 - * Prints attributes of RRO object.
46 - */
47 - void print();
48 -
49 - /**
50 * Writes the RRO Object into channel buffer. 45 * Writes the RRO Object into channel buffer.
51 * 46 *
52 * @param bb channel buffer 47 * @param bb channel buffer
......
...@@ -71,11 +71,6 @@ public interface PcepSrpObject { ...@@ -71,11 +71,6 @@ public interface PcepSrpObject {
71 LinkedList<PcepValueType> getOptionalTlv(); 71 LinkedList<PcepValueType> getOptionalTlv();
72 72
73 /** 73 /**
74 - * Prints attributes of SRP object.
75 - */
76 - void print();
77 -
78 - /**
79 * Writes the SRP Object into channel buffer. 74 * Writes the SRP Object into channel buffer.
80 * 75 *
81 * @param bb channel buffer 76 * @param bb channel buffer
...@@ -172,6 +167,5 @@ public interface PcepSrpObject { ...@@ -172,6 +167,5 @@ public interface PcepSrpObject {
172 * @return Builder by setting I flag 167 * @return Builder by setting I flag
173 */ 168 */
174 Builder setIFlag(boolean value); 169 Builder setIFlag(boolean value);
175 -
176 } 170 }
177 } 171 }
......
...@@ -102,12 +102,6 @@ public interface PcepStateReport { ...@@ -102,12 +102,6 @@ public interface PcepStateReport {
102 * @throws PcepParseException when mandatory object is not set 102 * @throws PcepParseException when mandatory object is not set
103 */ 103 */
104 int write(ChannelBuffer bb) throws PcepParseException; 104 int write(ChannelBuffer bb) throws PcepParseException;
105 -
106 - /***
107 - * Prints the attribute of PCEP Message Path.
108 - */
109 - void print();
110 -
111 } 105 }
112 106
113 /** 107 /**
...@@ -153,11 +147,6 @@ public interface PcepStateReport { ...@@ -153,11 +147,6 @@ public interface PcepStateReport {
153 void setMsgPath(PcepMsgPath msgPath); 147 void setMsgPath(PcepMsgPath msgPath);
154 148
155 /** 149 /**
156 - * Prints the attribute of PCEP state report.
157 - */
158 - public void print();
159 -
160 - /**
161 * Builder interface with get and set functions to build PcepStateReport. 150 * Builder interface with get and set functions to build PcepStateReport.
162 */ 151 */
163 public interface Builder { 152 public interface Builder {
......
...@@ -112,11 +112,6 @@ public interface PcepTEObject { ...@@ -112,11 +112,6 @@ public interface PcepTEObject {
112 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); 112 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
113 113
114 /** 114 /**
115 - * Prints attributes of TE object.
116 - */
117 - void print();
118 -
119 - /**
120 * Writes the TE Object into channel buffer. 115 * Writes the TE Object into channel buffer.
121 * 116 *
122 * @param bb channel buffer 117 * @param bb channel buffer
......
...@@ -18,7 +18,6 @@ package org.onosproject.pcepio.protocol; ...@@ -18,7 +18,6 @@ package org.onosproject.pcepio.protocol;
18 18
19 import org.onosproject.pcepio.exceptions.PcepParseException; 19 import org.onosproject.pcepio.exceptions.PcepParseException;
20 20
21 -
22 /** 21 /**
23 * Abstraction of an entity providing PCEP Update Request List. 22 * Abstraction of an entity providing PCEP Update Request List.
24 */ 23 */
...@@ -67,11 +66,6 @@ public interface PcepUpdateRequest { ...@@ -67,11 +66,6 @@ public interface PcepUpdateRequest {
67 void setMsgPath(PcepMsgPath msgPath); 66 void setMsgPath(PcepMsgPath msgPath);
68 67
69 /** 68 /**
70 - * Prints the attributes of PCEP Update Request.
71 - */
72 - void print();
73 -
74 - /**
75 * Builder interface with get and set functions to build PcepUpdateRequest. 69 * Builder interface with get and set functions to build PcepUpdateRequest.
76 */ 70 */
77 interface Builder { 71 interface Builder {
......
...@@ -276,47 +276,21 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest { ...@@ -276,47 +276,21 @@ public class PcInitiatedLspRequestVer1 implements PcInitiatedLspRequest {
276 this.bIsPcepAttributeSet = true; 276 this.bIsPcepAttributeSet = true;
277 return this; 277 return this;
278 } 278 }
279 -
280 - }
281 -
282 - @Override
283 - public void print() {
284 -
285 - log.debug(" PC-INITIATED LSP INITIATION REQUEST");
286 - srpObject.print();
287 - lspObject.print();
288 - //if PC initiate then print end point and ero object [pcepattribute].
289 - if (endPointsObject instanceof PcepEndPointsObject) {
290 - endPointsObject.print();
291 - }
292 -
293 - if (eroObject instanceof PcepEroObject) {
294 - eroObject.print();
295 - }
296 -
297 - if (pcepAttribute instanceof PcepAttribute) {
298 - pcepAttribute.print();
299 - }
300 } 279 }
301 280
302 @Override 281 @Override
303 public String toString() { 282 public String toString() {
304 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); 283 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
305 - toStrHelper 284 + toStrHelper.add("SrpObject", srpObject).add("LspObject", lspObject);
306 - .add("SRP Object", srpObject)
307 - .add("LSP object", lspObject);
308 285
309 if (endPointsObject instanceof PcepEndPointsObject) { 286 if (endPointsObject instanceof PcepEndPointsObject) {
310 - toStrHelper 287 + toStrHelper.add("EndPointObject", endPointsObject);
311 - .add("End Point Object", endPointsObject);
312 } 288 }
313 if (eroObject instanceof PcepEroObject) { 289 if (eroObject instanceof PcepEroObject) {
314 - toStrHelper 290 + toStrHelper.add("EroObject", eroObject);
315 - .add("ERO Object", eroObject);
316 } 291 }
317 if (pcepAttribute instanceof PcepAttribute) { 292 if (pcepAttribute instanceof PcepAttribute) {
318 - toStrHelper 293 + toStrHelper.add("PcepAttribute", pcepAttribute);
319 - .add("Pcep Attribute", pcepAttribute);
320 } 294 }
321 return toStrHelper.toString(); 295 return toStrHelper.toString();
322 } 296 }
......
...@@ -421,48 +421,20 @@ public class PcepAttributeVer1 implements PcepAttribute { ...@@ -421,48 +421,20 @@ public class PcepAttributeVer1 implements PcepAttribute {
421 } 421 }
422 422
423 @Override 423 @Override
424 - public void print() {
425 -
426 - log.debug("ATTRIBUTE LIST");
427 - if (lspaObject instanceof PcepLspaObject) {
428 - lspaObject.print();
429 - }
430 -
431 - if (bandwidthObject instanceof PcepBandwidthObject) {
432 - bandwidthObject.print();
433 - }
434 -
435 - if (llMetricList != null) {
436 - log.debug("METRIC LIST");
437 - ListIterator<PcepMetricObject> listIterator = llMetricList.listIterator();
438 - while (listIterator.hasNext()) {
439 - listIterator.next().print();
440 - }
441 - }
442 - if (iroObject instanceof PcepIroObject) {
443 - iroObject.print();
444 - }
445 - }
446 -
447 - @Override
448 public String toString() { 424 public String toString() {
449 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); 425 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
450 426
451 if (lspaObject instanceof PcepLspaObject) { 427 if (lspaObject instanceof PcepLspaObject) {
452 - toStrHelper 428 + toStrHelper.add("lspaObject", lspaObject);
453 - .add("PCEP lspa Object", lspaObject);
454 } 429 }
455 if (bandwidthObject instanceof PcepBandwidthObject) { 430 if (bandwidthObject instanceof PcepBandwidthObject) {
456 - toStrHelper 431 + toStrHelper.add("bandwidthObject", bandwidthObject);
457 - .add("bandwidth Object", bandwidthObject);
458 } 432 }
459 if (llMetricList instanceof PcepMetricObject) { 433 if (llMetricList instanceof PcepMetricObject) {
460 - toStrHelper 434 + toStrHelper.add("MetricObjectList", llMetricList);
461 - .add("Pcep Metric object List", llMetricList);
462 } 435 }
463 if (iroObject instanceof PcepIroObject) { 436 if (iroObject instanceof PcepIroObject) {
464 - toStrHelper 437 + toStrHelper.add("IroObject", iroObject);
465 - .add("iro Object", iroObject);
466 } 438 }
467 return toStrHelper.toString(); 439 return toStrHelper.toString();
468 } 440 }
......
...@@ -225,18 +225,8 @@ public class PcepBandwidthObjectVer1 implements PcepBandwidthObject { ...@@ -225,18 +225,8 @@ public class PcepBandwidthObjectVer1 implements PcepBandwidthObject {
225 } 225 }
226 226
227 @Override 227 @Override
228 - public void print() {
229 -
230 - log.debug("BANDWIDTH OBJECT");
231 - bandwidthObjHeader.print();
232 - log.debug("Bandwidth: " + iBandwidth);
233 - }
234 -
235 - @Override
236 public String toString() { 228 public String toString() {
237 - return MoreObjects.toStringHelper(getClass()) 229 + return MoreObjects.toStringHelper(getClass()).add("BandwidthObjectHeader", bandwidthObjHeader)
238 - .add("bandwidth Object Header", bandwidthObjHeader) 230 + .add("Bandwidth", iBandwidth).toString();
239 - .add("Bandwidth", iBandwidth)
240 - .toString();
241 } 231 }
242 } 232 }
......
...@@ -157,7 +157,7 @@ class PcepCloseMsgVer1 implements PcepCloseMsg { ...@@ -157,7 +157,7 @@ class PcepCloseMsgVer1 implements PcepCloseMsg {
157 private PcepObjectHeader closeObjHeader; 157 private PcepObjectHeader closeObjHeader;
158 private boolean bIsReasonSet = false; 158 private boolean bIsReasonSet = false;
159 private byte yReason; 159 private byte yReason;
160 - LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>(); 160 + private LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
161 161
162 private boolean bIsPFlagSet = false; 162 private boolean bIsPFlagSet = false;
163 private boolean bPFlag; 163 private boolean bPFlag;
...@@ -333,24 +333,8 @@ class PcepCloseMsgVer1 implements PcepCloseMsg { ...@@ -333,24 +333,8 @@ class PcepCloseMsgVer1 implements PcepCloseMsg {
333 } 333 }
334 334
335 @Override 335 @Override
336 - public void print() {
337 - log.debug("CLOSE MESSAGE");
338 - closeObjHeader.print();
339 - int x = yReason & 0xFF;
340 - log.debug("Reason: " + x);
341 - log.debug("OPTINAL TLV:");
342 - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
343 - while (listIterator.hasNext()) {
344 - listIterator.next().print();
345 - }
346 - }
347 -
348 - @Override
349 public String toString() { 336 public String toString() {
350 - return MoreObjects.toStringHelper(getClass()) 337 + return MoreObjects.toStringHelper(getClass()).add("closeObjectHeader", closeObjHeader).add("Reason", yReason)
351 - .add("close Object Header", closeObjHeader) 338 + .add("OptionalTlvlist", llOptionalTlv).toString();
352 - .add("Reason", yReason)
353 - .add("Optional Tlv list", llOptionalTlv)
354 - .toString();
355 } 339 }
356 } 340 }
......
...@@ -241,28 +241,12 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject { ...@@ -241,28 +241,12 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject {
241 this.bIsIFlagSet = true; 241 this.bIsIFlagSet = true;
242 return this; 242 return this;
243 } 243 }
244 -
245 - }
246 -
247 - @Override
248 - public void print() {
249 -
250 - log.debug("ENDPOINT OBJECT");
251 - long lTemp;
252 - lTemp = sourceIpAddress & 0xFFFFFFFF;
253 - String str = "Source IP Address: " + lTemp;
254 - log.debug(str);
255 - lTemp = destIpAddress & 0xFFFFFFFF;
256 - str = "destination IP Address: " + lTemp;
257 - log.debug(str);
258 } 244 }
259 245
260 @Override 246 @Override
261 public String toString() { 247 public String toString() {
262 - return MoreObjects.toStringHelper(getClass()) 248 + return MoreObjects.toStringHelper(getClass()).add("sourceIpAddress", sourceIpAddress)
263 - .add("sourceIpAddress", sourceIpAddress) 249 + .add("destIpAddress", destIpAddress).toString();
264 - .add("destIpAddress", destIpAddress)
265 - .toString();
266 } 250 }
267 251
268 } 252 }
......
...@@ -393,26 +393,11 @@ public class PcepEroObjectVer1 implements PcepEroObject { ...@@ -393,26 +393,11 @@ public class PcepEroObjectVer1 implements PcepEroObject {
393 this.bIsIFlagSet = true; 393 this.bIsIFlagSet = true;
394 return this; 394 return this;
395 } 395 }
396 -
397 - }
398 -
399 - @Override
400 - public void print() {
401 -
402 - log.debug("ERO OBJECT");
403 - eroObjHeader.print();
404 - log.debug("SUBOBJECTS:");
405 - ListIterator<PcepValueType> listIterator = llSubObjects.listIterator();
406 - while (listIterator.hasNext()) {
407 - listIterator.next().print();
408 - }
409 } 396 }
410 397
411 @Override 398 @Override
412 public String toString() { 399 public String toString() {
413 - return MoreObjects.toStringHelper(getClass()) 400 + return MoreObjects.toStringHelper(getClass()).add("EroObjHeader", eroObjHeader).add("SubObjects", llSubObjects)
414 - .add("ero obj Header", eroObjHeader)
415 - .add("Sub-Objects", llSubObjects)
416 .toString(); 401 .toString();
417 } 402 }
418 } 403 }
......
...@@ -31,7 +31,6 @@ import org.onosproject.pcepio.protocol.PcepMessage; ...@@ -31,7 +31,6 @@ import org.onosproject.pcepio.protocol.PcepMessage;
31 import org.onosproject.pcepio.protocol.PcepMessageReader; 31 import org.onosproject.pcepio.protocol.PcepMessageReader;
32 import org.onosproject.pcepio.protocol.PcepMetricObject; 32 import org.onosproject.pcepio.protocol.PcepMetricObject;
33 import org.onosproject.pcepio.protocol.PcepMsgPath; 33 import org.onosproject.pcepio.protocol.PcepMsgPath;
34 -
35 import org.onosproject.pcepio.protocol.PcepSrpObject; 34 import org.onosproject.pcepio.protocol.PcepSrpObject;
36 import org.onosproject.pcepio.protocol.PcepUpdateMsg; 35 import org.onosproject.pcepio.protocol.PcepUpdateMsg;
37 import org.onosproject.pcepio.protocol.PcepUpdateRequest; 36 import org.onosproject.pcepio.protocol.PcepUpdateRequest;
...@@ -210,4 +209,16 @@ public class PcepFactoryVer1 implements PcepFactory { ...@@ -210,4 +209,16 @@ public class PcepFactoryVer1 implements PcepFactory {
210 return null; 209 return null;
211 } 210 }
212 211
212 + @Override
213 + public org.onosproject.pcepio.protocol.PcepLabelRangeObject.Builder buildPcepLabelRangeObject() {
214 + // TODO Auto-generated method stub
215 + return null;
216 + }
217 +
218 + @Override
219 + public org.onosproject.pcepio.protocol.PcepLabelRangeResvMsg.Builder buildPcepLabelRangeResvMsg() {
220 + // TODO Auto-generated method stub
221 + return null;
222 + }
223 +
213 } 224 }
......
...@@ -316,19 +316,8 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg { ...@@ -316,19 +316,8 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg {
316 } 316 }
317 317
318 @Override 318 @Override
319 - public void print() {
320 -
321 - log.debug("PCEP INITIATE MESSAGE");
322 - ListIterator<PcInitiatedLspRequest> listIterator = llPcInitiatedLspRequestList.listIterator();
323 - while (listIterator.hasNext()) {
324 - listIterator.next().print();
325 - }
326 - }
327 -
328 - @Override
329 public String toString() { 319 public String toString() {
330 - return MoreObjects.toStringHelper(getClass()) 320 + return MoreObjects.toStringHelper(getClass()).add("PcInitiaitedLspRequestList", llPcInitiatedLspRequestList)
331 - .add("PC initiaited lsp request list", llPcInitiatedLspRequestList)
332 .toString(); 321 .toString();
333 } 322 }
334 } 323 }
......
...@@ -282,25 +282,11 @@ public class PcepIroObjectVer1 implements PcepIroObject { ...@@ -282,25 +282,11 @@ public class PcepIroObjectVer1 implements PcepIroObject {
282 this.bIsIFlagSet = true; 282 this.bIsIFlagSet = true;
283 return this; 283 return this;
284 } 284 }
285 -
286 - }
287 -
288 - @Override
289 - public void print() {
290 - log.debug("IRO OBJECT");
291 - iroObjHeader.print();
292 - log.debug("SUBOBJECTS:");
293 - ListIterator<PcepValueType> listIterator = llSubObjects.listIterator();
294 - while (listIterator.hasNext()) {
295 - listIterator.next().print();
296 - }
297 } 285 }
298 286
299 @Override 287 @Override
300 public String toString() { 288 public String toString() {
301 - return MoreObjects.toStringHelper(getClass()) 289 + return MoreObjects.toStringHelper(getClass()).add("IroObjectHeader", iroObjHeader)
302 - .add("IRO object header", iroObjHeader) 290 + .add("SubObjects", llSubObjects).toString();
303 - .add("List of sub object", llSubObjects)
304 - .toString();
305 } 291 }
306 } 292 }
......
...@@ -26,6 +26,8 @@ import org.onosproject.pcepio.protocol.PcepVersion; ...@@ -26,6 +26,8 @@ import org.onosproject.pcepio.protocol.PcepVersion;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory; 27 import org.slf4j.LoggerFactory;
28 28
29 +import com.google.common.base.MoreObjects;
30 +
29 class PcepKeepaliveMsgVer1 implements PcepKeepaliveMsg { 31 class PcepKeepaliveMsgVer1 implements PcepKeepaliveMsg {
30 32
31 /* 33 /*
...@@ -134,7 +136,7 @@ class PcepKeepaliveMsgVer1 implements PcepKeepaliveMsg { ...@@ -134,7 +136,7 @@ class PcepKeepaliveMsgVer1 implements PcepKeepaliveMsg {
134 } 136 }
135 137
136 @Override 138 @Override
137 - public void print() { 139 + public String toString() {
138 - log.debug("KEEPALIVE MESSAGE"); 140 + return MoreObjects.toStringHelper(getClass()).toString();
139 } 141 }
140 } 142 }
......
...@@ -555,39 +555,9 @@ public class PcepLspObjectVer1 implements PcepLspObject { ...@@ -555,39 +555,9 @@ public class PcepLspObjectVer1 implements PcepLspObject {
555 } 555 }
556 556
557 @Override 557 @Override
558 - public void print() {
559 -
560 - log.debug("LSP OBJECT");
561 - long lTemp = iPlspId & 0xFFFFFFFF;
562 - log.debug("PLSP Id: " + lTemp);
563 - lTemp = yOFlag & 0xFFFF;
564 - log.debug("O Flag: " + lTemp);
565 - lTemp = (bAFlag) ? 1 : 0;
566 - log.debug("A Flag: " + lTemp);
567 - lTemp = (bRFlag) ? 1 : 0;
568 - log.debug("R Flag: " + lTemp);
569 - lTemp = (bSFlag) ? 1 : 0;
570 - log.debug("S Flag: " + lTemp);
571 - lTemp = (bDFlag) ? 1 : 0;
572 - log.debug("D Flag: " + lTemp);
573 -
574 - log.debug("OPTIONAL TLV:");
575 - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
576 - while (listIterator.hasNext()) {
577 - listIterator.next().print();
578 - }
579 - }
580 -
581 - @Override
582 public String toString() { 558 public String toString() {
583 - return MoreObjects.toStringHelper(getClass()) 559 + return MoreObjects.toStringHelper(getClass()).add("PlspIDValue", iPlspId).add("OFlag", yOFlag)
584 - .add("Plsp ID value", iPlspId) 560 + .add("AFlag", bAFlag).add("RFlag", bRFlag).add("SFlag", bSFlag).add("DFlag", bDFlag)
585 - .add("o flag", yOFlag) 561 + .add("OptionalTlvList", llOptionalTlv).toString();
586 - .add("A flag", bAFlag)
587 - .add("R flag", bRFlag)
588 - .add("S flag", bSFlag)
589 - .add("D flag", bDFlag)
590 - .add("List of optional tlv", llOptionalTlv)
591 - .toString();
592 } 562 }
593 } 563 }
......
...@@ -514,39 +514,9 @@ public class PcepLspaObjectVer1 implements PcepLspaObject { ...@@ -514,39 +514,9 @@ public class PcepLspaObjectVer1 implements PcepLspaObject {
514 } 514 }
515 515
516 @Override 516 @Override
517 - public void print() {
518 - log.debug("LSPA OBJECT");
519 - long lTemp = flags & 0xFF;
520 - lTemp = (bLFlag) ? 1 : 0;
521 - log.debug("l Flag: " + lTemp);
522 - lTemp = cSetupPriority & 0xFF;
523 - log.debug("SetupPriority: " + lTemp);
524 - lTemp = cHoldPriority & 0xFF;
525 - log.debug("HoldPriority: " + lTemp);
526 - lTemp = iIncludeAll & 0xFFFFFFFF;
527 - log.debug("IncludeAll: " + lTemp);
528 - lTemp = iIncludeAny & 0xFFFFFFFF;
529 - log.debug("IncludeAny: " + lTemp);
530 - lTemp = iExcludeAny & 0xFFFFFFFF;
531 - log.debug("iExcludeAny: " + lTemp);
532 -
533 - log.debug("OPTIONAL TLV:");
534 - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
535 - while (listIterator.hasNext()) {
536 - listIterator.next().print();
537 - }
538 - }
539 -
540 - @Override
541 public String toString() { 517 public String toString() {
542 - return MoreObjects.toStringHelper(getClass()) 518 + return MoreObjects.toStringHelper(getClass()).add("LFlag", bLFlag).add("SetupPriority", cSetupPriority)
543 - .add("L flag", bLFlag) 519 + .add("HoldPriority", cHoldPriority).add("IncludeAll", iIncludeAll).add("IncludeAny", iIncludeAny)
544 - .add("Setup priority", cSetupPriority) 520 + .add("ExcludeAny", iExcludeAny).add("OptionalTlvList", llOptionalTlv).toString();
545 - .add("hold priority", cHoldPriority)
546 - .add("Include all", iIncludeAll)
547 - .add("Include any", iIncludeAny)
548 - .add("Exclude any", iExcludeAny)
549 - .add("List of optional tlv", llOptionalTlv)
550 - .toString();
551 } 521 }
552 } 522 }
......
...@@ -362,26 +362,8 @@ public class PcepMetricObjectVer1 implements PcepMetricObject { ...@@ -362,26 +362,8 @@ public class PcepMetricObjectVer1 implements PcepMetricObject {
362 } 362 }
363 363
364 @Override 364 @Override
365 - public void print() {
366 -
367 - log.debug("METRIC OBJECT");
368 - long lTemp = iMetricVal & 0xFFFFFFFF;
369 - log.debug("iMetricVal: " + lTemp);
370 - lTemp = (bBFlag) ? 1 : 0;
371 - log.debug("B Flag: " + lTemp);
372 - lTemp = (bCFlag) ? 1 : 0;
373 - log.debug("C Flag: " + lTemp);
374 - lTemp = bType & 0xFF;
375 - log.debug("Type: " + lTemp);
376 - }
377 -
378 - @Override
379 public String toString() { 365 public String toString() {
380 - return MoreObjects.toStringHelper(getClass()) 366 + return MoreObjects.toStringHelper(getClass()).add("MetricValue", iMetricVal).add("BFlag", bBFlag)
381 - .add("Metric value", iMetricVal) 367 + .add("CFlag", bCFlag).add("BType", bType).toString();
382 - .add("B flag", bBFlag)
383 - .add("C flag", bCFlag)
384 - .add("B-type", bType)
385 - .toString();
386 } 368 }
387 } 369 }
......
...@@ -163,18 +163,8 @@ public class PcepMsgPathVer1 implements PcepMsgPath { ...@@ -163,18 +163,8 @@ public class PcepMsgPathVer1 implements PcepMsgPath {
163 } 163 }
164 164
165 @Override 165 @Override
166 - public void print() {
167 -
168 - log.debug("PcepMsgPath");
169 - eroObj.print();
170 - attrList.print();
171 - }
172 -
173 - @Override
174 public String toString() { 166 public String toString() {
175 - return MoreObjects.toStringHelper(getClass()) 167 + return MoreObjects.toStringHelper(getClass()).add("EroObject", eroObj).add("AttributeList", attrList)
176 - .add("ERO object", eroObj)
177 - .add("Attribute list", attrList)
178 .toString(); 168 .toString();
179 } 169 }
180 } 170 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -379,25 +379,8 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { ...@@ -379,25 +379,8 @@ public class PcepSrpObjectVer1 implements PcepSrpObject {
379 } 379 }
380 380
381 @Override 381 @Override
382 - public void print() {
383 -
384 - log.debug("SRP OBJECT");
385 - long lTemp = (bRFlag) ? 1 : 0;
386 - log.debug("r Flag: " + lTemp);
387 - log.debug("SrpID: " + srpId);
388 -
389 - log.debug("OPTIONAL TLV");
390 - ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
391 - while (listIterator.hasNext()) {
392 - listIterator.next().print();
393 - }
394 - }
395 - @Override
396 public String toString() { 382 public String toString() {
397 - return MoreObjects.toStringHelper(getClass()) 383 + return MoreObjects.toStringHelper(getClass()).add("RFlag", bRFlag).add("SRPID", srpId)
398 - .add("R flag", bRFlag) 384 + .add("OptionalTlvList", llOptionalTlv).toString();
399 - .add("SRP ID", srpId)
400 - .add("Optional tlv list", llOptionalTlv)
401 - .toString();
402 } 385 }
403 } 386 }
......
...@@ -290,19 +290,7 @@ class PcepUpdateMsgVer1 implements PcepUpdateMsg { ...@@ -290,19 +290,7 @@ class PcepUpdateMsgVer1 implements PcepUpdateMsg {
290 } 290 }
291 291
292 @Override 292 @Override
293 - public void print() {
294 -
295 - log.debug("PCEP UPDATE MESSAGE");
296 - ListIterator<PcepUpdateRequest> listIterator = llUpdateRequestList.listIterator();
297 - while (listIterator.hasNext()) {
298 - listIterator.next().print();
299 - }
300 - }
301 -
302 - @Override
303 public String toString() { 293 public String toString() {
304 - return MoreObjects.toStringHelper(getClass()) 294 + return MoreObjects.toStringHelper(getClass()).add("UpdateRequestList", llUpdateRequestList).toString();
305 - .add("Update Request list", llUpdateRequestList)
306 - .toString();
307 } 295 }
308 } 296 }
......
...@@ -189,19 +189,8 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest { ...@@ -189,19 +189,8 @@ public class PcepUpdateRequestVer1 implements PcepUpdateRequest {
189 } 189 }
190 190
191 @Override 191 @Override
192 - public void print() {
193 -
194 - log.debug("UPDATE REQUEST");
195 - srpObject.print();
196 - lspObject.print();
197 - }
198 -
199 - @Override
200 public String toString() { 192 public String toString() {
201 - return MoreObjects.toStringHelper(getClass()) 193 + return MoreObjects.toStringHelper(getClass()).add("SrpObject", srpObject).add("LspObject", lspObject)
202 - .add("SRP Object", srpObject) 194 + .add("MsgPath", msgPath).toString();
203 - .add("LSP object", lspObject)
204 - .add("message path object", msgPath)
205 - .toString();
206 } 195 }
207 } 196 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory; ...@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
25 import com.google.common.base.MoreObjects; 25 import com.google.common.base.MoreObjects;
26 26
27 /** 27 /**
28 - * Provides Autonomous System Tlv which contains opaque value (32 Bit AS Number). 28 + * Provides Autonomous-System-Tlv which contains opaque value (32 Bit AS Number).
29 */ 29 */
30 public class AutonomousSystemTlv implements PcepValueType { 30 public class AutonomousSystemTlv implements PcepValueType {
31 31
...@@ -47,28 +47,28 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -47,28 +47,28 @@ public class AutonomousSystemTlv implements PcepValueType {
47 private final int rawValue; 47 private final int rawValue;
48 48
49 /** 49 /**
50 - * constructor to initialize Autonomous system tlv value. 50 + * Constructor to initialize rawValue.
51 * 51 *
52 - * @param rawValue value of Autonomous system tlv 52 + * @param rawValue Autonomous-System-Tlv
53 */ 53 */
54 public AutonomousSystemTlv(int rawValue) { 54 public AutonomousSystemTlv(int rawValue) {
55 this.rawValue = rawValue; 55 this.rawValue = rawValue;
56 } 56 }
57 57
58 /** 58 /**
59 - * To create instance of AutonomousSystemTlv. 59 + * Returns newly created AutonomousSystemTlv object.
60 * 60 *
61 - * @param raw opaque value ofc 32 Bit AS Number 61 + * @param raw value of opaque.
62 - * @return object of AutonomousSystemTlv 62 + * @return object of Autonomous-System-Tlv
63 */ 63 */
64 public static AutonomousSystemTlv of(final int raw) { 64 public static AutonomousSystemTlv of(final int raw) {
65 return new AutonomousSystemTlv(raw); 65 return new AutonomousSystemTlv(raw);
66 } 66 }
67 67
68 /** 68 /**
69 - * Returns opaque value of 32 Bit AS Number. 69 + * Returns opaque value.
70 * 70 *
71 - * @return int value of rawValue 71 + * @return rawValue opaque value.
72 */ 72 */
73 public int getInt() { 73 public int getInt() {
74 return rawValue; 74 return rawValue;
...@@ -118,22 +118,14 @@ public class AutonomousSystemTlv implements PcepValueType { ...@@ -118,22 +118,14 @@ public class AutonomousSystemTlv implements PcepValueType {
118 /** 118 /**
119 * Reads the channel buffer and returns object of AutonomousSystemTlv. 119 * Reads the channel buffer and returns object of AutonomousSystemTlv.
120 * 120 *
121 - * @param c type of channel buffer 121 + * @param c input channel buffer
122 - * @return object of AutonomousSystemTlv 122 + * @return object of Autonomous-System-Tlv
123 */ 123 */
124 public static AutonomousSystemTlv read(ChannelBuffer c) { 124 public static AutonomousSystemTlv read(ChannelBuffer c) {
125 return AutonomousSystemTlv.of(c.readInt()); 125 return AutonomousSystemTlv.of(c.readInt());
126 } 126 }
127 127
128 @Override 128 @Override
129 - public void print() {
130 - log.debug("AutonomousSystemTlv");
131 - log.debug("Type: " + TYPE);
132 - log.debug("Length: " + LENGTH);
133 - log.debug("Value: " + rawValue);
134 - }
135 -
136 - @Override
137 public String toString() { 129 public String toString() {
138 return MoreObjects.toStringHelper(getClass()) 130 return MoreObjects.toStringHelper(getClass())
139 .add("TYPE", TYPE) 131 .add("TYPE", TYPE)
......
...@@ -13,7 +13,7 @@ import org.slf4j.LoggerFactory; ...@@ -13,7 +13,7 @@ import org.slf4j.LoggerFactory;
13 import com.google.common.base.MoreObjects; 13 import com.google.common.base.MoreObjects;
14 import com.google.common.base.MoreObjects.ToStringHelper; 14 import com.google.common.base.MoreObjects.ToStringHelper;
15 15
16 -/* 16 +/**
17 * Provide the error object list with open object. 17 * Provide the error object list with open object.
18 */ 18 */
19 public class ErrorObjListWithOpen { 19 public class ErrorObjListWithOpen {
...@@ -22,14 +22,14 @@ public class ErrorObjListWithOpen { ...@@ -22,14 +22,14 @@ public class ErrorObjListWithOpen {
22 // openObject is optional 22 // openObject is optional
23 private PcepOpenObject openObject; 23 private PcepOpenObject openObject;
24 // flag to check if open object is set or not 24 // flag to check if open object is set or not
25 - public boolean isOpenObjectSet; 25 + private boolean isOpenObjectSet;
26 protected static final Logger log = LoggerFactory.getLogger(ErrorObjListWithOpen.class); 26 protected static final Logger log = LoggerFactory.getLogger(ErrorObjListWithOpen.class);
27 27
28 - /* 28 + /**
29 - * constructor to initialize errObj,openObj. 29 + * Constructor to initialize Error and OPEN object.
30 * 30 *
31 - * @param errObj error object list 31 + * @param errObj ERROR object list
32 - * @param openObj open object 32 + * @param openObj OPEN object
33 */ 33 */
34 public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) { 34 public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) {
35 this.llerrorObjList = errObj; 35 this.llerrorObjList = errObj;
...@@ -41,10 +41,10 @@ public class ErrorObjListWithOpen { ...@@ -41,10 +41,10 @@ public class ErrorObjListWithOpen {
41 } 41 }
42 } 42 }
43 43
44 - /* 44 + /**
45 - * constructor to initialize errObj. 45 + * Constructor to initialize ERROR Object.
46 * 46 *
47 - * @param errObj error object list 47 + * @param errObj ERROR Object list
48 */ 48 */
49 public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) { 49 public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) {
50 this.llerrorObjList = errObj; 50 this.llerrorObjList = errObj;
...@@ -53,9 +53,9 @@ public class ErrorObjListWithOpen { ...@@ -53,9 +53,9 @@ public class ErrorObjListWithOpen {
53 } 53 }
54 54
55 /** 55 /**
56 - * Returns error type. 56 + * Return list of Error Types.
57 * 57 *
58 - * @return error type 58 + * @return error types list
59 */ 59 */
60 public LinkedList<Integer> getErrorType() { 60 public LinkedList<Integer> getErrorType() {
61 LinkedList<Integer> errorType = new LinkedList<Integer>(); 61 LinkedList<Integer> errorType = new LinkedList<Integer>();
...@@ -73,9 +73,9 @@ public class ErrorObjListWithOpen { ...@@ -73,9 +73,9 @@ public class ErrorObjListWithOpen {
73 } 73 }
74 74
75 /** 75 /**
76 - * Returns error value. 76 + * Return list of Error Values.
77 * 77 *
78 - * @return error value 78 + * @return error values list
79 */ 79 */
80 public LinkedList<Integer> getErrorValue() { 80 public LinkedList<Integer> getErrorValue() {
81 LinkedList<Integer> errorValue = new LinkedList<Integer>(); 81 LinkedList<Integer> errorValue = new LinkedList<Integer>();
...@@ -87,16 +87,15 @@ public class ErrorObjListWithOpen { ...@@ -87,16 +87,15 @@ public class ErrorObjListWithOpen {
87 errorObj = errObjListIterator.next(); 87 errorObj = errObjListIterator.next();
88 error = errorObj.getErrorValue(); 88 error = errorObj.getErrorValue();
89 errorValue.add(error); 89 errorValue.add(error);
90 -
91 } 90 }
92 } 91 }
93 return errorValue; 92 return errorValue;
94 } 93 }
95 94
96 /** 95 /**
97 - * Checks whether error object list is empty or not. 96 + * Checks whether ERROR Object list is empty or not.
98 * 97 *
99 - * @return whether error object list is empty or not 98 + * @return true if ERROR Object list is empty otherwise false
100 */ 99 */
101 public boolean isErrorObjListWithOpenPresent() { 100 public boolean isErrorObjListWithOpenPresent() {
102 // ( <error-obj-list> [<Open>] 101 // ( <error-obj-list> [<Open>]
...@@ -107,62 +106,44 @@ public class ErrorObjListWithOpen { ...@@ -107,62 +106,44 @@ public class ErrorObjListWithOpen {
107 /** 106 /**
108 * Write Error Object List and Open Object to channel buffer. 107 * Write Error Object List and Open Object to channel buffer.
109 * 108 *
110 - * @param bb of type channel buffer 109 + * @param cb output channel buffer
110 + * @return length of written Error object list with open
111 * @throws PcepParseException when mandatory fields are not set 111 * @throws PcepParseException when mandatory fields are not set
112 */ 112 */
113 - public int write(ChannelBuffer bb) throws PcepParseException { 113 + public int write(ChannelBuffer cb) throws PcepParseException {
114 - int iLenStartIndex = bb.writerIndex(); 114 + int iLenStartIndex = cb.writerIndex();
115 boolean bIsErrObjListFound = false; 115 boolean bIsErrObjListFound = false;
116 116
117 //<error-obj-list> is mandatory , if not present throw exception. 117 //<error-obj-list> is mandatory , if not present throw exception.
118 if (llerrorObjList != null) { 118 if (llerrorObjList != null) {
119 ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator(); 119 ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
120 while (errObjListIterator.hasNext()) { 120 while (errObjListIterator.hasNext()) {
121 - errObjListIterator.next().write(bb); 121 + errObjListIterator.next().write(cb);
122 bIsErrObjListFound = true; 122 bIsErrObjListFound = true;
123 } 123 }
124 } 124 }
125 125
126 if (!bIsErrObjListFound) { 126 if (!bIsErrObjListFound) {
127 - throw new PcepParseException("Error: [ErrorObjListWithOpen::write] <error-obj-list> is mandatory."); 127 + throw new PcepParseException("<error-obj-list> is mandatory.");
128 } 128 }
129 129
130 //Open Object is optional , if present write. 130 //Open Object is optional , if present write.
131 if (openObject != null) { 131 if (openObject != null) {
132 - openObject.write(bb); 132 + openObject.write(cb);
133 - }
134 -
135 - return bb.writerIndex() - iLenStartIndex;
136 - }
137 -
138 - /**
139 - * Prints the attributes of ErrorObject List with open Object.
140 - */
141 - public void print() {
142 - log.debug("ErrorObjListWithOpen:");
143 - ListIterator<PcepErrorObject> pcepErrorObjIterator = llerrorObjList.listIterator();
144 - log.debug("<error-obj-list> :");
145 - while (pcepErrorObjIterator.hasNext()) {
146 - pcepErrorObjIterator.next().print();
147 } 133 }
148 134
149 - log.debug("OpenObject:"); 135 + return cb.writerIndex() - iLenStartIndex;
150 - if (openObject != null) {
151 - openObject.print();
152 - }
153 } 136 }
154 137
155 @Override 138 @Override
156 public String toString() { 139 public String toString() {
157 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); 140 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
158 141
159 - if (openObject == null) { 142 + toStrHelper.add("ErrorObjList", llerrorObjList);
160 - toStrHelper 143 +
161 - .add("error Obj List", llerrorObjList); 144 + // OPEN Object is optional
162 - } else { 145 + if (openObject != null) {
163 - toStrHelper 146 + toStrHelper.add("Open", openObject);
164 - .add("error Obj List", llerrorObjList)
165 - .add("open Object", openObject);
166 } 147 }
167 return toStrHelper.toString(); 148 return toStrHelper.toString();
168 } 149 }
......
...@@ -169,21 +169,12 @@ public class IPv4SubObject implements PcepValueType { ...@@ -169,21 +169,12 @@ public class IPv4SubObject implements PcepValueType {
169 } 169 }
170 170
171 @Override 171 @Override
172 - public void print() {
173 - log.debug("IPv4SubObject");
174 - log.debug("Type: " + TYPE);
175 - log.debug("Length: " + LENGTH);
176 - log.debug("IPv4 address: " + String.format("%08X", ipAddress));
177 - log.debug("Prefix Length: " + prefixLen);
178 - }
179 -
180 - @Override
181 public String toString() { 172 public String toString() {
182 return MoreObjects.toStringHelper(getClass()) 173 return MoreObjects.toStringHelper(getClass())
183 .add("Type", TYPE) 174 .add("Type", TYPE)
184 .add("Length", LENGTH) 175 .add("Length", LENGTH)
185 - .add("IPv4 Address", ipAddress) 176 + .add("IPv4Address", ipAddress)
186 - .add("Prefix Length", prefixLen) 177 + .add("PrefixLength", prefixLen)
187 .toString(); 178 .toString();
188 } 179 }
189 } 180 }
......
...@@ -24,6 +24,7 @@ import org.slf4j.Logger; ...@@ -24,6 +24,7 @@ import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
25 25
26 import com.google.common.base.MoreObjects; 26 import com.google.common.base.MoreObjects;
27 +import com.google.common.base.MoreObjects.ToStringHelper;
27 28
28 /** 29 /**
29 * Provides IPv6 Sub Object. 30 * Provides IPv6 Sub Object.
...@@ -204,25 +205,18 @@ public class IPv6SubObject implements PcepValueType { ...@@ -204,25 +205,18 @@ public class IPv6SubObject implements PcepValueType {
204 } 205 }
205 206
206 @Override 207 @Override
207 - public void print() { 208 + public String toString() {
208 - log.debug("IPv6SubObject"); 209 + ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
209 - log.debug("Type: ", TYPE); 210 +
210 - log.debug("Length: ", LENGTH); 211 + toStrHelper.add("Type", TYPE);
211 - if (null != rawValue) { 212 + toStrHelper.add("Length", LENGTH);
213 +
212 StringBuffer result = new StringBuffer(); 214 StringBuffer result = new StringBuffer();
213 for (byte b : rawValue) { 215 for (byte b : rawValue) {
214 result.append(String.format("%02X ", b)); 216 result.append(String.format("%02X ", b));
215 } 217 }
216 - log.debug(result.toString()); 218 + toStrHelper.add("Value", result);
217 - }
218 - }
219 219
220 - @Override 220 + return toStrHelper.toString();
221 - public String toString() {
222 - return MoreObjects.toStringHelper(getClass())
223 - .add("Type", TYPE)
224 - .add("Length", LENGTH)
225 - .add("IPv6 Address", rawValue)
226 - .toString();
227 } 221 }
228 } 222 }
......
...@@ -148,20 +148,12 @@ public class PathKeySubObject implements PcepValueType { ...@@ -148,20 +148,12 @@ public class PathKeySubObject implements PcepValueType {
148 } 148 }
149 149
150 @Override 150 @Override
151 - public void print() {
152 - log.debug("PathKeySubObject");
153 - log.debug("Type: " + TYPE);
154 - log.debug("Length: " + LENGTH);
155 - log.debug("Path Key: " + pathKey);
156 - log.debug("PCEID: " + pceID);
157 - }
158 -
159 - @Override
160 public String toString() { 151 public String toString() {
161 return MoreObjects.toStringHelper(getClass()) 152 return MoreObjects.toStringHelper(getClass())
162 - .add("Type", TYPE).add("Length", LENGTH) 153 + .add("Type", TYPE)
163 - .add("Path Key", pathKey) 154 + .add("Length", LENGTH)
164 - .add("PCE ID", pceID) 155 + .add("PathKey", pathKey)
156 + .add("PceID", pceID)
165 .toString(); 157 .toString();
166 } 158 }
167 } 159 }
......
1 package org.onosproject.pcepio.types; 1 package org.onosproject.pcepio.types;
2 2
3 import java.util.LinkedList; 3 import java.util.LinkedList;
4 -import java.util.ListIterator;
5 4
6 import org.onosproject.pcepio.protocol.PcepLabelObject; 5 import org.onosproject.pcepio.protocol.PcepLabelObject;
7 import org.onosproject.pcepio.protocol.PcepLspObject; 6 import org.onosproject.pcepio.protocol.PcepLspObject;
...@@ -36,7 +35,7 @@ public class PcepLabelDownload { ...@@ -36,7 +35,7 @@ public class PcepLabelDownload {
36 } 35 }
37 36
38 /** 37 /**
39 - * Sets the Pcep Srp Object. 38 + * Sets the Pcep SRP Object.
40 * 39 *
41 * @param srpobj PCEP SRP Object 40 * @param srpobj PCEP SRP Object
42 */ 41 */
...@@ -80,27 +79,9 @@ public class PcepLabelDownload { ...@@ -80,27 +79,9 @@ public class PcepLabelDownload {
80 this.llLabelList = llLabelList; 79 this.llLabelList = llLabelList;
81 } 80 }
82 81
83 - /**
84 - * Prints the attribute of PcepLableObject.
85 - */
86 - public void print() {
87 - log.debug("LABEL DOWNLOAD:");
88 - srpObject.print();
89 - lspObject.print();
90 -
91 - log.debug("label-list:");
92 - ListIterator<PcepLabelObject> listIterator = llLabelList.listIterator();
93 - while (listIterator.hasNext()) {
94 - listIterator.next().print();
95 - }
96 - }
97 -
98 @Override 82 @Override
99 public String toString() { 83 public String toString() {
100 - return MoreObjects.toStringHelper(getClass()) 84 + return MoreObjects.toStringHelper(getClass()).add("SrpObject", srpObject).add("LspObject", lspObject)
101 - .add("SRP object", srpObject) 85 + .add("LabelObjectList", llLabelList).toString();
102 - .add("LSP object", lspObject)
103 - .add("label object list", llLabelList)
104 - .toString();
105 } 86 }
106 } 87 }
......
...@@ -92,22 +92,12 @@ public class PcepLabelMap { ...@@ -92,22 +92,12 @@ public class PcepLabelMap {
92 this.labelObject = labelObject; 92 this.labelObject = labelObject;
93 } 93 }
94 94
95 - /**
96 - * Prints the attribute of PcepLabelMap.
97 - */
98 - public void print() {
99 - log.debug("LABEL MAP:");
100 - srpObject.print();
101 - labelObject.print();
102 - fecObject.print();
103 - }
104 -
105 @Override 95 @Override
106 public String toString() { 96 public String toString() {
107 return MoreObjects.toStringHelper(getClass()) 97 return MoreObjects.toStringHelper(getClass())
108 - .add("SRP object", srpObject) 98 + .add("SrpObject", srpObject)
109 - .add("Label object", labelObject) 99 + .add("LabelObject", labelObject)
110 - .add("Fec object", fecObject) 100 + .add("FecObject", fecObject)
111 .toString(); 101 .toString();
112 } 102 }
113 } 103 }
......
...@@ -86,8 +86,8 @@ public class PcepNaiIpv4Adjacency implements PcepNai { ...@@ -86,8 +86,8 @@ public class PcepNaiIpv4Adjacency implements PcepNai {
86 @Override 86 @Override
87 public String toString() { 87 public String toString() {
88 return MoreObjects.toStringHelper(getClass()) 88 return MoreObjects.toStringHelper(getClass())
89 - .add("local IPv4 Address", localIpv4Addr) 89 + .add("localIPv4Address", localIpv4Addr)
90 - .add("remote IPv4 Address", remoteIpv4Addr) 90 + .add("remoteIPv4Address", remoteIpv4Addr)
91 .toString(); 91 .toString();
92 } 92 }
93 } 93 }
......
...@@ -89,8 +89,6 @@ public class PcepNaiIpv4NodeId implements PcepNai { ...@@ -89,8 +89,6 @@ public class PcepNaiIpv4NodeId implements PcepNai {
89 89
90 @Override 90 @Override
91 public String toString() { 91 public String toString() {
92 - return MoreObjects.toStringHelper(getClass()) 92 + return MoreObjects.toStringHelper(getClass()).add("IPv4NodeId", ipv4NodeId).toString();
93 - .add("IPv4 Node Id", ipv4NodeId)
94 - .toString();
95 } 93 }
96 } 94 }
......
...@@ -102,8 +102,8 @@ public class PcepNaiIpv6Adjacency implements PcepNai { ...@@ -102,8 +102,8 @@ public class PcepNaiIpv6Adjacency implements PcepNai {
102 @Override 102 @Override
103 public String toString() { 103 public String toString() {
104 return MoreObjects.toStringHelper(getClass()) 104 return MoreObjects.toStringHelper(getClass())
105 - .add("local IPV6 address", localIpv6Addr) 105 + .add("localIPV6Address", localIpv6Addr)
106 - .add("remote IPV6 address", remoteIpv6Addr) 106 + .add("remoteIPV6Address", remoteIpv6Addr)
107 .toString(); 107 .toString();
108 } 108 }
109 109
......
...@@ -82,8 +82,6 @@ public class PcepNaiIpv6NodeId implements PcepNai { ...@@ -82,8 +82,6 @@ public class PcepNaiIpv6NodeId implements PcepNai {
82 82
83 @Override 83 @Override
84 public String toString() { 84 public String toString() {
85 - return MoreObjects.toStringHelper(getClass()) 85 + return MoreObjects.toStringHelper(getClass()).add("IPV6NodeID", ipv6NodeId).toString();
86 - .add("IPV6 node ID", ipv6NodeId)
87 - .toString();
88 } 86 }
89 } 87 }
......
...@@ -104,10 +104,10 @@ public class PcepNaiUnnumberedAdjacencyIpv4 implements PcepNai { ...@@ -104,10 +104,10 @@ public class PcepNaiUnnumberedAdjacencyIpv4 implements PcepNai {
104 @Override 104 @Override
105 public String toString() { 105 public String toString() {
106 return MoreObjects.toStringHelper(getClass()) 106 return MoreObjects.toStringHelper(getClass())
107 - .add("local Node Id", localNodeId) 107 + .add("localNodeId", localNodeId)
108 - .add("local Interface Id", localInterfaceId) 108 + .add("localInterfaceId", localInterfaceId)
109 - .add("remote Node Id", remoteNodeId) 109 + .add("remoteNodeId", remoteNodeId)
110 - .add("remote Interface Id:", remoteInterfaceId) 110 + .add("remoteInterfaceId:", remoteInterfaceId)
111 .toString(); 111 .toString();
112 } 112 }
113 } 113 }
......
...@@ -68,6 +68,7 @@ public class PcepObjectHeader { ...@@ -68,6 +68,7 @@ public class PcepObjectHeader {
68 * @param bIFlag I flag 68 * @param bIFlag I flag
69 * @param objLen PCEP object length 69 * @param objLen PCEP object length
70 */ 70 */
71 +
71 public PcepObjectHeader(byte objClass, byte objType, boolean bPFlag, boolean bIFlag, short objLen) { 72 public PcepObjectHeader(byte objClass, byte objType, boolean bPFlag, boolean bIFlag, short objLen) {
72 this.objClass = objClass; 73 this.objClass = objClass;
73 this.objType = objType; 74 this.objType = objType;
...@@ -169,12 +170,12 @@ public class PcepObjectHeader { ...@@ -169,12 +170,12 @@ public class PcepObjectHeader {
169 /** 170 /**
170 * Writes Byte stream of PCEP object header to channel buffer. 171 * Writes Byte stream of PCEP object header to channel buffer.
171 * 172 *
172 - * @param bb of type channel buffer 173 + * @param cb output channel buffer
173 * @return objLenIndex object length index in channel buffer 174 * @return objLenIndex object length index in channel buffer
174 */ 175 */
175 - public int write(ChannelBuffer bb) { 176 + public int write(ChannelBuffer cb) {
176 177
177 - bb.writeByte(this.objClass); 178 + cb.writeByte(this.objClass);
178 byte temp = (byte) (this.objType << OBJECT_TYPE_SHIFT_VALUE); 179 byte temp = (byte) (this.objType << OBJECT_TYPE_SHIFT_VALUE);
179 if (this.bPFlag) { 180 if (this.bPFlag) {
180 temp = (byte) (temp | PFLAG_SET); 181 temp = (byte) (temp | PFLAG_SET);
...@@ -182,55 +183,38 @@ public class PcepObjectHeader { ...@@ -182,55 +183,38 @@ public class PcepObjectHeader {
182 if (this.bIFlag) { 183 if (this.bIFlag) {
183 temp = (byte) (temp | IFLAG_SET); 184 temp = (byte) (temp | IFLAG_SET);
184 } 185 }
185 - bb.writeByte(temp); 186 + cb.writeByte(temp);
186 - int objLenIndex = bb.writerIndex(); 187 + int objLenIndex = cb.writerIndex();
187 - bb.writeShort((short) 0); 188 + cb.writeShort((short) 0);
188 return objLenIndex; 189 return objLenIndex;
189 } 190 }
190 191
191 /** 192 /**
192 * Read from channel buffer and Returns PCEP Objects header. 193 * Read from channel buffer and Returns PCEP Objects header.
193 * 194 *
194 - * @param bb of type channel buffer 195 + * @param cb of type channel buffer
195 * @return PCEP Object header 196 * @return PCEP Object header
196 */ 197 */
197 - public static PcepObjectHeader read(ChannelBuffer bb) { 198 + public static PcepObjectHeader read(ChannelBuffer cb) {
198 199
199 byte objClass; 200 byte objClass;
200 byte objType; 201 byte objType;
201 boolean bPFlag; 202 boolean bPFlag;
202 boolean bIFlag; 203 boolean bIFlag;
203 short objLen; 204 short objLen;
204 - objClass = bb.readByte(); 205 + objClass = cb.readByte();
205 - byte temp = bb.readByte(); 206 + byte temp = cb.readByte();
206 bIFlag = ((temp & IFLAG_SET) == IFLAG_SET) ? true : false; 207 bIFlag = ((temp & IFLAG_SET) == IFLAG_SET) ? true : false;
207 bPFlag = ((temp & PFLAG_SET) == PFLAG_SET) ? true : false; 208 bPFlag = ((temp & PFLAG_SET) == PFLAG_SET) ? true : false;
208 objType = (byte) (temp >> OBJECT_TYPE_SHIFT_VALUE); 209 objType = (byte) (temp >> OBJECT_TYPE_SHIFT_VALUE);
209 - objLen = bb.readShort(); 210 + objLen = cb.readShort();
210 return new PcepObjectHeader(objClass, objType, bPFlag, bIFlag, objLen); 211 return new PcepObjectHeader(objClass, objType, bPFlag, bIFlag, objLen);
211 } 212 }
212 213
213 - /**
214 - * Prints the Attributes of PCEP Object header.
215 - */
216 - public void print() {
217 -
218 - log.debug("PcepObjectHeader");
219 - log.debug("Object Class: " + objClass);
220 - log.debug("Object Type: " + objType);
221 - log.debug("Object Length: " + objLen);
222 - log.debug("P flag: " + bPFlag);
223 - log.debug("I flag: " + bIFlag);
224 - }
225 -
226 @Override 214 @Override
227 public String toString() { 215 public String toString() {
228 - return MoreObjects.toStringHelper(getClass()) 216 + return MoreObjects.toStringHelper(getClass()).add("ObjectClass", objClass).add("ObjectType", objType)
229 - .add("Object class:", objClass) 217 + .add("ObjectLength", objLen).add("PFlag", (bPFlag) ? 1 : 0).add("IFlag", (bIFlag) ? 1 : 0)
230 - .add("Object type:", objType)
231 - .add("Object length:", objLen)
232 - .add("P flag:", bPFlag)
233 - .add("I flag:", bIFlag)
234 .toString(); 218 .toString();
235 } 219 }
236 } 220 }
......
...@@ -40,8 +40,4 @@ public interface PcepRsvpErrorSpec extends PcepValueType { ...@@ -40,8 +40,4 @@ public interface PcepRsvpErrorSpec extends PcepValueType {
40 * @return class type 40 * @return class type
41 */ 41 */
42 byte getClassType(); 42 byte getClassType();
43 -
44 - @Override
45 - String toString();
46 -
47 } 43 }
......
...@@ -146,17 +146,12 @@ public class PcepRsvpIpv4ErrorSpec implements PcepRsvpErrorSpec { ...@@ -146,17 +146,12 @@ public class PcepRsvpIpv4ErrorSpec implements PcepRsvpErrorSpec {
146 } 146 }
147 147
148 @Override 148 @Override
149 - public void print() {
150 - // TODO Auto-generated method stub
151 - }
152 -
153 - @Override
154 public String toString() { 149 public String toString() {
155 return MoreObjects.toStringHelper(getClass()) 150 return MoreObjects.toStringHelper(getClass())
156 - .add("IPv4 Address:", ipv4Addr) 151 + .add("IPv4Address:", ipv4Addr)
157 .add("flags:", flags) 152 .add("flags:", flags)
158 - .add("error Code:", errCode) 153 + .add("errorCode:", errCode)
159 - .add("error Value:", errValue) 154 + .add("errorValue:", errValue)
160 .toString(); 155 .toString();
161 } 156 }
162 } 157 }
......
...@@ -136,17 +136,12 @@ public class PcepRsvpIpv6ErrorSpec implements PcepRsvpErrorSpec { ...@@ -136,17 +136,12 @@ public class PcepRsvpIpv6ErrorSpec implements PcepRsvpErrorSpec {
136 } 136 }
137 137
138 @Override 138 @Override
139 - public void print() {
140 - // TODO Auto-generated method stub
141 - }
142 -
143 - @Override
144 public String toString() { 139 public String toString() {
145 return MoreObjects.toStringHelper(getClass()) 140 return MoreObjects.toStringHelper(getClass())
146 - .add("IPv6 Address:", ipv6Addr) 141 + .add("IPv6Address:", ipv6Addr)
147 .add("flags:", flags) 142 .add("flags:", flags)
148 - .add("error Code:", errCode) 143 + .add("errorCode:", errCode)
149 - .add("error Value:", errValue) 144 + .add("errorValue:", errValue)
150 .toString(); 145 .toString();
151 } 146 }
152 } 147 }
......
...@@ -52,7 +52,7 @@ public class PcepRsvpObjectHeader { ...@@ -52,7 +52,7 @@ public class PcepRsvpObjectHeader {
52 private short objLen; 52 private short objLen;
53 53
54 /** 54 /**
55 - * Constructor to initialize class num , length and type. 55 + * Constructor to initialize class num, length and type.
56 * 56 *
57 * @param objClassNum object class number 57 * @param objClassNum object class number
58 * @param objClassType object class type 58 * @param objClassType object class type
...@@ -65,7 +65,7 @@ public class PcepRsvpObjectHeader { ...@@ -65,7 +65,7 @@ public class PcepRsvpObjectHeader {
65 } 65 }
66 66
67 /** 67 /**
68 - * Sets the Class num. 68 + * Sets the Class-Num.
69 * 69 *
70 * @param value object class number 70 * @param value object class number
71 */ 71 */
...@@ -121,52 +121,38 @@ public class PcepRsvpObjectHeader { ...@@ -121,52 +121,38 @@ public class PcepRsvpObjectHeader {
121 /** 121 /**
122 * Writes the byte stream of PcepRsvpObjectHeader to channel buffer. 122 * Writes the byte stream of PcepRsvpObjectHeader to channel buffer.
123 * 123 *
124 - * @param bb of type channel buffer 124 + * @param cb of type channel buffer
125 * @return object length index in channel buffer 125 * @return object length index in channel buffer
126 */ 126 */
127 - public int write(ChannelBuffer bb) { 127 + public int write(ChannelBuffer cb) {
128 - int iLenStartIndex = bb.writerIndex(); 128 + int iLenStartIndex = cb.writerIndex();
129 - bb.writeShort((short) 0); 129 + cb.writeShort((short) 0);
130 - bb.writeByte(this.objClassNum); 130 + cb.writeByte(this.objClassNum);
131 - bb.writeByte(this.objClassType); 131 + cb.writeByte(this.objClassType);
132 - return bb.writerIndex() - iLenStartIndex; 132 + return cb.writerIndex() - iLenStartIndex;
133 } 133 }
134 134
135 /** 135 /**
136 * Reads the PcepRsvpObjectHeader. 136 * Reads the PcepRsvpObjectHeader.
137 * 137 *
138 - * @param bb of type channel buffer 138 + * @param cb input channel buffer
139 * @return PcepRsvpObjectHeader 139 * @return PcepRsvpObjectHeader
140 */ 140 */
141 - public static PcepRsvpObjectHeader read(ChannelBuffer bb) { 141 + public static PcepRsvpObjectHeader read(ChannelBuffer cb) {
142 - log.debug("PcepRsvpObjectHeader ::read "); 142 + log.debug("read ");
143 byte objClassNum; 143 byte objClassNum;
144 byte objClassType; 144 byte objClassType;
145 short objLen; 145 short objLen;
146 - objLen = bb.readShort(); 146 + objLen = cb.readShort();
147 - objClassNum = bb.readByte(); 147 + objClassNum = cb.readByte();
148 - objClassType = bb.readByte(); 148 + objClassType = cb.readByte();
149 149
150 return new PcepRsvpObjectHeader(objClassNum, objClassType, objLen); 150 return new PcepRsvpObjectHeader(objClassNum, objClassType, objLen);
151 } 151 }
152 152
153 - /**
154 - * Prints the attribute of PcepRsvpObjectHeader.
155 - */
156 - public void print() {
157 -
158 - log.debug("PcepObjectHeader");
159 - log.debug("Object Class-Num: " + objClassNum);
160 - log.debug("Object C-Type: " + objClassType);
161 - log.debug("Object Length: " + objLen);
162 - }
163 -
164 @Override 153 @Override
165 public String toString() { 154 public String toString() {
166 - return MoreObjects.toStringHelper(getClass()) 155 + return MoreObjects.toStringHelper(getClass()).add("ObjectClassNum", objClassNum)
167 - .add("Object Class-Num: " , objClassNum) 156 + .add("ObjectCType", objClassType).add("ObjectLength", objLen).toString();
168 - .add("Object C-Type: " , objClassType)
169 - .add("Object Length: " , objLen)
170 - .toString();
171 } 157 }
172 } 158 }
......
...@@ -144,22 +144,12 @@ public class PcepRsvpSpecObjHeader { ...@@ -144,22 +144,12 @@ public class PcepRsvpSpecObjHeader {
144 return new PcepRsvpSpecObjHeader(objLen, objClassNum, objClassType); 144 return new PcepRsvpSpecObjHeader(objLen, objClassNum, objClassType);
145 } 145 }
146 146
147 - /**
148 - * Prints the attribute of PcepRsvpObjectHeader.
149 - */
150 - public void print() {
151 -
152 - log.debug("PcepObjectHeader");
153 - log.debug("Object Class-Num: " + objClassNum);
154 - log.debug("Object C-Type: " + objClassType);
155 - log.debug("Object Length: " + objLen);
156 - }
157 @Override 147 @Override
158 public String toString() { 148 public String toString() {
159 return MoreObjects.toStringHelper(getClass()) 149 return MoreObjects.toStringHelper(getClass())
160 - .add("Object Class-Num: " , objClassNum) 150 + .add("ObjectClassNum: " , objClassNum)
161 - .add("Object C-Type: " , objClassType) 151 + .add("ObjectCType: " , objClassType)
162 - .add("Object Length: " , objLen) 152 + .add("ObjectLength: " , objLen)
163 .toString(); 153 .toString();
164 } 154 }
165 } 155 }
......
...@@ -204,19 +204,14 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec { ...@@ -204,19 +204,14 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
204 } 204 }
205 205
206 @Override 206 @Override
207 - public void print() {
208 - // TODO Auto-generated method stub
209 - }
210 -
211 - @Override
212 public String toString() { 207 public String toString() {
213 return MoreObjects.toStringHelper(getClass()) 208 return MoreObjects.toStringHelper(getClass())
214 - .add("enterprise Number:", enterpriseNum) 209 + .add("enterpriseNumber:", enterpriseNum)
215 - .add("sub Organization:", subOrg) 210 + .add("subOrganization:", subOrg)
216 - .add("err Desc Length:", errDescLen) 211 + .add("errDescLength:", errDescLen)
217 - .add("user Error Value:", userErrorValue) 212 + .add("userErrorValue:", userErrorValue)
218 - .add("err Desc:", errDesc) 213 + .add("errDesc:", errDesc)
219 - .add("Rsvp User Spec Sub Object:", llRsvpUserSpecSubObj) 214 + .add("RsvpUserSpecSubObject:", llRsvpUserSpecSubObj)
220 .toString(); 215 .toString();
221 } 216 }
222 } 217 }
......
...@@ -52,9 +52,4 @@ public interface PcepValueType { ...@@ -52,9 +52,4 @@ public interface PcepValueType {
52 * @return length of bytes written to channel buffer 52 * @return length of bytes written to channel buffer
53 */ 53 */
54 public int write(ChannelBuffer bb); 54 public int write(ChannelBuffer bb);
55 -
56 - /**
57 - * Prints the Attributes of PCEP Message.
58 - */
59 - public void print();
60 } 55 }
......
...@@ -308,17 +308,6 @@ public class SrEroSubObject implements PcepValueType { ...@@ -308,17 +308,6 @@ public class SrEroSubObject implements PcepValueType {
308 } 308 }
309 309
310 @Override 310 @Override
311 - public void print() {
312 - log.debug("SrEroSubObject");
313 - log.debug("Type: " + TYPE);
314 - log.debug("Length: " + LENGTH);
315 -
316 - log.debug("st:" + st + " bFFlag:" + bFFlag + " bSFlag:" + bSFlag + " bCFlag:" + bCFlag + " bMFlag:" + bMFlag
317 - + " sID:" + sID + " nAI:" + nai);
318 -
319 - }
320 -
321 - @Override
322 public String toString() { 311 public String toString() {
323 return MoreObjects.toStringHelper(getClass()) 312 return MoreObjects.toStringHelper(getClass())
324 .add("Type", TYPE) 313 .add("Type", TYPE)
...@@ -332,5 +321,4 @@ public class SrEroSubObject implements PcepValueType { ...@@ -332,5 +321,4 @@ public class SrEroSubObject implements PcepValueType {
332 .add("nAI", nai) 321 .add("nAI", nai)
333 .toString(); 322 .toString();
334 } 323 }
335 -
336 } 324 }
......
...@@ -198,28 +198,13 @@ public class StatefulIPv4LspIdentidiersTlv implements PcepValueType { ...@@ -198,28 +198,13 @@ public class StatefulIPv4LspIdentidiersTlv implements PcepValueType {
198 } 198 }
199 199
200 @Override 200 @Override
201 - public void print() {
202 -
203 - log.debug("StatefulIPv4LspIdentidiersTlv");
204 - log.debug("Type: " + TYPE);
205 - log.debug("Length: " + LENGTH);
206 - log.debug("Ipv4IngressAddress: " + ipv4IngressAddress);
207 - log.debug("LspId: " + lspId);
208 - log.debug("TunnelId: " + tunnelId);
209 - log.debug("ExtendedTunnelId: " + extendedTunnelId);
210 - log.debug("Ipv4EgressAddress: " + ipv4EgressAddress);
211 - }
212 -
213 - @Override
214 public String toString() { 201 public String toString() {
215 return MoreObjects.toStringHelper(getClass()) 202 return MoreObjects.toStringHelper(getClass())
216 .add("Type:", TYPE) 203 .add("Type:", TYPE)
217 .add("Length:", LENGTH) 204 .add("Length:", LENGTH)
218 .add("Ipv4IngressAddress:", ipv4IngressAddress) 205 .add("Ipv4IngressAddress:", ipv4IngressAddress)
219 - .add("LspId:", lspId) 206 + .add("LspId:", lspId).add("TunnelId:", tunnelId)
220 - .add("TunnelId:", tunnelId)
221 .add("ExtendedTunnelId:", extendedTunnelId) 207 .add("ExtendedTunnelId:", extendedTunnelId)
222 - .add("Ipv4EgressAddress:", ipv4EgressAddress) 208 + .add("Ipv4EgressAddress:", ipv4EgressAddress).toString();
223 - .toString();
224 } 209 }
225 } 210 }
......
...@@ -131,15 +131,6 @@ public class StatefulLspErrorCodeTlv implements PcepValueType { ...@@ -131,15 +131,6 @@ public class StatefulLspErrorCodeTlv implements PcepValueType {
131 } 131 }
132 132
133 @Override 133 @Override
134 - public void print() {
135 -
136 - log.debug("StatefulLspErrorCodeTlv");
137 - log.debug("Type: " + TYPE);
138 - log.debug("Length: " + LENGTH);
139 - log.debug("Value: " + rawValue);
140 - }
141 -
142 - @Override
143 public String toString() { 134 public String toString() {
144 return MoreObjects.toStringHelper(getClass()).add("Type", TYPE).add("Length", LENGTH).add("Value", rawValue) 135 return MoreObjects.toStringHelper(getClass()).add("Type", TYPE).add("Length", LENGTH).add("Value", rawValue)
145 .toString(); 136 .toString();
......
...@@ -206,29 +206,13 @@ public class StatefulRsvpErrorSpecTlv implements PcepValueType { ...@@ -206,29 +206,13 @@ public class StatefulRsvpErrorSpecTlv implements PcepValueType {
206 } 206 }
207 207
208 @Override 208 @Override
209 - public void print() {
210 -
211 - log.debug("StatefulRsvpErrorSpecTlv");
212 - log.debug("Type: " + TYPE);
213 - log.debug("Length: " + hLength);
214 - if (isErrSpceObjSet) {
215 - rsvpErrSpecObj.print();
216 - }
217 - }
218 -
219 - @Override
220 public String toString() { 209 public String toString() {
221 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); 210 ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
222 211
223 if (!isErrSpceObjSet) { 212 if (!isErrSpceObjSet) {
224 - toStrHelper 213 + toStrHelper.add("Type", TYPE).add("Length", hLength);
225 - .add("Type", TYPE)
226 - .add("Length", hLength);
227 } else { 214 } else {
228 - toStrHelper 215 + toStrHelper.add("Type", TYPE).add("Length", hLength).add("RSVPErrorSpecObject", rsvpErrSpecObj);
229 - .add("Type", TYPE)
230 - .add("Length", hLength)
231 - .add("RSVP Error Spec Object", rsvpErrSpecObj);
232 } 216 }
233 return toStrHelper.toString(); 217 return toStrHelper.toString();
234 } 218 }
......
...@@ -151,15 +151,7 @@ public class SymbolicPathNameTlv implements PcepValueType { ...@@ -151,15 +151,7 @@ public class SymbolicPathNameTlv implements PcepValueType {
151 } 151 }
152 152
153 @Override 153 @Override
154 - public void print() {
155 - log.debug("SymbolicPathNameTlv");
156 - log.debug("Type: " + TYPE);
157 - log.debug("Length: " + hLength);
158 - log.debug("Symbolic Path Name : " + rawValue);
159 - }
160 -
161 - @Override
162 public String toString() { 154 public String toString() {
163 - return MoreObjects.toStringHelper(getClass()).add("Symbolic Path Name ", rawValue).toString(); 155 + return MoreObjects.toStringHelper(getClass()).add("SymbolicPathName ", rawValue).toString();
164 } 156 }
165 } 157 }
......