protected void init(DeviceId deviceId, PipelinerContext context) { this.deviceId = deviceId; this.flowObjectiveStore = context.store(); this.serviceDirectory = context.directory(); this.groupService = serviceDirectory.get(GroupService.class); this.storageService = serviceDirectory.get(StorageService.class); this.nextIndex = storageService.getAtomicCounter("group-id-index-counter"); pendingAddNextObjectives = CacheBuilder.newBuilder() .expireAfterWrite(20, TimeUnit.SECONDS) .removalListener(( RemovalNotification<GroupKey, List<OfdpaNextGroup>> notification) -> { if (notification.getCause() == RemovalCause.EXPIRED) { notification.getValue().forEach(ofdpaNextGrp -> Ofdpa2Pipeline.fail(ofdpaNextGrp.nextObj, ObjectiveError.GROUPINSTALLATIONFAILED)); } }).build(); pendingRemoveNextObjectives = CacheBuilder.newBuilder() .expireAfterWrite(20, TimeUnit.SECONDS) .removalListener(( RemovalNotification<NextObjective, List<GroupKey>> notification) -> { if (notification.getCause() == RemovalCause.EXPIRED) { Ofdpa2Pipeline.fail(notification.getKey(), ObjectiveError.GROUPREMOVALFAILED); } }).build(); pendingGroups = new ConcurrentHashMap<>(); groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500, TimeUnit.MILLISECONDS); groupService.addListener(new InnerGroupListener()); }
@Override public void init(DeviceId deviceId, PipelinerContext context) { log.debug("Initiate OLT pipeline"); this.serviceDirectory = context.directory(); this.deviceId = deviceId; flowRuleService = serviceDirectory.get(FlowRuleService.class); coreService = serviceDirectory.get(CoreService.class); groupService = serviceDirectory.get(GroupService.class); flowObjectiveStore = context.store(); storageService = serviceDirectory.get(StorageService.class); appId = coreService.registerApplication( "org.onosproject.driver.OLTPipeline"); pendingGroups = CacheBuilder.newBuilder() .expireAfterWrite(20, TimeUnit.SECONDS) .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> { if (notification.getCause() == RemovalCause.EXPIRED) { fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED); } }).build(); groupService.addListener(new InnerGroupListener()); }
@Override public void init(DeviceId deviceId, PipelinerContext context) { this.serviceDirectory = context.directory(); this.deviceId = deviceId; pendingGroups = CacheBuilder.newBuilder() .expireAfterWrite(20, TimeUnit.SECONDS) .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> { if (notification.getCause() == RemovalCause.EXPIRED) { fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED); } }).build(); groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500, TimeUnit.MILLISECONDS); coreService = serviceDirectory.get(CoreService.class); flowRuleService = serviceDirectory.get(FlowRuleService.class); groupService = serviceDirectory.get(GroupService.class); flowObjectiveStore = context.store(); groupService.addListener(new InnerGroupListener()); appId = coreService.registerApplication( "org.onosproject.driver.CentecV350Pipeline"); initializePipeline(); }
@Override public void init(DeviceId deviceId, PipelinerContext context) { this.serviceDirectory = context.directory(); this.deviceId = deviceId; pendingGroups = CacheBuilder .newBuilder() .expireAfterWrite(20, TimeUnit.SECONDS) .removalListener((RemovalNotification<GroupKey, NextObjective> notification) -> { if (notification.getCause() == RemovalCause.EXPIRED) { fail(notification.getValue(), ObjectiveError.GROUPINSTALLATIONFAILED); } }).build(); groupChecker.scheduleAtFixedRate(new GroupChecker(), 0, 500, TimeUnit.MILLISECONDS); coreService = serviceDirectory.get(CoreService.class); flowRuleService = serviceDirectory.get(FlowRuleService.class); groupService = serviceDirectory.get(GroupService.class); flowObjectiveStore = context.store(); groupService.addListener(new InnerGroupListener()); appId = coreService .registerApplication("org.onosproject.driver.SpringOpenTTP"); setTableMissEntries(); log.info("Spring Open TTP driver initialized"); }
groupService.addListener(listener); try { group = groupService.getGroup(deviceId, groupKey);