Fixing API config initialization issues

revert-70aa11f8
prabathabey 10 years ago
parent 717fa6dea8
commit aa7d4e4eba

@ -16,6 +16,7 @@
package org.wso2.carbon.device.mgt.mobile.config;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
@ -24,12 +25,13 @@ public class APIPublisherConfig {
private List<APIConfig> apis;
@XmlElement(name = "APIs")
public List<APIConfig> getApis() {
@XmlElementWrapper(name = "APIs", nillable = false, required = true)
@XmlElement(name = "API", nillable = false)
public List<APIConfig> getAPIs() {
return apis;
}
public void setApis(List<APIConfig> apis) {
public void setAPIs(List<APIConfig> apis) {
this.apis = apis;
}

@ -133,7 +133,7 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B
private void initAPIConfigs() throws DeviceManagementException {
List<APIConfig> apiConfigs =
MobileDeviceConfigurationManager.getInstance().getMobileDeviceManagementConfig().
getApiPublisherConfig().getApis();
getApiPublisherConfig().getAPIs();
for (APIConfig apiConfig : apiConfigs) {
try {
APIProvider provider = APIManagerFactory.getInstance().getAPIProvider(apiConfig.getOwner());
@ -148,7 +148,7 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B
private void publishAPIs() throws DeviceManagementException {
List<APIConfig> apiConfigs =
MobileDeviceConfigurationManager.getInstance().getMobileDeviceManagementConfig().
getApiPublisherConfig().getApis();
getApiPublisherConfig().getAPIs();
for (APIConfig apiConfig : apiConfigs) {
DeviceManagementAPIPublisherUtil.publishAPI(apiConfig);
}
@ -157,7 +157,7 @@ public class MobileDeviceManagementBundleActivator implements BundleActivator, B
private void removeAPIs() throws DeviceManagementException {
List<APIConfig> apiConfigs =
MobileDeviceConfigurationManager.getInstance().getMobileDeviceManagementConfig().
getApiPublisherConfig().getApis();
getApiPublisherConfig().getAPIs();
for (APIConfig apiConfig : apiConfigs) {
DeviceManagementAPIPublisherUtil.removeAPI(apiConfig);
}

@ -25,6 +25,7 @@
</ManagementRepository>
<APIPublisher>
<APIs>
<API>
<Name>enrollment</Name>
<Provider>admin</Provider>
@ -33,5 +34,6 @@
<Endpoint>http://localhost:9763/</Endpoint>
<Transports>http,https</Transports>
</API>
</APIs>
</APIPublisher>
</MobileDeviceMgtConfiguration>

Loading…
Cancel
Save