Phaneendra Manda
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014 Open Networking Laboratory
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-pcep-controller</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-pcep-controller-api</artifactId>
<packaging>bundle</packaging>
<description>ONOS Pcep controller subsystem API</description>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-pcepio</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-api</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-misc</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<configuration>
<artifactSet>
<excludes>
<exclude>io.netty:netty</exclude>
<exclude>com.google.guava:guava</exclude>
<exclude>org.slf4j:slfj-api</exclude>
<exclude>ch.qos.logback:logback-core</exclude>
<exclude>ch.qos.logback:logback-classic</exclude>
<exclude>com.google.code.findbugs:annotations</exclude>
</excludes>
</artifactSet>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
org.onosproject.pcep.*,org.onosproject.pcepio.*
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller;
import static com.google.common.base.Preconditions.checkArgument;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Objects;
import org.onlab.packet.IpAddress;
/**
* The class representing a network client pc ip.
* This class is immutable.
*/
public final class PccId {
private static final String SCHEME = "pcep";
private static final long UNKNOWN = 0;
private final IpAddress ipAddress;
/**
* Private constructor.
*/
private PccId(IpAddress ipAddress) {
this.ipAddress = ipAddress;
}
/**
* Create a PccId from ip address.
*
* @param ipAddress IP address
* @return ipAddress
*/
public static PccId pccId(IpAddress ipAddress) {
return new PccId(ipAddress);
}
/**
* Returns the ip address.
*
* @return ipAddress
*/
public IpAddress ipAddress() {
return ipAddress;
}
/**
* Convert the PccId value to a ':' separated hexadecimal string.
*
* @return the PccId value as a ':' separated hexadecimal string.
*/
@Override
public String toString() {
return ipAddress.toString();
}
@Override
public boolean equals(Object other) {
if (!(other instanceof PccId)) {
return false;
}
PccId otherPccid = (PccId) other;
return Objects.equals(ipAddress, otherPccid.ipAddress);
}
@Override
public int hashCode() {
return Objects.hash(ipAddress);
}
/**
* Returns PccId created from the given client URI.
*
* @param uri device URI
* @return pccid
*/
public static PccId pccid(URI uri) {
checkArgument(uri.getScheme().equals(SCHEME), "Unsupported URI scheme");
return new PccId(IpAddress.valueOf(uri.getSchemeSpecificPart()));
}
/**
* Produces client URI from the given DPID.
*
* @param pccid client pccid
* @return client URI
*/
public static URI uri(PccId pccid) {
return uri(pccid.ipAddress());
}
/**
* Produces client URI from the given ip address.
*
* @param ipAddress ip of client
* @return client URI
*/
public static URI uri(IpAddress ipAddress) {
try {
return new URI(SCHEME, ipAddress.toString(), null);
} catch (URISyntaxException e) {
return null;
}
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller;
import java.util.List;
import org.onosproject.pcepio.protocol.PcepFactory;
import org.onosproject.pcepio.protocol.PcepMessage;
/**
* Represents to provider facing side of a path computation client(pcc).
*/
public interface PcepClient {
/**
* Writes the message to the driver.
*
* @param msg the message to write
*/
public void sendMessage(PcepMessage msg);
/**
* Writes the PcepMessage list to the driver.
*
* @param msgs the messages to be written
*/
public void sendMessage(List<PcepMessage> msgs);
/**
* Handle a message from the pcc.
*
* @param fromClient the message to handle
*/
public void handleMessage(PcepMessage fromClient);
/**
* Provides the factory for this PCEP version.
*
* @return PCEP version specific factory.
*/
public PcepFactory factory();
/**
* Gets a string version of the ID for this pcc.
*
* @return string version of the ID
*/
public String getStringId();
/**
* Gets the ipAddress of the client.
*
* @return the client pccId in IPAddress format
*/
public PccId getPccId();
/**
* Checks if the pcc is still connected.
*
* @return true if client is connected, false otherwise
*/
public boolean isConnected();
/**
* Disconnects the pcc by closing the TCP connection. Results in a call
* to the channel handler's channelDisconnected method for cleanup.
*/
public void disconnectClient();
/**
* Indicates if this pcc is optical.
*
* @return true if optical
*/
public boolean isOptical();
/**
* Identifies the channel used to communicate with the pcc.
*
* @return string representation of the connection to the client
*/
public String channelId();
/**
* To set the status of state synchronization.
*
* @param value to set the synchronization status
*/
public void setIsSyncComplete(boolean value);
/**
* Indicates the state synchronization status of this pcc.
*
* @return true/false if the synchronization is completed/not completed
*/
public boolean isSyncComplete();
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller;
import java.util.List;
import org.onosproject.pcepio.protocol.PcepMessage;
/**
* Abstraction of an Pcep controller. Serves as a one stop
* shop for obtaining Pcep devices and (un)register listeners
* on pcep events
*/
public interface PcepClientController {
/**
* Returns list of pcc clients connected to this Pcep controller.
*
* @return list of PcepClient elements
*/
public List<PcepClient> getClients();
/**
* Returns the actual pcc client for the given ip address.
*
* @param pccId the id of the pcc client to fetch
* @return the interface to this pcc client
*/
public PcepClient getClient(PccId pccId);
/**
* Register a listener for meta events that occur to pcep
* devices.
*
* @param listener the listener to notify
*/
public void addListener(PcepClientListener listener);
/**
* Unregister a listener.
*
* @param listener the listener to unregister
*/
public void removeListener(PcepClientListener listener);
/**
* Register a listener for OF msg events.
*
* @param listener the listener to notify
*/
public void addEventListener(PcepEventListener listener);
/**
* Unregister a listener.
*
* @param listener the listener to unregister
*/
public void removeEventListener(PcepEventListener listener);
/**
* Send a message to a particular pcc client.
*
* @param pccId the id of the client to send message.
* @param msg the message to send
*/
public void writeMessage(PccId pccId, PcepMessage msg);
/**
* Process a message and notify the appropriate listeners.
*
* @param pccId id of the client the message arrived on
* @param msg the message to process.
*/
public void processClientMessage(PccId pccId, PcepMessage msg);
/**
* Close all connected PCC clients.
*/
public void closeConnectedClients();
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller;
/**
* Allows for providers interested in PCC client events to be notified.
*/
public interface PcepClientListener {
/**
* Notify that the PCC was connected.
*
* @param pccId the id of the client that connected
*/
public void clientConnected(PccId pccId);
/**
* Notify that the PCC was disconnected.
*
* @param pccId the id of the client that disconnected.
*/
public void clientDisconnected(PccId pccId);
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller;
import org.onosproject.pcepio.protocol.PcepMessage;
/**
* Notifies providers about pcep msg events.
*/
public interface PcepEventListener {
/**
* Handles the message event.
*
* @param pccId id of the pcc
* @param msg the message
*/
public void handleMessage(PccId pccId, PcepMessage msg);
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller;
/**
* The representation for PCEP packet statistics.
*/
public interface PcepPacketStats {
/**
* Returns the count for no of packets sent out.
*
* @return int value of no of packets sent
*/
public int outPacketCount();
/**
* Returns the count for no of packets received.
*
* @return int value of no of packets sent
*/
public int inPacketCount();
/**
* Returns the count for no of wrong packets received.
*
* @return int value of no of wrong packets received
*/
public int wrongPacketCount();
/**
* Returns the time value.
*
* @return long value of time
*/
public long getTime();
/**
* Sets the time value.
*
* @param time long value of time
*/
public void setTime(long time);
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller.driver;
import org.onosproject.pcep.controller.PccId;
import org.onosproject.pcep.controller.PcepClient;
import org.onosproject.pcepio.protocol.PcepMessage;
/**
* Responsible for keeping track of the current set Pcep clients
* connected to the system.
*
*/
public interface PcepAgent {
/**
* Add a pcc client that has just connected to the system.
*
* @param pccId the id of pcc client to add
* @param pc the actual pce client object.
* @return true if added, false otherwise.
*/
public boolean addConnectedClient(PccId pccId, PcepClient pc);
/**
* Checks if the activation for this pcc client is valid.
*
* @param pccId the id of pcc client to check
* @return true if valid, false otherwise
*/
public boolean validActivation(PccId pccId);
/**
* Clear all state in controller client maps for a pcc client that has
* disconnected from the local controller. Also release control for
* that pccIds client from the global repository. Notify client listeners.
*
* @param pccIds the id of pcc client to remove.
*/
public void removeConnectedClient(PccId pccIds);
/**
* Process a message coming from a pcc client.
*
* @param pccId the id of pcc client the message was received.
* @param m the message to process
*/
public void processPcepMessage(PccId pccId, PcepMessage m);
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller.driver;
import org.jboss.netty.channel.Channel;
import org.onosproject.pcep.controller.PccId;
import org.onosproject.pcep.controller.PcepClient;
import org.onosproject.pcep.controller.PcepPacketStats;
import org.onosproject.pcepio.protocol.PcepVersion;
/**
* Represents the driver side of an Path computation client(pcc).
*
*/
public interface PcepClientDriver extends PcepClient {
/**
* Sets the Pcep agent to be used. This method
* can only be called once.
*
* @param agent the agent to set.
*/
public void setAgent(PcepAgent agent);
/**
* Announce to the Pcep agent that this pcc client has connected.
*
* @return true if successful, false if duplicate switch.
*/
public boolean connectClient();
/**
* Remove this pcc client from the Pcep agent.
*/
public void removeConnectedClient();
/**
* Sets the PCEP version for this pcc.
*
* @param pcepVersion the version to set.
*/
public void setPcVersion(PcepVersion pcepVersion);
/**
* Sets the associated Netty channel for this pcc.
*
* @param channel the Netty channel
*/
public void setChannel(Channel channel);
/**
* Sets the keep alive time for this pcc.
*
* @param keepAliveTime the keep alive time to set.
*/
public void setPcKeepAliveTime(byte keepAliveTime);
/**
* Sets the dead time for this pcc.
*
* @param deadTime the dead timer value to set.
*/
public void setPcDeadTime(byte deadTime);
/**
* Sets the session id for this pcc.
*
* @param sessionId the session id value to set.
*/
public void setPcSessionId(byte sessionId);
/**
* Sets whether the pcc is connected.
*
* @param connected whether the pcc is connected
*/
public void setConnected(boolean connected);
/**
* Initializes the behavior.
*
* @param pccId id of pcc
* @param pcepVersion Pcep version
* @param pktStats Pcep Packet Stats
*/
void init(PccId pccId, PcepVersion pcepVersion, PcepPacketStats pktStats);
/**
* Checks whether the handshake is complete.
*
* @return true is finished, false if not.
*/
boolean isHandshakeComplete();
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcep.controller.driver;
import org.onlab.packet.IpAddress;
import org.onosproject.pcepio.protocol.PcepVersion;
/**
* Pcc Client factory which returns concrete pcc client objects for the
* physical pcc client in use.
*
*/
public interface PcepClientDriverFactory {
/**
* Constructs the real Pcep Client representation.
*
* @param pccIpAddress the ip address for this pcc client.
* @param pcepVersion the Pcep version in use
* @return the Pcep client representation.
*/
public PcepClientDriver getPcepClientImpl(IpAddress pccIpAddress,
PcepVersion pcepVersion);
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* PCEP controller driver API.
*/
package org.onosproject.pcep.controller.driver;
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* PCEP controller API.
*/
package org.onosproject.pcep.controller;
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2014 Open Networking Laboratory
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.onosproject</groupId>
<artifactId>onos-pcep-controller</artifactId>
<version>1.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>onos-pcepio</artifactId>
<packaging>bundle</packaging>
<description>ONOS Pcepio Protocol subsystem</description>
<dependencies>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onos-api</artifactId>
</dependency>
<dependency>
<groupId>org.onosproject</groupId>
<artifactId>onlab-osgi</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.karaf.shell</groupId>
<artifactId>org.apache.karaf.shell.console</artifactId>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.exceptions;
/**
* Custom Exception for PCEP IO.
*/
public class PcepParseException extends Exception {
private static final long serialVersionUID = 7960991379951448423L;
private byte errType = 0;
private byte errValue = 0;
/**
* Default constructor to create a new exception.
*/
public PcepParseException() {
super();
}
/**
* Constructor to create exception from message and cause.
*
* @param message the detail of exception in string
* @param cause underlying cause of the error
*/
public PcepParseException(final String message, final Throwable cause) {
super(message, cause);
}
/**
* Constructor to create exception from message.
*
* @param message the detail of exception in string
*/
public PcepParseException(final String message) {
super(message);
}
/**
* Constructor to create exception from error type and error value.
*
* @param errType error type of pcep
* @param errValue error value of pcep
*/
public PcepParseException(final byte errType, final byte errValue) {
super();
this.errType = errType;
this.errValue = errValue;
}
/**
* Constructor to create exception from cause.
*
* @param cause underlying cause of the error
*/
public PcepParseException(final Throwable cause) {
super(cause);
}
/**
* Returns error type for this exception.
*
* @return ErrorType
*/
public byte getErrorType() {
return this.errType;
}
/**
* Returns error value for this exception.
*
* @return ErrorValue
*/
public byte getErrorValue() {
return this.errValue;
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.exceptions;
/**
* Custom exception for Tunnel Attributes.
*/
public class PcepTunnelAttributeException extends Exception {
private static final long serialVersionUID = 7860981378961458434L;
/**
* Default constructor to create a new exception.
*/
public PcepTunnelAttributeException() {
super();
}
/**
* Constructor to create exception from message and cause.
*
* @param message the detail of exception in string
* @param cause underlying cause of the error
*/
public PcepTunnelAttributeException(final String message, final Throwable cause) {
super(message, cause);
}
/**
* Constructor to create exception from message.
*
* @param message the detail of exception in string
*/
public PcepTunnelAttributeException(final String message) {
super(message);
}
/**
* Constructor to create exception from cause.
*
* @param cause underlying cause of the error
*/
public PcepTunnelAttributeException(final Throwable cause) {
super(cause);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity Provides PcInitiatedLspRequest for PCEP Initiate message.
* Reference : PCE initiated tunnel setup draft-ietf-pce-pce-initiated-lsp-03.
*/
public interface PcInitiatedLspRequest {
/**
* Returns object of PcepSrpObject.
*
* @return srpObject PCEP SRP object
*/
PcepSrpObject getSrpObject();
/**
* Returns object of PcepLspObject.
*
* @return lspObject PCEP LSP object
*/
PcepLspObject getLspObject();
/**
* Returns object of PcepEndPointsObject.
*
* @return endPointsObject PCEP EndPoints object
*/
PcepEndPointsObject getEndPointsObject();
/**
* Returns object of PcepEroObject.
*
* @return eroObject PCEP ERO object
*/
PcepEroObject getEroObject();
/**
* Returns object of PcepAttribute.
*
* @return pcepAttribute PCEP Attributes
*/
PcepAttribute getPcepAttribute();
/**
* Sets PcepSrpObject.
*
* @param srpobj PCEP SRP object
*/
void setSrpObject(PcepSrpObject srpobj);
/**
* Sets PcepLspObject.
*
* @param lspObject PCEP LSP object
*/
void setLspObject(PcepLspObject lspObject);
/**
* Sets PcepEndPointsObject.
*
* @param endPointsObject PCEP EndPoints object
*/
void setEndPointsObject(PcepEndPointsObject endPointsObject);
/**
* Sets PcepEroObject.
*
* @param eroObject PCEP ERO object
*/
void setEroObject(PcepEroObject eroObject);
/**
* Sets PcepAttribute.
*
* @param pcepAttribute PCEP Attributes
*/
void setPcepAttribute(PcepAttribute pcepAttribute);
/**
* Prints the attribute of PC-INITIATED LSP INITIATION REQUEST.
*/
void print();
/**
* Builder interface with get and set functions to build PcInitiatedLspRequest.
*/
public interface Builder {
/**
* Builds PcInitiatedLspRequest.
*
* @return PcInitiatedLspRequest
* @throws PcepParseException when mandatory object is not set
*/
PcInitiatedLspRequest build() throws PcepParseException;
/**
* Returns object of PcepSrpObject.
*
* @return srpObject
*/
PcepSrpObject getSrpObject();
/**
* Returns object of PcepLspObject.
*
* @return lspObject
*/
PcepLspObject getLspObject();
/**
* Returns object of PcepEndPointsObject.
*
* @return endPointsObject
*/
PcepEndPointsObject getEndPointsObject();
/**
* Returns object of PcepEroObject.
*
* @return eroObject
*/
PcepEroObject getEroObject();
/**
* Returns object of PcepAttribute.
*
* @return pcepAttribute
*/
PcepAttribute getPcepAttribute();
/**
* Sets PcepSrpObject.
*
* @param srpobj PCEP SRP Object
* @return builder by setting PcepSrpObject
*/
Builder setSrpObject(PcepSrpObject srpobj);
/**
* Sets PcepLspObject.
*
* @param lspObject PCEP LSP Object
* @return builder by setting PcepLspObject
*/
Builder setLspObject(PcepLspObject lspObject);
/**
* Sets PcepEndPointsObject.
*
* @param endPointsObject EndPoints Object
* @return builder by setting PcepEndPointsObject
*/
Builder setEndPointsObject(PcepEndPointsObject endPointsObject);
/**
* Sets PcepEroObject.
*
* @param eroObject PCEP ERO Object
* @return builder by setting PcepEroObject
*/
Builder setEroObject(PcepEroObject eroObject);
/**
* Sets PcepAttribute.
*
* @param pcepAttribute PCEP Attributes
* @return builder by setting PcepAttribute
*/
Builder setPcepAttribute(PcepAttribute pcepAttribute);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
/**
* Abstraction of an entity which Provides List of PCEP Attributes.
*/
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
public interface PcepAttribute {
/**
* writes lspa , bandwidth , Metriclist and Iro objects to the channel.
*
* @param bb of type channel buffer.
* @return object length index.
* @throws PcepParseException while writing objects to channel buffer
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Returns PcepLspaObject.
*
* @return LspaObject
*/
PcepLspaObject getLspaObject();
/**
* Returns PcepBandwidthObject.
*
* @return BandwidthObject
*/
PcepBandwidthObject getBandwidthObject();
/**
* Returns PcepIroObject.
*
* @return iroObject
*/
PcepIroObject getIroObject();
/**
* Sets the PcepBandwidthObject.
*
* @param bandwidthObject bandwidth object
*/
void setBandwidthObject(PcepBandwidthObject bandwidthObject);
/**
* Sets the PcepLspaObject.
*
* @param lspaObject lspa object
*/
void setLspaObject(PcepLspaObject lspaObject);
/**
* Sets the PcepIroObject.
*
* @param iroObject iro object
*/
void setIroObject(PcepIroObject iroObject);
/**
* Returns PcepMetricObject List.
*
* @return list of metric objects
*/
LinkedList<PcepMetricObject> getMetricObjectList();
/**
* Sets PcepMetricObject List.
*
* @param llMetricList list of metric objects
*/
void setMetricObjectList(LinkedList<PcepMetricObject> llMetricList);
/**
* Prints the attributes of AttributeList.
*/
public void print();
/**
* Builder interface with get and set functions to build PcepAttribute.
*/
public interface Builder {
/**
* Builds PcepAttribute.
*
* @return PcepAttribute
*/
PcepAttribute build();
/**
* Returns PcepLspaObject.
*
* @return LspaObject
*/
PcepLspaObject getLspaObject();
/**
* Returns PcepBandwidthObject.
*
* @return BandwidthObject
*/
PcepBandwidthObject getBandwidthObject();
/**
* Returns PcepIroObject.
*
* @return iroObject
*/
PcepIroObject getIroObject();
/**
* Sets the PcepBandwidthObject.
*
* @param bandwidthObject bandwidth object
* @return Builder object for PcepAttrubute
*/
Builder setBandwidthObject(PcepBandwidthObject bandwidthObject);
/**
* Sets the PcepLspaObject.
*
* @param lspaObject lspa object
* @return Builder object for PcepAttrubute
*/
Builder setLspaObject(PcepLspaObject lspaObject);
/**
* Sets the PcepIroObject.
*
* @param iroObject iro object
* @return Builder object for PcepAttrubute
*/
Builder setIroObject(PcepIroObject iroObject);
/**
* Returns PcepMetricObject List.
*
* @return list of metric objects
*/
LinkedList<PcepMetricObject> getMetricObjectList();
/**
* Sets PcepMetricObject List.
*
* @param llMetricList list of metric objects
* @return Builder object for PcepAttrubute
*/
Builder setMetricObjectList(LinkedList<PcepMetricObject> llMetricList);
}
}
\ No newline at end of file
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing PCEP Bandwidth Object.
*/
public interface PcepBandwidthObject {
/**
* Returns bandwidth value.
*
* @return bandwidth value
*/
int getBandwidth();
/**
* Sets bandwidth with specified value.
*
* @param iBandwidth Bandwidth's value
*/
void setBandwidth(int iBandwidth);
/**
* Prints attributes of bandwidth object.
*/
void print();
/**
* Writes the BandwidthObject into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException if bandwidth object header fails to write in channel buffer
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build bandwidth object.
*/
public interface Builder {
/**
* Builds BandwidthObject.
*
* @return BandwidthObject
* @throws PcepParseException if build fails while creating PcepBandwidthObject
*/
PcepBandwidthObject build() throws PcepParseException;
/**
* Returns bandwidth object header.
*
* @return bandwidth object header
*/
PcepObjectHeader getBandwidthObjHeader();
/**
* Sets bandwidth object header and returns its builder.
*
* @param obj Bandwidth object header
* @return Builder by setting Bandwidth object header
*/
Builder setBandwidthObjHeader(PcepObjectHeader obj);
/**
* Returns bandwidth value.
*
* @return bandwidth
*/
int getBandwidth();
/**
* Sets bandwidth value and return its builder.
*
* @param iBandwidth bandwidth value
* @return Builder by setting bandwidth
*/
Builder setBandwidth(int iBandwidth);
/**
* Sets P flag in Bandwidth object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in Bandwidth object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP Close Message.
*/
public interface PcepCloseMsg extends PcepObject, PcepMessage {
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns reason field in Close message.
*
* @return reason field
*/
byte getReason();
/**
* Sets reason field in Close message with specified value.
*
* @param value of Reason field
*/
void setReason(byte value);
/**
* Returns LinkedList of Optional Tlv in Close Message.
*
* @return list of optional tlv
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets LinkedList of Optional Tlvs in Close Message.
*
* @param llOptionalTlv LinkedList of type PcepValueType
*/
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
@Override
void writeTo(ChannelBuffer channelBuffer);
/**
* Builder interface with get and set functions to build Close message.
*/
public interface Builder extends PcepMessage.Builder {
@Override
PcepCloseMsg build();
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns Close Object header.
*
* @return Close Object header
*/
PcepObjectHeader getCloseObjHeader();
/**
* Sets close object header and returns its builder.
*
* @param obj close object header
* @return Builder by setting Close object header
*/
Builder setCloseObjHeader(PcepObjectHeader obj);
/**
* Returns reason field in Close message.
*
* @return reason field in Close message
*/
byte getReason();
/**
* Sets reason field and return its builder.
*
* @param value of Reason field
* @return builder by setting reason field
*/
Builder setReason(byte value);
/**
* Returns LinkedList of Optional Tlvs.
*
* @return list of optional tlv
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets LinkedList of Optional Tlvs in Close Message.
*
* @param llOptionalTlv list of optional tlv
* @return Builder by setting Optional Tlvs
*/
Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Sets P flag in Close object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in Close object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing PCEP End Points Object.
*/
public interface PcepEndPointsObject {
/**
* Returns Source IpAddress from End Points Object.
*
* @return Source IpAddress from End Points Object
*/
int getSourceIpAddress();
/**
* Sets Source IpAddress in End Points Object.
*
* @param sourceIpAddress Source IP Address
*/
void setSourceIpAddress(int sourceIpAddress);
/**
* Returns Destination IpAddress from End Points Object.
*
* @return Destination IpAddress from End Points Object
*/
int getDestIpAddress();
/**
* Sets Destination IpAddress in End Points Object.
*
* @param destIpAddress Destination IP Address
*/
void setDestIpAddress(int destIpAddress);
/**
* Prints attributes of EndPoints object.
*/
void print();
/**
* Writes the EndPointsObject into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing EndPointObject into ChannelBuffer
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build EndPoints object.
*/
public interface Builder {
/**
* Builds End Points Object.
*
* @return End Points Object
* @throws PcepParseException while building EndPointObject
*/
PcepEndPointsObject build() throws PcepParseException;
/**
* Returns End Points Object header.
*
* @return End Points Object header
*/
PcepObjectHeader getEndPointsObjHeader();
/**
* Sets End Points Object header and returns its builder.
*
* @param obj End Points Object header
* @return Builder by setting End Points Object header
*/
Builder setEndPointsObjHeader(PcepObjectHeader obj);
/**
* Returns Source IpAddress from End Points Object.
*
* @return Source IpAddress from End Points Object
*/
int getSourceIpAddress();
/**
* Sets Source IpAddress in End Points Object and returns builder.
*
* @param sourceIpAddress Source IP Address
* @return Builder by setting Source IpAddress in End Points Object
*/
Builder setSourceIpAddress(int sourceIpAddress);
/**
* Returns Destination IpAddress from End Points Object.
*
* @return Destination IpAddress from End Points Object
*/
int getDestIpAddress();
/**
* Sets Destination IpAddress in End Points Object.
*
* @param destIpAddress Destination IP Address
* @return Builder by setting Destination IpAddress in End Points Object
*/
Builder setDestIpAddress(int destIpAddress);
/**
* Sets P flag in Bandwidth object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in Bandwidth object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP ERO Object.
*/
public interface PcepEroObject {
/**
* Return LinkedList of SubObjects of ERO Object.
*
* @return list of subobjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets LinkedList of SubObjects in ERO Object.
*
* @param llSubObjects list of subobjects
*/
void setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Writes the ERO Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing ERO Object into ChannelBuffer
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints attributes of ERO object.
*/
void print();
/**
* Builder interface with get and set functions to build ERO object.
*/
public interface Builder {
/**
* Builds ERO Object.
*
* @return ERO Object
*/
PcepEroObject build();
/**
* Returns ERO Object Header.
*
* @return ERO Object Header
*/
PcepObjectHeader getEroObjHeader();
/**
* Sets ERO Object header and returns its builder.
*
* @param obj ERO Object header
* @return Builder by setting ERO Object header
*/
Builder setEroObjHeader(PcepObjectHeader obj);
/**
* Returns LinkedList of SubObjects in ERO Objects.
*
* @return list of subobjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets LinkedList of SubObjects and returns its builder.
*
* @param llSubObjects list of SubObjects
* @return Builder by setting list of SubObjects
*/
Builder setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Sets P flag in ERO object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in ERO object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
\ No newline at end of file
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity which provides PCEP error for PCEP error message.
*/
public interface PcepError {
/**
* Returns the PcepRPObject List.
*
* @return list of type PcepRPObject
*/
LinkedList<PcepRPObject> getRPObjList();
/**
* Sets the RP Objects lists.
*
* @param llRPObjList list of type PcepRPObject
*/
void setRPObjList(LinkedList<PcepRPObject> llRPObjList);
/**
* Returns the PcepTEObject List.
*
* @return list of type PcepTEObject
*/
LinkedList<PcepTEObject> getTEObjList();
/**
* Sets the TE Objects lists.
*
* @param llTEObjList list of type PcepTEObject
*/
void setTEObjList(LinkedList<PcepTEObject> llTEObjList);
/**
* Returns the PcepErrorObject.
*
* @return list of type PcepErrorObject
*/
LinkedList<PcepErrorObject> getErrorObjList();
/**
* Sets the Error Objects lists.
*
* @param llErrorObjList list of type PcepErrorObject
*/
public void setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
/**
* Writes the byte stream of PCEP error to the channel buffer.
*
* @param bb of type channel buffer
* @return object length index
* @throws PcepParseException while writing Error part into ChannelBuffer
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of PCEP Error.
*/
public void print();
/**
* Builder interface with get and set functions to build PcepError.
*/
public interface Builder {
/**
* Builds PcepError Object.
*
* @return PcepError Object
*/
PcepError build();
/**
* Returns the PcepRPObject.
*
* @return list of type PcepRPObject
*/
LinkedList<PcepRPObject> getRPObjList();
/**
* Sets RP Object lists and returns its builder.
*
* @param llRPObjList list of type PcepRpObject
* @return builder by setting Linked list of RP Object
*/
Builder setRPObjList(LinkedList<PcepRPObject> llRPObjList);
/**
* Returns the PcepTEObject.
*
* @return llTEObjList of type PcepTEObject
*/
LinkedList<PcepTEObject> getTEObjList();
/**
* Sets TE Object lists and returns its builder.
*
* @param llTEObjList list of type PcepTEObject
* @return builder by setting list of type PcepTEObject
*/
Builder setTEObjList(LinkedList<PcepTEObject> llTEObjList);
/**
* Returns the PcepErrorObject.
*
* @return list of type PcepErrorObject
*/
LinkedList<PcepErrorObject> getErrorObjList();
/**
* Sets Error Object lists and returns its builder.
*
* @param llErrorObjList list of type PcepErrorObject
* @return builder by setting list of type PcepErrorObject
*/
Builder setErrorObjList(LinkedList<PcepErrorObject> llErrorObjList);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity which provides PCEP Error Info.
* Reference :PCEP Extension for Transporting TE Data draft-dhodylee-pce-pcep-te-data-extn-02.
*/
public interface PcepErrorInfo {
/**
* Returns whether error info list is present or not.
*
* @return true if error info present, false otherwise
*/
public boolean isErrorInfoPresent();
/**
* Reads from channel buffer for TE and RP objects.
*
* @param bb of channel buffer
* @throws PcepParseException while parsing Error info part.
*/
public void read(ChannelBuffer bb) throws PcepParseException;
/**
* Writes byte stream of PCEP error info to channel buffer.
*
* @param bb of type channel buffer
* @throws PcepParseException while writing Error info part into Channel Buffer.
*/
public void write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of error info list.
*/
public void print();
/**
* Returns Error Value in PCEP-ERROR Object.
*
* @return list of Error Value in PCEP-ERROR Object
*/
public LinkedList<Integer> getErrorValue();
/**
* Returns Error Type in PCEP-ERROR Object.
*
* @return list of Error Type in PCEP-ERROR Object
*/
public LinkedList<Integer> getErrorType();
/**
* Builder interface with get and set functions to build ErrorInfo.
*/
public interface Builder {
/**
* Builds ErrorInfo Object.
*
* @return ErrorInfo Object.
*/
PcepErrorInfo build();
/**
* Returns list of PcepError.
*
* @return list of PcepError
*/
LinkedList<PcepError> getPcepErrorList();
/**
* Sets PcepError lists and returns its builder.
*
* @param llPcepErrorList list of PcepError
* @return builder by setting list of PcepError.
*/
Builder setPcepErrorList(LinkedList<PcepError> llPcepErrorList);
}
}
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.types.ErrorObjListWithOpen;
/**
* Abstraction of an entity providing PCEP Error Message.
*/
public interface PcepErrorMsg extends PcepMessage {
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns Object of ErrorObjListWithOpen.
*
* @return Object of ErrorObjListWithOpen
*/
public ErrorObjListWithOpen getErrorObjListWithOpen();
/**
* Sets errObjListWithOpen object.
*
* @param errObjListWithOpen error object List with open object
*/
public void setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen);
/**
* Returns Object of PcepErrorInfo.
*
* @return Object of PcepErrorInfo
*/
public PcepErrorInfo getPcepErrorInfo();
/**
* Sets errInfo Object.
*
* @param errInfo error information
*/
public void setPcepErrorInfo(PcepErrorInfo errInfo);
@Override
void writeTo(ChannelBuffer channelBuffer);
/**
* Builder interface with get and set functions to build PCEP Error message.
*/
public interface Builder extends PcepMessage.Builder {
@Override
PcepErrorMsg build();
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns Object of ErrorObjListWithOpen.
*
* @return Object of ErrorObjListWithOpen
*/
public ErrorObjListWithOpen getErrorObjListWithOpen();
/**
* Sets errObjListWithOpen object.
*
* @param errObjListWithOpen error object with open object
* @return builder by setting Object of ErrorObjListWithOpen
*/
public Builder setErrorObjListWithOpen(ErrorObjListWithOpen errObjListWithOpen);
/**
* Returns Object of PcepErrorInfo.
*
* @return Object of PcepErrorInfo
*/
public PcepErrorInfo getPcepErrorInfo();
/**
* Sets errInfo Object.
*
* @param errInfo error information
* @return builder by getting Object of PcepErrorInfo
*/
public Builder setPcepErrorInfo(PcepErrorInfo errInfo);
}
}
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP Error Object.
*/
public interface PcepErrorObject {
/**
* Returns Error Type in Error Object.
*
* @return Error Type in Error Object
*/
int getErrorType();
/**
* Sets Error Type in Error Object.
*
* @param value Error Type
*/
void setErrorType(byte value);
/**
* Returns Error Value in Error Object.
*
* @return Error Value
*/
byte getErrorValue();
/**
* Sets Error Value in Error Object.
*
* @param value Error Value
*/
void setErrorValue(byte value);
/**
* Returns Optional Tlvs in Error Object.
*
* @return list of Optional Tlvs in Error Object
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets Optional Tlvs in Error Object.
*
* @param llOptionalTlv list of Optional Tlvs
*/
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of Error object.
*/
void print();
/**
* Writes the Error Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing Error Object into ChannelBuffer
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build Error object.
*/
public interface Builder {
/**
* Builds Error Object.
*
* @return Error Object.
*/
PcepErrorObject build();
/**
* Returns Error Object header.
*
* @return Error Object header
*/
PcepObjectHeader getErrorObjHeader();
/**
* Sets Error Object header and returns its Builder.
*
* @param obj Error Object header
* @return Builder by setting Error Object header
*/
Builder setErrorObjHeader(PcepObjectHeader obj);
/**
* Returns Error Type in Error Object.
*
* @return Error Type in Error Object
*/
int getErrorType();
/**
* Sets Error Type and returns its builder.
*
* @param value of Error-Type field
* @return builder by setting Error Type field.
*/
Builder setErrorType(byte value);
/**
* Returns Error Value in Error Object.
*
* @return Error Value
*/
byte getErrorValue();
/**
* Sets Error Value and returns its builder.
*
* @param value of Error-Value field
* @return Builder by setting Error Value field.
*/
Builder setErrorValue(byte value);
/**
* Returns list of Optional Tlvs of Error Object.
*
* @return list of Optional Tlvs of Error Object
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets Optional Tlvs of Error Object and returns its Builder.
*
* @param llOptionalTlv Optional Tlvs of Error Object
* @return Builder by setting Optional Tlvs.
*/
Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Sets P flag in Error object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in Error object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class PcepFactories {
protected static final Logger log = LoggerFactory.getLogger(PcepFactories.class);
private static final GenericReader GENERIC_READER = new GenericReader();
public static final byte SHIFT_FLAG = 5;
private PcepFactories() {
}
/*
* Returns the instance of PCEP Version.
*
* @param version
* @return PCEP version
*/
public static PcepFactory getFactory(PcepVersion version) {
switch (version) {
case PCEP_1:
// TODO : to get the pcep version 1 factory
default:
throw new IllegalArgumentException("[PcepFactory:]Unknown version: " + version);
}
}
private static class GenericReader implements PcepMessageReader<PcepMessage> {
@Override
public PcepMessage readFrom(ChannelBuffer bb) throws PcepParseException {
if (!bb.readable()) {
log.debug("Empty message received");
throw new PcepParseException("Empty message received");
}
/*
* 0 1 2 3
* 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
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Ver | Flags | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* Currently Version 1 is supported
* Currently no flags are used, it is all ignored
*/
byte packetVersion = bb.getByte(bb.readerIndex());
packetVersion = (byte) (packetVersion >> SHIFT_FLAG);
PcepFactory factory;
switch (packetVersion) {
case 1:
// TODO : get the factory for version 1
break;
default:
throw new IllegalArgumentException("Unknown Packet version: " + packetVersion);
}
// TODO : Read the PCEP message from the factory
return null;
}
}
/*
* Returns GENERIC_READER.
*
* @return GENERIC_READER
*/
public static PcepMessageReader<PcepMessage> getGenericReader() {
return GENERIC_READER;
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
/**
* Abstraction of an Message factory providing Builder functions to PCEP Messages and Objects.
*
*/
public interface PcepFactory {
/**
* To get Builder Object for Open Message.
*
* @return Builder Object for Open Message
*/
PcepOpenMsg.Builder buildOpenMsg();
/**
* To get Builder Object for Open Object.
*
* @return Builder Object for Open Object
*/
PcepOpenObject.Builder buildOpenObject();
/**
* To get Builder Object for Keepalive Message.
*
* @return Builder Object for Keepalive Message
*/
PcepKeepaliveMsg.Builder buildKeepaliveMsg();
/**
* To get Builder Object for Close Message.
*
* @return Builder Object for Close Message
*/
PcepCloseMsg.Builder buildCloseMsg();
/**
* To get Builder Object for Report Message.
*
* @return Builder Object for Report Message
*/
PcepReportMsg.Builder buildReportMsg();
/**
* To get Builder Object for Update Message.
*
* @return Builder Object for Update Message
*/
PcepUpdateMsg.Builder buildUpdateMsg();
/**
* To get Builder Object for Initiate Message.
*
* @return Builder Object for Initiate Message
*/
PcepInitiateMsg.Builder buildPcepInitiateMsg();
/**
* To get Builder Object for LSP Object.
*
* @return Builder Object for LSP Object
*/
PcepLspObject.Builder buildLspObject();
/**
* To get Builder Object for SRP Object.
*
* @return Builder Object for SRP Object
*/
PcepSrpObject.Builder buildSrpObject();
/**
* To get Builder Object for EndPoints Object.
*
* @return Builder Object for EndPoints Object
*/
PcepEndPointsObject.Builder buildEndPointsObject();
/**
* To get Builder Object for ERO Object.
*
* @return Builder Object for ERO Object
*/
PcepEroObject.Builder buildEroObject();
/**
* To get Builder Object for RRO Object.
*
* @return Builder Object for RRO Object
*/
PcepRroObject.Builder buildRroObject();
/**
* To get Builder Object for LSPA Object.
*
* @return Builder Object for LSPA Object
*/
PcepLspaObject.Builder buildLspaObject();
/**
* To get Builder Object for IRO Object.
*
* @return Builder Object for IRO Object
*/
PcepIroObject.Builder buildIroObject();
/**
* To get Builder Object for METRIC Object.
*
* @return Builder Object for METRIC Object
*/
PcepMetricObject.Builder buildMetricObject();
/**
* To get Builder Object for Bandwidth Object.
*
* @return Builder Object for Bandwidth Object
*/
PcepBandwidthObject.Builder buildBandwidthObject();
/**
* Returns PCEP Message Reader.
*
* @return PCEP Message Reader
*/
PcepMessageReader<PcepMessage> getReader();
/**
* Returns PCEP version.
*
* @return PCEP version
*/
PcepVersion getVersion();
/**
* Returns PcepStateReport.
*
* @return PcepStateReport
*/
PcepStateReport.Builder buildPcepStateReport();
/**
* Returns PcepUpdateRequest.
*
* @return PcepUpdateRequest
*/
PcepUpdateRequest.Builder buildPcepUpdateRequest();
/**
* Returns PcInitiatedLspRequest.
*
* @return PcInitiatedLspRequest
*/
PcInitiatedLspRequest.Builder buildPcInitiatedLspRequest();
/**
* Returns PcepMsgPath.
*
* @return PcepMsgPath
*/
PcepMsgPath.Builder buildPcepMsgPath();
/**
* Return PcepAttribute list.
*
* @return PcepAttribute
*/
PcepAttribute.Builder buildPcepAttribute();
/**
* To get Builder Object for LabelUpdate message.
*
* @return Builder Object for LabelUpdate message
*/
PcepLabelUpdateMsg.Builder buildPcepLabelUpdateMsg();
/**
* To get Builder Object for PcepLabelUpdate Object.
*
* @return Builder Object for PcepLabelUpdate Object
*/
PcepLabelUpdate.Builder buildPcepLabelUpdateObject();
/**
* To get Builder Object for PcepLabel Object.
*
* @return Builder Object for PcepLabel Object
*/
PcepLabelObject.Builder buildLabelObject();
/**
* To get Builder Object for Error Message.
*
* @return Builder Object for Error Message
*/
PcepErrorMsg.Builder buildPcepErrorMsg();
/**
* To get Builder Object for Error Object.
*
* @return Builder Object for Error Object
*/
PcepErrorObject.Builder buildPcepErrorObject();
/**
* To get Builder Object for FecIpv4Adjacency.
*
* @return Builder Object for FecIpv4Adjacency
*/
PcepFecObjectIPv4Adjacency.Builder buildFecIpv4Adjacency();
/**
* To get Builder Object for ErrorInfo.
*
* @return Builder Object for ErrorInfo
*/
PcepErrorInfo.Builder buildPcepErrorInfo();
/**
* To get Builder Object for PcepError.
*
* @return Builder Object for PcepError
*/
PcepError.Builder buildPcepError();
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP FEC Object.
*/
public interface PcepFecObject {
/**
* Returns PCEP Version of FEC Object.
*
* @return PCEP Version of FEC Object
*/
PcepVersion getVersion();
/**
* Returns FEC Object type.
*
* @return FEC Object type
*/
int getType();
/**
* Writes the FEC into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing FEC Object into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints attributes of FEC object.
*/
void print();
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing PCEP FEC Object of Type 1 IPv4 Node ID.
*/
public interface PcepFecObjectIPv4 extends PcepFecObject {
/**
* Returns NodeID of FEC Object.
*
* @return NodeID of FEC Object
*/
int getNodeID();
/**
* Sets NodeID with specified value.
*
* @param value node id
*/
void setNodeID(int value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build FEC object.
*/
public interface Builder {
/**
* Builds FEC Object IPv4.
*
* @return FEC Object IPv4
* @throws PcepParseException while creating FEC IPv4 Object.
*/
PcepFecObjectIPv4 build() throws PcepParseException;
/**
* Returns FEC Object IPv4 header.
*
* @return FEC Object IPv4 header
*/
PcepObjectHeader getFecIpv4ObjHeader();
/**
* Sets FEC Object IPv4 header and returns its builder.
*
* @param obj FEC Object IPv4 header
* @return Builder by setting FEC Object IPv4 header
*/
Builder setFecIpv4ObjHeader(PcepObjectHeader obj);
/**
* Returns NodeID of FEC Object.
*
* @return NodeID of FEC Object
*/
int getNodeID();
/**
* Sets NodeID and returns its builder.
*
* @param value node id
* @return builder by setting NodeID
*/
Builder setNodeID(int value);
/**
* Sets P flag in FEC object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in FEC object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing FEC Object of Type 3 IPv4 Adjacency.
*/
public interface PcepFecObjectIPv4Adjacency extends PcepFecObject {
/**
* Returns Local IPv4Address of FEC Object.
*
* @return Local IPv4Address of FEC Object
*/
int getLocalIPv4Address();
/**
* Sets Local IPv4Address with specified value.
*
* @param value Local IPv4Address
*/
void seLocalIPv4Address(int value);
/**
* Returns Remote IPv4Address of FEC Object.
*
* @return Remote IPv4Address of FEC Object
*/
int getRemoteIPv4Address();
/**
* Sets Remote IPv4Address with specified value.
*
* @param value Remote IPv4Address
*/
void seRemoteIPv4Address(int value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build FEC object.
*/
public interface Builder {
/**
* Builds FEC Object IPv4 Adjacency.
*
* @return FEC Object IPv4 Adjacency
* @throws PcepParseException while building FEC IPv4 Adjacency object.
*/
PcepFecObjectIPv4Adjacency build() throws PcepParseException;
/**
* Returns FEC Object IPv4 Adjacency header.
*
* @return FEC Object IPv4 Adjacency header
*/
PcepObjectHeader getFecIpv4AdjacencyObjHeader();
/**
* Sets FEC Object IPv4 Adjacency header and returns its builder.
*
* @param obj FEC Object IPv4 Adjacency header
* @return Builder by setting FEC Object IPv4 header
*/
Builder setFecIpv4AdjacencyObjHeader(PcepObjectHeader obj);
/**
* Returns Local IPv4Address of FEC Object.
*
* @return Local IPv4Address of FEC Object
*/
int getLocalIPv4Address();
/**
* Sets Local IPv4Address and returns its builder.
*
* @param value Local IPv4Address
* @return Builder by setting Local IPv4Address
*/
Builder seLocalIPv4Address(int value);
/**
* Sets Remote IPv4Address with specified value.
*
* @return Remote IPv4 Address
*/
int getRemoteIPv4Address();
/**
* Sets Remote IPv4Address and returns its builder.
*
* @param value Remote IPv4Address
* @return Builder by setting Remote IPv4Address
*/
Builder seRemoteIPv4Address(int value);
/**
* Sets P flag in FEC object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in FEC object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing PCEP FEC Object of Type is 5 Unnumbered Adjacency with IPv4 NodeIDs.
*/
public interface PcepFecObjectIPv4UnnumberedAdjacency extends PcepFecObject {
/**
* Returns Local NodeID of FEC Object.
*
* @return Local NodeID of FEC Object
*/
int getLocalNodeID();
/**
* Sets Local NodeID with specified value.
*
* @param value Local NodeID
*/
void setLocalNodeID(int value);
/**
* Returns Local InterfaceID of FEC Object.
*
* @return Local InterfaceID of FEC Object
*/
int getLocalInterfaceID();
/**
* Sets Local InterfaceID with specified value.
*
* @param value Local InterfaceID
*/
void setLocalInterfaceID(int value);
/**
* Returns Remote NodeID of FEC Object.
*
* @return Remote NodeID of FEC Object
*/
int getRemoteNodeID();
/**
* Sets Remote NodeID with specified value.
*
* @param value Remote NodeID
*/
void setRemoteNodeID(int value);
/**
* Returns Remote InterfaceID of FEC Object.
*
* @return Remote InterfaceID of FEC Object
*/
int getRemoteInterfaceID();
/**
* Sets Remote InterfaceID with specified value.
*
* @param value Remote InterfaceID
*/
void setRemoteInterfaceID(int value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build bandwidth object.
*/
public interface Builder {
/**
* Builds FEC Unnumbered Adjacency with IPv4 Object.
*
* @return FEC Unnumbered Adjacency with IPv4 Object
* @throws PcepParseException when building FEC IPv4 Unnumbered Adjacency object.
*/
PcepFecObjectIPv4UnnumberedAdjacency build() throws PcepParseException;
/**
* Returns FEC Unnumbered Adjacency with IPv4 header.
*
* @return FEC Unnumbered Adjacency with IPv4 header
*/
PcepObjectHeader getFecIpv4UnnumberedAdjacencyObjHeader();
/**
* Sets FEC Unnumbered Adjacency with IPv4 header and returns its builder.
*
* @param obj FEC Unnumbered Adjacency with IPv4 header
* @return Builder by setting FEC Unnumbered Adjacency with IPv4 header
*/
Builder setFecIpv4UnnumberedAdjacencyObjHeader(PcepObjectHeader obj);
/**
* Returns Local NodeID of FEC Object.
*
* @return Local NodeID of FEC Object
*/
int getLocalNodeID();
/**
* Sets Local NodeID and returns its builder.
*
* @param value Local NodeID
* @return Builder by setting Local NodeID
*/
Builder setLocalNodeID(int value);
/**
* Returns Local InterfaceID of FEC Object.
*
* @return Local InterfaceID of FEC Object
*/
int getLocalInterfaceID();
/**
* Sets Local InterfaceID and returns its builder.
*
* @param value Local InterfaceID
* @return Builder by setting Local InterfaceID
*/
Builder setLocalInterfaceID(int value);
/**
* Returns Remote NodeID of FEC Object.
*
* @return Remote NodeID of FEC Object
*/
int getRemoteNodeID();
/**
* Sets Remote NodeID and returns its builder.
*
* @param value Remote NodeID
* @return Builder by setting Remote NodeID
*/
Builder setRemoteNodeID(int value);
/**
* Returns Remote InterfaceID of FEC Object.
*
* @return Remote InterfaceID of FEC Object
*/
int getRemoteInterfaceID();
/**
* Sets Remote InterfaceID and returns its builder.
*
* @param value Remote InterfaceID
* @return Builder by setting Remote InterfaceID
*/
Builder setRemoteInterfaceID(int value);
/**
* Sets P flag in FEC object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in FEC object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing FEC Object of Type is 2 IPv6 Node ID.
*/
public interface PcepFecObjectIPv6 extends PcepFecObject {
/**
* Returns NodeID of FEC Object.
*
* @return NodeID of FEC Object
*/
byte[] getNodeID();
/**
* Sets NodeID with specified value.
*
* @param value node id
*/
void setNodeID(byte[] value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build FEC object.
*/
public interface Builder {
/**
* Builds FEC Object IPv6.
*
* @return FEC Object IPv6
* @throws PcepParseException while building FEC IPv6 Object.
*/
PcepFecObjectIPv6 build() throws PcepParseException;
/**
* Returns FEC Object IPv6 header.
*
* @return FEC Object IPv6 header
*/
PcepObjectHeader getFecIpv6ObjHeader();
/**
* Sets FEC Object IPv6 header and returns its builder.
*
* @param obj FEC Object IPv6 header
* @return Builder by setting FEC Object IPv6 header
*/
Builder setFecIpv6ObjHeader(PcepObjectHeader obj);
/**
* Returns NodeID of FEC Object.
*
* @return NodeID of FEC Object
*/
byte[] getNodeID();
/**
* Sets NodeID and returns its builder.
*
* @param value node id
* @return Builder by setting NodeID
*/
Builder setNodeID(byte[] value);
/**
* Sets P flag in FEC object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in FEC object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing FEC Object of Type is 4 IPv6 Adjacency.
*/
public interface PcepFecObjectIPv6Adjacency extends PcepFecObject {
/**
* Returns Local IPv6Address of FEC Object.
*
* @return Local IPv6Address of FEC Object
*/
byte[] getLocalIPv6Address();
/**
* Sets Local IPv6Address with specified value.
*
* @param value Local IPv6Address
*/
void seLocalIPv6Address(byte[] value);
/**
* Returns Remote IPv6Address of FEC Object.
*
* @return Remote IPv6Address of FEC Object
*/
byte[] getRemoteIPv6Address();
/**
* Sets Remote IPv6Address with specified value.
*
* @param value Remote IPv6Address
*/
void seRemoteIPv6Address(byte[] value);
@Override
void print();
@Override
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build FEC object.
*/
public interface Builder {
/**
* Builds FEC Object IPv6 Adjacency.
*
* @return FEC Object IPv6 Adjacency
* @throws PcepParseException while building FEC IPv6 Adjacency object.
*/
PcepFecObjectIPv6Adjacency build() throws PcepParseException;
/**
* Returns FEC Object IPv6 Adjacency header.
*
* @return FEC Object IPv6 Adjacency header
*/
PcepObjectHeader getFecIpv6AdjacencyObjHeader();
/**
* Sets FEC Object IPv6 Adjacency header and returns its builder.
*
* @param obj FEC Object IPv6 Adjacency header
* @return Builder by setting FEC Object IPv6 Adjacency header
*/
Builder setFecIpv6AdjacencyObjHeader(PcepObjectHeader obj);
/**
* Returns Local IPv6Address of FEC Object.
*
* @return Local IPv6Address of FEC Object
*/
byte[] getLocalIPv6Address();
/**
* Sets Local IPv6Address and returns its builder.
*
* @param value Local IPv6Address
* @return Builder by setting Local IPv6Address
*/
Builder setLocalIPv6Address(byte[] value);
/**
* Returns Remote IPv6Address of FEC Object.
*
* @return Remote IPv6Address of FEC Object
*/
byte[] getRemoteIPv6Address();
/**
* Sets Remote IPv6Address and returns its builder.
*
* @param value Remote IPv6Address
* @return Builder by setting Remote IPv6Address
*/
Builder setRemoteIPv6Address(byte[] value);
/**
* Sets P flag in FEC object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in FEC object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP Initiate Message.
*/
public interface PcepInitiateMsg extends PcepObject, PcepMessage {
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns list of PcInitiatedLspRequestList.
*
* @return list of PcInitiatedLspRequestList
*/
LinkedList<PcInitiatedLspRequest> getPcInitiatedLspRequestList();
/**
* Sets list of PcInitiatedLspRequestList.
*
* @param llPcInitiatedLspRequestList list of PcInitiatedLspRequestList
*/
void setPcInitiatedLspRequestList(LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList);
@Override
void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
/**
* Builder interface with get and set functions to build Initiate message.
*/
public interface Builder extends PcepMessage.Builder {
@Override
PcepInitiateMsg build();
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns list of PcInitiatedLspRequestList.
*
* @return list of PcInitiatedLspRequestList
*/
LinkedList<PcInitiatedLspRequest> getPcInitiatedLspRequestList();
/**
* Sets PcInitiatedLspRequestList.
*
* @param llPcInitiatedLspRequestList list of PcInitiatedLspRequestList
* @return builder by setting list of PcInitiatedLspRequestList
*/
Builder setPcInitiatedLspRequestList(LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList);
}
}
\ No newline at end of file
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing PCEP INTER Layer Object.
*/
public interface PcepInterLayerObject {
/**
* Returns N Flag in INTER Layer Object.
*
* @return N Flag in INTER Layer Object
*/
boolean getbNFlag();
/**
* Sets N Flag in INTER Layer Object with specified value.
*
* @param value N Flag
*/
void setbNFlag(boolean value);
/**
* Returns I Flag in INTER Layer Object.
*
* @return I Flag in INTER Layer Object
*/
boolean getbIFlag();
/**
* Sets I Flag in INTER Layer Object with specified value.
*
* @param value I Flag
*/
void setbIFlag(boolean value);
/**
* Prints attributes of INTER Layer object.
*/
void print();
/**
* Writes the INTER Layer Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing Inter Layer Object.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build INTER Layer object.
*/
public interface Builder {
/**
* Builds INTER Layer object.
*
* @return INTER Layer object
*/
PcepInterLayerObject build();
/**
* Returns INTER Layer object header.
*
* @return INTER Layer object header
*/
PcepObjectHeader getInterLayerObjHeader();
/**
* Sets INTER Layer object header and returns its builder.
*
* @param obj INTER Layer object header
* @return Builder by setting INTER Layer object header
*/
Builder setInterLayerObjHeader(PcepObjectHeader obj);
/**
* Returns N Flag in INTER Layer Object.
*
* @return N Flag in INTER Layer Object
*/
boolean getbNFlag();
/**
* Sets N flag and return its builder.
*
* @param value N flag
* @return Builder by setting N flag
*/
Builder setbNFlag(boolean value);
/**
* Returns I Flag in INTER Layer Object.
*
* @return I Flag in INTER Layer Object
*/
boolean getbIFlag();
/**
* Sets I flag and return its builder.
*
* @param value I flag
* @return Builder by setting N flag
*/
Builder setbIFlag(boolean value);
/**
* Sets P flag in INTER Layer object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in INTER Layer object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP IRO Object.
*/
public interface PcepIroObject {
/**
* Returns list of SubObjects.
*
* @return list of SubObjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets list of SubObjects.
*
* @param llSubObjects list of SubObjects
*/
void setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Prints attributes of IRO object.
*/
void print();
/**
* Writes the IRO into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing IRO object.
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build IRO object.
*/
public interface Builder {
/**
* Builds IRO Object.
*
* @return IRO Object
*/
PcepIroObject build();
/**
* Returns IRO object header.
*
* @return IRO object header
*/
PcepObjectHeader getIroObjHeader();
/**
* Sets IRO object header and returns its builder.
*
* @param obj IRO object header
* @return Builder by setting IRO object header
*/
Builder setIroObjHeader(PcepObjectHeader obj);
/**
* Returns list of SubObjects.
*
* @return list of SubObjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets list of SubObjects in IRO Object and returns its builder.
*
* @param llSubObjects list of SubObjects
* @return Builder by setting list of SubObjects
*/
Builder setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Sets P flag in IRO object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in IRO object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
/**
* Abstraction of an entity providing PCEP Keepalive Message.
*/
public interface PcepKeepaliveMsg extends PcepObject, PcepMessage {
@Override
PcepVersion getVersion();
@Override
PcepType getType();
@Override
void writeTo(ChannelBuffer channelBuffer);
/**
* Builder interface with get and set functions to build Keepalive message.
*/
public interface Builder extends PcepMessage.Builder {
@Override
PcepKeepaliveMsg build();
@Override
PcepVersion getVersion();
@Override
PcepType getType();
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP Label Object.
*/
public interface PcepLabelObject {
/**
* Returns O flag in Label Object.
*
* @return Boolean value
*/
boolean getOFlag();
/**
* Sets O flag in Label Object with specified value.
*
* @param value O flag
*/
void setOFlag(boolean value);
/**
* Returns Label from Label Object.
*
* @return Label value
*/
int getLabel();
/**
* Sets Label field in Label Object with specified value.
*
* @param value Label
*/
void setLabel(int value);
/**
* Returns list of Optional Tlvs.
*
* @return list of Optional Tlvs
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets Optional Tlvs in Label Object.
*
* @param llOptionalTlv list of Optional Tlvs
*/
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of Label object.
*/
void print();
/**
* Writes the Label Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing LABEL object into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build Label object.
*/
public interface Builder {
/**
* Builds Label Object.
*
* @return Label Object
* @throws PcepParseException while building LABEL object.
*/
PcepLabelObject build() throws PcepParseException;
/**
* Returns Label object header.
*
* @return Label object header
*/
PcepObjectHeader getLabelObjHeader();
/**
* Sets Label object header and returns its builder.
*
* @param obj Label object header
* @return Builder by setting Label object header
*/
Builder setLabelObjHeader(PcepObjectHeader obj);
/**
* Returns O flag in Label Object.
*
* @return Label value
*/
boolean getOFlag();
/**
* Sets O flag and return its builder.
*
* @param value O flag
* @return Builder by setting O flag
*/
Builder setOFlag(boolean value);
/**
* Returns Label from Label Object.
*
* @return Label value
*/
int getLabel();
/**
* Sets Label field and return its builder.
*
* @param value Label field
* @return Builder by setting Label field
*/
Builder setLabel(int value);
/**
* Returns list of Optional Tlvs.
*
* @return list of Optional Tlvs
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets list of Optional Tlvs and return its builder.
*
* @param llOptionalTlv list of Optional Tlvs
* @return Builder by setting list of Optional Tlvs
*/
Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Sets P flag in Label object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
public Builder setPFlag(boolean value);
/**
* Sets I flag in Label object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
public Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP Label Range.
*/
public interface PcepLabelRange {
/**
* Returns object of PCEP SRP Object.
*
* @return srpObject
*/
public PcepSrpObject getSrpObject();
/**
* Sets PCEP SRP Object.
*
* @param srpObject SRP object.
*/
public void setSrpObject(PcepSrpObject srpObject);
/**
* Returns list of PcepLabelRangeObject.
*
* @return Label Range List
*/
public LinkedList<PcepLabelRangeObject> getLabelRangeList();
/**
* Sets list of PcepLabelRangeObject.
*
* @param llLabelRangeList Label Range List
*/
public void setLabelRangeList(LinkedList<PcepLabelRangeObject> llLabelRangeList);
/**
* Write the byte stream of PcepLabelRange to channel buffer.
*
* @param bb of type channel buffer
* @return object length index
* @throws PcepParseException while writing LABEL RANGE into Channel Buffer.
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints Attributes of PcepLabelRange.
*/
public void print();
}
\ No newline at end of file
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
/**
* Abstraction of an entity providing PCEP LabelRange Object.
*/
public interface PcepLabelRangeObject {
/**
* Sets LabelRange Object header.
*
* @param obj LabelRange Object header
*/
void setLabelRangeObjHeader(PcepObjectHeader obj);
/**
* Sets LabelType in LabelRange Object.
*
* @param labelType label type value
*/
void setLabelType(byte labelType);
/**
* Sets RangeSize in LabelRange Object.
*
* @param rangeSize range size value
*/
void setRangeSize(int rangeSize);
/**
* Sets LabelBase in LabelRange Object.
*
* @param labelBase label base value
*/
void setLabelBase(int labelBase);
/**
* Returns LabelRange object header.
*
* @return LabelRange object header
*/
PcepObjectHeader getLabelRangeObjHeader();
/**
* Returns LabelType field in LabelRange object.
*
* @return LabelType field in LabelRange object
*/
byte getLabelType();
/**
* Returns RangeSize field in LabelRange object.
*
* @return RangeSize field in LabelRange object
*/
int getRangeSize();
/**
* Returns LabelBase field in LabelRange object.
*
* @return LabelBase field in LabelRange object
*/
int getLabelBase();
/**
* Prints attributes of LabelRange object.
*/
void print();
/**
* Writes the LabelRange Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing LABEL RANGE object into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build LabelRange object.
*/
public interface Builder {
/**
* Builds LabelRange Object.
*
* @return LabelRange Object
* @throws PcepParseException while building LABEL RANGE object.
*/
PcepLabelRangeObject build() throws PcepParseException;
/**
* Returns LabelRange object header.
*
* @return LabelRange object header
*/
PcepObjectHeader getLabelRangeObjHeader();
/**
* Sets LabelRange object header and returns its builder.
*
* @param obj LabelRange object header
* @return Builder by setting LabelRange object header
*/
Builder setLabelRangeObjHeader(PcepObjectHeader obj);
/**
* Returns LabelType field in LabelRange object.
*
* @return LabelType field in LabelRange object
*/
byte getLabelType();
/**
* Sets LabelType field and returns its builder.
*
* @param labelType LabelType field
* @return Builder by setting LabelType field
*/
Builder setLabelType(byte labelType);
/**
* Returns RangeSize field in LabelRange object.
*
* @return RangeSize field in LabelRange object
*/
int getRangeSize();
/**
* Sets RangeSize field and returns its builder.
*
* @param rangeSize RangeSize field
* @return Builder by setting RangeSize field
*/
Builder setRangeSize(int rangeSize);
/**
* Returns LabelBase field in LabelRange object.
*
* @return LabelBase field in LabelRange object
*/
int getLabelBase();
/**
* Sets LabelBase field and returns its builder.
*
* @param labelBase LabelBase field
* @return Builder by setting LabelBase field
*/
Builder setLabelBase(int labelBase);
/**
* Sets P flag in TE object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in TE object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP Label Range Reservation Message.
*/
public interface PcepLabelRangeResvMsg extends PcepObject, PcepMessage {
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns LabelRange field in Label Range Reservation message.
*
* @return LabelRange field
*/
PcepLabelRange getLabelRange();
/**
* Sets LabelRange field in Label Range Reservation message with specified value.
*
* @param lR label range object
*/
void setLabelRange(PcepLabelRange lR);
@Override
void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
/**
* Builder interface with get and set functions to build Label Range Reservation message.
*/
public interface Builder extends PcepMessage.Builder {
@Override
PcepLabelRangeResvMsg build();
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns LabelRange field in Label Range Reservation message.
*
* @return LabelRange object
*/
PcepLabelRange getLabelRange();
/**
* Sets LabelRange field and returns its Builder.
*
* @param lR label range object
* @return builder by setting LabelRange field
*/
Builder setLabelRange(PcepLabelRange lR);
}
}
/*
* Copyright 2014 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepLabelDownload;
import org.onosproject.pcepio.types.PcepLabelMap;
/***
* Abstraction to provide PCEP Label Updates.
*/
public interface PcepLabelUpdate {
/**
* Writes the byte stream of PcepLabelUpdate into channel buffer.
*
* @param bb of type channel buffer
* @throws PcepParseException while writing LABEL UPDATE.
*/
public void write(ChannelBuffer bb) throws PcepParseException;
/**
* Sets the Label Download object.
*
* @param labelDownload PCEP Label Download object
*/
public void setLabelDownload(PcepLabelDownload labelDownload);
/**
* Returns the PcepLabelDownload object.
*
* @return labelDownload PCEP Label Download
*/
public PcepLabelDownload getLabelDownload();
/**
* Sets the Label map object.
*
* @param labelMap PCEP Label Map object
*/
public void setLabelMap(PcepLabelMap labelMap);
/**
* Returns the PcepLabelMap object.
*
* @return labelMap PCEP Label Map
*/
public PcepLabelMap getLabelMap();
/**
* Prints the attributes of PCEP Label update.
*/
public void print();
/**
* Builder interface with get and set functions to build Label Update message.
*/
public interface Builder {
/**
* Builds PcepLableUpdate Object.
*
* @return PcepLableUpdate Object
* @throws PcepParseException while building LABEL-UPDATE.
*/
PcepLabelUpdate build() throws PcepParseException;
/**
* Sets the Label Download object.
*
* @param labelDownload PCEP Label Download object
* @return Builder by setting labelDownload object
*/
Builder setLabelDownload(PcepLabelDownload labelDownload);
/**
* Returns the PcepLabelDownload object.
*
* @return labelDownload PCEP Label Download
*/
PcepLabelDownload getLabelDownload();
/**
* Sets the Label map object.
*
* @param labelMap PCEP Label Map object
* @return Builder by setting PcepLabelMap object
*/
Builder setLabelMap(PcepLabelMap labelMap);
/**
* Returns the PcepLabelMap object.
*
* @return labelMap PCEP Label Map
*/
PcepLabelMap getLabelMap();
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP Label Update Message.
*/
public interface PcepLabelUpdateMsg extends PcepObject, PcepMessage {
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns list of PcLabelUpdateList.
*
* @return list of PcLabelUpdateList.
*/
LinkedList<PcepLabelUpdate> getPcLabelUpdateList();
/**
* Sets list of PcLabelUpdateList.
*
* @param llPcLabelUpdateList list of PcLabelUpdateList
*/
void setPcLabelUpdateList(LinkedList<PcepLabelUpdate> llPcLabelUpdateList);
@Override
void writeTo(ChannelBuffer channelBuffer) throws PcepParseException;
/**
* Builder interface with get and set functions to build Label Update message.
*/
public interface Builder extends PcepMessage.Builder {
@Override
PcepLabelUpdateMsg build();
@Override
PcepVersion getVersion();
@Override
PcepType getType();
/**
* Returns list of PcLabelUpdateList.
*
* @return list of PcLabelUpdateList.
*/
LinkedList<PcepLabelUpdate> getPcLabelUpdateList();
/**
* Sets list of PcLabelUpdateList.
*
* @param llPcLabelUpdateList list of PcLabelUpdateList.
* @return Builder by setting list of PcLabelUpdateList.
*/
Builder setPcLabelUpdateList(LinkedList<PcepLabelUpdate> llPcLabelUpdateList);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP LSP Object.
*/
public interface PcepLspObject {
/**
* Returns PlspId of LSP Object.
*
* @return PlspId of LSP Object
*/
int getPlspId();
/**
* Sets PlspId with specified value.
*
* @param value PlspId
*/
void setPlspId(int value);
/**
* Returns O flag in LSP Object.
*
* @return O flag in LSP Object
*/
byte getOFlag();
/**
* Sets O flag with specified value.
*
* @param value O flag
*/
void setOFlag(byte value);
/**
* Returns A flag in LSP Object.
*
* @return A flag in LSP Object
*/
boolean getAFlag();
/**
* Sets A flag with specified value.
*
* @param value A flag
*/
void setAFlag(boolean value);
/**
* Returns R flag in LSP Object.
*
* @return R flag in LSP Object
*/
boolean getRFlag();
/**
* Sets R flag with specified value.
*
* @param value R flag
*/
void setRFlag(boolean value);
/**
* Returns S flag in LSP Object.
*
* @return S flag in LSP Object
*/
boolean getSFlag();
/**
* Sets S flag with specified value.
*
* @param value S flag
*/
void setSFlag(boolean value);
/**
* Returns D flag in LSP Object.
*
* @return D flag in LSP Object
*/
boolean getDFlag();
/**
* Sets D flag with specified value.
*
* @param value D flag
*/
void setDFlag(boolean value);
/**
* Returns list of Optional Tlvs in LSP Object.
*
* @return list of Optional Tlvs
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets list of Optional Tlvs in LSP Object.
*
* @param llOptionalTlv list of Optional Tlvs
*/
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of LSP object.
*/
void print();
/**
* Writes the LSP Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing LSP object into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build LSP object.
*/
public interface Builder {
/**
* Builds LSP Object.
*
* @return LSP Object
*/
PcepLspObject build();
/**
* Returns LSP object header.
*
* @return LSP object header
*/
PcepObjectHeader getLspObjHeader();
/**
* Sets LSP object header and returns its builder.
*
* @param obj LSP object header
* @return Builder by setting LSP object header
*/
Builder setLspObjHeader(PcepObjectHeader obj);
/**
* Returns PlspId of LSP Object.
*
* @return PlspId of LSP Object
*/
int getPlspId();
/**
* Sets PlspId with specific value and return its builder.
*
* @param value PlspId
* @return Builder by setting PlspId
*/
Builder setPlspId(int value);
/**
* Returns O flag in LSP Object.
*
* @return O flag in LSP Object
*/
byte getOFlag();
/**
* Sets O flag with specific value and return its builder.
*
* @param value O flag
* @return Builder by setting O flag
*/
Builder setOFlag(byte value);
/**
* Returns A flag in LSP Object.
*
* @return A flag in LSP Object
*/
boolean getAFlag();
/**
* Sets A flag with specific value and return its builder.
*
* @param value A flag
* @return Builder by setting A flag
*/
Builder setAFlag(boolean value);
/**
* Returns A flag in LSP Object.
*
* @return A flag in LSP Object
*/
boolean getRFlag();
/**
* Sets R flag with specific value and return its builder.
*
* @param value r flag
* @return Builder by setting r flag
*/
Builder setRFlag(boolean value);
/**
* Returns S flag in LSP Object.
*
* @return S flag in LSP Object
*/
boolean getSFlag();
/**
* Sets S flag with specific value and return its builder.
*
* @param value s flag
* @return Builder by setting S flag
*/
Builder setSFlag(boolean value);
/**
* Returns D flag in LSP Object.
*
* @return D flag in LSP Object
*/
boolean getDFlag();
/**
* Sets D flag with specific value and return its builder.
*
* @param value D flag
* @return Builder by setting D flag
*/
Builder setDFlag(boolean value);
/**
* Returns list of Optional Tlvs in LSP Object.
*
* @return list of Optional Tlvs in LSP Object
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets list of Optional Tlvs and return its builder.
*
* @param llOptionalTlv list of Optional Tlvs
* @return Builder by setting list of Optional Tlvs
*/
Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Sets P flag in LSP object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in LSP object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
/*
* Copyright 2015 Open Networking Laboratory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.pcepio.protocol;
import java.util.LinkedList;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.types.PcepObjectHeader;
import org.onosproject.pcepio.types.PcepValueType;
/**
* Abstraction of an entity providing PCEP LSPA Object.
*/
public interface PcepLspaObject {
/**
* Returns L flag in LSPA Object.
*
* @return L flag in LSPA Object
*/
boolean getLFlag();
/**
* Sets L flag in LSPA Object.
*
* @param value L flag
*/
void setLFlag(boolean value);
/**
* Returns Exclude Any field in LSPA Object.
*
* @return Exclude Any field in LSPA Object
*/
int getExcludeAny();
/**
* Sets Exclude Any field in LSPA Object.
*
* @param value Exclude Any field
*/
void setExcludeAny(int value);
/**
* Returns Include Any field in LSPA Object.
*
* @return Include Any field in LSPA Object
*/
int getIncludeAny();
/**
* Sets Include Any field in LSPA Object.
*
* @param value Include Any field
*/
void setIncludeAny(int value);
/**
* Returns Include All field in LSPA Object.
*
* @return Include All field in LSPA Object
*/
int getIncludeAll();
/**
* Sets Include All field in LSPA Object.
*
* @param value Include All field
*/
void setIncludeAll(int value);
/**
* Returns Setup Priority field in LSPA Object.
*
* @return Setup Priority field in LSPA Object
*/
byte getSetupPriority();
/**
* Sets Setup Priority field in LSPA Object.
*
* @param value Setup Priority field
*/
void setSetupPriority(byte value);
/**
* Returns Hold Priority field in LSPA Object.
*
* @return Hold Priority field in LSPA Object
*/
byte getHoldPriority();
/**
* Sets Hold Priority field in LSPA Object.
*
* @param value Hold Priority field
*/
void setHoldPriority(byte value);
/**
* Returns list of Optional Tlvs in LSPA Object.
*
* @return list of Optional Tlvs in LSPA Object
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets Optional Tlvs in LSPA Object.
*
* @param llOptionalTlv Optional Tlvs in LSPA Object
*/
void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Prints attributes of LSPA object.
*/
void print();
/**
* Writes the LSPA Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException while writing LSPA object into Channel Buffer.
*/
int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build bandwidth object.
*/
public interface Builder {
/**
* Builds LSPA Object.
*
* @return LSPA Object
* @throws PcepParseException while building LSPA object.
*/
PcepLspaObject build() throws PcepParseException;
/**
* Returns LSPA object header.
*
* @return LSPA object header
*/
PcepObjectHeader getLspaObjHeader();
/**
* Sets LSPA object header and returns its builder.
*
* @param obj LSPA object header
* @return Builder by setting LSPA object header
*/
Builder setLspaObjHeader(PcepObjectHeader obj);
/**
* Returns L flag in LSPA Object.
*
* @return L flag in LSPA Object
*/
boolean getLFlag();
/**
* Sets L flag in LSPA Object and return its builder.
*
* @param value L flag in LSPA Object
* @return Builder by setting L flag
*/
Builder setLFlag(boolean value);
/**
* Returns Exclude Any field in LSPA Object.
*
* @return Exclude Any field in LSPA Object
*/
int getExcludeAny();
/**
* Sets Exclude Any field in LSPA Object and return its builder.
*
* @param value Exclude Any field in LSPA Object
* @return Builder by setting Exclude Any field
*/
Builder setExcludeAny(int value);
/**
* Returns Include Any field in LSPA Object.
*
* @return Include Any field in LSPA Object
*/
int getIncludeAny();
/**
* Sets Include Any field in LSPA Object and return its builder.
*
* @param value Include Any field in LSPA Object
* @return Builder by setting Include Any field
*/
Builder setIncludeAny(int value);
/**
* Returns Include All field in LSPA Object.
*
* @return Include All field in LSPA Object
*/
int getIncludeAll();
/**
* Sets Include All field in LSPA Object and return its builder.
*
* @param value Include All field in LSPA Object
* @return Builder by setting Include All field
*/
Builder setIncludeAll(int value);
/**
* Returns Setup Priority field in LSPA Object.
*
* @return Setup Priority field in LSPA Object
*/
byte getSetupPriority();
/**
* Sets Setup Priority field in LSPA Object and return its builder.
*
* @param value Setup Priority field in LSPA Object
* @return Builder by setting Setup Priority field
*/
Builder setSetupPriority(byte value);
/**
* Returns Hold Priority field in LSPA Object.
*
* @return Hold Priority field in LSPA Object
*/
byte getHoldPriority();
/**
* Sets Hold Priority field in LSPA Object and return its builder.
*
* @param value Hold Priority field in LSPA Object
* @return Builder by setting Hold Priority field
*/
Builder setHoldPriority(byte value);
/**
* Returns list of Optional Tlvs in LSPA Object.
*
* @return list of Optional Tlvs in LSPA Object
*/
LinkedList<PcepValueType> getOptionalTlv();
/**
* Sets list of Optional Tlvs in LSPA Object.
*
* @param llOptionalTlv list of Optional Tlvs
* @return builder by setting list of Optional Tlvs
*/
Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
/**
* Sets P flag in LSPA object header and returns its builder.
*
* @param value boolean value to set P flag
* @return Builder by setting P flag
*/
Builder setPFlag(boolean value);
/**
* Sets I flag in LSPA object header and returns its builder.
*
* @param value boolean value to set I flag
* @return Builder by setting I flag
*/
Builder setIFlag(boolean value);
}
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.