public List<Map<String, Object>> getHostVariables(String hostId) throws Exception {
WebContext ctx = WebContextFactory.get();
HttpServletRequest req = ctx.getHttpServletRequest();
UserWebAPI userWebAPI = WebAPILocator.getUserWebAPI();
User user = userWebAPI.getLoggedInUser(req);
boolean respectFrontendRoles = userWebAPI.isLoggedToFrontend(req);
HostVariableAPI hostVariableAPI = APILocator.getHostVariableAPI();
List<Map<String, Object>> resultList = new LinkedList<Map<String,Object>>();
List<HostVariable> hvars = hostVariableAPI.getVariablesForHost(hostId, user, respectFrontendRoles);
for(HostVariable variable : hvars) {
Map<String, Object> variableMap = variable.getMap();
User variableLastModifier = userWebAPI.loadUserById(variable.getLastModifierId(), userWebAPI.getSystemUser(), false);
String lastModifierFullName = "Unknown";
if(variableLastModifier != null)
lastModifierFullName = variableLastModifier.getFullName();
variableMap.put("lastModifierFullName", lastModifierFullName);
resultList.add(variableMap);