Sho SHIMIZU
Committed by Gerrit Code Review

Use LF (Line Feed) as line separator

Change-Id: I052ab6da04e418bb6bcb4aa1d3d6648dcfd14f6c
Showing 26 changed files with 2426 additions and 2426 deletions
/*
* 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;
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);
}
/*
* 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 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.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);
}
/*
* 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 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);
}
}
/*
* 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 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);
}
}
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;
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;
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);
}
/*
* 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 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 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 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();
/*
* 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 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 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();
}
}
......
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity Provides PCEP Message PAth for update message.
* Reference :PCE extensions for stateful draft-ietf-pce-stateful-pce-10.
*/
public interface PcepMsgPath {
/**
* Returns object of PcepEroObject.
*
* @return eroObject
*/
PcepEroObject getEroObject();
/**
* Returns object of PcepAttribute.
*
* @return pcepAttribute
*/
PcepAttribute getPcepAttribute();
/**
* Sets PcepEroObject.
*
* @param eroObject PCEP ERO Object.
*/
void setEroObject(PcepEroObject eroObject);
/**
* Sets PcepAttribute.
*
* @param pcepAttribute PCEP-Attribute.
*/
void setPcepAttribute(PcepAttribute pcepAttribute);
/**
* reads ERO object and attribute list.
*
* @param bb of type channel buffer
* @return PcepMsgPath
* @throws PcepParseException while parsing Message Path from Channel Buffer.
*/
public PcepMsgPath read(ChannelBuffer bb) throws PcepParseException;
/**
* writes ERO object and attribute list to channel.
*
* @param bb of type channel buffer
* @return object length index
* @throws PcepParseException while writing Message Path into Channel Buffer.
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of PCEP message path.
*/
void print();
/**
* Builder interface with get and set functions to build PcepMsgPath.
*/
public interface Builder {
/**
* Builds PcepMsgPath.
*
* @return PcepMsgPath
* @throws PcepParseException when mandatory object is not set
*/
PcepMsgPath build() throws PcepParseException;
/**
* Returns object of PcepEroObject.
*
* @return PcepEroObject
*/
PcepEroObject getEroObject();
/**
* Returns object of PcepAttribute.
*
* @return pcepAttribute
*/
PcepAttribute getPcepAttribute();
/**
* Sets PcepEroObject.
*
* @param eroObject PcepEroObject
* @return Builder by setting ERO object.
*/
Builder setEroObject(PcepEroObject eroObject);
/**
* Sets PcepAttribute.
*
* @param pcepAttribute PCEP-Attribute
* @return Builder by setting PCEP-Attribute.
*/
Builder setPcepAttribute(PcepAttribute pcepAttribute);
}
}
package org.onosproject.pcepio.protocol;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity Provides PCEP Message PAth for update message.
* Reference :PCE extensions for stateful draft-ietf-pce-stateful-pce-10.
*/
public interface PcepMsgPath {
/**
* Returns object of PcepEroObject.
*
* @return eroObject
*/
PcepEroObject getEroObject();
/**
* Returns object of PcepAttribute.
*
* @return pcepAttribute
*/
PcepAttribute getPcepAttribute();
/**
* Sets PcepEroObject.
*
* @param eroObject PCEP ERO Object.
*/
void setEroObject(PcepEroObject eroObject);
/**
* Sets PcepAttribute.
*
* @param pcepAttribute PCEP-Attribute.
*/
void setPcepAttribute(PcepAttribute pcepAttribute);
/**
* reads ERO object and attribute list.
*
* @param bb of type channel buffer
* @return PcepMsgPath
* @throws PcepParseException while parsing Message Path from Channel Buffer.
*/
public PcepMsgPath read(ChannelBuffer bb) throws PcepParseException;
/**
* writes ERO object and attribute list to channel.
*
* @param bb of type channel buffer
* @return object length index
* @throws PcepParseException while writing Message Path into Channel Buffer.
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Prints the attributes of PCEP message path.
*/
void print();
/**
* Builder interface with get and set functions to build PcepMsgPath.
*/
public interface Builder {
/**
* Builds PcepMsgPath.
*
* @return PcepMsgPath
* @throws PcepParseException when mandatory object is not set
*/
PcepMsgPath build() throws PcepParseException;
/**
* Returns object of PcepEroObject.
*
* @return PcepEroObject
*/
PcepEroObject getEroObject();
/**
* Returns object of PcepAttribute.
*
* @return pcepAttribute
*/
PcepAttribute getPcepAttribute();
/**
* Sets PcepEroObject.
*
* @param eroObject PcepEroObject
* @return Builder by setting ERO object.
*/
Builder setEroObject(PcepEroObject eroObject);
/**
* Sets PcepAttribute.
*
* @param pcepAttribute PCEP-Attribute
* @return Builder by setting PCEP-Attribute.
*/
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;
import org.jboss.netty.buffer.ChannelBuffer;
/**
* Abstraction of an entity provides NAI information in SR ERO Object.
*/
public interface PcepNai {
/**
* To get the ST type of the NAI information.
*
* @return type of ST info
*/
byte getType();
/**
* To write the object information to channelBuffer.
*
* @param cb of type channel buffer
* @return length of written bytes.
*/
int write(ChannelBuffer cb);
}
/*
* 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 provides NAI information in SR ERO Object.
*/
public interface PcepNai {
/**
* To get the ST type of the NAI information.
*
* @return type of ST info
*/
byte getType();
/**
* To write the object information to channelBuffer.
*
* @param cb of type channel buffer
* @return length of written bytes.
*/
int write(ChannelBuffer cb);
}
......
/*
* 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 RRO Object.
*/
public interface PcepRroObject {
/**
* Returns list of SubObjects.
*
* @return list of SubObjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets list of SubObjects and return its builder.
*
* @param llSubObjects list of SubObjects
*/
void setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Prints attributes of RRO object.
*/
void print();
/**
* Writes the RRO Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException when object header failed to write in channel buffer
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build RRO object.
*/
public interface Builder {
/**
* Builds RRO Object.
*
* @return RRO Object
*/
PcepRroObject build();
/**
* Returns RRO object header.
*
* @return RRO object header
*/
PcepObjectHeader getRroObjHeader();
/**
* Sets RRO object header and returns its builder.
*
* @param obj RRO object header
* @return Builder by setting RRO object header
*/
Builder setRroObjHeader(PcepObjectHeader obj);
/**
* Returns list of SubObjects.
*
* @return list of SubObjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets list of SubObjects in RRO 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 RRO 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 RRO 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 RRO Object.
*/
public interface PcepRroObject {
/**
* Returns list of SubObjects.
*
* @return list of SubObjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets list of SubObjects and return its builder.
*
* @param llSubObjects list of SubObjects
*/
void setSubObjects(LinkedList<PcepValueType> llSubObjects);
/**
* Prints attributes of RRO object.
*/
void print();
/**
* Writes the RRO Object into channel buffer.
*
* @param bb channel buffer
* @return Returns the writerIndex of this buffer
* @throws PcepParseException when object header failed to write in channel buffer
*/
public int write(ChannelBuffer bb) throws PcepParseException;
/**
* Builder interface with get and set functions to build RRO object.
*/
public interface Builder {
/**
* Builds RRO Object.
*
* @return RRO Object
*/
PcepRroObject build();
/**
* Returns RRO object header.
*
* @return RRO object header
*/
PcepObjectHeader getRroObjHeader();
/**
* Sets RRO object header and returns its builder.
*
* @param obj RRO object header
* @return Builder by setting RRO object header
*/
Builder setRroObjHeader(PcepObjectHeader obj);
/**
* Returns list of SubObjects.
*
* @return list of SubObjects
*/
LinkedList<PcepValueType> getSubObjects();
/**
* Sets list of SubObjects in RRO 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 RRO 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 RRO 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 org.onosproject.pcepio.exceptions.PcepParseException;
/**
* Abstraction of an entity providing PCEP Update Request List.
*/
public interface PcepUpdateRequest {
/**
* Returns object of PCEP SRP Object.
*
* @return srpObject of type PCEP SRP Object
*/
PcepSrpObject getSrpObject();
/**
* Returns object of PCEP LSP Object.
*
* @return lspObject of type PCEP LSP Object
*/
PcepLspObject getLspObject();
/**
* Returns object of PCEP MSG PATH.
*
* @return msgPath of type PCEP MSG PATH
*/
PcepMsgPath getMsgPath();
/**
* Sets the PCEP SRP Object.
*
* @param srpObject object of type PCEP SRP Object
*/
void setSrpObject(PcepSrpObject srpObject);
/**
* Sets the PCEP LSP Object.
*
* @param lspObject object of type PCEP LSP Object
*/
void setLspObject(PcepLspObject lspObject);
/**
* sets the PCEP MSG PATH.
*
* @param msgPath object of type PCEP MSG PATH
*/
void setMsgPath(PcepMsgPath msgPath);
/**
* Prints the attributes of PCEP Update Request.
*/
public void print();
/**
* Builder interface with get and set functions to build PcepUpdateRequest.
*/
public interface Builder {
/**
* Builds PcepUpdateRequest.
*
* @return PcepUpdateRequest
* @throws PcepParseException if mandatory object is not set
*/
PcepUpdateRequest build() throws PcepParseException;
/**
* Returns PcepSrpObject.
*
* @return srpObject
*/
PcepSrpObject getSrpObject();
/**
* Returns PcepLspObject.
*
* @return lspObject
*/
PcepLspObject getLspObject();
/**
* Returns PcepMsgPath.
*
* @return msgPath
*/
PcepMsgPath getMsgPath();
/**
* Sets the SRP Object.
*
* @param srpObj of type PcepSrpObject
* @return builder by setting PcepSrpObject
*/
Builder setSrpObject(PcepSrpObject srpObj);
/**
* Sets the LSP Object.
*
* @param lspObject of type PcepLspObject
* @return builder by setting PcepLspObject
*/
Builder setLspObject(PcepLspObject lspObject);
/**
* Sets the Path Object.
*
* @param msgPath of type PcepMsgPath
* @return builder by setting PcepMsgPath
*/
Builder setMsgPath(PcepMsgPath msgPath);
}
/*
* 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 providing PCEP Update Request List.
*/
public interface PcepUpdateRequest {
/**
* Returns object of PCEP SRP Object.
*
* @return srpObject of type PCEP SRP Object
*/
PcepSrpObject getSrpObject();
/**
* Returns object of PCEP LSP Object.
*
* @return lspObject of type PCEP LSP Object
*/
PcepLspObject getLspObject();
/**
* Returns object of PCEP MSG PATH.
*
* @return msgPath of type PCEP MSG PATH
*/
PcepMsgPath getMsgPath();
/**
* Sets the PCEP SRP Object.
*
* @param srpObject object of type PCEP SRP Object
*/
void setSrpObject(PcepSrpObject srpObject);
/**
* Sets the PCEP LSP Object.
*
* @param lspObject object of type PCEP LSP Object
*/
void setLspObject(PcepLspObject lspObject);
/**
* sets the PCEP MSG PATH.
*
* @param msgPath object of type PCEP MSG PATH
*/
void setMsgPath(PcepMsgPath msgPath);
/**
* Prints the attributes of PCEP Update Request.
*/
public void print();
/**
* Builder interface with get and set functions to build PcepUpdateRequest.
*/
public interface Builder {
/**
* Builds PcepUpdateRequest.
*
* @return PcepUpdateRequest
* @throws PcepParseException if mandatory object is not set
*/
PcepUpdateRequest build() throws PcepParseException;
/**
* Returns PcepSrpObject.
*
* @return srpObject
*/
PcepSrpObject getSrpObject();
/**
* Returns PcepLspObject.
*
* @return lspObject
*/
PcepLspObject getLspObject();
/**
* Returns PcepMsgPath.
*
* @return msgPath
*/
PcepMsgPath getMsgPath();
/**
* Sets the SRP Object.
*
* @param srpObj of type PcepSrpObject
* @return builder by setting PcepSrpObject
*/
Builder setSrpObject(PcepSrpObject srpObj);
/**
* Sets the LSP Object.
*
* @param lspObject of type PcepLspObject
* @return builder by setting PcepLspObject
*/
Builder setLspObject(PcepLspObject lspObject);
/**
* Sets the Path Object.
*
* @param msgPath of type PcepMsgPath
* @return builder by setting PcepMsgPath
*/
Builder setMsgPath(PcepMsgPath msgPath);
}
}
\ No newline at end of file
......
package org.onosproject.pcepio.types;
import java.util.LinkedList;
import java.util.ListIterator;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepErrorObject;
import org.onosproject.pcepio.protocol.PcepOpenObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* Provide the error object list with open object.
*/
public class ErrorObjListWithOpen {
//errorObjList is mandatory
LinkedList<PcepErrorObject> llerrorObjList;
// openObject is optional
PcepOpenObject openObject;
// flag to check if open object is set or not
public boolean isOpenObjectSet;
protected static final Logger log = LoggerFactory.getLogger(ErrorObjListWithOpen.class);
/*
* constructor to initialize errObj,openObj.
*
* @param errObj error object list
* @param openObj open object
*/
public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) {
this.llerrorObjList = errObj;
this.openObject = openObj;
if (openObj != null) {
isOpenObjectSet = true;
} else {
isOpenObjectSet = false;
}
}
/*
* constructor to initialize errObj.
*
* @param errObj error object list
*/
public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) {
this.llerrorObjList = errObj;
this.openObject = null;
isOpenObjectSet = false;
}
public LinkedList<Integer> getErrorType() {
LinkedList<Integer> errorType = new LinkedList<Integer>();
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
int error;
PcepErrorObject errorObj;
while (errObjListIterator.hasNext()) {
errorObj = errObjListIterator.next();
error = errorObj.getErrorType();
errorType.add(error);
}
}
return errorType;
}
public LinkedList<Integer> getErrorValue() {
LinkedList<Integer> errorValue = new LinkedList<Integer>();
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
int error;
PcepErrorObject errorObj;
while (errObjListIterator.hasNext()) {
errorObj = errObjListIterator.next();
error = errorObj.getErrorValue();
errorValue.add(error);
}
}
return errorValue;
}
/*
* Checks whether error object list is empty or not.
*
* @return whether error object list is empty or not
*/
public boolean isErrorObjListWithOpenPresent() {
// ( <error-obj-list> [<Open>]
// At least in this case <error-obj-list> should be present.
return (!this.llerrorObjList.isEmpty()) ? true : false;
}
/*
* Write Error Object List and Open Object to channel buffer.
*
* @param bb of type channel buffer
* @throws PcepParseException when mandatory fields are not set
*/
public int write(ChannelBuffer bb) throws PcepParseException {
int iLenStartIndex = bb.writerIndex();
boolean bIsErrObjListFound = false;
//<error-obj-list> is mandatory , if not present throw exception.
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
while (errObjListIterator.hasNext()) {
errObjListIterator.next().write(bb);
bIsErrObjListFound = true;
}
}
if (!bIsErrObjListFound) {
throw new PcepParseException("Error: [ErrorObjListWithOpen::write] <error-obj-list> is mandatory.");
}
//Open Object is optional , if present write.
if (openObject != null) {
openObject.write(bb);
}
return bb.writerIndex() - iLenStartIndex;
}
/*
* Prints the attributes of ErrorObject List with open Object.
*/
public void print() {
log.debug("ErrorObjListWithOpen:");
ListIterator<PcepErrorObject> pcepErrorObjIterator = llerrorObjList.listIterator();
log.debug("<error-obj-list> :");
while (pcepErrorObjIterator.hasNext()) {
pcepErrorObjIterator.next().print();
}
log.debug("OpenObject:");
if (openObject != null) {
openObject.print();
}
}
}
package org.onosproject.pcepio.types;
import java.util.LinkedList;
import java.util.ListIterator;
import org.jboss.netty.buffer.ChannelBuffer;
import org.onosproject.pcepio.exceptions.PcepParseException;
import org.onosproject.pcepio.protocol.PcepErrorObject;
import org.onosproject.pcepio.protocol.PcepOpenObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* Provide the error object list with open object.
*/
public class ErrorObjListWithOpen {
//errorObjList is mandatory
LinkedList<PcepErrorObject> llerrorObjList;
// openObject is optional
PcepOpenObject openObject;
// flag to check if open object is set or not
public boolean isOpenObjectSet;
protected static final Logger log = LoggerFactory.getLogger(ErrorObjListWithOpen.class);
/*
* constructor to initialize errObj,openObj.
*
* @param errObj error object list
* @param openObj open object
*/
public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj, PcepOpenObject openObj) {
this.llerrorObjList = errObj;
this.openObject = openObj;
if (openObj != null) {
isOpenObjectSet = true;
} else {
isOpenObjectSet = false;
}
}
/*
* constructor to initialize errObj.
*
* @param errObj error object list
*/
public ErrorObjListWithOpen(LinkedList<PcepErrorObject> errObj) {
this.llerrorObjList = errObj;
this.openObject = null;
isOpenObjectSet = false;
}
public LinkedList<Integer> getErrorType() {
LinkedList<Integer> errorType = new LinkedList<Integer>();
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
int error;
PcepErrorObject errorObj;
while (errObjListIterator.hasNext()) {
errorObj = errObjListIterator.next();
error = errorObj.getErrorType();
errorType.add(error);
}
}
return errorType;
}
public LinkedList<Integer> getErrorValue() {
LinkedList<Integer> errorValue = new LinkedList<Integer>();
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
int error;
PcepErrorObject errorObj;
while (errObjListIterator.hasNext()) {
errorObj = errObjListIterator.next();
error = errorObj.getErrorValue();
errorValue.add(error);
}
}
return errorValue;
}
/*
* Checks whether error object list is empty or not.
*
* @return whether error object list is empty or not
*/
public boolean isErrorObjListWithOpenPresent() {
// ( <error-obj-list> [<Open>]
// At least in this case <error-obj-list> should be present.
return (!this.llerrorObjList.isEmpty()) ? true : false;
}
/*
* Write Error Object List and Open Object to channel buffer.
*
* @param bb of type channel buffer
* @throws PcepParseException when mandatory fields are not set
*/
public int write(ChannelBuffer bb) throws PcepParseException {
int iLenStartIndex = bb.writerIndex();
boolean bIsErrObjListFound = false;
//<error-obj-list> is mandatory , if not present throw exception.
if (llerrorObjList != null) {
ListIterator<PcepErrorObject> errObjListIterator = llerrorObjList.listIterator();
while (errObjListIterator.hasNext()) {
errObjListIterator.next().write(bb);
bIsErrObjListFound = true;
}
}
if (!bIsErrObjListFound) {
throw new PcepParseException("Error: [ErrorObjListWithOpen::write] <error-obj-list> is mandatory.");
}
//Open Object is optional , if present write.
if (openObject != null) {
openObject.write(bb);
}
return bb.writerIndex() - iLenStartIndex;
}
/*
* Prints the attributes of ErrorObject List with open Object.
*/
public void print() {
log.debug("ErrorObjListWithOpen:");
ListIterator<PcepErrorObject> pcepErrorObjIterator = llerrorObjList.listIterator();
log.debug("<error-obj-list> :");
while (pcepErrorObjIterator.hasNext()) {
pcepErrorObjIterator.next().print();
}
log.debug("OpenObject:");
if (openObject != null) {
openObject.print();
}
}
}
......
package org.onosproject.pcepio.types;
import java.util.LinkedList;
import java.util.ListIterator;
import org.onosproject.pcepio.protocol.PcepLabelObject;
import org.onosproject.pcepio.protocol.PcepLspObject;
import org.onosproject.pcepio.protocol.PcepSrpObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* Provides Pcep Label.
* REference :draft-zhao-pce-pcep-extension-for-pce-controller-01.
*/
public class PcepLabelDownload {
protected static final Logger log = LoggerFactory.getLogger(PcepLabelDownload.class);
//PCEP SPR Object
PcepSrpObject srpObject;
//PCEP LSP Object
PcepLspObject lspObject;
//LinkList of Labels
LinkedList<PcepLabelObject> llLabelList;
/*
* Returns SRP Object.
*
* @return PCEP SRP Object
*/
public PcepSrpObject getSrpObject() {
return srpObject;
}
/*
* Sets the Pcep Srp Object.
*
* @param srpobj PCEP SRP Object
*/
public void setSrpObject(PcepSrpObject srpobj) {
this.srpObject = srpobj;
}
/*
* Returns LSP Object.
*
* @return PCEP LSP Object
*/
public PcepLspObject getLspObject() {
return lspObject;
}
/*
* Sets the Pcep LSP Object.
*
* @param lspObject PCEP LSP Object
*/
public void setLspObject(PcepLspObject lspObject) {
this.lspObject = lspObject;
}
/*
* Returns a list of labels.
*
* @return llLabelList list of pcep label objects
*/
public LinkedList<PcepLabelObject> getLabelList() {
return llLabelList;
}
/*
* set the llLabelList list of type PcepLableObject.
*
* @param llLabelList list of pcep label objects
*/
public void setLabelList(LinkedList<PcepLabelObject> llLabelList) {
this.llLabelList = llLabelList;
}
/*
* Prints the attribute of PcepLableObject.
*/
public void print() {
log.debug("LABEL DOWNLOAD:");
srpObject.print();
lspObject.print();
log.debug("label-list:");
ListIterator<PcepLabelObject> listIterator = llLabelList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().print();
}
}
}
package org.onosproject.pcepio.types;
import java.util.LinkedList;
import java.util.ListIterator;
import org.onosproject.pcepio.protocol.PcepLabelObject;
import org.onosproject.pcepio.protocol.PcepLspObject;
import org.onosproject.pcepio.protocol.PcepSrpObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/*
* Provides Pcep Label.
* REference :draft-zhao-pce-pcep-extension-for-pce-controller-01.
*/
public class PcepLabelDownload {
protected static final Logger log = LoggerFactory.getLogger(PcepLabelDownload.class);
//PCEP SPR Object
PcepSrpObject srpObject;
//PCEP LSP Object
PcepLspObject lspObject;
//LinkList of Labels
LinkedList<PcepLabelObject> llLabelList;
/*
* Returns SRP Object.
*
* @return PCEP SRP Object
*/
public PcepSrpObject getSrpObject() {
return srpObject;
}
/*
* Sets the Pcep Srp Object.
*
* @param srpobj PCEP SRP Object
*/
public void setSrpObject(PcepSrpObject srpobj) {
this.srpObject = srpobj;
}
/*
* Returns LSP Object.
*
* @return PCEP LSP Object
*/
public PcepLspObject getLspObject() {
return lspObject;
}
/*
* Sets the Pcep LSP Object.
*
* @param lspObject PCEP LSP Object
*/
public void setLspObject(PcepLspObject lspObject) {
this.lspObject = lspObject;
}
/*
* Returns a list of labels.
*
* @return llLabelList list of pcep label objects
*/
public LinkedList<PcepLabelObject> getLabelList() {
return llLabelList;
}
/*
* set the llLabelList list of type PcepLableObject.
*
* @param llLabelList list of pcep label objects
*/
public void setLabelList(LinkedList<PcepLabelObject> llLabelList) {
this.llLabelList = llLabelList;
}
/*
* Prints the attribute of PcepLableObject.
*/
public void print() {
log.debug("LABEL DOWNLOAD:");
srpObject.print();
lspObject.print();
log.debug("label-list:");
ListIterator<PcepLabelObject> listIterator = llLabelList.listIterator();
while (listIterator.hasNext()) {
listIterator.next().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.types;
import org.onosproject.pcepio.protocol.PcepFecObject;
import org.onosproject.pcepio.protocol.PcepLabelObject;
import org.onosproject.pcepio.protocol.PcepSrpObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provide PCEP Label Map.
* Reference :draft-zhao-pce-pcep-extension-for-pce-controller-01.
*/
public class PcepLabelMap {
protected static final Logger log = LoggerFactory.getLogger(PcepLabelMap.class);
//PCEP SRP Object
PcepSrpObject srpObject;
//PCEP Label Object
PcepLabelObject labelObject;
//PCEP FEC Object
PcepFecObject fecObject;
/**
* Sets Fec Object.
*
* @param fecObject PCEP fec object
*/
public void setFECObject(PcepFecObject fecObject) {
this.fecObject = fecObject;
}
/**
* Returns the PcepFecObject.
*
* @return PCEP fec object
*/
public PcepFecObject getFECObject() {
return this.fecObject;
}
/**
* Returns SRP Object.
*
* @return PCEP SRP Object
*/
public PcepSrpObject getSrpObject() {
return srpObject;
}
/**
* Sets the PCEP Srp Object.
*
* @param srpObject PCEP SRP Object
*/
public void setSrpObject(PcepSrpObject srpObject) {
this.srpObject = srpObject;
}
/**
* Returns labelObject.
*
* @return PCEP label object
*/
public PcepLabelObject getLabelObject() {
return labelObject;
}
/**
* Sets the Pcep labelObject.
*
* @param labelObject PCEP label object
*/
public void setLabelObject(PcepLabelObject labelObject) {
this.labelObject = labelObject;
}
/**
* Prints the attribute of PcepLabelMap.
*/
public void print() {
log.debug("LABEL MAP:");
srpObject.print();
labelObject.print();
fecObject.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.types;
import org.onosproject.pcepio.protocol.PcepFecObject;
import org.onosproject.pcepio.protocol.PcepLabelObject;
import org.onosproject.pcepio.protocol.PcepSrpObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provide PCEP Label Map.
* Reference :draft-zhao-pce-pcep-extension-for-pce-controller-01.
*/
public class PcepLabelMap {
protected static final Logger log = LoggerFactory.getLogger(PcepLabelMap.class);
//PCEP SRP Object
PcepSrpObject srpObject;
//PCEP Label Object
PcepLabelObject labelObject;
//PCEP FEC Object
PcepFecObject fecObject;
/**
* Sets Fec Object.
*
* @param fecObject PCEP fec object
*/
public void setFECObject(PcepFecObject fecObject) {
this.fecObject = fecObject;
}
/**
* Returns the PcepFecObject.
*
* @return PCEP fec object
*/
public PcepFecObject getFECObject() {
return this.fecObject;
}
/**
* Returns SRP Object.
*
* @return PCEP SRP Object
*/
public PcepSrpObject getSrpObject() {
return srpObject;
}
/**
* Sets the PCEP Srp Object.
*
* @param srpObject PCEP SRP Object
*/
public void setSrpObject(PcepSrpObject srpObject) {
this.srpObject = srpObject;
}
/**
* Returns labelObject.
*
* @return PCEP label object
*/
public PcepLabelObject getLabelObject() {
return labelObject;
}
/**
* Sets the Pcep labelObject.
*
* @param labelObject PCEP label object
*/
public void setLabelObject(PcepLabelObject labelObject) {
this.labelObject = labelObject;
}
/**
* Prints the attribute of PcepLabelMap.
*/
public void print() {
log.debug("LABEL MAP:");
srpObject.print();
labelObject.print();
fecObject.print();
}
}
......