/* Altran Technologies Proprietary This source code is the sole property of Altran Technologies. Any form of utilization of this source code in whole or in part is prohibited without written consent from Altran Technologies File Name : PcepSvec.java Principal Author : Supriya Saini Subsystem Name : Module Name : Pcepio Date of First Release : 15/5/2019 Author : Supriya Saini Description : Change History Version : 1.0 Date(DD/MM/YYYY) : 8/4/2019 Modified by : Supriya Saini Description of change : Initial version */ package org.onosproject.pcepio.protocol; import org.jboss.netty.buffer.ChannelBuffer; import org.onosproject.pcepio.exceptions.PcepParseException; import org.onosproject.pcepio.types.PcepObjectHeader; import java.util.ArrayList; /** *
Represents a SVEC Object as defined in RFC 5440
*From RFC 5440, Section 7.13.2. SVEC Object
** Section 7.13.1 details the circumstances under which it may be * desirable and/or required to synchronize a set of path computation * requests. The SVEC (Synchronization VECtor) object allows a PCC to * request the synchronization of a set of dependent or independent path * computation requests. The SVEC object is optional and may be carried * within a PCReq message. * * The aim of the SVEC object carried within a PCReq message is to * request the synchronization of M path computation requests. The SVEC * object is a variable-length object that lists the set of M path * computation requests that must be synchronized. Each path * computation request is uniquely identified by the Request-ID-number * carried within the respective RP object. The SVEC object also * contains a set of flags that specify the synchronization type. * * SVEC Object-Class is 11. * * SVEC Object-Type is 1. * * The format of the SVEC object body is as follows: * * 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 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Reserved | Flags |S|N|L| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Request-ID-number #1 | * // // * | Request-ID-number #M | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * * Figure 18: SVEC Body Object Format * * Reserved (8 bits): This field MUST be set to zero on transmission * and MUST be ignored on receipt. * * Flags (24 bits): Defines the potential dependency between the set of * path computation requests. * * L (Link diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT have any link in common. * * N (Node diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT have any node in common. * * S (SRLG diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT share any SRLG (Shared Risk Link * Group). * * In case of a set of M synchronized independent path computation * requests, the bits L, N, and S are cleared. * * Unassigned flags MUST be set to zero on transmission and MUST be * ignored on receipt. * * The flags defined above are not exclusive. */ public interface PcepSvec { /** * Returns SVEC Object common header. * * @return PcepObjectHeader instance */ PcepObjectHeader getSvecObjHeader(); /** * Sets SVEC Object common header. * * @param obj */ void setSvecObjHeader(PcepObjectHeader obj); /** * Returns Link Diverse bit. * * @return Link Diverse bit in PcepSvec Object */ boolean getLDiverseBit(); /** * L (Link diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT have any link in common. */ void setLDiverseBit(boolean lDiverseBit); /** * Returns Node diverse bit. * * @return Node diverse bit in PcepSvec Object */ boolean getNDiverseBit(); /** * N (Node diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT have any node in common. */ void setNDiverseBit(boolean nDiverseBit); /** * Returns SRLG diverse bit. * * @return SRLG diverse bit in PcepSvec Object */ boolean getSRLGDiverseBit(); /** * S (SRLG diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT share any SRLG (Shared Risk Link * Group). */ void setSRLGDiverseBit(boolean srlgDiverseBit); /** * Returns Request Id List. * * @return ArrayList*/ ArrayList getRequestIDlist(); /** * Sets Request Id List in PcepSvec Object. * * @param requestIDlist */ void setRequestIDlist(ArrayList requestIDlist); /** * Writes the PcepSvec Object into channel buffer. * * @param cb channel buffer * @return Returns the writerIndex of this buffer * @throws PcepParseException while writing PcepSvec object into Channel Buffer. */ int write(ChannelBuffer cb) throws PcepParseException; /** * Builder interface with get and set functions to build PcepSvec object. */ interface Builder { /** * Builds PcepSvec Object. * * @return PcepSvec Object * @throws PcepParseException while building PcepSvec object */ PcepSvec build() throws PcepParseException; /** * Returns PcepSvec object header. * * @return PcepSvec object header */ PcepObjectHeader getPcepSvecObjHeader(); /** * Sets PcepSvec object header and returns its builder. * * @param obj PcepSvec object header * @return Builder by setting PcepSvec object header */ Builder setPcepSvecObjHeader(PcepObjectHeader obj); /** * Returns Link Diverse bit. * * @return Link Diverse bit in PcepSvec Object */ boolean getLDiverseBit(); /** * L (Link diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT have any link in common. */ Builder setLDiverseBit(boolean lDiverseBit); /** * Returns Node diverse bit. * * @return Node diverse bit in PcepSvec Object */ boolean getNDiverseBit(); /** * N (Node diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT have any node in common. */ Builder setNDiverseBit(boolean nDiverseBit); /** * Returns SRLG diverse bit. * * @return SRLG diverse bit in PcepSvec Object */ boolean getSRLGDiverseBit(); /** * S (SRLG diverse) bit: when set, this indicates that the * computed paths corresponding to the requests specified by the * following RP objects MUST NOT share any SRLG (Shared Risk Link * Group). */ Builder setSRLGDiverseBit(boolean srlgDiverseBit); /** * Returns Request Id List. * * @return ArrayList */ ArrayList getRequestIDlist(); /** * Sets Request Id List in PcepSvec Object. * * @param requestIDlist List of Request Ids */ Builder setRequestIDlist(ArrayList requestIDlist); /** * Sets P flag in PcepSvec 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 PcepSvec object header and returns its builder. * * @param value boolean value to set I flag * @return Builder by setting I flag */ Builder setIFlag(boolean value); } }