Skip to content

Commit

Permalink
Merge branch 'tag-implementation' into master-latest-push-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ZiyamSanthosh committed Nov 19, 2024
2 parents 3629191 + 7ef7d3e commit df28ef4
Show file tree
Hide file tree
Showing 25 changed files with 2,308 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.wso2.carbon.identity.user.api</groupId>
<artifactId>org.wso2.carbon.identity.api.user.push</artifactId>
<version>1.3.39</version>
</parent>

<artifactId>org.wso2.carbon.identity.api.user.push.common</artifactId>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>org.wso2.carbon.identity.notification.push</groupId>
<artifactId>org.wso2.carbon.identity.notification.push.device.handler</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

<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>
</plugins>
</build>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package org.wso2.carbon.identity.api.user.push.common;

import org.wso2.carbon.identity.notification.push.device.handler.DeviceHandlerService;

/**
* Data holder for Push Device Manager Service.
*/
public class PushDeviceManagerServiceDataHolder {

private static DeviceHandlerService deviceHandlerService;

/**
* Get Device Handler Service.
*
* @return DeviceHandlerService
*/
public static DeviceHandlerService getDeviceHandlerService() {

return PushDeviceManagerServiceDataHolder.deviceHandlerService;
}

/**
* Set Device Handler Service.
*
* @param deviceHandlerService DeviceHandlerService
*/
public static void setDeviceHandlerService(DeviceHandlerService deviceHandlerService) {

PushDeviceManagerServiceDataHolder.deviceHandlerService = deviceHandlerService;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package org.wso2.carbon.identity.api.user.push.common.factory;

import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.identity.notification.push.device.handler.DeviceHandlerService;

/**
* Push device manager OSGI service factory.
*/
public class PushDeviceManagerOSGIServiceFactory extends AbstractFactoryBean<DeviceHandlerService> {

private DeviceHandlerService deviceHandlerService;

@Override
public Class<?> getObjectType() {

return Object.class;
}

@Override
protected DeviceHandlerService createInstance() throws Exception {

if (this.deviceHandlerService == null) {
DeviceHandlerService deviceHandlerService = (DeviceHandlerService) PrivilegedCarbonContext
.getThreadLocalCarbonContext().getOSGiService(DeviceHandlerService.class, null);
if (deviceHandlerService != null) {
this.deviceHandlerService = deviceHandlerService;
} else {
throw new Exception("Unable to retrieve DeviceHandlerService.");
}
}
return this.deviceHandlerService;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.wso2.carbon.identity.user.api</groupId>
<artifactId>org.wso2.carbon.identity.api.user.push</artifactId>
<version>1.3.39</version>
</parent>

<artifactId>org.wso2.carbon.identity.rest.api.user.push.v1</artifactId>
<name>WSO2 Identity Server - Push Notification Device Management REST API</name>
<description>WSO2 Identity Server - Push Notification Device Management REST API</description>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<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>
<!--Dependency to generate the code from the openapi generation.-->
<plugin>
<groupId>org.openapitools</groupId>
<artifactId>openapi-generator-maven-plugin</artifactId>
<version>4.1.2</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/src/main/resources/push.yaml</inputSpec>
<generatorName>org.wso2.carbon.codegen.CxfWso2Generator</generatorName>
<configOptions>
<sourceFolder>src/gen/java</sourceFolder>
<apiPackage>org.wso2.carbon.identity.rest.api.user.push.v1</apiPackage>
<modelPackage>org.wso2.carbon.identity.rest.api.user.push.v1.model</modelPackage>
<packageName>org.wso2.carbon.identity.rest.api.user.push.v1</packageName>
<dateLibrary>java8</dateLibrary>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
</configOptions>
<output>.</output>
<skipOverwrite>true</skipOverwrite>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.openapitools</groupId>
<artifactId>cxf-wso2-openapi-generator</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/gen/java</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-rs-service-description</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jaxrs</artifactId>
<exclusions>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</exclusion>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.notification.push</groupId>
<artifactId>org.wso2.carbon.identity.notification.push.device.handler</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.user.api</groupId>
<artifactId>org.wso2.carbon.identity.api.user.push.common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.identity.user.api</groupId>
<artifactId>org.wso2.carbon.identity.api.user.common</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit df28ef4

Please sign in to comment.