use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class TestMSIService method testOtherMSIInstalledFor41.
@Test
public void testOtherMSIInstalledFor41() throws DataGridConnectionRefusedException, DataGridRuleException {
when(mockRuleService.execGetMSIsRule(anyString())).thenReturn(otherMSIList);
when(irodsServices.isAtLeastIrods420()).thenReturn(false);
DataGridServer server = msiService.getMSIsInstalled("server1.test.com");
assertTrue(server.isThereAnyMSI());
assertMap(otherMSIList, server.getOtherMSIs());
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class DashboardController method getSystemHealthStatus.
/**
* Gets the system health status
*
* @return the status (normal, error or warning)
*/
private String getSystemHealthStatus() {
logger.info("getSystemHealthStatus()");
String status = "normal";
for (DataGridServer server : servers) {
serverMap.put(server.getHostname(), server);
if (server.getMachineStatus().compareTo("error") == 0) {
status = "error";
break;
} else if (server.getMachineStatus().compareTo("warning") == 0 && status.compareTo("normal") == 0) {
status = "warning";
}
}
return status;
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class DashboardController method isAnyIsilonServerWithBadFormedContextString.
/*
* *****************************************************************************
* *************** ********************************* PRIVATE METHODS
* **************************************
* *****************************************************************************
* ***************
*/
/**
* Checks if there is any isilon server that does not have a well formed context
* string. If there is, this server is removed from the list of servers and will
* not be shown in the view's server list.
*
* @return True, is there is at least one Isilon server that does not have a
* well formed string. False, otherwise.
*/
private boolean isAnyIsilonServerWithBadFormedContextString() {
if (isilonServers == null) {
return false;
}
boolean isIsilonListWithAnyBadFormedContextString = false;
Iterator<DataGridServer> isiServersIterator = isilonServers.iterator();
while (isiServersIterator.hasNext()) {
DataGridServer dataGridServer = isiServersIterator.next();
if (dataGridServer.getHostname().isEmpty() || dataGridServer.getIp().isEmpty()) {
isIsilonListWithAnyBadFormedContextString = true;
isiServersIterator.remove();
}
}
return isIsilonListWithAnyBadFormedContextString;
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class ResourceServiceImpl method getAllResourceServers.
@Override
public List<DataGridServer> getAllResourceServers(List<DataGridResource> resources) throws DataGridConnectionRefusedException {
logger.info("Getting all resource servers");
List<DataGridServer> servers = new ArrayList<>();
boolean isResourceWithEmptyHost = false;
for (DataGridResource resource : resources) {
logger.debug("Listing resource information: {}", resource);
if (resource.getContextString().contains("isi_host")) {
continue;
} else if (!resource.getHost().isEmpty()) {
DataGridServer server = new DataGridServer();
try {
server.setHostname(resource.getHost());
server.setIp(machineInfoService.getAddress(resource.getHost()));
server.setResources(getResourcesOfAServer(server.getHostname(), resources));
} catch (UnknownHostException e) {
logger.error("Could not retrieve IP address for [{}]", resource.getHost());
isResourceWithEmptyHost = true;
} catch (DataGridConnectionRefusedException e) {
logger.error("Could not get all resources of the server: ", resource.getHost());
server.setResources(null);
}
if (!isResourceWithEmptyHost && !servers.contains(server)) {
servers.add(server);
}
}
isResourceWithEmptyHost = false;
}
Collections.sort(servers);
return servers;
}
use of com.emc.metalnx.core.domain.entity.DataGridServer in project metalnx-web by irods-contrib.
the class ResourceServiceImpl method getAllIsilonServers.
@Override
public List<DataGridServer> getAllIsilonServers(List<DataGridResource> resources) {
logger.info("Getting all isilon servers");
List<DataGridServer> isilonServers = new ArrayList<>();
for (DataGridResource resource : resources) {
logger.debug("Listing resource information: {}", resource);
if (resource.getContextString().contains("isi_host")) {
DataGridServer isilonServer = new DataGridServer();
String isilonHostIp = getIsilonProperties(resource.getContextString()).get("isi_host");
if (isilonHostIp == null) {
isilonHostIp = new String("");
}
isilonServer.setHostname(isilonHostIp);
isilonServer.setIp(isilonHostIp);
isilonServer.setType(DataGridServerType.ISILON);
if (!isilonServers.contains(isilonServer)) {
isilonServers.add(isilonServer);
}
}
}
Collections.sort(isilonServers);
logger.info("Isilon servers done");
return isilonServers;
}
Aggregations