当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationId类代码示例

本文整理汇总了Java中org.onosproject.core.ApplicationId的典型用法代码示例。如果您正苦于以下问题:Java ApplicationId类的具体用法?Java ApplicationId怎么用?Java ApplicationId使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ApplicationId类属于org.onosproject.core包,在下文中一共展示了ApplicationId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
@Override
public Application create(InputStream appDescStream) {
    ApplicationDescription appDesc = saveApplication(appDescStream);
    ApplicationId appId = idStore.registerApplication(appDesc.name());
    DefaultApplication app =
            new DefaultApplication(appId,
                    appDesc.version(),
                    appDesc.title(),
                    appDesc.description(),
                    appDesc.origin(),
                    appDesc.category(),
                    appDesc.url(),
                    appDesc.readme(),
                    appDesc.icon(),
                    appDesc.role(),
                    appDesc.permissions(),
                    appDesc.featuresRepo(),
                    appDesc.features(),
                    appDesc.requiredApps());
    apps.put(appId, app);
    states.put(appId, INSTALLED);
    delegate.notify(new ApplicationEvent(APP_INSTALLED, app));
    return app;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:SimpleApplicationStore.java

示例2: populateRow

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
private void populateRow(TableModel.Row row, Application app,
                         ApplicationService as) {
    ApplicationId id = app.id();
    ApplicationState state = as.getState(id);
    String iconId = state == ACTIVE ? ICON_ID_ACTIVE : ICON_ID_INACTIVE;

    row.cell(STATE, state)
            .cell(STATE_IID, iconId)
            .cell(ID, id.name())
            .cell(ICON, id.name())
            .cell(VERSION, app.version())
            .cell(CATEGORY, app.category())
            .cell(ORIGIN, app.origin())
            .cell(TITLE, app.title())
            .cell(DESC, app.description())
            .cell(URL, app.url());
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:ApplicationViewMessageHandler.java

示例3: processEthDstOnlyFilter

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
@Override
protected List<FlowRule> processEthDstOnlyFilter(EthCriterion ethCriterion,
        ApplicationId applicationId) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchEthDst(ethCriterion.mac());
    /*
     * Note: CpqD switches do not handle MPLS-related operation properly
     * for a packet with VLAN tag. We pop VLAN here as a workaround.
     * Side effect: HostService learns redundant hosts with same MAC but
     * different VLAN. No known side effect on the network reachability.
     */
    treatment.popVlan();
    treatment.transition(UNICAST_ROUTING_TABLE);
    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DEFAULT_PRIORITY)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(TMAC_TABLE).build();
    return ImmutableList.<FlowRule>builder().add(rule).build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:CpqdOfdpa2Pipeline.java

示例4: processEthDstOnlyFilter

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
protected List<FlowRule> processEthDstOnlyFilter(EthCriterion ethCriterion,
        ApplicationId applicationId) {
    TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
    TrafficTreatment.Builder treatment = DefaultTrafficTreatment.builder();
    selector.matchEthType(Ethernet.TYPE_IPV4);
    selector.matchEthDst(ethCriterion.mac());
    treatment.transition(UNICAST_ROUTING_TABLE);
    FlowRule rule = DefaultFlowRule.builder()
            .forDevice(deviceId)
            .withSelector(selector.build())
            .withTreatment(treatment.build())
            .withPriority(DEFAULT_PRIORITY)
            .fromApp(applicationId)
            .makePermanent()
            .forTable(TMAC_TABLE).build();
    return ImmutableList.<FlowRule>builder().add(rule).build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:Ofdpa2Pipeline.java

示例5: registerOnlineFeature

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
@Override
public boolean registerOnlineFeature(ApplicationId applicationId, SimpleTriggerHelperRequester requester) {
    if (applicationId == null) {
        log.warn("applicationId could not be null");
        return false;
    }

    if (requester == null) {
        log.warn("SimpleTriggerHelperRequester could not be null");
        return false;
    }

    TriggerOnlineEventTable triggeredOnlineEventTable =
            new TriggerOnlineEventTable(applicationId, requester.getRequestFeatures());

    triggerOnlineEventTableList.add(triggeredOnlineEventTable);

    return true;

}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:TriggerHelperManager.java

示例6: setUp

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
/**
 * Initialize test related variables.
 *
 * @throws Exception
 */
@Before
public void setUp() throws Exception {
    InputStream jsonStream = SegmentRoutingAppConfigTest.class
            .getResourceAsStream("/app.json");
    InputStream invalidJsonStream = SegmentRoutingAppConfigTest.class
            .getResourceAsStream("/app-invalid.json");

    String key = SegmentRoutingManager.SR_APP_ID;
    ApplicationId subject = new TestApplicationId(key);
    ObjectMapper mapper = new ObjectMapper();
    JsonNode jsonNode = mapper.readTree(jsonStream);
    JsonNode invalidJsonNode = mapper.readTree(invalidJsonStream);
    ConfigApplyDelegate delegate = new MockDelegate();

    config = new SegmentRoutingAppConfig();
    config.init(subject, key, jsonNode, mapper, delegate);
    invalidConfig = new SegmentRoutingAppConfig();
    invalidConfig.init(subject, key, invalidJsonNode, mapper, delegate);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:SegmentRoutingAppConfigTest.java

示例7: printFlows

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
/**
 * Prints flows.
 *
 * @param d     the device
 * @param flows the set of flows for that device
 * @param coreService core system service
 */
protected void printFlows(Device d, List<FlowEntry> flows,
                          CoreService coreService) {
    boolean empty = flows == null || flows.isEmpty();
    print("deviceId=%s, flowRuleCount=%d", d.id(), empty ? 0 : flows.size());
    if (empty || countOnly) {
        return;
    }

    for (FlowEntry f : flows) {
        if (shortOutput) {
            print(SHORT_FORMAT, f.state(), f.bytes(), f.packets(),
                    f.tableId(), f.priority(), f.selector().criteria(),
                    printTreatment(f.treatment()));
        } else {
            ApplicationId appId = coreService.getAppId(f.appId());
            print(LONG_FORMAT, Long.toHexString(f.id().value()), f.state(),
                    f.bytes(), f.packets(), f.life(), f.priority(), f.tableId(),
                    appId != null ? appId.name() : "<none>",
                    f.payLoad() == null ? null : f.payLoad().payLoad().toString(),
                    f.selector().criteria(), f.treatment());
        }
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:31,代码来源:FlowsListCommand.java

示例8: getMaximumPermissions

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
private List<Permission> getMaximumPermissions(ApplicationId appId) {
    Application app = appAdminService.getApplication(appId);
    if (app == null) {
        print("Unknown application.");
        return null;
    }
    List<Permission> appPerms;
    switch (app.role()) {
        case ADMIN:
            appPerms = DefaultPolicyBuilder.getAdminApplicationPermissions(app.permissions());
            break;
        case USER:
            appPerms = DefaultPolicyBuilder.getUserApplicationPermissions(app.permissions());
            break;
        case UNSPECIFIED:
        default:
            appPerms = DefaultPolicyBuilder.getDefaultPerms();
            break;
    }

    return appPerms;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:23,代码来源:SecurityModeManager.java

示例9: updateConfig

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
private void updateConfig() {
    ApplicationId routingAppId =
            coreService.registerApplication(RoutingService.ROUTER_APP_ID);

    RouterConfig config = networkConfigService.getConfig(
            routingAppId, RoutingService.ROUTER_CONFIG_CLASS);

    if (config == null) {
        log.warn("Router config not available");
        return;
    }

    controlPlaneConnectPoint = config.getControlPlaneConnectPoint();
    ospfEnabled = config.getOspfEnabled();
    interfaces = config.getInterfaces();

    updateDevice();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:ControlPlaneRedirectManager.java

示例10: HostToHostIntent

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
/**
 * Creates a new host-to-host intent with the supplied host pair.
 *
 * @param appId       application identifier
 * @param key       intent key
 * @param one         first host
 * @param two         second host
 * @param selector    action
 * @param treatment   ingress port
 * @param constraints optional prioritized list of path selection constraints
 * @param priority    priority to use for flows generated by this intent
 * @throws NullPointerException if {@code one} or {@code two} is null.
 */
private HostToHostIntent(ApplicationId appId, Key key,
                        HostId one, HostId two,
                        TrafficSelector selector,
                        TrafficTreatment treatment,
                        List<Constraint> constraints,
                        int priority) {
    super(appId, key, ImmutableSet.of(one, two), selector, treatment,
          constraints, priority);

    // TODO: consider whether the case one and two are same is allowed
    this.one = checkNotNull(one);
    this.two = checkNotNull(two);

}
 
开发者ID:shlee89,项目名称:athena,代码行数:28,代码来源:HostToHostIntent.java

示例11: StringKey

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
private StringKey(String key, ApplicationId appId) {
    super(HASH_FN.newHasher()
                  .putShort(appId.id())
                  .putString(key, StandardCharsets.UTF_8)
                  .hash().asLong());
    this.key = key;
    this.appId = appId;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:9,代码来源:Key.java

示例12: appId

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
@Override
protected ApplicationId appId() {
    ApplicationId appIdForIntent;
    if (appId == null) {
        appIdForIntent = super.appId();
    } else {
        CoreService service = get(CoreService.class);
        appIdForIntent = service.getAppId(appId);
    }
    return appIdForIntent;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:12,代码来源:ConnectivityIntentCommand.java

示例13: encode

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
@Override
public ObjectNode encode(ApplicationId appId, CodecContext context) {
    checkNotNull(appId, "ApplicationId cannot be null");

    ObjectNode result = context.mapper().createObjectNode()
            .put("id", appId.id())
            .put("name", appId.name());

    return result;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:ApplicationIdCodec.java

示例14: json

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
private JsonNode json(List<ApplicationId> ids) {
    ObjectMapper mapper = new ObjectMapper();
    ArrayNode result = mapper.createArrayNode();
    for (ApplicationId id : ids) {
        result.add(mapper.createObjectNode()
                           .put("id", id.id())
                           .put("name", id.name()));
    }
    return result;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:11,代码来源:ApplicationIdListCommand.java

示例15: OpticalConnectivityIntent

import org.onosproject.core.ApplicationId; //导入依赖的package包/类
/**
 * Creates an optical connectivity intent between the specified
 * connection points.
 *
 * @param appId application identification
 * @param key intent key
 * @param src the source transponder port
 * @param dst the destination transponder port
 * @param signalType signal type
 * @param isBidirectional indicates if intent is unidirectional
 * @param priority priority to use for flows from this intent
 */
protected OpticalConnectivityIntent(ApplicationId appId,
                                    Key key,
                                    ConnectPoint src,
                                    ConnectPoint dst,
                                    OduSignalType signalType,
                                    boolean isBidirectional,
                                    int priority) {
    super(appId, key, Collections.emptyList(), priority);
    this.src = checkNotNull(src);
    this.dst = checkNotNull(dst);
    this.signalType = checkNotNull(signalType);
    this.isBidirectional = isBidirectional;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:OpticalConnectivityIntent.java


注:本文中的org.onosproject.core.ApplicationId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。