}
protected Comparator getComparator(String sortBy) {
Comparator comparator = null;
if ("CreationTime".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return new Date(session.getCreationTime());
}
};
} else if ("id".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return session.getId();
}
};
} else if ("LastAccessedTime".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return new Date(session.getLastAccessedTime());
}
};
} else if ("MaxInactiveInterval".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return new Date(session.getMaxInactiveInterval());
}
};
} else if ("new".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return Boolean.valueOf(session.getSession().isNew());
}
};
} else if ("locale".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return JspHelper.guessDisplayLocaleFromSession(session);
}
};
} else if ("user".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return JspHelper.guessDisplayUserFromSession(session);
}
};
} else if ("UsedTime".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return new Date(SessionUtils.getUsedTimeForSession(session));
}
};
} else if ("InactiveTime".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return new Date(SessionUtils.getInactiveTimeForSession(session));
}
};
} else if ("TTL".equalsIgnoreCase(sortBy)) {
comparator = new BaseSessionComparator() {
public Comparable getComparableObject(Session session) {
return new Date(SessionUtils.getTTLForSession(session));
}
};
}