class ClusterRestApi {

  @GET
  @Path("/" + RestConstants.NODE + "/{nodeName}/{intpName}")
  @SubmarineApi
  public Response getClusterNode(@PathParam("nodeName") String nodeName,
                                 @PathParam("intpName") String intpName){
    ArrayList<HashMap<String, Object>> intpProcesses = new ArrayList<>();

    Map<String, HashMap<String, Object>> intpMeta = null;
    intpMeta = clusterServer.getClusterMeta(ClusterMetaType.INTP_PROCESS_META, "");

    // Number of calculation processes
    for (Map.Entry<String, HashMap<String, Object>> intpMetaEntity : intpMeta.entrySet()) {
      String intpNodeName = (String) intpMetaEntity.getValue().get(ClusterMeta.NODE_NAME);

      if (null != intpNodeName && intpNodeName.equals(nodeName)) {
        HashMap<String, Object> node = new HashMap<String, Object>();
        node.put(ClusterMeta.NODE_NAME, intpNodeName);
        node.put(ClusterMeta.PROPERTIES, intpMetaEntity.getValue());

        // format LocalDateTime
        HashMap<String, Object> properties = intpMetaEntity.getValue();
        if (properties.containsKey(ClusterMeta.INTP_START_TIME)) {
          Object intpStartTime = properties.get(ClusterMeta.INTP_START_TIME);
          if (intpStartTime instanceof LocalDateTime) {
            LocalDateTime localDateTime = (LocalDateTime) intpStartTime;
            String dateTime = formatLocalDateTime(localDateTime);
            properties.put(ClusterMeta.INTP_START_TIME, dateTime);
          } else {
            properties.put(ClusterMeta.INTP_START_TIME, "Wrong time type!");
          }
        }
        if (properties.containsKey(ClusterMeta.LATEST_HEARTBEAT)) {
          Object latestHeartbeat = properties.get(ClusterMeta.LATEST_HEARTBEAT);
          if (latestHeartbeat instanceof LocalDateTime) {
            LocalDateTime localDateTime = (LocalDateTime) latestHeartbeat;
            String dateTime = formatLocalDateTime(localDateTime);
            properties.put(ClusterMeta.LATEST_HEARTBEAT, dateTime);
          } else {
            properties.put(ClusterMeta.LATEST_HEARTBEAT, "Wrong time type!");
          }
        }

        intpProcesses.add(node);
      }
    }

    return new JsonResponse.Builder<ArrayList<HashMap<String, Object>>>(Response.Status.OK)
        .success(true).result(intpProcesses).build();
  }

}