diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index bf44dd6270..1bf917de68 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index 58b2db1d49..ee4e158727 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 2d18f57ecd..b68df772b3 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java index 8cad8b016f..611679e512 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java @@ -26,6 +26,12 @@ import org.wso2.carbon.apimgt.application.extension.exception.APIManagerExceptio */ public interface APIManagementProviderService { + /** + * Check whether the tier is loaded for the tenant. + * @return + */ + boolean isTierLoaded(); + /** * Generate and retreive application keys. if the application does exist then * create it and subscribe to apis that are grouped with the tags. diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index b97146a02d..bc92961f64 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -45,8 +45,22 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe private static final String CONTENT_TYPE = "application/json"; private static final int MAX_API_PER_TAG = 200; private static final String APP_TIER_TYPE = "application"; - private static final Map tiersMap = new HashMap<>(); - private static final int MAX_ATTEMPTS = 20; + + public boolean isTierLoaded() { + StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() + .getStoreClient(); + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() + .getTenantDomain(); + try { + + storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, + APP_TIER_TYPE, + tenantDomain, CONTENT_TYPE, null, null); + return true; + } catch (FeignException e) { + return false; + } + } @Override public void removeAPIApplication(String applicationName, String username) throws APIManagerException { @@ -72,31 +86,8 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe throws APIManagerException { StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() .getStoreClient(); - //This is a fix to avoid race condition and trying to load tenant related tiers before invocation. String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() .getTenantDomain(); - String tiersLoadedForTenant = tiersMap.get(tenantDomain); - - if (tiersLoadedForTenant == null) { - boolean tierLoaded = false; - int attempts = 0; - do { - try { - storeClient.getIndividualTier() - .tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, APP_TIER_TYPE, - tenantDomain, CONTENT_TYPE, null, null); - tiersMap.put(tenantDomain, "exist"); - tierLoaded = true; - } catch (FeignException e) { - attempts++; - try { - Thread.sleep(500); - } catch (InterruptedException ex) { - log.warn("Interrupted the waiting for tier availability."); - } - } - } while ((!tierLoaded) && attempts < MAX_ATTEMPTS); - } ApplicationList applicationList = storeClient.getApplications() .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null); diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index 71fef924be..c5c272cfad 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module @@ -76,6 +76,7 @@ WSO2 Carbon - API Security Handler Component org.apache.axiom.*, + javax.security.cert.*, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, javax.xml.*, org.apache.axis2.*, @@ -90,7 +91,8 @@ org.w3c.dom, org.apache.synapse, org.apache.synapse.core.axis2, - org.apache.synapse.rest + org.apache.synapse.rest, + org.wso2.carbon.certificate.mgt.core.impl diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java index c5fe71dd4a..2891e06179 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java @@ -31,11 +31,17 @@ import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker; import org.wso2.carbon.apimgt.handlers.invoker.RESTResponse; import org.wso2.carbon.apimgt.handlers.utils.AuthConstants; import org.wso2.carbon.apimgt.handlers.utils.Utils; +import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator; import org.wso2.carbon.context.PrivilegedCarbonContext; +import javax.security.cert.CertificateEncodingException; +import java.io.ByteArrayInputStream; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; import java.util.HashMap; import java.util.Map; import java.util.StringTokenizer; @@ -140,6 +146,21 @@ public class AuthenticationHandler extends AbstractHandler { if (log.isDebugEnabled()) { log.debug("Verify response:" + response.getContent()); } + } else if (headers.containsKey(AuthConstants.MUTUAL_AUTH_HEADER)) { + javax.security.cert.X509Certificate[] certs = + (javax.security.cert.X509Certificate[]) axisMC.getProperty(AuthConstants.CLIENT_CERTIFICATE); + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + ByteArrayInputStream bais = new ByteArrayInputStream(certs[0].getEncoded()); + X509Certificate x509 = (X509Certificate) cf.generateCertificate(bais); + if (bais != null) { + bais.close(); + } + if (x509 != null) { + headers.put(AuthConstants.PROXY_MUTUAL_AUTH_HEADER, CertificateGenerator.getCommonName(x509)); + return true; + } else { + response = null; + } } else if (headers.containsKey(AuthConstants.ENCODED_PEM)) { String encodedPem = headers.get(AuthConstants.ENCODED_PEM).toString(); if (log.isDebugEnabled()) { @@ -178,8 +199,13 @@ public class AuthenticationHandler extends AbstractHandler { } catch (APIMCertificateMGTException e) { log.error("Error while processing certificate.", e); return false; + } catch (CertificateException e) { + log.error("Certificate issue occurred when generating converting PEM to x509Certificate", e); + return false; + } catch (CertificateEncodingException e) { + log.error("Error while attempting to encode certificate.", e); + return false; } - } @Override @@ -205,4 +231,4 @@ public class AuthenticationHandler extends AbstractHandler { map.put(CONTENT_TYPE, "application/json"); return map; } -} +} \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java index a1343c312b..74870c131f 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java @@ -35,6 +35,7 @@ public class AuthConstants { // public static final String ANDROID_VERIFY_ENDPOINT = "android-verify-endpoint"; public static final String MDM_SIGNATURE = "mdm-signature"; public static final String PROXY_MUTUAL_AUTH_HEADER = "proxy-mutual-auth-header"; + public static final String MUTUAL_AUTH_HEADER = "mutual-auth-header"; public static final String ENCODED_PEM = "encoded-pem"; public static final String CALLBACK_URL = ""; public static final String CLIENT_NAME = "IOT-API-MANAGER"; @@ -46,4 +47,5 @@ public class AuthConstants { public static final String BASIC_AUTH_PREFIX = "Basic "; public static final String CLIENT_ID = "clientId"; public static final String CLIENT_SECRET = "clientSecret"; + public static final String CLIENT_CERTIFICATE = "ssl.client.auth.cert.X509"; } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index ace168692b..b22946aa8d 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java index 9c12b0cdaa..19633fa009 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java @@ -19,7 +19,9 @@ package org.wso2.carbon.apimgt.integration.client.store; import feign.Feign; import feign.Logger; +import feign.Request; import feign.RequestInterceptor; +import feign.Retryer; import feign.gson.GsonDecoder; import feign.gson.GsonEncoder; import feign.slf4j.Slf4jLogger; @@ -28,6 +30,8 @@ import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; import org.wso2.carbon.apimgt.integration.generated.client.store.api.*; import org.wso2.carbon.core.util.Utils; +import java.util.concurrent.TimeUnit; + /** * API Store client, created using swagger gen. */ @@ -62,8 +66,10 @@ public class StoreClient { individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); tags = builder.target(TagCollectionApi.class, basePath); - tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); + tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) + .options(new Request.Options(10000, 5000)) + .target(ThrottlingTierCollectionApi.class, basePath); } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index 5fefc8b9a2..6ca40596f9 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -13,13 +13,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.generated.client - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index db967a6ca4..e7ee4fbf12 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index 41005d9a4a..745926115b 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index 6b1bce9146..0b546ac473 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 4a528d1c60..0e429ff5d4 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java index 3206d56a6d..3b014fe693 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java @@ -30,6 +30,7 @@ import org.wso2.carbon.certificate.mgt.cert.jaxrs.api.util.RequestValidationUtil import org.wso2.carbon.certificate.mgt.core.dto.CertificateResponse; import org.wso2.carbon.certificate.mgt.core.exception.CertificateManagementException; import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException; +import org.wso2.carbon.certificate.mgt.core.impl.CertificateGenerator; import org.wso2.carbon.certificate.mgt.core.scep.SCEPException; import org.wso2.carbon.certificate.mgt.core.scep.SCEPManager; import org.wso2.carbon.certificate.mgt.core.scep.TenantedDeviceWrapper; diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 911ab1bbfb..1abc607ad1 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index c44acce6f5..98a05901e4 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index e6a7dd35cd..ab72e92bd9 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java index 98c5ef2870..87795967f1 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManager.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.extensions.device.type.deployer.template; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -42,12 +43,14 @@ import org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.util. import org.wso2.carbon.device.mgt.extensions.license.mgt.registry.RegistryBasedLicenseManager; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; +import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; +import java.io.File; import java.io.StringReader; import java.io.StringWriter; import java.nio.charset.Charset; @@ -63,10 +66,15 @@ public class DeviceTypeManager implements DeviceManager { private String deviceType; private DeviceTypePluginDAOManager deviceTypePluginDAOManager; private LicenseManager licenseManager; + private PlatformConfiguration defaultPlatformConfiguration; private boolean propertiesExist; private boolean requiredDeviceTypeAuthorization; private boolean claimable; + private static final String PATH_MOBILE_PLUGIN_CONF_DIR = + CarbonUtils.getEtcCarbonConfigDirPath() + File.separator + "device-mgt-plugin-configs" + File.separator + + "mobile"; + private FeatureManager featureManager; public DeviceTypeManager(DeviceTypeConfigIdentifier deviceTypeConfigIdentifier, @@ -107,6 +115,14 @@ public class DeviceTypeManager implements DeviceManager { claimable = deviceTypeConfiguration.getClaimable().isEnabled(); } + // Loading default platform configuration + try { + defaultPlatformConfiguration = this.getDefaultConfiguration(); + } catch (DeviceManagementException e) { + String msg = "Error occurred while default platform configuration"; + throw new DeviceTypeDeployerFileException(msg, e); + } + DeviceDetails deviceDetails = deviceTypeConfiguration.getDeviceDetails(); if (deviceDetails != null) { @@ -205,6 +221,8 @@ public class DeviceTypeManager implements DeviceManager { return (PlatformConfiguration) unmarshaller.unmarshal( new StringReader(new String((byte[]) resource.getContent(), Charset. forName(DeviceTypePluginConstants.CHARSET_UTF8)))); + } else if (defaultPlatformConfiguration != null) { + return defaultPlatformConfiguration; } return null; } catch (DeviceTypeMgtPluginException e) { @@ -371,6 +389,39 @@ public class DeviceTypeManager implements DeviceManager { return requiredDeviceTypeAuthorization; } + @Override + public PlatformConfiguration getDefaultConfiguration() throws DeviceManagementException { + + if (log.isDebugEnabled()) { + log.debug("Loading default " + deviceType + " platform configuration from " + deviceType + + "-default-platform-configuration.xml"); + } + try { + String platformConfigurationPath = + PATH_MOBILE_PLUGIN_CONF_DIR + File.separator + deviceType + "-default-platform-configuration.xml"; + File platformConfig = new File(platformConfigurationPath); + + if (platformConfig.exists()) { + Document doc = DeviceTypeUtils.convertToDocument(platformConfig); + JAXBContext context = JAXBContext.newInstance(PlatformConfiguration.class); + Unmarshaller unmarshaller = context.createUnmarshaller(); + return (PlatformConfiguration) unmarshaller.unmarshal(doc); + } else { + log.warn(deviceType + "-default-platform-configuration.xml is not available, hence default " + + deviceType + "platform configuration cannot be loaded."); + } + return null; + } catch (JAXBException e) { + throw new DeviceManagementException( + "Error occurred while parsing the " + deviceType + " default platform configuration : " + e + .getMessage(), e); + } catch (DeviceTypeMgtPluginException e) { + throw new DeviceManagementException( + "Error occurred while parsing the " + deviceType + " default platform configuration : " + e + .getMessage(), e); + } + } + @Override public boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException { diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManagerService.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManagerService.java index fc28c446e8..6db5d88054 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManagerService.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/DeviceTypeManagerService.java @@ -32,6 +32,7 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService; +import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.ConfigProperties; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.DeviceTypeConfiguration; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.Property; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.config.PushNotificationProvider; @@ -59,7 +60,6 @@ public class DeviceTypeManagerService implements DeviceManagementService { private List monitoringOperations; private PolicyMonitoringManager policyMonitoringManager; private InitialOperationConfig initialOperationConfig; - private List operations; public DeviceTypeManagerService(DeviceTypeConfigIdentifier deviceTypeConfigIdentifier, DeviceTypeConfiguration deviceTypeConfiguration) { @@ -69,6 +69,7 @@ public class DeviceTypeManagerService implements DeviceManagementService { this.populatePushNotificationConfig(deviceTypeConfiguration.getPushNotificationProvider()); this.operationMonitoringConfigs = new OperationMonitoringTaskConfig(); this.setOperationMonitoringConfig(deviceTypeConfiguration); + this.initialOperationConfig = new InitialOperationConfig(); this.setInitialOperationConfig(deviceTypeConfiguration); if (deviceTypeConfiguration.getPolicyMonitoring() != null ) { this.policyMonitoringManager = new DefaultPolicyMonitoringManager(); @@ -113,8 +114,14 @@ public class DeviceTypeManagerService implements DeviceManagementService { if (pushNotificationProvider != null) { if (pushNotificationProvider.isFileBasedProperties()) { Map staticProps = new HashMap<>(); - for (Property property : pushNotificationProvider.getConfigProperties().getProperty()) { - staticProps.put(property.getName(), property.getValue()); + ConfigProperties configProperties = pushNotificationProvider.getConfigProperties(); + if (configProperties != null) { + List properties = configProperties.getProperty(); + if (properties != null && properties.size() > 0) { + for (Property property : properties) { + staticProps.put(property.getName(), property.getValue()); + } + } } pushNotificationConfig = new PushNotificationConfig(pushNotificationProvider.getType(), pushNotificationProvider.isScheduled(), staticProps); diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/util/DeviceTypeUtils.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/util/DeviceTypeUtils.java index 466b3edcfe..20417fa4be 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/util/DeviceTypeUtils.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/deployer/template/util/DeviceTypeUtils.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.extensions.device.type.deployer.template.util import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.exception.DeviceTypeMgtPluginException; import org.wso2.carbon.device.mgt.extensions.device.type.deployer.internal.DeviceTypeManagementDataHolder; @@ -30,6 +31,10 @@ import org.wso2.carbon.registry.core.Registry; import javax.naming.Context; import javax.naming.InitialContext; import javax.sql.DataSource; +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import java.io.File; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -128,4 +133,18 @@ public class DeviceTypeUtils { } } + public static Document convertToDocument(File file) throws DeviceTypeMgtPluginException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setNamespaceAware(true); + try { + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + DocumentBuilder docBuilder = factory.newDocumentBuilder(); + return docBuilder.parse(file); + } catch (Exception e) { + throw new DeviceTypeMgtPluginException("Error occurred while parsing file '" + file.getName() + "' to" + + " a org.w3c.dom.Document", e); + } + } + + } diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index a2e5a39cb2..3a3f0b5c3e 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 5231c3446b..f2db26c166 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java index 8af53af6b2..121599324a 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/org/wso2/carbon/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java @@ -46,36 +46,52 @@ public class MQTTNotificationStrategy implements NotificationStrategy { private String mqttAdapterName; private static final Log log = LogFactory.getLog(MQTTNotificationStrategy.class); private final PushNotificationConfig config; + private final String providerTenantDomain; + private static final Object lockObj = new Object(); public MQTTNotificationStrategy(PushNotificationConfig config) { this.config = config; OutputEventAdapterConfiguration adapterConfig = new OutputEventAdapterConfiguration(); adapterConfig.setType(MQTTAdapterConstants.MQTT_ADAPTER_TYPE); - mqttAdapterName = config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_NAME); - adapterConfig.setName(mqttAdapterName); adapterConfig.setMessageFormat(MessageType.TEXT); Map configProperties = new HashMap(); - String brokerUrl = config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_BROKER_URL); - if (brokerUrl != null && !brokerUrl.isEmpty()) { - configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_BROKER_URL, brokerUrl); + if (config.getProperties() != null && config.getProperties().size() > 0) { + String brokerUrl = config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_BROKER_URL); + if (brokerUrl != null && !brokerUrl.isEmpty()) { + configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_BROKER_URL, brokerUrl); + } + mqttAdapterName = config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_NAME); + configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_USERNAME, + config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_USERNAME)); + configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_PASSWORD, + config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_PASSWORD)); + configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_CLEAR_SESSION, + config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_CLEAR_SESSION)); + configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_SCOPES, + config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_SCOPES)); + configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_MESSAGE_QOS, + config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_MESSAGE_QOS)); + } else { + mqttAdapterName = "mqtt.adapter." + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain() + .toLowerCase(); } - configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_USERNAME, - config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_USERNAME)); - configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_PASSWORD, - config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_PASSWORD)); - configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_CLEAR_SESSION, - config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_CLEAR_SESSION)); - configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_SCOPES, - config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_SCOPES)); - configProperties.put(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_MESSAGE_QOS, - config.getProperty(MQTTAdapterConstants.MQTT_ADAPTER_PROPERTY_MESSAGE_QOS)); + adapterConfig.setName(mqttAdapterName); adapterConfig.setStaticProperties(configProperties); try { - MQTTDataHolder.getInstance().getOutputEventAdapterService().create(adapterConfig); + synchronized (lockObj) { + try { + MQTTDataHolder.getInstance().getOutputEventAdapterService().isPolled(mqttAdapterName); + } catch (OutputEventAdapterException e) { + //event adapter not created + MQTTDataHolder.getInstance().getOutputEventAdapterService().create(adapterConfig); + } + } } catch (OutputEventAdapterException e) { throw new InvalidConfigurationException("Error occurred while initializing MQTT output event adapter", e); } + providerTenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain() + .toLowerCase(); } @Override @@ -85,19 +101,47 @@ public class MQTTNotificationStrategy implements NotificationStrategy { @Override public void execute(NotificationContext ctx) throws PushNotificationExecutionFailedException { + String adapterName = mqttAdapterName; + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true); + if (!providerTenantDomain.equals(tenantDomain)) { + //this is to handle the device type shared with all tenant mode. + + adapterName = "mqtt.adapter." + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain() + .toLowerCase(); + try { + MQTTDataHolder.getInstance().getOutputEventAdapterService().isPolled(adapterName); + } catch (OutputEventAdapterException e) { + //event adapter not created + synchronized (lockObj) { + OutputEventAdapterConfiguration adapterConfig = new OutputEventAdapterConfiguration(); + adapterConfig.setType(MQTTAdapterConstants.MQTT_ADAPTER_TYPE); + adapterConfig.setMessageFormat(MessageType.TEXT); + adapterConfig.setName(adapterName); + Map configProperties = new HashMap(); + adapterConfig.setStaticProperties(configProperties); + try { + MQTTDataHolder.getInstance().getOutputEventAdapterService().create(adapterConfig); + } catch (OutputEventAdapterException e1) { + throw new PushNotificationExecutionFailedException + ("Error occurred while initializing MQTT output event adapter for shared tenant: " + + tenantDomain, e); + } + } + } + + } Operation operation = ctx.getOperation(); Properties properties = operation.getProperties(); if (properties != null && properties.get(MQTT_ADAPTER_TOPIC) != null) { Map dynamicProperties = new HashMap<>(); dynamicProperties.put("topic", (String) properties.get(MQTT_ADAPTER_TOPIC)); - MQTTDataHolder.getInstance().getOutputEventAdapterService().publish(mqttAdapterName, dynamicProperties, + MQTTDataHolder.getInstance().getOutputEventAdapterService().publish(adapterName, dynamicProperties, operation.getPayLoad()); } else { if (PolicyOperation.POLICY_OPERATION_CODE.equals(operation.getCode())) { PolicyOperation policyOperation = (PolicyOperation) operation; List profileOperations = policyOperation.getProfileOperations(); - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(true); String deviceType = ctx.getDeviceId().getType(); String deviceId = ctx.getDeviceId().getId(); for (ProfileOperation profileOperation : profileOperations) { @@ -106,7 +150,7 @@ public class MQTTNotificationStrategy implements NotificationStrategy { + deviceType + "/" + deviceId + "/" + profileOperation.getType() .toString().toLowerCase() + "/" + profileOperation.getCode().toLowerCase(); dynamicProperties.put("topic", topic); - MQTTDataHolder.getInstance().getOutputEventAdapterService().publish(mqttAdapterName, dynamicProperties, + MQTTDataHolder.getInstance().getOutputEventAdapterService().publish(adapterName, dynamicProperties, profileOperation.getPayLoad()); } @@ -119,7 +163,7 @@ public class MQTTNotificationStrategy implements NotificationStrategy { if (operation.getPayLoad() == null) { operation.setPayLoad(""); } - MQTTDataHolder.getInstance().getOutputEventAdapterService().publish(mqttAdapterName, dynamicProperties, + MQTTDataHolder.getInstance().getOutputEventAdapterService().publish(adapterName, dynamicProperties, operation.getPayLoad()); } diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 56c819b6ea..ffa9b0e9e3 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index f731ea5ebf..046d66c705 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml index 9613262d9a..582da4d506 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index ecda809a8a..cd7b19e7b4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index e977a4a460..c5696df2af 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java index 8a46b9b194..6a4b12d72e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java @@ -115,4 +115,43 @@ public interface DeviceAccessAuthorizationAdminService { response = ErrorResponse.class) }) Response isAuthorized(AuthorizationRequest authorizationRequest); + + @POST + @Path("/stat") + @ApiOperation( + consumes = MediaType.APPLICATION_JSON, + produces = MediaType.APPLICATION_JSON, + httpMethod = "POST", + value = "Check for device access authorization for stat\n", + notes = "This is an internal API that can be used to check for authorization.", + response = DeviceAuthorizationResult.class, + tags = "Authorization Administrative Service", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:authorization:verify") + }) + }) + + @ApiResponses(value = { + @ApiResponse( + code = 200, + message = "OK. \n Authorized device list will be delivered to the requested services", + response = DeviceAuthorizationResult.class), + @ApiResponse( + code = 400, + message = "Bad Request. \n Invalid request or validation error.", + response = ErrorResponse.class), + @ApiResponse( + code = 404, + message = "Not Found. \n The specified resource does not exist."), + @ApiResponse( + code = 415, + message = "Unsupported media type. \n The entity of the request was in a not supported format."), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while checking the authorization" + + " for a specified set of devices.", + response = ErrorResponse.class) + }) + Response isAuthorizedForStat(AuthorizationRequest authorizationRequest); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypePublisherAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java similarity index 70% rename from components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypePublisherAdminService.java rename to components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java index 7914f9d071..6c7f0d5eff 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypePublisherAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java @@ -38,7 +38,7 @@ import javax.ws.rs.core.Response; title = "", extensions = { @Extension(properties = { - @ExtensionProperty(name = "name", value = "DeviceTypePublisherAdminService"), + @ExtensionProperty(name = "name", value = "DeviceAnalyticsArtifactUploaderAdminService"), @ExtensionProperty(name = "context", value = "/api/device-mgt/v1.0/admin/devicetype"), }) } @@ -62,7 +62,7 @@ import javax.ws.rs.core.Response; } ) -public interface DeviceTypePublisherAdminService { +public interface DeviceAnalyticsArtifactUploaderAdminService { @POST @Path("/deploy/{type}") @@ -107,42 +107,4 @@ public interface DeviceTypePublisherAdminService { required = true) @PathParam("type") String type); - @GET - @Path("/deploy/{type}/status") - @ApiOperation( - httpMethod = "GET", - value = "Check the status of device type artifact\n", - notes = "This is an API that can be used to check the status of the artifact", - response = Response.class, - tags = "Devicetype Status Service", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:devicetype:deployment") - }) - }) - - @ApiResponses(value = { - @ApiResponse( - code = 201, - message = "OK. \n Successfully deployed the artifacts.", - response = Response.class), - @ApiResponse( - code = 400, - message = "Bad Request. \n Invalid request or validation error.", - response = ErrorResponse.class), - @ApiResponse( - code = 404, - message = "Not Found. \n The specified resource does not exist."), - @ApiResponse( - code = 415, - message = "Unsupported media type. \n The entity of the request was in a not supported format."), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while checking the authorization" + - " for a specified set of devices.", - response = ErrorResponse.class) - }) - - Response getStatus(@PathParam("type") String deviceType); - } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index c5446035c8..b201bfd80c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -550,7 +550,6 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (policy == null) { deviceCompliance.setDeviceID(id); deviceCompliance.setComplianceData(null); - //deviceCompliance.setCode(0001l); //code 0001 means no compliance data related to the device return Response.status(Response.Status.OK).entity(deviceCompliance).build(); } else { try { @@ -559,7 +558,6 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { new DeviceIdentifier(id, type)); deviceCompliance.setDeviceID(id); deviceCompliance.setComplianceData(complianceData); - //deviceCompliance.setCode(0002l); //code 0002 means there are compliance data related to the device return Response.status(Response.Status.OK).entity(deviceCompliance).build(); } catch (PolicyComplianceException e) { String error = "Error occurred while getting the compliance data."; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java index fc3fe169ba..035caa3a18 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java @@ -36,6 +36,8 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.util.ArrayList; +import java.util.List; @Path("/admin/authorization") @Produces(MediaType.APPLICATION_JSON) @@ -43,6 +45,7 @@ import javax.ws.rs.core.Response; public class DeviceAccessAuthorizationAdminServiceImpl implements DeviceAccessAuthorizationAdminService { private static final Log log = LogFactory.getLog(DeviceAccessAuthorizationAdminServiceImpl.class); + private static final String DEFAULT_STAT_PERMISSION = "/permission/admin/device-mgt/device/realtime_analytics"; @POST @Override @@ -90,4 +93,14 @@ public class DeviceAccessAuthorizationAdminServiceImpl implements DeviceAccessAu } } + @POST + @Path("/stat") + @Override + public Response isAuthorizedForStat(AuthorizationRequest authorizationRequest) { + List permissions = new ArrayList<>(); + permissions.add(DEFAULT_STAT_PERMISSION); + authorizationRequest.setPermissions(permissions); + return isAuthorized(authorizationRequest); + } + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java similarity index 88% rename from components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java rename to components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java index d959113709..27e74549b0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceTypePublisherAdminServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java @@ -37,13 +37,10 @@ import org.wso2.carbon.application.mgt.stub.upload.types.carbon.UploadedFileItem import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.Utils; -import org.wso2.carbon.device.mgt.jaxrs.service.api.admin.DeviceTypePublisherAdminService; +import org.wso2.carbon.device.mgt.jaxrs.service.api.admin.DeviceAnalyticsArtifactUploaderAdminService; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; -import org.wso2.carbon.registry.core.Registry; -import org.wso2.carbon.registry.core.Resource; -import org.wso2.carbon.registry.core.ResourceImpl; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.CarbonUtils; @@ -55,7 +52,6 @@ import javax.activation.DataHandler; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; -import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; @@ -73,7 +69,7 @@ import java.util.ArrayList; import java.util.List; @Path("/admin/devicetype") -public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherAdminService { +public class DeviceAnalyticsArtifactUploaderAdminServiceImpl implements DeviceAnalyticsArtifactUploaderAdminService { /** * required soap header for authorization @@ -110,7 +106,7 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA private String tenantDomain; - private static final Log log = LogFactory.getLog(DeviceTypePublisherAdminServiceImpl.class); + private static final Log log = LogFactory.getLog(DeviceAnalyticsArtifactUploaderAdminServiceImpl.class); private static final String DEFAULT_RESOURCE_LOCATION = "/resources/devicetypes"; private static final String CAR_FILE_LOCATION = CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator + "resources" + File.separator + "devicetypes"; @@ -178,6 +174,9 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA publishDynamicEventReceivers(type, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, receiverFileList); } } + if (streamFileList != null) { + publishDynamicEventStream(type, tenantDomain, streamFileList); + } if (deployAnalyticsCapp(type, list)){ return Response.status(Response.Status.BAD_REQUEST) .entity("\"Error, Artifact does not exist.\"").build(); @@ -185,14 +184,6 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA if (receiverFileList != null) { publishDynamicEventReceivers(type, tenantDomain, receiverFileList); } - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - Registry registry = DeviceMgtAPIUtils.getRegistryService().getConfigSystemRegistry(tenantId); - if (!registry.resourceExists(DEFAULT_RESOURCE_LOCATION + type + ".exist")) { - Resource resource = new ResourceImpl(); - resource.setContent(""); - resource.setMediaType(MEDIA_TYPE_XML); - registry.put(DEFAULT_RESOURCE_LOCATION + type + ".exist", resource); - } return Response.status(Response.Status.CREATED).entity("\"OK. \\n Successfully uploaded the artifacts.\"") .build(); } catch (AxisFault e) { @@ -227,23 +218,25 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA if (directory.isDirectory() && directory.exists()) { UploadedFileItem[] uploadedFileItems = loadCappFromFileSystem(type); if (uploadedFileItems.length > 0) { - carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty( - IOT_MGT_URL)); - Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); - if (appUploaderOptions == null) { - appUploaderOptions = new Options(); - } - appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list); - appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER - , new Protocol(DEFAULT_HTTP_PROTOCOL, (ProtocolSocketFactory) new SSLProtocolSocketFactory - (sslContext), Integer.parseInt(Utils.replaceSystemProperty(IOT_MGT_PORT)))); - - carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions); - carbonAppUploaderStub.uploadApp(uploadedFileItems); + if (DEVICE_MANAGEMENT_TYPE.equals(type.toLowerCase())) { + carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty( + IOT_MGT_URL)); + Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); + if (appUploaderOptions == null) { + appUploaderOptions = new Options(); + } + appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list); + appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER + , new Protocol(DEFAULT_HTTP_PROTOCOL, + (ProtocolSocketFactory) new SSLProtocolSocketFactory + (sslContext), Integer.parseInt(Utils.replaceSystemProperty( + IOT_MGT_PORT)))); - if (!DEVICE_MANAGEMENT_TYPE.equals(type.toLowerCase())) { + carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions); + carbonAppUploaderStub.uploadApp(uploadedFileItems); + } else { carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty(DAS_URL)); - appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); + Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); if (appUploaderOptions == null) { appUploaderOptions = new Options(); } @@ -266,27 +259,6 @@ public class DeviceTypePublisherAdminServiceImpl implements DeviceTypePublisherA } } - @GET - @Path("/deploy/{type}/status") - @Override - public Response getStatus(@PathParam("type") String deviceType) { - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - Registry registry; - try { - registry = DeviceMgtAPIUtils.getRegistryService().getConfigSystemRegistry(tenantId); - if (registry.resourceExists(DEFAULT_RESOURCE_LOCATION + deviceType + ".exist")) { - return Response.status(Response.Status.OK).entity("Exist").build(); - } else { - return Response.status(Response.Status.NO_CONTENT).entity("Does not Exist").build(); - } - } catch (RegistryException e) { - log.error("Registry failed to load." + e.getMessage(), e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( - "\"Error, Artifact status check has failed\"").build(); - } - } - - private void publishDynamicEventReceivers(String deviceType, String tenantDomain, List receiversList) throws IOException, UserStoreException, JWTClientException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index fd6c5e0309..e33d1beb26 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -40,7 +40,7 @@ - + @@ -82,7 +82,7 @@ - + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index 74d1305bb8..fe45823629 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java index 060865c726..3c97fa81ce 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/DeviceManager.java @@ -157,4 +157,13 @@ public interface DeviceManager { */ boolean requireDeviceAuthorization(); + /** + * This method returns the default configuration values which is stored in the configuration file + * rather than fetching from the registry. + * + * @return Returns Default PlatformConfiguration + * @throws DeviceManagementException + */ + PlatformConfiguration getDefaultConfiguration() throws DeviceManagementException; + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index 59d34fb114..365576d8a3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 6672311c3d..13a5547687 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -2114,22 +2114,21 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv deviceIdentifiers.add(deviceIdentifier); if (init != null) { List initialOperations = init.getOperations(); - - for (String str : initialOperations) { - CommandOperation operation = new CommandOperation(); - operation.setEnabled(true); - operation.setType(Operation.Type.COMMAND); - operation.setCode(str); - try { - deviceManagementProviderService. - addOperation(deviceType, - operation, deviceIdentifiers); - } catch (OperationManagementException e) { - throw new DeviceManagementException("Unable to find the device with the id: '" + deviceIdentifier.getId(), - e); - } catch (InvalidDeviceException e) { - throw new DeviceManagementException("Unable to find the device with the id: '" + deviceIdentifier.getId(), - e); + if (initialOperations != null) { + for (String str : initialOperations) { + CommandOperation operation = new CommandOperation(); + operation.setEnabled(true); + operation.setType(Operation.Type.COMMAND); + operation.setCode(str); + try { + deviceManagementProviderService.addOperation(deviceType, operation, deviceIdentifiers); + } catch (OperationManagementException e) { + throw new DeviceManagementException("Unable to add the operation for the device with the id: '" + + deviceIdentifier.getId(), e); + } catch (InvalidDeviceException e) { + throw new DeviceManagementException("Unable to find the device with the id: '" + + deviceIdentifier.getId(), e); + } } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java index a1a17b47e3..7b07c0a62b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/TestDeviceManager.java @@ -121,4 +121,9 @@ public class TestDeviceManager implements DeviceManager { return false; } + @Override + public PlatformConfiguration getDefaultConfiguration() throws DeviceManagementException { + return null; + } + } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 45785a607e..792ab01c8b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index fb1441c641..5f72aa84b3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag index 9d12aa9360..34e4ee14e7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/api/user-api.jag @@ -176,6 +176,27 @@ if (uriMatcher.match("/{context}/api/user/authenticate")) { } } else if (uriMatcher.match("/{context}/api/user/all")) { result = userModule.getUsers(); +} else if (uriMatcher.match("/{context}/api/user/environment-loaded")) { + try { + var carbonUser = session.get(constants.USER_SESSION_KEY); + if (!carbonUser) { + response.sendRedirect("/devicemgt/login?#login-required"); + exit(); + } + utility.startTenantFlow(carbonUser); + var APIManagementProviderService = utility.getAPIManagementProviderService(); + var isLoaded = APIManagementProviderService.isTierLoaded(); + result = {"isLoaded": isLoaded}; + if (isLoaded) { + var samlToken = session.get(constants.SAML_TOKEN_KEY); + if (samlToken) { + apiWrapperUtil.setupTokenPairByJWTGrantType(carbonUser.username + '@' + carbonUser.domain, samlToken); + } + } + response.contentType = 'application/json'; + } finally { + utility.endTenantFlow(); + } } // returning the result. diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json index d2beaa71a7..58a741db8c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/app-conf.json @@ -11,7 +11,7 @@ "login": { "onSuccess": { "script": "/app/modules/login.js", - "page": "cdmf.page.dashboard" + "page": "cdmf.page.processing" }, "onFail": { "script": "/app/modules/login.js", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.loading.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.loading.hbs new file mode 100644 index 0000000000..ab70bdc1cf --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/layouts/cdmf.layout.loading.hbs @@ -0,0 +1,57 @@ +{{!-- Copyright (c) 2015, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + +WSO2 Inc. licenses this file to you under the Apache License, +Version 2.0 (the "License"); you may not use this file except +in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, +either express or implied. See the License for the +specific language governing permissions and limitations +under the License. --}} + + + + + + + + {{defineZone "favicon"}} + + {{defineZone "title"}} + + {{defineZone "topLibCss"}} + {{defineZone "topCss"}} + {{defineZone "topJs"}} + + + + + + + + {{defineZone "content"}} + + {{defineZone "bottomModalContent"}} + {{defineZone "bottomLibJs"}} + {{defineZone "bottomJs"}} + + \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js index e85f46c347..f8c420d58c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/business-controllers/user.js @@ -612,6 +612,9 @@ var userModule = function () { if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/change-status")) { permissions["CHANGE_DEVICE_STATUS"] = true; } + if (publicMethods.isAuthorized("/permission/admin/device-mgt")) { + permissions["IS_ADMIN"] = true; + } return permissions; }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js index a71495851f..56d03a6ce9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/constants.js @@ -81,3 +81,6 @@ var CACHED_CREDENTIALS = "tenantBasedCredentials"; var CACHED_CREDENTIALS_FOR_WEBSOCKET_APP = "tenantBasedWebSocketClientCredentials"; var ALLOWED_SCOPES = "scopes"; + +var SAML_TOKEN_KEY = "samlToken"; +var SKIP_WELCOME_SCREEN ="skipWelcomeScreen"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js index 166859f89b..461e4e4fbc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/login.js @@ -25,6 +25,19 @@ var onFail; onSuccess = function (context) { var utility = require("/app/modules/utility.js").utility; var apiWrapperUtil = require("/app/modules/oauth/token-handlers.js")["handlers"]; + try { + utility.startTenantFlow(context.user); + var APIManagementProviderService = utility.getAPIManagementProviderService(); + var isLoaded = APIManagementProviderService.isTierLoaded(); + if(!isLoaded && context.input.samlToken) { + session.put(constants.SKIP_WELCOME_SCREEN, false); + session.put(constants.SAML_TOKEN_KEY, context.input.samlToken); + return; + } + } finally { + utility.endTenantFlow(); + } + session.put(constants.SKIP_WELCOME_SCREEN, true); if (context.input.samlToken) { //apiWrapperUtil.setupTokenPairBySamlGrantType(context.user.username + '@' + context.user.domain, context.input.samlToken); /** diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js index 7b6add5fa8..5505219181 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js @@ -53,6 +53,10 @@ utility = function () { return getOsgiService('org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService'); }; + publicMethods.getAPIManagementProviderService = function () { + return getOsgiService('org.wso2.carbon.apimgt.application.extension.APIManagementProviderService'); + }; + publicMethods.getUserManagementService = function () { return getOsgiService("org.wso2.carbon.device.mgt.user.core.UserManager"); }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js index 1d2d7c8607..4e0c9aafa1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.dashboard/dashboard.js @@ -16,7 +16,7 @@ * under the License. */ -function onRequest() { +function onRequest(context) { var constants = require("/app/modules/constants.js"); var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; @@ -24,6 +24,11 @@ function onRequest() { var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"]; var policyModule = require("/app/modules/business-controllers/policy.js")["policyModule"]; + if(!session.get(constants["TOKEN_PAIR"])){ + response.sendRedirect(context.app.context + "/welcome"); + return; + } + var user = session.get(constants["USER_SESSION_KEY"]); var permissions = userModule.getUIPermissions(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs index 71d4a93523..cab8dffe4a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.hbs @@ -40,6 +40,20 @@ {{/zone}} +{{#zone "navbarActions"}} + {{#if isCloud}} +
  • + + + + + + Request new device type + +
  • + {{/if}} +{{/zone}} + {{#zone "content"}}
    diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.js new file mode 100644 index 0000000000..cfda9029de --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.enroll/enroll.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/** + * Returns the dynamic state to be populated by device-enrollment page. + * + * @param context Object that gets updated with the dynamic state of this page to be presented + * @returns {*} A context object that returns the dynamic state of this page to be presented + */ +function onRequest(context) { + var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; + var page = {}; + page["isCloud"] = devicemgtProps.isCloud; + page["contact_form_url"] = "https://cloudmgt.cloud.wso2.com/cloudmgt/site/pages/contact-us.jag?cloud-type=device_cloud&subject=Requesting for a new device type"; + return page; +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs index 7b68b15449..059aa68899 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.hbs @@ -519,7 +519,7 @@ {{/zone}} {{#zone "bottomJs"}} - {{js "js/listing.js"}} {{/zone}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js index 56a9c452fa..5727b6f06d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/devices.js @@ -80,10 +80,9 @@ function onRequest(context) { } var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; - var cUser = userModule.getUser(); - var analiticsServer = mdmProps["dashboardServerURL"]; - var analiticsURL = analiticsServer + "/portal/t/" + cUser.userDomain + "/dashboards/android-iot/battery?owner=" + cUser.username + "&deviceId="; - viewModel.analiticsURL = analiticsURL; + var analyticsServer = mdmProps["dashboardServerURL"]; + var analyticsURL = analyticsServer + "/portal/t/" + context.user.userDomain + "/dashboards/android-iot/battery?owner=" + context.user.username + "&deviceId="; + viewModel.analyticsURL = analyticsURL; return viewModel; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.hbs new file mode 100644 index 0000000000..48a23ed87e --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.hbs @@ -0,0 +1,57 @@ +{{! + Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + + WSO2 Inc. licenses this file to you under the Apache License, + Version 2.0 (the "License"); you may not use this file except + in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +}} +{{unit "cdmf.unit.ui.title" pageTitle="Home"}} + +{{#zone "breadcrumbs"}} +
  • + + + +
  • +{{/zone}} + +{{#zone "content"}} +
    +
    + Loading...Please Wait +
    +
    +{{/zone}} + +{{#zone "bottomJs"}} + + {{js "/js/script.js"}} +{{/zone}} + +{{#zone "topCss"}} + +{{/zone}} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.js new file mode 100644 index 0000000000..f0df8f166e --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +function onRequest(context) { + var constants = require("/app/modules/constants.js"); + var skipWelcomeScreen = session.get(constants.SKIP_WELCOME_SCREEN); + if (skipWelcomeScreen) { + response.sendRedirect(context.app.context + "/"); + exit(); + } + return {}; +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.json new file mode 100644 index 0000000000..add6d0c2de --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/processing.json @@ -0,0 +1,5 @@ +{ + "version": "1.0.0", + "uri": "/welcome", + "layout": "cdmf.layout.loading" +} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/public/js/script.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/public/js/script.js new file mode 100644 index 0000000000..b45759dfba --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.processing/public/js/script.js @@ -0,0 +1,30 @@ +var pollingCount = 24; +function poll() { + $.ajax({ + url: context + "/api/user/environment-loaded", + type: "GET", + success: function (data) { + if (data.isLoaded) { + window.location = context + "/"; + } + }, + dataType: "json", + complete: setTimeout(function () { + pollingCount = pollingCount - 1; + if (pollingCount > 0) { + poll(); + } else { + $(".loading-animation .logo").hide(); + $(".loading-animation").prepend( + ''); + $(".loading-animation p").css("width", "150%") + .html("Ops... it seems something went wrong.
    Refresh the page to retry!"); + } + }, 5000), + timeout: 5000 + }); +} + +$(document).ready(function () { + poll(); +}); \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.hbs index fc4ecd9efc..2df360ab3a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.hbs @@ -17,8 +17,8 @@ }} {{#zone "footer"}}

    - - WSO2 IoT Server 3.1.0 | © , + + WSO2 IoT Server{{#unless isCloud}} 3.1.0{{/unless}} | © , Inc. All Rights Reserved.

    {{/zone}} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.js new file mode 100644 index 0000000000..2df5f2c493 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.footer/footer.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +function onRequest(context) { + var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; + var page = {}; + page["isCloud"] = devicemgtProps.isCloud; + return page; +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs index 78aa84e001..f5416944dd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/nav-menu.hbs @@ -87,7 +87,6 @@
  • Policy Management
  • {{/if}} - {{#unless isCloud}} {{#if permissions.TENANT_CONFIGURATION}}
  • Configuration Management
      @@ -99,7 +98,6 @@
  • {{/if}} - {{/unless}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js index 07ddd59f2a..40c1cdd4f0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.ui.navbar.nav-menu/public/js/nav-menu.js @@ -456,15 +456,18 @@ $(document).ready(function () { function statisticLoad(redirectUrl) { var contentType = "application/json"; - - var uri = backendEndBasePath + "/admin/devicetype/deploy/device_management/status"; var defaultStatusClasses = "fw fw-stack-1x"; var content = $("#statistic-response-template").find(".content"); var title = content.find("#title"); var statusIcon = content.find("#status-icon"); - invokerUtil.get(uri, function (data, textStatus, jqXHR) { - if (jqXHR.status == 204) { + $.ajax({ + url: redirectUrl, + type: "GET", + success: function () { + window.location.href = redirectUrl; + }, + error: function() { var urix = backendEndBasePath + "/admin/devicetype/deploy/device_management"; var device = {}; invokerUtil.post(urix, device, function (data) { @@ -472,25 +475,39 @@ function statisticLoad(redirectUrl) { statusIcon.attr("class", defaultStatusClasses + " fw-check"); $(modalPopupContent).html(content.html()); showPopup(); - setTimeout(function () { - hidePopup(); - // location.reload(true); - location.href = redirectUrl; - }, 20000); - + poll(redirectUrl); }, function (jqXHR) { title.html("Failed to deploy artifacts, Please contact administrator."); statusIcon.attr("class", defaultStatusClasses + " fw-error"); $(modalPopupContent).html(content.html()); showPopup(); }, contentType); - } else { - location.href = redirectUrl; } - }, function (jqXHR) { - title.html("Failed to connect with server, Please contact administrator."); - statusIcon.attr("class", defaultStatusClasses + " fw-error"); - $(modalPopupContent).html(content.html()); - showPopup(); - }, contentType); + }); + } +var pollingCount = 15; +function poll(portalUrl) { + var content = $("#statistic-response-template").find(".content"); + var title = content.find("#title"); + var defaultStatusClasses = "fw fw-stack-1x"; + var statusIcon = content.find("#status-icon"); + $.ajax({ + url: portalUrl, + type: "GET", + success: function (data) { + window.location.href = portalUrl; + }, + dataType: "json", + error: setTimeout(function () { + pollingCount = pollingCount - 1; + if (pollingCount > 0) { + poll(portalUrl); + } else { + window.location.href = portalUrl; + } + }, 5000), + timeout: 5000 + }); +} + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml index fc69cf70bf..9c41c02669 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml @@ -23,7 +23,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 48cafc1ea7..3716fea159 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml index 6763af8f9b..100a0b9347 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt email-sender - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/email-sender/pom.xml b/components/email-sender/pom.xml index 721ea1cd19..c0cf986f91 100644 --- a/components/email-sender/pom.xml +++ b/components/email-sender/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml index dd0577036f..1fdb8539c3 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml @@ -21,7 +21,7 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index 6bc8659d99..f16bb6f9dc 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -21,7 +21,7 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml index c69c106e65..f25c5e58b6 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml @@ -21,13 +21,13 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.registration - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Dynamic client registration service WSO2 Carbon - Dynamic Client Registration Service diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml index 150d28e59f..713a789a4d 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml @@ -21,13 +21,13 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.web.app.registration - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Dynamic client web app registration WSO2 Carbon - Dynamic Client Web-app Registration Service diff --git a/components/identity-extensions/dynamic-client-registration/pom.xml b/components/identity-extensions/dynamic-client-registration/pom.xml index 3ff7cc5006..164cd016cd 100644 --- a/components/identity-extensions/dynamic-client-registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt identity-extensions - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt dynamic-client-registration - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Dynamic client registration http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index 4fdc96116f..c40c7e4296 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt identity-extensions - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - OAuth Extensions http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index 59134cf8ce..ad287d9e51 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -21,7 +21,7 @@ identity-extensions org.wso2.carbon.devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT 4.0.0 diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index 76a7c3a703..f0effb3f80 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt identity-extensions - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index 2fec45a8ab..9ca315da73 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml index c4e27f9502..d606db126b 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.complex.policy.decision.point - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml index f221e66edf..9eb3c490f1 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml @@ -3,14 +3,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.decision.point - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml index e8950628e8..d12c999aa0 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.information.point - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Policy Information Point WSO2 Carbon - Policy Information Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index 6161ccefac..13e424e73a 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Policy Management Common WSO2 Carbon - Policy Management Common diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index cb9c2ce287..22c4afd898 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Policy Management Core WSO2 Carbon - Policy Management Core diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml index 0f2d566220..fa765e3e55 100644 --- a/components/policy-mgt/pom.xml +++ b/components/policy-mgt/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 policy-mgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Policy Management Component http://wso2.org diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 645c5b96d5..4fd0512135 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.webapp.authenticator.framework - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT bundle WSO2 Carbon - Web Application Authenticator Framework Bundle WSO2 Carbon - Web Application Authenticator Framework Bundle diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java index a402f18e7c..e47208a490 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java @@ -164,4 +164,4 @@ public class CertificateAuthenticator implements WebappAuthenticator { return null; } -} +} \ No newline at end of file diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml index a052e3633d..d72d494b2f 100644 --- a/components/webapp-authenticator-framework/pom.xml +++ b/components/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml index 088c01a561..e164f5d271 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.application.extension.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - API Management Application Extension Feature http://wso2.org This feature contains an implementation of a api application registration, which takes care of subscription diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml index 2731f30adc..995078fded 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handler.server.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Management - APIM handler Server Feature http://wso2.org This feature contains the handler for the api authentications diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml index 7f2c5a79dc..e0e41371de 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client.feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - APIM Integration Client Feature http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index 9b57951f4f..100d410240 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - API Management Webapp Publisher Feature http://wso2.org This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 87abf167a5..51a463726d 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - API Management Extensions Feature http://wso2.org diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml index 366784ab2b..971682b88e 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml index d2405a11aa..242bcbea3b 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml index db79f9d7c5..e4e0159240 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.server.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Certificate Management Server Feature http://wso2.org This feature contains the core bundles required for back-end Certificate Management functionality diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index 6614d25e15..ef6eab1abf 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Certificate Management Feature http://wso2.org diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml index 0c9e49b6bd..f616420d20 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Type Deployer Feature http://wso2.org WSO2 Carbon - Device Type Deployer Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml index 1acbd9697f..34e37ea1e8 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - FCM Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml index 32061be220..4d7649ce67 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml index 499e0197d2..477cd98542 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - XMPP Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - XMPP Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml index e6b956cc52..25bb072f4b 100644 --- a/features/device-mgt-extensions/pom.xml +++ b/features/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml index 2513cb68ea..d8fdd298e5 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml @@ -3,13 +3,13 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.dashboard.feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Device Management Dashboard Analytics Feature WSO2 Carbon - Device Management Dashboard Analytics Feature diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml index 8bb3277838..0c38cb00b7 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.data.publisher.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains bundles related to device analytics data publisher diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml index deba1cfde9..ffd9ac79b6 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index 723073fd06..b873196eb3 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -4,14 +4,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Management Extensions Feature http://wso2.org This feature contains common extensions used by key device management functionalities diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index 437259ac6a..a7eb53b1c5 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml index 09423f8943..1d0dfe0a71 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.server.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml index f7fef0d55e..e4be480282 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index eceb963e6e..78c6c0076d 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml diff --git a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml index 94cb981d44..2d2b5487b8 100644 --- a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml +++ b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt dynamic-client-registration-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.registration.server.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Dynamic Client Registration Server Feature http://wso2.org This feature contains dynamic client registration features diff --git a/features/dynamic-client-registration/pom.xml b/features/dynamic-client-registration/pom.xml index 4552055324..995d7cf9eb 100644 --- a/features/dynamic-client-registration/pom.xml +++ b/features/dynamic-client-registration/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt dynamic-client-registration-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Dynamic Client Registration Feature http://wso2.org diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml index a7194c5fef..c390a1f0ad 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt email-sender-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.email.sender.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Email Sender Feature http://wso2.org This feature contains the core bundles required for email sender related functionality diff --git a/features/email-sender/pom.xml b/features/email-sender/pom.xml index 09a0b76f90..80f4d34062 100644 --- a/features/email-sender/pom.xml +++ b/features/email-sender/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt email-sender-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Email Sender Feature http://wso2.org diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml index f9b55908de..aed7c95ad2 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt jwt-client-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.identity.jwt.client.extension.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - JWT Client Feature http://wso2.org This feature contains jwt client implementation from which we can get a access token using the jwt diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml index 1822490693..8fb61d67ec 100644 --- a/features/jwt-client/pom.xml +++ b/features/jwt-client/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 jwt-client-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Dynamic Client Registration Feature http://wso2.org diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml index 90fb2ee5e5..162f65f86b 100644 --- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml +++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt oauth-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Mgt OAuth Extensions Feature http://wso2.org This feature contains devicemgt related OAuth extensions diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml index 18b9de5778..265b341501 100644 --- a/features/oauth-extensions/pom.xml +++ b/features/oauth-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt oauth-extensions-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Device Management OAuth Extensions Feature http://wso2.org diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml index 4500623609..12dac4d89e 100644 --- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml +++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt policy-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.policy.mgt.server.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Policy Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml index 45316268d8..7e0ec982e4 100644 --- a/features/policy-mgt/pom.xml +++ b/features/policy-mgt/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt policy-mgt-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Policy Management Feature http://wso2.org diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml index 1537be022a..8ac8a8b91b 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.webapp.authenticator.framework.server.feature pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Webapp Authenticator Framework Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml index a742ac1f0b..cf9594ccfd 100644 --- a/features/webapp-authenticator-framework/pom.xml +++ b/features/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework Feature http://wso2.org diff --git a/pom.xml b/pom.xml index ea58dcfca9..f9a412e9b9 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt pom - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT WSO2 Carbon - Device Management - Parent http://wso2.org WSO2 Connected Device Manager Components @@ -1813,7 +1813,7 @@ 1.2.11.wso2v10 - 2.0.55-SNAPSHOT + 2.0.65-SNAPSHOT 4.4.8