Skip to content

Commit

Permalink
Add h2 db
Browse files Browse the repository at this point in the history
  • Loading branch information
chamilaadhi committed Apr 20, 2023
1 parent a95451f commit 133e10a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
45 changes: 45 additions & 0 deletions features/wso2is.key.manager.tokenpersistence.feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,54 @@
<groupId>org.wso2.km.ext.wso2is</groupId>
<artifactId>wso2is.key.manager.tokenpersistence</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.orbit.com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>clean-persistence-h2-database</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete file="src/main/resources/repository/database/WSO2INVALID_TOKEN_DB.mv.db" />
</tasks>
</configuration>
</execution>
<execution>
<id>create-persistence-database</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<path id="h2.classpath">
<path refid="maven.compile.classpath" />
</path>
<echo message="########### Creating Invalid Token Database ##############" />
<sql driver="org.h2.Driver" url="jdbc:h2:${basedir}/src/main/resources/repository/database/WSO2INVALID_TOKEN_DB" userid="wso2carbon" password="wso2carbon" autocommit="true" onerror="continue">
<classpath>
<path refid="h2.classpath" />
</classpath>
<fileset file="${basedir}/src/main/resources/sql/h2.sql" />
</sql>
<echo message="##################### END ########################" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/wso2is.key.manager.tokenpersistence_${feature.version}/repository/database/WSO2INVALID_TOKEN_DB.mv.db/,target:${installFolder}/../../database/WSO2INVALID_TOKEN_DB.mv.db,overwrite:true);\
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS AM_INVALID_TOKENS (
UUID VARCHAR(255) NOT NULL,
SIGNATURE VARCHAR(2048) NOT NULL,
CONSUMER_KEY VARCHAR(255) NOT NULL,
TOKEN_TYPE VARCHAR(15) NOT NULL,
TIME_CREATED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
EXPIRY_TIMESTAMP BIGINT NOT NULL,
PRIMARY KEY (UUID)
)
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@
<artifactId>commons-codec</artifactId>
<version>${common.codec.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.orbit.com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.orbit.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -448,5 +453,6 @@
<junit.version>4.12</junit.version>
<powermock.version>1.7.4</powermock.version>
<mockito.all.version>1.10.19</mockito.all.version>
<h2.orbit.version>2.1.210.wso2v1</h2.orbit.version>
</properties>
</project>

0 comments on commit 133e10a

Please sign in to comment.