blob: 82be0414f8a7cf703bcb779087291c5dad5a5dba [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
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
17package org.onosproject.pcepio.types;
18
19import org.onosproject.pcepio.protocol.PcepFecObject;
20import org.onosproject.pcepio.protocol.PcepLabelObject;
21import org.onosproject.pcepio.protocol.PcepSrpObject;
22import org.slf4j.Logger;
23import org.slf4j.LoggerFactory;
24
bharat saraswalf7364db2015-08-11 13:39:31 +053025import com.google.common.base.MoreObjects;
26
Sho SHIMIZU74361c12015-08-11 12:31:48 -070027/**
28 * Provide PCEP Label Map.
29 * Reference :draft-zhao-pce-pcep-extension-for-pce-controller-01.
30 */
31public class PcepLabelMap {
32
33 protected static final Logger log = LoggerFactory.getLogger(PcepLabelMap.class);
34 //PCEP SRP Object
bharat saraswalf7364db2015-08-11 13:39:31 +053035 private PcepSrpObject srpObject;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070036 //PCEP Label Object
bharat saraswalf7364db2015-08-11 13:39:31 +053037 private PcepLabelObject labelObject;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070038 //PCEP FEC Object
bharat saraswalf7364db2015-08-11 13:39:31 +053039 private PcepFecObject fecObject;
Sho SHIMIZU74361c12015-08-11 12:31:48 -070040
41 /**
42 * Sets Fec Object.
43 *
44 * @param fecObject PCEP fec object
45 */
46 public void setFECObject(PcepFecObject fecObject) {
47 this.fecObject = fecObject;
48 }
49
50 /**
51 * Returns the PcepFecObject.
52 *
53 * @return PCEP fec object
54 */
55 public PcepFecObject getFECObject() {
56 return this.fecObject;
57 }
58
59 /**
60 * Returns SRP Object.
61 *
62 * @return PCEP SRP Object
63 */
64 public PcepSrpObject getSrpObject() {
65 return srpObject;
66 }
67
68 /**
69 * Sets the PCEP Srp Object.
70 *
71 * @param srpObject PCEP SRP Object
72 */
73 public void setSrpObject(PcepSrpObject srpObject) {
74 this.srpObject = srpObject;
75 }
76
77 /**
78 * Returns labelObject.
79 *
80 * @return PCEP label object
81 */
82 public PcepLabelObject getLabelObject() {
83 return labelObject;
84 }
85
86 /**
87 * Sets the Pcep labelObject.
88 *
89 * @param labelObject PCEP label object
90 */
91 public void setLabelObject(PcepLabelObject labelObject) {
92 this.labelObject = labelObject;
93 }
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 }
bharat saraswalf7364db2015-08-11 13:39:31 +0530104
105 @Override
106 public String toString() {
107 return MoreObjects.toStringHelper(getClass())
108 .add("SRP object", srpObject)
109 .add("Label object", labelObject)
110 .add("Fec object", fecObject)
111 .toString();
112 }
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700113}