Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/push-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
secrets:
OSSRH_USER: ${{ secrets.OSSRH_USER }}
OSSRH_SECRET: ${{ secrets.OSSRH_SECRET }}
OSSRH_URL: ${{ secrets.RELEASE_URL }}
OSSRH_URL: ${{ secrets.OSSRH_CENTRAL_URL }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
GPG_SECRET: ${{ secrets.GPG_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
Expand Down
50 changes: 41 additions & 9 deletions data-share/data-share-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
<parent>
<groupId>io.mosip.datashare</groupId>
<artifactId>data-share</artifactId>
<version>1.2.0.1</version>
<version>1.2.0.2-SNAPSHOT</version>
</parent>

<artifactId>data-share-service</artifactId>
<version>1.2.0.1</version>
<version>1.2.0.2-SNAPSHOT</version>
<name>data-share-service</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<springdoc.version>1.5.10</springdoc.version>
<central.publishing.maven.plugin.version>0.7.0</central.publishing.maven.plugin.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -152,10 +153,29 @@
<optional>true</optional>
</dependency>
</dependencies>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://central.sonatype.com/api/v1/publisher</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central.publishing.maven.plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>ossrh</publishingServerId>
<autoPublish>false</autoPublish>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
Expand All @@ -170,6 +190,9 @@
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
Expand All @@ -196,8 +219,21 @@
<layout>ZIP</layout>
</configuration>
<executions>
<!-- Build info and repackage -->
<execution>
<id>build-info-repackage</id>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
</configuration>
</execution>
<!-- Integration test startup -->
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
Expand All @@ -215,18 +251,14 @@

</configuration>
</execution>
<!-- Integration test shutdown -->
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ private boolean getAndUpdateMetaData(String randomShareKey, String policyId, Str
int transactionAllowed = Integer.parseInt((String) metaDataMap.get(TRANSACTIONSALLOWED));
if(transactionAllowed >= 1) {
isDataShareAllow=true;
objectStoreAdapter.decMetadata(subcriberId, policyId, null, null, randomShareKey,
"transactionsallowed");
metaDataMap.put(TRANSACTIONSALLOWED, transactionAllowed- 1);
objectStoreAdapter.addObjectMetaData(subcriberId, policyId, null, null, randomShareKey, metaDataMap);
LOGGER.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.POLICYID.toString(), policyId,
"Successfully update the metadata");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.ssl.TrustStrategy;
import org.springframework.beans.factory.annotation.Value;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
Expand Down Expand Up @@ -56,12 +56,19 @@
@Component
public class RestUtil {

@Value("${mosip.data.share.restTemplate.max-connection-per-route:20}")
private int maxConnectionPerRoute;

@Value("${mosip.data.share.restTemplate.total-max-connections:100}")
private int totalMaxConnection;

/** The environment. */
@Autowired
private Environment environment;

/** The Constant AUTHORIZATION. */
private static final String AUTHORIZATION = "Authorization=";

private RestTemplate localRestTemplate;

@PostConstruct
Expand Down Expand Up @@ -216,9 +223,11 @@ public RestTemplate getRestTemplate() throws KeyManagementException, NoSuchAlgor
SSLContext sslContext = org.apache.http.ssl.SSLContexts.custom()
.loadTrustMaterial(null, acceptingTrustStrategy).build();
SSLConnectionSocketFactory csf = new SSLConnectionSocketFactory(sslContext);
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(csf).build();
HttpClientBuilder httpClientBuilder = HttpClients.custom().setMaxConnPerRoute(maxConnectionPerRoute)
.setMaxConnTotal(totalMaxConnection).setSSLSocketFactory(csf);
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);

requestFactory.setHttpClient(httpClientBuilder.build());
localRestTemplate = new RestTemplate(requestFactory);
}
return localRestTemplate;
Expand Down
14 changes: 12 additions & 2 deletions data-share/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<parent>
<groupId>io.mosip.datashare</groupId>
<artifactId>durian</artifactId>
<version>1.2.0.1</version>
<version>1.2.0.2-SNAPSHOT</version>
</parent>

<artifactId>data-share</artifactId>
<version>1.2.0.1</version>
<version>1.2.0.2-SNAPSHOT</version>
<packaging>pom</packaging>

<name>data-share</name>
Expand Down Expand Up @@ -45,6 +45,16 @@
<modules>
<module>data-share-service</module>
</modules>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://central.sonatype.com/api/v1/publisher</url>
</repository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
Expand Down
23 changes: 11 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.mosip.datashare</groupId>
<artifactId>durian</artifactId>
<version>1.2.0.1</version>
<version>1.2.0.2-SNAPSHOT</version>
<packaging>pom</packaging>

<name>MOSIP Durian Parent POM</name>
Expand Down Expand Up @@ -36,9 +36,9 @@

<repositories>
<repository>
<id>ossrh</id>
<name>CentralRepository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<id>ossrh-central</id>
<name>MavenCentralRepository</name>
<url>https://central.sonatype.com/repository/maven-snapshots</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
Expand All @@ -58,24 +58,23 @@
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
<url>https://central.sonatype.com/api/v1/publisher</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
<publishingServerId>ossrh</publishingServerId>
<autoPublish>false</autoPublish>
</configuration>
</plugin>

Expand Down
Loading