本文整理汇总了Java中org.oscm.vo.VOSubscription类的典型用法代码示例。如果您正苦于以下问题:Java VOSubscription类的具体用法?Java VOSubscription怎么用?Java VOSubscription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
VOSubscription类属于org.oscm.vo包,在下文中一共展示了VOSubscription类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: terminateSubscription
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
public void terminateSubscription(ServiceInstance currentSI, String locale)
throws BESNotificationException {
VOSubscription vo = null;
try {
SubscriptionService subServ = getBESWebService(
SubscriptionService.class, currentSI, Optional.empty());
vo = subServ.getSubscriptionForCustomer(
currentSI.getOrganizationId(),
currentSI.getOriginalSubscriptionId());
String reason = Messages.get(locale,
"terminate_subscription_reason");
subServ.terminateSubscription(vo, reason);
} catch (Exception e) {
throw new BESNotificationException(
"The subscription cannot be terminated.", e);
}
}
示例2: terminateSubscription_successful
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void terminateSubscription_successful() throws APPlatformException,
ObjectNotFoundException, OperationNotPermittedException,
OrganizationAuthoritiesException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException,
ConcurrentModificationException, SubscriptionStateException,
BESNotificationException {
// given
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class), any(Optional.class));
ServiceInstance si = givenServiceInstance(false);
String locale = "en";
// when
besDAO.terminateSubscription(si, locale);
// then
verify(subServ, times(1)).getSubscriptionForCustomer(
si.getOrganizationId(), si.getSubscriptionId());
verify(subServ, times(1)).terminateSubscription(
any(VOSubscription.class), anyString());
}
示例3: determineSubscriptionId
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
/**
* (determineRegistrationIds) Determines the subscription identifier for the
* trigger process parameters of the current trigger process.
*
* @param triggerProcessKey
* The technical key of the trigger process.
* @return The subscription identifier.
* @throws Exception
*/
private String determineSubscriptionId(long triggerProcessKey)
throws Exception {
ResourceHolder holder = getTriggerProcessParameters(triggerProcessKey);
ResultSet triggerProcessParameters = holder.getRs();
while (triggerProcessParameters.next()) {
String parameterName = triggerProcessParameters.getString("name");
if (TriggerProcessParameterName.SUBSCRIPTION.name().equals(
parameterName)) {
Object entry = getObjectFromXML(triggerProcessParameters,
Object.class);
// entry can be either of type VOSubscription or String
holder.close();
if (entry instanceof String) {
return (String) entry;
} else if (entry instanceof VOSubscription) {
return ((VOSubscription) entry).getSubscriptionId();
}
}
}
throw new Exception(
"Migration failed, no product entry found for trigger process!");
}
示例4: determineSubscriptionKey
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
/**
* Determines subscription key for the trigger process parameters of the
* current trigger process.
*
* @param triggerProcessKey
* The technical key of the trigger process.
* @return The subscription key.
* @throws Exception
*/
private String determineSubscriptionKey(long triggerProcessKey)
throws Exception {
ResourceHolder holder = getTriggerProcessParameters(triggerProcessKey);
ResultSet triggerProcessParameters = holder.getRs();
while (triggerProcessParameters.next()) {
String parameterName = triggerProcessParameters.getString("name");
if (TriggerProcessParameterName.SUBSCRIPTION.name().equals(
parameterName)) {
VOSubscription entry = getObjectFromXML(
triggerProcessParameters, VOSubscription.class);
holder.close();
return String.valueOf(entry.getKey());
}
}
throw new Exception(
"Migration failed, no product entry found for trigger process!");
}
示例5: createSubscription
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
public static VOSubscription createSubscription(
AccountService accountService,
SubscriptionService subscriptionService, String name,
VOService service) throws Exception {
// billing contact
List<VOPaymentInfo> paymentInfos = accountService.getPaymentInfos();
VOPaymentInfo voPaymentInfo = paymentInfos.get(0);
VOBillingContact voBillingContact = accountService
.saveBillingContact(factory.createBillingContactVO());
// create subscription
VOSubscription s = factory.createSubscriptionVO(name);
List<VOUsageLicense> users = new ArrayList<VOUsageLicense>();
return subscriptionService.subscribeToService(s, service, users,
voPaymentInfo, voBillingContact, new ArrayList<VOUda>());
}
示例6: createSubscription
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
public VOSubscriptionDetails createSubscription(String namePrefix,
VOService service) throws Exception {
VOSubscription subscription = factory.createSubscriptionVO(namePrefix
+ "_" + WebserviceTestBase.createUniqueKey());
List<VOUsageLicense> users = new ArrayList<VOUsageLicense>();
users.add(factory.createUsageLicenceVO(voCustomerUser.getUserId()));
SubscriptionService subscriptionSV = ServiceFactory.getDefault()
.getSubscriptionService(
String.valueOf(voCustomerUser.getKey()),
WebserviceTestBase.DEFAULT_PASSWORD);
subscription = subscriptionSV.subscribeToService(subscription, service,
users, voCustomerPaymentInfo, voCustomerBillingContact,
new ArrayList<VOUda>());
return subscriptionSV.getSubscriptionDetails(subscription
.getSubscriptionId());
}
示例7: createSubscription
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
private VOSubscription createSubscription(AccountService accountService,
SubscriptionService subscriptionService, String name)
throws Exception {
// billing contact
List<VOPaymentInfo> paymentInfos = accountService.getPaymentInfos();
VOPaymentInfo voPaymentInfo = paymentInfos.get(0);
VOBillingContact voBillingContact = accountService
.saveBillingContact(factory.createBillingContactVO());
// create subscription
VOSubscription s = factory.createSubscriptionVO(name);
List<VOUsageLicense> users = new ArrayList<VOUsageLicense>();
return subscriptionService.subscribeToService(s, service, users,
voPaymentInfo, voBillingContact, new ArrayList<VOUda>());
}
示例8: testGetMarketplaceForSubscription
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void testGetMarketplaceForSubscription() throws Exception {
VOMarketplace marketplace = factory.createMarketplaceVO(
supplier.getOrganizationId(), false, "globalMp");
marketplace = createAndValidateMarketplace(marketplace);
VOService freeService = createAndActivateFreeService(marketplace);
// subscribe the service
SubscriptionService subSvc = ServiceFactory.getDefault()
.getSubscriptionService();
VOSubscription subscription = new VOSubscription();
subscription.setSubscriptionId(
Long.toHexString(System.currentTimeMillis()));
subscription = subSvc.subscribeToService(subscription, freeService,
null, null, null, new ArrayList<VOUda>());
VOMarketplace marketplace2 = mpService_Supplier
.getMarketplaceForSubscription(subscription.getKey(), "en");
assertNotNull(marketplace2);
assertEquals(marketplace.getKey(), marketplace2.getKey());
}
示例9: subscribe
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
private VOSubscription subscribe() throws ObjectNotFoundException,
NonUniqueBusinessKeyException, ValidationException,
PaymentInformationException, ServiceParameterException,
ServiceChangedException, PriceModelException,
TechnicalServiceNotAliveException,
TechnicalServiceOperationException, OperationNotPermittedException,
SubscriptionAlreadyExistsException, OperationPendingException,
MandatoryUdaMissingException, ConcurrentModificationException,
SubscriptionStateException {
createdSubscription = createSubscription();
createdSubscription = subscrServiceForCustomer.subscribeToService(
createdSubscription, freeService, usageLicences, null, null,
new ArrayList<VOUda>());
subscriptionID = createdSubscription.getSubscriptionId();
return createdSubscription;
}
示例10: bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminSubManager
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminSubManager() throws Exception {
//given
List<VOUda> udasToSave = prepareUdasForSave();
VOSubscription subscription = createSubscription();
subscription.setUnitKey(unitBug12379.getKey());
subscription.setUnitName(unitBug12379.getName());
organizationalUnitService.revokeUserRoles(unitAdminSubManager, Arrays.asList(UnitRoleType.USER), unitBug12379);
organizationalUnitService.grantUserRoles(unitAdminSubManager, Arrays.asList(org.oscm.types.enumtypes.UnitRoleType.ADMINISTRATOR), unitBug12379);
//when
service4UnitAdminSubManager = ServiceFactory.getDefault()
.getSubscriptionService(
String.valueOf(unitAdminSubManager.getKey()),
WebserviceTestBase.DEFAULT_PASSWORD);
VOSubscription voSubscription = service4UnitAdminSubManager.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
//then
assertEquals(voSubscription.getUnitKey(), unitBug12379.getKey());
assertEquals(voSubscription.getUnitName(), unitBug12379.getName());
service4UnitAdminSubManager.unsubscribeFromService(voSubscription.getSubscriptionId());
}
示例11: bug12379_subscriptionToServiceWithoutUnitAssignedByApi_unitAdminSubManager
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithoutUnitAssignedByApi_unitAdminSubManager() throws Exception {
//given
List<VOUda> udasToSave = prepareUdasForSave();
VOSubscription subscription = createSubscription();
organizationalUnitService.revokeUserRoles(unitAdminSubManager, Arrays.asList(UnitRoleType.USER), unitBug12379);
organizationalUnitService.grantUserRoles(unitAdminSubManager, Arrays.asList(org.oscm.types.enumtypes.UnitRoleType.ADMINISTRATOR), unitBug12379);
//when
VOSubscription voSubscription = service4UnitAdminSubManager.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
waitForLogStored();
//then
assertTrue(voSubscription.getUnitKey() == 0);
assertNull(voSubscription.getUnitName());
service4UnitAdminSubManager.unsubscribeFromService(voSubscription.getSubscriptionId());
}
示例12: bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminOnly
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_unitAdminOnly() throws Exception {
//given
List<VOUda> udasToSave = prepareUdasForSave();
VOSubscription subscription = createSubscription();
subscription.setUnitKey(unitBug12379.getKey());
subscription.setUnitName(unitBug12379.getName());
organizationalUnitService.revokeUserRoles(unitAdminOnly, Arrays.asList(UnitRoleType.USER), unitBug12379);
organizationalUnitService.grantUserRoles(unitAdminOnly, Arrays.asList(org.oscm.types.enumtypes.UnitRoleType.ADMINISTRATOR), unitBug12379);
service4UnitAdminOnly = ServiceFactory.getDefault()
.getSubscriptionService(
String.valueOf(unitAdminOnly.getKey()),
WebserviceTestBase.DEFAULT_PASSWORD);
//when
VOSubscription voSubscription = service4UnitAdminOnly.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
waitForLogStored();
//then
assertEquals(voSubscription.getUnitKey(), unitBug12379.getKey());
assertEquals(voSubscription.getUnitName(), unitBug12379.getName());
service4UnitAdminOnly.unsubscribeFromService(voSubscription.getSubscriptionId());
}
示例13: bug12379_subscriptionToServiceWithUnitAssignedByApi_subManagerOnly
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test(expected = OperationNotPermittedException.class)
public void bug12379_subscriptionToServiceWithUnitAssignedByApi_subManagerOnly() throws Exception {
//given
List<VOUda> udasToSave = prepareUdasForSave();
VOSubscription subscription = createSubscription();
subscription.setUnitKey(unitBug12379.getKey());
subscription.setUnitName(unitBug12379.getName());
service4SubManagerOnly = ServiceFactory.getDefault()
.getSubscriptionService(
String.valueOf(subManagerOnly.getKey()),
WebserviceTestBase.DEFAULT_PASSWORD);
//when
VOSubscription voSubscription = service4SubManagerOnly.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
//then
assertEquals(unitBug12379.getKey(), voSubscription.getUnitKey());
assertEquals(unitBug12379.getName(), voSubscription.getUnitName());
}
示例14: bug12379_subscriptionToServiceWithoutUnitAssignedByApi_subManagerOnly
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void bug12379_subscriptionToServiceWithoutUnitAssignedByApi_subManagerOnly() throws Exception {
//given
List<VOUda> udasToSave = prepareUdasForSave();
VOSubscription subscription = createSubscription();
service4SubManagerOnly = ServiceFactory.getDefault()
.getSubscriptionService(
String.valueOf(subManagerOnly.getKey()),
WebserviceTestBase.DEFAULT_PASSWORD);
//when
VOSubscription voSubscription = service4SubManagerOnly.subscribeToService(subscription, freeService, usageLicences, null, null, udasToSave);
//then
assertTrue(voSubscription.getUnitKey() == 0);
assertNull(voSubscription.getUnitName());
service4SubManagerOnly.unsubscribeFromService(voSubscription.getSubscriptionId());
}
示例15: modifySubscription_SubscriptionManagerPermissions
import org.oscm.vo.VOSubscription; //导入依赖的package包/类
@Test
public void modifySubscription_SubscriptionManagerPermissions()
throws Exception {
// given
createdSubscription = createSubscription();
createdSubscription = subscrServiceForSubManager.subscribeToService(
createdSubscription, freeService, usageLicences, null, null,
new ArrayList<VOUda>());
createdSubscription.setPurchaseOrderNumber("newOrderNumber");
// when
subscrServiceForSubManager.modifySubscription(createdSubscription,
null, null);
// then
List<VOSubscription> subList = subscrServiceForSubManager
.getSubscriptionsForOrganization();
VOSubscription subscription = getSubscriptionInList(
createdSubscription, subList);
assertNotNull(subscription);
assertEquals("newOrderNumber", subscription.getPurchaseOrderNumber());
}