Committed by
Gerrit Code Review
Interfaces added for PCEP messages and PCEP Controller
Change-Id: Id678b6832b42bcf4a437322996244d224c4052d0
Showing
74 changed files
with
8364 additions
and
0 deletions
pcep/api/pom.xml
0 → 100755
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <groupId>org.onosproject</groupId> | ||
24 | + <artifactId>onos-pcep-controller</artifactId> | ||
25 | + <version>1.3.0-SNAPSHOT</version> | ||
26 | + <relativePath>../pom.xml</relativePath> | ||
27 | + </parent> | ||
28 | + | ||
29 | + <artifactId>onos-pcep-controller-api</artifactId> | ||
30 | + <packaging>bundle</packaging> | ||
31 | + | ||
32 | + <description>ONOS Pcep controller subsystem API</description> | ||
33 | + | ||
34 | + <dependencies> | ||
35 | + <dependency> | ||
36 | + <groupId>org.onosproject</groupId> | ||
37 | + <artifactId>onos-pcepio</artifactId> | ||
38 | + </dependency> | ||
39 | + <dependency> | ||
40 | + <groupId>io.netty</groupId> | ||
41 | + <artifactId>netty</artifactId> | ||
42 | + </dependency> | ||
43 | + <dependency> | ||
44 | + <groupId>org.onosproject</groupId> | ||
45 | + <artifactId>onos-api</artifactId> | ||
46 | + </dependency> | ||
47 | + <dependency> | ||
48 | + <groupId>org.onosproject</groupId> | ||
49 | + <artifactId>onlab-misc</artifactId> | ||
50 | + </dependency> | ||
51 | + | ||
52 | + </dependencies> | ||
53 | + | ||
54 | + <build> | ||
55 | + <plugins> | ||
56 | + <plugin> | ||
57 | + <groupId>org.apache.maven.plugins</groupId> | ||
58 | + <artifactId>maven-shade-plugin</artifactId> | ||
59 | + <version>2.3</version> | ||
60 | + <configuration> | ||
61 | + <artifactSet> | ||
62 | + <excludes> | ||
63 | + <exclude>io.netty:netty</exclude> | ||
64 | + <exclude>com.google.guava:guava</exclude> | ||
65 | + <exclude>org.slf4j:slfj-api</exclude> | ||
66 | + <exclude>ch.qos.logback:logback-core</exclude> | ||
67 | + <exclude>ch.qos.logback:logback-classic</exclude> | ||
68 | + <exclude>com.google.code.findbugs:annotations</exclude> | ||
69 | + </excludes> | ||
70 | + </artifactSet> | ||
71 | + </configuration> | ||
72 | + <executions> | ||
73 | + <execution> | ||
74 | + <phase>package</phase> | ||
75 | + <goals> | ||
76 | + <goal>shade</goal> | ||
77 | + </goals> | ||
78 | + </execution> | ||
79 | + </executions> | ||
80 | + </plugin> | ||
81 | + <plugin> | ||
82 | + <groupId>org.apache.felix</groupId> | ||
83 | + <artifactId>maven-bundle-plugin</artifactId> | ||
84 | + <configuration> | ||
85 | + <instructions> | ||
86 | + <Export-Package> | ||
87 | + org.onosproject.pcep.*,org.onosproject.pcepio.* | ||
88 | + </Export-Package> | ||
89 | + </instructions> | ||
90 | + </configuration> | ||
91 | + </plugin> | ||
92 | + </plugins> | ||
93 | + </build> | ||
94 | + | ||
95 | +</project> |
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 | +package org.onosproject.pcep.controller; | ||
17 | + | ||
18 | +import static com.google.common.base.Preconditions.checkArgument; | ||
19 | +import java.net.URI; | ||
20 | +import java.net.URISyntaxException; | ||
21 | +import java.util.Objects; | ||
22 | + | ||
23 | +import org.onlab.packet.IpAddress; | ||
24 | + | ||
25 | +/** | ||
26 | + * The class representing a network client pc ip. | ||
27 | + * This class is immutable. | ||
28 | + */ | ||
29 | +public final class PccId { | ||
30 | + | ||
31 | + private static final String SCHEME = "pcep"; | ||
32 | + private static final long UNKNOWN = 0; | ||
33 | + private final IpAddress ipAddress; | ||
34 | + | ||
35 | + /** | ||
36 | + * Private constructor. | ||
37 | + */ | ||
38 | + private PccId(IpAddress ipAddress) { | ||
39 | + this.ipAddress = ipAddress; | ||
40 | + } | ||
41 | + | ||
42 | + /** | ||
43 | + * Create a PccId from ip address. | ||
44 | + * | ||
45 | + * @param ipAddress IP address | ||
46 | + * @return ipAddress | ||
47 | + */ | ||
48 | + public static PccId pccId(IpAddress ipAddress) { | ||
49 | + return new PccId(ipAddress); | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * Returns the ip address. | ||
54 | + * | ||
55 | + * @return ipAddress | ||
56 | + */ | ||
57 | + public IpAddress ipAddress() { | ||
58 | + return ipAddress; | ||
59 | + } | ||
60 | + | ||
61 | + /** | ||
62 | + * Convert the PccId value to a ':' separated hexadecimal string. | ||
63 | + * | ||
64 | + * @return the PccId value as a ':' separated hexadecimal string. | ||
65 | + */ | ||
66 | + @Override | ||
67 | + public String toString() { | ||
68 | + return ipAddress.toString(); | ||
69 | + } | ||
70 | + | ||
71 | + @Override | ||
72 | + public boolean equals(Object other) { | ||
73 | + if (!(other instanceof PccId)) { | ||
74 | + return false; | ||
75 | + } | ||
76 | + | ||
77 | + PccId otherPccid = (PccId) other; | ||
78 | + return Objects.equals(ipAddress, otherPccid.ipAddress); | ||
79 | + } | ||
80 | + | ||
81 | + @Override | ||
82 | + public int hashCode() { | ||
83 | + return Objects.hash(ipAddress); | ||
84 | + } | ||
85 | + | ||
86 | + /** | ||
87 | + * Returns PccId created from the given client URI. | ||
88 | + * | ||
89 | + * @param uri device URI | ||
90 | + * @return pccid | ||
91 | + */ | ||
92 | + public static PccId pccid(URI uri) { | ||
93 | + checkArgument(uri.getScheme().equals(SCHEME), "Unsupported URI scheme"); | ||
94 | + return new PccId(IpAddress.valueOf(uri.getSchemeSpecificPart())); | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * Produces client URI from the given DPID. | ||
99 | + * | ||
100 | + * @param pccid client pccid | ||
101 | + * @return client URI | ||
102 | + */ | ||
103 | + public static URI uri(PccId pccid) { | ||
104 | + return uri(pccid.ipAddress()); | ||
105 | + } | ||
106 | + | ||
107 | + /** | ||
108 | + * Produces client URI from the given ip address. | ||
109 | + * | ||
110 | + * @param ipAddress ip of client | ||
111 | + * @return client URI | ||
112 | + */ | ||
113 | + public static URI uri(IpAddress ipAddress) { | ||
114 | + try { | ||
115 | + return new URI(SCHEME, ipAddress.toString(), null); | ||
116 | + } catch (URISyntaxException e) { | ||
117 | + return null; | ||
118 | + } | ||
119 | + } | ||
120 | +} |
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 | +package org.onosproject.pcep.controller; | ||
17 | + | ||
18 | +import java.util.List; | ||
19 | + | ||
20 | +import org.onosproject.pcepio.protocol.PcepFactory; | ||
21 | +import org.onosproject.pcepio.protocol.PcepMessage; | ||
22 | + | ||
23 | +/** | ||
24 | + * Represents to provider facing side of a path computation client(pcc). | ||
25 | + */ | ||
26 | +public interface PcepClient { | ||
27 | + | ||
28 | + /** | ||
29 | + * Writes the message to the driver. | ||
30 | + * | ||
31 | + * @param msg the message to write | ||
32 | + */ | ||
33 | + public void sendMessage(PcepMessage msg); | ||
34 | + | ||
35 | + /** | ||
36 | + * Writes the PcepMessage list to the driver. | ||
37 | + * | ||
38 | + * @param msgs the messages to be written | ||
39 | + */ | ||
40 | + public void sendMessage(List<PcepMessage> msgs); | ||
41 | + | ||
42 | + /** | ||
43 | + * Handle a message from the pcc. | ||
44 | + * | ||
45 | + * @param fromClient the message to handle | ||
46 | + */ | ||
47 | + public void handleMessage(PcepMessage fromClient); | ||
48 | + | ||
49 | + /** | ||
50 | + * Provides the factory for this PCEP version. | ||
51 | + * | ||
52 | + * @return PCEP version specific factory. | ||
53 | + */ | ||
54 | + public PcepFactory factory(); | ||
55 | + | ||
56 | + /** | ||
57 | + * Gets a string version of the ID for this pcc. | ||
58 | + * | ||
59 | + * @return string version of the ID | ||
60 | + */ | ||
61 | + public String getStringId(); | ||
62 | + | ||
63 | + /** | ||
64 | + * Gets the ipAddress of the client. | ||
65 | + * | ||
66 | + * @return the client pccId in IPAddress format | ||
67 | + */ | ||
68 | + public PccId getPccId(); | ||
69 | + | ||
70 | + /** | ||
71 | + * Checks if the pcc is still connected. | ||
72 | + * | ||
73 | + * @return true if client is connected, false otherwise | ||
74 | + */ | ||
75 | + public boolean isConnected(); | ||
76 | + | ||
77 | + /** | ||
78 | + * Disconnects the pcc by closing the TCP connection. Results in a call | ||
79 | + * to the channel handler's channelDisconnected method for cleanup. | ||
80 | + */ | ||
81 | + public void disconnectClient(); | ||
82 | + | ||
83 | + /** | ||
84 | + * Indicates if this pcc is optical. | ||
85 | + * | ||
86 | + * @return true if optical | ||
87 | + */ | ||
88 | + public boolean isOptical(); | ||
89 | + | ||
90 | + /** | ||
91 | + * Identifies the channel used to communicate with the pcc. | ||
92 | + * | ||
93 | + * @return string representation of the connection to the client | ||
94 | + */ | ||
95 | + public String channelId(); | ||
96 | + | ||
97 | + /** | ||
98 | + * To set the status of state synchronization. | ||
99 | + * | ||
100 | + * @param value to set the synchronization status | ||
101 | + */ | ||
102 | + public void setIsSyncComplete(boolean value); | ||
103 | + | ||
104 | + /** | ||
105 | + * Indicates the state synchronization status of this pcc. | ||
106 | + * | ||
107 | + * @return true/false if the synchronization is completed/not completed | ||
108 | + */ | ||
109 | + public boolean isSyncComplete(); | ||
110 | +} |
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 | +package org.onosproject.pcep.controller; | ||
17 | + | ||
18 | +import java.util.List; | ||
19 | + | ||
20 | +import org.onosproject.pcepio.protocol.PcepMessage; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an Pcep controller. Serves as a one stop | ||
24 | + * shop for obtaining Pcep devices and (un)register listeners | ||
25 | + * on pcep events | ||
26 | + */ | ||
27 | +public interface PcepClientController { | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns list of pcc clients connected to this Pcep controller. | ||
31 | + * | ||
32 | + * @return list of PcepClient elements | ||
33 | + */ | ||
34 | + public List<PcepClient> getClients(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Returns the actual pcc client for the given ip address. | ||
38 | + * | ||
39 | + * @param pccId the id of the pcc client to fetch | ||
40 | + * @return the interface to this pcc client | ||
41 | + */ | ||
42 | + public PcepClient getClient(PccId pccId); | ||
43 | + | ||
44 | + /** | ||
45 | + * Register a listener for meta events that occur to pcep | ||
46 | + * devices. | ||
47 | + * | ||
48 | + * @param listener the listener to notify | ||
49 | + */ | ||
50 | + public void addListener(PcepClientListener listener); | ||
51 | + | ||
52 | + /** | ||
53 | + * Unregister a listener. | ||
54 | + * | ||
55 | + * @param listener the listener to unregister | ||
56 | + */ | ||
57 | + public void removeListener(PcepClientListener listener); | ||
58 | + | ||
59 | + /** | ||
60 | + * Register a listener for OF msg events. | ||
61 | + * | ||
62 | + * @param listener the listener to notify | ||
63 | + */ | ||
64 | + public void addEventListener(PcepEventListener listener); | ||
65 | + | ||
66 | + /** | ||
67 | + * Unregister a listener. | ||
68 | + * | ||
69 | + * @param listener the listener to unregister | ||
70 | + */ | ||
71 | + public void removeEventListener(PcepEventListener listener); | ||
72 | + | ||
73 | + /** | ||
74 | + * Send a message to a particular pcc client. | ||
75 | + * | ||
76 | + * @param pccId the id of the client to send message. | ||
77 | + * @param msg the message to send | ||
78 | + */ | ||
79 | + public void writeMessage(PccId pccId, PcepMessage msg); | ||
80 | + | ||
81 | + /** | ||
82 | + * Process a message and notify the appropriate listeners. | ||
83 | + * | ||
84 | + * @param pccId id of the client the message arrived on | ||
85 | + * @param msg the message to process. | ||
86 | + */ | ||
87 | + public void processClientMessage(PccId pccId, PcepMessage msg); | ||
88 | + | ||
89 | + /** | ||
90 | + * Close all connected PCC clients. | ||
91 | + */ | ||
92 | + public void closeConnectedClients(); | ||
93 | +} |
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 | +package org.onosproject.pcep.controller; | ||
17 | + | ||
18 | +/** | ||
19 | + * Allows for providers interested in PCC client events to be notified. | ||
20 | + */ | ||
21 | +public interface PcepClientListener { | ||
22 | + | ||
23 | + /** | ||
24 | + * Notify that the PCC was connected. | ||
25 | + * | ||
26 | + * @param pccId the id of the client that connected | ||
27 | + */ | ||
28 | + public void clientConnected(PccId pccId); | ||
29 | + | ||
30 | + /** | ||
31 | + * Notify that the PCC was disconnected. | ||
32 | + * | ||
33 | + * @param pccId the id of the client that disconnected. | ||
34 | + */ | ||
35 | + public void clientDisconnected(PccId pccId); | ||
36 | +} |
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 | +package org.onosproject.pcep.controller; | ||
17 | + | ||
18 | +import org.onosproject.pcepio.protocol.PcepMessage; | ||
19 | +/** | ||
20 | + * Notifies providers about pcep msg events. | ||
21 | + */ | ||
22 | +public interface PcepEventListener { | ||
23 | + | ||
24 | + /** | ||
25 | + * Handles the message event. | ||
26 | + * | ||
27 | + * @param pccId id of the pcc | ||
28 | + * @param msg the message | ||
29 | + */ | ||
30 | + public void handleMessage(PccId pccId, PcepMessage msg); | ||
31 | +} |
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 | +package org.onosproject.pcep.controller; | ||
17 | + | ||
18 | +/** | ||
19 | + * The representation for PCEP packet statistics. | ||
20 | + */ | ||
21 | +public interface PcepPacketStats { | ||
22 | + | ||
23 | + /** | ||
24 | + * Returns the count for no of packets sent out. | ||
25 | + * | ||
26 | + * @return int value of no of packets sent | ||
27 | + */ | ||
28 | + public int outPacketCount(); | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns the count for no of packets received. | ||
32 | + * | ||
33 | + * @return int value of no of packets sent | ||
34 | + */ | ||
35 | + public int inPacketCount(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Returns the count for no of wrong packets received. | ||
39 | + * | ||
40 | + * @return int value of no of wrong packets received | ||
41 | + */ | ||
42 | + public int wrongPacketCount(); | ||
43 | + | ||
44 | + /** | ||
45 | + * Returns the time value. | ||
46 | + * | ||
47 | + * @return long value of time | ||
48 | + */ | ||
49 | + public long getTime(); | ||
50 | + | ||
51 | + /** | ||
52 | + * Sets the time value. | ||
53 | + * | ||
54 | + * @param time long value of time | ||
55 | + */ | ||
56 | + public void setTime(long time); | ||
57 | + | ||
58 | +} |
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 | +package org.onosproject.pcep.controller.driver; | ||
17 | + | ||
18 | +import org.onosproject.pcep.controller.PccId; | ||
19 | +import org.onosproject.pcep.controller.PcepClient; | ||
20 | +import org.onosproject.pcepio.protocol.PcepMessage; | ||
21 | + | ||
22 | +/** | ||
23 | + * Responsible for keeping track of the current set Pcep clients | ||
24 | + * connected to the system. | ||
25 | + * | ||
26 | + */ | ||
27 | +public interface PcepAgent { | ||
28 | + | ||
29 | + /** | ||
30 | + * Add a pcc client that has just connected to the system. | ||
31 | + * | ||
32 | + * @param pccId the id of pcc client to add | ||
33 | + * @param pc the actual pce client object. | ||
34 | + * @return true if added, false otherwise. | ||
35 | + */ | ||
36 | + public boolean addConnectedClient(PccId pccId, PcepClient pc); | ||
37 | + | ||
38 | + /** | ||
39 | + * Checks if the activation for this pcc client is valid. | ||
40 | + * | ||
41 | + * @param pccId the id of pcc client to check | ||
42 | + * @return true if valid, false otherwise | ||
43 | + */ | ||
44 | + public boolean validActivation(PccId pccId); | ||
45 | + | ||
46 | + /** | ||
47 | + * Clear all state in controller client maps for a pcc client that has | ||
48 | + * disconnected from the local controller. Also release control for | ||
49 | + * that pccIds client from the global repository. Notify client listeners. | ||
50 | + * | ||
51 | + * @param pccIds the id of pcc client to remove. | ||
52 | + */ | ||
53 | + public void removeConnectedClient(PccId pccIds); | ||
54 | + | ||
55 | + /** | ||
56 | + * Process a message coming from a pcc client. | ||
57 | + * | ||
58 | + * @param pccId the id of pcc client the message was received. | ||
59 | + * @param m the message to process | ||
60 | + */ | ||
61 | + public void processPcepMessage(PccId pccId, PcepMessage m); | ||
62 | + | ||
63 | +} |
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 | +package org.onosproject.pcep.controller.driver; | ||
17 | + | ||
18 | +import org.jboss.netty.channel.Channel; | ||
19 | +import org.onosproject.pcep.controller.PccId; | ||
20 | +import org.onosproject.pcep.controller.PcepClient; | ||
21 | +import org.onosproject.pcep.controller.PcepPacketStats; | ||
22 | +import org.onosproject.pcepio.protocol.PcepVersion; | ||
23 | + | ||
24 | + | ||
25 | +/** | ||
26 | + * Represents the driver side of an Path computation client(pcc). | ||
27 | + * | ||
28 | + */ | ||
29 | +public interface PcepClientDriver extends PcepClient { | ||
30 | + | ||
31 | + /** | ||
32 | + * Sets the Pcep agent to be used. This method | ||
33 | + * can only be called once. | ||
34 | + * | ||
35 | + * @param agent the agent to set. | ||
36 | + */ | ||
37 | + public void setAgent(PcepAgent agent); | ||
38 | + | ||
39 | + /** | ||
40 | + * Announce to the Pcep agent that this pcc client has connected. | ||
41 | + * | ||
42 | + * @return true if successful, false if duplicate switch. | ||
43 | + */ | ||
44 | + public boolean connectClient(); | ||
45 | + | ||
46 | + /** | ||
47 | + * Remove this pcc client from the Pcep agent. | ||
48 | + */ | ||
49 | + public void removeConnectedClient(); | ||
50 | + | ||
51 | + /** | ||
52 | + * Sets the PCEP version for this pcc. | ||
53 | + * | ||
54 | + * @param pcepVersion the version to set. | ||
55 | + */ | ||
56 | + public void setPcVersion(PcepVersion pcepVersion); | ||
57 | + | ||
58 | + /** | ||
59 | + * Sets the associated Netty channel for this pcc. | ||
60 | + * | ||
61 | + * @param channel the Netty channel | ||
62 | + */ | ||
63 | + public void setChannel(Channel channel); | ||
64 | + | ||
65 | + | ||
66 | + /** | ||
67 | + * Sets the keep alive time for this pcc. | ||
68 | + * | ||
69 | + * @param keepAliveTime the keep alive time to set. | ||
70 | + */ | ||
71 | + public void setPcKeepAliveTime(byte keepAliveTime); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets the dead time for this pcc. | ||
75 | + * | ||
76 | + * @param deadTime the dead timer value to set. | ||
77 | + */ | ||
78 | + public void setPcDeadTime(byte deadTime); | ||
79 | + | ||
80 | + /** | ||
81 | + * Sets the session id for this pcc. | ||
82 | + * | ||
83 | + * @param sessionId the session id value to set. | ||
84 | + */ | ||
85 | + public void setPcSessionId(byte sessionId); | ||
86 | + | ||
87 | + /** | ||
88 | + * Sets whether the pcc is connected. | ||
89 | + * | ||
90 | + * @param connected whether the pcc is connected | ||
91 | + */ | ||
92 | + public void setConnected(boolean connected); | ||
93 | + | ||
94 | + /** | ||
95 | + * Initializes the behavior. | ||
96 | + * | ||
97 | + * @param pccId id of pcc | ||
98 | + * @param pcepVersion Pcep version | ||
99 | + * @param pktStats Pcep Packet Stats | ||
100 | + */ | ||
101 | + void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats); | ||
102 | + | ||
103 | + /** | ||
104 | + * Checks whether the handshake is complete. | ||
105 | + * | ||
106 | + * @return true is finished, false if not. | ||
107 | + */ | ||
108 | + boolean isHandshakeComplete(); | ||
109 | + | ||
110 | +} |
pcep/api/src/main/java/org/onosproject/pcep/controller/driver/PcepClientDriverFactory.java
0 → 100755
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 | +package org.onosproject.pcep.controller.driver; | ||
17 | + | ||
18 | +import org.onlab.packet.IpAddress; | ||
19 | +import org.onosproject.pcepio.protocol.PcepVersion; | ||
20 | + | ||
21 | +/** | ||
22 | + * Pcc Client factory which returns concrete pcc client objects for the | ||
23 | + * physical pcc client in use. | ||
24 | + * | ||
25 | + */ | ||
26 | +public interface PcepClientDriverFactory { | ||
27 | + | ||
28 | + | ||
29 | + /** | ||
30 | + * Constructs the real Pcep Client representation. | ||
31 | + * | ||
32 | + * @param pccIpAddress the ip address for this pcc client. | ||
33 | + * @param pcepVersion the Pcep version in use | ||
34 | + * @return the Pcep client representation. | ||
35 | + */ | ||
36 | + public PcepClientDriver getPcepClientImpl(IpAddress pccIpAddress, | ||
37 | + PcepVersion pcepVersion); | ||
38 | +} |
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 | + | ||
17 | +/** | ||
18 | + * PCEP controller driver API. | ||
19 | + */ | ||
20 | +package org.onosproject.pcep.controller.driver; |
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 | + | ||
17 | +/** | ||
18 | + * PCEP controller API. | ||
19 | + */ | ||
20 | +package org.onosproject.pcep.controller; |
pcep/pcepio/pom.xml
0 → 100755
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <groupId>org.onosproject</groupId> | ||
24 | + <artifactId>onos-pcep-controller</artifactId> | ||
25 | + <version>1.3.0-SNAPSHOT</version> | ||
26 | + <relativePath>../pom.xml</relativePath> | ||
27 | + </parent> | ||
28 | + | ||
29 | + <artifactId>onos-pcepio</artifactId> | ||
30 | + <packaging>bundle</packaging> | ||
31 | + | ||
32 | + <description>ONOS Pcepio Protocol subsystem</description> | ||
33 | + | ||
34 | + | ||
35 | + <dependencies> | ||
36 | + <dependency> | ||
37 | + <groupId>org.onosproject</groupId> | ||
38 | + <artifactId>onos-api</artifactId> | ||
39 | + </dependency> | ||
40 | + <dependency> | ||
41 | + <groupId>org.onosproject</groupId> | ||
42 | + <artifactId>onlab-osgi</artifactId> | ||
43 | + </dependency> | ||
44 | + | ||
45 | + <dependency> | ||
46 | + <groupId>com.fasterxml.jackson.core</groupId> | ||
47 | + <artifactId>jackson-databind</artifactId> | ||
48 | + </dependency> | ||
49 | + <dependency> | ||
50 | + <groupId>com.fasterxml.jackson.core</groupId> | ||
51 | + <artifactId>jackson-annotations</artifactId> | ||
52 | + </dependency> | ||
53 | + | ||
54 | + <dependency> | ||
55 | + <groupId>org.osgi</groupId> | ||
56 | + <artifactId>org.osgi.core</artifactId> | ||
57 | + </dependency> | ||
58 | + <dependency> | ||
59 | + <groupId>org.apache.karaf.shell</groupId> | ||
60 | + <artifactId>org.apache.karaf.shell.console</artifactId> | ||
61 | + </dependency> | ||
62 | + <dependency> | ||
63 | + <groupId>org.apache.felix</groupId> | ||
64 | + <artifactId>org.apache.felix.scr.annotations</artifactId> | ||
65 | + </dependency> | ||
66 | + </dependencies> | ||
67 | + | ||
68 | + <build> | ||
69 | + <plugins> | ||
70 | + <plugin> | ||
71 | + <groupId>org.apache.felix</groupId> | ||
72 | + <artifactId>maven-bundle-plugin</artifactId> | ||
73 | + </plugin> | ||
74 | + </plugins> | ||
75 | + </build> | ||
76 | + | ||
77 | +</project> |
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 | + | ||
17 | +package org.onosproject.pcepio.exceptions; | ||
18 | + | ||
19 | +/** | ||
20 | + * Custom Exception for PCEP IO. | ||
21 | + */ | ||
22 | +public class PcepParseException extends Exception { | ||
23 | + | ||
24 | + private static final long serialVersionUID = 7960991379951448423L; | ||
25 | + private byte errType = 0; | ||
26 | + private byte errValue = 0; | ||
27 | + | ||
28 | + /** | ||
29 | + * Default constructor to create a new exception. | ||
30 | + */ | ||
31 | + public PcepParseException() { | ||
32 | + super(); | ||
33 | + } | ||
34 | + | ||
35 | + /** | ||
36 | + * Constructor to create exception from message and cause. | ||
37 | + * | ||
38 | + * @param message the detail of exception in string | ||
39 | + * @param cause underlying cause of the error | ||
40 | + */ | ||
41 | + public PcepParseException(final String message, final Throwable cause) { | ||
42 | + super(message, cause); | ||
43 | + } | ||
44 | + | ||
45 | + /** | ||
46 | + * Constructor to create exception from message. | ||
47 | + * | ||
48 | + * @param message the detail of exception in string | ||
49 | + */ | ||
50 | + public PcepParseException(final String message) { | ||
51 | + super(message); | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * Constructor to create exception from error type and error value. | ||
56 | + * | ||
57 | + * @param errType error type of pcep | ||
58 | + * @param errValue error value of pcep | ||
59 | + */ | ||
60 | + public PcepParseException(final byte errType, final byte errValue) { | ||
61 | + super(); | ||
62 | + this.errType = errType; | ||
63 | + this.errValue = errValue; | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * Constructor to create exception from cause. | ||
68 | + * | ||
69 | + * @param cause underlying cause of the error | ||
70 | + */ | ||
71 | + public PcepParseException(final Throwable cause) { | ||
72 | + super(cause); | ||
73 | + } | ||
74 | + | ||
75 | + /** | ||
76 | + * Returns error type for this exception. | ||
77 | + * | ||
78 | + * @return ErrorType | ||
79 | + */ | ||
80 | + public byte getErrorType() { | ||
81 | + return this.errType; | ||
82 | + } | ||
83 | + | ||
84 | + /** | ||
85 | + * Returns error value for this exception. | ||
86 | + * | ||
87 | + * @return ErrorValue | ||
88 | + */ | ||
89 | + public byte getErrorValue() { | ||
90 | + return this.errValue; | ||
91 | + } | ||
92 | +} |
pcep/pcepio/src/main/java/org/onosproject/pcepio/exceptions/PcepTunnelAttributeException.java
0 → 100755
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 | + | ||
17 | +package org.onosproject.pcepio.exceptions; | ||
18 | + | ||
19 | +/** | ||
20 | + * Custom exception for Tunnel Attributes. | ||
21 | + */ | ||
22 | +public class PcepTunnelAttributeException extends Exception { | ||
23 | + | ||
24 | + private static final long serialVersionUID = 7860981378961458434L; | ||
25 | + | ||
26 | + /** | ||
27 | + * Default constructor to create a new exception. | ||
28 | + */ | ||
29 | + public PcepTunnelAttributeException() { | ||
30 | + super(); | ||
31 | + } | ||
32 | + | ||
33 | + /** | ||
34 | + * Constructor to create exception from message and cause. | ||
35 | + * | ||
36 | + * @param message the detail of exception in string | ||
37 | + * @param cause underlying cause of the error | ||
38 | + */ | ||
39 | + public PcepTunnelAttributeException(final String message, final Throwable cause) { | ||
40 | + super(message, cause); | ||
41 | + } | ||
42 | + | ||
43 | + /** | ||
44 | + * Constructor to create exception from message. | ||
45 | + * | ||
46 | + * @param message the detail of exception in string | ||
47 | + */ | ||
48 | + public PcepTunnelAttributeException(final String message) { | ||
49 | + super(message); | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * Constructor to create exception from cause. | ||
54 | + * | ||
55 | + * @param cause underlying cause of the error | ||
56 | + */ | ||
57 | + public PcepTunnelAttributeException(final Throwable cause) { | ||
58 | + super(cause); | ||
59 | + } | ||
60 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
20 | + | ||
21 | +/** | ||
22 | + * Abstraction of an entity Provides PcInitiatedLspRequest for PCEP Initiate message. | ||
23 | + * Reference : PCE initiated tunnel setup draft-ietf-pce-pce-initiated-lsp-03. | ||
24 | + */ | ||
25 | +public interface PcInitiatedLspRequest { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns object of PcepSrpObject. | ||
29 | + * | ||
30 | + * @return srpObject PCEP SRP object | ||
31 | + */ | ||
32 | + PcepSrpObject getSrpObject(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Returns object of PcepLspObject. | ||
36 | + * | ||
37 | + * @return lspObject PCEP LSP object | ||
38 | + */ | ||
39 | + PcepLspObject getLspObject(); | ||
40 | + | ||
41 | + /** | ||
42 | + * Returns object of PcepEndPointsObject. | ||
43 | + * | ||
44 | + * @return endPointsObject PCEP EndPoints object | ||
45 | + */ | ||
46 | + PcepEndPointsObject getEndPointsObject(); | ||
47 | + | ||
48 | + /** | ||
49 | + * Returns object of PcepEroObject. | ||
50 | + * | ||
51 | + * @return eroObject PCEP ERO object | ||
52 | + */ | ||
53 | + PcepEroObject getEroObject(); | ||
54 | + | ||
55 | + /** | ||
56 | + * Returns object of PcepAttribute. | ||
57 | + * | ||
58 | + * @return pcepAttribute PCEP Attributes | ||
59 | + */ | ||
60 | + PcepAttribute getPcepAttribute(); | ||
61 | + | ||
62 | + /** | ||
63 | + * Sets PcepSrpObject. | ||
64 | + * | ||
65 | + * @param srpobj PCEP SRP object | ||
66 | + */ | ||
67 | + void setSrpObject(PcepSrpObject srpobj); | ||
68 | + | ||
69 | + /** | ||
70 | + * Sets PcepLspObject. | ||
71 | + * | ||
72 | + * @param lspObject PCEP LSP object | ||
73 | + */ | ||
74 | + void setLspObject(PcepLspObject lspObject); | ||
75 | + | ||
76 | + /** | ||
77 | + * Sets PcepEndPointsObject. | ||
78 | + * | ||
79 | + * @param endPointsObject PCEP EndPoints object | ||
80 | + */ | ||
81 | + void setEndPointsObject(PcepEndPointsObject endPointsObject); | ||
82 | + | ||
83 | + /** | ||
84 | + * Sets PcepEroObject. | ||
85 | + * | ||
86 | + * @param eroObject PCEP ERO object | ||
87 | + */ | ||
88 | + void setEroObject(PcepEroObject eroObject); | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets PcepAttribute. | ||
92 | + * | ||
93 | + * @param pcepAttribute PCEP Attributes | ||
94 | + */ | ||
95 | + void setPcepAttribute(PcepAttribute pcepAttribute); | ||
96 | + | ||
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. | ||
104 | + */ | ||
105 | + public interface Builder { | ||
106 | + | ||
107 | + /** | ||
108 | + * Builds PcInitiatedLspRequest. | ||
109 | + * | ||
110 | + * @return PcInitiatedLspRequest | ||
111 | + * @throws PcepParseException when mandatory object is not set | ||
112 | + */ | ||
113 | + PcInitiatedLspRequest build() throws PcepParseException; | ||
114 | + | ||
115 | + /** | ||
116 | + * Returns object of PcepSrpObject. | ||
117 | + * | ||
118 | + * @return srpObject | ||
119 | + */ | ||
120 | + PcepSrpObject getSrpObject(); | ||
121 | + | ||
122 | + /** | ||
123 | + * Returns object of PcepLspObject. | ||
124 | + * | ||
125 | + * @return lspObject | ||
126 | + */ | ||
127 | + PcepLspObject getLspObject(); | ||
128 | + | ||
129 | + /** | ||
130 | + * Returns object of PcepEndPointsObject. | ||
131 | + * | ||
132 | + * @return endPointsObject | ||
133 | + */ | ||
134 | + PcepEndPointsObject getEndPointsObject(); | ||
135 | + | ||
136 | + /** | ||
137 | + * Returns object of PcepEroObject. | ||
138 | + * | ||
139 | + * @return eroObject | ||
140 | + */ | ||
141 | + PcepEroObject getEroObject(); | ||
142 | + | ||
143 | + /** | ||
144 | + * Returns object of PcepAttribute. | ||
145 | + * | ||
146 | + * @return pcepAttribute | ||
147 | + */ | ||
148 | + PcepAttribute getPcepAttribute(); | ||
149 | + | ||
150 | + /** | ||
151 | + * Sets PcepSrpObject. | ||
152 | + * | ||
153 | + * @param srpobj PCEP SRP Object | ||
154 | + * @return builder by setting PcepSrpObject | ||
155 | + */ | ||
156 | + Builder setSrpObject(PcepSrpObject srpobj); | ||
157 | + | ||
158 | + /** | ||
159 | + * Sets PcepLspObject. | ||
160 | + * | ||
161 | + * @param lspObject PCEP LSP Object | ||
162 | + * @return builder by setting PcepLspObject | ||
163 | + */ | ||
164 | + Builder setLspObject(PcepLspObject lspObject); | ||
165 | + | ||
166 | + /** | ||
167 | + * Sets PcepEndPointsObject. | ||
168 | + * | ||
169 | + * @param endPointsObject EndPoints Object | ||
170 | + * @return builder by setting PcepEndPointsObject | ||
171 | + */ | ||
172 | + Builder setEndPointsObject(PcepEndPointsObject endPointsObject); | ||
173 | + | ||
174 | + /** | ||
175 | + * Sets PcepEroObject. | ||
176 | + * | ||
177 | + * @param eroObject PCEP ERO Object | ||
178 | + * @return builder by setting PcepEroObject | ||
179 | + */ | ||
180 | + Builder setEroObject(PcepEroObject eroObject); | ||
181 | + | ||
182 | + /** | ||
183 | + * Sets PcepAttribute. | ||
184 | + * | ||
185 | + * @param pcepAttribute PCEP Attributes | ||
186 | + * @return builder by setting PcepAttribute | ||
187 | + */ | ||
188 | + Builder setPcepAttribute(PcepAttribute pcepAttribute); | ||
189 | + } | ||
190 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity which Provides List of PCEP Attributes. | ||
21 | + */ | ||
22 | +import java.util.LinkedList; | ||
23 | + | ||
24 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
25 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
26 | + | ||
27 | +public interface PcepAttribute { | ||
28 | + | ||
29 | + /** | ||
30 | + * writes lspa , bandwidth , Metriclist and Iro objects to the channel. | ||
31 | + * | ||
32 | + * @param bb of type channel buffer. | ||
33 | + * @return object length index. | ||
34 | + * @throws PcepParseException while writing objects to channel buffer | ||
35 | + */ | ||
36 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
37 | + | ||
38 | + /** | ||
39 | + * Returns PcepLspaObject. | ||
40 | + * | ||
41 | + * @return LspaObject | ||
42 | + */ | ||
43 | + PcepLspaObject getLspaObject(); | ||
44 | + | ||
45 | + /** | ||
46 | + * Returns PcepBandwidthObject. | ||
47 | + * | ||
48 | + * @return BandwidthObject | ||
49 | + */ | ||
50 | + PcepBandwidthObject getBandwidthObject(); | ||
51 | + | ||
52 | + /** | ||
53 | + * Returns PcepIroObject. | ||
54 | + * | ||
55 | + * @return iroObject | ||
56 | + */ | ||
57 | + PcepIroObject getIroObject(); | ||
58 | + | ||
59 | + /** | ||
60 | + * Sets the PcepBandwidthObject. | ||
61 | + * | ||
62 | + * @param bandwidthObject bandwidth object | ||
63 | + */ | ||
64 | + void setBandwidthObject(PcepBandwidthObject bandwidthObject); | ||
65 | + | ||
66 | + /** | ||
67 | + * Sets the PcepLspaObject. | ||
68 | + * | ||
69 | + * @param lspaObject lspa object | ||
70 | + */ | ||
71 | + void setLspaObject(PcepLspaObject lspaObject); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets the PcepIroObject. | ||
75 | + * | ||
76 | + * @param iroObject iro object | ||
77 | + */ | ||
78 | + void setIroObject(PcepIroObject iroObject); | ||
79 | + | ||
80 | + /** | ||
81 | + * Returns PcepMetricObject List. | ||
82 | + * | ||
83 | + * @return list of metric objects | ||
84 | + */ | ||
85 | + LinkedList<PcepMetricObject> getMetricObjectList(); | ||
86 | + | ||
87 | + /** | ||
88 | + * Sets PcepMetricObject List. | ||
89 | + * | ||
90 | + * @param llMetricList list of metric objects | ||
91 | + */ | ||
92 | + void setMetricObjectList(LinkedList<PcepMetricObject> llMetricList); | ||
93 | + | ||
94 | + /** | ||
95 | + * Prints the attributes of AttributeList. | ||
96 | + */ | ||
97 | + | ||
98 | + public void print(); | ||
99 | + | ||
100 | + /** | ||
101 | + * Builder interface with get and set functions to build PcepAttribute. | ||
102 | + */ | ||
103 | + public interface Builder { | ||
104 | + | ||
105 | + /** | ||
106 | + * Builds PcepAttribute. | ||
107 | + * | ||
108 | + * @return PcepAttribute | ||
109 | + */ | ||
110 | + PcepAttribute build(); | ||
111 | + | ||
112 | + /** | ||
113 | + * Returns PcepLspaObject. | ||
114 | + * | ||
115 | + * @return LspaObject | ||
116 | + */ | ||
117 | + PcepLspaObject getLspaObject(); | ||
118 | + | ||
119 | + /** | ||
120 | + * Returns PcepBandwidthObject. | ||
121 | + * | ||
122 | + * @return BandwidthObject | ||
123 | + */ | ||
124 | + PcepBandwidthObject getBandwidthObject(); | ||
125 | + | ||
126 | + /** | ||
127 | + * Returns PcepIroObject. | ||
128 | + * | ||
129 | + * @return iroObject | ||
130 | + */ | ||
131 | + PcepIroObject getIroObject(); | ||
132 | + | ||
133 | + /** | ||
134 | + * Sets the PcepBandwidthObject. | ||
135 | + * | ||
136 | + * @param bandwidthObject bandwidth object | ||
137 | + * @return Builder object for PcepAttrubute | ||
138 | + */ | ||
139 | + Builder setBandwidthObject(PcepBandwidthObject bandwidthObject); | ||
140 | + | ||
141 | + /** | ||
142 | + * Sets the PcepLspaObject. | ||
143 | + * | ||
144 | + * @param lspaObject lspa object | ||
145 | + * @return Builder object for PcepAttrubute | ||
146 | + */ | ||
147 | + Builder setLspaObject(PcepLspaObject lspaObject); | ||
148 | + | ||
149 | + /** | ||
150 | + * Sets the PcepIroObject. | ||
151 | + * | ||
152 | + * @param iroObject iro object | ||
153 | + * @return Builder object for PcepAttrubute | ||
154 | + */ | ||
155 | + Builder setIroObject(PcepIroObject iroObject); | ||
156 | + | ||
157 | + /** | ||
158 | + * Returns PcepMetricObject List. | ||
159 | + * | ||
160 | + * @return list of metric objects | ||
161 | + */ | ||
162 | + LinkedList<PcepMetricObject> getMetricObjectList(); | ||
163 | + | ||
164 | + /** | ||
165 | + * Sets PcepMetricObject List. | ||
166 | + * | ||
167 | + * @param llMetricList list of metric objects | ||
168 | + * @return Builder object for PcepAttrubute | ||
169 | + */ | ||
170 | + Builder setMetricObjectList(LinkedList<PcepMetricObject> llMetricList); | ||
171 | + } | ||
172 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
19 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
20 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Bandwidth Object. | ||
24 | + */ | ||
25 | +public interface PcepBandwidthObject { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns bandwidth value. | ||
29 | + * | ||
30 | + * @return bandwidth value | ||
31 | + */ | ||
32 | + int getBandwidth(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Sets bandwidth with specified value. | ||
36 | + * | ||
37 | + * @param iBandwidth Bandwidth's value | ||
38 | + */ | ||
39 | + void setBandwidth(int iBandwidth); | ||
40 | + | ||
41 | + /** | ||
42 | + * Prints attributes of bandwidth object. | ||
43 | + */ | ||
44 | + void print(); | ||
45 | + | ||
46 | + /** | ||
47 | + * Writes the BandwidthObject into channel buffer. | ||
48 | + * | ||
49 | + * @param bb channel buffer | ||
50 | + * @return Returns the writerIndex of this buffer | ||
51 | + * @throws PcepParseException if bandwidth object header fails to write in channel buffer | ||
52 | + */ | ||
53 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
54 | + | ||
55 | + /** | ||
56 | + * Builder interface with get and set functions to build bandwidth object. | ||
57 | + */ | ||
58 | + public interface Builder { | ||
59 | + | ||
60 | + /** | ||
61 | + * Builds BandwidthObject. | ||
62 | + * | ||
63 | + * @return BandwidthObject | ||
64 | + * @throws PcepParseException if build fails while creating PcepBandwidthObject | ||
65 | + */ | ||
66 | + PcepBandwidthObject build() throws PcepParseException; | ||
67 | + | ||
68 | + /** | ||
69 | + * Returns bandwidth object header. | ||
70 | + * | ||
71 | + * @return bandwidth object header | ||
72 | + */ | ||
73 | + PcepObjectHeader getBandwidthObjHeader(); | ||
74 | + | ||
75 | + /** | ||
76 | + * Sets bandwidth object header and returns its builder. | ||
77 | + * | ||
78 | + * @param obj Bandwidth object header | ||
79 | + * @return Builder by setting Bandwidth object header | ||
80 | + */ | ||
81 | + Builder setBandwidthObjHeader(PcepObjectHeader obj); | ||
82 | + | ||
83 | + /** | ||
84 | + * Returns bandwidth value. | ||
85 | + * | ||
86 | + * @return bandwidth | ||
87 | + */ | ||
88 | + int getBandwidth(); | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets bandwidth value and return its builder. | ||
92 | + * | ||
93 | + * @param iBandwidth bandwidth value | ||
94 | + * @return Builder by setting bandwidth | ||
95 | + */ | ||
96 | + Builder setBandwidth(int iBandwidth); | ||
97 | + | ||
98 | + /** | ||
99 | + * Sets P flag in Bandwidth object header and returns its builder. | ||
100 | + * | ||
101 | + * @param value boolean value to set P flag | ||
102 | + * @return Builder by setting P flag | ||
103 | + */ | ||
104 | + Builder setPFlag(boolean value); | ||
105 | + | ||
106 | + /** | ||
107 | + * Sets I flag in Bandwidth object header and returns its builder. | ||
108 | + * | ||
109 | + * @param value boolean value to set I flag | ||
110 | + * @return Builder by setting I flag | ||
111 | + */ | ||
112 | + Builder setIFlag(boolean value); | ||
113 | + } | ||
114 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
23 | +import org.onosproject.pcepio.types.PcepValueType; | ||
24 | + | ||
25 | +/** | ||
26 | + * Abstraction of an entity providing PCEP Close Message. | ||
27 | + */ | ||
28 | +public interface PcepCloseMsg extends PcepObject, PcepMessage { | ||
29 | + | ||
30 | + @Override | ||
31 | + PcepVersion getVersion(); | ||
32 | + | ||
33 | + @Override | ||
34 | + PcepType getType(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Returns reason field in Close message. | ||
38 | + * | ||
39 | + * @return reason field | ||
40 | + */ | ||
41 | + byte getReason(); | ||
42 | + | ||
43 | + /** | ||
44 | + * Sets reason field in Close message with specified value. | ||
45 | + * | ||
46 | + * @param value of Reason field | ||
47 | + */ | ||
48 | + void setReason(byte value); | ||
49 | + | ||
50 | + /** | ||
51 | + * Returns LinkedList of Optional Tlv in Close Message. | ||
52 | + * | ||
53 | + * @return list of optional tlv | ||
54 | + */ | ||
55 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
56 | + | ||
57 | + /** | ||
58 | + * Sets LinkedList of Optional Tlvs in Close Message. | ||
59 | + * | ||
60 | + * @param llOptionalTlv LinkedList of type PcepValueType | ||
61 | + */ | ||
62 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
63 | + | ||
64 | + @Override | ||
65 | + void writeTo(ChannelBuffer channelBuffer); | ||
66 | + | ||
67 | + /** | ||
68 | + * Builder interface with get and set functions to build Close message. | ||
69 | + */ | ||
70 | + public interface Builder extends PcepMessage.Builder { | ||
71 | + | ||
72 | + @Override | ||
73 | + PcepCloseMsg build(); | ||
74 | + | ||
75 | + @Override | ||
76 | + PcepVersion getVersion(); | ||
77 | + | ||
78 | + @Override | ||
79 | + PcepType getType(); | ||
80 | + | ||
81 | + /** | ||
82 | + * Returns Close Object header. | ||
83 | + * | ||
84 | + * @return Close Object header | ||
85 | + */ | ||
86 | + PcepObjectHeader getCloseObjHeader(); | ||
87 | + | ||
88 | + /** | ||
89 | + * Sets close object header and returns its builder. | ||
90 | + * | ||
91 | + * @param obj close object header | ||
92 | + * @return Builder by setting Close object header | ||
93 | + */ | ||
94 | + Builder setCloseObjHeader(PcepObjectHeader obj); | ||
95 | + | ||
96 | + /** | ||
97 | + * Returns reason field in Close message. | ||
98 | + * | ||
99 | + * @return reason field in Close message | ||
100 | + */ | ||
101 | + byte getReason(); | ||
102 | + | ||
103 | + /** | ||
104 | + * Sets reason field and return its builder. | ||
105 | + * | ||
106 | + * @param value of Reason field | ||
107 | + * @return builder by setting reason field | ||
108 | + */ | ||
109 | + Builder setReason(byte value); | ||
110 | + | ||
111 | + /** | ||
112 | + * Returns LinkedList of Optional Tlvs. | ||
113 | + * | ||
114 | + * @return list of optional tlv | ||
115 | + */ | ||
116 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
117 | + | ||
118 | + /** | ||
119 | + * Sets LinkedList of Optional Tlvs in Close Message. | ||
120 | + * | ||
121 | + * @param llOptionalTlv list of optional tlv | ||
122 | + * @return Builder by setting Optional Tlvs | ||
123 | + */ | ||
124 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
125 | + | ||
126 | + /** | ||
127 | + * Sets P flag in Close object header and returns its builder. | ||
128 | + * | ||
129 | + * @param value boolean value to set P flag | ||
130 | + * @return Builder by setting P flag | ||
131 | + */ | ||
132 | + Builder setPFlag(boolean value); | ||
133 | + | ||
134 | + /** | ||
135 | + * Sets I flag in Close object header and returns its builder. | ||
136 | + * | ||
137 | + * @param value boolean value to set I flag | ||
138 | + * @return Builder by setting I flag | ||
139 | + */ | ||
140 | + Builder setIFlag(boolean value); | ||
141 | + } | ||
142 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing PCEP End Points Object. | ||
25 | + */ | ||
26 | +public interface PcepEndPointsObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns Source IpAddress from End Points Object. | ||
30 | + * | ||
31 | + * @return Source IpAddress from End Points Object | ||
32 | + */ | ||
33 | + int getSourceIpAddress(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets Source IpAddress in End Points Object. | ||
37 | + * | ||
38 | + * @param sourceIpAddress Source IP Address | ||
39 | + */ | ||
40 | + void setSourceIpAddress(int sourceIpAddress); | ||
41 | + | ||
42 | + /** | ||
43 | + * Returns Destination IpAddress from End Points Object. | ||
44 | + * | ||
45 | + * @return Destination IpAddress from End Points Object | ||
46 | + */ | ||
47 | + int getDestIpAddress(); | ||
48 | + | ||
49 | + /** | ||
50 | + * Sets Destination IpAddress in End Points Object. | ||
51 | + * | ||
52 | + * @param destIpAddress Destination IP Address | ||
53 | + */ | ||
54 | + void setDestIpAddress(int destIpAddress); | ||
55 | + | ||
56 | + /** | ||
57 | + * Prints attributes of EndPoints object. | ||
58 | + */ | ||
59 | + void print(); | ||
60 | + | ||
61 | + /** | ||
62 | + * Writes the EndPointsObject into channel buffer. | ||
63 | + * | ||
64 | + * @param bb channel buffer | ||
65 | + * @return Returns the writerIndex of this buffer | ||
66 | + * @throws PcepParseException while writing EndPointObject into ChannelBuffer | ||
67 | + */ | ||
68 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
69 | + | ||
70 | + /** | ||
71 | + * Builder interface with get and set functions to build EndPoints object. | ||
72 | + */ | ||
73 | + public interface Builder { | ||
74 | + | ||
75 | + /** | ||
76 | + * Builds End Points Object. | ||
77 | + * | ||
78 | + * @return End Points Object | ||
79 | + * @throws PcepParseException while building EndPointObject | ||
80 | + */ | ||
81 | + PcepEndPointsObject build() throws PcepParseException; | ||
82 | + | ||
83 | + /** | ||
84 | + * Returns End Points Object header. | ||
85 | + * | ||
86 | + * @return End Points Object header | ||
87 | + */ | ||
88 | + PcepObjectHeader getEndPointsObjHeader(); | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets End Points Object header and returns its builder. | ||
92 | + * | ||
93 | + * @param obj End Points Object header | ||
94 | + * @return Builder by setting End Points Object header | ||
95 | + */ | ||
96 | + Builder setEndPointsObjHeader(PcepObjectHeader obj); | ||
97 | + | ||
98 | + /** | ||
99 | + * Returns Source IpAddress from End Points Object. | ||
100 | + * | ||
101 | + * @return Source IpAddress from End Points Object | ||
102 | + */ | ||
103 | + int getSourceIpAddress(); | ||
104 | + | ||
105 | + /** | ||
106 | + * Sets Source IpAddress in End Points Object and returns builder. | ||
107 | + * | ||
108 | + * @param sourceIpAddress Source IP Address | ||
109 | + * @return Builder by setting Source IpAddress in End Points Object | ||
110 | + */ | ||
111 | + Builder setSourceIpAddress(int sourceIpAddress); | ||
112 | + | ||
113 | + /** | ||
114 | + * Returns Destination IpAddress from End Points Object. | ||
115 | + * | ||
116 | + * @return Destination IpAddress from End Points Object | ||
117 | + */ | ||
118 | + int getDestIpAddress(); | ||
119 | + | ||
120 | + /** | ||
121 | + * Sets Destination IpAddress in End Points Object. | ||
122 | + * | ||
123 | + * @param destIpAddress Destination IP Address | ||
124 | + * @return Builder by setting Destination IpAddress in End Points Object | ||
125 | + */ | ||
126 | + Builder setDestIpAddress(int destIpAddress); | ||
127 | + | ||
128 | + /** | ||
129 | + * Sets P flag in Bandwidth object header and returns its builder. | ||
130 | + * | ||
131 | + * @param value boolean value to set P flag | ||
132 | + * @return Builder by setting P flag | ||
133 | + */ | ||
134 | + Builder setPFlag(boolean value); | ||
135 | + | ||
136 | + /** | ||
137 | + * Sets I flag in Bandwidth object header and returns its builder. | ||
138 | + * | ||
139 | + * @param value boolean value to set I flag | ||
140 | + * @return Builder by setting I flag | ||
141 | + */ | ||
142 | + Builder setIFlag(boolean value); | ||
143 | + } | ||
144 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
24 | +import org.onosproject.pcepio.types.PcepValueType; | ||
25 | + | ||
26 | +/** | ||
27 | + * Abstraction of an entity providing PCEP ERO Object. | ||
28 | + */ | ||
29 | +public interface PcepEroObject { | ||
30 | + | ||
31 | + /** | ||
32 | + * Return LinkedList of SubObjects of ERO Object. | ||
33 | + * | ||
34 | + * @return list of subobjects | ||
35 | + */ | ||
36 | + LinkedList<PcepValueType> getSubObjects(); | ||
37 | + | ||
38 | + /** | ||
39 | + * Sets LinkedList of SubObjects in ERO Object. | ||
40 | + * | ||
41 | + * @param llSubObjects list of subobjects | ||
42 | + */ | ||
43 | + void setSubObjects(LinkedList<PcepValueType> llSubObjects); | ||
44 | + | ||
45 | + /** | ||
46 | + * Writes the ERO Object into channel buffer. | ||
47 | + * | ||
48 | + * @param bb channel buffer | ||
49 | + * @return Returns the writerIndex of this buffer | ||
50 | + * @throws PcepParseException while writing ERO Object into ChannelBuffer | ||
51 | + */ | ||
52 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
53 | + | ||
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. | ||
61 | + */ | ||
62 | + public interface Builder { | ||
63 | + | ||
64 | + /** | ||
65 | + * Builds ERO Object. | ||
66 | + * | ||
67 | + * @return ERO Object | ||
68 | + */ | ||
69 | + PcepEroObject build(); | ||
70 | + | ||
71 | + /** | ||
72 | + * Returns ERO Object Header. | ||
73 | + * | ||
74 | + * @return ERO Object Header | ||
75 | + */ | ||
76 | + PcepObjectHeader getEroObjHeader(); | ||
77 | + | ||
78 | + /** | ||
79 | + * Sets ERO Object header and returns its builder. | ||
80 | + * | ||
81 | + * @param obj ERO Object header | ||
82 | + * @return Builder by setting ERO Object header | ||
83 | + */ | ||
84 | + Builder setEroObjHeader(PcepObjectHeader obj); | ||
85 | + | ||
86 | + /** | ||
87 | + * Returns LinkedList of SubObjects in ERO Objects. | ||
88 | + * | ||
89 | + * @return list of subobjects | ||
90 | + */ | ||
91 | + LinkedList<PcepValueType> getSubObjects(); | ||
92 | + | ||
93 | + /** | ||
94 | + * Sets LinkedList of SubObjects and returns its builder. | ||
95 | + * | ||
96 | + * @param llSubObjects list of SubObjects | ||
97 | + * @return Builder by setting list of SubObjects | ||
98 | + */ | ||
99 | + Builder setSubObjects(LinkedList<PcepValueType> llSubObjects); | ||
100 | + | ||
101 | + /** | ||
102 | + * Sets P flag in ERO object header and returns its builder. | ||
103 | + * | ||
104 | + * @param value boolean value to set P flag | ||
105 | + * @return Builder by setting P flag | ||
106 | + */ | ||
107 | + Builder setPFlag(boolean value); | ||
108 | + | ||
109 | + /** | ||
110 | + * Sets I flag in ERO object header and returns its builder. | ||
111 | + * | ||
112 | + * @param value boolean value to set I flag | ||
113 | + * @return Builder by setting I flag | ||
114 | + */ | ||
115 | + Builder setIFlag(boolean value); | ||
116 | + } | ||
117 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | + | ||
20 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
21 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity which provides PCEP error for PCEP error message. | ||
25 | + */ | ||
26 | +public interface PcepError { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns the PcepRPObject List. | ||
30 | + * | ||
31 | + * @return list of type PcepRPObject | ||
32 | + */ | ||
33 | + LinkedList<PcepRPObject> getRPObjList(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets the RP Objects lists. | ||
37 | + * | ||
38 | + * @param llRPObjList list of type PcepRPObject | ||
39 | + */ | ||
40 | + void setRPObjList(LinkedList<PcepRPObject> llRPObjList); | ||
41 | + | ||
42 | + /** | ||
43 | + * Returns the PcepTEObject List. | ||
44 | + * | ||
45 | + * @return list of type PcepTEObject | ||
46 | + */ | ||
47 | + LinkedList<PcepTEObject> getTEObjList(); | ||
48 | + | ||
49 | + /** | ||
50 | + * Sets the TE Objects lists. | ||
51 | + * | ||
52 | + * @param llTEObjList list of type PcepTEObject | ||
53 | + */ | ||
54 | + void setTEObjList(LinkedList<PcepTEObject> llTEObjList); | ||
55 | + | ||
56 | + /** | ||
57 | + * Returns the PcepErrorObject. | ||
58 | + * | ||
59 | + * @return list of type PcepErrorObject | ||
60 | + */ | ||
61 | + LinkedList<PcepErrorObject> getErrorObjList(); | ||
62 | + | ||
63 | + /** | ||
64 | + * Sets the Error Objects lists. | ||
65 | + * | ||
66 | + * @param llErrorObjList list of type PcepErrorObject | ||
67 | + */ | ||
68 | + public void setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList); | ||
69 | + | ||
70 | + /** | ||
71 | + * Writes the byte stream of PCEP error to the channel buffer. | ||
72 | + * | ||
73 | + * @param bb of type channel buffer | ||
74 | + * @return object length index | ||
75 | + * @throws PcepParseException while writing Error part into ChannelBuffer | ||
76 | + */ | ||
77 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
78 | + | ||
79 | + /** | ||
80 | + * Prints the attributes of PCEP Error. | ||
81 | + */ | ||
82 | + public void print(); | ||
83 | + | ||
84 | + /** | ||
85 | + * Builder interface with get and set functions to build PcepError. | ||
86 | + */ | ||
87 | + public interface Builder { | ||
88 | + | ||
89 | + /** | ||
90 | + * Builds PcepError Object. | ||
91 | + * | ||
92 | + * @return PcepError Object | ||
93 | + */ | ||
94 | + PcepError build(); | ||
95 | + | ||
96 | + /** | ||
97 | + * Returns the PcepRPObject. | ||
98 | + * | ||
99 | + * @return list of type PcepRPObject | ||
100 | + */ | ||
101 | + LinkedList<PcepRPObject> getRPObjList(); | ||
102 | + | ||
103 | + /** | ||
104 | + * Sets RP Object lists and returns its builder. | ||
105 | + * | ||
106 | + * @param llRPObjList list of type PcepRpObject | ||
107 | + * @return builder by setting Linked list of RP Object | ||
108 | + */ | ||
109 | + Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList); | ||
110 | + | ||
111 | + /** | ||
112 | + * Returns the PcepTEObject. | ||
113 | + * | ||
114 | + * @return llTEObjList of type PcepTEObject | ||
115 | + */ | ||
116 | + LinkedList<PcepTEObject> getTEObjList(); | ||
117 | + | ||
118 | + /** | ||
119 | + * Sets TE Object lists and returns its builder. | ||
120 | + * | ||
121 | + * @param llTEObjList list of type PcepTEObject | ||
122 | + * @return builder by setting list of type PcepTEObject | ||
123 | + */ | ||
124 | + Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList); | ||
125 | + | ||
126 | + /** | ||
127 | + * Returns the PcepErrorObject. | ||
128 | + * | ||
129 | + * @return list of type PcepErrorObject | ||
130 | + */ | ||
131 | + LinkedList<PcepErrorObject> getErrorObjList(); | ||
132 | + | ||
133 | + /** | ||
134 | + * Sets Error Object lists and returns its builder. | ||
135 | + * | ||
136 | + * @param llErrorObjList list of type PcepErrorObject | ||
137 | + * @return builder by setting list of type PcepErrorObject | ||
138 | + */ | ||
139 | + Builder setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList); | ||
140 | + } | ||
141 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | + | ||
20 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
21 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity which provides PCEP Error Info. | ||
25 | + * Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02. | ||
26 | + */ | ||
27 | +public interface PcepErrorInfo { | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns whether error info list is present or not. | ||
31 | + * | ||
32 | + * @return true if error info present, false otherwise | ||
33 | + */ | ||
34 | + public boolean isErrorInfoPresent(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Reads from channel buffer for TE and RP objects. | ||
38 | + * | ||
39 | + * @param bb of channel buffer | ||
40 | + * @throws PcepParseException while parsing Error info part. | ||
41 | + */ | ||
42 | + public void read(ChannelBuffer bb) throws PcepParseException; | ||
43 | + | ||
44 | + /** | ||
45 | + * Writes byte stream of PCEP error info to channel buffer. | ||
46 | + * | ||
47 | + * @param bb of type channel buffer | ||
48 | + * @throws PcepParseException while writing Error info part into Channel Buffer. | ||
49 | + */ | ||
50 | + public void write(ChannelBuffer bb) throws PcepParseException; | ||
51 | + | ||
52 | + /** | ||
53 | + * Prints the attributes of error info list. | ||
54 | + */ | ||
55 | + public void print(); | ||
56 | + | ||
57 | + /** | ||
58 | + * Returns Error Value in PCEP-ERROR Object. | ||
59 | + * | ||
60 | + * @return list of Error Value in PCEP-ERROR Object | ||
61 | + */ | ||
62 | + public LinkedList<Integer> getErrorValue(); | ||
63 | + | ||
64 | + /** | ||
65 | + * Returns Error Type in PCEP-ERROR Object. | ||
66 | + * | ||
67 | + * @return list of Error Type in PCEP-ERROR Object | ||
68 | + */ | ||
69 | + public LinkedList<Integer> getErrorType(); | ||
70 | + | ||
71 | + /** | ||
72 | + * Builder interface with get and set functions to build ErrorInfo. | ||
73 | + */ | ||
74 | + public interface Builder { | ||
75 | + | ||
76 | + /** | ||
77 | + * Builds ErrorInfo Object. | ||
78 | + * | ||
79 | + * @return ErrorInfo Object. | ||
80 | + */ | ||
81 | + PcepErrorInfo build(); | ||
82 | + | ||
83 | + /** | ||
84 | + * Returns list of PcepError. | ||
85 | + * | ||
86 | + * @return list of PcepError | ||
87 | + */ | ||
88 | + LinkedList<PcepError> getPcepErrorList(); | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets PcepError lists and returns its builder. | ||
92 | + * | ||
93 | + * @param llPcepErrorList list of PcepError | ||
94 | + * @return builder by setting list of PcepError. | ||
95 | + */ | ||
96 | + Builder setPcepErrorList(LinkedList<PcepError> llPcepErrorList); | ||
97 | + } | ||
98 | +} |
1 | +package org.onosproject.pcepio.protocol; | ||
2 | + | ||
3 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
4 | +import org.onosproject.pcepio.types.ErrorObjListWithOpen; | ||
5 | + | ||
6 | +/** | ||
7 | + * Abstraction of an entity providing PCEP Error Message. | ||
8 | + */ | ||
9 | +public interface PcepErrorMsg extends PcepMessage { | ||
10 | + | ||
11 | + @Override | ||
12 | + PcepVersion getVersion(); | ||
13 | + | ||
14 | + @Override | ||
15 | + PcepType getType(); | ||
16 | + | ||
17 | + /** | ||
18 | + * Returns Object of ErrorObjListWithOpen. | ||
19 | + * | ||
20 | + * @return Object of ErrorObjListWithOpen | ||
21 | + */ | ||
22 | + public ErrorObjListWithOpen getErrorObjListWithOpen(); | ||
23 | + | ||
24 | + /** | ||
25 | + * Sets errObjListWithOpen object. | ||
26 | + * | ||
27 | + * @param errObjListWithOpen error object List with open object | ||
28 | + */ | ||
29 | + public void setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen); | ||
30 | + | ||
31 | + /** | ||
32 | + * Returns Object of PcepErrorInfo. | ||
33 | + * | ||
34 | + * @return Object of PcepErrorInfo | ||
35 | + */ | ||
36 | + public PcepErrorInfo getPcepErrorInfo(); | ||
37 | + | ||
38 | + /** | ||
39 | + * Sets errInfo Object. | ||
40 | + * | ||
41 | + * @param errInfo error information | ||
42 | + */ | ||
43 | + public void setPcepErrorInfo(PcepErrorInfo errInfo); | ||
44 | + | ||
45 | + @Override | ||
46 | + void writeTo(ChannelBuffer channelBuffer); | ||
47 | + | ||
48 | + /** | ||
49 | + * Builder interface with get and set functions to build PCEP Error message. | ||
50 | + */ | ||
51 | + public interface Builder extends PcepMessage.Builder { | ||
52 | + | ||
53 | + @Override | ||
54 | + PcepErrorMsg build(); | ||
55 | + | ||
56 | + @Override | ||
57 | + PcepVersion getVersion(); | ||
58 | + | ||
59 | + @Override | ||
60 | + PcepType getType(); | ||
61 | + | ||
62 | + /** | ||
63 | + * Returns Object of ErrorObjListWithOpen. | ||
64 | + * | ||
65 | + * @return Object of ErrorObjListWithOpen | ||
66 | + */ | ||
67 | + public ErrorObjListWithOpen getErrorObjListWithOpen(); | ||
68 | + | ||
69 | + /** | ||
70 | + * Sets errObjListWithOpen object. | ||
71 | + * | ||
72 | + * @param errObjListWithOpen error object with open object | ||
73 | + * @return builder by setting Object of ErrorObjListWithOpen | ||
74 | + */ | ||
75 | + public Builder setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen); | ||
76 | + | ||
77 | + /** | ||
78 | + * Returns Object of PcepErrorInfo. | ||
79 | + * | ||
80 | + * @return Object of PcepErrorInfo | ||
81 | + */ | ||
82 | + public PcepErrorInfo getPcepErrorInfo(); | ||
83 | + | ||
84 | + /** | ||
85 | + * Sets errInfo Object. | ||
86 | + * | ||
87 | + * @param errInfo error information | ||
88 | + * @return builder by getting Object of PcepErrorInfo | ||
89 | + */ | ||
90 | + public Builder setPcepErrorInfo(PcepErrorInfo errInfo); | ||
91 | + } | ||
92 | +} |
1 | +package org.onosproject.pcepio.protocol; | ||
2 | + | ||
3 | +import java.util.LinkedList; | ||
4 | + | ||
5 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
6 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
7 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
8 | +import org.onosproject.pcepio.types.PcepValueType; | ||
9 | + | ||
10 | +/** | ||
11 | + * Abstraction of an entity providing PCEP Error Object. | ||
12 | + */ | ||
13 | +public interface PcepErrorObject { | ||
14 | + | ||
15 | + /** | ||
16 | + * Returns Error Type in Error Object. | ||
17 | + * | ||
18 | + * @return Error Type in Error Object | ||
19 | + */ | ||
20 | + int getErrorType(); | ||
21 | + | ||
22 | + /** | ||
23 | + * Sets Error Type in Error Object. | ||
24 | + * | ||
25 | + * @param value Error Type | ||
26 | + */ | ||
27 | + void setErrorType(byte value); | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns Error Value in Error Object. | ||
31 | + * | ||
32 | + * @return Error Value | ||
33 | + */ | ||
34 | + byte getErrorValue(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Sets Error Value in Error Object. | ||
38 | + * | ||
39 | + * @param value Error Value | ||
40 | + */ | ||
41 | + void setErrorValue(byte value); | ||
42 | + | ||
43 | + /** | ||
44 | + * Returns Optional Tlvs in Error Object. | ||
45 | + * | ||
46 | + * @return list of Optional Tlvs in Error Object | ||
47 | + */ | ||
48 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
49 | + | ||
50 | + /** | ||
51 | + * Sets Optional Tlvs in Error Object. | ||
52 | + * | ||
53 | + * @param llOptionalTlv list of Optional Tlvs | ||
54 | + */ | ||
55 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
56 | + | ||
57 | + /** | ||
58 | + * Prints attributes of Error object. | ||
59 | + */ | ||
60 | + void print(); | ||
61 | + | ||
62 | + /** | ||
63 | + * Writes the Error Object into channel buffer. | ||
64 | + * | ||
65 | + * @param bb channel buffer | ||
66 | + * @return Returns the writerIndex of this buffer | ||
67 | + * @throws PcepParseException while writing Error Object into ChannelBuffer | ||
68 | + */ | ||
69 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
70 | + | ||
71 | + /** | ||
72 | + * Builder interface with get and set functions to build Error object. | ||
73 | + */ | ||
74 | + public interface Builder { | ||
75 | + | ||
76 | + /** | ||
77 | + * Builds Error Object. | ||
78 | + * | ||
79 | + * @return Error Object. | ||
80 | + */ | ||
81 | + PcepErrorObject build(); | ||
82 | + | ||
83 | + /** | ||
84 | + * Returns Error Object header. | ||
85 | + * | ||
86 | + * @return Error Object header | ||
87 | + */ | ||
88 | + PcepObjectHeader getErrorObjHeader(); | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets Error Object header and returns its Builder. | ||
92 | + * | ||
93 | + * @param obj Error Object header | ||
94 | + * @return Builder by setting Error Object header | ||
95 | + */ | ||
96 | + Builder setErrorObjHeader(PcepObjectHeader obj); | ||
97 | + | ||
98 | + /** | ||
99 | + * Returns Error Type in Error Object. | ||
100 | + * | ||
101 | + * @return Error Type in Error Object | ||
102 | + */ | ||
103 | + int getErrorType(); | ||
104 | + | ||
105 | + /** | ||
106 | + * Sets Error Type and returns its builder. | ||
107 | + * | ||
108 | + * @param value of Error-Type field | ||
109 | + * @return builder by setting Error Type field. | ||
110 | + */ | ||
111 | + Builder setErrorType(byte value); | ||
112 | + | ||
113 | + /** | ||
114 | + * Returns Error Value in Error Object. | ||
115 | + * | ||
116 | + * @return Error Value | ||
117 | + */ | ||
118 | + byte getErrorValue(); | ||
119 | + | ||
120 | + /** | ||
121 | + * Sets Error Value and returns its builder. | ||
122 | + * | ||
123 | + * @param value of Error-Value field | ||
124 | + * @return Builder by setting Error Value field. | ||
125 | + */ | ||
126 | + Builder setErrorValue(byte value); | ||
127 | + | ||
128 | + /** | ||
129 | + * Returns list of Optional Tlvs of Error Object. | ||
130 | + * | ||
131 | + * @return list of Optional Tlvs of Error Object | ||
132 | + */ | ||
133 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
134 | + | ||
135 | + /** | ||
136 | + * Sets Optional Tlvs of Error Object and returns its Builder. | ||
137 | + * | ||
138 | + * @param llOptionalTlv Optional Tlvs of Error Object | ||
139 | + * @return Builder by setting Optional Tlvs. | ||
140 | + */ | ||
141 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
142 | + | ||
143 | + /** | ||
144 | + * Sets P flag in Error object header and returns its builder. | ||
145 | + * | ||
146 | + * @param value boolean value to set P flag | ||
147 | + * @return Builder by setting P flag | ||
148 | + */ | ||
149 | + Builder setPFlag(boolean value); | ||
150 | + | ||
151 | + /** | ||
152 | + * Sets I flag in Error object header and returns its builder. | ||
153 | + * | ||
154 | + * @param value boolean value to set I flag | ||
155 | + * @return Builder by setting I flag | ||
156 | + */ | ||
157 | + Builder setIFlag(boolean value); | ||
158 | + } | ||
159 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.slf4j.Logger; | ||
22 | +import org.slf4j.LoggerFactory; | ||
23 | + | ||
24 | +public final class PcepFactories { | ||
25 | + | ||
26 | + protected static final Logger log = LoggerFactory.getLogger(PcepFactories.class); | ||
27 | + | ||
28 | + private static final GenericReader GENERIC_READER = new GenericReader(); | ||
29 | + | ||
30 | + public static final byte SHIFT_FLAG = 5; | ||
31 | + | ||
32 | + private PcepFactories() { | ||
33 | + } | ||
34 | + | ||
35 | + /* | ||
36 | + * Returns the instance of PCEP Version. | ||
37 | + * | ||
38 | + * @param version | ||
39 | + * @return PCEP version | ||
40 | + */ | ||
41 | + public static PcepFactory getFactory(PcepVersion version) { | ||
42 | + switch (version) { | ||
43 | + case PCEP_1: | ||
44 | + // TODO : to get the pcep version 1 factory | ||
45 | + default: | ||
46 | + throw new IllegalArgumentException("[PcepFactory:]Unknown version: " + version); | ||
47 | + } | ||
48 | + } | ||
49 | + | ||
50 | + private static class GenericReader implements PcepMessageReader<PcepMessage> { | ||
51 | + | ||
52 | + @Override | ||
53 | + public PcepMessage readFrom(ChannelBuffer bb) throws PcepParseException { | ||
54 | + | ||
55 | + if (!bb.readable()) { | ||
56 | + log.debug("Empty message received"); | ||
57 | + throw new PcepParseException("Empty message received"); | ||
58 | + } | ||
59 | + | ||
60 | + /* | ||
61 | + * 0 1 2 3 | ||
62 | + * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||
63 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
64 | + * | Ver | Flags | | | ||
65 | + * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
66 | + * | ||
67 | + * Currently Version 1 is supported | ||
68 | + * Currently no flags are used, it is all ignored | ||
69 | + */ | ||
70 | + | ||
71 | + byte packetVersion = bb.getByte(bb.readerIndex()); | ||
72 | + packetVersion = (byte) (packetVersion >> SHIFT_FLAG); | ||
73 | + PcepFactory factory; | ||
74 | + | ||
75 | + switch (packetVersion) { | ||
76 | + | ||
77 | + case 1: | ||
78 | + // TODO : get the factory for version 1 | ||
79 | + break; | ||
80 | + default: | ||
81 | + throw new IllegalArgumentException("Unknown Packet version: " + packetVersion); | ||
82 | + } | ||
83 | + // TODO : Read the PCEP message from the factory | ||
84 | + return null; | ||
85 | + } | ||
86 | + } | ||
87 | + | ||
88 | + /* | ||
89 | + * Returns GENERIC_READER. | ||
90 | + * | ||
91 | + * @return GENERIC_READER | ||
92 | + */ | ||
93 | + public static PcepMessageReader<PcepMessage> getGenericReader() { | ||
94 | + return GENERIC_READER; | ||
95 | + } | ||
96 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an Message factory providing Builder functions to PCEP Messages and Objects. | ||
21 | + * | ||
22 | + */ | ||
23 | +public interface PcepFactory { | ||
24 | + | ||
25 | + /** | ||
26 | + * To get Builder Object for Open Message. | ||
27 | + * | ||
28 | + * @return Builder Object for Open Message | ||
29 | + */ | ||
30 | + PcepOpenMsg.Builder buildOpenMsg(); | ||
31 | + | ||
32 | + /** | ||
33 | + * To get Builder Object for Open Object. | ||
34 | + * | ||
35 | + * @return Builder Object for Open Object | ||
36 | + */ | ||
37 | + PcepOpenObject.Builder buildOpenObject(); | ||
38 | + | ||
39 | + /** | ||
40 | + * To get Builder Object for Keepalive Message. | ||
41 | + * | ||
42 | + * @return Builder Object for Keepalive Message | ||
43 | + */ | ||
44 | + PcepKeepaliveMsg.Builder buildKeepaliveMsg(); | ||
45 | + | ||
46 | + /** | ||
47 | + * To get Builder Object for Close Message. | ||
48 | + * | ||
49 | + * @return Builder Object for Close Message | ||
50 | + */ | ||
51 | + PcepCloseMsg.Builder buildCloseMsg(); | ||
52 | + | ||
53 | + /** | ||
54 | + * To get Builder Object for Report Message. | ||
55 | + * | ||
56 | + * @return Builder Object for Report Message | ||
57 | + */ | ||
58 | + PcepReportMsg.Builder buildReportMsg(); | ||
59 | + | ||
60 | + /** | ||
61 | + * To get Builder Object for Update Message. | ||
62 | + * | ||
63 | + * @return Builder Object for Update Message | ||
64 | + */ | ||
65 | + PcepUpdateMsg.Builder buildUpdateMsg(); | ||
66 | + | ||
67 | + /** | ||
68 | + * To get Builder Object for Initiate Message. | ||
69 | + * | ||
70 | + * @return Builder Object for Initiate Message | ||
71 | + */ | ||
72 | + PcepInitiateMsg.Builder buildPcepInitiateMsg(); | ||
73 | + | ||
74 | + /** | ||
75 | + * To get Builder Object for LSP Object. | ||
76 | + * | ||
77 | + * @return Builder Object for LSP Object | ||
78 | + */ | ||
79 | + PcepLspObject.Builder buildLspObject(); | ||
80 | + | ||
81 | + /** | ||
82 | + * To get Builder Object for SRP Object. | ||
83 | + * | ||
84 | + * @return Builder Object for SRP Object | ||
85 | + */ | ||
86 | + PcepSrpObject.Builder buildSrpObject(); | ||
87 | + | ||
88 | + /** | ||
89 | + * To get Builder Object for EndPoints Object. | ||
90 | + * | ||
91 | + * @return Builder Object for EndPoints Object | ||
92 | + */ | ||
93 | + PcepEndPointsObject.Builder buildEndPointsObject(); | ||
94 | + | ||
95 | + /** | ||
96 | + * To get Builder Object for ERO Object. | ||
97 | + * | ||
98 | + * @return Builder Object for ERO Object | ||
99 | + */ | ||
100 | + PcepEroObject.Builder buildEroObject(); | ||
101 | + | ||
102 | + /** | ||
103 | + * To get Builder Object for RRO Object. | ||
104 | + * | ||
105 | + * @return Builder Object for RRO Object | ||
106 | + */ | ||
107 | + PcepRroObject.Builder buildRroObject(); | ||
108 | + | ||
109 | + /** | ||
110 | + * To get Builder Object for LSPA Object. | ||
111 | + * | ||
112 | + * @return Builder Object for LSPA Object | ||
113 | + */ | ||
114 | + PcepLspaObject.Builder buildLspaObject(); | ||
115 | + | ||
116 | + /** | ||
117 | + * To get Builder Object for IRO Object. | ||
118 | + * | ||
119 | + * @return Builder Object for IRO Object | ||
120 | + */ | ||
121 | + PcepIroObject.Builder buildIroObject(); | ||
122 | + | ||
123 | + /** | ||
124 | + * To get Builder Object for METRIC Object. | ||
125 | + * | ||
126 | + * @return Builder Object for METRIC Object | ||
127 | + */ | ||
128 | + PcepMetricObject.Builder buildMetricObject(); | ||
129 | + | ||
130 | + /** | ||
131 | + * To get Builder Object for Bandwidth Object. | ||
132 | + * | ||
133 | + * @return Builder Object for Bandwidth Object | ||
134 | + */ | ||
135 | + PcepBandwidthObject.Builder buildBandwidthObject(); | ||
136 | + | ||
137 | + /** | ||
138 | + * Returns PCEP Message Reader. | ||
139 | + * | ||
140 | + * @return PCEP Message Reader | ||
141 | + */ | ||
142 | + PcepMessageReader<PcepMessage> getReader(); | ||
143 | + | ||
144 | + /** | ||
145 | + * Returns PCEP version. | ||
146 | + * | ||
147 | + * @return PCEP version | ||
148 | + */ | ||
149 | + PcepVersion getVersion(); | ||
150 | + | ||
151 | + /** | ||
152 | + * Returns PcepStateReport. | ||
153 | + * | ||
154 | + * @return PcepStateReport | ||
155 | + */ | ||
156 | + PcepStateReport.Builder buildPcepStateReport(); | ||
157 | + | ||
158 | + /** | ||
159 | + * Returns PcepUpdateRequest. | ||
160 | + * | ||
161 | + * @return PcepUpdateRequest | ||
162 | + */ | ||
163 | + PcepUpdateRequest.Builder buildPcepUpdateRequest(); | ||
164 | + | ||
165 | + /** | ||
166 | + * Returns PcInitiatedLspRequest. | ||
167 | + * | ||
168 | + * @return PcInitiatedLspRequest | ||
169 | + */ | ||
170 | + PcInitiatedLspRequest.Builder buildPcInitiatedLspRequest(); | ||
171 | + | ||
172 | + /** | ||
173 | + * Returns PcepMsgPath. | ||
174 | + * | ||
175 | + * @return PcepMsgPath | ||
176 | + */ | ||
177 | + PcepMsgPath.Builder buildPcepMsgPath(); | ||
178 | + | ||
179 | + /** | ||
180 | + * Return PcepAttribute list. | ||
181 | + * | ||
182 | + * @return PcepAttribute | ||
183 | + */ | ||
184 | + PcepAttribute.Builder buildPcepAttribute(); | ||
185 | + | ||
186 | + /** | ||
187 | + * To get Builder Object for LabelUpdate message. | ||
188 | + * | ||
189 | + * @return Builder Object for LabelUpdate message | ||
190 | + */ | ||
191 | + PcepLabelUpdateMsg.Builder buildPcepLabelUpdateMsg(); | ||
192 | + | ||
193 | + /** | ||
194 | + * To get Builder Object for PcepLabelUpdate Object. | ||
195 | + * | ||
196 | + * @return Builder Object for PcepLabelUpdate Object | ||
197 | + */ | ||
198 | + PcepLabelUpdate.Builder buildPcepLabelUpdateObject(); | ||
199 | + | ||
200 | + /** | ||
201 | + * To get Builder Object for PcepLabel Object. | ||
202 | + * | ||
203 | + * @return Builder Object for PcepLabel Object | ||
204 | + */ | ||
205 | + PcepLabelObject.Builder buildLabelObject(); | ||
206 | + | ||
207 | + /** | ||
208 | + * To get Builder Object for Error Message. | ||
209 | + * | ||
210 | + * @return Builder Object for Error Message | ||
211 | + */ | ||
212 | + PcepErrorMsg.Builder buildPcepErrorMsg(); | ||
213 | + | ||
214 | + /** | ||
215 | + * To get Builder Object for Error Object. | ||
216 | + * | ||
217 | + * @return Builder Object for Error Object | ||
218 | + */ | ||
219 | + PcepErrorObject.Builder buildPcepErrorObject(); | ||
220 | + | ||
221 | + /** | ||
222 | + * To get Builder Object for FecIpv4Adjacency. | ||
223 | + * | ||
224 | + * @return Builder Object for FecIpv4Adjacency | ||
225 | + */ | ||
226 | + PcepFecObjectIPv4Adjacency.Builder buildFecIpv4Adjacency(); | ||
227 | + | ||
228 | + /** | ||
229 | + * To get Builder Object for ErrorInfo. | ||
230 | + * | ||
231 | + * @return Builder Object for ErrorInfo | ||
232 | + */ | ||
233 | + PcepErrorInfo.Builder buildPcepErrorInfo(); | ||
234 | + | ||
235 | + /** | ||
236 | + * To get Builder Object for PcepError. | ||
237 | + * | ||
238 | + * @return Builder Object for PcepError | ||
239 | + */ | ||
240 | + PcepError.Builder buildPcepError(); | ||
241 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP FEC Object. | ||
24 | + */ | ||
25 | +public interface PcepFecObject { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns PCEP Version of FEC Object. | ||
29 | + * | ||
30 | + * @return PCEP Version of FEC Object | ||
31 | + */ | ||
32 | + PcepVersion getVersion(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Returns FEC Object type. | ||
36 | + * | ||
37 | + * @return FEC Object type | ||
38 | + */ | ||
39 | + int getType(); | ||
40 | + | ||
41 | + /** | ||
42 | + * Writes the FEC into channel buffer. | ||
43 | + * | ||
44 | + * @param bb channel buffer | ||
45 | + * @return Returns the writerIndex of this buffer | ||
46 | + * @throws PcepParseException while writing FEC Object into Channel Buffer. | ||
47 | + */ | ||
48 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
49 | + | ||
50 | + /** | ||
51 | + * Prints attributes of FEC object. | ||
52 | + */ | ||
53 | + void print(); | ||
54 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing PCEP FEC Object of Type 1 IPv4 Node ID. | ||
25 | + */ | ||
26 | +public interface PcepFecObjectIPv4 extends PcepFecObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns NodeID of FEC Object. | ||
30 | + * | ||
31 | + * @return NodeID of FEC Object | ||
32 | + */ | ||
33 | + int getNodeID(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets NodeID with specified value. | ||
37 | + * | ||
38 | + * @param value node id | ||
39 | + */ | ||
40 | + void setNodeID(int value); | ||
41 | + | ||
42 | + @Override | ||
43 | + void print(); | ||
44 | + | ||
45 | + @Override | ||
46 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
47 | + | ||
48 | + /** | ||
49 | + * Builder interface with get and set functions to build FEC object. | ||
50 | + */ | ||
51 | + public interface Builder { | ||
52 | + | ||
53 | + /** | ||
54 | + * Builds FEC Object IPv4. | ||
55 | + * | ||
56 | + * @return FEC Object IPv4 | ||
57 | + * @throws PcepParseException while creating FEC IPv4 Object. | ||
58 | + */ | ||
59 | + PcepFecObjectIPv4 build() throws PcepParseException; | ||
60 | + | ||
61 | + /** | ||
62 | + * Returns FEC Object IPv4 header. | ||
63 | + * | ||
64 | + * @return FEC Object IPv4 header | ||
65 | + */ | ||
66 | + PcepObjectHeader getFecIpv4ObjHeader(); | ||
67 | + | ||
68 | + /** | ||
69 | + * Sets FEC Object IPv4 header and returns its builder. | ||
70 | + * | ||
71 | + * @param obj FEC Object IPv4 header | ||
72 | + * @return Builder by setting FEC Object IPv4 header | ||
73 | + */ | ||
74 | + Builder setFecIpv4ObjHeader(PcepObjectHeader obj); | ||
75 | + | ||
76 | + /** | ||
77 | + * Returns NodeID of FEC Object. | ||
78 | + * | ||
79 | + * @return NodeID of FEC Object | ||
80 | + */ | ||
81 | + int getNodeID(); | ||
82 | + | ||
83 | + /** | ||
84 | + * Sets NodeID and returns its builder. | ||
85 | + * | ||
86 | + * @param value node id | ||
87 | + * @return builder by setting NodeID | ||
88 | + */ | ||
89 | + Builder setNodeID(int value); | ||
90 | + | ||
91 | + /** | ||
92 | + * Sets P flag in FEC object header and returns its builder. | ||
93 | + * | ||
94 | + * @param value boolean value to set P flag | ||
95 | + * @return Builder by setting P flag | ||
96 | + */ | ||
97 | + Builder setPFlag(boolean value); | ||
98 | + | ||
99 | + /** | ||
100 | + * Sets I flag in FEC object header and returns its builder. | ||
101 | + * | ||
102 | + * @param value boolean value to set I flag | ||
103 | + * @return Builder by setting I flag | ||
104 | + */ | ||
105 | + Builder setIFlag(boolean value); | ||
106 | + } | ||
107 | +} |
pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFecObjectIPv4Adjacency.java
0 → 100755
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing FEC Object of Type 3 IPv4 Adjacency. | ||
25 | + */ | ||
26 | +public interface PcepFecObjectIPv4Adjacency extends PcepFecObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns Local IPv4Address of FEC Object. | ||
30 | + * | ||
31 | + * @return Local IPv4Address of FEC Object | ||
32 | + */ | ||
33 | + int getLocalIPv4Address(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets Local IPv4Address with specified value. | ||
37 | + * | ||
38 | + * @param value Local IPv4Address | ||
39 | + */ | ||
40 | + void seLocalIPv4Address(int value); | ||
41 | + | ||
42 | + /** | ||
43 | + * Returns Remote IPv4Address of FEC Object. | ||
44 | + * | ||
45 | + * @return Remote IPv4Address of FEC Object | ||
46 | + */ | ||
47 | + int getRemoteIPv4Address(); | ||
48 | + | ||
49 | + /** | ||
50 | + * Sets Remote IPv4Address with specified value. | ||
51 | + * | ||
52 | + * @param value Remote IPv4Address | ||
53 | + */ | ||
54 | + void seRemoteIPv4Address(int value); | ||
55 | + | ||
56 | + @Override | ||
57 | + void print(); | ||
58 | + | ||
59 | + @Override | ||
60 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
61 | + | ||
62 | + /** | ||
63 | + * Builder interface with get and set functions to build FEC object. | ||
64 | + */ | ||
65 | + public interface Builder { | ||
66 | + | ||
67 | + /** | ||
68 | + * Builds FEC Object IPv4 Adjacency. | ||
69 | + * | ||
70 | + * @return FEC Object IPv4 Adjacency | ||
71 | + * @throws PcepParseException while building FEC IPv4 Adjacency object. | ||
72 | + */ | ||
73 | + PcepFecObjectIPv4Adjacency build() throws PcepParseException; | ||
74 | + | ||
75 | + /** | ||
76 | + * Returns FEC Object IPv4 Adjacency header. | ||
77 | + * | ||
78 | + * @return FEC Object IPv4 Adjacency header | ||
79 | + */ | ||
80 | + PcepObjectHeader getFecIpv4AdjacencyObjHeader(); | ||
81 | + | ||
82 | + /** | ||
83 | + * Sets FEC Object IPv4 Adjacency header and returns its builder. | ||
84 | + * | ||
85 | + * @param obj FEC Object IPv4 Adjacency header | ||
86 | + * @return Builder by setting FEC Object IPv4 header | ||
87 | + */ | ||
88 | + Builder setFecIpv4AdjacencyObjHeader(PcepObjectHeader obj); | ||
89 | + | ||
90 | + /** | ||
91 | + * Returns Local IPv4Address of FEC Object. | ||
92 | + * | ||
93 | + * @return Local IPv4Address of FEC Object | ||
94 | + */ | ||
95 | + int getLocalIPv4Address(); | ||
96 | + | ||
97 | + /** | ||
98 | + * Sets Local IPv4Address and returns its builder. | ||
99 | + * | ||
100 | + * @param value Local IPv4Address | ||
101 | + * @return Builder by setting Local IPv4Address | ||
102 | + */ | ||
103 | + Builder seLocalIPv4Address(int value); | ||
104 | + | ||
105 | + /** | ||
106 | + * Sets Remote IPv4Address with specified value. | ||
107 | + * | ||
108 | + * @return Remote IPv4 Address | ||
109 | + */ | ||
110 | + int getRemoteIPv4Address(); | ||
111 | + | ||
112 | + /** | ||
113 | + * Sets Remote IPv4Address and returns its builder. | ||
114 | + * | ||
115 | + * @param value Remote IPv4Address | ||
116 | + * @return Builder by setting Remote IPv4Address | ||
117 | + */ | ||
118 | + Builder seRemoteIPv4Address(int value); | ||
119 | + | ||
120 | + /** | ||
121 | + * Sets P flag in FEC object header and returns its builder. | ||
122 | + * | ||
123 | + * @param value boolean value to set P flag | ||
124 | + * @return Builder by setting P flag | ||
125 | + */ | ||
126 | + Builder setPFlag(boolean value); | ||
127 | + | ||
128 | + /** | ||
129 | + * Sets I flag in FEC object header and returns its builder. | ||
130 | + * | ||
131 | + * @param value boolean value to set I flag | ||
132 | + * @return Builder by setting I flag | ||
133 | + */ | ||
134 | + Builder setIFlag(boolean value); | ||
135 | + } | ||
136 | +} |
pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFecObjectIPv4UnnumberedAdjacency.java
0 → 100755
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing PCEP FEC Object of Type is 5 Unnumbered Adjacency with IPv4 NodeIDs. | ||
25 | + */ | ||
26 | +public interface PcepFecObjectIPv4UnnumberedAdjacency extends PcepFecObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns Local NodeID of FEC Object. | ||
30 | + * | ||
31 | + * @return Local NodeID of FEC Object | ||
32 | + */ | ||
33 | + int getLocalNodeID(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets Local NodeID with specified value. | ||
37 | + * | ||
38 | + * @param value Local NodeID | ||
39 | + */ | ||
40 | + void setLocalNodeID(int value); | ||
41 | + | ||
42 | + /** | ||
43 | + * Returns Local InterfaceID of FEC Object. | ||
44 | + * | ||
45 | + * @return Local InterfaceID of FEC Object | ||
46 | + */ | ||
47 | + int getLocalInterfaceID(); | ||
48 | + | ||
49 | + /** | ||
50 | + * Sets Local InterfaceID with specified value. | ||
51 | + * | ||
52 | + * @param value Local InterfaceID | ||
53 | + */ | ||
54 | + void setLocalInterfaceID(int value); | ||
55 | + | ||
56 | + /** | ||
57 | + * Returns Remote NodeID of FEC Object. | ||
58 | + * | ||
59 | + * @return Remote NodeID of FEC Object | ||
60 | + */ | ||
61 | + int getRemoteNodeID(); | ||
62 | + | ||
63 | + /** | ||
64 | + * Sets Remote NodeID with specified value. | ||
65 | + * | ||
66 | + * @param value Remote NodeID | ||
67 | + */ | ||
68 | + void setRemoteNodeID(int value); | ||
69 | + | ||
70 | + /** | ||
71 | + * Returns Remote InterfaceID of FEC Object. | ||
72 | + * | ||
73 | + * @return Remote InterfaceID of FEC Object | ||
74 | + */ | ||
75 | + int getRemoteInterfaceID(); | ||
76 | + | ||
77 | + /** | ||
78 | + * Sets Remote InterfaceID with specified value. | ||
79 | + * | ||
80 | + * @param value Remote InterfaceID | ||
81 | + */ | ||
82 | + void setRemoteInterfaceID(int value); | ||
83 | + | ||
84 | + @Override | ||
85 | + void print(); | ||
86 | + | ||
87 | + @Override | ||
88 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
89 | + | ||
90 | + /** | ||
91 | + * Builder interface with get and set functions to build bandwidth object. | ||
92 | + */ | ||
93 | + public interface Builder { | ||
94 | + | ||
95 | + /** | ||
96 | + * Builds FEC Unnumbered Adjacency with IPv4 Object. | ||
97 | + * | ||
98 | + * @return FEC Unnumbered Adjacency with IPv4 Object | ||
99 | + * @throws PcepParseException when building FEC IPv4 Unnumbered Adjacency object. | ||
100 | + */ | ||
101 | + PcepFecObjectIPv4UnnumberedAdjacency build() throws PcepParseException; | ||
102 | + | ||
103 | + /** | ||
104 | + * Returns FEC Unnumbered Adjacency with IPv4 header. | ||
105 | + * | ||
106 | + * @return FEC Unnumbered Adjacency with IPv4 header | ||
107 | + */ | ||
108 | + PcepObjectHeader getFecIpv4UnnumberedAdjacencyObjHeader(); | ||
109 | + | ||
110 | + /** | ||
111 | + * Sets FEC Unnumbered Adjacency with IPv4 header and returns its builder. | ||
112 | + * | ||
113 | + * @param obj FEC Unnumbered Adjacency with IPv4 header | ||
114 | + * @return Builder by setting FEC Unnumbered Adjacency with IPv4 header | ||
115 | + */ | ||
116 | + Builder setFecIpv4UnnumberedAdjacencyObjHeader(PcepObjectHeader obj); | ||
117 | + | ||
118 | + /** | ||
119 | + * Returns Local NodeID of FEC Object. | ||
120 | + * | ||
121 | + * @return Local NodeID of FEC Object | ||
122 | + */ | ||
123 | + int getLocalNodeID(); | ||
124 | + | ||
125 | + /** | ||
126 | + * Sets Local NodeID and returns its builder. | ||
127 | + * | ||
128 | + * @param value Local NodeID | ||
129 | + * @return Builder by setting Local NodeID | ||
130 | + */ | ||
131 | + Builder setLocalNodeID(int value); | ||
132 | + | ||
133 | + /** | ||
134 | + * Returns Local InterfaceID of FEC Object. | ||
135 | + * | ||
136 | + * @return Local InterfaceID of FEC Object | ||
137 | + */ | ||
138 | + int getLocalInterfaceID(); | ||
139 | + | ||
140 | + /** | ||
141 | + * Sets Local InterfaceID and returns its builder. | ||
142 | + * | ||
143 | + * @param value Local InterfaceID | ||
144 | + * @return Builder by setting Local InterfaceID | ||
145 | + */ | ||
146 | + Builder setLocalInterfaceID(int value); | ||
147 | + | ||
148 | + /** | ||
149 | + * Returns Remote NodeID of FEC Object. | ||
150 | + * | ||
151 | + * @return Remote NodeID of FEC Object | ||
152 | + */ | ||
153 | + int getRemoteNodeID(); | ||
154 | + | ||
155 | + /** | ||
156 | + * Sets Remote NodeID and returns its builder. | ||
157 | + * | ||
158 | + * @param value Remote NodeID | ||
159 | + * @return Builder by setting Remote NodeID | ||
160 | + */ | ||
161 | + Builder setRemoteNodeID(int value); | ||
162 | + | ||
163 | + /** | ||
164 | + * Returns Remote InterfaceID of FEC Object. | ||
165 | + * | ||
166 | + * @return Remote InterfaceID of FEC Object | ||
167 | + */ | ||
168 | + int getRemoteInterfaceID(); | ||
169 | + | ||
170 | + /** | ||
171 | + * Sets Remote InterfaceID and returns its builder. | ||
172 | + * | ||
173 | + * @param value Remote InterfaceID | ||
174 | + * @return Builder by setting Remote InterfaceID | ||
175 | + */ | ||
176 | + Builder setRemoteInterfaceID(int value); | ||
177 | + | ||
178 | + /** | ||
179 | + * Sets P flag in FEC object header and returns its builder. | ||
180 | + * | ||
181 | + * @param value boolean value to set P flag | ||
182 | + * @return Builder by setting P flag | ||
183 | + */ | ||
184 | + Builder setPFlag(boolean value); | ||
185 | + | ||
186 | + /** | ||
187 | + * Sets I flag in FEC object header and returns its builder. | ||
188 | + * | ||
189 | + * @param value boolean value to set I flag | ||
190 | + * @return Builder by setting I flag | ||
191 | + */ | ||
192 | + Builder setIFlag(boolean value); | ||
193 | + } | ||
194 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing FEC Object of Type is 2 IPv6 Node ID. | ||
25 | + */ | ||
26 | +public interface PcepFecObjectIPv6 extends PcepFecObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns NodeID of FEC Object. | ||
30 | + * | ||
31 | + * @return NodeID of FEC Object | ||
32 | + */ | ||
33 | + byte[] getNodeID(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets NodeID with specified value. | ||
37 | + * | ||
38 | + * @param value node id | ||
39 | + */ | ||
40 | + void setNodeID(byte[] value); | ||
41 | + | ||
42 | + @Override | ||
43 | + void print(); | ||
44 | + | ||
45 | + @Override | ||
46 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
47 | + | ||
48 | + /** | ||
49 | + * Builder interface with get and set functions to build FEC object. | ||
50 | + */ | ||
51 | + public interface Builder { | ||
52 | + | ||
53 | + /** | ||
54 | + * Builds FEC Object IPv6. | ||
55 | + * | ||
56 | + * @return FEC Object IPv6 | ||
57 | + * @throws PcepParseException while building FEC IPv6 Object. | ||
58 | + */ | ||
59 | + PcepFecObjectIPv6 build() throws PcepParseException; | ||
60 | + | ||
61 | + /** | ||
62 | + * Returns FEC Object IPv6 header. | ||
63 | + * | ||
64 | + * @return FEC Object IPv6 header | ||
65 | + */ | ||
66 | + PcepObjectHeader getFecIpv6ObjHeader(); | ||
67 | + | ||
68 | + /** | ||
69 | + * Sets FEC Object IPv6 header and returns its builder. | ||
70 | + * | ||
71 | + * @param obj FEC Object IPv6 header | ||
72 | + * @return Builder by setting FEC Object IPv6 header | ||
73 | + */ | ||
74 | + Builder setFecIpv6ObjHeader(PcepObjectHeader obj); | ||
75 | + | ||
76 | + /** | ||
77 | + * Returns NodeID of FEC Object. | ||
78 | + * | ||
79 | + * @return NodeID of FEC Object | ||
80 | + */ | ||
81 | + byte[] getNodeID(); | ||
82 | + | ||
83 | + /** | ||
84 | + * Sets NodeID and returns its builder. | ||
85 | + * | ||
86 | + * @param value node id | ||
87 | + * @return Builder by setting NodeID | ||
88 | + */ | ||
89 | + Builder setNodeID(byte[] value); | ||
90 | + | ||
91 | + /** | ||
92 | + * Sets P flag in FEC object header and returns its builder. | ||
93 | + * | ||
94 | + * @param value boolean value to set P flag | ||
95 | + * @return Builder by setting P flag | ||
96 | + */ | ||
97 | + Builder setPFlag(boolean value); | ||
98 | + | ||
99 | + /** | ||
100 | + * Sets I flag in FEC object header and returns its builder. | ||
101 | + * | ||
102 | + * @param value boolean value to set I flag | ||
103 | + * @return Builder by setting I flag | ||
104 | + */ | ||
105 | + Builder setIFlag(boolean value); | ||
106 | + } | ||
107 | +} |
pcep/pcepio/src/main/java/org/onosproject/pcepio/protocol/PcepFecObjectIPv6Adjacency.java
0 → 100755
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing FEC Object of Type is 4 IPv6 Adjacency. | ||
25 | + */ | ||
26 | +public interface PcepFecObjectIPv6Adjacency extends PcepFecObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Returns Local IPv6Address of FEC Object. | ||
30 | + * | ||
31 | + * @return Local IPv6Address of FEC Object | ||
32 | + */ | ||
33 | + byte[] getLocalIPv6Address(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets Local IPv6Address with specified value. | ||
37 | + * | ||
38 | + * @param value Local IPv6Address | ||
39 | + */ | ||
40 | + void seLocalIPv6Address(byte[] value); | ||
41 | + | ||
42 | + /** | ||
43 | + * Returns Remote IPv6Address of FEC Object. | ||
44 | + * | ||
45 | + * @return Remote IPv6Address of FEC Object | ||
46 | + */ | ||
47 | + byte[] getRemoteIPv6Address(); | ||
48 | + | ||
49 | + /** | ||
50 | + * Sets Remote IPv6Address with specified value. | ||
51 | + * | ||
52 | + * @param value Remote IPv6Address | ||
53 | + */ | ||
54 | + void seRemoteIPv6Address(byte[] value); | ||
55 | + | ||
56 | + @Override | ||
57 | + void print(); | ||
58 | + | ||
59 | + @Override | ||
60 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
61 | + | ||
62 | + /** | ||
63 | + * Builder interface with get and set functions to build FEC object. | ||
64 | + */ | ||
65 | + public interface Builder { | ||
66 | + | ||
67 | + /** | ||
68 | + * Builds FEC Object IPv6 Adjacency. | ||
69 | + * | ||
70 | + * @return FEC Object IPv6 Adjacency | ||
71 | + * @throws PcepParseException while building FEC IPv6 Adjacency object. | ||
72 | + */ | ||
73 | + PcepFecObjectIPv6Adjacency build() throws PcepParseException; | ||
74 | + | ||
75 | + /** | ||
76 | + * Returns FEC Object IPv6 Adjacency header. | ||
77 | + * | ||
78 | + * @return FEC Object IPv6 Adjacency header | ||
79 | + */ | ||
80 | + PcepObjectHeader getFecIpv6AdjacencyObjHeader(); | ||
81 | + | ||
82 | + /** | ||
83 | + * Sets FEC Object IPv6 Adjacency header and returns its builder. | ||
84 | + * | ||
85 | + * @param obj FEC Object IPv6 Adjacency header | ||
86 | + * @return Builder by setting FEC Object IPv6 Adjacency header | ||
87 | + */ | ||
88 | + Builder setFecIpv6AdjacencyObjHeader(PcepObjectHeader obj); | ||
89 | + | ||
90 | + /** | ||
91 | + * Returns Local IPv6Address of FEC Object. | ||
92 | + * | ||
93 | + * @return Local IPv6Address of FEC Object | ||
94 | + */ | ||
95 | + byte[] getLocalIPv6Address(); | ||
96 | + | ||
97 | + /** | ||
98 | + * Sets Local IPv6Address and returns its builder. | ||
99 | + * | ||
100 | + * @param value Local IPv6Address | ||
101 | + * @return Builder by setting Local IPv6Address | ||
102 | + */ | ||
103 | + Builder setLocalIPv6Address(byte[] value); | ||
104 | + | ||
105 | + /** | ||
106 | + * Returns Remote IPv6Address of FEC Object. | ||
107 | + * | ||
108 | + * @return Remote IPv6Address of FEC Object | ||
109 | + */ | ||
110 | + byte[] getRemoteIPv6Address(); | ||
111 | + | ||
112 | + /** | ||
113 | + * Sets Remote IPv6Address and returns its builder. | ||
114 | + * | ||
115 | + * @param value Remote IPv6Address | ||
116 | + * @return Builder by setting Remote IPv6Address | ||
117 | + */ | ||
118 | + Builder setRemoteIPv6Address(byte[] value); | ||
119 | + | ||
120 | + /** | ||
121 | + * Sets P flag in FEC object header and returns its builder. | ||
122 | + * | ||
123 | + * @param value boolean value to set P flag | ||
124 | + * @return Builder by setting P flag | ||
125 | + */ | ||
126 | + Builder setPFlag(boolean value); | ||
127 | + | ||
128 | + /** | ||
129 | + * Sets I flag in FEC object header and returns its builder. | ||
130 | + * | ||
131 | + * @param value boolean value to set I flag | ||
132 | + * @return Builder by setting I flag | ||
133 | + */ | ||
134 | + Builder setIFlag(boolean value); | ||
135 | + } | ||
136 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP Initiate Message. | ||
26 | + */ | ||
27 | +public interface PcepInitiateMsg extends PcepObject, PcepMessage { | ||
28 | + | ||
29 | + @Override | ||
30 | + PcepVersion getVersion(); | ||
31 | + | ||
32 | + @Override | ||
33 | + PcepType getType(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Returns list of PcInitiatedLspRequestList. | ||
37 | + * | ||
38 | + * @return list of PcInitiatedLspRequestList | ||
39 | + */ | ||
40 | + LinkedList<PcInitiatedLspRequest> getPcInitiatedLspRequestList(); | ||
41 | + | ||
42 | + /** | ||
43 | + * Sets list of PcInitiatedLspRequestList. | ||
44 | + * | ||
45 | + * @param llPcInitiatedLspRequestList list of PcInitiatedLspRequestList | ||
46 | + */ | ||
47 | + void setPcInitiatedLspRequestList(LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList); | ||
48 | + | ||
49 | + @Override | ||
50 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
51 | + | ||
52 | + /** | ||
53 | + * Builder interface with get and set functions to build Initiate message. | ||
54 | + */ | ||
55 | + public interface Builder extends PcepMessage.Builder { | ||
56 | + | ||
57 | + @Override | ||
58 | + PcepInitiateMsg build(); | ||
59 | + | ||
60 | + @Override | ||
61 | + PcepVersion getVersion(); | ||
62 | + | ||
63 | + @Override | ||
64 | + PcepType getType(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns list of PcInitiatedLspRequestList. | ||
68 | + * | ||
69 | + * @return list of PcInitiatedLspRequestList | ||
70 | + */ | ||
71 | + LinkedList<PcInitiatedLspRequest> getPcInitiatedLspRequestList(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets PcInitiatedLspRequestList. | ||
75 | + * | ||
76 | + * @param llPcInitiatedLspRequestList list of PcInitiatedLspRequestList | ||
77 | + * @return builder by setting list of PcInitiatedLspRequestList | ||
78 | + */ | ||
79 | + Builder setPcInitiatedLspRequestList(LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList); | ||
80 | + } | ||
81 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
19 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
20 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP INTER Layer Object. | ||
24 | + */ | ||
25 | +public interface PcepInterLayerObject { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns N Flag in INTER Layer Object. | ||
29 | + * | ||
30 | + * @return N Flag in INTER Layer Object | ||
31 | + */ | ||
32 | + boolean getbNFlag(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Sets N Flag in INTER Layer Object with specified value. | ||
36 | + * | ||
37 | + * @param value N Flag | ||
38 | + */ | ||
39 | + void setbNFlag(boolean value); | ||
40 | + | ||
41 | + /** | ||
42 | + * Returns I Flag in INTER Layer Object. | ||
43 | + * | ||
44 | + * @return I Flag in INTER Layer Object | ||
45 | + */ | ||
46 | + boolean getbIFlag(); | ||
47 | + | ||
48 | + /** | ||
49 | + * Sets I Flag in INTER Layer Object with specified value. | ||
50 | + * | ||
51 | + * @param value I Flag | ||
52 | + */ | ||
53 | + void setbIFlag(boolean value); | ||
54 | + | ||
55 | + /** | ||
56 | + * Prints attributes of INTER Layer object. | ||
57 | + */ | ||
58 | + void print(); | ||
59 | + | ||
60 | + /** | ||
61 | + * Writes the INTER Layer Object into channel buffer. | ||
62 | + * | ||
63 | + * @param bb channel buffer | ||
64 | + * @return Returns the writerIndex of this buffer | ||
65 | + * @throws PcepParseException while writing Inter Layer Object. | ||
66 | + */ | ||
67 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
68 | + | ||
69 | + /** | ||
70 | + * Builder interface with get and set functions to build INTER Layer object. | ||
71 | + */ | ||
72 | + public interface Builder { | ||
73 | + | ||
74 | + /** | ||
75 | + * Builds INTER Layer object. | ||
76 | + * | ||
77 | + * @return INTER Layer object | ||
78 | + */ | ||
79 | + PcepInterLayerObject build(); | ||
80 | + | ||
81 | + /** | ||
82 | + * Returns INTER Layer object header. | ||
83 | + * | ||
84 | + * @return INTER Layer object header | ||
85 | + */ | ||
86 | + PcepObjectHeader getInterLayerObjHeader(); | ||
87 | + | ||
88 | + /** | ||
89 | + * Sets INTER Layer object header and returns its builder. | ||
90 | + * | ||
91 | + * @param obj INTER Layer object header | ||
92 | + * @return Builder by setting INTER Layer object header | ||
93 | + */ | ||
94 | + Builder setInterLayerObjHeader(PcepObjectHeader obj); | ||
95 | + | ||
96 | + /** | ||
97 | + * Returns N Flag in INTER Layer Object. | ||
98 | + * | ||
99 | + * @return N Flag in INTER Layer Object | ||
100 | + */ | ||
101 | + boolean getbNFlag(); | ||
102 | + | ||
103 | + /** | ||
104 | + * Sets N flag and return its builder. | ||
105 | + * | ||
106 | + * @param value N flag | ||
107 | + * @return Builder by setting N flag | ||
108 | + */ | ||
109 | + Builder setbNFlag(boolean value); | ||
110 | + | ||
111 | + /** | ||
112 | + * Returns I Flag in INTER Layer Object. | ||
113 | + * | ||
114 | + * @return I Flag in INTER Layer Object | ||
115 | + */ | ||
116 | + boolean getbIFlag(); | ||
117 | + | ||
118 | + /** | ||
119 | + * Sets I flag and return its builder. | ||
120 | + * | ||
121 | + * @param value I flag | ||
122 | + * @return Builder by setting N flag | ||
123 | + */ | ||
124 | + Builder setbIFlag(boolean value); | ||
125 | + | ||
126 | + /** | ||
127 | + * Sets P flag in INTER Layer object header and returns its builder. | ||
128 | + * | ||
129 | + * @param value boolean value to set P flag | ||
130 | + * @return Builder by setting P flag | ||
131 | + */ | ||
132 | + Builder setPFlag(boolean value); | ||
133 | + | ||
134 | + /** | ||
135 | + * Sets I flag in INTER Layer object header and returns its builder. | ||
136 | + * | ||
137 | + * @param value boolean value to set I flag | ||
138 | + * @return Builder by setting I flag | ||
139 | + */ | ||
140 | + Builder setIFlag(boolean value); | ||
141 | + } | ||
142 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | +import org.onosproject.pcepio.types.PcepValueType; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP IRO Object. | ||
26 | + */ | ||
27 | +public interface PcepIroObject { | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns list of SubObjects. | ||
31 | + * | ||
32 | + * @return list of SubObjects | ||
33 | + */ | ||
34 | + LinkedList<PcepValueType> getSubObjects(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Sets list of SubObjects. | ||
38 | + * | ||
39 | + * @param llSubObjects list of SubObjects | ||
40 | + */ | ||
41 | + void setSubObjects(LinkedList<PcepValueType> llSubObjects); | ||
42 | + | ||
43 | + /** | ||
44 | + * Prints attributes of IRO object. | ||
45 | + */ | ||
46 | + void print(); | ||
47 | + | ||
48 | + /** | ||
49 | + * Writes the IRO into channel buffer. | ||
50 | + * | ||
51 | + * @param bb channel buffer | ||
52 | + * @return Returns the writerIndex of this buffer | ||
53 | + * @throws PcepParseException while writing IRO object. | ||
54 | + */ | ||
55 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
56 | + | ||
57 | + /** | ||
58 | + * Builder interface with get and set functions to build IRO object. | ||
59 | + */ | ||
60 | + public interface Builder { | ||
61 | + | ||
62 | + /** | ||
63 | + * Builds IRO Object. | ||
64 | + * | ||
65 | + * @return IRO Object | ||
66 | + */ | ||
67 | + PcepIroObject build(); | ||
68 | + | ||
69 | + /** | ||
70 | + * Returns IRO object header. | ||
71 | + * | ||
72 | + * @return IRO object header | ||
73 | + */ | ||
74 | + PcepObjectHeader getIroObjHeader(); | ||
75 | + | ||
76 | + /** | ||
77 | + * Sets IRO object header and returns its builder. | ||
78 | + * | ||
79 | + * @param obj IRO object header | ||
80 | + * @return Builder by setting IRO object header | ||
81 | + */ | ||
82 | + Builder setIroObjHeader(PcepObjectHeader obj); | ||
83 | + | ||
84 | + /** | ||
85 | + * Returns list of SubObjects. | ||
86 | + * | ||
87 | + * @return list of SubObjects | ||
88 | + */ | ||
89 | + LinkedList<PcepValueType> getSubObjects(); | ||
90 | + | ||
91 | + /** | ||
92 | + * Sets list of SubObjects in IRO Object and returns its builder. | ||
93 | + * | ||
94 | + * @param llSubObjects list of SubObjects | ||
95 | + * @return Builder by setting list of SubObjects | ||
96 | + */ | ||
97 | + Builder setSubObjects(LinkedList<PcepValueType> llSubObjects); | ||
98 | + | ||
99 | + /** | ||
100 | + * Sets P flag in IRO object header and returns its builder. | ||
101 | + * | ||
102 | + * @param value boolean value to set P flag | ||
103 | + * @return Builder by setting P flag | ||
104 | + */ | ||
105 | + Builder setPFlag(boolean value); | ||
106 | + | ||
107 | + /** | ||
108 | + * Sets I flag in IRO object header and returns its builder. | ||
109 | + * | ||
110 | + * @param value boolean value to set I flag | ||
111 | + * @return Builder by setting I flag | ||
112 | + */ | ||
113 | + Builder setIFlag(boolean value); | ||
114 | + } | ||
115 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | + | ||
21 | +/** | ||
22 | + * Abstraction of an entity providing PCEP Keepalive Message. | ||
23 | + */ | ||
24 | +public interface PcepKeepaliveMsg extends PcepObject, PcepMessage { | ||
25 | + | ||
26 | + @Override | ||
27 | + PcepVersion getVersion(); | ||
28 | + | ||
29 | + @Override | ||
30 | + PcepType getType(); | ||
31 | + | ||
32 | + @Override | ||
33 | + void writeTo(ChannelBuffer channelBuffer); | ||
34 | + | ||
35 | + /** | ||
36 | + * Builder interface with get and set functions to build Keepalive message. | ||
37 | + */ | ||
38 | + public interface Builder extends PcepMessage.Builder { | ||
39 | + | ||
40 | + @Override | ||
41 | + PcepKeepaliveMsg build(); | ||
42 | + | ||
43 | + @Override | ||
44 | + PcepVersion getVersion(); | ||
45 | + | ||
46 | + @Override | ||
47 | + PcepType getType(); | ||
48 | + } | ||
49 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
24 | +import org.onosproject.pcepio.types.PcepValueType; | ||
25 | + | ||
26 | +/** | ||
27 | + * Abstraction of an entity providing PCEP Label Object. | ||
28 | + */ | ||
29 | +public interface PcepLabelObject { | ||
30 | + | ||
31 | + /** | ||
32 | + * Returns O flag in Label Object. | ||
33 | + * | ||
34 | + * @return Boolean value | ||
35 | + */ | ||
36 | + boolean getOFlag(); | ||
37 | + | ||
38 | + /** | ||
39 | + * Sets O flag in Label Object with specified value. | ||
40 | + * | ||
41 | + * @param value O flag | ||
42 | + */ | ||
43 | + void setOFlag(boolean value); | ||
44 | + | ||
45 | + /** | ||
46 | + * Returns Label from Label Object. | ||
47 | + * | ||
48 | + * @return Label value | ||
49 | + */ | ||
50 | + int getLabel(); | ||
51 | + | ||
52 | + /** | ||
53 | + * Sets Label field in Label Object with specified value. | ||
54 | + * | ||
55 | + * @param value Label | ||
56 | + */ | ||
57 | + void setLabel(int value); | ||
58 | + | ||
59 | + /** | ||
60 | + * Returns list of Optional Tlvs. | ||
61 | + * | ||
62 | + * @return list of Optional Tlvs | ||
63 | + */ | ||
64 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Sets Optional Tlvs in Label Object. | ||
68 | + * | ||
69 | + * @param llOptionalTlv list of Optional Tlvs | ||
70 | + */ | ||
71 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
72 | + | ||
73 | + /** | ||
74 | + * Prints attributes of Label object. | ||
75 | + */ | ||
76 | + void print(); | ||
77 | + | ||
78 | + /** | ||
79 | + * Writes the Label Object into channel buffer. | ||
80 | + * | ||
81 | + * @param bb channel buffer | ||
82 | + * @return Returns the writerIndex of this buffer | ||
83 | + * @throws PcepParseException while writing LABEL object into Channel Buffer. | ||
84 | + */ | ||
85 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
86 | + | ||
87 | + /** | ||
88 | + * Builder interface with get and set functions to build Label object. | ||
89 | + */ | ||
90 | + public interface Builder { | ||
91 | + | ||
92 | + /** | ||
93 | + * Builds Label Object. | ||
94 | + * | ||
95 | + * @return Label Object | ||
96 | + * @throws PcepParseException while building LABEL object. | ||
97 | + */ | ||
98 | + PcepLabelObject build() throws PcepParseException; | ||
99 | + | ||
100 | + /** | ||
101 | + * Returns Label object header. | ||
102 | + * | ||
103 | + * @return Label object header | ||
104 | + */ | ||
105 | + PcepObjectHeader getLabelObjHeader(); | ||
106 | + | ||
107 | + /** | ||
108 | + * Sets Label object header and returns its builder. | ||
109 | + * | ||
110 | + * @param obj Label object header | ||
111 | + * @return Builder by setting Label object header | ||
112 | + */ | ||
113 | + Builder setLabelObjHeader(PcepObjectHeader obj); | ||
114 | + | ||
115 | + /** | ||
116 | + * Returns O flag in Label Object. | ||
117 | + * | ||
118 | + * @return Label value | ||
119 | + */ | ||
120 | + boolean getOFlag(); | ||
121 | + | ||
122 | + /** | ||
123 | + * Sets O flag and return its builder. | ||
124 | + * | ||
125 | + * @param value O flag | ||
126 | + * @return Builder by setting O flag | ||
127 | + */ | ||
128 | + Builder setOFlag(boolean value); | ||
129 | + | ||
130 | + /** | ||
131 | + * Returns Label from Label Object. | ||
132 | + * | ||
133 | + * @return Label value | ||
134 | + */ | ||
135 | + int getLabel(); | ||
136 | + | ||
137 | + /** | ||
138 | + * Sets Label field and return its builder. | ||
139 | + * | ||
140 | + * @param value Label field | ||
141 | + * @return Builder by setting Label field | ||
142 | + */ | ||
143 | + Builder setLabel(int value); | ||
144 | + | ||
145 | + /** | ||
146 | + * Returns list of Optional Tlvs. | ||
147 | + * | ||
148 | + * @return list of Optional Tlvs | ||
149 | + */ | ||
150 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
151 | + | ||
152 | + /** | ||
153 | + * Sets list of Optional Tlvs and return its builder. | ||
154 | + * | ||
155 | + * @param llOptionalTlv list of Optional Tlvs | ||
156 | + * @return Builder by setting list of Optional Tlvs | ||
157 | + */ | ||
158 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
159 | + | ||
160 | + /** | ||
161 | + * Sets P flag in Label object header and returns its builder. | ||
162 | + * | ||
163 | + * @param value boolean value to set P flag | ||
164 | + * @return Builder by setting P flag | ||
165 | + */ | ||
166 | + public Builder setPFlag(boolean value); | ||
167 | + | ||
168 | + /** | ||
169 | + * Sets I flag in Label object header and returns its builder. | ||
170 | + * | ||
171 | + * @param value boolean value to set I flag | ||
172 | + * @return Builder by setting I flag | ||
173 | + */ | ||
174 | + public Builder setIFlag(boolean value); | ||
175 | + } | ||
176 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP Label Range. | ||
26 | + */ | ||
27 | +public interface PcepLabelRange { | ||
28 | + | ||
29 | + /** | ||
30 | + * Returns object of PCEP SRP Object. | ||
31 | + * | ||
32 | + * @return srpObject | ||
33 | + */ | ||
34 | + public PcepSrpObject getSrpObject(); | ||
35 | + | ||
36 | + /** | ||
37 | + * Sets PCEP SRP Object. | ||
38 | + * | ||
39 | + * @param srpObject SRP object. | ||
40 | + */ | ||
41 | + public void setSrpObject(PcepSrpObject srpObject); | ||
42 | + | ||
43 | + /** | ||
44 | + * Returns list of PcepLabelRangeObject. | ||
45 | + * | ||
46 | + * @return Label Range List | ||
47 | + */ | ||
48 | + public LinkedList<PcepLabelRangeObject> getLabelRangeList(); | ||
49 | + | ||
50 | + /** | ||
51 | + * Sets list of PcepLabelRangeObject. | ||
52 | + * | ||
53 | + * @param llLabelRangeList Label Range List | ||
54 | + */ | ||
55 | + public void setLabelRangeList(LinkedList<PcepLabelRangeObject> llLabelRangeList); | ||
56 | + | ||
57 | + /** | ||
58 | + * Write the byte stream of PcepLabelRange to channel buffer. | ||
59 | + * | ||
60 | + * @param bb of type channel buffer | ||
61 | + * @return object length index | ||
62 | + * @throws PcepParseException while writing LABEL RANGE into Channel Buffer. | ||
63 | + */ | ||
64 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
65 | + | ||
66 | + /** | ||
67 | + * Prints Attributes of PcepLabelRange. | ||
68 | + */ | ||
69 | + public void print(); | ||
70 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
22 | + | ||
23 | +/** | ||
24 | + * Abstraction of an entity providing PCEP LabelRange Object. | ||
25 | + */ | ||
26 | +public interface PcepLabelRangeObject { | ||
27 | + | ||
28 | + /** | ||
29 | + * Sets LabelRange Object header. | ||
30 | + * | ||
31 | + * @param obj LabelRange Object header | ||
32 | + */ | ||
33 | + void setLabelRangeObjHeader(PcepObjectHeader obj); | ||
34 | + | ||
35 | + /** | ||
36 | + * Sets LabelType in LabelRange Object. | ||
37 | + * | ||
38 | + * @param labelType label type value | ||
39 | + */ | ||
40 | + void setLabelType(byte labelType); | ||
41 | + | ||
42 | + /** | ||
43 | + * Sets RangeSize in LabelRange Object. | ||
44 | + * | ||
45 | + * @param rangeSize range size value | ||
46 | + */ | ||
47 | + void setRangeSize(int rangeSize); | ||
48 | + | ||
49 | + /** | ||
50 | + * Sets LabelBase in LabelRange Object. | ||
51 | + * | ||
52 | + * @param labelBase label base value | ||
53 | + */ | ||
54 | + void setLabelBase(int labelBase); | ||
55 | + | ||
56 | + /** | ||
57 | + * Returns LabelRange object header. | ||
58 | + * | ||
59 | + * @return LabelRange object header | ||
60 | + */ | ||
61 | + PcepObjectHeader getLabelRangeObjHeader(); | ||
62 | + | ||
63 | + /** | ||
64 | + * Returns LabelType field in LabelRange object. | ||
65 | + * | ||
66 | + * @return LabelType field in LabelRange object | ||
67 | + */ | ||
68 | + byte getLabelType(); | ||
69 | + | ||
70 | + /** | ||
71 | + * Returns RangeSize field in LabelRange object. | ||
72 | + * | ||
73 | + * @return RangeSize field in LabelRange object | ||
74 | + */ | ||
75 | + int getRangeSize(); | ||
76 | + | ||
77 | + /** | ||
78 | + * Returns LabelBase field in LabelRange object. | ||
79 | + * | ||
80 | + * @return LabelBase field in LabelRange object | ||
81 | + */ | ||
82 | + int getLabelBase(); | ||
83 | + | ||
84 | + /** | ||
85 | + * Prints attributes of LabelRange object. | ||
86 | + */ | ||
87 | + void print(); | ||
88 | + | ||
89 | + /** | ||
90 | + * Writes the LabelRange Object into channel buffer. | ||
91 | + * | ||
92 | + * @param bb channel buffer | ||
93 | + * @return Returns the writerIndex of this buffer | ||
94 | + * @throws PcepParseException while writing LABEL RANGE object into Channel Buffer. | ||
95 | + */ | ||
96 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
97 | + | ||
98 | + /** | ||
99 | + * Builder interface with get and set functions to build LabelRange object. | ||
100 | + */ | ||
101 | + public interface Builder { | ||
102 | + | ||
103 | + /** | ||
104 | + * Builds LabelRange Object. | ||
105 | + * | ||
106 | + * @return LabelRange Object | ||
107 | + * @throws PcepParseException while building LABEL RANGE object. | ||
108 | + */ | ||
109 | + PcepLabelRangeObject build() throws PcepParseException; | ||
110 | + | ||
111 | + /** | ||
112 | + * Returns LabelRange object header. | ||
113 | + * | ||
114 | + * @return LabelRange object header | ||
115 | + */ | ||
116 | + PcepObjectHeader getLabelRangeObjHeader(); | ||
117 | + | ||
118 | + /** | ||
119 | + * Sets LabelRange object header and returns its builder. | ||
120 | + * | ||
121 | + * @param obj LabelRange object header | ||
122 | + * @return Builder by setting LabelRange object header | ||
123 | + */ | ||
124 | + Builder setLabelRangeObjHeader(PcepObjectHeader obj); | ||
125 | + | ||
126 | + /** | ||
127 | + * Returns LabelType field in LabelRange object. | ||
128 | + * | ||
129 | + * @return LabelType field in LabelRange object | ||
130 | + */ | ||
131 | + byte getLabelType(); | ||
132 | + | ||
133 | + /** | ||
134 | + * Sets LabelType field and returns its builder. | ||
135 | + * | ||
136 | + * @param labelType LabelType field | ||
137 | + * @return Builder by setting LabelType field | ||
138 | + */ | ||
139 | + Builder setLabelType(byte labelType); | ||
140 | + | ||
141 | + /** | ||
142 | + * Returns RangeSize field in LabelRange object. | ||
143 | + * | ||
144 | + * @return RangeSize field in LabelRange object | ||
145 | + */ | ||
146 | + int getRangeSize(); | ||
147 | + | ||
148 | + /** | ||
149 | + * Sets RangeSize field and returns its builder. | ||
150 | + * | ||
151 | + * @param rangeSize RangeSize field | ||
152 | + * @return Builder by setting RangeSize field | ||
153 | + */ | ||
154 | + Builder setRangeSize(int rangeSize); | ||
155 | + | ||
156 | + /** | ||
157 | + * Returns LabelBase field in LabelRange object. | ||
158 | + * | ||
159 | + * @return LabelBase field in LabelRange object | ||
160 | + */ | ||
161 | + int getLabelBase(); | ||
162 | + | ||
163 | + /** | ||
164 | + * Sets LabelBase field and returns its builder. | ||
165 | + * | ||
166 | + * @param labelBase LabelBase field | ||
167 | + * @return Builder by setting LabelBase field | ||
168 | + */ | ||
169 | + Builder setLabelBase(int labelBase); | ||
170 | + | ||
171 | + /** | ||
172 | + * Sets P flag in TE object header and returns its builder. | ||
173 | + * | ||
174 | + * @param value boolean value to set P flag | ||
175 | + * @return Builder by setting P flag | ||
176 | + */ | ||
177 | + Builder setPFlag(boolean value); | ||
178 | + | ||
179 | + /** | ||
180 | + * Sets I flag in TE object header and returns its builder. | ||
181 | + * | ||
182 | + * @param value boolean value to set I flag | ||
183 | + * @return Builder by setting I flag | ||
184 | + */ | ||
185 | + Builder setIFlag(boolean value); | ||
186 | + } | ||
187 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Label Range Reservation Message. | ||
24 | + */ | ||
25 | +public interface PcepLabelRangeResvMsg extends PcepObject, PcepMessage { | ||
26 | + | ||
27 | + @Override | ||
28 | + PcepVersion getVersion(); | ||
29 | + | ||
30 | + @Override | ||
31 | + PcepType getType(); | ||
32 | + | ||
33 | + /** | ||
34 | + * Returns LabelRange field in Label Range Reservation message. | ||
35 | + * | ||
36 | + * @return LabelRange field | ||
37 | + */ | ||
38 | + PcepLabelRange getLabelRange(); | ||
39 | + | ||
40 | + /** | ||
41 | + * Sets LabelRange field in Label Range Reservation message with specified value. | ||
42 | + * | ||
43 | + * @param lR label range object | ||
44 | + */ | ||
45 | + void setLabelRange(PcepLabelRange lR); | ||
46 | + | ||
47 | + @Override | ||
48 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
49 | + | ||
50 | + /** | ||
51 | + * Builder interface with get and set functions to build Label Range Reservation message. | ||
52 | + */ | ||
53 | + public interface Builder extends PcepMessage.Builder { | ||
54 | + | ||
55 | + @Override | ||
56 | + PcepLabelRangeResvMsg build(); | ||
57 | + | ||
58 | + @Override | ||
59 | + PcepVersion getVersion(); | ||
60 | + | ||
61 | + @Override | ||
62 | + PcepType getType(); | ||
63 | + | ||
64 | + /** | ||
65 | + * Returns LabelRange field in Label Range Reservation message. | ||
66 | + * | ||
67 | + * @return LabelRange object | ||
68 | + */ | ||
69 | + PcepLabelRange getLabelRange(); | ||
70 | + | ||
71 | + /** | ||
72 | + * Sets LabelRange field and returns its Builder. | ||
73 | + * | ||
74 | + * @param lR label range object | ||
75 | + * @return builder by setting LabelRange field | ||
76 | + */ | ||
77 | + Builder setLabelRange(PcepLabelRange lR); | ||
78 | + } | ||
79 | +} |
1 | +/* | ||
2 | + * Copyright 2014 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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
19 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
20 | +import org.onosproject.pcepio.types.PcepLabelDownload; | ||
21 | +import org.onosproject.pcepio.types.PcepLabelMap; | ||
22 | + | ||
23 | +/*** | ||
24 | + * Abstraction to provide PCEP Label Updates. | ||
25 | + */ | ||
26 | +public interface PcepLabelUpdate { | ||
27 | + | ||
28 | + /** | ||
29 | + * Writes the byte stream of PcepLabelUpdate into channel buffer. | ||
30 | + * | ||
31 | + * @param bb of type channel buffer | ||
32 | + * @throws PcepParseException while writing LABEL UPDATE. | ||
33 | + */ | ||
34 | + public void write(ChannelBuffer bb) throws PcepParseException; | ||
35 | + | ||
36 | + /** | ||
37 | + * Sets the Label Download object. | ||
38 | + * | ||
39 | + * @param labelDownload PCEP Label Download object | ||
40 | + */ | ||
41 | + public void setLabelDownload(PcepLabelDownload labelDownload); | ||
42 | + | ||
43 | + /** | ||
44 | + * Returns the PcepLabelDownload object. | ||
45 | + * | ||
46 | + * @return labelDownload PCEP Label Download | ||
47 | + */ | ||
48 | + public PcepLabelDownload getLabelDownload(); | ||
49 | + | ||
50 | + /** | ||
51 | + * Sets the Label map object. | ||
52 | + * | ||
53 | + * @param labelMap PCEP Label Map object | ||
54 | + */ | ||
55 | + public void setLabelMap(PcepLabelMap labelMap); | ||
56 | + | ||
57 | + /** | ||
58 | + * Returns the PcepLabelMap object. | ||
59 | + * | ||
60 | + * @return labelMap PCEP Label Map | ||
61 | + */ | ||
62 | + public PcepLabelMap getLabelMap(); | ||
63 | + | ||
64 | + /** | ||
65 | + * Prints the attributes of PCEP Label update. | ||
66 | + */ | ||
67 | + public void print(); | ||
68 | + | ||
69 | + /** | ||
70 | + * Builder interface with get and set functions to build Label Update message. | ||
71 | + */ | ||
72 | + public interface Builder { | ||
73 | + | ||
74 | + /** | ||
75 | + * Builds PcepLableUpdate Object. | ||
76 | + * | ||
77 | + * @return PcepLableUpdate Object | ||
78 | + * @throws PcepParseException while building LABEL-UPDATE. | ||
79 | + */ | ||
80 | + PcepLabelUpdate build() throws PcepParseException; | ||
81 | + | ||
82 | + /** | ||
83 | + * Sets the Label Download object. | ||
84 | + * | ||
85 | + * @param labelDownload PCEP Label Download object | ||
86 | + * @return Builder by setting labelDownload object | ||
87 | + */ | ||
88 | + Builder setLabelDownload(PcepLabelDownload labelDownload); | ||
89 | + | ||
90 | + /** | ||
91 | + * Returns the PcepLabelDownload object. | ||
92 | + * | ||
93 | + * @return labelDownload PCEP Label Download | ||
94 | + */ | ||
95 | + PcepLabelDownload getLabelDownload(); | ||
96 | + | ||
97 | + /** | ||
98 | + * Sets the Label map object. | ||
99 | + * | ||
100 | + * @param labelMap PCEP Label Map object | ||
101 | + * @return Builder by setting PcepLabelMap object | ||
102 | + */ | ||
103 | + Builder setLabelMap(PcepLabelMap labelMap); | ||
104 | + | ||
105 | + /** | ||
106 | + * Returns the PcepLabelMap object. | ||
107 | + * | ||
108 | + * @return labelMap PCEP Label Map | ||
109 | + */ | ||
110 | + PcepLabelMap getLabelMap(); | ||
111 | + } | ||
112 | + | ||
113 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP Label Update Message. | ||
26 | + */ | ||
27 | +public interface PcepLabelUpdateMsg extends PcepObject, PcepMessage { | ||
28 | + | ||
29 | + @Override | ||
30 | + PcepVersion getVersion(); | ||
31 | + | ||
32 | + @Override | ||
33 | + PcepType getType(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Returns list of PcLabelUpdateList. | ||
37 | + * | ||
38 | + * @return list of PcLabelUpdateList. | ||
39 | + */ | ||
40 | + LinkedList<PcepLabelUpdate> getPcLabelUpdateList(); | ||
41 | + | ||
42 | + /** | ||
43 | + * Sets list of PcLabelUpdateList. | ||
44 | + * | ||
45 | + * @param llPcLabelUpdateList list of PcLabelUpdateList | ||
46 | + */ | ||
47 | + void setPcLabelUpdateList(LinkedList<PcepLabelUpdate> llPcLabelUpdateList); | ||
48 | + | ||
49 | + @Override | ||
50 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
51 | + | ||
52 | + /** | ||
53 | + * Builder interface with get and set functions to build Label Update message. | ||
54 | + */ | ||
55 | + public interface Builder extends PcepMessage.Builder { | ||
56 | + | ||
57 | + @Override | ||
58 | + PcepLabelUpdateMsg build(); | ||
59 | + | ||
60 | + @Override | ||
61 | + PcepVersion getVersion(); | ||
62 | + | ||
63 | + @Override | ||
64 | + PcepType getType(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns list of PcLabelUpdateList. | ||
68 | + * | ||
69 | + * @return list of PcLabelUpdateList. | ||
70 | + */ | ||
71 | + LinkedList<PcepLabelUpdate> getPcLabelUpdateList(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets list of PcLabelUpdateList. | ||
75 | + * | ||
76 | + * @param llPcLabelUpdateList list of PcLabelUpdateList. | ||
77 | + * @return Builder by setting list of PcLabelUpdateList. | ||
78 | + */ | ||
79 | + Builder setPcLabelUpdateList(LinkedList<PcepLabelUpdate> llPcLabelUpdateList); | ||
80 | + } | ||
81 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
24 | +import org.onosproject.pcepio.types.PcepValueType; | ||
25 | + | ||
26 | +/** | ||
27 | + * Abstraction of an entity providing PCEP LSP Object. | ||
28 | + */ | ||
29 | +public interface PcepLspObject { | ||
30 | + | ||
31 | + /** | ||
32 | + * Returns PlspId of LSP Object. | ||
33 | + * | ||
34 | + * @return PlspId of LSP Object | ||
35 | + */ | ||
36 | + int getPlspId(); | ||
37 | + | ||
38 | + /** | ||
39 | + * Sets PlspId with specified value. | ||
40 | + * | ||
41 | + * @param value PlspId | ||
42 | + */ | ||
43 | + void setPlspId(int value); | ||
44 | + | ||
45 | + /** | ||
46 | + * Returns O flag in LSP Object. | ||
47 | + * | ||
48 | + * @return O flag in LSP Object | ||
49 | + */ | ||
50 | + byte getOFlag(); | ||
51 | + | ||
52 | + /** | ||
53 | + * Sets O flag with specified value. | ||
54 | + * | ||
55 | + * @param value O flag | ||
56 | + */ | ||
57 | + void setOFlag(byte value); | ||
58 | + | ||
59 | + /** | ||
60 | + * Returns A flag in LSP Object. | ||
61 | + * | ||
62 | + * @return A flag in LSP Object | ||
63 | + */ | ||
64 | + boolean getAFlag(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Sets A flag with specified value. | ||
68 | + * | ||
69 | + * @param value A flag | ||
70 | + */ | ||
71 | + void setAFlag(boolean value); | ||
72 | + | ||
73 | + /** | ||
74 | + * Returns R flag in LSP Object. | ||
75 | + * | ||
76 | + * @return R flag in LSP Object | ||
77 | + */ | ||
78 | + boolean getRFlag(); | ||
79 | + | ||
80 | + /** | ||
81 | + * Sets R flag with specified value. | ||
82 | + * | ||
83 | + * @param value R flag | ||
84 | + */ | ||
85 | + void setRFlag(boolean value); | ||
86 | + | ||
87 | + /** | ||
88 | + * Returns S flag in LSP Object. | ||
89 | + * | ||
90 | + * @return S flag in LSP Object | ||
91 | + */ | ||
92 | + boolean getSFlag(); | ||
93 | + | ||
94 | + /** | ||
95 | + * Sets S flag with specified value. | ||
96 | + * | ||
97 | + * @param value S flag | ||
98 | + */ | ||
99 | + void setSFlag(boolean value); | ||
100 | + | ||
101 | + /** | ||
102 | + * Returns D flag in LSP Object. | ||
103 | + * | ||
104 | + * @return D flag in LSP Object | ||
105 | + */ | ||
106 | + boolean getDFlag(); | ||
107 | + | ||
108 | + /** | ||
109 | + * Sets D flag with specified value. | ||
110 | + * | ||
111 | + * @param value D flag | ||
112 | + */ | ||
113 | + void setDFlag(boolean value); | ||
114 | + | ||
115 | + /** | ||
116 | + * Returns list of Optional Tlvs in LSP Object. | ||
117 | + * | ||
118 | + * @return list of Optional Tlvs | ||
119 | + */ | ||
120 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
121 | + | ||
122 | + /** | ||
123 | + * Sets list of Optional Tlvs in LSP Object. | ||
124 | + * | ||
125 | + * @param llOptionalTlv list of Optional Tlvs | ||
126 | + */ | ||
127 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
128 | + | ||
129 | + /** | ||
130 | + * Prints attributes of LSP object. | ||
131 | + */ | ||
132 | + void print(); | ||
133 | + | ||
134 | + /** | ||
135 | + * Writes the LSP Object into channel buffer. | ||
136 | + * | ||
137 | + * @param bb channel buffer | ||
138 | + * @return Returns the writerIndex of this buffer | ||
139 | + * @throws PcepParseException while writing LSP object into Channel Buffer. | ||
140 | + */ | ||
141 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
142 | + | ||
143 | + /** | ||
144 | + * Builder interface with get and set functions to build LSP object. | ||
145 | + */ | ||
146 | + public interface Builder { | ||
147 | + | ||
148 | + /** | ||
149 | + * Builds LSP Object. | ||
150 | + * | ||
151 | + * @return LSP Object | ||
152 | + */ | ||
153 | + PcepLspObject build(); | ||
154 | + | ||
155 | + /** | ||
156 | + * Returns LSP object header. | ||
157 | + * | ||
158 | + * @return LSP object header | ||
159 | + */ | ||
160 | + PcepObjectHeader getLspObjHeader(); | ||
161 | + | ||
162 | + /** | ||
163 | + * Sets LSP object header and returns its builder. | ||
164 | + * | ||
165 | + * @param obj LSP object header | ||
166 | + * @return Builder by setting LSP object header | ||
167 | + */ | ||
168 | + Builder setLspObjHeader(PcepObjectHeader obj); | ||
169 | + | ||
170 | + /** | ||
171 | + * Returns PlspId of LSP Object. | ||
172 | + * | ||
173 | + * @return PlspId of LSP Object | ||
174 | + */ | ||
175 | + int getPlspId(); | ||
176 | + | ||
177 | + /** | ||
178 | + * Sets PlspId with specific value and return its builder. | ||
179 | + * | ||
180 | + * @param value PlspId | ||
181 | + * @return Builder by setting PlspId | ||
182 | + */ | ||
183 | + Builder setPlspId(int value); | ||
184 | + | ||
185 | + /** | ||
186 | + * Returns O flag in LSP Object. | ||
187 | + * | ||
188 | + * @return O flag in LSP Object | ||
189 | + */ | ||
190 | + byte getOFlag(); | ||
191 | + | ||
192 | + /** | ||
193 | + * Sets O flag with specific value and return its builder. | ||
194 | + * | ||
195 | + * @param value O flag | ||
196 | + * @return Builder by setting O flag | ||
197 | + */ | ||
198 | + Builder setOFlag(byte value); | ||
199 | + | ||
200 | + /** | ||
201 | + * Returns A flag in LSP Object. | ||
202 | + * | ||
203 | + * @return A flag in LSP Object | ||
204 | + */ | ||
205 | + boolean getAFlag(); | ||
206 | + | ||
207 | + /** | ||
208 | + * Sets A flag with specific value and return its builder. | ||
209 | + * | ||
210 | + * @param value A flag | ||
211 | + * @return Builder by setting A flag | ||
212 | + */ | ||
213 | + Builder setAFlag(boolean value); | ||
214 | + | ||
215 | + /** | ||
216 | + * Returns A flag in LSP Object. | ||
217 | + * | ||
218 | + * @return A flag in LSP Object | ||
219 | + */ | ||
220 | + boolean getRFlag(); | ||
221 | + | ||
222 | + /** | ||
223 | + * Sets R flag with specific value and return its builder. | ||
224 | + * | ||
225 | + * @param value r flag | ||
226 | + * @return Builder by setting r flag | ||
227 | + */ | ||
228 | + Builder setRFlag(boolean value); | ||
229 | + | ||
230 | + /** | ||
231 | + * Returns S flag in LSP Object. | ||
232 | + * | ||
233 | + * @return S flag in LSP Object | ||
234 | + */ | ||
235 | + boolean getSFlag(); | ||
236 | + | ||
237 | + /** | ||
238 | + * Sets S flag with specific value and return its builder. | ||
239 | + * | ||
240 | + * @param value s flag | ||
241 | + * @return Builder by setting S flag | ||
242 | + */ | ||
243 | + Builder setSFlag(boolean value); | ||
244 | + | ||
245 | + /** | ||
246 | + * Returns D flag in LSP Object. | ||
247 | + * | ||
248 | + * @return D flag in LSP Object | ||
249 | + */ | ||
250 | + boolean getDFlag(); | ||
251 | + | ||
252 | + /** | ||
253 | + * Sets D flag with specific value and return its builder. | ||
254 | + * | ||
255 | + * @param value D flag | ||
256 | + * @return Builder by setting D flag | ||
257 | + */ | ||
258 | + Builder setDFlag(boolean value); | ||
259 | + | ||
260 | + /** | ||
261 | + * Returns list of Optional Tlvs in LSP Object. | ||
262 | + * | ||
263 | + * @return list of Optional Tlvs in LSP Object | ||
264 | + */ | ||
265 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
266 | + | ||
267 | + /** | ||
268 | + * Sets list of Optional Tlvs and return its builder. | ||
269 | + * | ||
270 | + * @param llOptionalTlv list of Optional Tlvs | ||
271 | + * @return Builder by setting list of Optional Tlvs | ||
272 | + */ | ||
273 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
274 | + | ||
275 | + /** | ||
276 | + * Sets P flag in LSP object header and returns its builder. | ||
277 | + * | ||
278 | + * @param value boolean value to set P flag | ||
279 | + * @return Builder by setting P flag | ||
280 | + */ | ||
281 | + Builder setPFlag(boolean value); | ||
282 | + | ||
283 | + /** | ||
284 | + * Sets I flag in LSP object header and returns its builder. | ||
285 | + * | ||
286 | + * @param value boolean value to set I flag | ||
287 | + * @return Builder by setting I flag | ||
288 | + */ | ||
289 | + Builder setIFlag(boolean value); | ||
290 | + } | ||
291 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | + | ||
20 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
21 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
22 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
23 | +import org.onosproject.pcepio.types.PcepValueType; | ||
24 | + | ||
25 | +/** | ||
26 | + * Abstraction of an entity providing PCEP LSPA Object. | ||
27 | + */ | ||
28 | +public interface PcepLspaObject { | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns L flag in LSPA Object. | ||
32 | + * | ||
33 | + * @return L flag in LSPA Object | ||
34 | + */ | ||
35 | + boolean getLFlag(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Sets L flag in LSPA Object. | ||
39 | + * | ||
40 | + * @param value L flag | ||
41 | + */ | ||
42 | + void setLFlag(boolean value); | ||
43 | + | ||
44 | + /** | ||
45 | + * Returns Exclude Any field in LSPA Object. | ||
46 | + * | ||
47 | + * @return Exclude Any field in LSPA Object | ||
48 | + */ | ||
49 | + int getExcludeAny(); | ||
50 | + | ||
51 | + /** | ||
52 | + * Sets Exclude Any field in LSPA Object. | ||
53 | + * | ||
54 | + * @param value Exclude Any field | ||
55 | + */ | ||
56 | + void setExcludeAny(int value); | ||
57 | + | ||
58 | + /** | ||
59 | + * Returns Include Any field in LSPA Object. | ||
60 | + * | ||
61 | + * @return Include Any field in LSPA Object | ||
62 | + */ | ||
63 | + int getIncludeAny(); | ||
64 | + | ||
65 | + /** | ||
66 | + * Sets Include Any field in LSPA Object. | ||
67 | + * | ||
68 | + * @param value Include Any field | ||
69 | + */ | ||
70 | + void setIncludeAny(int value); | ||
71 | + | ||
72 | + /** | ||
73 | + * Returns Include All field in LSPA Object. | ||
74 | + * | ||
75 | + * @return Include All field in LSPA Object | ||
76 | + */ | ||
77 | + int getIncludeAll(); | ||
78 | + | ||
79 | + /** | ||
80 | + * Sets Include All field in LSPA Object. | ||
81 | + * | ||
82 | + * @param value Include All field | ||
83 | + */ | ||
84 | + void setIncludeAll(int value); | ||
85 | + | ||
86 | + /** | ||
87 | + * Returns Setup Priority field in LSPA Object. | ||
88 | + * | ||
89 | + * @return Setup Priority field in LSPA Object | ||
90 | + */ | ||
91 | + byte getSetupPriority(); | ||
92 | + | ||
93 | + /** | ||
94 | + * Sets Setup Priority field in LSPA Object. | ||
95 | + * | ||
96 | + * @param value Setup Priority field | ||
97 | + */ | ||
98 | + void setSetupPriority(byte value); | ||
99 | + | ||
100 | + /** | ||
101 | + * Returns Hold Priority field in LSPA Object. | ||
102 | + * | ||
103 | + * @return Hold Priority field in LSPA Object | ||
104 | + */ | ||
105 | + byte getHoldPriority(); | ||
106 | + | ||
107 | + /** | ||
108 | + * Sets Hold Priority field in LSPA Object. | ||
109 | + * | ||
110 | + * @param value Hold Priority field | ||
111 | + */ | ||
112 | + void setHoldPriority(byte value); | ||
113 | + | ||
114 | + /** | ||
115 | + * Returns list of Optional Tlvs in LSPA Object. | ||
116 | + * | ||
117 | + * @return list of Optional Tlvs in LSPA Object | ||
118 | + */ | ||
119 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
120 | + | ||
121 | + /** | ||
122 | + * Sets Optional Tlvs in LSPA Object. | ||
123 | + * | ||
124 | + * @param llOptionalTlv Optional Tlvs in LSPA Object | ||
125 | + */ | ||
126 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
127 | + | ||
128 | + /** | ||
129 | + * Prints attributes of LSPA object. | ||
130 | + */ | ||
131 | + void print(); | ||
132 | + | ||
133 | + /** | ||
134 | + * Writes the LSPA Object into channel buffer. | ||
135 | + * | ||
136 | + * @param bb channel buffer | ||
137 | + * @return Returns the writerIndex of this buffer | ||
138 | + * @throws PcepParseException while writing LSPA object into Channel Buffer. | ||
139 | + */ | ||
140 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
141 | + | ||
142 | + /** | ||
143 | + * Builder interface with get and set functions to build bandwidth object. | ||
144 | + */ | ||
145 | + public interface Builder { | ||
146 | + | ||
147 | + /** | ||
148 | + * Builds LSPA Object. | ||
149 | + * | ||
150 | + * @return LSPA Object | ||
151 | + * @throws PcepParseException while building LSPA object. | ||
152 | + */ | ||
153 | + PcepLspaObject build() throws PcepParseException; | ||
154 | + | ||
155 | + /** | ||
156 | + * Returns LSPA object header. | ||
157 | + * | ||
158 | + * @return LSPA object header | ||
159 | + */ | ||
160 | + PcepObjectHeader getLspaObjHeader(); | ||
161 | + | ||
162 | + /** | ||
163 | + * Sets LSPA object header and returns its builder. | ||
164 | + * | ||
165 | + * @param obj LSPA object header | ||
166 | + * @return Builder by setting LSPA object header | ||
167 | + */ | ||
168 | + Builder setLspaObjHeader(PcepObjectHeader obj); | ||
169 | + | ||
170 | + /** | ||
171 | + * Returns L flag in LSPA Object. | ||
172 | + * | ||
173 | + * @return L flag in LSPA Object | ||
174 | + */ | ||
175 | + boolean getLFlag(); | ||
176 | + | ||
177 | + /** | ||
178 | + * Sets L flag in LSPA Object and return its builder. | ||
179 | + * | ||
180 | + * @param value L flag in LSPA Object | ||
181 | + * @return Builder by setting L flag | ||
182 | + */ | ||
183 | + Builder setLFlag(boolean value); | ||
184 | + | ||
185 | + /** | ||
186 | + * Returns Exclude Any field in LSPA Object. | ||
187 | + * | ||
188 | + * @return Exclude Any field in LSPA Object | ||
189 | + */ | ||
190 | + int getExcludeAny(); | ||
191 | + | ||
192 | + /** | ||
193 | + * Sets Exclude Any field in LSPA Object and return its builder. | ||
194 | + * | ||
195 | + * @param value Exclude Any field in LSPA Object | ||
196 | + * @return Builder by setting Exclude Any field | ||
197 | + */ | ||
198 | + Builder setExcludeAny(int value); | ||
199 | + | ||
200 | + /** | ||
201 | + * Returns Include Any field in LSPA Object. | ||
202 | + * | ||
203 | + * @return Include Any field in LSPA Object | ||
204 | + */ | ||
205 | + int getIncludeAny(); | ||
206 | + | ||
207 | + /** | ||
208 | + * Sets Include Any field in LSPA Object and return its builder. | ||
209 | + * | ||
210 | + * @param value Include Any field in LSPA Object | ||
211 | + * @return Builder by setting Include Any field | ||
212 | + */ | ||
213 | + Builder setIncludeAny(int value); | ||
214 | + | ||
215 | + /** | ||
216 | + * Returns Include All field in LSPA Object. | ||
217 | + * | ||
218 | + * @return Include All field in LSPA Object | ||
219 | + */ | ||
220 | + int getIncludeAll(); | ||
221 | + | ||
222 | + /** | ||
223 | + * Sets Include All field in LSPA Object and return its builder. | ||
224 | + * | ||
225 | + * @param value Include All field in LSPA Object | ||
226 | + * @return Builder by setting Include All field | ||
227 | + */ | ||
228 | + Builder setIncludeAll(int value); | ||
229 | + | ||
230 | + /** | ||
231 | + * Returns Setup Priority field in LSPA Object. | ||
232 | + * | ||
233 | + * @return Setup Priority field in LSPA Object | ||
234 | + */ | ||
235 | + byte getSetupPriority(); | ||
236 | + | ||
237 | + /** | ||
238 | + * Sets Setup Priority field in LSPA Object and return its builder. | ||
239 | + * | ||
240 | + * @param value Setup Priority field in LSPA Object | ||
241 | + * @return Builder by setting Setup Priority field | ||
242 | + */ | ||
243 | + Builder setSetupPriority(byte value); | ||
244 | + | ||
245 | + /** | ||
246 | + * Returns Hold Priority field in LSPA Object. | ||
247 | + * | ||
248 | + * @return Hold Priority field in LSPA Object | ||
249 | + */ | ||
250 | + byte getHoldPriority(); | ||
251 | + | ||
252 | + /** | ||
253 | + * Sets Hold Priority field in LSPA Object and return its builder. | ||
254 | + * | ||
255 | + * @param value Hold Priority field in LSPA Object | ||
256 | + * @return Builder by setting Hold Priority field | ||
257 | + */ | ||
258 | + Builder setHoldPriority(byte value); | ||
259 | + | ||
260 | + /** | ||
261 | + * Returns list of Optional Tlvs in LSPA Object. | ||
262 | + * | ||
263 | + * @return list of Optional Tlvs in LSPA Object | ||
264 | + */ | ||
265 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
266 | + | ||
267 | + /** | ||
268 | + * Sets list of Optional Tlvs in LSPA Object. | ||
269 | + * | ||
270 | + * @param llOptionalTlv list of Optional Tlvs | ||
271 | + * @return builder by setting list of Optional Tlvs | ||
272 | + */ | ||
273 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
274 | + | ||
275 | + /** | ||
276 | + * Sets P flag in LSPA object header and returns its builder. | ||
277 | + * | ||
278 | + * @param value boolean value to set P flag | ||
279 | + * @return Builder by setting P flag | ||
280 | + */ | ||
281 | + Builder setPFlag(boolean value); | ||
282 | + | ||
283 | + /** | ||
284 | + * Sets I flag in LSPA object header and returns its builder. | ||
285 | + * | ||
286 | + * @param value boolean value to set I flag | ||
287 | + * @return Builder by setting I flag | ||
288 | + */ | ||
289 | + Builder setIFlag(boolean value); | ||
290 | + } | ||
291 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Messages. | ||
24 | + */ | ||
25 | +public interface PcepMessage extends PcepObject { | ||
26 | + | ||
27 | + @Override | ||
28 | + PcepVersion getVersion(); | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns Type of PCEP Message. | ||
32 | + * | ||
33 | + * @return Type of PCEP Message | ||
34 | + */ | ||
35 | + PcepType getType(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Prints attributes of PCEP Messages. | ||
39 | + */ | ||
40 | + void print(); | ||
41 | + | ||
42 | + @Override | ||
43 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
44 | + | ||
45 | + /** | ||
46 | + * Builder interface with get and set functions to build PCEP Message. | ||
47 | + */ | ||
48 | + public interface Builder { | ||
49 | + | ||
50 | + /** | ||
51 | + * Builds PCEP Message. | ||
52 | + * | ||
53 | + * @return PCEP Message | ||
54 | + * @throws PcepParseException when build fails to create PCEP message | ||
55 | + */ | ||
56 | + PcepMessage build() throws PcepParseException; | ||
57 | + | ||
58 | + /** | ||
59 | + * Returns Version of PCEP Message. | ||
60 | + * | ||
61 | + * @return Version of PCEP Message | ||
62 | + */ | ||
63 | + PcepVersion getVersion(); | ||
64 | + | ||
65 | + /** | ||
66 | + * Returns Type of PCEP Message. | ||
67 | + * | ||
68 | + * @return Type of PCEP Message | ||
69 | + */ | ||
70 | + PcepType getType(); | ||
71 | + } | ||
72 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Message Reader. | ||
24 | + */ | ||
25 | +public interface PcepMessageReader<T> { | ||
26 | + | ||
27 | + /** | ||
28 | + * Reads the Objects in the PCEP Message and Returns PCEP Message. | ||
29 | + * | ||
30 | + * @param bb Channel Buffer | ||
31 | + * @return PCEP Message | ||
32 | + * @throws PcepParseException while parsing PCEP message. | ||
33 | + * @throws PcepParseException when received message is empty | ||
34 | + */ | ||
35 | + T readFrom(ChannelBuffer bb) throws PcepParseException; | ||
36 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Message Writer. | ||
24 | + */ | ||
25 | +public interface PcepMessageWriter<T> { | ||
26 | + | ||
27 | + /** | ||
28 | + * Writes the Objects of the PCEP Message into Channel Buffer. | ||
29 | + * | ||
30 | + * @param bb Channel Buffer | ||
31 | + * @param message PCEP Message | ||
32 | + * @throws PcepParseException while writing PCEP message. | ||
33 | + */ | ||
34 | + public void write(ChannelBuffer bb, T message) throws PcepParseException; | ||
35 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
19 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
20 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Metric Object. | ||
24 | + */ | ||
25 | +public interface PcepMetricObject { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns Metric value in Metric Object. | ||
29 | + * | ||
30 | + * @return Metric value | ||
31 | + */ | ||
32 | + int getMetricVal(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Sets Metric value in Metric Object with specified value. | ||
36 | + * | ||
37 | + * @param value Metric value | ||
38 | + */ | ||
39 | + void setMetricVal(int value); | ||
40 | + | ||
41 | + /** | ||
42 | + * Returns Y flag in Metric Object. | ||
43 | + * | ||
44 | + * @return Y flag in Metric Object | ||
45 | + */ | ||
46 | + byte getYFlag(); | ||
47 | + | ||
48 | + /** | ||
49 | + * Sets Y flag in Metric Object with specified value. | ||
50 | + * | ||
51 | + * @param value Y flag | ||
52 | + */ | ||
53 | + void setYFlag(byte value); | ||
54 | + | ||
55 | + /** | ||
56 | + * Returns C flag in Metric Object. | ||
57 | + * | ||
58 | + * @return C flag in Metric Object | ||
59 | + */ | ||
60 | + boolean getCFlag(); | ||
61 | + | ||
62 | + /** | ||
63 | + * Sets C flag in Metric Object with specified value. | ||
64 | + * | ||
65 | + * @param value C flag | ||
66 | + */ | ||
67 | + void setCFlag(boolean value); | ||
68 | + | ||
69 | + /** | ||
70 | + * Returns B flag in Metric Object. | ||
71 | + * | ||
72 | + * @return B flag in Metric Object | ||
73 | + */ | ||
74 | + boolean getBFlag(); | ||
75 | + | ||
76 | + /** | ||
77 | + * Sets B flag in Metric Object with specified value. | ||
78 | + * | ||
79 | + * @param value B flag | ||
80 | + */ | ||
81 | + void setBFlag(boolean value); | ||
82 | + | ||
83 | + /** | ||
84 | + * Returns BType field in Metric Object. | ||
85 | + * | ||
86 | + * @return BType field in Metric Object | ||
87 | + */ | ||
88 | + byte getBType(); | ||
89 | + | ||
90 | + /** | ||
91 | + * Sets BType field in Metric Object with specified value. | ||
92 | + * | ||
93 | + * @param value BType field | ||
94 | + */ | ||
95 | + void setBType(byte value); | ||
96 | + | ||
97 | + /** | ||
98 | + * Prints attributes of Metric object. | ||
99 | + */ | ||
100 | + void print(); | ||
101 | + | ||
102 | + /** | ||
103 | + * Writes the Metric Object into channel buffer. | ||
104 | + * | ||
105 | + * @param bb channel buffer | ||
106 | + * @return Returns the writerIndex of this buffer | ||
107 | + * @throws PcepParseException while writing METRIC object into Channel Buffer. | ||
108 | + */ | ||
109 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
110 | + | ||
111 | + /** | ||
112 | + * Builder interface with get and set functions to build Metric object. | ||
113 | + */ | ||
114 | + public interface Builder { | ||
115 | + | ||
116 | + /** | ||
117 | + * Builds Metric Object. | ||
118 | + * | ||
119 | + * @return Metric Object | ||
120 | + * @throws PcepParseException when mandatory object is not set | ||
121 | + */ | ||
122 | + PcepMetricObject build() throws PcepParseException; | ||
123 | + | ||
124 | + /** | ||
125 | + * Returns Metric object header. | ||
126 | + * | ||
127 | + * @return Metric object header | ||
128 | + */ | ||
129 | + PcepObjectHeader getMetricObjHeader(); | ||
130 | + | ||
131 | + /** | ||
132 | + * Sets Metric object header and returns its builder. | ||
133 | + * | ||
134 | + * @param obj Metric object header | ||
135 | + * @return Builder by setting Metric object header | ||
136 | + */ | ||
137 | + Builder setMetricObjHeader(PcepObjectHeader obj); | ||
138 | + | ||
139 | + /** | ||
140 | + * Returns Metric value in Metric Object. | ||
141 | + * | ||
142 | + * @return Metric value | ||
143 | + */ | ||
144 | + int getMetricVal(); | ||
145 | + | ||
146 | + /** | ||
147 | + * Sets Metric Value in Metric Object and returns its builder. | ||
148 | + * | ||
149 | + * @param value Metric Value | ||
150 | + * @return Builder by setting Metric Value | ||
151 | + */ | ||
152 | + Builder setMetricVal(int value); | ||
153 | + | ||
154 | + /** | ||
155 | + * Returns Flags in Metric Object. | ||
156 | + * | ||
157 | + * @return Flags in Metric Object | ||
158 | + */ | ||
159 | + byte getYFlag(); | ||
160 | + | ||
161 | + /** | ||
162 | + * Sets Flags in Metric Object and returns its builder. | ||
163 | + * | ||
164 | + * @param value Flags | ||
165 | + * @return Builder by setting Flags | ||
166 | + */ | ||
167 | + Builder setYFlag(byte value); | ||
168 | + | ||
169 | + /** | ||
170 | + * Returns C flag in Metric Object. | ||
171 | + * | ||
172 | + * @return C flag in Metric Object | ||
173 | + */ | ||
174 | + boolean getCFlag(); | ||
175 | + | ||
176 | + /** | ||
177 | + * Sets C flag in Metric Object and returns its builder. | ||
178 | + * | ||
179 | + * @param value C flag | ||
180 | + * @return Builder by setting C flag | ||
181 | + */ | ||
182 | + Builder setCFlag(boolean value); | ||
183 | + | ||
184 | + /** | ||
185 | + * Returns B flag in Metric Object. | ||
186 | + * | ||
187 | + * @return B flag in Metric Object | ||
188 | + */ | ||
189 | + boolean getBFlag(); | ||
190 | + | ||
191 | + /** | ||
192 | + * Sets B flag in Metric Object and returns its builder. | ||
193 | + * | ||
194 | + * @param value B flag | ||
195 | + * @return Builder by setting B flag | ||
196 | + */ | ||
197 | + Builder setBFlag(boolean value); | ||
198 | + | ||
199 | + /** | ||
200 | + * Returns BType field in Metric Object. | ||
201 | + * | ||
202 | + * @return BType field in Metric Object | ||
203 | + */ | ||
204 | + byte getBType(); | ||
205 | + | ||
206 | + /** | ||
207 | + * Sets B Type field in Metric Object and returns its builder. | ||
208 | + * | ||
209 | + * @param value B Type field | ||
210 | + * @return Builder by setting B Type field | ||
211 | + */ | ||
212 | + Builder setBType(byte value); | ||
213 | + | ||
214 | + /** | ||
215 | + * Sets P flag in Metric object header and returns its builder. | ||
216 | + * | ||
217 | + * @param value boolean value to set P flag | ||
218 | + * @return Builder by setting P flag | ||
219 | + */ | ||
220 | + Builder setPFlag(boolean value); | ||
221 | + | ||
222 | + /** | ||
223 | + * Sets I flag in Metric object header and returns its builder. | ||
224 | + * | ||
225 | + * @param value boolean value to set I flag | ||
226 | + * @return Builder by setting I flag | ||
227 | + */ | ||
228 | + Builder setIFlag(boolean value); | ||
229 | + } | ||
230 | +} |
1 | +package org.onosproject.pcepio.protocol; | ||
2 | + | ||
3 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
4 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
5 | + | ||
6 | +/** | ||
7 | + * Abstraction of an entity Provides PCEP Message PAth for update message. | ||
8 | + * Reference :PCE extensions for stateful draft-ietf-pce-stateful-pce-10. | ||
9 | + */ | ||
10 | +public interface PcepMsgPath { | ||
11 | + | ||
12 | + /** | ||
13 | + * Returns object of PcepEroObject. | ||
14 | + * | ||
15 | + * @return eroObject | ||
16 | + */ | ||
17 | + PcepEroObject getEroObject(); | ||
18 | + | ||
19 | + /** | ||
20 | + * Returns object of PcepAttribute. | ||
21 | + * | ||
22 | + * @return pcepAttribute | ||
23 | + */ | ||
24 | + PcepAttribute getPcepAttribute(); | ||
25 | + | ||
26 | + /** | ||
27 | + * Sets PcepEroObject. | ||
28 | + * | ||
29 | + * @param eroObject PCEP ERO Object. | ||
30 | + */ | ||
31 | + void setEroObject(PcepEroObject eroObject); | ||
32 | + | ||
33 | + /** | ||
34 | + * Sets PcepAttribute. | ||
35 | + * | ||
36 | + * @param pcepAttribute PCEP-Attribute. | ||
37 | + */ | ||
38 | + void setPcepAttribute(PcepAttribute pcepAttribute); | ||
39 | + | ||
40 | + /** | ||
41 | + * reads ERO object and attribute list. | ||
42 | + * | ||
43 | + * @param bb of type channel buffer | ||
44 | + * @return PcepMsgPath | ||
45 | + * @throws PcepParseException while parsing Message Path from Channel Buffer. | ||
46 | + */ | ||
47 | + public PcepMsgPath read(ChannelBuffer bb) throws PcepParseException; | ||
48 | + | ||
49 | + /** | ||
50 | + * writes ERO object and attribute list to channel. | ||
51 | + * | ||
52 | + * @param bb of type channel buffer | ||
53 | + * @return object length index | ||
54 | + * @throws PcepParseException while writing Message Path into Channel Buffer. | ||
55 | + */ | ||
56 | + | ||
57 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
58 | + | ||
59 | + /** | ||
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. | ||
66 | + */ | ||
67 | + public interface Builder { | ||
68 | + | ||
69 | + /** | ||
70 | + * Builds PcepMsgPath. | ||
71 | + * | ||
72 | + * @return PcepMsgPath | ||
73 | + * @throws PcepParseException when mandatory object is not set | ||
74 | + */ | ||
75 | + PcepMsgPath build() throws PcepParseException; | ||
76 | + | ||
77 | + /** | ||
78 | + * Returns object of PcepEroObject. | ||
79 | + * | ||
80 | + * @return PcepEroObject | ||
81 | + */ | ||
82 | + PcepEroObject getEroObject(); | ||
83 | + | ||
84 | + /** | ||
85 | + * Returns object of PcepAttribute. | ||
86 | + * | ||
87 | + * @return pcepAttribute | ||
88 | + */ | ||
89 | + PcepAttribute getPcepAttribute(); | ||
90 | + | ||
91 | + /** | ||
92 | + * Sets PcepEroObject. | ||
93 | + * | ||
94 | + * @param eroObject PcepEroObject | ||
95 | + * @return Builder by setting ERO object. | ||
96 | + */ | ||
97 | + Builder setEroObject(PcepEroObject eroObject); | ||
98 | + | ||
99 | + /** | ||
100 | + * Sets PcepAttribute. | ||
101 | + * | ||
102 | + * @param pcepAttribute PCEP-Attribute | ||
103 | + * @return Builder by setting PCEP-Attribute. | ||
104 | + */ | ||
105 | + Builder setPcepAttribute(PcepAttribute pcepAttribute); | ||
106 | + } | ||
107 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | + | ||
21 | +/** | ||
22 | + * Abstraction of an entity provides NAI information in SR ERO Object. | ||
23 | + */ | ||
24 | +public interface PcepNai { | ||
25 | + | ||
26 | + /** | ||
27 | + * To get the ST type of the NAI information. | ||
28 | + * | ||
29 | + * @return type of ST info | ||
30 | + */ | ||
31 | + byte getType(); | ||
32 | + | ||
33 | + /** | ||
34 | + * To write the object information to channelBuffer. | ||
35 | + * | ||
36 | + * @param cb of type channel buffer | ||
37 | + * @return length of written bytes. | ||
38 | + */ | ||
39 | + int write(ChannelBuffer cb); | ||
40 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +/** | ||
20 | + * Abstraction of an entity providing PCEP Object. | ||
21 | + */ | ||
22 | +public interface PcepObject extends Writeable { | ||
23 | + | ||
24 | + /** | ||
25 | + * Returns Version of PCEP Object. | ||
26 | + * | ||
27 | + * @return Version of PCEP Object | ||
28 | + */ | ||
29 | + PcepVersion getVersion(); | ||
30 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Open Message. | ||
24 | + */ | ||
25 | +public interface PcepOpenMsg extends PcepObject, PcepMessage { | ||
26 | + | ||
27 | + @Override | ||
28 | + PcepVersion getVersion(); | ||
29 | + | ||
30 | + @Override | ||
31 | + PcepType getType(); | ||
32 | + | ||
33 | + /** | ||
34 | + * Sets OpenObject in Open Message with Specified Obj. | ||
35 | + * | ||
36 | + * @param obj OpenObject | ||
37 | + */ | ||
38 | + void setPcepOpenObject(PcepOpenObject obj); | ||
39 | + | ||
40 | + /** | ||
41 | + * Returns OpenObject in Open Message. | ||
42 | + * | ||
43 | + * @return OpenObject in Open Message | ||
44 | + */ | ||
45 | + PcepOpenObject getPcepOpenObject(); | ||
46 | + | ||
47 | + @Override | ||
48 | + void writeTo(ChannelBuffer channelBuffer); | ||
49 | + | ||
50 | + /** | ||
51 | + * Builder interface with get and set functions to build Open message. | ||
52 | + */ | ||
53 | + public interface Builder extends PcepMessage.Builder { | ||
54 | + | ||
55 | + @Override | ||
56 | + PcepOpenMsg build() throws PcepParseException; | ||
57 | + | ||
58 | + /** | ||
59 | + * Sets Open Object in Open Message and return its builder. | ||
60 | + * | ||
61 | + * @param obj Open Object | ||
62 | + * @return builder by setting Open Object | ||
63 | + */ | ||
64 | + Builder setPcepOpenObj(PcepOpenObject obj); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns OpenObject in Open Message. | ||
68 | + * | ||
69 | + * @return OpenObject in Open Message | ||
70 | + */ | ||
71 | + PcepOpenObject getPcepOpenObj(); | ||
72 | + } | ||
73 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
24 | +import org.onosproject.pcepio.types.PcepValueType; | ||
25 | + | ||
26 | +/** | ||
27 | + * Abstraction of an entity providing PCEP Open Object. | ||
28 | + */ | ||
29 | +public interface PcepOpenObject { | ||
30 | + | ||
31 | + /** | ||
32 | + * Returns Open object header. | ||
33 | + * | ||
34 | + * @return Open object header | ||
35 | + */ | ||
36 | + PcepObjectHeader getOpenObjHeader(); | ||
37 | + | ||
38 | + /** | ||
39 | + * Sets Open object header in Open Object. | ||
40 | + * | ||
41 | + * @param obj Open object header | ||
42 | + */ | ||
43 | + void setOpenObjHeader(PcepObjectHeader obj); | ||
44 | + | ||
45 | + /** | ||
46 | + * Returns version of Open Object. | ||
47 | + * | ||
48 | + * @return Version of Open Object | ||
49 | + */ | ||
50 | + PcepVersion getVersion(); | ||
51 | + | ||
52 | + /** | ||
53 | + * Returns KeepAlive Time in Open Object. | ||
54 | + * | ||
55 | + * @return KeepAlive Time in Open Object | ||
56 | + */ | ||
57 | + byte getKeepAliveTime(); | ||
58 | + | ||
59 | + /** | ||
60 | + * Sets KeepAlive Time in Open Object with specified value. | ||
61 | + * | ||
62 | + * @param value KeepAlive Time | ||
63 | + */ | ||
64 | + void setKeepAliveTime(byte value); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns Dead Time in Open Object. | ||
68 | + * | ||
69 | + * @return Dead Time in Open Object | ||
70 | + */ | ||
71 | + byte getDeadTime(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets Dead Time in Open Object with specified value. | ||
75 | + * | ||
76 | + * @param value Dead Time | ||
77 | + */ | ||
78 | + void setDeadTime(byte value); | ||
79 | + | ||
80 | + /** | ||
81 | + * Returns SessionId in Open Object. | ||
82 | + * | ||
83 | + * @return SessionId in Open Object | ||
84 | + */ | ||
85 | + byte getSessionId(); | ||
86 | + | ||
87 | + /** | ||
88 | + * Sets SessionId in Open Object with specified value. | ||
89 | + * | ||
90 | + * @param value SessionId | ||
91 | + */ | ||
92 | + void setSessionId(byte value); | ||
93 | + | ||
94 | + /** | ||
95 | + * Returns list of Optional Tlvs in Open Object. | ||
96 | + * | ||
97 | + * @return list of Optional Tlvs | ||
98 | + */ | ||
99 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
100 | + | ||
101 | + /** | ||
102 | + * Sets list of Optional Tlvs in Open Object. | ||
103 | + * | ||
104 | + * @param llOptionalTlv list of Optional Tlvs | ||
105 | + */ | ||
106 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
107 | + | ||
108 | + /** | ||
109 | + * Prints attributes of Open object. | ||
110 | + */ | ||
111 | + void print(); | ||
112 | + | ||
113 | + /** | ||
114 | + * Writes the Open into channel buffer. | ||
115 | + * | ||
116 | + * @param bb channel buffer | ||
117 | + * @return Returns the writerIndex of this buffer | ||
118 | + * @throws PcepParseException while writing Open Object into Channel Buffer. | ||
119 | + */ | ||
120 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
121 | + | ||
122 | + /** | ||
123 | + * Builder interface with get and set functions to build Open object. | ||
124 | + */ | ||
125 | + public interface Builder { | ||
126 | + | ||
127 | + /** | ||
128 | + * Builds Open Object. | ||
129 | + * | ||
130 | + * @return Open Object | ||
131 | + * @throws PcepParseException while building PCEP-Open object | ||
132 | + */ | ||
133 | + PcepOpenObject build() throws PcepParseException; | ||
134 | + | ||
135 | + /** | ||
136 | + * Returns Open object header. | ||
137 | + * | ||
138 | + * @return Open object header | ||
139 | + */ | ||
140 | + PcepObjectHeader getOpenObjHeader(); | ||
141 | + | ||
142 | + /** | ||
143 | + * Sets Open object header and returns its builder. | ||
144 | + * | ||
145 | + * @param obj Open object header | ||
146 | + * @return Builder by setting Open object header | ||
147 | + */ | ||
148 | + Builder setOpenObjHeader(PcepObjectHeader obj); | ||
149 | + | ||
150 | + /** | ||
151 | + * Returns KeepAlive Time in Open Object. | ||
152 | + * | ||
153 | + * @return KeepAlive Time in Open Object | ||
154 | + */ | ||
155 | + byte getKeepAliveTime(); | ||
156 | + | ||
157 | + /** | ||
158 | + * Sets KeepAlive Time and returns its builder. | ||
159 | + * | ||
160 | + * @param value KeepAlive Time | ||
161 | + * @return Builder by setting KeepAlive Time | ||
162 | + */ | ||
163 | + Builder setKeepAliveTime(byte value); | ||
164 | + | ||
165 | + /** | ||
166 | + * Returns Dead Time in Open Object. | ||
167 | + * | ||
168 | + * @return Dead Time in Open Object | ||
169 | + */ | ||
170 | + byte getDeadTime(); | ||
171 | + | ||
172 | + /** | ||
173 | + * Sets Dead Time and returns its builder. | ||
174 | + * | ||
175 | + * @param value Dead Time | ||
176 | + * @return Builder by setting Dead Time | ||
177 | + */ | ||
178 | + Builder setDeadTime(byte value); | ||
179 | + | ||
180 | + /** | ||
181 | + * Returns SessionId in Open Object. | ||
182 | + * | ||
183 | + * @return SessionId in Open Object | ||
184 | + */ | ||
185 | + byte getSessionId(); | ||
186 | + | ||
187 | + /** | ||
188 | + * Sets SessionId and returns its builder. | ||
189 | + * | ||
190 | + * @param value SessionId | ||
191 | + * @return Builder by setting SessionId | ||
192 | + */ | ||
193 | + Builder setSessionId(byte value); | ||
194 | + | ||
195 | + /** | ||
196 | + * Returns list of Optional Tlvs in Open Object. | ||
197 | + * | ||
198 | + * @return list of Optional Tlvs in Open Object | ||
199 | + */ | ||
200 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
201 | + | ||
202 | + /** | ||
203 | + * Sets list of Optional Tlvs and return its Builder. | ||
204 | + * | ||
205 | + * @param llOptionalTlv list of Optional Tlvs | ||
206 | + * @return builder by setting list of Optional Tlvs | ||
207 | + */ | ||
208 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
209 | + | ||
210 | + /** | ||
211 | + * Sets P flag in Open object header and returns its builder. | ||
212 | + * | ||
213 | + * @param value boolean value to set P flag | ||
214 | + * @return Builder by setting P flag | ||
215 | + */ | ||
216 | + Builder setPFlag(boolean value); | ||
217 | + | ||
218 | + /** | ||
219 | + * Sets I flag in Open object header and returns its builder. | ||
220 | + * | ||
221 | + * @param value boolean value to set I flag | ||
222 | + * @return Builder by setting I flag | ||
223 | + */ | ||
224 | + Builder setIFlag(boolean value); | ||
225 | + } | ||
226 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | + | ||
20 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
21 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
22 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
23 | +import org.onosproject.pcepio.types.PcepValueType; | ||
24 | + | ||
25 | +/** | ||
26 | + * Abstraction of an entity providing PCEP RP Object. | ||
27 | + */ | ||
28 | +public interface PcepRPObject { | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns RequestId Number in RP Object. | ||
32 | + * | ||
33 | + * @return RequestId Number in RP Object | ||
34 | + */ | ||
35 | + int getRequestIdNum(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Sets RequestId Number with specified value. | ||
39 | + * | ||
40 | + * @param value RequestId Number | ||
41 | + */ | ||
42 | + void setRequestIdNum(int value); | ||
43 | + | ||
44 | + /** | ||
45 | + * Returns O flag in RP Object. | ||
46 | + * | ||
47 | + * @return O flag in RP Object | ||
48 | + */ | ||
49 | + boolean getOFlag(); | ||
50 | + | ||
51 | + /** | ||
52 | + * Sets O flag with specified value. | ||
53 | + * | ||
54 | + * @param value O flag | ||
55 | + */ | ||
56 | + void setOFlag(boolean value); | ||
57 | + | ||
58 | + /** | ||
59 | + * Returns B flag in RP Object. | ||
60 | + * | ||
61 | + * @return B flag in RP Object | ||
62 | + */ | ||
63 | + boolean getBFlag(); | ||
64 | + | ||
65 | + /** | ||
66 | + * Sets B flag with specified value. | ||
67 | + * | ||
68 | + * @param value B flag | ||
69 | + */ | ||
70 | + void setBFlag(boolean value); | ||
71 | + | ||
72 | + /** | ||
73 | + * Returns R flag in RP Object. | ||
74 | + * | ||
75 | + * @return R flag in RP Object | ||
76 | + */ | ||
77 | + boolean getRFlag(); | ||
78 | + | ||
79 | + /** | ||
80 | + * Sets R flag with specified value. | ||
81 | + * | ||
82 | + * @param value R flag | ||
83 | + */ | ||
84 | + void setRFlag(boolean value); | ||
85 | + | ||
86 | + /** | ||
87 | + * Returns Priority Flag in RP Object. | ||
88 | + * | ||
89 | + * @return Priority Flag in RP Object | ||
90 | + */ | ||
91 | + byte getPriFlag(); | ||
92 | + | ||
93 | + /** | ||
94 | + * Sets Priority Flag with specified value. | ||
95 | + * | ||
96 | + * @param value Priority Flag | ||
97 | + */ | ||
98 | + void setPriFlag(byte value); | ||
99 | + | ||
100 | + /** | ||
101 | + * Returns list of Optional Tlvs in RP Object. | ||
102 | + * | ||
103 | + * @return list of Optional Tlvs in RP Object | ||
104 | + */ | ||
105 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
106 | + | ||
107 | + /** | ||
108 | + * Sets list of Optional Tlvs in RP Object and returns its builder. | ||
109 | + * | ||
110 | + * @param llOptionalTlv list of Optional Tlvs | ||
111 | + */ | ||
112 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
113 | + | ||
114 | + /** | ||
115 | + * Prints attributes of RP object. | ||
116 | + */ | ||
117 | + void print(); | ||
118 | + | ||
119 | + /** | ||
120 | + * Writes the RP Object into channel buffer. | ||
121 | + * | ||
122 | + * @param bb channel buffer | ||
123 | + * @return Returns the writerIndex of this buffer | ||
124 | + * @throws PcepParseException while writing RP object into Channel Buffer. | ||
125 | + */ | ||
126 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
127 | + | ||
128 | + /** | ||
129 | + * Builder interface with get and set functions to build bandwidth object. | ||
130 | + */ | ||
131 | + public interface Builder { | ||
132 | + | ||
133 | + /** | ||
134 | + * Builds RP Object. | ||
135 | + * | ||
136 | + * @return RP Object | ||
137 | + */ | ||
138 | + PcepRPObject build(); | ||
139 | + | ||
140 | + /** | ||
141 | + * Returns RP object header. | ||
142 | + * | ||
143 | + * @return RP object header | ||
144 | + */ | ||
145 | + PcepObjectHeader getRPObjHeader(); | ||
146 | + | ||
147 | + /** | ||
148 | + * Sets RP object header and returns its builder. | ||
149 | + * | ||
150 | + * @param obj RP object header | ||
151 | + * @return Builder by setting RP object header | ||
152 | + */ | ||
153 | + Builder setRPObjHeader(PcepObjectHeader obj); | ||
154 | + | ||
155 | + /** | ||
156 | + * Returns Request Id Number in RP Object. | ||
157 | + * | ||
158 | + * @return Request Id Number in RP Object | ||
159 | + */ | ||
160 | + int getRequestIdNum(); | ||
161 | + | ||
162 | + /** | ||
163 | + * Sets Request Id Number and returns its builder. | ||
164 | + * | ||
165 | + * @param value Request Id Number | ||
166 | + * @return Builder by setting Request Id Number | ||
167 | + */ | ||
168 | + Builder setRequestIdNum(int value); | ||
169 | + | ||
170 | + /** | ||
171 | + * Returns O flag in RP Object. | ||
172 | + * | ||
173 | + * @return O flag in RP Object | ||
174 | + */ | ||
175 | + boolean getOFlag(); | ||
176 | + | ||
177 | + /** | ||
178 | + * Sets O flag and returns its builder. | ||
179 | + * | ||
180 | + * @param value O flag | ||
181 | + * @return Builder by setting O flag | ||
182 | + */ | ||
183 | + Builder setOFlag(boolean value); | ||
184 | + | ||
185 | + /** | ||
186 | + * Returns B flag in RP Object. | ||
187 | + * | ||
188 | + * @return B flag in RP Object | ||
189 | + */ | ||
190 | + boolean getBFlag(); | ||
191 | + | ||
192 | + /** | ||
193 | + * Sets B flag and returns its builder. | ||
194 | + * | ||
195 | + * @param value B flag | ||
196 | + * @return Builder by setting B flag | ||
197 | + */ | ||
198 | + Builder setBFlag(boolean value); | ||
199 | + | ||
200 | + /** | ||
201 | + * Returns R flag in RP Object. | ||
202 | + * | ||
203 | + * @return R flag in RP Object | ||
204 | + */ | ||
205 | + boolean getRFlag(); | ||
206 | + | ||
207 | + /** | ||
208 | + * Sets R flag and returns its builder. | ||
209 | + * | ||
210 | + * @param value R flag | ||
211 | + * @return Builder by setting R flag | ||
212 | + */ | ||
213 | + Builder setRFlag(boolean value); | ||
214 | + | ||
215 | + /** | ||
216 | + * Returns Priority Flag in RP Object. | ||
217 | + * | ||
218 | + * @return Priority Flag in RP Object | ||
219 | + */ | ||
220 | + byte getPriFlag(); | ||
221 | + | ||
222 | + /** | ||
223 | + * Sets Priority Flag and returns its builder. | ||
224 | + * | ||
225 | + * @param value Priority Flag | ||
226 | + * @return Builder by setting Priority Flag | ||
227 | + */ | ||
228 | + Builder setPriFlag(byte value); | ||
229 | + | ||
230 | + /** | ||
231 | + * Returns list of Optional Tlvs in RP Object. | ||
232 | + * | ||
233 | + * @return list of Optional Tlvs | ||
234 | + */ | ||
235 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
236 | + | ||
237 | + /** | ||
238 | + * Sets list of Optional Tlvs and returns its builder. | ||
239 | + * | ||
240 | + * @param llOptionalTlv list of Optional Tlvs | ||
241 | + * @return Builder by setting list of Optional Tlvs | ||
242 | + */ | ||
243 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
244 | + | ||
245 | + /** | ||
246 | + * Sets P flag in RP object header and returns its builder. | ||
247 | + * | ||
248 | + * @param value boolean value to set P flag | ||
249 | + * @return Builder by setting P flag | ||
250 | + */ | ||
251 | + Builder setPFlag(boolean value); | ||
252 | + | ||
253 | + /** | ||
254 | + * Sets I flag in RP object header and returns its builder. | ||
255 | + * | ||
256 | + * @param value boolean value to set I flag | ||
257 | + * @return Builder by setting I flag | ||
258 | + */ | ||
259 | + Builder setIFlag(boolean value); | ||
260 | + } | ||
261 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP Report Message. | ||
26 | + */ | ||
27 | +public interface PcepReportMsg extends PcepObject, PcepMessage { | ||
28 | + | ||
29 | + @Override | ||
30 | + PcepVersion getVersion(); | ||
31 | + | ||
32 | + @Override | ||
33 | + PcepType getType(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Returns PcepStateReport list. | ||
37 | + * | ||
38 | + * @return list of PcepStateReport | ||
39 | + */ | ||
40 | + LinkedList<PcepStateReport> getStateReportList(); | ||
41 | + | ||
42 | + /** | ||
43 | + * Sets StateReportList. | ||
44 | + * | ||
45 | + * @param llStateReportList list of PcepStateReport. | ||
46 | + */ | ||
47 | + void setStateReportList(LinkedList<PcepStateReport> llStateReportList); | ||
48 | + | ||
49 | + @Override | ||
50 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
51 | + | ||
52 | + /** | ||
53 | + * Builder interface with get and set functions to build Report message. | ||
54 | + */ | ||
55 | + public interface Builder extends PcepMessage.Builder { | ||
56 | + | ||
57 | + @Override | ||
58 | + PcepReportMsg build(); | ||
59 | + | ||
60 | + @Override | ||
61 | + PcepVersion getVersion(); | ||
62 | + | ||
63 | + @Override | ||
64 | + PcepType getType(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns StateReportList. | ||
68 | + * | ||
69 | + * @return StateReportList. | ||
70 | + */ | ||
71 | + LinkedList<PcepStateReport> getStateReportList(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets list of PcepStateReport and returns builder. | ||
75 | + * | ||
76 | + * @param llStateReportList list of PcepStateReport. | ||
77 | + * @return Builder by setting list of PcepStateReport. | ||
78 | + */ | ||
79 | + Builder setStateReportList(LinkedList<PcepStateReport> llStateReportList); | ||
80 | + } | ||
81 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | + | ||
20 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
21 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
22 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
23 | +import org.onosproject.pcepio.types.PcepValueType; | ||
24 | + | ||
25 | +/** | ||
26 | + * Abstraction of an entity providing PCEP RRO Object. | ||
27 | + */ | ||
28 | +public interface PcepRroObject { | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns list of SubObjects. | ||
32 | + * | ||
33 | + * @return list of SubObjects | ||
34 | + */ | ||
35 | + LinkedList<PcepValueType> getSubObjects(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Sets list of SubObjects and return its builder. | ||
39 | + * | ||
40 | + * @param llSubObjects list of SubObjects | ||
41 | + */ | ||
42 | + void setSubObjects(LinkedList<PcepValueType> llSubObjects); | ||
43 | + | ||
44 | + /** | ||
45 | + * Prints attributes of RRO object. | ||
46 | + */ | ||
47 | + void print(); | ||
48 | + | ||
49 | + /** | ||
50 | + * Writes the RRO Object into channel buffer. | ||
51 | + * | ||
52 | + * @param bb channel buffer | ||
53 | + * @return Returns the writerIndex of this buffer | ||
54 | + * @throws PcepParseException when object header failed to write in channel buffer | ||
55 | + */ | ||
56 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
57 | + | ||
58 | + /** | ||
59 | + * Builder interface with get and set functions to build RRO object. | ||
60 | + */ | ||
61 | + public interface Builder { | ||
62 | + | ||
63 | + /** | ||
64 | + * Builds RRO Object. | ||
65 | + * | ||
66 | + * @return RRO Object | ||
67 | + */ | ||
68 | + PcepRroObject build(); | ||
69 | + | ||
70 | + /** | ||
71 | + * Returns RRO object header. | ||
72 | + * | ||
73 | + * @return RRO object header | ||
74 | + */ | ||
75 | + PcepObjectHeader getRroObjHeader(); | ||
76 | + | ||
77 | + /** | ||
78 | + * Sets RRO object header and returns its builder. | ||
79 | + * | ||
80 | + * @param obj RRO object header | ||
81 | + * @return Builder by setting RRO object header | ||
82 | + */ | ||
83 | + Builder setRroObjHeader(PcepObjectHeader obj); | ||
84 | + | ||
85 | + /** | ||
86 | + * Returns list of SubObjects. | ||
87 | + * | ||
88 | + * @return list of SubObjects | ||
89 | + */ | ||
90 | + LinkedList<PcepValueType> getSubObjects(); | ||
91 | + | ||
92 | + /** | ||
93 | + * Sets list of SubObjects in RRO Object and returns its builder. | ||
94 | + * | ||
95 | + * @param llSubObjects list of SubObjects | ||
96 | + * @return Builder by setting list of SubObjects | ||
97 | + */ | ||
98 | + Builder setSubObjects(LinkedList<PcepValueType> llSubObjects); | ||
99 | + | ||
100 | + /** | ||
101 | + * Sets P flag in RRO object header and returns its builder. | ||
102 | + * | ||
103 | + * @param value boolean value to set P flag | ||
104 | + * @return Builder by setting P flag | ||
105 | + */ | ||
106 | + Builder setPFlag(boolean value); | ||
107 | + | ||
108 | + /** | ||
109 | + * Sets I flag in RRO object header and returns its builder. | ||
110 | + * | ||
111 | + * @param value boolean value to set I flag | ||
112 | + * @return Builder by setting I flag | ||
113 | + */ | ||
114 | + Builder setIFlag(boolean value); | ||
115 | + } | ||
116 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
24 | +import org.onosproject.pcepio.types.PcepValueType; | ||
25 | + | ||
26 | +/** | ||
27 | + * Abstraction of an entity providing PCEP SRP Object. | ||
28 | + */ | ||
29 | +public interface PcepSrpObject { | ||
30 | + | ||
31 | + /** | ||
32 | + * Returns SRP ID of SRP Object. | ||
33 | + * | ||
34 | + * @return SRP ID of SRP Object | ||
35 | + */ | ||
36 | + int getSrpID(); | ||
37 | + | ||
38 | + /** | ||
39 | + * Sets SRP ID with specified value. | ||
40 | + * | ||
41 | + * @param srpID SRP ID of SRP Object | ||
42 | + */ | ||
43 | + void setSrpID(int srpID); | ||
44 | + | ||
45 | + /** | ||
46 | + * Returns R flag of SRP Object. | ||
47 | + * | ||
48 | + * @return R flag of SRP Object | ||
49 | + */ | ||
50 | + boolean getRFlag(); | ||
51 | + | ||
52 | + /** | ||
53 | + * Sets R flag with specified value. | ||
54 | + * | ||
55 | + * @param bRFlag R Flag of SRP Object | ||
56 | + */ | ||
57 | + void setRFlag(boolean bRFlag); | ||
58 | + | ||
59 | + /** | ||
60 | + * sets the optional TLvs. | ||
61 | + * | ||
62 | + * @param llOptionalTlv list of optional tlvs | ||
63 | + */ | ||
64 | + public void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns list of optional tlvs. | ||
68 | + * | ||
69 | + * @return llOptionalTlv list of optional tlvs | ||
70 | + */ | ||
71 | + public LinkedList<PcepValueType> getOptionalTlv(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Prints attributes of SRP object. | ||
75 | + */ | ||
76 | + void print(); | ||
77 | + | ||
78 | + /** | ||
79 | + * Writes the SRP Object into channel buffer. | ||
80 | + * | ||
81 | + * @param bb channel buffer | ||
82 | + * @return Returns the writerIndex of this buffer | ||
83 | + * @throws PcepParseException when tlv is null | ||
84 | + */ | ||
85 | + int write(ChannelBuffer bb) throws PcepParseException; | ||
86 | + | ||
87 | + /** | ||
88 | + * Builder interface with get and set functions to build SRP object. | ||
89 | + */ | ||
90 | + public interface Builder { | ||
91 | + | ||
92 | + /** | ||
93 | + * Builds SRP Object. | ||
94 | + * | ||
95 | + * @return SRP Object | ||
96 | + * @throws PcepParseException when mandatory object is not set | ||
97 | + */ | ||
98 | + PcepSrpObject build() throws PcepParseException; | ||
99 | + | ||
100 | + /** | ||
101 | + * Returns SRP object header. | ||
102 | + * | ||
103 | + * @return SRP object header | ||
104 | + */ | ||
105 | + PcepObjectHeader getSrpObjHeader(); | ||
106 | + | ||
107 | + /** | ||
108 | + * Sets SRP object header and returns its builder. | ||
109 | + * | ||
110 | + * @param obj SRP object header | ||
111 | + * @return Builder by setting SRP object header | ||
112 | + */ | ||
113 | + Builder setSrpObjHeader(PcepObjectHeader obj); | ||
114 | + | ||
115 | + /** | ||
116 | + * Returns SRP ID of SRP Object. | ||
117 | + * | ||
118 | + * @return SRP ID of SRP Object | ||
119 | + */ | ||
120 | + int getSrpID(); | ||
121 | + | ||
122 | + /** | ||
123 | + * Sets SRP ID and returns its builder. | ||
124 | + * | ||
125 | + * @param srpID SRP ID | ||
126 | + * @return Builder by setting SRP ID | ||
127 | + */ | ||
128 | + Builder setSrpID(int srpID); | ||
129 | + | ||
130 | + /** | ||
131 | + * Returns R flag of SRP Object. | ||
132 | + * | ||
133 | + * @return R flag of SRP Object | ||
134 | + */ | ||
135 | + boolean getRFlag(); | ||
136 | + | ||
137 | + /** | ||
138 | + * Sets R flag and returns its builder. | ||
139 | + * | ||
140 | + * @param bRFlag R flag | ||
141 | + * @return Builder by setting R flag | ||
142 | + */ | ||
143 | + Builder setRFlag(boolean bRFlag); | ||
144 | + | ||
145 | + /** | ||
146 | + * Returns list of optional tlvs. | ||
147 | + * | ||
148 | + * @return llOptionalTlv list of optional tlvs | ||
149 | + */ | ||
150 | + public LinkedList<PcepValueType> getOptionalTlv(); | ||
151 | + | ||
152 | + /** | ||
153 | + * sets the optional TLvs. | ||
154 | + * | ||
155 | + * @param llOptionalTlv List of optional tlv | ||
156 | + * @return builder by setting list of optional tlv. | ||
157 | + */ | ||
158 | + public Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
159 | + | ||
160 | + /** | ||
161 | + * Sets P flag in SRP object header and returns its builder. | ||
162 | + * | ||
163 | + * @param value boolean value to set P flag | ||
164 | + * @return Builder by setting P flag | ||
165 | + */ | ||
166 | + Builder setPFlag(boolean value); | ||
167 | + | ||
168 | + /** | ||
169 | + * Sets I flag in SRP object header and returns its builder. | ||
170 | + * | ||
171 | + * @param value boolean value to set I flag | ||
172 | + * @return Builder by setting I flag | ||
173 | + */ | ||
174 | + Builder setIFlag(boolean value); | ||
175 | + | ||
176 | + } | ||
177 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity provides State Report for PCEP Report Message. | ||
24 | + */ | ||
25 | +public interface PcepStateReport { | ||
26 | + | ||
27 | + /** | ||
28 | + * Provides PCEP Message path for report message. | ||
29 | + */ | ||
30 | + public interface PcepMsgPath { | ||
31 | + | ||
32 | + /** | ||
33 | + * Returns PcepEroObject. | ||
34 | + * | ||
35 | + * @return eroObj | ||
36 | + */ | ||
37 | + PcepEroObject getEroObject(); | ||
38 | + | ||
39 | + /** | ||
40 | + * Sets PcepEroObject. | ||
41 | + * | ||
42 | + * @param eroObject Ero Object | ||
43 | + */ | ||
44 | + void setEroObject(PcepEroObject eroObject); | ||
45 | + | ||
46 | + /** | ||
47 | + * Returns PcepAttribute. | ||
48 | + * | ||
49 | + * @return attrList | ||
50 | + */ | ||
51 | + PcepAttribute getPcepAttribute(); | ||
52 | + | ||
53 | + /** | ||
54 | + * Sets PcepAttribute. | ||
55 | + * | ||
56 | + * @param pcepAttribute Pcep Attribute object | ||
57 | + */ | ||
58 | + void setPcepAttribute(PcepAttribute pcepAttribute); | ||
59 | + | ||
60 | + /** | ||
61 | + * Returns PcepRroObject. | ||
62 | + * | ||
63 | + * @return rroObj | ||
64 | + */ | ||
65 | + PcepRroObject getRroObject(); | ||
66 | + | ||
67 | + /** | ||
68 | + * Sets PcepRroObject. | ||
69 | + * | ||
70 | + * @param rroObject Rro object | ||
71 | + */ | ||
72 | + void setRroObject(PcepRroObject rroObject); | ||
73 | + | ||
74 | + /** | ||
75 | + * Returns PcepBandwidthObject. | ||
76 | + * | ||
77 | + * @return bandwidth object | ||
78 | + */ | ||
79 | + PcepBandwidthObject getBandwidthObject(); | ||
80 | + | ||
81 | + /** | ||
82 | + * Sets PcepBandwidthObject. | ||
83 | + * | ||
84 | + * @param bandwidth bandwidth object | ||
85 | + */ | ||
86 | + void setBandwidthObject(PcepBandwidthObject bandwidth); | ||
87 | + | ||
88 | + /** | ||
89 | + * Reads all the Objects for PCEP Message Path. | ||
90 | + * | ||
91 | + * @param bb of type channel buffer | ||
92 | + * @return PCEP Message path | ||
93 | + * @throws PcepParseException when invalid buffer received | ||
94 | + */ | ||
95 | + public PcepMsgPath read(ChannelBuffer bb) throws PcepParseException; | ||
96 | + | ||
97 | + /** | ||
98 | + * Writes all the objects for pcep message path. | ||
99 | + * | ||
100 | + * @param bb of type channel buffer. | ||
101 | + * @return object length index | ||
102 | + * @throws PcepParseException when mandatory object is not set | ||
103 | + */ | ||
104 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
105 | + | ||
106 | + /*** | ||
107 | + * Prints the attribute of PCEP Message Path. | ||
108 | + */ | ||
109 | + public void print(); | ||
110 | + | ||
111 | + } | ||
112 | + | ||
113 | + /** | ||
114 | + * Returns PcepSrpObject. | ||
115 | + * | ||
116 | + * @return srpObject | ||
117 | + */ | ||
118 | + PcepSrpObject getSrpObject(); | ||
119 | + | ||
120 | + /** | ||
121 | + * Returns PcepLspObject. | ||
122 | + * | ||
123 | + * @return lspObject | ||
124 | + */ | ||
125 | + PcepLspObject getLspObject(); | ||
126 | + | ||
127 | + /** | ||
128 | + * Returns PcepMsgPath. | ||
129 | + * | ||
130 | + * @return msgPath | ||
131 | + */ | ||
132 | + PcepMsgPath getMsgPath(); | ||
133 | + | ||
134 | + /** | ||
135 | + * Sets the SRP Object. | ||
136 | + * | ||
137 | + * @param srpObj Pcep Srp Object | ||
138 | + */ | ||
139 | + void setSrpObject(PcepSrpObject srpObj); | ||
140 | + | ||
141 | + /** | ||
142 | + * Sets the LSP Object. | ||
143 | + * | ||
144 | + * @param lspObject Pcep Lsp Object | ||
145 | + */ | ||
146 | + void setLspObject(PcepLspObject lspObject); | ||
147 | + | ||
148 | + /** | ||
149 | + * Sets the Path Object. | ||
150 | + * | ||
151 | + * @param msgPath Pcep MsgPath object | ||
152 | + */ | ||
153 | + void setMsgPath(PcepMsgPath msgPath); | ||
154 | + | ||
155 | + /** | ||
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. | ||
162 | + */ | ||
163 | + public interface Builder { | ||
164 | + | ||
165 | + /** | ||
166 | + * Builds PcepStateReport. | ||
167 | + * | ||
168 | + * @return PcepStateReport | ||
169 | + * @throws PcepParseException when mandatory object is not set | ||
170 | + */ | ||
171 | + PcepStateReport build() throws PcepParseException; | ||
172 | + | ||
173 | + /** | ||
174 | + * Returns PcepSrpObject. | ||
175 | + * | ||
176 | + * @return srpObject | ||
177 | + */ | ||
178 | + PcepSrpObject getSrpObject(); | ||
179 | + | ||
180 | + /** | ||
181 | + * Returns PcepLspObject. | ||
182 | + * | ||
183 | + * @return lspObject | ||
184 | + */ | ||
185 | + PcepLspObject getLspObject(); | ||
186 | + | ||
187 | + /** | ||
188 | + * Returns PcepMsgPath. | ||
189 | + * | ||
190 | + * @return msgPath | ||
191 | + */ | ||
192 | + PcepMsgPath getMsgPath(); | ||
193 | + | ||
194 | + /** | ||
195 | + * Sets the SRP Object. | ||
196 | + * | ||
197 | + * @param srpObj Pcep Srp Object | ||
198 | + * @return builder by setting PcepSrpObject | ||
199 | + */ | ||
200 | + Builder setSrpObject(PcepSrpObject srpObj); | ||
201 | + | ||
202 | + /** | ||
203 | + * Sets the LSP Object. | ||
204 | + * | ||
205 | + * @param lspObject Pcep Lsp Object | ||
206 | + * @return builder by setting PcepLspObject | ||
207 | + */ | ||
208 | + Builder setLspObject(PcepLspObject lspObject); | ||
209 | + | ||
210 | + /** | ||
211 | + * Sets the Path Object. | ||
212 | + * | ||
213 | + * @param msgPath Pcep MsgPath object | ||
214 | + * @return builder by setting PcepMsgPath | ||
215 | + */ | ||
216 | + Builder setMsgPath(PcepMsgPath msgPath); | ||
217 | + } | ||
218 | +} |
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 | +package org.onosproject.pcepio.protocol; | ||
17 | + | ||
18 | +import java.util.LinkedList; | ||
19 | + | ||
20 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
21 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
22 | +import org.onosproject.pcepio.types.PcepObjectHeader; | ||
23 | +import org.onosproject.pcepio.types.PcepValueType; | ||
24 | + | ||
25 | +/** | ||
26 | + * Abstraction of an entity providing PCEP TE Object. | ||
27 | + */ | ||
28 | +public interface PcepTEObject { | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns TE object header. | ||
32 | + * | ||
33 | + * @return TE object header | ||
34 | + */ | ||
35 | + PcepObjectHeader getTEObjHeader(); | ||
36 | + | ||
37 | + /** | ||
38 | + * Sets TE Object header. | ||
39 | + * | ||
40 | + * @param obj TE Object header | ||
41 | + */ | ||
42 | + void setTEObjHeader(PcepObjectHeader obj); | ||
43 | + | ||
44 | + /** | ||
45 | + * Returns ProtocolId in TE Object. | ||
46 | + * | ||
47 | + * @return ProtocolId in TE Object | ||
48 | + */ | ||
49 | + byte getProtocolId(); | ||
50 | + | ||
51 | + /** | ||
52 | + * Sets ProtocolId in TE Object. | ||
53 | + * | ||
54 | + * @param yProtId ProtocolId in TE Object | ||
55 | + */ | ||
56 | + void setProtocolId(byte yProtId); | ||
57 | + | ||
58 | + /** | ||
59 | + * Returns R flag in TE Object. | ||
60 | + * | ||
61 | + * @return R flag in TE Object | ||
62 | + */ | ||
63 | + boolean getRFlag(); | ||
64 | + | ||
65 | + /** | ||
66 | + * Sets R flag in TE Object. | ||
67 | + * | ||
68 | + * @param bRFlag R flag in TE Object | ||
69 | + */ | ||
70 | + void setRFlag(boolean bRFlag); | ||
71 | + | ||
72 | + /** | ||
73 | + * Returns S flag in TE Object. | ||
74 | + * | ||
75 | + * @return S flag in TE Object | ||
76 | + */ | ||
77 | + boolean getSFlag(); | ||
78 | + | ||
79 | + /** | ||
80 | + * Sets S flag in TE Object. | ||
81 | + * | ||
82 | + * @param bSFlag S flag in TE Object | ||
83 | + */ | ||
84 | + void setSFlag(boolean bSFlag); | ||
85 | + | ||
86 | + /** | ||
87 | + * Returns TE ID in TE Object. | ||
88 | + * | ||
89 | + * @return TE ID in TE Object | ||
90 | + */ | ||
91 | + int getTEId(); | ||
92 | + | ||
93 | + /** | ||
94 | + * Sets TE ID in TE Object. | ||
95 | + * | ||
96 | + * @param iTEId TE ID in TE Object | ||
97 | + */ | ||
98 | + void setTEId(int iTEId); | ||
99 | + | ||
100 | + /** | ||
101 | + * Returns list of Optional Tlvs in TE Object. | ||
102 | + * | ||
103 | + * @return list of Optional Tlvs | ||
104 | + */ | ||
105 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
106 | + | ||
107 | + /** | ||
108 | + * Sets list of Optional Tlvs in TE Object. | ||
109 | + * | ||
110 | + * @param llOptionalTlv list of Optional Tlvs | ||
111 | + */ | ||
112 | + void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
113 | + | ||
114 | + /** | ||
115 | + * Prints attributes of TE object. | ||
116 | + */ | ||
117 | + void print(); | ||
118 | + | ||
119 | + /** | ||
120 | + * Writes the TE Object into channel buffer. | ||
121 | + * | ||
122 | + * @param bb channel buffer | ||
123 | + * @return Returns the writerIndex of this buffer | ||
124 | + * @throws PcepParseException when obj header is not written to channel buffer | ||
125 | + */ | ||
126 | + public int write(ChannelBuffer bb) throws PcepParseException; | ||
127 | + | ||
128 | + /** | ||
129 | + * Builder interface with get and set functions to build TE object. | ||
130 | + */ | ||
131 | + public interface Builder { | ||
132 | + | ||
133 | + /** | ||
134 | + * Builds TE Object. | ||
135 | + * | ||
136 | + * @return TE Object | ||
137 | + */ | ||
138 | + PcepTEObject build(); | ||
139 | + | ||
140 | + /** | ||
141 | + * Returns TE object header. | ||
142 | + * | ||
143 | + * @return TE object header | ||
144 | + */ | ||
145 | + PcepObjectHeader getTEObjHeader(); | ||
146 | + | ||
147 | + /** | ||
148 | + * Sets TE object header and returns its builder. | ||
149 | + * | ||
150 | + * @param obj TE object header | ||
151 | + * @return Builder by setting TE object header | ||
152 | + */ | ||
153 | + Builder setTEObjHeader(PcepObjectHeader obj); | ||
154 | + | ||
155 | + /** | ||
156 | + * Returns ProtocolId in TE Object. | ||
157 | + * | ||
158 | + * @return ProtocolId in TE Object | ||
159 | + */ | ||
160 | + byte getProtocolId(); | ||
161 | + | ||
162 | + /** | ||
163 | + * Sets ProtocolId in TE Object and returns its builder. | ||
164 | + * | ||
165 | + * @param yProtId ProtocolId in TE Object | ||
166 | + * @return Builder by setting ProtocolId | ||
167 | + */ | ||
168 | + Builder setProtocolId(byte yProtId); | ||
169 | + | ||
170 | + /** | ||
171 | + * Returns R flag in TE Object. | ||
172 | + * | ||
173 | + * @return R flag in TE Object | ||
174 | + */ | ||
175 | + boolean getRFlag(); | ||
176 | + | ||
177 | + /** | ||
178 | + * Sets R flag in TE Object and returns its builder. | ||
179 | + * | ||
180 | + * @param bRFlag R flag in TE Object | ||
181 | + * @return Builder by setting R flag | ||
182 | + */ | ||
183 | + Builder setRFlag(boolean bRFlag); | ||
184 | + | ||
185 | + /** | ||
186 | + * Returns S flag in TE Object. | ||
187 | + * | ||
188 | + * @return S flag in TE Object | ||
189 | + */ | ||
190 | + boolean getSFlag(); | ||
191 | + | ||
192 | + /** | ||
193 | + * Sets S flag in TE Object and returns its builder. | ||
194 | + * | ||
195 | + * @param bSFlag S flag in TE Object | ||
196 | + * @return Builder by setting S flag | ||
197 | + */ | ||
198 | + Builder setSFlag(boolean bSFlag); | ||
199 | + | ||
200 | + /** | ||
201 | + * Returns TE ID in TE Object. | ||
202 | + * | ||
203 | + * @return TE ID in TE Object | ||
204 | + */ | ||
205 | + int getTEId(); | ||
206 | + | ||
207 | + /** | ||
208 | + * Sets TE ID in TE Object and returns its builder. | ||
209 | + * | ||
210 | + * @param iTEId TE ID in TE Object | ||
211 | + * @return Builder by setting TE ID | ||
212 | + */ | ||
213 | + Builder setTEId(int iTEId); | ||
214 | + | ||
215 | + /** | ||
216 | + * Returns list of Optional Tlvs in TE Object. | ||
217 | + * | ||
218 | + * @return list of Optional Tlvs | ||
219 | + */ | ||
220 | + LinkedList<PcepValueType> getOptionalTlv(); | ||
221 | + | ||
222 | + /** | ||
223 | + * Sets list of Optional Tlvs in TE Object and returns its builder. | ||
224 | + * | ||
225 | + * @param llOptionalTlv list of Optional Tlvs | ||
226 | + * @return Builder by setting list of Optional Tlvs | ||
227 | + */ | ||
228 | + Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv); | ||
229 | + | ||
230 | + /** | ||
231 | + * Sets P flag in TE object header and returns its builder. | ||
232 | + * | ||
233 | + * @param value boolean value to set P flag | ||
234 | + * @return Builder by setting P flag | ||
235 | + */ | ||
236 | + Builder setPFlag(boolean value); | ||
237 | + | ||
238 | + /** | ||
239 | + * Sets I flag in TE object header and returns its builder. | ||
240 | + * | ||
241 | + * @param value boolean value to set I flag | ||
242 | + * @return Builder by setting I flag | ||
243 | + */ | ||
244 | + Builder setIFlag(boolean value); | ||
245 | + } | ||
246 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP TE Report Message. | ||
26 | + */ | ||
27 | +public interface PcepTEReportMsg extends PcepObject, PcepMessage { | ||
28 | + | ||
29 | + @Override | ||
30 | + PcepVersion getVersion(); | ||
31 | + | ||
32 | + @Override | ||
33 | + PcepType getType(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Returns list of PCEP TE Objects. | ||
37 | + * | ||
38 | + * @return list of PCEP TE Objects | ||
39 | + */ | ||
40 | + LinkedList<PcepTEObject> getTEReportList(); | ||
41 | + | ||
42 | + /** | ||
43 | + * Sets list of Optional Tlvs in TE Report Message. | ||
44 | + * | ||
45 | + * @param llTEReportList list of optional Tlvs | ||
46 | + */ | ||
47 | + void setTEReportList(LinkedList<PcepTEObject> llTEReportList); | ||
48 | + | ||
49 | + @Override | ||
50 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
51 | + | ||
52 | + /** | ||
53 | + * Builder interface with get and set functions to build TE Report message. | ||
54 | + */ | ||
55 | + public interface Builder extends PcepMessage.Builder { | ||
56 | + | ||
57 | + @Override | ||
58 | + PcepTEReportMsg build(); | ||
59 | + | ||
60 | + @Override | ||
61 | + PcepVersion getVersion(); | ||
62 | + | ||
63 | + @Override | ||
64 | + PcepType getType(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns list of Optional Tlv in TE Report Message. | ||
68 | + * | ||
69 | + * @return list of Optional Tlv | ||
70 | + */ | ||
71 | + LinkedList<PcepTEObject> getTEReportList(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets list of Optional Tlvs and returns its builder. | ||
75 | + * | ||
76 | + * @param llTEReportList list of Optional Tlvs | ||
77 | + * @return Builder object for TE report message | ||
78 | + */ | ||
79 | + Builder setTEReportList(LinkedList<PcepTEObject> llTEReportList); | ||
80 | + } | ||
81 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +/** | ||
20 | + * Enum to Provide the Different types of PCEP messages. | ||
21 | + */ | ||
22 | +public enum PcepType { | ||
23 | + | ||
24 | + NONE(0), OPEN(1), KEEP_ALIVE(2), PATH_COMPUTATION_REQUEST(3), PATH_COMPUTATION_REPLY(4), | ||
25 | + NOTIFICATION(5), ERROR(6), CLOSE(7), REPORT(10), UPDATE(11), INITIATE(12), LABEL_UPDATE(13), | ||
26 | + TE_REPORT(14), LABEL_RANGE_RESERV(15), MAX(16), END(17); | ||
27 | + | ||
28 | + int iValue; | ||
29 | + | ||
30 | + /** | ||
31 | + * Assign iValue with the value iVal as the types of PCEP message. | ||
32 | + * | ||
33 | + * @param iVal type of pcep message | ||
34 | + */ | ||
35 | + PcepType(int iVal) { | ||
36 | + | ||
37 | + iValue = iVal; | ||
38 | + } | ||
39 | + | ||
40 | + /** | ||
41 | + * Returns iValue as type of PCEP message. | ||
42 | + * | ||
43 | + * @return iValue type of pcep message | ||
44 | + */ | ||
45 | + public byte getType() { | ||
46 | + | ||
47 | + return (byte) iValue; | ||
48 | + } | ||
49 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import java.util.LinkedList; | ||
20 | + | ||
21 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
22 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
23 | + | ||
24 | +/** | ||
25 | + * Abstraction of an entity providing PCEP Update Message. | ||
26 | + */ | ||
27 | +public interface PcepUpdateMsg extends PcepObject, PcepMessage { | ||
28 | + | ||
29 | + @Override | ||
30 | + PcepVersion getVersion(); | ||
31 | + | ||
32 | + @Override | ||
33 | + PcepType getType(); | ||
34 | + | ||
35 | + /** | ||
36 | + * Returns the update request list for PCEP Update Message. | ||
37 | + * | ||
38 | + * @return list of Update Requests | ||
39 | + */ | ||
40 | + LinkedList<PcepUpdateRequest> getUpdateRequestList(); | ||
41 | + | ||
42 | + /** | ||
43 | + * Sets the update request list for PCEP update message. | ||
44 | + * | ||
45 | + * @param llUpdateRequestList is a list of PCEP Update Requests | ||
46 | + */ | ||
47 | + void setUpdateRequestList(LinkedList<PcepUpdateRequest> llUpdateRequestList); | ||
48 | + | ||
49 | + @Override | ||
50 | + void writeTo(ChannelBuffer channelBuffer) throws PcepParseException; | ||
51 | + | ||
52 | + /** | ||
53 | + * Builder interface with Get and Set Functions to build the PCEP update Message. | ||
54 | + */ | ||
55 | + public interface Builder extends PcepMessage.Builder { | ||
56 | + | ||
57 | + @Override | ||
58 | + PcepUpdateMsg build(); | ||
59 | + | ||
60 | + @Override | ||
61 | + PcepVersion getVersion(); | ||
62 | + | ||
63 | + @Override | ||
64 | + PcepType getType(); | ||
65 | + | ||
66 | + /** | ||
67 | + * Returns the update request list for the PCEP update message. | ||
68 | + * | ||
69 | + * @return list of Update Requests | ||
70 | + */ | ||
71 | + LinkedList<PcepUpdateRequest> getUpdateRequestList(); | ||
72 | + | ||
73 | + /** | ||
74 | + * Sets the update request list for the PCEP update message. | ||
75 | + * | ||
76 | + * @param llUpdateRequestList list of Update requests | ||
77 | + * @return builder by setting list llUpdateRequestList of PcepUpdateRequest. | ||
78 | + */ | ||
79 | + Builder setUpdateRequestList(LinkedList<PcepUpdateRequest> llUpdateRequestList); | ||
80 | + } | ||
81 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
20 | + | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing PCEP Update Request List. | ||
24 | + */ | ||
25 | +public interface PcepUpdateRequest { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns object of PCEP SRP Object. | ||
29 | + * | ||
30 | + * @return srpObject of type PCEP SRP Object | ||
31 | + */ | ||
32 | + PcepSrpObject getSrpObject(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Returns object of PCEP LSP Object. | ||
36 | + * | ||
37 | + * @return lspObject of type PCEP LSP Object | ||
38 | + */ | ||
39 | + PcepLspObject getLspObject(); | ||
40 | + | ||
41 | + /** | ||
42 | + * Returns object of PCEP MSG PATH. | ||
43 | + * | ||
44 | + * @return msgPath of type PCEP MSG PATH | ||
45 | + */ | ||
46 | + PcepMsgPath getMsgPath(); | ||
47 | + | ||
48 | + /** | ||
49 | + * Sets the PCEP SRP Object. | ||
50 | + * | ||
51 | + * @param srpObject object of type PCEP SRP Object | ||
52 | + */ | ||
53 | + void setSrpObject(PcepSrpObject srpObject); | ||
54 | + | ||
55 | + /** | ||
56 | + * Sets the PCEP LSP Object. | ||
57 | + * | ||
58 | + * @param lspObject object of type PCEP LSP Object | ||
59 | + */ | ||
60 | + void setLspObject(PcepLspObject lspObject); | ||
61 | + | ||
62 | + /** | ||
63 | + * sets the PCEP MSG PATH. | ||
64 | + * | ||
65 | + * @param msgPath object of type PCEP MSG PATH | ||
66 | + */ | ||
67 | + void setMsgPath(PcepMsgPath msgPath); | ||
68 | + | ||
69 | + /** | ||
70 | + * Prints the attributes of PCEP Update Request. | ||
71 | + */ | ||
72 | + public void print(); | ||
73 | + | ||
74 | + /** | ||
75 | + * Builder interface with get and set functions to build PcepUpdateRequest. | ||
76 | + */ | ||
77 | + public interface Builder { | ||
78 | + | ||
79 | + /** | ||
80 | + * Builds PcepUpdateRequest. | ||
81 | + * | ||
82 | + * @return PcepUpdateRequest | ||
83 | + * @throws PcepParseException if mandatory object is not set | ||
84 | + */ | ||
85 | + PcepUpdateRequest build() throws PcepParseException; | ||
86 | + | ||
87 | + /** | ||
88 | + * Returns PcepSrpObject. | ||
89 | + * | ||
90 | + * @return srpObject | ||
91 | + */ | ||
92 | + PcepSrpObject getSrpObject(); | ||
93 | + | ||
94 | + /** | ||
95 | + * Returns PcepLspObject. | ||
96 | + * | ||
97 | + * @return lspObject | ||
98 | + */ | ||
99 | + PcepLspObject getLspObject(); | ||
100 | + | ||
101 | + /** | ||
102 | + * Returns PcepMsgPath. | ||
103 | + * | ||
104 | + * @return msgPath | ||
105 | + */ | ||
106 | + PcepMsgPath getMsgPath(); | ||
107 | + | ||
108 | + /** | ||
109 | + * Sets the SRP Object. | ||
110 | + * | ||
111 | + * @param srpObj of type PcepSrpObject | ||
112 | + * @return builder by setting PcepSrpObject | ||
113 | + */ | ||
114 | + Builder setSrpObject(PcepSrpObject srpObj); | ||
115 | + | ||
116 | + /** | ||
117 | + * Sets the LSP Object. | ||
118 | + * | ||
119 | + * @param lspObject of type PcepLspObject | ||
120 | + * @return builder by setting PcepLspObject | ||
121 | + */ | ||
122 | + Builder setLspObject(PcepLspObject lspObject); | ||
123 | + | ||
124 | + /** | ||
125 | + * Sets the Path Object. | ||
126 | + * | ||
127 | + * @param msgPath of type PcepMsgPath | ||
128 | + * @return builder by setting PcepMsgPath | ||
129 | + */ | ||
130 | + Builder setMsgPath(PcepMsgPath msgPath); | ||
131 | + } | ||
132 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +/** | ||
20 | + * Enum to provide PCEP Message Version. | ||
21 | + */ | ||
22 | +public enum PcepVersion { | ||
23 | + | ||
24 | + PCEP_1(1); | ||
25 | + | ||
26 | + public final int packetVersion; | ||
27 | + | ||
28 | + /** | ||
29 | + * Assign PCEP PacketVersion with WireVersion. | ||
30 | + * | ||
31 | + * @param wireVersion version of pcep | ||
32 | + */ | ||
33 | + PcepVersion(final int wireVersion) { | ||
34 | + | ||
35 | + this.packetVersion = wireVersion; | ||
36 | + } | ||
37 | + | ||
38 | + /** | ||
39 | + * Returns Wire version of PCEP Message. | ||
40 | + * | ||
41 | + * @return packetVersion | ||
42 | + */ | ||
43 | + public int getWireVersion() { | ||
44 | + return packetVersion; | ||
45 | + } | ||
46 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.protocol; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction of an entity providing functionality to write byte streams of | ||
24 | + * Messages to channel buffer. | ||
25 | + */ | ||
26 | +public interface Writeable { | ||
27 | + | ||
28 | + /** | ||
29 | + * Writes byte streams of messages to channel buffer. | ||
30 | + * | ||
31 | + * @param bb parameter of type channel buffer | ||
32 | + * @throws PcepParseException when error occurs while writing pcep message to channel buffer | ||
33 | + */ | ||
34 | + void writeTo(ChannelBuffer bb) throws PcepParseException; | ||
35 | +} |
1 | +package org.onosproject.pcepio.types; | ||
2 | + | ||
3 | +import java.util.LinkedList; | ||
4 | +import java.util.ListIterator; | ||
5 | + | ||
6 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
7 | +import org.onosproject.pcepio.exceptions.PcepParseException; | ||
8 | +import org.onosproject.pcepio.protocol.PcepErrorObject; | ||
9 | +import org.onosproject.pcepio.protocol.PcepOpenObject; | ||
10 | +import org.slf4j.Logger; | ||
11 | +import org.slf4j.LoggerFactory; | ||
12 | + | ||
13 | +/* | ||
14 | + * Provide the error object list with open object. | ||
15 | + */ | ||
16 | +public class ErrorObjListWithOpen { | ||
17 | + //errorObjList is mandatory | ||
18 | + LinkedList<PcepErrorObject> llerrorObjList; | ||
19 | + // openObject is optional | ||
20 | + PcepOpenObject openObject; | ||
21 | + // flag to check if open object is set or not | ||
22 | + public boolean isOpenObjectSet; | ||
23 | + protected static final Logger log = LoggerFactory.getLogger(ErrorObjListWithOpen.class); | ||
24 | + | ||
25 | + /* | ||
26 | + * constructor to initialize errObj,openObj. | ||
27 | + * | ||
28 | + * @param errObj error object list | ||
29 | + * @param openObj open object | ||
30 | + */ | ||
31 | + public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) { | ||
32 | + this.llerrorObjList = errObj; | ||
33 | + this.openObject = openObj; | ||
34 | + if (openObj != null) { | ||
35 | + isOpenObjectSet = true; | ||
36 | + } else { | ||
37 | + isOpenObjectSet = false; | ||
38 | + } | ||
39 | + } | ||
40 | + | ||
41 | + /* | ||
42 | + * constructor to initialize errObj. | ||
43 | + * | ||
44 | + * @param errObj error object list | ||
45 | + */ | ||
46 | + public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) { | ||
47 | + this.llerrorObjList = errObj; | ||
48 | + this.openObject = null; | ||
49 | + isOpenObjectSet = false; | ||
50 | + } | ||
51 | + | ||
52 | + public LinkedList<Integer> getErrorType() { | ||
53 | + LinkedList<Integer> errorType = new LinkedList<Integer>(); | ||
54 | + if (llerrorObjList != null) { | ||
55 | + ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator(); | ||
56 | + int error; | ||
57 | + PcepErrorObject errorObj; | ||
58 | + while (errObjListIterator.hasNext()) { | ||
59 | + errorObj = errObjListIterator.next(); | ||
60 | + error = errorObj.getErrorType(); | ||
61 | + errorType.add(error); | ||
62 | + } | ||
63 | + } | ||
64 | + return errorType; | ||
65 | + } | ||
66 | + | ||
67 | + public LinkedList<Integer> getErrorValue() { | ||
68 | + LinkedList<Integer> errorValue = new LinkedList<Integer>(); | ||
69 | + if (llerrorObjList != null) { | ||
70 | + ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator(); | ||
71 | + int error; | ||
72 | + PcepErrorObject errorObj; | ||
73 | + while (errObjListIterator.hasNext()) { | ||
74 | + errorObj = errObjListIterator.next(); | ||
75 | + error = errorObj.getErrorValue(); | ||
76 | + errorValue.add(error); | ||
77 | + | ||
78 | + } | ||
79 | + } | ||
80 | + return errorValue; | ||
81 | + } | ||
82 | + /* | ||
83 | + * Checks whether error object list is empty or not. | ||
84 | + * | ||
85 | + * @return whether error object list is empty or not | ||
86 | + */ | ||
87 | + public boolean isErrorObjListWithOpenPresent() { | ||
88 | + // ( <error-obj-list> [<Open>] | ||
89 | + // At least in this case <error-obj-list> should be present. | ||
90 | + return (!this.llerrorObjList.isEmpty()) ? true : false; | ||
91 | + } | ||
92 | + | ||
93 | + /* | ||
94 | + * Write Error Object List and Open Object to channel buffer. | ||
95 | + * | ||
96 | + * @param bb of type channel buffer | ||
97 | + * @throws PcepParseException when mandatory fields are not set | ||
98 | + */ | ||
99 | + public int write(ChannelBuffer bb) throws PcepParseException { | ||
100 | + int iLenStartIndex = bb.writerIndex(); | ||
101 | + boolean bIsErrObjListFound = false; | ||
102 | + | ||
103 | + //<error-obj-list> is mandatory , if not present throw exception. | ||
104 | + if (llerrorObjList != null) { | ||
105 | + ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator(); | ||
106 | + while (errObjListIterator.hasNext()) { | ||
107 | + errObjListIterator.next().write(bb); | ||
108 | + bIsErrObjListFound = true; | ||
109 | + } | ||
110 | + } | ||
111 | + | ||
112 | + if (!bIsErrObjListFound) { | ||
113 | + throw new PcepParseException("Error: [ErrorObjListWithOpen::write] <error-obj-list> is mandatory."); | ||
114 | + } | ||
115 | + | ||
116 | + //Open Object is optional , if present write. | ||
117 | + if (openObject != null) { | ||
118 | + openObject.write(bb); | ||
119 | + } | ||
120 | + | ||
121 | + return bb.writerIndex() - iLenStartIndex; | ||
122 | + } | ||
123 | + | ||
124 | + /* | ||
125 | + * Prints the attributes of ErrorObject List with open Object. | ||
126 | + */ | ||
127 | + public void print() { | ||
128 | + log.debug("ErrorObjListWithOpen:"); | ||
129 | + ListIterator<PcepErrorObject> pcepErrorObjIterator = llerrorObjList.listIterator(); | ||
130 | + log.debug("<error-obj-list> :"); | ||
131 | + while (pcepErrorObjIterator.hasNext()) { | ||
132 | + pcepErrorObjIterator.next().print(); | ||
133 | + } | ||
134 | + | ||
135 | + log.debug("OpenObject:"); | ||
136 | + if (openObject != null) { | ||
137 | + openObject.print(); | ||
138 | + } | ||
139 | + } | ||
140 | +} |
1 | +package org.onosproject.pcepio.types; | ||
2 | + | ||
3 | +import java.util.LinkedList; | ||
4 | +import java.util.ListIterator; | ||
5 | + | ||
6 | +import org.onosproject.pcepio.protocol.PcepLabelObject; | ||
7 | +import org.onosproject.pcepio.protocol.PcepLspObject; | ||
8 | +import org.onosproject.pcepio.protocol.PcepSrpObject; | ||
9 | +import org.slf4j.Logger; | ||
10 | +import org.slf4j.LoggerFactory; | ||
11 | + | ||
12 | +/* | ||
13 | + * Provides Pcep Label. | ||
14 | + * REference :draft-zhao-pce-pcep-extension-for-pce-controller-01. | ||
15 | + */ | ||
16 | +public class PcepLabelDownload { | ||
17 | + | ||
18 | + protected static final Logger log = LoggerFactory.getLogger(PcepLabelDownload.class); | ||
19 | + | ||
20 | + //PCEP SPR Object | ||
21 | + PcepSrpObject srpObject; | ||
22 | + //PCEP LSP Object | ||
23 | + PcepLspObject lspObject; | ||
24 | + //LinkList of Labels | ||
25 | + LinkedList<PcepLabelObject> llLabelList; | ||
26 | + | ||
27 | + /* | ||
28 | + * Returns SRP Object. | ||
29 | + * | ||
30 | + * @return PCEP SRP Object | ||
31 | + */ | ||
32 | + public PcepSrpObject getSrpObject() { | ||
33 | + return srpObject; | ||
34 | + } | ||
35 | + | ||
36 | + /* | ||
37 | + * Sets the Pcep Srp Object. | ||
38 | + * | ||
39 | + * @param srpobj PCEP SRP Object | ||
40 | + */ | ||
41 | + public void setSrpObject(PcepSrpObject srpobj) { | ||
42 | + this.srpObject = srpobj; | ||
43 | + } | ||
44 | + | ||
45 | + /* | ||
46 | + * Returns LSP Object. | ||
47 | + * | ||
48 | + * @return PCEP LSP Object | ||
49 | + */ | ||
50 | + public PcepLspObject getLspObject() { | ||
51 | + return lspObject; | ||
52 | + } | ||
53 | + | ||
54 | + /* | ||
55 | + * Sets the Pcep LSP Object. | ||
56 | + * | ||
57 | + * @param lspObject PCEP LSP Object | ||
58 | + */ | ||
59 | + public void setLspObject(PcepLspObject lspObject) { | ||
60 | + this.lspObject = lspObject; | ||
61 | + } | ||
62 | + | ||
63 | + /* | ||
64 | + * Returns a list of labels. | ||
65 | + * | ||
66 | + * @return llLabelList list of pcep label objects | ||
67 | + */ | ||
68 | + public LinkedList<PcepLabelObject> getLabelList() { | ||
69 | + return llLabelList; | ||
70 | + } | ||
71 | + | ||
72 | + /* | ||
73 | + * set the llLabelList list of type PcepLableObject. | ||
74 | + * | ||
75 | + * @param llLabelList list of pcep label objects | ||
76 | + */ | ||
77 | + public void setLabelList(LinkedList<PcepLabelObject> llLabelList) { | ||
78 | + this.llLabelList = llLabelList; | ||
79 | + } | ||
80 | + | ||
81 | + /* | ||
82 | + * Prints the attribute of PcepLableObject. | ||
83 | + */ | ||
84 | + public void print() { | ||
85 | + log.debug("LABEL DOWNLOAD:"); | ||
86 | + srpObject.print(); | ||
87 | + lspObject.print(); | ||
88 | + | ||
89 | + log.debug("label-list:"); | ||
90 | + ListIterator<PcepLabelObject> listIterator = llLabelList.listIterator(); | ||
91 | + while (listIterator.hasNext()) { | ||
92 | + listIterator.next().print(); | ||
93 | + } | ||
94 | + } | ||
95 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.types; | ||
18 | + | ||
19 | +import org.onosproject.pcepio.protocol.PcepFecObject; | ||
20 | +import org.onosproject.pcepio.protocol.PcepLabelObject; | ||
21 | +import org.onosproject.pcepio.protocol.PcepSrpObject; | ||
22 | +import org.slf4j.Logger; | ||
23 | +import org.slf4j.LoggerFactory; | ||
24 | + | ||
25 | +/** | ||
26 | + * Provide PCEP Label Map. | ||
27 | + * Reference :draft-zhao-pce-pcep-extension-for-pce-controller-01. | ||
28 | + */ | ||
29 | +public class PcepLabelMap { | ||
30 | + | ||
31 | + protected static final Logger log = LoggerFactory.getLogger(PcepLabelMap.class); | ||
32 | + //PCEP SRP Object | ||
33 | + PcepSrpObject srpObject; | ||
34 | + //PCEP Label Object | ||
35 | + PcepLabelObject labelObject; | ||
36 | + //PCEP FEC Object | ||
37 | + PcepFecObject fecObject; | ||
38 | + | ||
39 | + /** | ||
40 | + * Sets Fec Object. | ||
41 | + * | ||
42 | + * @param fecObject PCEP fec object | ||
43 | + */ | ||
44 | + public void setFECObject(PcepFecObject fecObject) { | ||
45 | + this.fecObject = fecObject; | ||
46 | + } | ||
47 | + | ||
48 | + /** | ||
49 | + * Returns the PcepFecObject. | ||
50 | + * | ||
51 | + * @return PCEP fec object | ||
52 | + */ | ||
53 | + public PcepFecObject getFECObject() { | ||
54 | + return this.fecObject; | ||
55 | + } | ||
56 | + | ||
57 | + /** | ||
58 | + * Returns SRP Object. | ||
59 | + * | ||
60 | + * @return PCEP SRP Object | ||
61 | + */ | ||
62 | + public PcepSrpObject getSrpObject() { | ||
63 | + return srpObject; | ||
64 | + } | ||
65 | + | ||
66 | + /** | ||
67 | + * Sets the PCEP Srp Object. | ||
68 | + * | ||
69 | + * @param srpObject PCEP SRP Object | ||
70 | + */ | ||
71 | + public void setSrpObject(PcepSrpObject srpObject) { | ||
72 | + this.srpObject = srpObject; | ||
73 | + } | ||
74 | + | ||
75 | + /** | ||
76 | + * Returns labelObject. | ||
77 | + * | ||
78 | + * @return PCEP label object | ||
79 | + */ | ||
80 | + public PcepLabelObject getLabelObject() { | ||
81 | + return labelObject; | ||
82 | + } | ||
83 | + | ||
84 | + /** | ||
85 | + * Sets the Pcep labelObject. | ||
86 | + * | ||
87 | + * @param labelObject PCEP label object | ||
88 | + */ | ||
89 | + public void setLabelObject(PcepLabelObject labelObject) { | ||
90 | + this.labelObject = labelObject; | ||
91 | + } | ||
92 | + | ||
93 | + /** | ||
94 | + * Prints the attribute of PcepLabelMap. | ||
95 | + */ | ||
96 | + public void print() { | ||
97 | + log.debug("LABEL MAP:"); | ||
98 | + srpObject.print(); | ||
99 | + labelObject.print(); | ||
100 | + fecObject.print(); | ||
101 | + } | ||
102 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.types; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.slf4j.Logger; | ||
21 | +import org.slf4j.LoggerFactory; | ||
22 | + | ||
23 | +/** | ||
24 | + * Provides PCEP Object Header which is common for all the objects. | ||
25 | + * Reference : RFC 5440. | ||
26 | + */ | ||
27 | + | ||
28 | +public class PcepObjectHeader { | ||
29 | + | ||
30 | + /* | ||
31 | + 0 1 2 3 | ||
32 | + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 | ||
33 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
34 | + | Object-Class | OT |Res|P|I| Object Length (bytes) | | ||
35 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
36 | + | | | ||
37 | + // (Object body) // | ||
38 | + | | | ||
39 | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
40 | + | ||
41 | + PCEP Common Object Header | ||
42 | + */ | ||
43 | + | ||
44 | + protected static final Logger log = LoggerFactory.getLogger(PcepObjectHeader.class); | ||
45 | + | ||
46 | + public static final boolean REQ_OBJ_MUST_PROCESS = true; | ||
47 | + public static final boolean REQ_OBJ_OPTIONAL_PROCESS = false; | ||
48 | + public static final boolean RSP_OBJ_IGNORED = true; | ||
49 | + public static final boolean RSP_OBJ_PROCESSED = false; | ||
50 | + public static final int OBJECT_TYPE_SHIFT_VALUE = 4; | ||
51 | + public static final byte PFLAG_SET = 0x02; | ||
52 | + public static final byte IFLAG_SET = 0x01; | ||
53 | + public static final int SET = 1; | ||
54 | + private byte objClass; | ||
55 | + private byte objType; | ||
56 | + private boolean bPFlag; | ||
57 | + private boolean bIFlag; | ||
58 | + private short objLen; | ||
59 | + | ||
60 | + /** | ||
61 | + * Constructor to initialize all the variables in object header. | ||
62 | + * | ||
63 | + * @param objClass PCEP Object class | ||
64 | + * @param objType PCEP Object type | ||
65 | + * @param bPFlag P flag | ||
66 | + * @param bIFlag I flag | ||
67 | + * @param objLen PCEP object length | ||
68 | + */ | ||
69 | + | ||
70 | + public PcepObjectHeader(byte objClass, byte objType, boolean bPFlag, boolean bIFlag, short objLen) { | ||
71 | + this.objClass = objClass; | ||
72 | + this.objType = objType; | ||
73 | + this.bPFlag = bPFlag; | ||
74 | + this.bIFlag = bIFlag; | ||
75 | + this.objLen = objLen; | ||
76 | + } | ||
77 | + | ||
78 | + /** | ||
79 | + * Sets the Object class. | ||
80 | + * | ||
81 | + * @param value object class | ||
82 | + */ | ||
83 | + public void setObjClass(byte value) { | ||
84 | + this.objClass = value; | ||
85 | + } | ||
86 | + | ||
87 | + /** | ||
88 | + * Sets the Object TYPE. | ||
89 | + * | ||
90 | + * @param value object type | ||
91 | + */ | ||
92 | + public void setObjType(byte value) { | ||
93 | + this.objType = value; | ||
94 | + } | ||
95 | + | ||
96 | + /** | ||
97 | + * Sets the Object P flag. | ||
98 | + * | ||
99 | + * @param value p flag | ||
100 | + */ | ||
101 | + public void setPFlag(boolean value) { | ||
102 | + this.bPFlag = value; | ||
103 | + } | ||
104 | + | ||
105 | + /** | ||
106 | + * Sets the Object I flag. | ||
107 | + * | ||
108 | + * @param value I flag | ||
109 | + */ | ||
110 | + public void setIFlag(boolean value) { | ||
111 | + this.bIFlag = value; | ||
112 | + } | ||
113 | + | ||
114 | + /** | ||
115 | + * Sets the Object Length. | ||
116 | + * | ||
117 | + * @param value object length | ||
118 | + */ | ||
119 | + public void setObjLen(short value) { | ||
120 | + this.objLen = value; | ||
121 | + } | ||
122 | + | ||
123 | + /** | ||
124 | + * Returns Object's P flag. | ||
125 | + * | ||
126 | + * @return bPFlag P flag | ||
127 | + */ | ||
128 | + public boolean getPFlag() { | ||
129 | + return this.bPFlag; | ||
130 | + } | ||
131 | + | ||
132 | + /** | ||
133 | + * Returns Object's i flag. | ||
134 | + * | ||
135 | + * @return bIFlag I flag | ||
136 | + */ | ||
137 | + public boolean getIFlag() { | ||
138 | + return this.bIFlag; | ||
139 | + } | ||
140 | + | ||
141 | + /** | ||
142 | + * Returns Object Length. | ||
143 | + * | ||
144 | + * @return objLen object length | ||
145 | + */ | ||
146 | + public short getObjLen() { | ||
147 | + return this.objLen; | ||
148 | + } | ||
149 | + | ||
150 | + /** | ||
151 | + * Returns Object class. | ||
152 | + * | ||
153 | + * @return objClass object class | ||
154 | + */ | ||
155 | + public byte getObjClass() { | ||
156 | + return this.objClass; | ||
157 | + } | ||
158 | + | ||
159 | + /** | ||
160 | + * Returns Object Type. | ||
161 | + * | ||
162 | + * @return objType object type | ||
163 | + */ | ||
164 | + public byte getObjType() { | ||
165 | + return this.objType; | ||
166 | + } | ||
167 | + | ||
168 | + /** | ||
169 | + * Writes Byte stream of PCEP object header to channel buffer. | ||
170 | + * | ||
171 | + * @param bb of type channel buffer | ||
172 | + * @return objLenIndex object length index in channel buffer | ||
173 | + */ | ||
174 | + public int write(ChannelBuffer bb) { | ||
175 | + | ||
176 | + bb.writeByte(this.objClass); | ||
177 | + byte temp = (byte) (this.objType << OBJECT_TYPE_SHIFT_VALUE); | ||
178 | + if (this.bPFlag) { | ||
179 | + temp = (byte) (temp | PFLAG_SET); | ||
180 | + } | ||
181 | + if (this.bIFlag) { | ||
182 | + temp = (byte) (temp | IFLAG_SET); | ||
183 | + } | ||
184 | + bb.writeByte(temp); | ||
185 | + int objLenIndex = bb.writerIndex(); | ||
186 | + bb.writeShort((short) 0); | ||
187 | + return objLenIndex; | ||
188 | + } | ||
189 | + | ||
190 | + /** | ||
191 | + * Read from channel buffer and Returns PCEP Objects header. | ||
192 | + * | ||
193 | + * @param bb of type channel buffer | ||
194 | + * @return PCEP Object header | ||
195 | + */ | ||
196 | + public static PcepObjectHeader read(ChannelBuffer bb) { | ||
197 | + | ||
198 | + byte objClass; | ||
199 | + byte objType; | ||
200 | + boolean bPFlag; | ||
201 | + boolean bIFlag; | ||
202 | + short objLen; | ||
203 | + objClass = bb.readByte(); | ||
204 | + byte temp = bb.readByte(); | ||
205 | + bIFlag = ((temp & IFLAG_SET) == IFLAG_SET) ? true : false; | ||
206 | + bPFlag = ((temp & PFLAG_SET) == PFLAG_SET) ? true : false; | ||
207 | + objType = (byte) (temp >> OBJECT_TYPE_SHIFT_VALUE); | ||
208 | + objLen = bb.readShort(); | ||
209 | + return new PcepObjectHeader(objClass, objType, bPFlag, bIFlag, objLen); | ||
210 | + } | ||
211 | + | ||
212 | + /** | ||
213 | + * Prints the Attributes of PCEP Object header. | ||
214 | + */ | ||
215 | + public void print() { | ||
216 | + | ||
217 | + log.debug("PcepObjectHeader"); | ||
218 | + log.debug("Object Class: " + objClass); | ||
219 | + log.debug("Object Type: " + objType); | ||
220 | + log.debug("Object Length: " + objLen); | ||
221 | + log.debug("P flag: " + bPFlag); | ||
222 | + log.debug("I flag: " + bIFlag); | ||
223 | + } | ||
224 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.types; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.slf4j.Logger; | ||
21 | +import org.slf4j.LoggerFactory; | ||
22 | + | ||
23 | +/** | ||
24 | + * Provides PcepRsvpObjectHeader. | ||
25 | + */ | ||
26 | +public class PcepRsvpObjectHeader { | ||
27 | + | ||
28 | + /* | ||
29 | + 0 1 2 3 | ||
30 | + +-------------+-------------+-------------+-------------+ | ||
31 | + | Length (bytes) | Class-Num | C-Type | | ||
32 | + +-------------+-------------+-------------+-------------+ | ||
33 | + | | | ||
34 | + // (Object contents) // | ||
35 | + | | | ||
36 | + +-------------+-------------+-------------+-------------+ | ||
37 | + | ||
38 | + ERROR_SPEC object Header | ||
39 | + */ | ||
40 | + | ||
41 | + protected static final Logger log = LoggerFactory.getLogger(PcepRsvpObjectHeader.class); | ||
42 | + | ||
43 | + public static final boolean REQ_OBJ_MUST_PROCESS = true; | ||
44 | + public static final boolean REQ_OBJ_OPTIONAL_PROCESS = false; | ||
45 | + public static final boolean RSP_OBJ_IGNORED = true; | ||
46 | + public static final boolean RSP_OBJ_PROCESSED = false; | ||
47 | + public static final int OBJECT_TYPE_SHIFT_VALUE = 4; | ||
48 | + private byte objClassNum; | ||
49 | + private byte objClassType; | ||
50 | + private short objLen; | ||
51 | + | ||
52 | + /** | ||
53 | + * Constructor to initialize class num , length and type. | ||
54 | + * | ||
55 | + * @param objClassNum object class number | ||
56 | + * @param objClassType object class type | ||
57 | + * @param objLen object length | ||
58 | + */ | ||
59 | + public PcepRsvpObjectHeader(byte objClassNum, byte objClassType, short objLen) { | ||
60 | + this.objClassNum = objClassNum; | ||
61 | + this.objClassType = objClassType; | ||
62 | + this.objLen = objLen; | ||
63 | + } | ||
64 | + | ||
65 | + /** | ||
66 | + * Sets the Class num. | ||
67 | + * | ||
68 | + * @param value object class number | ||
69 | + */ | ||
70 | + public void setObjClassNum(byte value) { | ||
71 | + this.objClassNum = value; | ||
72 | + } | ||
73 | + | ||
74 | + /** | ||
75 | + * Sets the Class type. | ||
76 | + * | ||
77 | + * @param value object class type | ||
78 | + */ | ||
79 | + public void setObjClassType(byte value) { | ||
80 | + this.objClassType = value; | ||
81 | + } | ||
82 | + | ||
83 | + /** | ||
84 | + * Sets the Class Length. | ||
85 | + * | ||
86 | + * @param value object length | ||
87 | + */ | ||
88 | + public void setObjLen(short value) { | ||
89 | + this.objLen = value; | ||
90 | + } | ||
91 | + | ||
92 | + /** | ||
93 | + * Returns Object Length. | ||
94 | + * | ||
95 | + * @return objLen | ||
96 | + */ | ||
97 | + public short getObjLen() { | ||
98 | + return this.objLen; | ||
99 | + } | ||
100 | + | ||
101 | + /** | ||
102 | + * Returns Object num. | ||
103 | + * | ||
104 | + * @return objClassNum | ||
105 | + */ | ||
106 | + public byte getObjClassNum() { | ||
107 | + return this.objClassNum; | ||
108 | + } | ||
109 | + | ||
110 | + /** | ||
111 | + * Returns Object type. | ||
112 | + * | ||
113 | + * @return objClassType | ||
114 | + */ | ||
115 | + public byte getObjClassType() { | ||
116 | + return this.objClassType; | ||
117 | + } | ||
118 | + | ||
119 | + /** | ||
120 | + * Writes the byte stream of PcepRsvpObjectHeader to channel buffer. | ||
121 | + * | ||
122 | + * @param bb of type channel buffer | ||
123 | + * @return object length index in channel buffer | ||
124 | + */ | ||
125 | + public int write(ChannelBuffer bb) { | ||
126 | + int iLenStartIndex = bb.writerIndex(); | ||
127 | + bb.writeShort((short) 0); | ||
128 | + bb.writeByte(this.objClassNum); | ||
129 | + bb.writeByte(this.objClassType); | ||
130 | + return bb.writerIndex() - iLenStartIndex; | ||
131 | + } | ||
132 | + | ||
133 | + /** | ||
134 | + * Reads the PcepRsvpObjectHeader. | ||
135 | + * | ||
136 | + * @param bb of type channel buffer | ||
137 | + * @return PcepRsvpObjectHeader | ||
138 | + */ | ||
139 | + public static PcepRsvpObjectHeader read(ChannelBuffer bb) { | ||
140 | + log.debug("PcepRsvpObjectHeader ::read "); | ||
141 | + byte objClassNum; | ||
142 | + byte objClassType; | ||
143 | + short objLen; | ||
144 | + objLen = bb.readShort(); | ||
145 | + objClassNum = bb.readByte(); | ||
146 | + objClassType = bb.readByte(); | ||
147 | + | ||
148 | + return new PcepRsvpObjectHeader(objClassNum, objClassType, objLen); | ||
149 | + } | ||
150 | + | ||
151 | + /** | ||
152 | + * Prints the attribute of PcepRsvpObjectHeader. | ||
153 | + */ | ||
154 | + public void print() { | ||
155 | + | ||
156 | + log.debug("PcepObjectHeader"); | ||
157 | + log.debug("Object Class-Num: " + objClassNum); | ||
158 | + log.debug("Object C-Type: " + objClassType); | ||
159 | + log.debug("Object Length: " + objLen); | ||
160 | + } | ||
161 | +} |
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 | + | ||
17 | +package org.onosproject.pcepio.types; | ||
18 | + | ||
19 | +import org.jboss.netty.buffer.ChannelBuffer; | ||
20 | +import org.onosproject.pcepio.protocol.PcepVersion; | ||
21 | + | ||
22 | +/** | ||
23 | + * Abstraction which Provides the PCEP Values of Type, Length ,Version. | ||
24 | + */ | ||
25 | +public interface PcepValueType { | ||
26 | + | ||
27 | + /** | ||
28 | + * Returns the Version Of PCEP Message. | ||
29 | + * | ||
30 | + * @return Version of PcepVersion Type. | ||
31 | + */ | ||
32 | + PcepVersion getVersion(); | ||
33 | + | ||
34 | + /** | ||
35 | + * Returns the Type of PCEP Message. | ||
36 | + * | ||
37 | + * @return value of type | ||
38 | + */ | ||
39 | + public short getType(); | ||
40 | + | ||
41 | + /** | ||
42 | + * Returns the Length of PCEP Message. | ||
43 | + * | ||
44 | + * @return value of Length | ||
45 | + */ | ||
46 | + public short getLength(); | ||
47 | + | ||
48 | + /** | ||
49 | + * Writes the byte Stream of PCEP Message to channel buffer. | ||
50 | + * | ||
51 | + * @param bb of type channel buffer | ||
52 | + * @return length of bytes written to channel buffer | ||
53 | + */ | ||
54 | + public int write(ChannelBuffer bb); | ||
55 | + | ||
56 | + /** | ||
57 | + * Prints the Attributes of PCEP Message. | ||
58 | + */ | ||
59 | + public void print(); | ||
60 | +} |
pcep/pom.xml
0 → 100755
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<!-- | ||
3 | + ~ Copyright 2014 Open Networking Laboratory | ||
4 | + ~ | ||
5 | + ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
6 | + ~ you may not use this file except in compliance with the License. | ||
7 | + ~ You may obtain a copy of the License at | ||
8 | + ~ | ||
9 | + ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
10 | + ~ | ||
11 | + ~ Unless required by applicable law or agreed to in writing, software | ||
12 | + ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
13 | + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
14 | + ~ See the License for the specific language governing permissions and | ||
15 | + ~ limitations under the License. | ||
16 | + --> | ||
17 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
18 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
19 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
20 | + <modelVersion>4.0.0</modelVersion> | ||
21 | + | ||
22 | + <parent> | ||
23 | + <groupId>org.onosproject</groupId> | ||
24 | + <artifactId>onos</artifactId> | ||
25 | + <version>1.3.0-SNAPSHOT</version> | ||
26 | + <relativePath>../pom.xml</relativePath> | ||
27 | + </parent> | ||
28 | + | ||
29 | + <artifactId>onos-pcep-controller</artifactId> | ||
30 | + <packaging>pom</packaging> | ||
31 | + | ||
32 | + <description>ONOS Pcep Protocol subsystem</description> | ||
33 | + | ||
34 | + <modules> | ||
35 | + <module>api</module> | ||
36 | + <module>pcepio</module> | ||
37 | + </modules> | ||
38 | + | ||
39 | + <dependencies> | ||
40 | + <dependency> | ||
41 | + <groupId>org.onosproject</groupId> | ||
42 | + <artifactId>onlab-misc</artifactId> | ||
43 | + </dependency> | ||
44 | + <dependency> | ||
45 | + <groupId>org.onosproject</groupId> | ||
46 | + <artifactId>onlab-junit</artifactId> | ||
47 | + </dependency> | ||
48 | + </dependencies> | ||
49 | + | ||
50 | + <build> | ||
51 | + <plugins> | ||
52 | + <plugin> | ||
53 | + <groupId>org.apache.felix</groupId> | ||
54 | + <artifactId>maven-bundle-plugin</artifactId> | ||
55 | + </plugin> | ||
56 | + </plugins> | ||
57 | + </build> | ||
58 | + | ||
59 | +</project> |
pom.xml
100644 → 100755
... | @@ -49,6 +49,7 @@ | ... | @@ -49,6 +49,7 @@ |
49 | <module>apps</module> | 49 | <module>apps</module> |
50 | <module>incubator</module> | 50 | <module>incubator</module> |
51 | <module>features</module> | 51 | <module>features</module> |
52 | + <module>pcep</module> | ||
52 | <module>tools/package/archetypes</module> | 53 | <module>tools/package/archetypes</module> |
53 | <module>tools/package/branding</module> | 54 | <module>tools/package/branding</module> |
54 | <!-- FIXME remove before release --> | 55 | <!-- FIXME remove before release --> |
... | @@ -399,6 +400,18 @@ | ... | @@ -399,6 +400,18 @@ |
399 | 400 | ||
400 | <dependency> | 401 | <dependency> |
401 | <groupId>org.onosproject</groupId> | 402 | <groupId>org.onosproject</groupId> |
403 | + <artifactId>onos-pcepio</artifactId> | ||
404 | + <version>${project.version}</version> | ||
405 | + </dependency> | ||
406 | + | ||
407 | + <dependency> | ||
408 | + <groupId>org.onosproject</groupId> | ||
409 | + <artifactId>onos-pcep-controller-api</artifactId> | ||
410 | + <version>${project.version}</version> | ||
411 | + </dependency> | ||
412 | + | ||
413 | + <dependency> | ||
414 | + <groupId>org.onosproject</groupId> | ||
402 | <artifactId>onos-app-pcep-api</artifactId> | 415 | <artifactId>onos-app-pcep-api</artifactId> |
403 | <version>${project.version}</version> | 416 | <version>${project.version}</version> |
404 | </dependency> | 417 | </dependency> | ... | ... |
-
Please register or login to post a comment