Commit f53bb5d0 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Updated EE virtual machines table

parent 720f62b1
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>ide</org-netbeans-modules-maven-jaxws.rest_2e_config_2e_type>
</properties>
</project-shared-configuration>
......@@ -43,6 +43,8 @@ public class MonitoringResource implements MonitoringApi {
VirtualMachineInfoTO info1 = new VirtualMachineInfoTO();
info1.setKey("vm001");
info1.setSysOp("Ubuntu 16.10");
info1.setIp("192.168.0.11");
info1.setHostname("localhost");
info1.setCpuCount(4);
info1.setCpuUsageRatio(30.5);
info1.setRamUsage(1500);
......@@ -55,6 +57,8 @@ public class MonitoringResource implements MonitoringApi {
VirtualMachineInfoTO info2 = new VirtualMachineInfoTO();
info2.setKey("vm002");
info2.setSysOp("Ubuntu 16.10");
info2.setIp("192.168.0.12");
info2.setHostname("localhost");
info2.setCpuCount(2);
info2.setCpuUsageRatio(51);
info2.setRamUsage(400);
......@@ -67,6 +71,8 @@ public class MonitoringResource implements MonitoringApi {
VirtualMachineInfoTO info3 = new VirtualMachineInfoTO();
info3.setKey("vm003");
info3.setSysOp("Ubuntu 16.10");
info3.setIp("192.168.0.13");
info3.setHostname("localhost");
info3.setCpuCount(4);
info3.setCpuUsageRatio(26.5);
info3.setRamUsage(2230);
......@@ -79,6 +85,8 @@ public class MonitoringResource implements MonitoringApi {
VirtualMachineInfoTO info4 = new VirtualMachineInfoTO();
info4.setKey("vm004");
info4.setSysOp("Ubuntu 16.10");
info4.setIp("192.168.0.14");
info4.setHostname("localhost");
info4.setCpuCount(4);
info4.setCpuUsageRatio(44);
info4.setRamUsage(750);
......@@ -133,6 +141,8 @@ public class MonitoringResource implements MonitoringApi {
VirtualMachineInfoTO info1 = new VirtualMachineInfoTO();
info1.setKey("vm001");
info1.setSysOp("Ubuntu 16.10");
info1.setIp("192.168.0.11");
info1.setHostname("localhost");
info1.setCpuCount(4);
info1.setCpuUsageRatio(30.5);
info1.setRamUsage(1500);
......@@ -145,6 +155,8 @@ public class MonitoringResource implements MonitoringApi {
VirtualMachineInfoTO info2 = new VirtualMachineInfoTO();
info2.setKey("vm002");
info2.setSysOp("Ubuntu 16.10");
info2.setIp("192.168.0.12");
info2.setHostname("localhost");
info2.setCpuCount(2);
info2.setCpuUsageRatio(51);
info2.setRamUsage(400);
......
......@@ -98,11 +98,6 @@ public class ChoreographyVMDirectoryPanel extends DirectoryPanel<
protected List<IColumn<VirtualMachineInfoTO, String>> getColumns() {
final List<IColumn<VirtualMachineInfoTO, String>> columns = new ArrayList<>();
//columns.add(new PropertyColumn<>(new ResourceModel("ipAddress", "IP"), "IP", "ipAddress"));
//columns.add(new PropertyColumn<>(new ResourceModel("hostname", "Hostname"), "Hostname", "hostname"));
columns.add(new PropertyColumn<>(new ResourceModel("sysOp", "OS"), "OS", "sysOp"));
//columns.add(new PropertyColumn<>(new ResourceModel("type", "Type"), "Type", "type"));
columns.add(new AbstractColumn<VirtualMachineInfoTO, String>(new ResourceModel("", "Type")) {
private static final long serialVersionUID = -5860164518940274921L;
......@@ -119,7 +114,9 @@ public class ChoreographyVMDirectoryPanel extends DirectoryPanel<
//columns.add(new PropertyColumn<>(new ResourceModel(
// "choreography", "Deployed Choreography"), "Deployed Choreography", "choreography"));
columns.add(new PropertyColumn<>(new ResourceModel("sysOp", "OS"), "OS", "sysOp"));
columns.add(new PropertyColumn<>(new ResourceModel("ip", "IP Address"), "IP Address", "ip"));
columns.add(new PropertyColumn<>(new ResourceModel("hostname", "Hostname"), "Hostname", "hostname"));
columns.add(new PropertyColumn<>(new ResourceModel("cpuCount", "CPU"), "CPU", "cpuCount"));
columns.add(new PropertyColumn<>(new ResourceModel(
"cpuUsageRatio", "CPU Utilization (%)"), "CPU Utilization (%)", "cpuUsageRatio"));
......
......@@ -23,7 +23,7 @@ public class VirtualMachineInfoTO extends AbstractBaseBean {
private String key;
private String ipAddress;
private String ip;
private String hostname;
......@@ -55,12 +55,12 @@ public class VirtualMachineInfoTO extends AbstractBaseBean {
this.key = key;
}
public String getIpAddress() {
return ipAddress;
public String getIp() {
return ip;
}
public void setIpAddress(final String ipAddress) {
this.ipAddress = ipAddress;
public void setIp(final String ip) {
this.ip = ip;
}
public String getHostname() {
......
......@@ -173,6 +173,7 @@ public interface ChoreographyService extends JAXRSService {
*/
@GET
@Path("{id}/enactmentEngine")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
AnyObjectTO getEnactmentEngine(@NotNull @PathParam("id") String id);
}
......@@ -103,11 +103,6 @@ public class EEVMDirectoryPanel extends DirectoryPanel<
protected List<IColumn<VirtualMachineInfoTO, String>> getColumns() {
final List<IColumn<VirtualMachineInfoTO, String>> columns = new ArrayList<>();
//columns.add(new PropertyColumn<>(new ResourceModel("ipAddress", "IP"), "IP", "ipAddress"));
//columns.add(new PropertyColumn<>(new ResourceModel("hostname", "Hostname"), "Hostname", "hostname"));
columns.add(new PropertyColumn<>(new ResourceModel("sysOp", "OS"), "OS", "sysOp"));
//columns.add(new PropertyColumn<>(new ResourceModel("type", "Type"), "Type", "type"));
columns.add(new AbstractColumn<VirtualMachineInfoTO, String>(new ResourceModel("", "Type")) {
private static final long serialVersionUID = -5860164518940274921L;
......@@ -124,7 +119,9 @@ public class EEVMDirectoryPanel extends DirectoryPanel<
//columns.add(new PropertyColumn<>(new ResourceModel(
// "choreography", "Deployed Choreography"), "Deployed Choreography", "choreography"));
columns.add(new PropertyColumn<>(new ResourceModel("sysOp", "OS"), "OS", "sysOp"));
columns.add(new PropertyColumn<>(new ResourceModel("ip", "IP Address"), "IP Address", "ip"));
columns.add(new PropertyColumn<>(new ResourceModel("hostname", "Hostname"), "Hostname", "hostname"));
columns.add(new PropertyColumn<>(new ResourceModel("cpuCount", "CPU"), "CPU", "cpuCount"));
columns.add(new PropertyColumn<>(new ResourceModel(
"cpuUsageRatio", "CPU Utilization (%)"), "CPU Utilization (%)", "cpuUsageRatio"));
......
......@@ -19,6 +19,7 @@ import eu.chorevolution.idm.common.to.EnactmentEngineStatusTO;
import eu.chorevolution.idm.common.to.VirtualMachineInfoTO;
import java.util.List;
import static org.apache.syncope.client.console.rest.BaseRestClient.getService;
import org.apache.syncope.common.rest.api.service.EEService;
import org.apache.syncope.common.rest.api.service.MonitorInterfaceService;
public class EnactmentEngineRestClient extends BaseRestClient {
......@@ -32,4 +33,8 @@ public class EnactmentEngineRestClient extends BaseRestClient {
public List<VirtualMachineInfoTO> getEEVmList(final String enactmentEngineKey) {
return getService(MonitorInterfaceService.class).getEEVmList(enactmentEngineKey);
}
public void create() {
getService(EEService.class).create();
}
}
......@@ -17,11 +17,34 @@ package org.apache.syncope.core.logic;
import java.lang.reflect.Method;
import org.apache.syncope.common.lib.AbstractBaseBean;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class EELogic extends AbstractTransactionalLogic<AbstractBaseBean> {
private static final String ENACTMENT_ENGINE_TYPE = "ENACTMENT ENGINE";
private static final String ENACTMENT_ENGINE_BASE_URL = "enactmentEngineBaseURL";
private static final String ENACTMENT_ENGINE_USERNAME = "enactmentEngineUsername";
private static final String ENACTMENT_ENGINE_PASSWORD = "enactmentEnginePassword";
@Autowired
private AnyObjectLogic anyObjectLogic;
public void create(final String name, final String baseURL, final String username, final String password) {
AnyObjectTO ee = new AnyObjectTO();
ee.setName("ciao");
ee.setType(ENACTMENT_ENGINE_TYPE);
ee.setRealm(SyncopeConstants.ROOT_REALM);
anyObjectLogic.create(ee, true);
}
@Override
protected AbstractBaseBean resolveReference(final Method method, final Object... os)
throws UnresolvedReferenceException {
......
......@@ -15,6 +15,7 @@
*/
package org.apache.syncope.common.rest.api.service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
/**
......@@ -23,4 +24,7 @@ import javax.ws.rs.Path;
@Path("enactmentengine")
public interface EEService extends JAXRSService {
@POST
@Path("/create")
void create();
}
......@@ -25,4 +25,9 @@ public class EEServiceImpl extends AbstractServiceImpl implements EEService {
@Autowired
private EELogic logic;
@Override
public void create() {
logic.create("", "", "", "");
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment