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


Java VOSubscription.getKey方法代码示例

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


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

示例1: initTestData

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
/**
 * Creates a technology provider and imports a technical product. Also a
 * supplier is created for which a service is created and published.
 */
private static void initTestData() throws Exception {
    // OPERATOR:
    WebserviceTestBase.getOperator().addCurrency(
            WebserviceTestBase.CURRENCY_EUR);
    registerProvider();
    registerSupplier();
    WebserviceTestBase.savePaymentInfoToSupplier(supplier,
            PaymentInfoType.INVOICE);

    // TECHNCIAL PROVIDER:
    initProviderServices();
    importTechnicalService(serviceProvisioningService);
    accountService.addSuppliersForTechnicalService(techProduct,
            Collections.singletonList(supplier.getOrganizationId()));

    // SUPPLIER:
    initSupplierServices();
    marketplace = WebserviceTestBase.registerMarketplace(
            supplier.getOrganizationId(), "mp");
    enablePaymentType(accountService);
    registerMarketableService(serviceProvisioningService);
    WebserviceTestBase.publishToMarketplace(service, true, srvMarketplace,
            marketplace);
    service = serviceProvisioningService.activateService(service);
    VOSubscription subscription = WebserviceTestBase.createSubscription(
            accountService, subscriptionService, "subscrname", service);
    subscriptionKey = subscription.getKey();
    instanceId = subscription.getServiceInstanceId();
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:34,代码来源:EventServiceWSTest.java

示例2: getSubscriptionInList

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
private VOSubscription getSubscriptionInList(VOSubscription subToGet,
        List<VOSubscription> subList) {
    VOSubscription subscription = null;
    for (VOSubscription sub : subList) {
        if (sub.getKey() == subToGet.getKey()) {
            subscription = sub;
        }
    }
    return subscription;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:11,代码来源:SubscriptionServiceWSTest.java

示例3: testCreateTwoSubscription

import org.oscm.vo.VOSubscription; //导入方法依赖的package包/类
/**
 * Test for 'Blue Line', however in this test onBehalfUser create another
 * subscription. At that case, if first subscription is deleted, the
 * onBehalfUser must not be deleted and another onBehalfUser also can be
 * made.
 * 
 * @throws Exception
 */
@Test
public void testCreateTwoSubscription() throws Exception {
    // set up of blue line test
    createMarketableServiceAndSubscribe(true);

    // By PaaS: create OnBehalfUser
    IdentityService identifySV = ServiceFactory.getDefault()
            .getIdentityService(hostUserKey, commonUserPWD);
    VOUserDetails onBehalfUser = identifySV.createOnBehalfUser(
            techProviderOrg.getOrganizationId(), commonUserPWD);
    String onBehalfUserKey = Long.toString(onBehalfUser.getKey());

    // By OnBehalfUser: create another subscription
    VOSubscription subscription2 = factory.createSubscriptionVO("sub2_"
            + WebserviceTestBase.createUniqueKey());
    List<VOUsageLicense> users = new ArrayList<VOUsageLicense>();
    users.add(factory.createUsageLicenceVO(techProviderUserId));
    SubscriptionService subscriptionSV = ServiceFactory.getDefault()
            .getSubscriptionService(onBehalfUserKey, commonUserPWD);
    subscription2 = subscriptionSV.subscribeToService(subscription2,
            activatedService, users, null, null, new ArrayList<VOUda>());

    // By OnBehalfUser: unsubscribe the first subscription
    String subscriptionId = subscription.getSubscriptionId();
    subscriptionSV = ServiceFactory.getDefault().getSubscriptionService(
            Long.toString(onBehalfUser.getKey()), commonUserPWD);
    subscriptionSV.unsubscribeFromService(subscriptionId);

    // By OnBehalfUser: login to second subscription
    long subscriptionKey = subscription2.getKey();
    SessionService sessionSV = ServiceFactory.getDefault()
            .getSessionService(onBehalfUserKey, commonUserPWD);
    String sessionId = "session" + WebserviceTestBase.createUniqueKey();
    sessionSV.createServiceSession(subscriptionKey, sessionId, "token2");
    sessionSV.deleteServiceSession(subscriptionKey, sessionId);

    // By PaaS: create another OnBehalfUser
    identifySV = ServiceFactory.getDefault().getIdentityService(
            hostUserKey, commonUserPWD);
    identifySV.createOnBehalfUser(techProviderOrg.getOrganizationId(),
            commonUserPWD);

}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:52,代码来源:OnBehalfActingServiceWSTest.java


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