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


Java TenantId类代码示例

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


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

示例1: activate

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Activate
public void activate() {

    appId = coreService.registerApplication(VTNRSC_APP);

    networkIdAsKeyStore = storageService.<TenantNetworkId, TenantNetwork>consistentMapBuilder()
            .withName(TENANTNETWORK)
            .withApplicationId(appId)
            .withPurgeOnUninstall()
            .withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
                                             TenantNetworkId.class,
                                             DefaultTenantNetwork.class,
                                             TenantNetwork.State.class,
                                             TenantId.class,
                                             TenantNetwork.Type.class,
                                             PhysicalNetwork.class,
                                             SegmentationId.class))
            .build().asJavaMap();

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:TenantNetworkManager.java

示例2: activate

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Activate
public void activate() {
    appId = coreService.registerApplication(VTNRSC_APP);
    KryoNamespace.Builder serializer = KryoNamespace
            .newBuilder()
            .register(KryoNamespaces.API)
            .register(RouterId.class, TenantId.class, VirtualPortId.class,
                      RouterInterface.class, SubnetId.class);
    routerInterfaceStore = storageService
            .<SubnetId, RouterInterface>eventuallyConsistentMapBuilder()
            .withName(ROUTER_INTERFACE).withSerializer(serializer)
            .withTimestampProvider((k, v) -> new WallClockTimestamp())
            .build();
    routerInterfaceStore.addListener(routerInterfaceListener);
    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:RouterInterfaceManager.java

示例3: activate

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Activate
public void activate() {
    appId = coreService.registerApplication(VTNRSC_APP);
    KryoNamespace.Builder serializer = KryoNamespace
            .newBuilder()
            .register(KryoNamespaces.API)
            .register(FloatingIp.class, FloatingIpId.class,
                      TenantNetworkId.class, TenantId.class,
                      FloatingIp.Status.class, RouterId.class,
                      VirtualPortId.class, DefaultFloatingIp.class,
                      UUID.class);
    floatingIpStore = storageService
            .<FloatingIpId, FloatingIp>eventuallyConsistentMapBuilder()
            .withName(FLOATINGIPSTORE).withSerializer(serializer)
            .withTimestampProvider((k, v) -> new WallClockTimestamp())
            .build();
    floatingIpBindStore = storageService
            .<FloatingIpId, FloatingIp>eventuallyConsistentMapBuilder()
            .withName(FLOATINGIPBINDSTORE).withSerializer(serializer)
            .withTimestampProvider((k, v) -> new WallClockTimestamp())
            .build();
    floatingIpStore.addListener(floatingIpListener);
    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:FloatingIpManager.java

示例4: fixedIpIsUsed

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
public boolean fixedIpIsUsed(IpAddress fixedIpAddr, TenantId tenantId,
                             FloatingIpId floatingIpId) {
    checkNotNull(fixedIpAddr, "Fixed IP address cannot be null");
    checkNotNull(tenantId, "Tenant Id cannot be null");
    checkNotNull(floatingIpId, "Floating IP Id cannot be null");
    Collection<FloatingIp> floatingIps = getFloatingIps();
    for (FloatingIp floatingIp : floatingIps) {
        IpAddress fixedIp = floatingIp.fixedIp();
        if (fixedIp != null) {
            if (fixedIp.equals(fixedIpAddr)
                    && floatingIp.tenantId().equals(tenantId)
                    && !floatingIp.id().equals(floatingIpId)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:FloatingIpManager.java

示例5: activate

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Activate
public void activate() {

    appId = coreService.registerApplication(VTNRSC_APP);

    subnetStore = storageService.<SubnetId, Subnet>consistentMapBuilder()
            .withName(SUBNET)
            .withApplicationId(appId)
            .withPurgeOnUninstall()
            .withSerializer(Serializer.using(Arrays.asList(KryoNamespaces.API),
                                             Subnet.class,
                                             SubnetId.class,
                                             TenantNetworkId.class,
                                             TenantId.class,
                                             HostRoute.class,
                                             DefaultHostRoute.class,
                                             Subnet.Mode.class,
                                             AllocationPool.class,
                                             DefaultAllocationPool.class,
                                             DefaultSubnet.class,
                                             IpAddress.Version.class))
            .build().asJavaMap();

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:SubnetManager.java

示例6: isLastSFHostOfTenant

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
/**
 * Checks whether the last Service Function host of a specific tenant in
 * this device.
 *
 * @param host the host on device
 * @param deviceId the device identifier
 * @param tenantId the tenant identifier
 * @return true or false
 */
private boolean isLastSFHostOfTenant(Host host, DeviceId deviceId,
                                     TenantId tenantId) {
    Set<Host> hostSet = hostService.getConnectedHosts(deviceId);
    if (hostSet != null) {
        for (Host h : hostSet) {
            String ifaceId = h.annotations().value(IFACEID);
            if (ifaceId != null) {
                VirtualPortId hPortId = VirtualPortId.portId(ifaceId);
                if (virtualPortService.getPort(hPortId).tenantId().tenantId()
                        .equals(tenantId.tenantId())
                        && isServiceFunction(hPortId)) {
                    if (!h.equals(host)) {
                        return false;
                    }
                }
            }
        }
    }
    return true;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:VtnRscManager.java

示例7: isLastClassifierHostOfTenant

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
/**
 * Checks whether the last Classifier host of a specific tenant in this
 * device.
 *
 * @param host the host on device
 * @param deviceId the device identifier
 * @param tenantId the tenant identifier
 * @return true or false
 */
private boolean isLastClassifierHostOfTenant(Host host, DeviceId deviceId,
                                             TenantId tenantId) {
    Set<Host> hostSet = hostService.getConnectedHosts(deviceId);
    if (hostSet != null) {
        for (Host h : hostSet) {
            String ifaceId = h.annotations().value(IFACEID);
            if (ifaceId != null) {
                VirtualPortId hPortId = VirtualPortId.portId(ifaceId);
                if (virtualPortService.getPort(hPortId).tenantId().tenantId()
                        .equals(tenantId.tenantId())
                        && !isServiceFunction(hPortId)) {
                    if (!h.equals(host)) {
                        return false;
                    }
                }
            }
        }
    }
    return true;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:30,代码来源:VtnRscManager.java

示例8: activate

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Activate
public void activate() {

    eventDispatcher.addSink(PortChainEvent.class, listenerRegistry);

    KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
            .register(KryoNamespaces.API)
            .register(MultiValuedTimestamp.class)
            .register(PortChain.class, PortChainId.class, UUID.class, PortPairGroupId.class,
                      FlowClassifierId.class, FiveTuple.class, LoadBalanceId.class, DeviceId.class,
                      DefaultPortChain.class, PortPairId.class, TenantId.class);

    portChainStore = storageService
            .<PortChainId, PortChain>eventuallyConsistentMapBuilder()
            .withName("portchainstore").withSerializer(serializer)
            .withTimestampProvider((k, v) -> new WallClockTimestamp()).build();

    portChainStore.addListener(portChainListener);

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:PortChainManager.java

示例9: activate

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Activate
public void activate() {
    eventDispatcher.addSink(PortPairGroupEvent.class, listenerRegistry);
    KryoNamespace.Builder serializer = KryoNamespace.newBuilder()
            .register(KryoNamespaces.API)
            .register(MultiValuedTimestamp.class)
            .register(PortPairGroup.class, PortPairGroupId.class, UUID.class, DefaultPortPairGroup.class,
                      TenantId.class, PortPairId.class);

    portPairGroupStore = storageService
            .<PortPairGroupId, PortPairGroup>eventuallyConsistentMapBuilder()
            .withName("portpairgroupstore").withSerializer(serializer)
            .withTimestampProvider((k, v) -> new WallClockTimestamp()).build();

    portPairGroupStore.addListener(portPairGroupListener);

    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:PortPairGroupManager.java

示例10: execute

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
protected void execute() {
    TenantNetworkService service = get(TenantNetworkService.class);
    TenantNetwork network = new DefaultTenantNetwork(TenantNetworkId.networkId(id), name,
                                                     adminStateUp,
                                                     TenantNetwork.State.valueOf(state),
                                                     shared, TenantId.tenantId(tenantID),
                                                     routerExternal,
                                                     TenantNetwork.Type.valueOf(type),
                                                     PhysicalNetwork.physicalNetwork(physicalNetwork),
                                                     SegmentationId.segmentationId(segmentationID));

    Set<TenantNetwork> networksSet = Sets.newHashSet();
    networksSet.add(network);
    service.updateNetworks(networksSet);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:17,代码来源:TenantNetworkUpdateCommand.java

示例11: execute

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
protected void execute() {
    FloatingIpService service = get(FloatingIpService.class);
    try {
        FloatingIp floatingIpObj = new DefaultFloatingIp(
                                                      FloatingIpId.of(id),
                                                      TenantId.tenantId(tenantId),
                                                      TenantNetworkId.networkId(networkId),
                                                      VirtualPortId.portId(portId),
                                                      RouterId.valueOf(routerId),
                                                      floatingIp == null ? null : IpAddress.valueOf(floatingIp),
                                                      fixedIp == null ? null : IpAddress.valueOf(fixedIp),
                                                      status == null ? Status.ACTIVE
                                                                     : Status.valueOf(status));
        Set<FloatingIp> floatingIpSet = Sets.newHashSet(floatingIpObj);
        service.createFloatingIps(floatingIpSet);
    } catch (Exception e) {
        print(null, e.getMessage());
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:FloatingIpCreateCommand.java

示例12: execute

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
protected void execute() {
    SubnetService service = get(SubnetService.class);
    if (id == null || networkId == null || tenantId == null) {
        print("id,networkId,tenantId can not be null");
        return;
    }
    Subnet subnet = new DefaultSubnet(SubnetId.subnetId(id), subnetName,
                                      TenantNetworkId.networkId(networkId),
                                      TenantId.tenantId(tenantId), ipVersion,
                                      cidr == null ? null : IpPrefix.valueOf(cidr),
                                      gatewayIp == null ? null : IpAddress.valueOf(gatewayIp),
                                      dhcpEnabled, shared, hostRoutes,
                                      ipV6AddressMode == null ? null : Mode.valueOf(ipV6AddressMode),
                                      ipV6RaMode == null ? null : Mode.valueOf(ipV6RaMode),
                                      allocationPools);

    Set<Subnet> subnetsSet = Sets.newHashSet(subnet);
    service.createSubnets(subnetsSet);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:SubnetCreateCommand.java

示例13: execute

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
protected void execute() {
    SubnetService service = get(SubnetService.class);
    if (id == null || networkId == null || tenantId == null) {
        print("id,networkId,tenantId can not be null");
        return;
    }
    Subnet subnet = new DefaultSubnet(SubnetId.subnetId(id), subnetName,
                                      TenantNetworkId.networkId(networkId),
                                      TenantId.tenantId(tenantId), ipVersion,
                                      cidr == null ? null : IpPrefix.valueOf(cidr),
                                      gatewayIp == null ? null : IpAddress.valueOf(gatewayIp),
                                      dhcpEnabled, shared, hostRoutes,
                                      ipV6AddressMode == null ? null : Mode.valueOf(ipV6AddressMode),
                                      ipV6RaMode == null ? null : Mode.valueOf(ipV6RaMode),
                                      allocationPools);
    Set<Subnet> subnetsSet = Sets.newHashSet();
    subnetsSet.add(subnet);
    service.updateSubnets(subnetsSet);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:SubnetUpdateCommand.java

示例14: execute

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
protected void execute() {
    Map<String, String> strMap = Maps.newHashMap();
    strMap.putIfAbsent("name", name);
    strMap.putIfAbsent("deviceOwner", deviceOwner);
    strMap.putIfAbsent("bindingvnicType", bindingvnicType);
    strMap.putIfAbsent("bindingvifType", bindingvifType);
    strMap.putIfAbsent("bindingvnicDetails", bindingvnicDetails);
    VirtualPortService service = get(VirtualPortService.class);
    VirtualPort virtualPort = new DefaultVirtualPort(VirtualPortId.portId(id),
                                   TenantNetworkId.networkId(networkId),
                                   false, strMap, VirtualPort.State.ACTIVE,
                                   MacAddress.valueOf(macAddress),
                                   TenantId.tenantId(tenantId),
                                   DeviceId.deviceId(deviceId), Sets.newHashSet(fixedIp),
                                   BindingHostId.bindingHostId(bindingHostId),
                                   allowedAddressPairs, securityGroups);
    Set<VirtualPort> virtualPorts = Sets.newHashSet(virtualPort);
    service.createPorts(virtualPorts);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:VirtualPortCreateCommand.java

示例15: execute

import org.onosproject.vtnrsc.TenantId; //导入依赖的package包/类
@Override
protected void execute() {
    VirtualPortService service = get(VirtualPortService.class);
    Map<String, String> strMap = Maps.newHashMap();
    strMap.putIfAbsent("name", name);
    strMap.putIfAbsent("deviceOwner", deviceOwner);
    strMap.putIfAbsent("bindingvnicType", bindingvnicType);
    strMap.putIfAbsent("bindingvifType", bindingvifType);
    strMap.putIfAbsent("bindingvnicDetails", bindingvnicDetails);
    VirtualPort virtualPort = new DefaultVirtualPort(VirtualPortId.portId(id),
                                                     TenantNetworkId.networkId(networkId),
                                                     false, strMap, VirtualPort.State.ACTIVE,
                                                     MacAddress.valueOf(macAddress),
                                                     TenantId.tenantId(tenantId),
                                                     DeviceId.deviceId(deviceId), Sets.newHashSet(fixedIp),
                                                     BindingHostId.bindingHostId(bindingHostId),
                                                     allowedAddressPairs, securityGroups);
    Set<VirtualPort> virtualPorts = Sets.newHashSet(virtualPort);
    service.updatePorts(virtualPorts);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:21,代码来源:VirtualPortUpdateCommand.java


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