當前位置: 首頁>>代碼示例>>Java>>正文


Java PcepLabelMap類代碼示例

本文整理匯總了Java中org.onosproject.pcepio.types.PcepLabelMap的典型用法代碼示例。如果您正苦於以下問題:Java PcepLabelMap類的具體用法?Java PcepLabelMap怎麽用?Java PcepLabelMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PcepLabelMap類屬於org.onosproject.pcepio.types包,在下文中一共展示了PcepLabelMap類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PcepLabelUpdateVer1

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
/**
 * Constructor to initialize PCEP label map.
 *
 * @param labelMap PCEP label map
 */
public PcepLabelUpdateVer1(PcepLabelMap labelMap) {
    this.labelDownload = null;
    this.isLabelDownloadSet = false;
    this.labelMap = labelMap;
    this.isLabelMapSet = true;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:12,代碼來源:PcepLabelUpdateVer1.java

示例2: setLabelMap

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
@Override
public void setLabelMap(PcepLabelMap labelMap) {
    if (this.isLabelDownloadSet) {
        return;
    }
    this.labelMap = labelMap;
    this.isLabelMapSet = true;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:9,代碼來源:PcepLabelUpdateVer1.java

示例3: getLabelMap

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
@Override
public PcepLabelMap getLabelMap() {
    return labelMap;
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:5,代碼來源:PcepLabelUpdateVer1.java

示例4: pushGlobalNodeLabel

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
private void pushGlobalNodeLabel(DeviceId deviceId, LabelResourceId labelId,
        IpPrefix ipPrefix, PcepFlowType type, boolean isBos) throws PcepParseException {

    checkNotNull(deviceId);
    checkNotNull(labelId);
    checkNotNull(type);

    PcepClient pc = getPcepClient(deviceId);
    if (pc == null) {
        log.error("PCEP client not found");
        return;
    }

    LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>();

    if (ipPrefix == null) {
        // Pushing self node label to device.
        ipPrefix = IpPrefix.valueOf(pc.getPccId().ipAddress(), 32);
    }

    PcepFecObjectIPv4 fecObject = pc.factory().buildFecObjectIpv4()
                                  .setNodeID(ipPrefix.address().getIp4Address().toInt())
                                  .build();

    boolean bSFlag = false;
    if (pc.labelDbSyncStatus() == IN_SYNC && !isBos) {
        // Need to set sync flag in all messages till sync completes.
        bSFlag = true;
    }

    PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag);

    //Global NODE-SID as label object
    PcepLabelObject labelObject = pc.factory().buildLabelObject()
                                  .setLabel((int) labelId.labelId())
                                  .build();

    PcepLabelMap labelMap = new PcepLabelMap();
    labelMap.setFecObject(fecObject);
    labelMap.setLabelObject(labelObject);
    labelMap.setSrpObject(srpObj);

    labelUpdateList.add(pc.factory().buildPcepLabelUpdateObject()
                        .setLabelMap(labelMap)
                        .build());

    PcepLabelUpdateMsg labelMsg = pc.factory().buildPcepLabelUpdateMsg()
                                  .setPcLabelUpdateList(labelUpdateList)
                                  .build();

    pc.sendMessage(labelMsg);

    if (isBos) {
        // Sync is completed.
        pc.setLabelDbSyncStatus(SYNCED);
    }
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:58,代碼來源:BgpcepFlowRuleProvider.java

示例5: pushAdjacencyLabel

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
private void pushAdjacencyLabel(DeviceId deviceId, LabelResourceId labelId, IpPrefix ip4PrefixSrc,
                                IpPrefix ip4PrefixDst, PcepFlowType type)
        throws PcepParseException {

    checkNotNull(deviceId);
    checkNotNull(labelId);
    checkNotNull(ip4PrefixSrc);
    checkNotNull(ip4PrefixDst);
    checkNotNull(type);

    PcepClient pc = getPcepClient(deviceId);
    if (pc == null) {
        log.error("PCEP client not found");
        return;
    }

    LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>();

    int srcPortNo = ip4PrefixSrc.address().getIp4Address().toInt();
    int dstPortNo = ip4PrefixDst.address().getIp4Address().toInt();

    PcepFecObjectIPv4Adjacency fecAdjObject = pc.factory().buildFecIpv4Adjacency()
                                              .seRemoteIPv4Address(dstPortNo)
                                              .seLocalIPv4Address(srcPortNo)
                                              .build();

    boolean bSFlag = false;
    if (pc.labelDbSyncStatus() == IN_SYNC) {
        // Need to set sync flag in all messages till sync completes.
        bSFlag = true;
    }

    PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag);

    //Adjacency label object
    PcepLabelObject labelObject = pc.factory().buildLabelObject()
                                  .setLabel((int) labelId.labelId())
                                  .build();

    PcepLabelMap labelMap = new PcepLabelMap();
    labelMap.setFecObject(fecAdjObject);
    labelMap.setLabelObject(labelObject);
    labelMap.setSrpObject(srpObj);

    labelUpdateList.add(pc.factory().buildPcepLabelUpdateObject()
                        .setLabelMap(labelMap)
                        .build());

    PcepLabelUpdateMsg labelMsg = pc.factory().buildPcepLabelUpdateMsg()
                                  .setPcLabelUpdateList(labelUpdateList)
                                  .build();

    pc.sendMessage(labelMsg);
}
 
開發者ID:shlee89,項目名稱:athena,代碼行數:55,代碼來源:BgpcepFlowRuleProvider.java

示例6: pushGlobalNodeLabel

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
void pushGlobalNodeLabel(PcepClient pc, LabelResourceId labelId,
        int labelForNode, PcepLabelOp type, boolean isBos) throws PcepParseException {

    checkNotNull(pc);
    checkNotNull(labelId);
    checkNotNull(type);

    LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>();
    PcepFecObjectIPv4 fecObject = pc.factory().buildFecObjectIpv4()
                                  .setNodeID(labelForNode)
                                  .build();

    boolean bSFlag = false;
    if (pc.labelDbSyncStatus() == IN_SYNC && !isBos) {
        // Need to set sync flag in all messages till sync completes.
        bSFlag = true;
    }

    PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag);

    //Global NODE-SID as label object
    PcepLabelObject labelObject = pc.factory().buildLabelObject()
                                  .setLabel((int) labelId.labelId())
                                  .build();

    PcepLabelMap labelMap = new PcepLabelMap();
    labelMap.setFecObject(fecObject);
    labelMap.setLabelObject(labelObject);
    labelMap.setSrpObject(srpObj);

    labelUpdateList.add(pc.factory().buildPcepLabelUpdateObject()
                        .setLabelMap(labelMap)
                        .build());

    PcepLabelUpdateMsg labelMsg = pc.factory().buildPcepLabelUpdateMsg()
                                  .setPcLabelUpdateList(labelUpdateList)
                                  .build();
    pc.sendMessage(labelMsg);

    if (isBos) {
        // Sync is completed.
        pc.setLabelDbSyncStatus(SYNCED);
    }
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:45,代碼來源:PceccSrTeBeHandler.java

示例7: pushAdjacencyLabel

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
void pushAdjacencyLabel(PcepClient pc, LabelResourceId labelId, int srcPortNo,
                                int dstPortNo, PcepLabelOp type)
        throws PcepParseException {

    checkNotNull(pc);
    checkNotNull(labelId);
    checkNotNull(type);

    LinkedList<PcepLabelUpdate> labelUpdateList = new LinkedList<>();
    PcepFecObjectIPv4Adjacency fecAdjObject = pc.factory().buildFecIpv4Adjacency()
                                              .seRemoteIPv4Address(dstPortNo)
                                              .seLocalIPv4Address(srcPortNo)
                                              .build();

    boolean bSFlag = false;
    if (pc.labelDbSyncStatus() == IN_SYNC) {
        // Need to set sync flag in all messages till sync completes.
        bSFlag = true;
    }

    PcepSrpObject srpObj = getSrpObject(pc, type, bSFlag);

    //Adjacency label object
    PcepLabelObject labelObject = pc.factory().buildLabelObject()
                                  .setLabel((int) labelId.labelId())
                                  .build();

    PcepLabelMap labelMap = new PcepLabelMap();
    labelMap.setFecObject(fecAdjObject);
    labelMap.setLabelObject(labelObject);
    labelMap.setSrpObject(srpObj);

    labelUpdateList.add(pc.factory().buildPcepLabelUpdateObject()
                        .setLabelMap(labelMap)
                        .build());

    PcepLabelUpdateMsg labelMsg = pc.factory().buildPcepLabelUpdateMsg()
                                  .setPcLabelUpdateList(labelUpdateList)
                                  .build();
    pc.sendMessage(labelMsg);
}
 
開發者ID:opennetworkinglab,項目名稱:onos,代碼行數:42,代碼來源:PceccSrTeBeHandler.java

示例8: setLabelMap

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
/**
 * Sets the Label map object.
 *
 * @param labelMap PCEP Label Map object
 */
void setLabelMap(PcepLabelMap labelMap);
 
開發者ID:shlee89,項目名稱:athena,代碼行數:7,代碼來源:PcepLabelUpdate.java

示例9: getLabelMap

import org.onosproject.pcepio.types.PcepLabelMap; //導入依賴的package包/類
/**
 * Returns the PcepLabelMap object.
 *
 * @return labelMap PCEP Label Map
 */
PcepLabelMap getLabelMap();
 
開發者ID:shlee89,項目名稱:athena,代碼行數:7,代碼來源:PcepLabelUpdate.java


注:本文中的org.onosproject.pcepio.types.PcepLabelMap類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。