本文整理汇总了Java中org.oscm.provisioning.intf.ProvisioningService类的典型用法代码示例。如果您正苦于以下问题:Java ProvisioningService类的具体用法?Java ProvisioningService怎么用?Java ProvisioningService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProvisioningService类属于org.oscm.provisioning.intf包,在下文中一共展示了ProvisioningService类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deleteInstance
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
public BaseResult deleteInstance(ServiceInstance instance,
User requestingUser) throws BadResultException, APPlatformException {
String oldSubscriptionId = instance.getSubscriptionId();
instance.markForDeletion();
instance.setRunWithTimer(true);
instance.setProvisioningStatus(ProvisioningStatus.WAITING_FOR_SYSTEM_DELETION);
final APPlatformController controller = APPlatformControllerFactory
.getInstance(instance.getControllerId());
final ProvisioningSettings settings = configService
.getProvisioningSettings(instance,
UserMapper.toServiceUser(requestingUser));
final InstanceStatus status = controller.deleteInstance(
instance.getInstanceId(), settings);
if (status != null) {
// forward call to provisioning service on application instance
if (status.isInstanceProvisioningRequested()) {
final ProvisioningService provisioning = provisioningFactory
.getInstance(instance);
String instanceId = instance.getInstanceId();
String organizationId = instance.getOrganizationId();
final BaseResult result = provisioning.deleteInstance(
instanceId, organizationId, oldSubscriptionId,
requestingUser);
if (provResultHelper.isError(result)) {
return result;
}
}
// If everything worked well we will save all changed parameters
instance.setInstanceParameters(status.getChangedParameters());
}
timerService.initTimers();
return provResultHelper.getOKResult(BaseResult.class);
}
示例2: setup
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
instance = new InstanceResult();
instance.setDesc(SYNC);
baseResult = new BaseResult();
baseResult.setDesc(ASYNC);
MockitoAnnotations.initMocks(this);
adapter = new ProvisioningServiceAdapterV1_0();
service = mock(ProvisioningService.class);
adapter.setProvisioningService(service);
}
示例3: createLogEntry
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
private RequestLogEntry createLogEntry(String title) {
final ServletContext servletContext = (ServletContext) context
.getMessageContext().get(MessageContext.SERVLET_CONTEXT);
final RequestLog log = (RequestLog) servletContext
.getAttribute(InitServlet.REQUESTLOG);
final RequestLogEntry entry = log.createEntry(
ProvisioningService.class.getSimpleName() + "." + title,
RequestDirection.INBOUND);
ServletRequest request = (ServletRequest) context.getMessageContext()
.get(MessageContext.SERVLET_REQUEST);
entry.setHost(request.getRemoteHost());
return entry;
}
示例4: updateUsers
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Override
public BaseResult updateUsers(String instanceId, List<User> users,
User requestingUser) {
logger.info("Update users for service instance {}.", instanceId);
ServiceInstance instance = null;
try {
instance = instanceDAO.getInstanceById(instanceId);
checkInstanceAvailability(instance);
final APPlatformController controller = APPlatformControllerFactory
.getInstance(instance.getControllerId());
final ProvisioningSettings settings = configService
.getProvisioningSettings(instance,
UserMapper.toServiceUser(requestingUser));
// Forward request
final InstanceStatus status = controller.updateUsers(
instance.getInstanceId(), settings,
mapToServiceUsers(users));
if (status != null) {
// forward call to provisioning service on application instance
if (status.isInstanceProvisioningRequested()) {
final ProvisioningService provisioning = provisioningFactory
.getInstance(instance);
final BaseResult result = provisioning
.updateUsers(instanceId, users, requestingUser);
if (provResult.isError(result)) {
return result;
}
}
// If everything worked well we will save all changed parameters
instance.setInstanceParameters(status.getChangedParameters());
}
instance.setProvisioningStatus(
ProvisioningStatus.WAITING_FOR_USER_MODIFICATION);
em.persist(instance);
timerService.initTimers();
return provResult.newOkBaseResult();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return provResult.getErrorResult(BaseResult.class, e,
getLocale(requestingUser), instance, instanceId);
}
}
示例5: deleteUsers
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Override
public BaseResult deleteUsers(String instanceId, List<User> users,
User requestingUser) {
logger.info("Delete users for instance {}.", instanceId);
ServiceInstance instance = null;
try {
instance = instanceDAO.getInstanceById(instanceId);
checkInstanceAvailability(instance);
final APPlatformController controller = APPlatformControllerFactory
.getInstance(instance.getControllerId());
final ProvisioningSettings settings = configService
.getProvisioningSettings(instance,
UserMapper.toServiceUser(requestingUser));
// Forward activation request
final InstanceStatus status = controller.deleteUsers(
instance.getInstanceId(), settings,
mapToServiceUsers(users));
if (status != null) {
// forward call to provisioning service on application instance
if (status.isInstanceProvisioningRequested()) {
final ProvisioningService provisioning = provisioningFactory
.getInstance(instance);
final BaseResult result = provisioning
.deleteUsers(instanceId, users, requestingUser);
if (provResult.isError(result)) {
return result;
}
}
// If everything worked well we will save all changed parameters
instance.setInstanceParameters(status.getChangedParameters());
}
instance.setProvisioningStatus(
ProvisioningStatus.WAITING_FOR_USER_DELETION);
em.persist(instance);
timerService.initTimers();
return provResult.newOkBaseResult();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return provResult.getErrorResult(BaseResult.class, e,
getLocale(requestingUser), instance, instanceId);
}
}
示例6: modifySubscription
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
private BaseResult modifySubscription(String instanceId,
String subscriptionId, String referenceId,
List<ServiceParameter> parameterValues,
List<ServiceAttribute> attributeValues,
final HashMap<String, Setting> parameterMap,
final HashMap<String, Setting> attributeMap,
ProvisioningStatus targetStatus, User requestingUser) {
ServiceInstance instance = null;
try {
instance = instanceDAO.getInstanceById(instanceId);
instance.prepareRollback();
checkInstanceAvailability(instance);
final HashMap<String, Setting> controllerSettings = configService
.getControllerConfigurationSettings(
instance.getControllerId());
final APPlatformController controller = APPlatformControllerFactory
.getInstance(instance.getControllerId());
final ProvisioningSettings currentSettings = configService
.getProvisioningSettings(instance,
UserMapper.toServiceUser(requestingUser));
final ProvisioningSettings newSettings = new ProvisioningSettings(
parameterMap, attributeMap,
currentSettings.getCustomAttributes(), controllerSettings,
instance.getDefaultLocale());
newSettings.setAuthentication(currentSettings.getAuthentication());
configService.copyCredentialsFromControllerSettings(newSettings,
controllerSettings);
newSettings.setRequestingUser(
UserMapper.toServiceUser(requestingUser));
newSettings.setSubscriptionId(subscriptionId);
newSettings.setReferenceId(referenceId);
// Forward modification request
final InstanceStatus status = controller.modifyInstance(
instance.getInstanceId(), currentSettings, newSettings);
if (status != null) {
// forward call to provisioning service on application instance
if (status.isInstanceProvisioningRequested()) {
final ProvisioningService provisioning = provisioningFactory
.getInstance(instance);
final List<ServiceParameter> filteredParameters = InstanceFilter
.getFilteredInstanceParametersForService(
parameterValues);
final BaseResult result = provisioning.modifySubscription(
instanceId, subscriptionId, referenceId,
filteredParameters, attributeValues,
requestingUser);
if (provResult.isError(result)) {
return result;
}
}
// If everything worked well we will save all changed parameters
instance.setInstanceParameters(status.getChangedParameters());
instance.setInstanceAttributes(status.getChangedAttributes());
}
instance.setProvisioningStatus(targetStatus);
instance.setSubscriptionId(subscriptionId);
instance.setReferenceId(referenceId);
em.persist(instance);
timerService.initTimers();
return provResult.newOkBaseResult();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return provResult.getErrorResult(BaseResult.class, e,
getLocale(requestingUser), instance, instanceId);
}
}
示例7: activateInstance
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Override
public BaseResult activateInstance(String instanceId, User requestingUser) {
logger.info("Activate instance {}.", instanceId);
ServiceInstance instance = null;
try {
instance = instanceDAO.getInstanceById(instanceId);
checkInstanceAvailability(instance);
final APPlatformController controller = APPlatformControllerFactory
.getInstance(instance.getControllerId());
final ProvisioningSettings settings = configService
.getProvisioningSettings(instance,
UserMapper.toServiceUser(requestingUser));
// Forward request
final InstanceStatus status = controller
.activateInstance(instance.getInstanceId(), settings);
if (status != null) {
// forward call to provisioning service on application instance
if (status.isInstanceProvisioningRequested()) {
final ProvisioningService provisioning = provisioningFactory
.getInstance(instance);
final BaseResult result = provisioning
.activateInstance(instanceId, requestingUser);
if (provResult.isError(result)) {
return result;
}
}
// If everything worked well we will save all changed parameters
instance.setInstanceParameters(status.getChangedParameters());
}
// Update current state
instance.setProvisioningStatus(
ProvisioningStatus.WAITING_FOR_SYSTEM_ACTIVATION);
em.persist(instance);
timerService.initTimers();
return provResult.newOkBaseResult();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return provResult.getErrorResult(BaseResult.class, e,
getLocale(requestingUser), instance, instanceId);
}
}
示例8: deactivateInstance
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Override
public BaseResult deactivateInstance(String instanceId,
User requestingUser) {
logger.info("Deactivate instance {}.", instanceId);
ServiceInstance instance = null;
try {
instance = instanceDAO.getInstanceById(instanceId);
checkInstanceAvailability(instance);
final APPlatformController controller = APPlatformControllerFactory
.getInstance(instance.getControllerId());
final ProvisioningSettings settings = configService
.getProvisioningSettings(instance,
UserMapper.toServiceUser(requestingUser));
// Forward request
final InstanceStatus status = controller
.deactivateInstance(instance.getInstanceId(), settings);
if (status != null) {
// forward call to provisioning service on application instance
if (status.isInstanceProvisioningRequested()) {
final ProvisioningService provisioning = provisioningFactory
.getInstance(instance);
final BaseResult result = provisioning
.deactivateInstance(instanceId, requestingUser);
if (provResult.isError(result)) {
return result;
}
}
// If everything worked well we will save all changed parameters
instance.setInstanceParameters(status.getChangedParameters());
}
// Update current state
instance.setProvisioningStatus(
ProvisioningStatus.WAITING_FOR_SYSTEM_DEACTIVATION);
em.persist(instance);
timerService.initTimers();
return provResult.newOkBaseResult();
} catch (Exception e) {
logger.warn(e.getMessage(), e);
return provResult.getErrorResult(BaseResult.class, e,
getLocale(requestingUser), instance, instanceId);
}
}
示例9: setup
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Override
protected void setup(TestContainer container) throws Exception {
container.addBean(LoggerFactory.getLogger(APPTimerServiceBean.class));
container.addBean(instanceDAO = new ServiceInstanceDAO());
container.addBean(configService = Mockito
.mock(APPConfigurationServiceBean.class));
container.addBean(mock(APPConcurrencyServiceBean.class));
container.addBean(provFactoryBean = Mockito
.mock(ProductProvisioningServiceFactoryBean.class));
provService = mock(ProvisioningService.class);
doReturn(provService).when(provFactoryBean)
.getInstance(any(ServiceInstance.class));
container.addBean(
mailService = Mockito.mock(APPCommunicationServiceBean.class));
container.addBean(besDAOMock = mock(BesDAO.class));
doReturn(Arrays.asList(new VOUserDetails())).when(besDAOMock)
.getBESTechnologyManagers(any(ServiceInstance.class));
operationDAOMock = mock(OperationDAO.class);
container.addBean(operationDAOMock);
container.addBean(opBean = mock(OperationServiceBean.class));
container.addBean(mock(APPAuthenticationServiceBean.class));
container.addBean(new APPlatformServiceBean());
controller = mock(APPlatformController.class);
InitialContext context = new InitialContext();
context.bind("bss/app/controller/ess.vmware", controller);
container.addBean(controller);
timer = mock(Timer.class);
defaultUser = new VOUser();
defaultUser.setUserId("user");
em = instanceDAO.em;
container.addBean(timerService = spy(new APPTimerServiceBean()));
container.addBean(timerService1 = spy(new APPTimerServiceBean()));
timerService.em = em;
timerService1.em = em;
timerService.instanceDAO = instanceDAO;
timerService1.instanceDAO = instanceDAO;
timerService.configService = configService;
timerService1.configService = configService;
timerService.provServFact = provFactoryBean;
timerService1.provServFact = provFactoryBean;
timerService.besDAO = besDAOMock;
timerService1.besDAO = besDAOMock;
timerService.mailService = mailService;
timerService1.mailService = mailService;
timerService.operationDAO = operationDAOMock;
timerService1.operationDAO = operationDAOMock;
timerService.opBean = opBean;
timerService1.opBean = opBean;
timerService.appTimerServiceBean = timerService1;
}
示例10: getInstance
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
private ProvisioningService getInstance(final ServiceInstance instance)
throws Exception {
return factory.getInstance(instance);
}
示例11: setProvisioningService
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
@Override
public void setProvisioningService(Object provServ) {
this.service = ProvisioningService.class.cast(provServ);
}
示例12: createServiceInstance
import org.oscm.provisioning.intf.ProvisioningService; //导入依赖的package包/类
/**
* Creates the instance of the technical service, running in the provisioned
* environment.
*
* @param currentSI
* The service instance containing the environment details.
* @param provisioningService
* The ProvisioningService of the technical service.
* @return The instance result object returned from the technical service.
* @throws BadResultException
*/
InstanceResult createServiceInstance(ServiceInstance currentSI,
ProvisioningService provisioningService) throws BadResultException {
InstanceRequest request = getInstanceRequest(currentSI);
InstanceResult instanceResult = provisioningService
.createInstance(request, null);
return instanceResult;
}