Skip to content

Commit e5a9a49

Browse files
committed
add java code
1 parent 90879bd commit e5a9a49

File tree

7 files changed

+1109
-16
lines changed

7 files changed

+1109
-16
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ Python/.env
33
Python/jupyterlab_ESG_Screener_RDP_Search.ipynb
44

55

6-
Java/
76
Java/.idea
87
Java/logs/
98
Java/target/

Java/.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
target/
2+
logs/
3+
.env
4+
.idea/
5+
README.md
6+
.env.example

Java/.env.example

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Core Credentials
2+
RTO_USER=RTO_USER
3+
RTO_PASSWORD=RTO_PASSWORD
4+
RTO_APP_KEY=RTO_APP_KEY
5+
RTO_SERVICE=ELEKTRON_DD
6+
7+
#WebSocketAPI
8+
RTO_WS_PORT=443
9+
RTO_WS_APP_ID=256
10+
RTO_WS_NEW_PASSWORD=
11+
RTO_WS_AUTH_URL=https://api.refinitiv.com:443/auth/oauth2/v1/token
12+
RTO_WS_DISCOVERY_URL=https://api.refinitiv.com/streaming/pricing/v1/
13+
RTO_WS_POSITION=443
14+
15+
#EMA Java
16+
RTO_WS_RDMFIELDDICTIONARY=./etc/RDMFieldDictionary
17+
RTO_WS_ENUMTYPEDEF=./etc/enumtype.def
18+
RTO_PROXY_HOSTNAME=
19+
RTO_PROXY_PORT=
20+
RTO_PROXY_USERNAME=
21+
RTO_PROXY_PASSWORD=
22+
RTO_PROXY_DOMAIN=
23+
RTO_PROXY_KRB5=

Java/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#Build stage.
2+
FROM maven:3.8.1-openjdk-11-slim AS builder
3+
WORKDIR /app
4+
COPY pom.xml .
5+
# Resolve Dependencies
6+
RUN mvn -e -B dependency:resolve
7+
COPY src ./src
8+
# Build and compile application
9+
RUN mvn clean -e -B package
10+
11+
# Run stage
12+
FROM openjdk:11-jre-slim
13+
WORKDIR /app
14+
15+
# Copy final Jar file from the builder stage
16+
COPY --from=builder /app/target/dotenv_Java-1.0-jar-with-dependencies.jar .
17+
# update PATH environment variable
18+
ENV USERNAME=DOCKER_CONTAINER
19+
20+
ENTRYPOINT ["java", "-jar", "./dotenv_Java-1.0-jar-with-dependencies.jar"]
21+
CMD ["-ric", "/EUR="]

Java/pom.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<groupId>com.refinitiv</groupId>
8+
<artifactId>dotenv_Java</artifactId>
9+
<version>1.0</version>
10+
11+
<properties>
12+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13+
<maven.compiler.source>1.8</maven.compiler.source>
14+
<maven.compiler.target>1.8</maven.compiler.target>
15+
</properties>
16+
17+
<dependencies>
18+
19+
<!-- websocket api -->
20+
<dependency>
21+
<groupId>org.apache.httpcomponents</groupId>
22+
<artifactId>httpclient</artifactId>
23+
<version>4.5.13</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>commons-cli</groupId>
27+
<artifactId>commons-cli</artifactId>
28+
<version>1.4</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.json</groupId>
32+
<artifactId>json</artifactId>
33+
<version>20210307</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>com.neovisionaries</groupId>
37+
<artifactId>nv-websocket-client</artifactId>
38+
<version>2.14</version>
39+
</dependency>
40+
<!-- dotenv -->
41+
<dependency>
42+
<groupId>io.github.cdimascio</groupId>
43+
<artifactId>dotenv-java</artifactId>
44+
<version>2.2.0</version>
45+
</dependency>
46+
</dependencies>
47+
48+
<build>
49+
<plugins>
50+
<plugin>
51+
<groupId>org.apache.maven.plugins</groupId>
52+
<artifactId>maven-assembly-plugin</artifactId>
53+
<executions>
54+
<execution>
55+
<phase>package</phase>
56+
<goals>
57+
<goal>single</goal>
58+
</goals>
59+
<configuration>
60+
<archive>
61+
<manifest>
62+
<mainClass>
63+
<!--com.refinitiv.ema.test.TestENV-->
64+
com.refinitiv.ws.cloud.MarketPriceRdpGwServiceDiscovery
65+
</mainClass>
66+
</manifest>
67+
</archive>
68+
<descriptorRefs>
69+
<descriptorRef>jar-with-dependencies</descriptorRef>
70+
</descriptorRefs>
71+
</configuration>
72+
</execution>
73+
</executions>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
78+
</project>

0 commit comments

Comments
 (0)