updated mobile plugin for apim 420

master
Amalka Subasinghe 1 year ago
parent 41af0d78a2
commit d5f7bbfeaa

@ -34,13 +34,11 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<packagingExcludes>WEB-INF/lib/*cxf*.jar</packagingExcludes>

@ -38,10 +38,10 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
@ -55,27 +55,44 @@
<Bundle-Description>Device Management Mobile Android Impl Bundle</Bundle-Description>
<Private-Package>io.entgra.device.mgt.plugins.mobile.android.internal</Private-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.xml,
javax.xml.stream,
javax.xml.bind.*,
com.google.gson;version="[2.9,3)",
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.configuration.mgt;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.general;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.invitation.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.license.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.policy.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.pull.notification;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.push.notification;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.spi;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.common.type.mgt;version="[5.0,6)",
io.entgra.device.mgt.core.device.mgt.extensions.license.mgt.registry;version="[5.0,6)",
io.entgra.device.mgt.plugins.mobile.android.impl.config.datasource,
io.entgra.device.mgt.plugins.mobile.android.impl.dao,
io.entgra.device.mgt.plugins.mobile.android.impl.dao.impl,
io.entgra.device.mgt.plugins.mobile.android.impl.dao.util,
io.entgra.device.mgt.plugins.mobile.android.impl.dto,
javax.naming,
javax.sql,
javax.xml.parsers; version=0.0.0,
javax.xml.bind;version="[0.0,1)",
javax.xml.bind.annotation;version="[0.0,1)",
javax.xml.bind.annotation.adapters;version="[0.0,1)",
javax.xml.parsers,
javax.xml.stream;version="[1.0,2)",
org.apache.commons.logging;version="[1.2,2)",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.w3c.dom,
javax.naming,
org.wso2.carbon.context,
org.wso2.carbon.utils.*,
io.entgra.device.mgt.core.device.mgt.common.*,
org.wso2.carbon.ndatasource.core,
io.entgra.device.mgt.core.policy.mgt.common.*,
org.wso2.carbon.registry.core,
org.wso2.carbon.registry.core.session,
org.wso2.carbon.registry.core.service,
org.wso2.carbon.registry.api,
io.entgra.device.mgt.core.device.mgt.extensions.license.mgt.registry,
com.google.gson.*
org.wso2.carbon.context;version="[4.8,5)",
org.wso2.carbon.ndatasource.core;version="[4.8,5)",
org.wso2.carbon.registry.api;version="[1.0,2)",
org.wso2.carbon.registry.core;version="[1.0,2)",
org.wso2.carbon.registry.core.service;version="[1.0,2)",
org.wso2.carbon.registry.core.session;version="[1.0,2)",
org.wso2.carbon.utils;version="[4.8,5)"
</Import-Package>
<Export-Package>
!io.entgra.device.mgt.plugins.mobile.android.internal,
@ -115,12 +132,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>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>

@ -25,28 +25,16 @@ import org.osgi.service.component.ComponentContext;
import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.ndatasource.core.DataSourceService;
import org.wso2.carbon.registry.core.service.RegistryService;
import org.osgi.service.component.annotations.*;
/**
* @scr.component name="io.entgra.device.mgt.plugins.mobile.android.internal.AndroidDeviceManagementServiceComponent"
* immediate="true"
* @scr.reference name="org.wso2.carbon.ndatasource"
* interface="org.wso2.carbon.ndatasource.core.DataSourceService"
* cardinality="1..1"
* policy="dynamic"
* bind="setDataSourceService"
* unbind="unsetDataSourceService"
* @scr.reference name="registry.service"
* interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="0..1"
* policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService"
* <p>
* Adding reference to API Manager Configuration service is an unavoidable hack to get rid of NPEs thrown while
* initializing APIMgtDAOs attempting to register APIs programmatically. APIMgtDAO needs to be proper cleaned up
* to avoid as an ideal fix
*/
@Component(
name = "io.entgra.device.mgt.plugins.mobile.android.internal.AndroidDeviceManagementServiceComponent",
immediate = true)
public class AndroidDeviceManagementServiceComponent {
private static final Log log = LogFactory.getLog(AndroidDeviceManagementServiceComponent.class);
@Activate
protected void activate(ComponentContext ctx) {
if (log.isDebugEnabled()) {
@ -64,6 +52,7 @@ public class AndroidDeviceManagementServiceComponent {
}
}
@Deactivate
protected void deactivate(ComponentContext ctx) {
if (log.isDebugEnabled()) {
log.debug("De-activating Android Mobile Device Management Service Component");
@ -78,6 +67,12 @@ public class AndroidDeviceManagementServiceComponent {
}
}
@Reference(
name = "datasource.service",
service = org.wso2.carbon.ndatasource.core.DataSourceService.class,
cardinality = ReferenceCardinality.MANDATORY,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetDataSourceService")
protected void setDataSourceService(DataSourceService dataSourceService) {
/* This is to avoid mobile device management component getting initialized before the underlying datasources
are registered */
@ -90,6 +85,12 @@ public class AndroidDeviceManagementServiceComponent {
//do nothing
}
@Reference(
name = "registry.service",
service = org.wso2.carbon.registry.core.service.RegistryService.class,
cardinality = ReferenceCardinality.OPTIONAL,
policy = ReferencePolicy.DYNAMIC,
unbind = "unsetRegistryService")
protected void setRegistryService(RegistryService registryService) {
if (log.isDebugEnabled()) {
log.debug("RegistryService acquired");

@ -39,22 +39,4 @@
<module>io.entgra.device.mgt.plugins.mobile.android.ui</module>
</modules>
<!-- <build>-->
<!-- <pluginManagement>-->
<!-- <plugins>-->
<!-- <plugin>-->
<!-- <groupId>org.apache.felix</groupId>-->
<!-- <artifactId>maven-scr-plugin</artifactId>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>generate-scr-scrdescriptor</id>-->
<!-- <goals>-->
<!-- <goal>scr</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<!-- </plugins>-->
<!-- </pluginManagement>-->
<!-- </build>-->
</project>

@ -142,45 +142,6 @@
</executions>
</plugin>
<!--<plugin>-->
<!--<groupId>org.apache.maven.plugins</groupId>-->
<!--<artifactId>maven-dependency-plugin</artifactId>-->
<!--<version>2.10</version>-->
<!--<executions>-->
<!--<execution>-->
<!--<id>unpack</id>-->
<!--<phase>package</phase>-->
<!--<goals>-->
<!--<goal>unpack</goal>-->
<!--</goals>-->
<!--<configuration>-->
<!--<artifactItems>-->
<!--<artifactItem>-->
<!--<groupId>junit</groupId>-->
<!--<artifactId>junit</artifactId>-->
<!--<type>jar</type>-->
<!--<overWrite>false</overWrite>-->
<!--<outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>-->
<!--<destFileName>optional-new-name.jar</destFileName>-->
<!--<includes>**/*.class,**/*.xml</includes>-->
<!--<excludes>**/*test.class</excludes>-->
<!--</artifactItem>-->
<!--</artifactItems>-->
<!--<includes>**/*.java</includes>-->
<!--<excludes>**/*.properties</excludes>-->
<!--<outputDirectory>${project.build.directory}/wars</outputDirectory>-->
<!--<overWriteReleases>false</overWriteReleases>-->
<!--<overWriteSnapshots>true</overWriteSnapshots>-->
<!--</configuration>-->
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
<!--<fileSet>-->
<!--<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/jaggeryapps/uuf-template-app/</directory>-->
<!--<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/jaggeryapps/emm-web-agent</outputDirectory>-->
<!--</fileSet>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
@ -219,7 +180,6 @@
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>${carbon.p2.plugin.version}</version>
<executions>
<execution>
<id>p2-feature-generation</id>
@ -245,9 +205,7 @@
</bundleDef>
</bundles>
<importFeatures>
<importFeatureDef>
org.wso2.carbon.core.server:${carbon.kernel.version}
</importFeatureDef>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
<importFeatureDef>
io.entgra.device.mgt.core.device.mgt.server:${io.entgra.device.mgt.core.version}
</importFeatureDef>

@ -33,6 +33,6 @@
</outSequence>
</resource>
<handlers>
<handler class="org.wso2.carbon.apimgt.handlers.AuthenticationHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/>
</handlers>
</api>

@ -77,6 +77,6 @@
</outSequence>
</resource>
<handlers>
<handler class="org.wso2.carbon.apimgt.handlers.AuthenticationHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/>
</handlers>
</api>

@ -32,6 +32,6 @@
</outSequence>
</resource>
<handlers>
<handler class="org.wso2.carbon.apimgt.handlers.AuthenticationHandler"/>
<handler class="org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"/>
</handlers>
</api>

@ -1189,6 +1189,11 @@
<artifactId>httpasyncclient</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.ds-annotations</artifactId>
<version>${apache.felix.scr.ds.annotations.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -1389,6 +1394,8 @@
<grpc.version>1.51.0</grpc.version>
<tomcat-annotations-api>6.0.53</tomcat-annotations-api>
<commons-lang-wso2>2.6.0.wso2v1</commons-lang-wso2>
<apache.felix.scr.ds.annotations.version>1.2.4</apache.felix.scr.ds.annotations.version>
</properties>
<scm>
@ -1427,8 +1434,8 @@
<version>3.8.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>17</source>
<target>17</target>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
@ -1453,6 +1460,11 @@
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>${carbon.p2.plugin.version}</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
@ -1472,7 +1484,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>5.1.1</version>
<version>3.2.0</version>
<extensions>true</extensions>
<configuration>
<obrRepository>NONE</obrRepository>

Loading…
Cancel
Save