Exemplo n.º 1
0
 @Override
 public Iterable<FlowRule> getFlowRulesByGroupId(ApplicationId appId, short groupId) {
   return flows
       .stream()
       .filter(flow -> flow.appId() == appId.id() && flow.groupId().id() == groupId)
       .collect(Collectors.toList());
 }
Exemplo n.º 2
0
 @Before
 public void setUpIntentService() {
   final IntentService mockIntentService = new IntentServiceAdapter();
   context.registerService(IntentService.class, mockIntentService);
   context.registerService(CoreService.class, mockCoreService);
   expect(mockCoreService.getAppId(appId.name())).andReturn(appId);
   replay(mockCoreService);
 }
Exemplo n.º 3
0
  @Deactivate
  protected void deactivate() {
    leadershipService.removeListener(leadershipListener);
    leadershipService.withdraw(appId.name());

    configRegistry.unregisterConfigFactory(configFactory);
    configService.removeListener(configListener);
  }
Exemplo n.º 4
0
 @Activate
 public void activate() {
   String nodeId = clusterService.getLocalNode().ip().toString();
   appId = coreService.registerApplication("org.onosproject.demo.installer." + nodeId);
   worker =
       Executors.newFixedThreadPool(
           1, new ThreadFactoryBuilder().setNameFormat("demo-app-worker").build());
   log.info("Started with Application ID {}", appId.id());
 }
  @Activate
  public void activate(ComponentContext context) {
    cfgService.registerProperties(getClass());
    appId = coreService.registerApplication("org.onosproject.fwd");

    packetService.addProcessor(processor, PacketProcessor.ADVISOR_MAX + 2);
    readComponentConfiguration(context);
    requestPackests();

    log.info("Started with Application ID {}", appId.id());
  }
Exemplo n.º 6
0
  @Before
  public void setUp() {

    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication(appId.name())).andReturn(appId).anyTimes();
    replay(coreService);

    provider.cfgService = new ComponentConfigAdapter();
    provider.coreService = coreService;

    provider.providerRegistry = hostRegistry;
    provider.topologyService = topoService;
    provider.packetService = packetService;
    provider.deviceService = deviceService;
    provider.hostService = hostService;

    provider.activate(CTX_FOR_NO_REMOVE);
  }
Exemplo n.º 7
0
 @Override
 public Iterable<FlowRule> getFlowRulesById(ApplicationId id) {
   return flows.stream().filter(flow -> flow.appId() == id.id()).collect(Collectors.toList());
 }
Exemplo n.º 8
0
 @Deactivate
 public void deactivate() {
   log.info("Mao Stopped, id: {}, name: {}", appId.id(), appId.name());
 }
Exemplo n.º 9
0
 @Activate
 public void activate(ComponentContext context) {
   appId = coreSerivice.registerApplication("org.onosproject.Mao.Mao-Ether-igmp");
   log.info("Mao Started, id: {}, name: {}", appId.id(), appId.name());
 }
Exemplo n.º 10
0
 @Override
 public int compare(ApplicationId id1, ApplicationId id2) {
   return id1.id() - id2.id();
 }