Skip to content

Commit a3339c0

Browse files
David O'SullivanDavid O'Sullivan
authored andcommitted
Initial Commit
0 parents  commit a3339c0

File tree

15 files changed

+228
-0
lines changed

15 files changed

+228
-0
lines changed

.classpath

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
15+
<attributes>
16+
<attribute name="maven.pomderived" value="true"/>
17+
</attributes>
18+
</classpathentry>
19+
<classpathentry kind="output" path="target/classes"/>
20+
</classpath>

.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>cf-java-client-sample</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
eclipse.preferences.version=1
2+
encoding//src/main/java=UTF-8
3+
encoding/<project>=UTF-8
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
12+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1

pom.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>cf-java-client</groupId>
6+
<artifactId>test</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<name>test</name>
11+
<url>http://maven.apache.org</url>
12+
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<maven.compiler.source>1.8</maven.compiler.source>
16+
<maven.compiler.target>1.8</maven.compiler.target>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>junit</groupId>
22+
<artifactId>junit</artifactId>
23+
<version>3.8.1</version>
24+
<scope>test</scope>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.cloudfoundry</groupId>
28+
<artifactId>cloudfoundry-client-reactor</artifactId>
29+
<version>2.20.0.RELEASE</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.cloudfoundry</groupId>
33+
<artifactId>cloudfoundry-operations</artifactId>
34+
<version>2.20.0.RELEASE</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>io.projectreactor</groupId>
38+
<artifactId>reactor-core</artifactId>
39+
<version>3.0.7.RELEASE</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>io.projectreactor.ipc</groupId>
43+
<artifactId>reactor-netty</artifactId>
44+
<version>0.6.6.RELEASE</version>
45+
</dependency>
46+
</dependencies>
47+
</project>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package cf_java_client.test;
2+
import org.cloudfoundry.operations.DefaultCloudFoundryOperations;
3+
import org.cloudfoundry.operations.organizations.OrganizationSummary;
4+
import org.cloudfoundry.reactor.DefaultConnectionContext;
5+
import org.cloudfoundry.reactor.client.ReactorCloudFoundryClient;
6+
import org.cloudfoundry.reactor.tokenprovider.PasswordGrantTokenProvider;
7+
8+
import java.util.concurrent.CountDownLatch;
9+
10+
public final class JavaSample {
11+
12+
public static void main(String[] args) {
13+
String target = args[0];
14+
String user = args[1];
15+
String password = args[2];
16+
17+
DefaultConnectionContext connectionContext = DefaultConnectionContext.builder()
18+
.apiHost(target)
19+
.build();
20+
21+
PasswordGrantTokenProvider tokenProvider = PasswordGrantTokenProvider.builder()
22+
.password(password)
23+
.username(user)
24+
.build();
25+
26+
ReactorCloudFoundryClient cfClient = ReactorCloudFoundryClient.builder()
27+
.connectionContext(connectionContext)
28+
.tokenProvider(tokenProvider)
29+
.build();
30+
31+
DefaultCloudFoundryOperations cloudFoundryOperations = DefaultCloudFoundryOperations.builder()
32+
.cloudFoundryClient(cfClient)
33+
.build();
34+
35+
CountDownLatch latch = new CountDownLatch(1);
36+
37+
cloudFoundryOperations.organizations()
38+
.list()
39+
.map(OrganizationSummary::getName)
40+
.subscribe(System.out::println, t->{
41+
t.printStackTrace();
42+
latch.countDown();
43+
}, latch::countDown);
44+
45+
try {
46+
latch.await();
47+
} catch (InterruptedException e) {
48+
// TODO Auto-generated catch block
49+
e.printStackTrace();
50+
}
51+
}
52+
53+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Manifest-Version: 1.0
2+
Built-By: dosullivan
3+
Build-Jdk: 1.8.0_144
4+
Created-By: Maven Integration for Eclipse
5+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#Generated by Maven Integration for Eclipse
2+
#Tue Oct 24 16:39:48 IST 2017
3+
version=0.0.1-SNAPSHOT
4+
groupId=cf-java-client
5+
m2e.projectName=cf-java-client-sample
6+
m2e.projectLocation=/Users/dosullivan/Tools/workspace-sts-3.9.1.RELEASE/cf-java-client-sample
7+
artifactId=test
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<groupId>cf-java-client</groupId>
6+
<artifactId>test</artifactId>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<packaging>jar</packaging>
9+
10+
<name>test</name>
11+
<url>http://maven.apache.org</url>
12+
13+
<properties>
14+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15+
<maven.compiler.source>1.8</maven.compiler.source>
16+
<maven.compiler.target>1.8</maven.compiler.target>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>junit</groupId>
22+
<artifactId>junit</artifactId>
23+
<version>3.8.1</version>
24+
<scope>test</scope>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.cloudfoundry</groupId>
28+
<artifactId>cloudfoundry-client-reactor</artifactId>
29+
<version>2.20.0.RELEASE</version>
30+
</dependency>
31+
<dependency>
32+
<groupId>org.cloudfoundry</groupId>
33+
<artifactId>cloudfoundry-operations</artifactId>
34+
<version>2.20.0.RELEASE</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>io.projectreactor</groupId>
38+
<artifactId>reactor-core</artifactId>
39+
<version>3.0.7.RELEASE</version>
40+
</dependency>
41+
<dependency>
42+
<groupId>io.projectreactor.ipc</groupId>
43+
<artifactId>reactor-netty</artifactId>
44+
<version>0.6.6.RELEASE</version>
45+
</dependency>
46+
</dependencies>
47+
</project>

0 commit comments

Comments
 (0)