Skip to content
This repository has been archived by the owner on Apr 15, 2021. It is now read-only.

Commit

Permalink
Fb operator export data (#684)
Browse files Browse the repository at this point in the history
* Issue #665 - Added new command and empty method in operator service bean.

* Issue #665 - Added fully functional method.

* Issue #665 - Test added.

* Issue #665 - Test fixed.

* Issue #665 - Refactor.

* Issue #665 - Fixing test.

* Issue #665 - Added IT test..

* Fixes #663. Get the number of VMs provisioned in the target environment.

* Fixes #663. Saving number of provisioned vms in bes and app databases.

* Fixes #663. Saving number of provisioned vms in bes and app databases.

* Revert "bug 12669 - When click "cancel" with nothing changed in the user page… (#543)"

This reverts commit 900ca65.

* fix link for app webservice library

* Issue #560 changed copyright year

* Issue #560 changed year in the rest of files

* Issue #248

* Issue #516

* Change AWS parameters and migrate them

* Update sample aws technical service

* Bug 12669 - When click "cancel" with nothing changed in the user page, there is the confirmation window popup.

* TechnicalService_AWS update

* add test for schema upgrade

* fix webtests

* Fixes #514 added tenant from the marketplace during organization registering

* Fixes #529 added null check

* Update version info for Fix 6

* Hotfix/issue 424 (#574)

* Issue#424 Added missing tenant assignment

* Issue#424 Null pointer fix

* Fixes #424. Import users from csv in tenants environment fixed

* Merge branch 'hotfix/issue-424' of https://github.com/servicecatalog/development into hotfix/issue-424

* fix webtests

* Fixes #529 Changed to check for auth mode

* Issue #573 - Improve descriptions of new/changed settings

* Fix for failing tests

* add missing settings in app properties template

* fix webtests

* Bug #13384

* Remove unit test

* Performance issue related to many trigger processes stord in the db fixed

* fix packaging for app common and controllers

* fix wrong classpath in Manifest

* Modify subscription id fixed. IT tests added

* fix create new user within default tenant

* fix missing logging classes for controllers

* fix project references for app controllers

* Unit tests fixed

* fix missing properties in app extsvc

* fix wrong package path in app common faces config

* adapt service instance to delete old instance attributes

* Increase version number to 16.1.7

* Fix for APP_SUSPEND

* allow publish service for marketplace with different tenant

* Fix IT tests for #13356

* fix self registration with duplicate names in different tenants

* Fixing integration tests. (cherry picked from commit 2d6e455)

* fix register customer for marketplace in different tenant

* fix tests for account service

* add scripts for google cloud builder

* fix npe and tests for account service

* update cloudbuild.yaml

* Add secure http listener

* remove app-common.jar from vmware application.xml

* Glassfish4 working (#550)

* Modified travis.

* Fixing merge issue.

* Modified travis.

* upgrade rest api to jersey 2

* Changed ecj version in ivy

* Change java version in sonar used by travis

* integrate rest api improvements to upgrade

* FIxing travis.

* Increased ant version.

* Increased ant version.

* Increased ant version.

* Increased ant version.

* Added travis wait

* MOdified travis wait.

* Updated data input for webtest

* Temporary change for WS verification

* Audit loging interceptor reverted to old version

* Temporary change fo WS check

* Change lock type on getting config setting

* Change Lock type for the whole configuration service ejb

* Reverted configuration service  bean changes

* Testing travis failure

* Increased jacoco version

* Added wait to sonar travis task

* Changed jacoco version

* Fixing ant version 10.0.0 not downloadable

* Fixing ant version 10.0.0 not downloadable

* Changed app persistence to support jpa 2.1

* local settings for eststavreva

* Update local settings for eststavreva

* Add local settings for estono

* Previous form of a test for audit logging enabling

* Change for ws verification

* Fixes #561 - Modified glassfish paths to gl4.

* Local settings

* Local configuration updated

* Search services issue fixed

* Xmx setup fixed

* Issue #552 - Added BSSDS to resource annotation.

* Changed db port for GF4 machines

* Changes related to 12517 bug

* Changes for audit logging enabled interceptor

* Updated webtests id error message verification

* BP webtests fixed

* MP webtests fixed

* Fixes #569 eclipse persistence libs updated to version 2.6.3 on glassfish 4

* Bumped eclipse persistence version

* Added missing dependency

* Testing with lower persistence version

* Fixes #554 - removing one property for jms port definition from indexer domain.

* Stop generating metamodel classes by eclipselink

* Hibernate issue

* Hibernate issue

* Fixes #553 - Modified portbase in installpack file for bes domain.

* Fixes #578 - modifiy method name.

* Fixes #558 SSO settings are only being displayed in SSO mode

* Modified postgres port to 5432

* Fixing IT tests.

* Adapted APP to new jpa

* Fix for import.

* Modified import to java8

* Modified import to java8

* Fixed build.

* Fixing unit tests.

* Fixing unit tests.

* Added setter and getter to fullfill EJB reference.

* Fixed broker property.

* Modification of db port.

* Modified version of java in message during installation.

* Fixes #590 - modification of java version message during installation.

* Fixes #567 Removed javax.faces copying

* Reverting db port change.

* Fixes #558 Added three settings to the exclusions list

* Issue #585 updated ejb-jar.xml files

* Fixed webtest

* Issue #12517 - webtest fixing. From ID.xls the entries were removed for $ sign and ' (single quote)

* Modification of configuration service bean from singleton to stateless.

* Configuration bean set as singleton back.

* Modification of birt address for gl4 hosts.

* TaskQueueServiceBean modified not to use injected jms resources.

* Commenting out test

* Updated integration property

* Removed unnecessary classpath entry

* Issue #12517 - webtest fixing. From ID.xls the entries were removed for $ sign and ' (single quote)

* Adding regexp to field verification in mkp.

* Adding regexp to field verification in mkp.

* Added logging information.

* Added regex to marketplace text.

* Uncommented tests and added logging information.

* Added missing library to oscm-search.ear

* Modified transaction to requires_new insted of required.

* Issue #568 - setting hibernate.classloading.use_current_tccl_as_parent to false.

* Disabling rest api

* Adding dummy method to satisfy the tests.

* Update DefinitionBackendTest.java

Added dummy method.

* Update ProcessBackendTest.java

Added dummy method.

* add selenium web test framework and basic portal tests

* shippable configuration

* shippable configuration: restrict to fb_web_integration_tests branch

* shippable configuration: fix yml format

* shippable configuration: fix yml format

* shippable configuration: fix yml format

* Removed selenium and firefox addon.

* Trying to fix folder

* Set correct path to pom.file.

* download maven

* build oscm-webtest-base

* switch to gl4

* get local env hostname

* get local env hostname

* Added logging information to shippable

* adding maven locally

* adding maven locally

* adding maven locally

* adding maven locally

* Removed empty tests.
Modified email for shippable

* Configured to log errors

* Configured to log errors

* Getting back deleted files. Modification of webtester to support shippable and local envs.

* Getting back deleted files. Modification of webtester to support shippable and local envs.

* start domains before tests

* start domains before tests

* start domains before tests - removed 'read' command

* start domains before tests - added ' &'

* start domains before tests - added ' &'

* sleep 20

* sleep 20

* Update shippable.yml

* sleep 20

* sleep 20

* Adding closed producer method.

* Added missing classpath

* Added dol.jar to install pack

* Updated beans.xml to jee 7

* Commented out rest api

* Merge conflicts

* Fixed copyright headers in new integrationtests

* Removed empty classes

* Commented out rest api in saml mode

* Fix for missing class when try to authenticate to app in saml mode

* Fixes #606 dol.jar fix for APP install packs

* Fixes #595 Added APP_SUSPEND to the properties file

* Fixes #568

* Adding missing jar.

* Issue #563 - Queue switched to local from embeded.

* Webtests with validation fixed

* Issue #563 - Added SOAP logging.

* Issue #563 - Test on payara.

* Uncommenting rest API.

* Issue #563 - Reverted test on payara. Webservice tests limited.

* Issue #563 - Reverted: Webservice tests limited.

* Fixed webtests

* Uncommented search webtests

* Modification of deployment descriptors.

* Modification of deployment descriptors.

* Webtests fixed

* Issue #563 - Test on payara.

* Issue #563 - Limitation of webservice tests to the one which fails.

* Fixing travis build.

* Issue #563 - Reverted test on payara.

* Issue #563 - Webservice tests limited.

* Added travis report.

* Disabled coverage.

* Adding parallel-junit task.

* Reverted: Adding parallel-junit task.

* Adding parallel-junit task.

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Adding parallel-junit task.

* Adding parallel-junit task.

* Adding parallel-junit task.

* Adding parallel-junit task.

* Adding parallel-junit task.

* Adding parallel-junit task.

* Adding parallel-junit task.

* Adding parallel-junit task.

* Ignore one test, which may cause travis to hang.

* Fixed classpath.

* Unignore test.

* Fixing travis.

* Fixing travis.

* Fixing travis.

* Fixing travis and adding loggign.

* Ignoring test.

* Reverting junit in parallel.

* Adding additional information to ws tests and limiting the tests.

* Ignoring another test.

* Ignoring another test.

* Ignoring another test.

* Added fork possibility.

* update rest api

* Add missing manifest

* Registration webtest fixed

* Added logging information.

* Search services webtest added to be run in a playground job

* Issue #644 - Reverting all tries to fix the bug.

* Changes for serach webtests

* Issue #643 - Adding jms queue port configuration file for app domain.

* Fixes #619.

* Fixes #645. Assign users to subscription with roles.

* Issue #607 - Fixing validation method for JMS resources.

* Fixes #607 - Setting up hibernate search locking strategy to single.

* Issue #607 - Closing producer

* Fix for failing search webtest

* Removing unneded echo.

* Issue #645 Added webtest

* Fixes #607 - setting hibernate reader strategy not to be shared.

* Fix for failing travis

* Travis with openjdk8

* Removed unused test classes

* Travis with openjdk8

* Moved test to another package

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Changed exclude on travis

* Webtests fixed

* Webtests fixed

                                   (cherry picked from commit 1cacbb5)

* Testing travis

* Fixes #673.

* Webtest with validation fixed

* Accidentally commited debug.log file deleted

* Fixing merge problem

* Fixex #671. Guest added to the anonymous group of bes domain broker

* Change version number from 16.1.7 to 17.0.0 in properties files

* Issue #665 - Added new command and empty method in operator service bean.

* Issue #665 - Added fully functional method.

* Issue #665 - Test added.

* Issue #665 - Test fixed.

* Issue #665 - Refactor.

* Issue #665 - Fixing test.

* Issue #665 - Added IT test..

* Issue #665 - Added fully functional method.

* Issue #665 - Modified sql due to new field.

* Fixes #660. Fix unit tests.

* Fixes #660. IT tests fixed.

* Fixes #660. 0 instead of -1

* Issue #661 - Fixed default value from -1 to 0.

* Issue #665 - Modified warning text and updated manifest.

* Fixes #660. Change endpoint

* Issue #665 - Modified parsed results.

* Fixes #660. Revert default method in InstanceAccess interface

* Issue #665 - Added order by clause.

* Fix timers for subscription vm refresh and filter report

* Issue #712 - modified order of exported csv.

* Issue #712 - modified order of exported csv and added test.

* Issue #712 - Added closing csv stream.

* Fixes #708

* Fixes #708

* Fixes #714. VMs number for all controllers.

* Issue #712 - Modified query according to db schema changes.

* Fixes #716.

* Added script
  • Loading branch information
Dawid authored and badziakp committed May 31, 2017
1 parent 66de583 commit 7ab1f33
Show file tree
Hide file tree
Showing 99 changed files with 976 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,21 @@ public InstanceStatus executeServiceOperation(String userId,
* configuration settings
*/
public void setControllerSettings(ControllerSettings settings);

/**
* Writes back the number of VMs for the tenant of given instance
* @param instanceId
* the ID of the application instance
* @param subscriptionId
* the ID of the subscription
* @param organizationId
* the ID of the organization
* @return the number of VMs
* @throws APPlatformException
*/
default Integer getServersNumber(String instanceId,
String subscriptionId, String organizationId)
throws APPlatformException {
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public String getAccessInfo(String instanceId, String subscriptionId,
* @param key
* the message key
* @param arguments
* optional arguments
* @return the localized message
*/
public String getMessage(String locale, String key, Object... arguments);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.*;

import org.apache.sling.commons.json.JSONArray;
import org.apache.sling.commons.json.JSONException;
Expand Down Expand Up @@ -229,4 +227,5 @@ private String getFlavorName(String flavorID)
}
return "-";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,5 @@ public List<Server> getServersDetails(PropertyHandler ph, boolean moreInfo)
}
return servers;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

import org.oscm.app.openstack.NovaProcessor;
import org.oscm.app.openstack.data.FlowState;
import org.oscm.app.openstack.i18n.Messages;
import org.oscm.app.v2_0.APPlatformServiceFactory;
Expand All @@ -32,8 +33,7 @@
import org.oscm.app.v2_0.data.OperationParameter;
import org.oscm.app.v2_0.data.ProvisioningSettings;
import org.oscm.app.v2_0.data.ServiceUser;
import org.oscm.app.v2_0.exceptions.APPlatformException;
import org.oscm.app.v2_0.exceptions.LogAndExceptionConverter;
import org.oscm.app.v2_0.exceptions.*;
import org.oscm.app.v2_0.intf.APPlatformController;
import org.oscm.app.v2_0.intf.APPlatformService;
import org.slf4j.Logger;
Expand Down Expand Up @@ -62,6 +62,7 @@ public class OpenStackController extends ProvisioningValidator
implements APPlatformController {

public static final String ID = "ess.openstack";
private static final int SERVERS_NUMBER_CANNOT_BE_CHECKED = 0;

private static final Logger LOGGER = LoggerFactory
.getLogger(OpenStackController.class);
Expand Down Expand Up @@ -327,7 +328,6 @@ public InstanceStatus activateInstance(String instanceId,
Context.ACTIVATION);
}
}

/**
* Starts the deactivation of an application instance.
* <p>
Expand Down Expand Up @@ -537,4 +537,22 @@ private List<LocalizedText> getProvisioningStatusText(
}
return messages;
}

@Override
public Integer getServersNumber(String instanceId,
String subscriptionId, String organizationId)
throws APPlatformException {

ProvisioningSettings settings = platformService
.getServiceInstanceDetails(OpenStackController.ID, instanceId,
subscriptionId, organizationId);
PropertyHandler ph = new PropertyHandler(settings);

try {
return new NovaProcessor().getServersDetails(ph, false).size();
} catch (Exception e) {
LOGGER.warn(e.getMessage());
}
return SERVERS_NUMBER_CANNOT_BE_CHECKED;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ public List<? extends ServerInformation> getServerDetails(String instanceId,
return servers;
}

@Override
public String getMessage(String locale, String key, Object... arguments) {
// TODO Auto-generated method stub
return null;
}

@Override
public String getAccessInfo(String instanceId, String subscriptionId,
String organizationId) throws AuthenticationException,
Expand All @@ -95,4 +89,10 @@ public String getAccessInfo(String instanceId, String subscriptionId,
return settings.getServiceAccessInfo();
}

@Override
public String getMessage(String locale, String key, Object... arguments) {
// TODO Auto-generated method stub
return null;
}

}
17 changes: 11 additions & 6 deletions oscm-app-openstack/resources/TechnicalService_OpenStack.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<tns:TechnicalService accessType="DIRECT" allowingOnBehalfActing="false" baseUrl=""
build="20140708" id="OPENSTACK_V4" loginPath=""
onlyOneSubscriptionPerUser="false" provisioningType="ASYNCHRONOUS"
provisioningUrl="https://<host>:<port>/ProvisioningService/AsynchronousProvisioningProxy?wsdl"
provisioningUrl="https://localhost:8680/ProvisioningService/AsynchronousProvisioningProxy?wsdl"
provisioningVersion="1.0">
<AccessInfo locale="en" >OpenStack Access Info</AccessInfo>
<LocalizedDescription locale="en">OpenStack IaaS implementation</LocalizedDescription>
Expand Down Expand Up @@ -36,7 +36,8 @@
</Options>
<LocalizedDescription locale="en">Template files for resource orchestration</LocalizedDescription>
</ParameterDefinition>
<ParameterDefinition configurable="true" id="TENANT_ID" default="<your.tenant.id>" mandatory="true" valueType="STRING" modificationType="ONE_TIME">
<ParameterDefinition configurable="true" id="TENANT_ID" default="6867876" mandatory="true" valueType="STRING"
modificationType="ONE_TIME">
<LocalizedDescription locale="en">Tenant ID (project ID)</LocalizedDescription>
</ParameterDefinition>
<ParameterDefinition configurable="true" id="ACCESS_INFO_PATTERN" default="Key pair name: {KP_Out}; Assigned network addresses: {NW_Out};" mandatory="true" valueType="STRING" modificationType="ONE_TIME">
Expand Down Expand Up @@ -91,31 +92,35 @@
<LocalizedDescription locale="en">The address to which emails are to be sent that describe manual steps required to complete an operation. If you specify this parameter, the service controller interrupts the processing of each operation before its completion and waits for a notification about the execution of a manual action. Omit this parameter if you do not want to interrupt the processing.</LocalizedDescription>
<LocalizedDescription locale="ja">操作を完了するために手動の手順が必要であることを知らせるemailの送信先メールアドレス。このパラメーターを指定すると、サービスコントロールは各操作の完了前に処理を中断して、手動の操作が終わったことを知らせる通知が届くまで待ちます。処理を中断したくない場合は、このパラメーターを省略してください。</LocalizedDescription>
</ParameterDefinition>
<Operation actionURL="https://<host>:<port>/OperationService/AsynchronousOperationProxy?wsdl" id="START_VIRTUAL_SYSTEM">
<ParameterDefinition configurable="false" default="0" id="VMS_NUMBER"
mandatory="true" valueType="LONG">
<LocalizedDescription locale="en">The number of VMs of IaaS subscriptions</LocalizedDescription>
</ParameterDefinition>
<Operation actionURL="https://localhost:8680/OperationService/AsynchronousOperationProxy?wsdl" id="START_VIRTUAL_SYSTEM">
<LocalizedName locale="de">Start</LocalizedName>
<LocalizedName locale="en">Start</LocalizedName>
<LocalizedName locale="ja">起動</LocalizedName>
<LocalizedDescription locale="de">Startet alle Server</LocalizedDescription>
<LocalizedDescription locale="en">Start all servers</LocalizedDescription>
<LocalizedDescription locale="ja">システムを起動します</LocalizedDescription>
</Operation>
<Operation actionURL="https://<host>:<port>/OperationService/AsynchronousOperationProxy?wsdl" id="STOP_VIRTUAL_SYSTEM">
<Operation actionURL="https://localhost:8680/OperationService/AsynchronousOperationProxy?wsdl" id="STOP_VIRTUAL_SYSTEM">
<LocalizedName locale="de">Stop</LocalizedName>
<LocalizedName locale="en">Stop</LocalizedName>
<LocalizedName locale="ja">停止</LocalizedName>
<LocalizedDescription locale="de">Stoppt alle Server</LocalizedDescription>
<LocalizedDescription locale="en">Stop all servers</LocalizedDescription>
<LocalizedDescription locale="ja">システムを停止します</LocalizedDescription>
</Operation>
<Operation actionURL="https://<host>:<port>/OperationService/AsynchronousOperationProxy?wsdl" id="RESUME_VIRTUAL_SYSTEM">
<Operation actionURL="https://localhost:8680/OperationService/AsynchronousOperationProxy?wsdl" id="RESUME_VIRTUAL_SYSTEM">
<LocalizedName locale="de">Fortsetzen</LocalizedName>
<LocalizedName locale="en">Resume</LocalizedName>
<LocalizedName locale="ja">レジューム</LocalizedName>
<LocalizedDescription locale="de">Setzt den Betrieb der Instanz fort</LocalizedDescription>
<LocalizedDescription locale="en">Resume the instance</LocalizedDescription>
<LocalizedDescription locale="ja">システムをレジュームします</LocalizedDescription>
</Operation>
<Operation actionURL="https://<host>:<port>/OperationService/AsynchronousOperationProxy?wsdl" id="SUSPEND_VIRTUAL_SYSTEM">
<Operation actionURL="https://localhost:8680/OperationService/AsynchronousOperationProxy?wsdl" id="SUSPEND_VIRTUAL_SYSTEM">
<LocalizedName locale="de">Aussetzen</LocalizedName>
<LocalizedName locale="en">Suspend</LocalizedName>
<LocalizedName locale="ja">サスペンド</LocalizedName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ private static Properties getProperties() {
p.put(PlatformConfigurationKey.APP_ADMIN_MAIL_ADDRESS.name(),
"[email protected]");
p.put(PlatformConfigurationKey.APP_TIMER_INTERVAL.name(), "15000");
p.put(PlatformConfigurationKey.APP_TIMER_REFRESH_SUBSCRIPTIONS.name(), "86400000");
p.put(PlatformConfigurationKey.BSS_WEBSERVICE_URL.name(),
"http://www.fujitsu.com/{service}/BASIC?wsdl");
p.put(PlatformConfigurationKey.BSS_USER_KEY.name(), "1000");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ public void testGetProvisioningSettings() throws Exception {
"http://abc.de");
createConfigSetting(PlatformConfigurationKey.APP_TIMER_INTERVAL.name(),
"15000");
createConfigSetting(PlatformConfigurationKey.APP_TIMER_REFRESH_SUBSCRIPTIONS.name(),
"86400000");
createConfigSetting(PlatformConfigurationKey.BSS_WEBSERVICE_URL.name(),
"http://abc.de");
createConfigSetting(
Expand Down
15 changes: 15 additions & 0 deletions oscm-app-unittests/javasrc/org/oscm/app/dao/BesDAOTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1735,6 +1735,21 @@ public void terminateSubscription_NoSubscription_unsuccessful()

}

@Test
public void testNotifySubscriptionAboutVmsNumber()
throws BESNotificationException, APPlatformException, ObjectNotFoundException {
//given
ServiceInstance si = givenServiceInstance(false);
doReturn(subServ).when(besDAO).getBESWebService(
eq(SubscriptionService.class), any(ServiceInstance.class));
doNothing().when(subServ).notifySubscriptionAboutVmsNumber(anyString(), anyString(), any(VOInstanceInfo.class));
//when
besDAO.notifySubscriptionAboutVmsNumber(si);

//then
verify(subServ, times(1)).notifySubscriptionAboutVmsNumber(anyString(), anyString(), any(VOInstanceInfo.class));
}

private LocalizedText givenText(String locale, String text) {
LocalizedText voText = new LocalizedText();
voText.setLocale(locale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ private Properties getProperties() {
p.put(PlatformConfigurationKey.APP_ADMIN_MAIL_ADDRESS.name(),
"[email protected]");
p.put(PlatformConfigurationKey.APP_TIMER_INTERVAL.name(), "15000");
p.put(PlatformConfigurationKey.APP_TIMER_REFRESH_SUBSCRIPTIONS.name(), "86400000");
p.put(PlatformConfigurationKey.BSS_WEBSERVICE_URL.name(),
"http://localhost:8680/{service}/BASIC?wsdl");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ private Properties getProperties() {
p.put(PlatformConfigurationKey.APP_ADMIN_MAIL_ADDRESS.name(),
"[email protected]");
p.put(PlatformConfigurationKey.APP_TIMER_INTERVAL.name(), "15000");
p.put(PlatformConfigurationKey.APP_TIMER_REFRESH_SUBSCRIPTIONS.name(), "86400000");
p.put(PlatformConfigurationKey.BSS_WEBSERVICE_URL.name(),
"http://www.fujitsu.com/{service}/BASIC?wsdl");
p.put(PlatformConfigurationKey.BSS_USER_KEY.name(), "1000");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,10 @@ public InstanceStatus executeServiceOperation(String userId,
public void setControllerSettings(ControllerSettings settings) {
delegate.setControllerSettings(settings);
}

@Override
public Integer getServersNumber(String instanceId, String subscriptionId, String organizationId)
throws APPlatformException {
return delegate.getServersNumber(instanceId,subscriptionId, organizationId);
}
}
18 changes: 18 additions & 0 deletions oscm-app/javasrc/org/oscm/app/dao/BesDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,23 @@ public void notifyAsyncModifySubscription(ServiceInstance currentSI,
}
}


public void notifySubscriptionAboutVmsNumber(ServiceInstance currentSI) throws BESNotificationException {
if (currentSI.isDeleted()) {
return;
}
VOInstanceInfo voInstanceInfo = new VOInstanceInfo();
voInstanceInfo.setVmsNumber(currentSI.getVmsNumber());
try {
SubscriptionService subServ = getBESWebService(
SubscriptionService.class, currentSI);
subServ.notifySubscriptionAboutVmsNumber(currentSI.getSubscriptionId(), currentSI.getOrganizationId(),
voInstanceInfo);
} catch (Exception e) {
handleException(currentSI, e);
}
}

public void notifyAsyncOperationStatus(ServiceInstance currentSI,
String transactionId, OperationStatus status,
List<LocalizedText> list) throws BESNotificationException {
Expand Down Expand Up @@ -513,6 +530,7 @@ VOInstanceInfo getInstanceInfo(ServiceInstance currentSI,
voInstanceInfo.setAccessInfo(instanceInfo.getAccessInfo());
voInstanceInfo.setBaseUrl(instanceInfo.getBaseUrl());
voInstanceInfo.setLoginPath(instanceInfo.getLoginPath());
voInstanceInfo.setVmsNumber(currentSI.getVmsNumber());
return voInstanceInfo;
}

Expand Down
20 changes: 16 additions & 4 deletions oscm-app/javasrc/org/oscm/app/dao/ServiceInstanceDAO.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,22 @@ public boolean exists(String instanceId) {

public List<ServiceInstance> getInstancesSuspendedbyApp() {
Query query = em
.createNamedQuery("ServiceInstance.getForSuspendedByApp");
@SuppressWarnings("unchecked")
List<ServiceInstance> result = query.getResultList();
return result;
.createNamedQuery("ServiceInstance.getForSuspendedByApp");
return query.getResultList();
}

public List<ServiceInstance> getInstances() {
Query query = em
.createNamedQuery("ServiceInstance.getAll");
return query.getResultList();
}


public ServiceInstance updateVmsNumber(ServiceInstance serviceInstance, Integer vmsNumber) {
Query query = em.createNamedQuery("ServiceInstance.getForKey");
query.setParameter("key", serviceInstance.getInstanceId());
ServiceInstance si = (ServiceInstance) query.getSingleResult();
si.setVmsNumber(vmsNumber);
return em.merge(si);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ public enum PlatformConfigurationKey {
*/
APP_TIMER_INTERVAL("long"),

/**
* The interval (in milliseconds) at which APP polls the status of instances
* and updates respective subscription parameters, e.g. the number of VMs.
*/
APP_TIMER_REFRESH_SUBSCRIPTIONS("long"),

/**
* Defines the mail resource to be used for communication.
*/
Expand Down
16 changes: 15 additions & 1 deletion oscm-app/javasrc/org/oscm/app/domain/ServiceInstance.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
@NamedQuery(name = "ServiceInstance.getForKey", query = "SELECT si FROM ServiceInstance si WHERE si.instanceId = :key"),
@NamedQuery(name = "ServiceInstance.getForSubscriptionAndOrg", query = "SELECT si FROM ServiceInstance si WHERE si.subscriptionId = :subscriptionId AND si.organizationId = :organizationId"),
@NamedQuery(name = "ServiceInstance.getForCtrlKey", query = "SELECT si FROM ServiceInstance si WHERE si.instanceId = :key AND si.controllerId = :cid"),
@NamedQuery(name = "ServiceInstance.getAllForCtrl", query = "SELECT si FROM ServiceInstance si WHERE si.controllerId = :cid") })
@NamedQuery(name = "ServiceInstance.getAllForCtrl", query = "SELECT si FROM ServiceInstance si WHERE si"
+ ".controllerId = :cid"),
@NamedQuery(name = "ServiceInstance.getAll", query = "SELECT si FROM ServiceInstance si") })
public class ServiceInstance implements Serializable {

private static final long serialVersionUID = 4298435124486600408L;
Expand Down Expand Up @@ -194,6 +196,9 @@ public int getVersion() {
*/
private String serviceLoginPath;

@Column
private int vmsNumber;

/**
* SubscriptionID key for rollbackParameters
*/
Expand Down Expand Up @@ -791,4 +796,13 @@ public void setRollbackInstanceAttributes(
public String getRollbackInstanceAttributes() {
return rollbackInstanceAttributes;
}

public int getVmsNumber() {
return vmsNumber;
}

public void setVmsNumber(int vmsNumber) {
this.vmsNumber = vmsNumber;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,14 @@ public void initTimers() {
*/
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void initTimers_internal() {
Collection<?> timers = timerService.getTimers();
if (timers.isEmpty()) {
Collection<Timer> timers = timerService.getTimers();
boolean appTimerExist = false;
for (Timer timerAPP : timers) {
if (APP_TIMER_INFO.equals(timerAPP.getInfo())) {
appTimerExist = true;
}
}
if (!appTimerExist) {
logger.info("Timer create.");
try {
String timerIntervalSetting = configService
Expand Down
Loading

0 comments on commit 7ab1f33

Please sign in to comment.