<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
-
+
<parent>
- <groupId>org.onap.oparent</groupId>
- <artifactId>oparent</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.onap.oparent</groupId>
+ <artifactId>oparent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.msb.sdk</groupId>
</dependency>
</dependencies>
</dependencyManagement>
-
+
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
-
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
-
<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
</dependency>
-
- <dependency>
- <groupId>org.onap.msb.sdk</groupId>
+ <dependency>
+ <groupId>org.onap.msb.sdk</groupId>
<artifactId>msb-java-sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
- </dependency>
-
+ </dependency>
</dependencies>
<build>
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port);
MsbHelper helper = new MsbHelper(msbClient);
-
+
try {
- helper.registerMsb();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ helper.registerMsb();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
}
\ No newline at end of file
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
@ServiceHttpEndPoint(serviceName = "employee", serviceVersion = "v1")
public interface EmployeeServiceClient {
- @GET("employee")
- Call<Employee> queryEmployee();
+ @GET("employee")
+ Call<Employee> queryEmployee();
}
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
import org.onap.msb.sdk.httpclient.RestServiceCreater;
import org.onap.msb.sdk.httpclient.msb.MSBServiceClient;
-
public class ExampleClient {
/**
*/
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";
+ String MSB_IP="127.0.0.1";
int MSB_Port=10081;
MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port);
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
@SpringBootApplication
public class SpringBootApp {
-
public static void main(String[] args) {
SpringApplication.run(SpringBootApp.class, args);
}
-}
-
+}
\ No newline at end of file
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
msinfo.setUrl("/api/v1");
msinfo.setProtocol("REST");
msinfo.setVisualRange("0|1");
-
+
Set<Node> nodes = new HashSet<>();
Node node1 = new Node();
node1.setIp(InetAddress.getLocalHost().getHostAddress());
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-
-import org.onap.msb.sdk.example.springboot.model.Employee;;
-
+import org.onap.msb.sdk.example.springboot.model.Employee;
+
@RestController
public class EmployeeController {
@RequestMapping("/employee")
/*******************************************************************************
* Copyright 2017 Infosys Limited and others.
- *------------------------------------------------------------------------------
+ *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
+ *
* http://www.apache.org/licenses/LICENSE-2.0
+ *
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
package org.onap.msb.sdk.example.springboot.model;
import java.io.Serializable;
-
import com.fasterxml.jackson.annotation.JsonProperty;
public class Employee implements Serializable {
-
- private static final long serialVersionUID = 1L;
+
+ private static final long serialVersionUID = 1L;
@JsonProperty
private Integer id;
-
+
@JsonProperty
private String firstName;
-
+
@JsonProperty
private String lastName;
@JsonProperty
private String email;
-
+
public Employee() {}
public Employee(Integer id, String firstName, String lastName, String email) {
this.lastName = lastName;
this.email = email;
}
-
+
public Integer getId() {
return id;
}