private final SimpleDateFormat sdf = new SimpleDateFormat("dd MMM hh:mm:ss.SSS");
@Override
protected void populateItem(final ListItem<SessionData> item)
{
final SessionData sd = item.getModelObject();
Link<Void> link = new Link<Void>("id")
{
private static final long serialVersionUID = 1L;
/**
* @see org.apache.wicket.markup.html.link.Link#onClick()
*/
@Override
public void onClick()
{
setResponsePage(new RequestsPage(sd));
}
};
link.add(new Label("id", new Model<String>(sd.getSessionId())));
item.add(link);
item.add(new Label("lastRequestTime", new Model<String>(
sdf.format(sd.getLastActive()))));
item.add(new Label("requestCount", new Model<Long>(sd.getNumberOfRequests())));
item.add(new Label("requestsTime", new Model<Long>(sd.getTotalTimeTaken())));
item.add(new Label("sessionSize",
new Model<Bytes>(Bytes.bytes(sd.getSessionSize()))));
}
};
add(listView);
PagingNavigator navigator = new PagingNavigator("navigator", listView);