sync with upstream

apim420
Dharmakeerthi Lasantha 1 year ago
commit 0927dfc835

@ -18,25 +18,12 @@
package io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api;
import com.google.gson.JsonObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Extension;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Info;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
import io.entgra.device.mgt.core.apimgt.annotations.Scope;
import io.entgra.device.mgt.core.apimgt.annotations.Scopes;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import io.swagger.annotations.*;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
@SwaggerDefinition(
info = @Info(

@ -18,12 +18,7 @@
package io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api.addons;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@ -28,11 +28,7 @@ import org.apache.cxf.message.MessageContentsList;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.*;
import javax.validation.executable.ExecutableValidator;
import java.lang.reflect.Method;
import java.util.List;

@ -27,20 +27,12 @@ import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception.Gr
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean.GrafanaPanelIdentifier;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.MaliciousQueryAttempt;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal.GrafanaMgtDataHolder;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import java.io.IOException;
import java.sql.SQLException;

@ -25,6 +25,8 @@ import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean.GrafanaPa
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.GrafanaEnvVariablesNotDefined;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaConstants;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUtil;
import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil;
import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpResponse;
@ -35,8 +37,6 @@ import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil;
import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;

@ -35,6 +35,14 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
@ -48,12 +56,6 @@
<Export-Package>
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.*
</Export-Package>
<Import-Package>
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
com.fasterxml.jackson.annotation;version="${jackson-annotations.version}",
io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional,
com.google.gson
</Import-Package>
</instructions>
</configuration>
</plugin>

@ -35,10 +35,6 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
@ -65,6 +61,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
@ -77,15 +81,47 @@
<Bundle-Description>Grafana API Management Core Bundle</Bundle-Description>
<Private-Package>io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal</Private-Package>
<Import-Package>
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.*,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
javax.xml.bind.annotation,
javax.xml.bind,
org.apache.commons.lang,
org.wso2.carbon,
io.entgra.device.mgt.core.device.mgt.common.*,
io.entgra.device.mgt.core.device.mgt.core.*
io.entgra.device.mgt.core.application.mgt.core.*
com.google.common.cache;version="[31.0,32)",
com.google.gson;version="[2.9,3)",
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception;version="[5.0,6)",
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.config,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.config.xml.bean,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service.bean,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service.cache,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service.impl,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.sql.connection,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.sql.query,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.sql.query.encoder,
io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util,
io.entgra.device.mgt.core.application.mgt.common.exception;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.core.config;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.core.util;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.common.util;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.config.datasource;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.dao;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.report.mgt.config;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.report.mgt.dao.common;version="[5.0,6)",
javax.xml.bind;version="[0.0,1)",
javax.xml.bind.annotation;version="[0.0,1)",
javax.xml.parsers,
org.apache.commons.codec.binary;version="[1.9,2)",
org.apache.commons.lang;version="[2.6,3)",
org.apache.commons.lang3;version="[3.1,4)",
org.apache.commons.logging;version="[1.2,2)",
org.apache.http;version="[4.4,5)",
org.apache.http.client,
org.apache.http.client.methods,
org.apache.http.impl.client,
org.apache.juli.logging;version="[9.0,10)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.w3c.dom,org.wso2.carbon.context;version="[4.8,5)",
org.wso2.carbon.utils;version="[4.8,5)"
</Import-Package>
<Export-Package>
!io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal,
@ -103,15 +139,12 @@
<dependencies>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.orbit.org.scannotation</groupId>
<groupId>io.entgra.org.scannotation</groupId>
<artifactId>scannotation</artifactId>
</dependency>
<dependency>
@ -132,7 +165,6 @@
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
@ -246,14 +278,6 @@
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom</artifactId>
</dependency>
<!--dependency>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.axiom.wso2</groupId>
<artifactId>axiom</artifactId>
</dependency-->
<dependency>
<groupId>org.apache.axis2.wso2</groupId>
<artifactId>axis2</artifactId>

@ -26,16 +26,19 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
/**
* @scr.component name="io.entgra.analytics.mgt.grafana.proxy.grafanamanagementservicecomponent" immediate="true"
*/
@Component(
name = "io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal.GrafanaManagementServiceComponent",
immediate = true)
public class GrafanaManagementServiceComponent {
private static Log log = LogFactory.getLog(GrafanaManagementServiceComponent.class);
@SuppressWarnings("unused")
@Activate
protected void activate(ComponentContext componentContext) {
try {
if (log.isDebugEnabled()) {
@ -60,6 +63,7 @@ public class GrafanaManagementServiceComponent {
}
@SuppressWarnings("unused")
@Deactivate
protected void deactivate(ComponentContext componentContext) {
if (log.isDebugEnabled()) {
log.debug("De-activating Grafana Management Service Component");

@ -27,9 +27,14 @@
<artifactId>io.entgra.device.mgt.core.apimgt.analytics.extension</artifactId>
<packaging>bundle</packaging>
<name>Entgra - API mgt analytics extension</name>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.core</artifactId>
@ -40,7 +45,7 @@
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<artifactId>velocity-engine-core</artifactId>
</dependency>
</dependencies>
@ -56,8 +61,12 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -72,10 +81,11 @@
<Private-Package>io.entgra.device.mgt.core.apimgt.application.extension.internal</Private-Package>
<Import-Packages>
io.entgra.device.mgt.core.apimgt.analytics.extension.dto,
io.entgra.device.mgt.core.apimgt.analytics.extension.exception,
org.apache.velocity,
org.apache.velocity.app,
org.apache.velocity.context,
org.wso2.carbon.utils;version="[4.6,5)"
org.wso2.carbon.utils;version="[4.8,5)"
</Import-Packages>
<Export-Package>
io.entgra.device.mgt.core.apimgt.analytics.extension.*

@ -27,16 +27,11 @@ import io.entgra.device.mgt.core.apimgt.analytics.extension.exception.EventStrea
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
import org.wso2.carbon.utils.CarbonUtils;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
import java.io.*;
public class AnalyticsArtifactsDeployer {

@ -31,22 +31,18 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Annotations</name>
<description>WSO2 Carbon - API Management Custom Annotation Module</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
@ -56,8 +52,12 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -72,15 +72,6 @@
<Export-Package>
io.entgra.device.mgt.core.apimgt.annotations.*
</Export-Package>
<Import-Package>
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.servlet,
javax.xml.*,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
org.apache.commons.lang
</Import-Package>
<Embed-Dependency>
scribe;scope=compile|runtime;inline=false;
</Embed-Dependency>

@ -30,7 +30,7 @@
<packaging>war</packaging>
<name>WSO2 Carbon - API Application Management API</name>
<description>This module provides capability to create api manager application.</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>
<dependency>
@ -159,10 +159,6 @@
<artifactId>org.wso2.carbon.registry.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.orbit.javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
</dependencies>
<build>

@ -18,18 +18,18 @@
package io.entgra.device.mgt.core.apimgt.application.extension.api;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService;
import io.entgra.device.mgt.core.apimgt.application.extension.api.util.APIUtil;
import io.entgra.device.mgt.core.apimgt.application.extension.api.util.RegistrationProfile;
import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants;
import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey;
import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import org.wso2.carbon.user.api.UserStoreException;
import javax.ws.rs.POST;

@ -17,20 +17,15 @@
*/
package io.entgra.device.mgt.core.apimgt.application.extension.api.filter;
import io.entgra.device.mgt.core.apimgt.application.extension.api.util.APIUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.application.extension.api.util.APIUtil;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.bind.JAXBContext;

@ -18,13 +18,13 @@
package io.entgra.device.mgt.core.apimgt.application.extension.api.util;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.registry.api.Resource;
import org.wso2.carbon.registry.core.Registry;
import org.wso2.carbon.registry.core.exceptions.RegistryException;

@ -31,9 +31,14 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Application Management</name>
<description>This module provides capability to create api manager application.</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.registry.core</artifactId>
@ -93,8 +98,12 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -108,9 +117,16 @@
<Bundle-Description>API Management Application Bundle</Bundle-Description>
<Private-Package>io.entgra.device.mgt.core.apimgt.application.extension.internal</Private-Package>
<Import-Packages>
io.entgra.device.mgt.core.apimgt.application.extension.bean,
io.entgra.device.mgt.core.apimgt.application.extension.dto,
io.entgra.device.mgt.core.apimgt.application.extension.exception,
io.entgra.device.mgt.core.identity.jwt.client.extension;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension.dto;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension.exception;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension.service;version="[5.0,6)",
org.apache.commons.lang;version="[2.6,3)",
org.apache.commons.logging;version="[1.2,2)",
org.json.simple,
org.json.simple;version="[1.1,2)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.apimgt.api;version="${carbon.api.mgt.version.range}",
@ -127,12 +143,18 @@
io.entgra.device.mgt.core.identity.jwt.client.extension.exception,
io.entgra.device.mgt.core.identity.jwt.client.extension.service,
io.entgra.device.mgt.core.apimgt.extension.rest.api,
org.wso2.carbon.apimgt.api;version="[9.28,10)",
org.wso2.carbon.apimgt.api.dto;version="[9.28,10)",
org.wso2.carbon.apimgt.api.model;version="[9.28,10)",
org.wso2.carbon.apimgt.impl;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.utils;version="[9.28,10)",
org.wso2.carbon.context;version="[4.8,5)",
org.wso2.carbon.registry.core.exceptions;version="[1.0,2)",
org.wso2.carbon.registry.core.service;version="[1.0,2)",
org.wso2.carbon.registry.indexing.service;version="${carbon.registry.imp.pkg.version.range}",
org.wso2.carbon.registry.indexing.service;version="[4.8,5)",
org.wso2.carbon.user.api;version="[1.0,2)",
org.wso2.carbon.user.core.service;version="${carbon.kernel.version.range}",
org.wso2.carbon.user.core.tenant;version="${carbon.kernel.version.range}"
org.wso2.carbon.user.core.service;version="[4.8,5)",
org.wso2.carbon.user.core.tenant;version="[4.8,5)"
</Import-Packages>
<Export-Package>
!io.entgra.device.mgt.core.apimgt.application.extension.internal,

@ -18,6 +18,16 @@
package io.entgra.device.mgt.core.apimgt.application.extension;
import io.entgra.device.mgt.core.apimgt.application.extension.bean.APIRegistrationProfile;
import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants;
import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey;
import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException;
import io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder;
import io.entgra.device.mgt.core.apimgt.application.extension.util.APIManagerUtil;
import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient;
import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException;
import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.bean.APIMConsumer.APIInfo;
@ -41,21 +51,11 @@ import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper;
import org.wso2.carbon.apimgt.api.model.Application;
import org.wso2.carbon.apimgt.api.model.SubscribedAPI;
import org.wso2.carbon.apimgt.api.model.Subscriber;
import io.entgra.device.mgt.core.apimgt.application.extension.bean.APIRegistrationProfile;
import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants;
import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey;
import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException;
import io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder;
import io.entgra.device.mgt.core.apimgt.application.extension.util.APIManagerUtil;
import org.wso2.carbon.apimgt.impl.APIAdminImpl;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient;
import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException;
import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.apimgt.application.extension.dto;
import org.json.simple.JSONObject;
import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants;
import org.json.simple.JSONObject;
/**
* This holds api application consumer key and secret.

@ -19,54 +19,25 @@ package io.entgra.device.mgt.core.apimgt.application.extension.internal;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderServiceImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService;
import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderServiceImpl;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.*;
import org.wso2.carbon.registry.core.service.TenantRegistryLoader;
import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader;
import org.wso2.carbon.user.core.service.RealmService;
/**
* @scr.component name="io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionServiceComponent"
* @scr.reference name="tenant.registryloader"
* interface="org.wso2.carbon.registry.core.service.TenantRegistryLoader"
* cardinality="1..1"
* policy="dynamic"
* bind="setTenantRegistryLoader"
* unbind="unsetTenantRegistryLoader"
* @scr.reference name="tenant.indexloader"
* interface="org.wso2.carbon.registry.indexing.service.TenantIndexingLoader"
* cardinality="1..1"
* policy="dynamic"
* bind="setIndexLoader"
* unbind="unsetIndexLoader"
* @scr.reference name="realm.service"
* immediate="true"
* interface="org.wso2.carbon.user.core.service.RealmService"
* cardinality="1..1"
* policy="dynamic"
* bind="setRealmService"
* unbind="unsetRealmService"
* @scr.reference name="apimgt.extension.ConsumerRESTAPIServices"
* interface="io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices"
* cardinality="0..1"
* policy="dynamic"
* bind="setConsumerRESTAPIServices"
* unbind="unsetConsumerRESTAPIServices"
* @scr.reference name="apimgt.extension.APIApplicationService"
* interface="io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices"
* cardinality="0..1"
* policy="dynamic"
* bind="setAPIApplicationServices"
* unbind="unsetAPIApplicationServices"
*/
@Component(
name = "io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionServiceComponent",
immediate = true)
public class APIApplicationManagerExtensionServiceComponent {
private static final Log log = LogFactory.getLog(APIApplicationManagerExtensionServiceComponent.class);
@Activate
protected void activate(ComponentContext componentContext) {
try {
if (log.isDebugEnabled()) {
@ -81,10 +52,17 @@ public class APIApplicationManagerExtensionServiceComponent {
}
}
@Deactivate
protected void deactivate(ComponentContext componentContext) {
//do nothing
}
@Reference(
name = "tenant.registry.loader",
service = org.wso2.carbon.registry.core.service.TenantRegistryLoader.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetTenantRegistryLoader")
protected void setTenantRegistryLoader(TenantRegistryLoader tenantRegistryLoader) {
APIApplicationManagerExtensionDataHolder.getInstance().setTenantRegistryLoader(tenantRegistryLoader);
}
@ -93,6 +71,12 @@ public class APIApplicationManagerExtensionServiceComponent {
APIApplicationManagerExtensionDataHolder.getInstance().setTenantRegistryLoader(null);
}
@Reference(
name = "tenant.index.loader",
service = org.wso2.carbon.registry.indexing.service.TenantIndexingLoader.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetIndexLoader")
protected void setIndexLoader(TenantIndexingLoader indexLoader) {
if (indexLoader != null && log.isDebugEnabled()) {
log.debug("IndexLoader service initialized");
@ -109,6 +93,12 @@ public class APIApplicationManagerExtensionServiceComponent {
*
* @param realmService An instance of RealmService
*/
@Reference(
name = "realm.service",
service = org.wso2.carbon.user.core.service.RealmService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetRealmService")
protected void setRealmService(RealmService realmService) {
if (log.isDebugEnabled()) {
log.debug("Setting Realm Service");
@ -133,6 +123,12 @@ public class APIApplicationManagerExtensionServiceComponent {
*
* @param consumerRESTAPIServices An instance of ConsumerRESTAPIServices
*/
@Reference(
name = "APIM.consumer.service",
service = io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetConsumerRESTAPIServices")
protected void setConsumerRESTAPIServices(ConsumerRESTAPIServices consumerRESTAPIServices) {
if (log.isDebugEnabled()) {
log.debug("Setting APIM Consumer REST API Service");
@ -158,6 +154,12 @@ public class APIApplicationManagerExtensionServiceComponent {
*
* @param apiApplicationServices An instance of APIApplicationServices
*/
@Reference(
name = "APIM.application.service",
service = io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetAPIApplicationServices")
protected void setAPIApplicationServices(APIApplicationServices apiApplicationServices) {
if (log.isDebugEnabled()) {
log.debug("Setting DCR REST API Service");
@ -176,5 +178,4 @@ public class APIApplicationManagerExtensionServiceComponent {
}
APIApplicationManagerExtensionDataHolder.getInstance().setApiApplicationServices(null);
}
}

@ -17,10 +17,10 @@
*/
package io.entgra.device.mgt.core.apimgt.application.extension.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException;
import io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.registry.core.exceptions.RegistryException;

@ -34,6 +34,11 @@
<url>https://entgra.io</url>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient.wso2</groupId>
<artifactId>commons-httpclient</artifactId>
@ -54,17 +59,6 @@
<artifactId>org.wso2.carbon.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json.wso2</groupId>
<artifactId>json</artifactId>
@ -89,8 +83,12 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -110,17 +108,23 @@
io.entgra.device.mgt.core.apimgt.extension.rest.api.*
</Export-Package>
<Import-Package>
com.google.gson;version="[2.9,3)",
io.entgra.device.mgt.core.apimgt.extension.rest.api,
io.entgra.device.mgt.core.apimgt.extension.rest.api.dto,
io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo,
io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions,
io.entgra.device.mgt.core.apimgt.extension.rest.api.util,
javax.net.ssl,okhttp3;version="[4.9,5)",
org.apache.commons.lang;version="[2.6,3)",
org.apache.commons.logging;version="[1.2,2)",
org.apache.commons.ssl;version="[3.1,4)",
org.json;version="[3.0,4)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.core;version="4.6",
org.wso2.carbon.core.util;version="4.6",
org.apache.commons.ssl,
org.wso2.carbon.apimgt.api.model,
okhttp3.*,
org.wso2.carbon.apimgt.impl;version="${carbon.api.mgt.version.range}",
org.wso2.carbon.apimgt.impl.utils;version="${carbon.api.mgt.version.range}",
org.wso2.carbon.apimgt.impl.internal;version="${carbon.api.mgt.version.range}",
org.json
org.wso2.carbon.apimgt.api.model;version="[9.28,10)",
org.wso2.carbon.apimgt.impl;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.internal;version="[9.28,10)",
org.wso2.carbon.base;version="[1.0,2)"
</Import-Package>
</instructions>
</configuration>

@ -19,20 +19,15 @@
package io.entgra.device.mgt.core.apimgt.extension.rest.api;
import com.google.gson.Gson;
import org.json.JSONObject;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.RequestBody;
import okhttp3.Credentials;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils;
import okhttp3.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONObject;
import org.wso2.carbon.apimgt.impl.APIManagerConfiguration;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;

@ -19,18 +19,13 @@
package io.entgra.device.mgt.core.apimgt.extension.rest.api;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
import org.json.JSONObject;
import org.wso2.carbon.apimgt.api.model.APIIdentifier;
import org.wso2.carbon.apimgt.api.model.Scope;
import org.wso2.carbon.apimgt.api.model.Mediation;
import org.wso2.carbon.apimgt.api.model.APIRevision;
import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment;
import org.wso2.carbon.apimgt.api.model.Documentation;
import org.wso2.carbon.apimgt.api.model.*;
import java.util.List;

@ -21,30 +21,21 @@ package io.entgra.device.mgt.core.apimgt.extension.rest.api;
import com.google.gson.Gson;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.ScopeUtils;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.RequestBody;
import okhttp3.*;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.ssl.Base64;
import org.json.JSONArray;
import org.json.JSONObject;
import org.wso2.carbon.apimgt.api.model.APIIdentifier;
import org.wso2.carbon.apimgt.api.model.Scope;
import org.wso2.carbon.apimgt.api.model.Mediation;
import org.wso2.carbon.apimgt.api.model.APIRevision;
import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment;
import org.wso2.carbon.apimgt.api.model.Documentation;
import org.wso2.carbon.apimgt.api.model.*;
import java.io.IOException;
import java.util.List;

@ -26,22 +26,17 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.*;
import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
/**
* @scr.component name="internal.io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServiceComponent"
* immediate="true"
* @scr.reference name="user.apimanagerconfigurationservice.default"
* interface="org.wso2.carbon.apimgt.impl.APIManagerConfigurationService"
* cardinality="1..1"
* policy="dynamic"
* bind="setAPIManagerConfigurationService"
* unbind="unsetAPIManagerConfigurationService"
*/
@Component(
name = "io.entgra.device.mgt.core.apimgt.extension.rest.api.internal.PublisherRESTAPIServiceComponent",
immediate = true)
public class PublisherRESTAPIServiceComponent {
private static final Log log = LogFactory.getLog(PublisherRESTAPIServiceComponent.class);
@Activate
protected void activate(ComponentContext componentContext) {
if (log.isDebugEnabled()) {
log.debug("Initializing publisher API extension bundle");
@ -64,11 +59,17 @@ public class PublisherRESTAPIServiceComponent {
log.error("Error occurred while initializing API Application bundle", e);
}
}
@Deactivate
protected void deactivate(ComponentContext componentContext) {
//do nothing
}
@Reference(
name = "apim.configuration.service",
service = org.wso2.carbon.apimgt.impl.APIManagerConfigurationService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetAPIManagerConfigurationService")
protected void setAPIManagerConfigurationService(APIManagerConfigurationService apiManagerConfigurationService) {
if (log.isDebugEnabled()) {
log.debug("Setting API Manager Configuration Service");

@ -25,30 +25,12 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.ServerConfiguration;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import javax.net.ssl.SSLSession;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.*;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.URI;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.SecureRandom;
import java.net.*;
import java.security.*;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.List;

@ -29,15 +29,16 @@
<packaging>war</packaging>
<name>WSO2 Carbon - API Key Management API</name>
<description>This module extends the API manager's key management apis.</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>WEB-INF/lib/*cxf*.jar</packagingExcludes>

@ -18,12 +18,7 @@
package io.entgra.device.mgt.core.apimgt.keymgt.extension.api;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@ -28,12 +28,7 @@ import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnAuthorizedException;
import javax.ws.rs.Consumes;
import javax.ws.rs.FormParam;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.Base64;

@ -19,9 +19,9 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxrs="http://cxf.apache.org/jaxrs"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd">
<jaxrs:server id="services" address="/">
<jaxrs:serviceBeans>

@ -30,9 +30,14 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Key Management</name>
<description>This module extends the API manager's key management.</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId>
@ -55,8 +60,12 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -70,10 +79,40 @@
<Bundle-Description>API Management Application Bundle</Bundle-Description>
<Private-Package>io.entgra.device.mgt.core.apimgt.keymgt.extension.internal</Private-Package>
<Import-Packages>
io.entgra.device.mgt.core.apimgt.application.extension,
io.entgra.device.mgt.core.apimgt.application.extension.*,
io.entgra.device.mgt.core.device.mgt.common.*,
io.entgra.device.mgt.core.device.mgt.core.*
com.google.gson;version="[2.9,3)",
io.entgra.device.mgt.core.apimgt.keymgt.extension,
io.entgra.device.mgt.core.apimgt.keymgt.extension.exception,
io.entgra.device.mgt.core.apimgt.keymgt.extension.service,
io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.config.keymanager;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.permission.mgt;version="[5.0,6)",
javax.cache;version="[1.0,2)",
javax.net.ssl,okhttp3;version="[4.9,5)",
org.apache.commons.lang;version="[2.4,3)",
org.apache.commons.logging;version="[1.2,2)",
org.json;version="[3.0,4)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.apimgt.api;version="[9.28,10)",
org.wso2.carbon.apimgt.api.model;version="[9.28,10)",
org.wso2.carbon.apimgt.api.model.subscription;version="[9.28,10)",
org.wso2.carbon.apimgt.impl;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.caching;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.dto;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.factory;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.jwt;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.utils;version="[9.28,10)",
org.wso2.carbon.apimgt.keymgt;version="[9.28,10)",
org.wso2.carbon.apimgt.keymgt.handlers;version="[9.28,10)",
org.wso2.carbon.apimgt.keymgt.model;version="[9.28,10)",
org.wso2.carbon.apimgt.keymgt.model.entity;version="[9.28,10)",
org.wso2.carbon.apimgt.keymgt.service;version="[9.28,10)",
org.wso2.carbon.context;version="[4.8,5)",
org.wso2.carbon.user.api;version="[1.0,2)",
org.wso2.carbon.user.core.service;version="[4.8,5)",
org.wso2.carbon.user.core.tenant;version="[4.8,5)",
org.wso2.carbon.utils.multitenancy;version="[4.8,5)"
</Import-Packages>
<Export-Package>
!io.entgra.device.mgt.core.apimgt.keymgt.extension.internal,

@ -18,6 +18,7 @@
package io.entgra.device.mgt.core.apimgt.keymgt.extension;
import org.osgi.service.component.annotations.Component;
import org.wso2.carbon.apimgt.api.model.ConfigurationDto;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.DefaultKeyManagerConnectorConfiguration;
@ -27,9 +28,10 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* @scr.component name="io.entgra.device.mgt.core.apimgt.keymgt.extension.customKeyManagerConfigComponent" immediate="true"
*/
@Component(
name = "io.entgra.device.mgt.core.apimgt.keymgt.extension.KeyManagerConnectorConfiguration",
service = DefaultKeyManagerConnectorConfiguration.class,
immediate = true)
public class KeyManagerConnectorConfiguration extends DefaultKeyManagerConnectorConfiguration {
@Override

@ -17,6 +17,10 @@
*/
package io.entgra.device.mgt.core.apimgt.keymgt.extension;
import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission;
import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException;
import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService;
import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionManagerServiceImpl;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -36,22 +40,12 @@ import org.wso2.carbon.apimgt.keymgt.model.SubscriptionDataStore;
import org.wso2.carbon.apimgt.keymgt.model.entity.API;
import org.wso2.carbon.apimgt.keymgt.service.TokenValidationContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission;
import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException;
import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService;
import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionManagerServiceImpl;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.service.RealmService;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.*;
public class KeyValidationHandler extends DefaultKeyValidationHandler {

@ -18,21 +18,24 @@
package io.entgra.device.mgt.core.apimgt.keymgt.extension.internal;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl;
/**
* @scr.component name="io.entgra.device.mgt.core.apimgt.keymgt.extension.keyMgtServiceComponent" immediate="true"
*/
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
@Component(
name = "io.entgra.device.mgt.core.apimgt.keymgt.extension.internal.KeyMgtServiceComponent",
immediate = true)
public class KeyMgtServiceComponent {
private static final Log log = LogFactory.getLog(KeyMgtServiceComponent.class);
@SuppressWarnings("unused")
@Activate
protected void activate(ComponentContext componentContext) {
try {
if (log.isDebugEnabled()) {
@ -54,6 +57,7 @@ public class KeyMgtServiceComponent {
}
@SuppressWarnings("unused")
@Deactivate
protected void deactivate(ComponentContext componentContext) {
if (log.isDebugEnabled()) {
log.debug("De-activating Key Management Service Component");

@ -19,13 +19,13 @@
package io.entgra.device.mgt.core.apimgt.keymgt.extension.service;
import com.google.gson.Gson;
import okhttp3.Credentials;
import okhttp3.FormBody;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.*;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.BadRequestException;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.KeyMgtException;
import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager;
import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig;
import io.entgra.device.mgt.core.device.mgt.core.config.keymanager.KeyManagerConfigurations;
import okhttp3.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONObject;
@ -34,18 +34,7 @@ import org.wso2.carbon.apimgt.api.APIManagementException;
import org.wso2.carbon.apimgt.api.model.Application;
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.DCRResponse;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.KeyManagerPayload;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.KeyMgtConstants;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.OAuthApplication;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.TokenRequest;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.TokenResponse;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.BadRequestException;
import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.KeyMgtException;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager;
import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig;
import io.entgra.device.mgt.core.device.mgt.core.config.keymanager.KeyManagerConfigurations;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.api.UserStoreManager;
@ -59,11 +48,7 @@ import javax.net.ssl.X509TrustManager;
import java.io.IOException;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
public class KeyMgtServiceImpl implements KeyMgtService {

@ -31,22 +31,19 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Webapp Publisher</name>
<description>WSO2 Carbon - API Management Webapp Publisher</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
@ -67,7 +64,6 @@
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
@ -82,7 +78,7 @@
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.orbit.org.scannotation</groupId>
<groupId>io.entgra.org.scannotation</groupId>
<artifactId>scannotation</artifactId>
</dependency>
<dependency>
@ -138,8 +134,12 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -158,47 +158,43 @@
io.entgra.device.mgt.core.apimgt.webapp.publisher.*
</Export-Package>
<Import-Package>
com.google.gson;version="[2.3,2.8.6)",
com.google.gson.reflect;version="[2.3,2.8.6)",
io.swagger.annotations,
javax.servlet;version="2.6",
javax.xml,
javax.xml.bind,
javax.xml.bind.annotation,
javax.xml.parsers,
org.apache.catalina;version="9.0",
org.apache.catalina.core;version="9.0",
org.apache.commons.logging;version="1.2",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.scannotation;version="1.0",
org.scannotation.archiveiterator;version="1.0",
org.w3c.dom,
io.entgra.device.mgt.core.apimgt.extension.rest.api.*,
io.entgra.device.mgt.core.apimgt.annotations,
org.wso2.carbon.apimgt.api,
org.wso2.carbon.apimgt.api.model,
org.wso2.carbon.apimgt.impl,
org.wso2.carbon.apimgt.impl.utils,
io.entgra.device.mgt.core.apimgt.webapp.publisher,
com.google.gson;version="[2.9,3)",
com.google.gson.reflect;version="[2.9,3)",
io.entgra.device.mgt.core.apimgt.annotations;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.extension.rest.api;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.extension.rest.api.dto;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.webapp.publisher.config,
io.entgra.device.mgt.core.apimgt.webapp.publisher.dto,
io.entgra.device.mgt.core.apimgt.webapp.publisher.exception,
io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.listener,
io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util,
org.wso2.carbon.base;version="1.0",
org.wso2.carbon.context;version="4.6",
org.wso2.carbon.core;version="4.6",
org.wso2.carbon.core.util;version="4.6",
org.wso2.carbon.registry.core.service;version="1.0",
org.wso2.carbon.user.api;version="1.0",
org.wso2.carbon.user.core.service;version="4.6",
org.wso2.carbon.user.core.tenant;version="4.6",
org.wso2.carbon.utils;version="4.6",
org.wso2.carbon.utils.multitenancy;version="4.6",
org.wso2.carbon.apimgt.impl.definitions,
org.apache.commons.lang,
org.json
io.swagger.annotations;version="[1.6,2)",
javax.servlet;version="[2.6,3)",
javax.xml.bind;version="[0.0,1)",
javax.xml.bind.annotation;version="[0.0,1)",
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}",
org.apache.catalina;version="${catalina.version.range}",
org.apache.catalina.core;version="${catalina.version.range}",
org.apache.commons.lang;version="[2.6,3)",
org.apache.commons.logging;version="[1.2,2)",
org.json;version="[3.0,4)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.scannotation;version="[1.0,2)",
org.scannotation.archiveiterator;version="[1.0,2)",
org.w3c.dom,
org.wso2.carbon.apimgt.api;version="[9.28,10)",
org.wso2.carbon.apimgt.api.model;version="[9.28,10)",
org.wso2.carbon.apimgt.impl;version="[9.28,10)",
org.wso2.carbon.apimgt.impl.utils;version="[9.28,10)",
org.wso2.carbon.context;version="[4.8,5)",
org.wso2.carbon.core;version="[4.8,5)",
org.wso2.carbon.core.util;version="[4.8,5)",
org.wso2.carbon.registry.core.service,
org.wso2.carbon.user.api,
org.wso2.carbon.user.core.service;version="[4.8,5)",
org.wso2.carbon.user.core.tenant;version="[4.8,5)",
org.wso2.carbon.utils;version="[4.8,5)"
</Import-Package>
<Embed-Dependency>
jsr311-api;scope=compile|runtime;inline=false

@ -23,33 +23,26 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServi
import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServicesImpl;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.api.model.Documentation;
import org.wso2.carbon.apimgt.api.model.DocumentationType;
import org.json.JSONArray;
import org.json.JSONObject;
import org.wso2.carbon.apimgt.api.APIManagementException;
import org.wso2.carbon.apimgt.api.APIProvider;
import org.wso2.carbon.apimgt.api.model.APIIdentifier;
import org.wso2.carbon.apimgt.api.model.APIRevision;
import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment;
import org.wso2.carbon.apimgt.api.model.CORSConfiguration;
import org.wso2.carbon.apimgt.api.model.Mediation;
import org.wso2.carbon.apimgt.api.model.Scope;
import org.wso2.carbon.apimgt.api.model.*;
import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.APIManagerFactory;
import org.wso2.carbon.apimgt.impl.utils.APIUtil;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.service.RealmService;
@ -65,16 +58,7 @@ import java.io.IOException;
import java.nio.file.DirectoryIteratorException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Date;
import java.util.*;
/**
* This class represents the concrete implementation of the APIPublisherService that corresponds to providing all

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.apimgt.webapp.publisher;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.core.ServerStartupObserver;
import java.util.Stack;

@ -23,8 +23,6 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.annotations.Scope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration;
@ -32,6 +30,8 @@ import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherC
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.core.util.Utils;

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.apimgt.webapp.publisher.config;
import org.w3c.dom.Document;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.InvalidConfigurationStateException;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.WebappPublisherConfigurationFailedException;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.WebappPublisherUtil;
import org.w3c.dom.Document;
import org.wso2.carbon.utils.CarbonUtils;
import javax.xml.bind.JAXBContext;

@ -17,37 +17,27 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher.internal;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherService;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherServiceImpl;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherStartupHandler;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.*;
import org.wso2.carbon.core.ServerStartupObserver;
import org.wso2.carbon.registry.core.service.RegistryService;
import org.wso2.carbon.user.core.service.RealmService;
/**
* @scr.component name="io.entgra.device.mgt.core.apimgt.webapp.publisher" immediate="true"
* @scr.reference name="user.realmservice.default"
* interface="org.wso2.carbon.user.core.service.RealmService"
* cardinality="1..1"
* policy="dynamic"
* bind="setRealmService"
* unbind="unsetRealmService"
* @scr.reference name="registry.service"
* interface="org.wso2.carbon.registry.core.service.RegistryService"
* cardinality="1..1"
* policy="dynamic"
* bind="setRegistryService"
* unbind="unsetRegistryService"
*/
@Component(
name = "io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherServiceComponent",
immediate = true)
public class APIPublisherServiceComponent {
private static Log log = LogFactory.getLog(APIPublisherServiceComponent.class);
@Activate
protected void activate(ComponentContext componentContext) {
try {
if (log.isDebugEnabled()) {
@ -71,6 +61,7 @@ public class APIPublisherServiceComponent {
}
}
@Deactivate
protected void deactivate(ComponentContext componentContext) {
//do nothing
}
@ -88,6 +79,12 @@ public class APIPublisherServiceComponent {
bundleContext.registerService(ServerStartupObserver.class, new APIPublisherStartupHandler(), null);
}
@Reference(
name = "user.realmservice.default",
service = org.wso2.carbon.user.core.service.RealmService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetRealmService")
protected void setRealmService(RealmService realmService) {
if (log.isDebugEnabled()) {
log.debug("Setting Realm Service");
@ -102,6 +99,12 @@ public class APIPublisherServiceComponent {
APIPublisherDataHolder.getInstance().setRealmService(null);
}
@Reference(
name = "registry.service",
service = org.wso2.carbon.registry.core.service.RegistryService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetRegistryService")
protected void setRegistryService(RegistryService registryService) {
if (registryService != null && log.isDebugEnabled()) {
log.debug("Registry service initialized");

@ -17,12 +17,6 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.listener;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.core.StandardContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherService;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil;
@ -30,6 +24,12 @@ import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfi
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
import org.apache.catalina.core.StandardContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.user.api.UserStoreException;

@ -20,27 +20,18 @@ package io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util;
import io.entgra.device.mgt.core.apimgt.annotations.Scope;
import io.entgra.device.mgt.core.apimgt.annotations.Scopes;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.SwaggerDefinition;
import org.apache.catalina.core.StandardContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import javax.servlet.ServletContext;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.HttpMethod;
import javax.ws.rs.OPTIONS;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.*;
import java.io.File;
import java.io.IOException;
import java.lang.annotation.Annotation;

@ -18,7 +18,6 @@
package io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util;
import org.scannotation.archiveiterator.*;
import java.io.File;
import java.io.IOException;
import java.net.URL;

@ -17,6 +17,13 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPICollectionApi;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.TestUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mockito.Mockito;
@ -32,13 +39,6 @@ import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIIndi
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.API;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIInfo;
import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIList;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPICollectionApi;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.TestUtils;
import java.lang.reflect.Field;
import java.util.*;

@ -17,9 +17,6 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
@ -28,6 +25,9 @@ import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockServletContext;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.TestUtils;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.registry.core.exceptions.RegistryException;
import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService;
@ -36,14 +36,11 @@ import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import javax.servlet.ServletContext;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.buildApiConfig;
import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.getApiEndpointUrl;
import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.setResourceAuthTypes;
import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.*;
/**
* This is the test class for {@link APIPublisherUtil}

@ -17,12 +17,13 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi;
import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.mockito.Mockito;
import org.testng.annotations.BeforeSuite;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.context.internal.OSGiDataHolder;
@ -33,7 +34,6 @@ import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService;
import org.wso2.carbon.registry.core.service.RegistryService;
import org.wso2.carbon.user.api.UserStoreException;
import org.wso2.carbon.user.core.service.RealmService;
import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException;
import java.io.File;
import java.io.InputStream;

@ -30,7 +30,7 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Security Handler Component</name>
<description>WSO2 Carbon - API Management Security Handler Module</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<dependencies>

@ -30,7 +30,7 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Client</name>
<description>WSO2 Carbon - API Management Integration Client</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<build>
<plugins>

@ -30,7 +30,7 @@
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Generated Client</name>
<description>WSO2 Carbon - API Management Integration Client</description>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<build>
<plugins>

@ -30,7 +30,7 @@
<artifactId>apimgt-extensions</artifactId>
<packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Component</name>
<url>http://wso2.org</url>
<url>https://entgra.io</url>
<modules>
<module>io.entgra.device.mgt.core.apimgt.webapp.publisher</module>
@ -43,23 +43,4 @@
<module>io.entgra.device.mgt.core.apimgt.extension.rest.api</module>
</modules>
<!-- <build>-->
<!-- <pluginManagement>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.felix</groupId>-->
<!-- <artifactId>maven-scr-plugin</artifactId>-->
<!--&lt;!&ndash; <version>1.7.2</version>&ndash;&gt;-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>generate-scr-scrdescriptor</id>-->
<!-- <goals>-->
<!-- <goal>scr</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </pluginManagement>-->
<!-- </build>-->
</project>

@ -29,12 +29,17 @@
<name>Entgra - Application Management Add-Ons</name>
<description>Entgra - Application Management Add-Ons</description>
<url>https://entgra.io</url>
<packaging>bundle</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -47,8 +52,21 @@
<Bundle-Version>${io.entgra.device.mgt.core.version}</Bundle-Version>
<Bundle-Description>Application Management Add-Ons Bundle</Bundle-Description>
<Import-Package>
com.google.gson,
io.swagger.annotations.*;resolution:=optional
com.google.gson;version="[2.9,3)",
io.entgra.device.mgt.core.application.mgt.addons.jaxrs,
javax.servlet;version="[4.0,5)",
javax.servlet.http;version="[4.0,5)",
javax.validation;version="[1.1,2)",
javax.validation.executable;version="[1.1,2)",
javax.ws.rs;version="[2.1,3)",
javax.ws.rs.core;version="[2.1,3)",
javax.ws.rs.ext;version="[2.1,3)",
org.apache.commons.logging;version="[1.2,2)",
org.apache.cxf.interceptor;version="[3.5,4)",
org.apache.cxf.jaxrs.lifecycle;version="[3.5,4)",
org.apache.cxf.jaxrs.model;version="[3.5,4)",
org.apache.cxf.message;version="[3.5,4)",
org.apache.cxf.phase;version="[3.5,4)"
</Import-Package>
<Export-Package>
io.entgra.device.mgt.core.application.mgt.addons.*
@ -60,6 +78,11 @@
</build>
<dependencies>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
@ -75,19 +98,10 @@
<artifactId>cxf-rt-transports-http</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>commons-codec.wso2</groupId>

@ -29,11 +29,7 @@ import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;

@ -21,8 +21,8 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import io.entgra.device.mgt.core.application.mgt.addons.jaxrs.AnnotationExclusionStrategy;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import javax.ws.rs.Consumes;
import javax.ws.rs.WebApplicationException;

@ -140,7 +140,6 @@
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>org.json.wso2</groupId>

@ -18,23 +18,11 @@
package io.entgra.device.mgt.core.application.mgt.api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.Extension;
import io.swagger.annotations.ExtensionProperty;
import io.swagger.annotations.Info;
import io.swagger.annotations.SwaggerDefinition;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationList;
import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse;
import io.swagger.annotations.*;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@ -18,9 +18,6 @@
package io.entgra.device.mgt.core.application.mgt.api.impl;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.api.ArtifactDownloadAPI;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager;
@ -29,18 +26,16 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestExcept
import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException;
import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
/**
* Implementation of ApplicationDTO Management related APIs.

@ -35,8 +35,12 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -49,13 +53,23 @@
<Bundle-Version>${io.entgra.device.mgt.core.version}</Bundle-Version>
<Bundle-Description>Application Management Common Bundle</Bundle-Description>
<Import-Package>
io.entgra.device.mgt.core.device.mgt.common.*;version="${io.entgra.device.mgt.core.version}",
io.entgra.device.mgt.core.device.mgt.core.dto;version="${io.entgra.device.mgt.core.version}",
com.google.gson,
io.swagger.annotations.*;resolution:=optional,
com.fasterxml.jackson.annotation,
javax.validation.constraints,
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
com.fasterxml.jackson.annotation;version="[2.9,3)",
com.google.gson;version="[2.9,3)",
io.entgra.device.mgt.core.application.mgt.common,
io.entgra.device.mgt.core.application.mgt.common.config,
io.entgra.device.mgt.core.application.mgt.common.dto,
io.entgra.device.mgt.core.application.mgt.common.exception,
io.entgra.device.mgt.core.application.mgt.common.response,
io.entgra.device.mgt.core.application.mgt.common.wrapper,
io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.app.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.common.exception;version="[5.0,6)",
io.swagger.annotations;version="[1.6,2)",
javax.validation.constraints;version="[2.0,3)",
javax.xml.bind.annotation;version="[0.0,1)"
<!-- org.apache.cxf.jaxrs.ext.multipart;version="[3.5,4)",-->
<!-- org.codehaus.jackson.annotate;version="[2.9,3)"-->
</Import-Package>
<Export-Package>
io.entgra.device.mgt.core.application.mgt.common.*
@ -68,18 +82,14 @@
<dependencies>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>commons-codec.wso2</groupId>

@ -18,9 +18,9 @@
package io.entgra.device.mgt.core.application.mgt.common;
import io.swagger.annotations.ApiModelProperty;
import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier;
import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;

@ -21,7 +21,6 @@ package io.entgra.device.mgt.core.application.mgt.common;
import io.entgra.device.mgt.core.device.mgt.common.Device;
import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier;
import java.util.ArrayList;
import java.util.List;
public class ApplicationSubscriptionInfo {

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.application.mgt.common;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.entgra.device.mgt.core.device.mgt.common.Device;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;

@ -20,8 +20,6 @@ package io.entgra.device.mgt.core.application.mgt.common;
import io.entgra.device.mgt.core.device.mgt.common.Device;
import java.sql.Timestamp;
public class DeviceSubscriptionData {
private int subId;

@ -17,8 +17,8 @@
*/
package io.entgra.device.mgt.core.application.mgt.common;
import io.swagger.annotations.ApiModelProperty;
import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;

@ -17,10 +17,10 @@
*/
package io.entgra.device.mgt.core.application.mgt.common;
import java.sql.Timestamp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.sql.Timestamp;
import java.util.List;
@ApiModel(value = "LifecycleState", description = "LifecycleState represents the Lifecycle state for an application release")

@ -20,8 +20,8 @@ package io.entgra.device.mgt.core.application.mgt.common.dto;
import com.google.gson.Gson;
import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType;
import io.entgra.device.mgt.core.application.mgt.common.SubAction;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType;
import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease;
import java.util.List;

@ -17,7 +17,9 @@
*/
package io.entgra.device.mgt.core.application.mgt.common.services;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationType;
import io.entgra.device.mgt.core.application.mgt.common.*;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException;
@ -25,20 +27,10 @@ import io.entgra.device.mgt.core.application.mgt.common.response.Application;
import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease;
import io.entgra.device.mgt.core.application.mgt.common.response.Category;
import io.entgra.device.mgt.core.application.mgt.common.response.Tag;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.*;
import io.entgra.device.mgt.core.device.mgt.common.Base64File;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact;
import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationList;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.LifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper;
import java.util.List;
/**
@ -525,4 +517,12 @@ public interface ApplicationManager {
String getPlistArtifact(String uuid) throws ApplicationManagementException;
List<ApplicationReleaseDTO> getReleaseByPackageNames(List<String> packageIds) throws ApplicationManagementException;
/**
* @param applicationRelease {@link ApplicationRelease}
* @param oldPackageName Old package name of the application
* @throws ApplicationManagementException Application management exception
*/
void updateAppIconInfo(ApplicationRelease applicationRelease, String oldPackageName)
throws ApplicationManagementException;
}

@ -17,12 +17,12 @@
*/
package io.entgra.device.mgt.core.application.mgt.common.services;
import io.entgra.device.mgt.core.application.mgt.common.Rating;
import io.entgra.device.mgt.core.application.mgt.common.response.Review;
import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.application.mgt.common.PaginationResult;
import io.entgra.device.mgt.core.application.mgt.common.Rating;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException;
import io.entgra.device.mgt.core.application.mgt.common.response.Review;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.ReviewWrapper;
/**

@ -19,10 +19,10 @@ package io.entgra.device.mgt.core.application.mgt.common.services;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse;
import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType;
import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType;
import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier;
import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.device.mgt.common.PaginationResult;

@ -35,8 +35,12 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -50,40 +54,91 @@
<Bundle-Description>Application Management Core Bundle</Bundle-Description>
<Private-Package>io.entgra.device.mgt.core.application.mgt.core.internal</Private-Package>
<Import-Package>
com.dd.plist;version="[1.21,2)",
com.google.gson;version="[2.9,3)",
com.google.gson.reflect;version="[2.9,3)",
io.entgra.device.mgt.core.apimgt.application.extension;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.application.extension.dto;version="[5.0,6)",
io.entgra.device.mgt.core.apimgt.application.extension.exception;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common.config;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common.dto;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common.exception;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common.response;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common.services;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.common.wrapper;version="[5.0,6)",
io.entgra.device.mgt.core.application.mgt.core.config,
io.entgra.device.mgt.core.application.mgt.core.dao,
io.entgra.device.mgt.core.application.mgt.core.dao.common,
io.entgra.device.mgt.core.application.mgt.core.dao.impl,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.application,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.review,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription,
io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility,
io.entgra.device.mgt.core.application.mgt.core.exception,
io.entgra.device.mgt.core.application.mgt.core.serviceprovider,
io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.app.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.app.mgt.android;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.group.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.common.exception;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.common.util;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.dto;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.operation.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.permission.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.task.impl;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.core.util;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension.dto;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension.exception;version="[5.0,6)",
io.entgra.device.mgt.core.identity.jwt.client.extension.service;version="[5.0,6)",
javax.annotation;version="[1.0,2)",
javax.naming,
javax.sql,
<!--javax.ws.rs.core;version="[2.1,3)",-->
javax.xml.bind;version="[0.0,1)",
javax.xml.bind.annotation;version="[0.0,1)",
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}",
org.apache.commons.codec.digest;version="[1.4,2)",
org.apache.commons.httpclient;version="[3.1,4)",
org.apache.commons.httpclient.methods;version="[3.1,4)",
org.apache.commons.io;version="[2.4,3)",
org.apache.commons.lang;version="[2.6,3)",
org.apache.commons.lang3;version="[3.12,4)",
org.apache.commons.logging;version="[1.2,2)",
org.apache.commons.validator.routines;version="[1.7,2)",
<!--org.apache.cxf.jaxrs.ext.multipart;version="[3.5,4)",-->
org.apache.http;version="[4.4,5)",
org.apache.http.client;version="[4.3,5)",
org.apache.http.client.methods;version="[4.3,5)",
org.apache.http.impl.client;version="[4.3,5)",
org.bouncycastle.cert,
org.bouncycastle.cert.jcajce,
org.bouncycastle.cms,
org.bouncycastle.jce.provider;version="[1.70,2)",
org.bouncycastle.util;version="[1.70,2)",
org.json;version="[3.0,4)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional,
org.wso2.carbon.context.*,
org.wso2.carbon.utils.*,
org.w3c.dom,
org.json,
javax.sql,
com.google.gson.*,
javax.naming,
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
javax.xml.bind; version="${javax.xml.bind.imp.pkg.version}",
io.entgra.device.mgt.core.application.mgt.common.*,
io.entgra.device.mgt.core.device.mgt.core.*,
io.entgra.device.mgt.core.device.mgt.common.*,
org.wso2.carbon.user.core.*,
org.wso2.carbon.user.api.*,
org.wso2.carbon.ntask.*,
org.quartz.*,
org.wso2.carbon.ndatasource.core,
org.wso2.carbon,
org.quartz;version="[2.1,3)",
org.wso2.carbon.context;version="[4.8,5)",
org.wso2.carbon.ndatasource.core;version="[4.8,5)",
org.wso2.carbon.ntask.common;version="[4.9,5)",
org.wso2.carbon.ntask.core;version="[4.9,5)",
org.wso2.carbon.ntask.core.service;version="[4.9,5)",
org.wso2.carbon.user.api;version="[1.0,2)",
org.wso2.carbon.user.core.service;version="[4.8,5)",
org.wso2.carbon.utils;version="[4.8,5)",
org.wso2.carbon.utils.dbcreator;version="[4.8,5)",
org.xml.sax,
org.xml.sax.helpers,
org.apache.commons.io,
org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}",
org.apache.commons.codec.digest;version="${commons-codec.wso2.osgi.version.range}",
org.wso2.carbon.base,
com.dd.*,
io.entgra.device.mgt.core.identity.jwt.client.extension.*,
io.entgra.device.mgt.core.apimgt.application.extension.*,
org.apache.commons.httpclient,
org.apache.commons.httpclient.methods,
org.apache.commons.validator.routines
org.xml.sax.helpers
</Import-Package>
<Embed-Dependency>apk-parser;scope=compile|runtime;inline=false</Embed-Dependency>
<Export-Package>
@ -112,16 +167,9 @@
<dependencies>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.osgi</groupId>
<artifactId>org.eclipse.osgi.services</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.common</artifactId>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
@ -136,7 +184,6 @@
<groupId>org.ops4j.pax.logging</groupId>
<artifactId>pax-logging-api</artifactId>
<scope>provided</scope>
<!-- <version>${pax.logging.api.version}</version>-->
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>

@ -17,14 +17,14 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.config;
import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.config.MDMConfig;
import io.entgra.device.mgt.core.application.mgt.common.config.RatingConfiguration;
import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
/**
* Represents the Application Management Configuration.

@ -17,15 +17,15 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.config;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException;
import java.io.File;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
import java.io.File;
/**
* ConfigurationManager is responsible for the managing Application Management related configurations.

@ -17,11 +17,11 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.config;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
/**
* Represents a extension in the application management configuration.

@ -17,7 +17,7 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao;
import io.entgra.device.mgt.core.application.mgt.common.*;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO;

@ -17,8 +17,8 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.Rating;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import java.util.List;

@ -17,9 +17,9 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao;
import io.entgra.device.mgt.core.application.mgt.common.response.Review;
import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO;
import io.entgra.device.mgt.core.application.mgt.common.response.Review;
import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException;
import java.util.List;

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.application.mgt.core.dao;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import java.util.List;

@ -17,38 +17,25 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao.common;
import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.GenericSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.OracleSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.PostgreSQLSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.SQLServerSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.OracleVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.PostgreSQLVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.SQLServerVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.UnsupportedDatabaseEngineException;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.LifecycleStateDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.ReviewDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.VisibilityDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.*;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.OracleApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.PostgreSQLApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.SQLServerApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.OracleApplicationReleaseDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.PostgreSQLApplicationReleaseDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.SQLServerApplicationReleaseDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.GenericSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.OracleSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.PostgreSQLSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.SQLServerSPApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.OracleLifecycleStateDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.PostgreSQLLifecycleStateDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.SQLServerLifecycleStateDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.GenericReviewDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.OracleApplicationDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.OracleReviewDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.PostgreSQLReviewDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.SQLServerReviewDAOImpl;
@ -56,7 +43,14 @@ import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.Gene
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.OracleSubscriptionDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.PostgreSQLSubscriptionDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.SQLServerSubscriptionDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.OracleVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.PostgreSQLVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.SQLServerVisibilityDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.sql.DataSource;
import java.sql.SQLException;

@ -17,27 +17,23 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application;
import io.entgra.device.mgt.core.application.mgt.common.AppLifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.AppLifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;

@ -18,15 +18,15 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,15 +18,15 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,21 +18,17 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.Rating;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
@ -30,11 +30,7 @@ import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import java.util.List;
public class GenericSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO {

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
@ -28,11 +28,8 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServer
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import java.util.List;
public class OracleSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO {

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
@ -28,11 +28,8 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServer
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import java.util.List;
public class PostgreSQLSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO {

@ -18,8 +18,8 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
@ -28,11 +28,8 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServer
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.*;
import java.util.List;
public class SQLServerSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO {

@ -17,21 +17,17 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.AppLifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.LifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.LifecycleStateDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.LifeCycleManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;

@ -17,24 +17,19 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.review;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.ReviewDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.SQLException;
import java.sql.ResultSet;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Timestamp;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import java.util.StringJoiner;

@ -18,14 +18,14 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.review;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,14 +18,14 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.review;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -17,32 +17,22 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription;
import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus;
import io.entgra.device.mgt.core.application.mgt.common.SubAction;
import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType;
import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException;
import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import java.sql.*;
import java.util.*;
public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements SubscriptionDAO {
private static final Log log = LogFactory.getLog(GenericSubscriptionDAOImpl.class);

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,10 +18,10 @@
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -17,12 +17,12 @@
*/
package io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.core.dao.VisibilityDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl;
import io.entgra.device.mgt.core.application.mgt.core.exception.VisibilityManagementDAOException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;

@ -18,93 +18,49 @@
package io.entgra.device.mgt.core.application.mgt.core.impl;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import io.entgra.device.mgt.core.device.mgt.common.Base64File;
import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.validator.routines.UrlValidator;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstaller;
import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes;
import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger;
import io.entgra.device.mgt.core.application.mgt.common.Pagination;
import io.entgra.device.mgt.core.application.mgt.common.*;
import io.entgra.device.mgt.core.application.mgt.common.config.RatingConfiguration;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationList;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationSubscriptionType;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationType;
import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO;
import io.entgra.device.mgt.core.application.mgt.common.Filter;
import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO;
import io.entgra.device.mgt.core.application.mgt.common.LifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.TransactionManagementException;
import io.entgra.device.mgt.core.application.mgt.common.dto.*;
import io.entgra.device.mgt.core.application.mgt.common.exception.*;
import io.entgra.device.mgt.core.application.mgt.common.response.Application;
import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease;
import io.entgra.device.mgt.core.application.mgt.common.response.Category;
import io.entgra.device.mgt.core.application.mgt.common.response.Tag;
import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager;
import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.*;
import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.LifecycleStateDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.VisibilityDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.*;
import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory;
import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException;
import io.entgra.device.mgt.core.application.mgt.core.exception.LifeCycleManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException;
import io.entgra.device.mgt.core.application.mgt.core.exception.VisibilityManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.*;
import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder;
import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager;
import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException;
import io.entgra.device.mgt.core.device.mgt.common.Base64File;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException;
import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType;
import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.validator.routines.UrlValidator;
import org.apache.cxf.jaxrs.ext.multipart.Attachment;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.user.api.UserRealm;
import org.wso2.carbon.user.api.UserStoreException;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
@ -1287,6 +1243,9 @@ public class ApplicationManagerImpl implements ApplicationManager {
}
applicationDTO.setId(appId);
applicationDTO.setApplicationReleaseDTOs(applicationReleaseEntities);
if (applicationDTO.getType().equals("ENTERPRISE") || applicationDTO.getType().equals("PUBLIC") ) {
persistAppIconInfo(applicationReleaseDTO);
}
return APIUtil.appDtoToAppResponse(applicationDTO);
}
} catch (LifeCycleManagementDAOException e) {
@ -1313,6 +1272,30 @@ public class ApplicationManagerImpl implements ApplicationManager {
}
}
/**
* Persist application icon information when creating an application
*
* @param applicationReleaseDTO {@link ApplicationReleaseDTO}
* @throws ApplicationManagementException if error occurred while persisting application icon information
*/
private void persistAppIconInfo(ApplicationReleaseDTO applicationReleaseDTO)
throws ApplicationManagementException {
try {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true);
String iconPath = APIUtil.createAppIconPath(applicationReleaseDTO, tenantId);
DataHolder.getInstance().getDeviceManagementService().saveApplicationIcon(iconPath,
String.valueOf(applicationReleaseDTO.getPackageName()), applicationReleaseDTO.getVersion(), tenantId);
} catch (ApplicationManagementException e) {
String msg = "Error occurred while creating iconPath. Application package name : " + applicationReleaseDTO.getPackageName();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
} catch (DeviceManagementException e) {
String msg = "Error occurred while saving application icon info. Application package name : " + applicationReleaseDTO.getPackageName();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
}
}
@Override
public <T> ApplicationRelease createRelease(ApplicationDTO applicationDTO, ApplicationReleaseDTO applicationReleaseDTO,
ApplicationType type, boolean isPublished)
@ -1918,6 +1901,13 @@ public class ApplicationManagerImpl implements ApplicationManager {
break;
}
}
try {
deleteAppIconInfo(applicationDTO);
} catch (ApplicationManagementException e) {
String msg = "Error occurred while deleting application icon info. Application package name: " + applicationDTO.getPackageName();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
}
}
@Override
@ -4022,4 +4012,32 @@ public class ApplicationManagerImpl implements ApplicationManager {
ConnectionManagerUtil.closeDBConnection();
}
}
@Override
public void updateAppIconInfo(ApplicationRelease applicationRelease, String oldPackageName) throws ApplicationManagementException {
try {
DataHolder.getInstance().getDeviceManagementService().updateApplicationIcon(applicationRelease.getIconPath(),
oldPackageName, applicationRelease.getPackageName(), applicationRelease.getVersion());
} catch (DeviceManagementException e) {
String msg = "Error occurred while updating application icon info. Application package name: " + oldPackageName;
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
}
}
/**
* Delete application icon information when deleting an application
*
* @param applicationDTO {@link ApplicationDTO}
* @throws ApplicationManagementException if error occurred while deleting application icon information
*/
private void deleteAppIconInfo(ApplicationDTO applicationDTO) throws ApplicationManagementException {
try {
DataHolder.getInstance().getDeviceManagementService().deleteApplicationIcon(applicationDTO.getPackageName());
} catch (DeviceManagementException e) {
String msg = "Error occurred while deleting application icon info. Application package name: " + applicationDTO.getPackageName();
log.error(msg, e);
throw new ApplicationManagementException(msg, e);
}
}
}

@ -19,24 +19,27 @@
package io.entgra.device.mgt.core.application.mgt.core.impl;
import com.dd.plist.NSDictionary;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstaller;
import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException;
import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager;
import io.entgra.device.mgt.core.application.mgt.core.exception.ParsingException;
import io.entgra.device.mgt.core.application.mgt.core.util.ArtifactsParser;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException;
import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil;
import net.dongliu.apk.parser.bean.ApkMeta;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstaller;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException;
import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager;
import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException;
import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil;
import java.io.*;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import static io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil.saveFile;

@ -18,22 +18,22 @@
package io.entgra.device.mgt.core.application.mgt.core.impl;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException;
import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager;
import io.entgra.device.mgt.core.application.mgt.common.services.AppmDataHandler;
import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException;
import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder;
import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager;
import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import java.io.InputStream;
import java.util.Map;

@ -18,34 +18,30 @@
package io.entgra.device.mgt.core.application.mgt.core.impl;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.application.mgt.common.Rating;
import io.entgra.device.mgt.core.application.mgt.common.ReviewNode;
import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest;
import io.entgra.device.mgt.core.application.mgt.common.PaginationResult;
import io.entgra.device.mgt.core.application.mgt.common.Rating;
import io.entgra.device.mgt.core.application.mgt.common.ReviewNode;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.TransactionManagementException;
import io.entgra.device.mgt.core.application.mgt.common.response.Review;
import io.entgra.device.mgt.core.application.mgt.common.services.*;
import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager;
import io.entgra.device.mgt.core.application.mgt.common.wrapper.ReviewWrapper;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.ReviewDAO;
import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory;
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException;
import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException;
import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.*;
import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.Constants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.util.ArrayList;
import java.util.Comparator;

@ -19,10 +19,10 @@
package io.entgra.device.mgt.core.application.mgt.core.impl;
import io.entgra.device.mgt.core.application.mgt.common.IdentityServerResponse;
import io.entgra.device.mgt.core.application.mgt.common.SPApplicationListResponse;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.SPApplication;
import io.entgra.device.mgt.core.application.mgt.common.SPApplicationListResponse;
import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO;
import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServiceProviderDTO;
import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException;
import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException;
@ -39,18 +39,17 @@ import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationMana
import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException;
import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException;
import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException;
import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService;
import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder;
import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager;
import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService;
import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil;
import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil;
import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.validator.routines.UrlValidator;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil;
import java.util.ArrayList;
import java.util.List;

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save