/** * Registers all the class registered to given KryoNamespace. * * @param ns KryoNamespace * @return this */ public Builder register(final KryoNamespace ns) { if (blocks.containsAll(ns.registeredBlocks)) { // Everything was already registered. log.debug("Ignoring {}, already registered.", ns); return this; } for (RegistrationBlock block : ns.registeredBlocks) { this.register(block); } return this; }
@Activate public void activate() { eventDispatcher.addSink(PiPipeconfWatchdogEvent.class, listenerRegistry); localStatusMap = Maps.newConcurrentMap(); // Init distributed status map. KryoNamespace.Builder serializer = KryoNamespace.newBuilder() .register(KryoNamespaces.API) .register(PipelineStatus.class); statusMap = storageService.<DeviceId, PipelineStatus>eventuallyConsistentMapBuilder() .withName("onos-pipeconf-status-table") .withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()).build(); statusMap.addListener(new StatusMapListener()); // Register component configurable properties. componentConfigService.registerProperties(getClass()); // Start periodic watchdog task. timer = new Timer(); startProbeTask(); // Add device listener. deviceService.addListener(deviceListener); log.info("Started"); }
@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"); }
.withSerializer(Serializer.using( new KryoNamespace.Builder() .register(KryoNamespaces.API) .register(LabelResourceId.class) .build())) .build(); .withSerializer(Serializer.using( new KryoNamespace.Builder() .register(KryoNamespaces.API) .register(Link.class, LabelResource.class, LabelResourceId.class) .withSerializer(Serializer.using( new KryoNamespace.Builder() .register(KryoNamespaces.API) .register(TunnelId.class, DefaultLspLocalLabelInfo.class, LabelResourceId.class,
@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"); }
@Activate public void activate() { appId = coreService.registerApplication(VTNRSC_APP); eventDispatcher.addSink(VirtualPortEvent.class, listenerRegistry); vPortStore = storageService.<VirtualPortId, VirtualPort>eventuallyConsistentMapBuilder() .withName(VIRTUALPORT) .withSerializer(KryoNamespace.newBuilder().register(KryoNamespaces.API) .register(MultiValuedTimestamp.class) .register(VirtualPortId.class, TenantNetworkId.class, VirtualPort.State.class, TenantId.class, AllowedAddressPair.class, FixedIp.class, BindingHostId.class, SecurityGroup.class, SubnetId.class, IpAddress.class, DefaultVirtualPort.class)) .withTimestampProvider((k, v) ->new WallClockTimestamp()) .build(); vPortStore.addListener(virtualPortListener); log.info("Started"); }
@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"); }
@Activate public void activate() { appId = coreService.registerApplication(APP_ID); nshSpiIdGenerator = coreService.getIdGenerator(nshSpiIdTopic); vtnRscService.addListener(vtnRscListener); KryoNamespace.Builder serializer = KryoNamespace .newBuilder() .register(PortChainId.class, UUID.class, FiveTuple.class, IpAddress.class, PortNumber.class, DefaultFiveTuple.class, IpAddress.Version.class, TenantId.class); nshSpiPortChainMap = storageService.<PortChainId, Integer>eventuallyConsistentMapBuilder() .withName("nshSpiPortChainMap").withSerializer(serializer) .withTimestampProvider((k, v) ->new WallClockTimestamp()).build(); portChainFiveTupleMap = storageService.<PortChainId, List<FiveTuple>>eventuallyConsistentMapBuilder() .withName("portChainFiveTupleMap").withSerializer(serializer) .withTimestampProvider((k, v) ->new WallClockTimestamp()).build(); nshSpiIdFreeList = storageService.<Integer>setBuilder() .withName("nshSpiIdDeletedList") .withSerializer(Serializer.using(KryoNamespaces.API)) .build() .asDistributedSet(); packetService.addProcessor(processor, PacketProcessor.director(SFC_PRIORITY)); log.info("Started"); }
@Activate public void activate() { appId = coreService.registerApplication(VTNRSC_APP); KryoNamespace.Builder serializer = KryoNamespace .newBuilder() .register(KryoNamespaces.API) .register(Router.class, RouterId.class, DefaultRouter.class, TenantNetworkId.class, TenantId.class, VirtualPortId.class, DefaultRouter.class, RouterGateway.class, Router.Status.class, SubnetId.class, FixedIp.class); routerStore = storageService .<RouterId, Router>eventuallyConsistentMapBuilder() .withName(ROUTER).withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()) .build(); routerStore.addListener(routerListener); log.info("Started"); }
@Activate protected void activate() { tunnelInfoMap = storageService.<TunnelId, ResourceConsumer>consistentMapBuilder() .withName("onos-pce-tunnelinfomap") .withSerializer(Serializer.using( new KryoNamespace.Builder() .register(KryoNamespaces.API) .register(TunnelId.class, TunnelConsumerId.class) .build())) .build(); failedPathSet = storageService.<PcePathInfo>setBuilder() .withName("failed-path-info") .withSerializer(SERIALIZER) .build() .asDistributedSet(); tunnelNameExplicitPathInfoMap = storageService.<String, List<ExplicitPathInfo>>consistentMapBuilder() .withName("onos-pce-explicitpathinfo") .withSerializer(Serializer.using( new KryoNamespace.Builder() .register(KryoNamespaces.API) .register(ExplicitPathInfo.class) .register(ExplicitPathInfo.Type.class) .build())) .build(); log.info("Started"); }
@Activate public void activate() { appId = coreService.registerApplication(VTNRSC_APP); KryoNamespace.Builder serializer = KryoNamespace .newBuilder() .register(KryoNamespaces.API) .register(Router.class, RouterId.class, DefaultRouter.class, TenantNetworkId.class, TenantId.class, VirtualPortId.class, DefaultRouter.class, RouterGateway.class, Router.Status.class, SubnetId.class, FixedIp.class); routerStore = storageService .<RouterId, Router>eventuallyConsistentMapBuilder() .withName(ROUTER).withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()) .build(); routerStore.addListener(routerListener); log.info("Started"); }
@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"); }
@Activate protected void activate() { eventDispatcher.addSink(FlowClassifierEvent.class, listenerRegistry); KryoNamespace.Builder serializer = KryoNamespace.newBuilder() .register(KryoNamespaces.API) .register(MultiValuedTimestamp.class) .register(FlowClassifier.class, FlowClassifierId.class, UUID.class, IpPrefix.class, VirtualPortId.class, DefaultFlowClassifier.class, TenantId.class); flowClassifierStore = storageService .<FlowClassifierId, FlowClassifier>eventuallyConsistentMapBuilder() .withName("flowclassifierstore").withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()).build(); flowClassifierStore.addListener(flowClassifierListener); log.info("Flow Classifier service activated"); }
@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"); }
@Activate public void activate() { eventDispatcher.addSink(PortPairEvent.class, listenerRegistry); KryoNamespace.Builder serializer = KryoNamespace.newBuilder() .register(KryoNamespaces.API) .register(MultiValuedTimestamp.class) .register(PortPair.class, PortPairId.class, UUID.class, DefaultPortPair.class, TenantId.class); portPairStore = storageService.<PortPairId, PortPair>eventuallyConsistentMapBuilder() .withName("portpairstore") .withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()) .build(); portPairStore.addListener(portPairListener); log.info("Started"); }
@Activate public void activate() { eventDispatcher.addSink(PortPairEvent.class, listenerRegistry); KryoNamespace.Builder serializer = KryoNamespace.newBuilder() .register(KryoNamespaces.API) .register(MultiValuedTimestamp.class) .register(PortPair.class, PortPairId.class, UUID.class, DefaultPortPair.class, TenantId.class); portPairStore = storageService.<PortPairId, PortPair>eventuallyConsistentMapBuilder() .withName("portpairstore") .withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()) .build(); portPairStore.addListener(portPairListener); log.info("Started"); }
@Activate protected void activate() { eventDispatcher.addSink(FlowClassifierEvent.class, listenerRegistry); KryoNamespace.Builder serializer = KryoNamespace.newBuilder() .register(KryoNamespaces.API) .register(MultiValuedTimestamp.class) .register(FlowClassifier.class, FlowClassifierId.class, UUID.class, IpPrefix.class, VirtualPortId.class, DefaultFlowClassifier.class, TenantId.class); flowClassifierStore = storageService .<FlowClassifierId, FlowClassifier>eventuallyConsistentMapBuilder() .withName("flowclassifierstore").withSerializer(serializer) .withTimestampProvider((k, v) -> new WallClockTimestamp()).build(); flowClassifierStore.addListener(flowClassifierListener); log.info("Flow Classifier service activated"); }
@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"); }
@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"); }
@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"); }