mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Fixing API config initialization issues
This commit is contained in:
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,13 +25,15 @@
|
||||
</ManagementRepository>
|
||||
|
||||
<APIPublisher>
|
||||
<API>
|
||||
<Name>enrollment</Name>
|
||||
<Provider>admin</Provider>
|
||||
<Context>enrollment</Context>
|
||||
<Version>1.0.0</Version>
|
||||
<Endpoint>http://localhost:9763/</Endpoint>
|
||||
<Transports>http,https</Transports>
|
||||
</API>
|
||||
<APIs>
|
||||
<API>
|
||||
<Name>enrollment</Name>
|
||||
<Provider>admin</Provider>
|
||||
<Context>enrollment</Context>
|
||||
<Version>1.0.0</Version>
|
||||
<Endpoint>http://localhost:9763/</Endpoint>
|
||||
<Transports>http,https</Transports>
|
||||
</API>
|
||||
</APIs>
|
||||
</APIPublisher>
|
||||
</MobileDeviceMgtConfiguration>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user