本文整理汇总了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();
}
示例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;
}
示例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);
}