File tree Expand file tree Collapse file tree 3 files changed +90
-0
lines changed
sessionize-java-client-demo Expand file tree Collapse file tree 3 files changed +90
-0
lines changed Original file line number Diff line number Diff line change 3333 <project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
3434
3535 <mainClass >software.xdev.Application</mainClass >
36+
37+ <log4j2-version >2.20.0</log4j2-version >
3638 </properties >
3739
3840 <dependencies >
4143 <artifactId >sessionize-java-client</artifactId >
4244 <version >${project.version} </version >
4345 </dependency >
46+
47+ <!-- Logging -->
48+ <!-- SLF4J comes from Apache Httpclient -->
49+ <dependency >
50+ <groupId >org.apache.logging.log4j</groupId >
51+ <artifactId >log4j-core</artifactId >
52+ <version >${log4j2-version} </version >
53+ </dependency >
54+ <dependency >
55+ <groupId >org.apache.logging.log4j</groupId >
56+ <artifactId >log4j-slf4j-impl</artifactId >
57+ <version >${log4j2-version} </version >
58+ </dependency >
4459 </dependencies >
4560
4661 <build >
5873 </compilerArgs >
5974 </configuration >
6075 </plugin >
76+ <plugin >
77+ <groupId >org.apache.maven.plugins</groupId >
78+ <artifactId >maven-jar-plugin</artifactId >
79+ <version >3.3.0</version >
80+ <configuration >
81+ <archive >
82+ <manifest >
83+ <addClasspath >true</addClasspath >
84+ <mainClass >${mainClass} </mainClass >
85+ </manifest >
86+ </archive >
87+ </configuration >
88+ </plugin >
6189 </plugins >
6290 </build >
6391</project >
Original file line number Diff line number Diff line change 1+ package software .xdev ;
2+
3+ import org .slf4j .Logger ;
4+ import org .slf4j .LoggerFactory ;
5+
6+ import software .xdev .sessionize .api .AllApi ;
7+ import software .xdev .sessionize .api .SessionsApi ;
8+ import software .xdev .sessionize .api .SpeakersApi ;
9+ import software .xdev .sessionize .client .ApiClient ;
10+
11+
12+ public final class Application
13+ {
14+ public static final Logger LOG = LoggerFactory .getLogger (Application .class );
15+ public static final String TEST_ENDPOINT_ID = "jl4ktls0" ;
16+
17+ @ SuppressWarnings ("java:S2629" ) // Just a demo
18+ public static void main (final String [] args )
19+ {
20+ final CustomApiClient apiClient = new CustomApiClient ();
21+
22+ LOG .info ("*** Speakers-Endpoint ***" );
23+ new SpeakersApi (apiClient ).getAllSpeakers (TEST_ENDPOINT_ID )
24+ .forEach (x -> LOG .info (x .toString ()));
25+
26+ LOG .info ("*** Sessions-Endpoint ***" );
27+ new SessionsApi (apiClient ).getAllSessions (TEST_ENDPOINT_ID )
28+ .forEach (x -> LOG .info (x .toString ()));
29+
30+ LOG .info ("*** All-Endpoint ***" );
31+ LOG .info (new AllApi (apiClient ).getAll (TEST_ENDPOINT_ID ).toString ());
32+ }
33+
34+ public static class CustomApiClient extends ApiClient
35+ {
36+ public CustomApiClient ()
37+ {
38+ this .setConnectTimeout (30_000 );
39+ this .setUserAgent ("Sessionize-Java-Client-Demo" );
40+ }
41+ }
42+ }
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!DOCTYPE Configuration >
3+ <Configuration status =" ERROR" >
4+
5+ <Properties >
6+ <Property name =" consolePattern" >%d{HH:mm:ss} %-5p [%t] [%-25.25c] %m %n</Property >
7+ </Properties >
8+
9+ <Appenders >
10+ <Console name =" stdout" target =" SYSTEM_OUT" >
11+ <PatternLayout pattern =" ${consolePattern}" />
12+ </Console >
13+ </Appenders >
14+
15+ <Loggers >
16+ <Root level =" INFO" >
17+ <AppenderRef ref =" stdout" />
18+ </Root >
19+ </Loggers >
20+ </Configuration >
You can’t perform that action at this time.
0 commit comments