Committed by
Gerrit Code Review
Interfaces added for PCEP messages and PCEP Controller
Change-Id: Id678b6832b42bcf4a437322996244d224c4052d0
Showing
74 changed files
with
5138 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 |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
pcep/pom.xml
0 → 100755
This diff is collapsed. Click to expand it.
pom.xml
100644 → 100755
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment