mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-17 14:21:39 +00:00
added some initial code
This commit is contained in:
22
pom.xml
22
pom.xml
@@ -168,6 +168,28 @@
|
|||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.amazonaws</groupId>
|
||||||
|
<artifactId>aws-java-sdk</artifactId>
|
||||||
|
<version>1.12.604</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.amazonaws</groupId>
|
||||||
|
<artifactId>aws-java-sdk-sns</artifactId>
|
||||||
|
<version>1.12.604</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/software.amazon.awssdk/auth -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>software.amazon.awssdk</groupId>
|
||||||
|
<artifactId>auth</artifactId>
|
||||||
|
<version>2.21.37</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-core -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.amazonaws</groupId>
|
||||||
|
<artifactId>aws-java-sdk-core</artifactId>
|
||||||
|
<version>1.12.604</version>
|
||||||
|
</dependency>
|
||||||
<!-- Jakarta... -->
|
<!-- Jakarta... -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>jakarta.xml.bind</groupId>
|
<groupId>jakarta.xml.bind</groupId>
|
||||||
|
31
repository/src/main/java/org/alfresco/repo/event2/SNS.java
Normal file
31
repository/src/main/java/org/alfresco/repo/event2/SNS.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package org.alfresco.repo.event2;
|
||||||
|
import com.amazonaws.auth.AWSStaticCredentialsProvider;
|
||||||
|
import com.amazonaws.auth.BasicAWSCredentials;
|
||||||
|
import com.amazonaws.services.sns.AmazonSNSClient;
|
||||||
|
import com.amazonaws.services.sns.AmazonSNSClientBuilder;
|
||||||
|
import com.amazonaws.services.sns.model.PublishRequest;
|
||||||
|
public class SNS {
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
String TOPIC_ARN = "";
|
||||||
|
String AWS_ACCESS_KEY = "";
|
||||||
|
String AWS_SECRET_KEY = "";
|
||||||
|
String AWS_REGION = "";
|
||||||
|
String MESSAGE = "Hey! Manish Connection is established";
|
||||||
|
|
||||||
|
AmazonSNSClient amazonSNSClient = (AmazonSNSClient) AmazonSNSClientBuilder
|
||||||
|
.standard()
|
||||||
|
.withRegion(AWS_REGION)
|
||||||
|
.withCredentials(new AWSStaticCredentialsProvider(
|
||||||
|
new BasicAWSCredentials(AWS_ACCESS_KEY, AWS_SECRET_KEY)))
|
||||||
|
.build();
|
||||||
|
PublishRequest request = new PublishRequest(TOPIC_ARN, MESSAGE);
|
||||||
|
amazonSNSClient.publish(request);
|
||||||
|
}
|
||||||
|
catch(Exception e)
|
||||||
|
{
|
||||||
|
System.out.print(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user