class SessionAuditKtrl extends BaseKontroller {

    private static final Logger log = LoggerFactory.getLogger(SessionAuditKtrl.class);

    @Model(name = "sortedSet")
    SortedSet sortedSet = new SortedSet();
    @Model(name = "sessionId")
    Long sessionId;
    @Model(name = "instanceId")
    Integer instanceId;
    @Model(name = "sessionAudit")
    SessionAudit sessionAudit;
    @Model(name = "systemList")
    List<HostSystem> systemList;
    @Model(name = "userList")
    List<User> userList;

    public SessionAuditKtrl(HttpServletRequest request, HttpServletResponse response) {
        super(request, response);
    }

    @Kontrol(path = "/manage/viewSessions", method = MethodType.GET)
    public String viewSessions() throws ServletException {

        if (sortedSet.getOrderByField() == null || sortedSet.getOrderByField().trim().equals("")) {
            sortedSet.setOrderByField(SessionAuditDB.SORT_BY_SESSION_TM);
            sortedSet.setOrderByDirection("desc");
        }
        try {
            systemList = SystemDB.getSystemSet(new SortedSet(SystemDB.SORT_BY_NAME)).getItemList();
            userList = UserDB.getUserSet(new SortedSet(SessionAuditDB.SORT_BY_USERNAME)).getItemList();
            sortedSet = SessionAuditDB.getSessions(sortedSet);
        } catch (SQLException | GeneralSecurityException ex) {
            log.error(ex.toString(), ex);
            throw new ServletException(ex.toString(), ex);
        }

        return "/manage/view_sessions.html";

    }


    @Kontrol(path = "/manage/getTermsForSession", method = MethodType.GET)
    public String getTermsForSession() throws ServletException {
        try {
            sessionAudit = SessionAuditDB.getSessionsTerminals(sessionId);
        } catch (SQLException | GeneralSecurityException ex) {
            log.error(ex.toString(), ex);
            throw new ServletException(ex.toString(), ex);
        }
        return "/manage/view_terms.html";
    }

    @Kontrol(path = "/manage/getJSONTermOutputForSession", method = MethodType.GET)
    public String getJSONTermOutputForSession() throws ServletException {<FILL_FUNCTION_BODY>}
}


        try {
            String json = new Gson().toJson(SessionAuditDB.getTerminalLogsForSession(sessionId, instanceId));
            getResponse().getOutputStream().write(json.getBytes());
        } catch (SQLException | GeneralSecurityException | IOException ex) {
            log.error(ex.toString(), ex);
            throw new ServletException(ex.toString(), ex);
        }

        return null;
    
<no_super_class>