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


Java Intent.bindIdGenerator方法代码示例

本文整理汇总了Java中org.onosproject.net.intent.Intent.bindIdGenerator方法的典型用法代码示例。如果您正苦于以下问题:Java Intent.bindIdGenerator方法的具体用法?Java Intent.bindIdGenerator怎么用?Java Intent.bindIdGenerator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.onosproject.net.intent.Intent的用法示例。


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

示例1: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    provider = new PtToPtIntentVirtualNetworkProvider();
    provider.providerRegistry = virtualNetworkRegistry;
    final CoreService mockCoreService = createMock(CoreService.class);
    provider.coreService = mockCoreService;
    expect(mockCoreService.registerApplication(PtToPtIntentVirtualNetworkProvider.PTPT_INTENT_APPID))
            .andReturn(APP_ID).anyTimes();
    replay(mockCoreService);
    Intent.unbindIdGenerator(idGenerator);
    Intent.bindIdGenerator(idGenerator);

    intentService.addListener(listener);
    provider.intentService = intentService;

    // Register a compiler and an installer both setup for success.
    intentExtensionService = intentService;
    intentExtensionService.registerCompiler(PointToPointIntent.class, compiler);

    provider.activate();
    created = new Semaphore(0, true);
    removed = new Semaphore(0, true);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:24,代码来源:PtToPtIntentVirtualNetworkProviderTest.java

示例2: activate

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Activate
public void activate() {
    configService.registerProperties(getClass());

    intentInstaller.init(store, trackerService, flowRuleService, flowObjectiveService);
    if (skipReleaseResourcesOnWithdrawal) {
        store.setDelegate(testOnlyDelegate);
    } else {
        store.setDelegate(delegate);
    }
    trackerService.setDelegate(topoDelegate);
    eventDispatcher.addSink(IntentEvent.class, listenerRegistry);
    batchExecutor = newSingleThreadExecutor(groupedThreads("onos/intent", "batch", log));
    workerExecutor = newFixedThreadPool(numThreads, groupedThreads("onos/intent", "worker-%d", log));
    idGenerator = coreService.getIdGenerator("intent-ids");
    Intent.bindIdGenerator(idGenerator);
    log.info("Started");
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:IntentManager.java

示例3: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    service = new MockIntentService();
    store = new SimpleIntentStore();
    cleanup = new IntentCleanup();
    idGenerator = new MockIdGenerator();

    cleanup.cfgService = new ComponentConfigAdapter();
    cleanup.service = service;
    cleanup.store = store;
    cleanup.period = 10;
    cleanup.retryThreshold = 3;
    cleanup.activate();

    assertTrue("store should be empty",
               Sets.newHashSet(cleanup.store.getIntents()).isEmpty());

    Intent.bindIdGenerator(idGenerator);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:20,代码来源:IntentCleanupTest.java

示例4: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    processor = createMock(IntentProcessor.class);
    version = createMock(Timestamp.class);

    idGenerator = new MockIdGenerator();

    Intent.bindIdGenerator(idGenerator);

    // Intent creation should be placed after binding an ID generator
    input = PointToPointIntent.builder()
            .appId(appId)
            .selector(selector)
            .treatment(treatment)
            .ingressPoint(cp1)
            .egressPoint(cp3)
            .build();
    compiled = PathIntent.builder()
            .appId(appId)
            .selector(selector)
            .treatment(treatment)
            .path(path)
            .build();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:25,代码来源:CompilingTest.java

示例5: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    service = createMock(IntentService.class);
    store = new SimpleIntentStore();
    cleanup = new IntentCleanup();
    idGenerator = new MockIdGenerator();

    service.addListener(cleanup);
    expectLastCall().once();
    replay(service);

    cleanup.cfgService = new ComponentConfigAdapter();
    cleanup.service = service;
    cleanup.store = store;
    cleanup.period = 1000;
    cleanup.retryThreshold = 3;
    cleanup.activate();

    verify(service);
    reset(service);

    assertTrue("store should be empty",
               Sets.newHashSet(cleanup.store.getIntents()).isEmpty());

    Intent.bindIdGenerator(idGenerator);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:27,代码来源:IntentCleanupTestMock.java

示例6: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    sut = new OpticalPathIntentCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent"))
            .andReturn(appId);
    sut.coreService = coreService;

    Intent.bindIdGenerator(idGenerator);

    intent = OpticalPathIntent.builder()
            .appId(appId)
            .src(d1p1)
            .dst(d3p1)
            .path(new DefaultPath(PID, links, hops))
            .lambda(createLambda())
            .signalType(OchSignalType.FIXED_GRID)
            .build();
    intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(OpticalPathIntent.class, sut);
    intentExtensionService.unregisterCompiler(OpticalPathIntent.class);
    sut.intentManager = intentExtensionService;

    replay(coreService, intentExtensionService);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:26,代码来源:OpticalPathIntentCompilerTest.java

示例7: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    AbstractProjectableModel.setDriverService(null, new MockDriverService());
    sut =  new OpticalOduIntentCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent"))
            .andReturn(appId);
    sut.coreService = coreService;
    sut.deviceService = new MockDeviceService();
    sut.resourceService = new MockResourceService();
    sut.topologyService = new MockTopologyService();

    Intent.bindIdGenerator(idGenerator);

    intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(OpticalOduIntent.class, sut);
    intentExtensionService.unregisterCompiler(OpticalOduIntent.class);
    sut.intentManager = intentExtensionService;

    replay(coreService, intentExtensionService);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:22,代码来源:OpticalOduIntentCompilerTest.java

示例8: localSetup

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
/**
 * Creates mock intents used by the test.
 */
@Before
public void localSetup() {
    mockGenerator = new MockIdGenerator();
    Intent.bindIdGenerator(mockGenerator);

    intent1 = new MockIntent(1L);
    intent2 = new MockIntent(2L);
    intent3 = new MockIntent(3L);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:13,代码来源:IntentAccumulatorTest.java

示例9: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
/**
 * Initialization shared by all test cases.
 *
 * @throws TestUtilsException if any filed look ups fail
 */
@Before
public void setUp() throws TestUtilsException {
    topology = createMock(Topology.class);
    tracker = new ObjectiveTracker();
    delegate = new TestTopologyChangeDelegate();
    tracker.setDelegate(delegate);
    reasons = new LinkedList<>();
    listener = TestUtils.getField(tracker, "listener");
    hostListener = TestUtils.getField(tracker, "hostListener");
    resourceListener = TestUtils.getField(tracker, "resourceListener");
    mockGenerator = new MockIdGenerator();
    Intent.bindIdGenerator(mockGenerator);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:19,代码来源:ObjectiveTrackerTest.java

示例10: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    sut = new OpticalCircuitIntentCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent"))
            .andReturn(appId);
    sut.coreService = coreService;
    sut.deviceService = new MockDeviceService();
    sut.resourceService = new MockResourceService();
    sut.intentService = new TestIntentService();
    sut.intentSetMultimap = new MockIntentSetMultimap();

    Intent.bindIdGenerator(idGenerator);

    intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(OpticalCircuitIntent.class, sut);
    intentExtensionService.unregisterCompiler(OpticalCircuitIntent.class);
    sut.intentManager = intentExtensionService;
    replay(coreService, intentExtensionService);

    // mocking ComponentConfigService
    ComponentConfigService mockConfigService =
            EasyMock.createMock(ComponentConfigService.class);
    expect(mockConfigService.getProperties(anyObject())).andReturn(ImmutableSet.of());
    mockConfigService.registerProperties(sut.getClass());
    expectLastCall();
    mockConfigService.unregisterProperties(sut.getClass(), false);
    expectLastCall();
    expect(mockConfigService.getProperties(anyObject())).andReturn(ImmutableSet.of());
    sut.cfgService = mockConfigService;
    replay(mockConfigService);

}
 
开发者ID:shlee89,项目名称:athena,代码行数:34,代码来源:OpticalCircuitIntentCompilerTest.java

示例11: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    sut = new LinkCollectionIntentCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent"))
            .andReturn(appId);
    sut.coreService = coreService;

    Intent.bindIdGenerator(idGenerator);

    intent = LinkCollectionIntent.builder()
            .appId(APP_ID)
            .selector(selector)
            .treatment(treatment)
            .links(links)
            .ingressPoints(ImmutableSet.of(d1p1))
            .egressPoints(ImmutableSet.of(d3p1))
            .build();
    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;

    replay(coreService, intentExtensionService);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:32,代码来源:LinkCollectionIntentCompilerTest.java

示例12: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    sut = new MplsPathIntentCompiler();
    CoreService coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent"))
            .andReturn(appId);
    sut.coreService = coreService;
    sut.resourceService = new MockResourceService();

    Intent.bindIdGenerator(idGenerator);

    intent = MplsPathIntent.builder()
            .appId(APP_ID)
            .selector(selector)
            .treatment(treatment)
            .path(new DefaultPath(PID, links, hops))
            .ingressLabel(ingressLabel)
            .egressLabel(egressLabel)
            .priority(55)
            .build();

    IntentExtensionService intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(MplsPathIntent.class, sut);
    intentExtensionService.unregisterCompiler(MplsPathIntent.class);
    sut.intentExtensionService = intentExtensionService;

    replay(coreService, intentExtensionService);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:29,代码来源:MplsPathIntentCompilerTest.java

示例13: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@Before
public void setUp() {
    intentStore = new GossipIntentStore();
    intentStore.storageService = new TestStorageService();
    intentStore.partitionService = new IntentPartitionServiceAdapter();
    intentStore.clusterService = new ClusterServiceAdapter();
    idGenerator = new MockIdGenerator();
    Intent.bindIdGenerator(idGenerator);
    builder1 = HostToHostIntent
                    .builder()
                    .one(hid("12:34:56:78:91:ab/1"))
                    .two(hid("12:34:56:78:91:ac/1"))
                    .appId(APP_ID);
    intentStore.activate();
}
 
开发者ID:shlee89,项目名称:athena,代码行数:16,代码来源:GossipIntentStoreTest.java

示例14: setUpClass

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
@BeforeClass
public static void setUpClass() {
    IdGenerator idGenerator = new TestIdGenerator();
    Intent.bindIdGenerator(idGenerator);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:6,代码来源:VplsTest.java

示例15: setUp

import org.onosproject.net.intent.Intent; //导入方法依赖的package包/类
/**
 * Configures objects used in all the test cases.
 */
@Before
public void setUp() {
    sut = new PathIntentCompiler();
    coreService = createMock(CoreService.class);
    expect(coreService.registerApplication("org.onosproject.net.intent"))
            .andReturn(appId);
    sut.coreService = coreService;
    sut.resourceService = new MockResourceService();

    Intent.bindIdGenerator(idGenerator);

    intent = PathIntent.builder()
            .appId(APP_ID)
            .selector(selector)
            .treatment(treatment)
            .priority(PRIORITY)
            .path(new DefaultPath(pid, links, hops))
            .build();

    //Intent with VLAN encap without egress VLAN
    constraintVlanIntent = PathIntent.builder()
            .appId(APP_ID)
            .selector(selector)
            .treatment(treatment)
            .priority(PRIORITY)
            .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN)))
            .path(new DefaultPath(pid, links, hops))
            .build();

    //Intent with VLAN encap with ingress and egress VLAN
    constrainIngressEgressVlanIntent = PathIntent.builder()
            .appId(APP_ID)
            .selector(vlanSelector)
            .treatment(vlanTreatment)
            .priority(PRIORITY)
            .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.VLAN)))
            .path(new DefaultPath(pid, links, hops))
            .build();

    constraintMplsIntent = PathIntent.builder()
            .appId(APP_ID)
            .selector(selector)
            .treatment(treatment)
            .priority(PRIORITY)
            .constraints(ImmutableList.of(new EncapsulationConstraint(EncapsulationType.MPLS)))
            .path(new DefaultPath(pid, links, hops))
            .build();
    intentExtensionService = createMock(IntentExtensionService.class);
    intentExtensionService.registerCompiler(PathIntent.class, sut);
    intentExtensionService.unregisterCompiler(PathIntent.class);

    registrator = new IntentConfigurableRegistrator();
    registrator.extensionService = intentExtensionService;
    registrator.cfgService = new ComponentConfigAdapter();
    registrator.activate();

    sut.registrator = registrator;

    replay(coreService, intentExtensionService);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:64,代码来源:PathIntentCompilerTest.java


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