diff options
author | virajput <vijendra_rajput@infosys.com> | 2017-08-31 15:46:27 +0530 |
---|---|---|
committer | virajput <vijendra_rajput@infosys.com> | 2017-08-31 15:49:51 +0530 |
commit | e638628b22fef6f480fa104cd696834dddf6c030 (patch) | |
tree | dd66e5f9c794eca6b6239ee5dbff980a2f8bf647 /example-spring-boot/src/main/java/org/onap/boot/example/demo/ExampleClient.java | |
parent | de0c3cac5c259a83eba9711aa295ddf919fd6df5 (diff) |
added spring boot example using msb java sdk
Issue-Id: MSB-23
Change-Id: Ic3caf7d63a4588aab73df1b07da3d15d6edfa485
Signed-off-by: virajput <vijendra_rajput@infosys.com>
Diffstat (limited to 'example-spring-boot/src/main/java/org/onap/boot/example/demo/ExampleClient.java')
-rw-r--r-- | example-spring-boot/src/main/java/org/onap/boot/example/demo/ExampleClient.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/example-spring-boot/src/main/java/org/onap/boot/example/demo/ExampleClient.java b/example-spring-boot/src/main/java/org/onap/boot/example/demo/ExampleClient.java new file mode 100644 index 0000000..720264b --- /dev/null +++ b/example-spring-boot/src/main/java/org/onap/boot/example/demo/ExampleClient.java @@ -0,0 +1,35 @@ +package org.onap.boot.example.demo; + +import java.io.IOException; + +import org.onap.boot.example.demo.model.Employee; +import org.onap.msb.sdk.httpclient.RestServiceCreater; +import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; + +import retrofit2.Response; + + +public class ExampleClient { + + /** + * @param args + * @throws IOException + */ + public static void main(String[] args) throws IOException { + //For real use case, MSB IP and Port should come from configuration file instead of hard code here + String MSB_IP="192.168.0.110"; + int MSB_Port=10081; + + MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port); + + RestServiceCreater restServiceCreater = + new RestServiceCreater(msbClient); + + EmployeeServiceClient implProxy = + restServiceCreater.createService(EmployeeServiceClient.class); + + Employee employee = implProxy.queryEmployee().execute().body(); + System.out.println("Employee:" + employee); + } + +} |