use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class DomainIdCompleter method complete.
@Override
public int complete(Session session, CommandLine commandLine, List<String> candidates) {
// Delegate string completer
StringsCompleter delegate = new StringsCompleter();
// Fetch our service and feed it's offerings to the string completer
DomainService service = AbstractShellCommand.get(DomainService.class);
Iterator<DomainId> it = service.getDomainIds().iterator();
SortedSet<String> strings = delegate.getStrings();
while (it.hasNext()) {
strings.add(it.next().id());
}
// Now let the completer do the work for figuring out what to offer.
return delegate.complete(session, commandLine, candidates);
}
use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class LinkCollectionEncapIntentCompilerTest method setUp.
@Before
public void setUp() {
sut = new LinkCollectionIntentCompiler();
coreService = createMock(CoreService.class);
expect(coreService.registerApplication("org.onosproject.net.intent")).andReturn(appId);
sut.coreService = coreService;
domainService = createMock(DomainService.class);
expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes();
sut.domainService = domainService;
super.setUp();
intentExtensionService = createMock(IntentExtensionService.class);
intentExtensionService.registerCompiler(LinkCollectionIntent.class, sut);
intentExtensionService.unregisterCompiler(LinkCollectionIntent.class);
registrator = new IntentConfigurableRegistrator();
registrator.extensionService = intentExtensionService;
registrator.cfgService = new ComponentConfigAdapter();
registrator.activate();
sut.registrator = registrator;
sut.resourceService = new MockResourceService();
LinkCollectionCompiler.optimizeInstructions = false;
LinkCollectionCompiler.copyTtl = false;
replay(coreService, domainService, intentExtensionService);
}
use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class LinkCollectionIntentFlowObjectiveCompilerTest method setUp.
@Before
public void setUp() {
compiler = new LinkCollectionIntentFlowObjectiveCompiler();
coreService = createMock(CoreService.class);
expect(coreService.registerApplication("org.onosproject.net.intent")).andReturn(appId);
flowObjectiveService = new FlowObjectiveServiceAdapter();
resourceService = new MockResourceService();
compiler.coreService = coreService;
compiler.flowObjectiveService = flowObjectiveService;
domainService = createMock(DomainService.class);
expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes();
compiler.domainService = domainService;
super.setUp();
intentExtensionService = createMock(IntentExtensionService.class);
intentExtensionService.registerCompiler(LinkCollectionIntent.class, compiler);
intentExtensionService.unregisterCompiler(LinkCollectionIntent.class);
registrator = new IntentConfigurableRegistrator();
registrator.extensionService = intentExtensionService;
registrator.cfgService = new ComponentConfigAdapter();
registrator.activate();
compiler.registrator = registrator;
compiler.resourceService = resourceService;
LinkCollectionCompiler.optimizeInstructions = false;
LinkCollectionCompiler.copyTtl = false;
replay(coreService, domainService, intentExtensionService);
compiler.activate();
}
use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class GetDomainsCommand method doExecute.
@Override
public void doExecute() {
DomainService domainService = AbstractShellCommand.get(DomainService.class);
Set<DomainId> domainIds = domainService.getDomainIds();
domainIds.forEach(domainId -> print("%s", domainId.id()));
}
use of org.onosproject.net.domain.DomainService in project onos by opennetworkinglab.
the class LinkCollectionIntentCompilerP2PTest method setUp.
@Before
public void setUp() {
sut = new LinkCollectionIntentCompiler();
coreService = createMock(CoreService.class);
expect(coreService.registerApplication("org.onosproject.net.intent")).andReturn(appId);
sut.coreService = coreService;
domainService = createMock(DomainService.class);
expect(domainService.getDomain(anyObject(DeviceId.class))).andReturn(LOCAL).anyTimes();
sut.domainService = domainService;
super.setUp();
intentExtensionService = createMock(IntentExtensionService.class);
intentExtensionService.registerCompiler(LinkCollectionIntent.class, sut);
intentExtensionService.unregisterCompiler(LinkCollectionIntent.class);
registrator = new IntentConfigurableRegistrator();
registrator.extensionService = intentExtensionService;
registrator.cfgService = new ComponentConfigAdapter();
registrator.activate();
sut.registrator = registrator;
sut.resourceService = new MockResourceService();
LinkCollectionCompiler.optimizeInstructions = false;
LinkCollectionCompiler.copyTtl = false;
replay(coreService, domainService, intentExtensionService);
}
Aggregations