} catch (final ConcurrentModificationException e) {}
return accessClone;
}
public static serverObjects respond(final RequestHeader header, final serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env;
// return variable that accumulates replacements
final serverObjects prop = new serverObjects();
prop.setLocalized(!(header.get(HeaderFramework.CONNECTION_PROP_PATH)).endsWith(".xml"));
int page = 0;
if (post != null) {
page = post.getInt("page", 0);
}
prop.put("page", page);
final int maxCount = 1000;
boolean dark = true;
if (page == 0) {
final Iterator<String> i = sb.accessHosts();
String host;
int entCount = 0;
try {
while ((entCount < maxCount) && (i.hasNext())) {
host = i.next();
prop.putHTML("page_list_" + entCount + "_host", host);
prop.putNum("page_list_" + entCount + "_countSecond", sb.latestAccessCount(host, 1000));
prop.putNum("page_list_" + entCount + "_countMinute", sb.latestAccessCount(host, 1000 * 60));
prop.putNum("page_list_" + entCount + "_count10Minutes", sb.latestAccessCount(host, 1000 * 60 * 10));
prop.putNum("page_list_" + entCount + "_countHour", sb.latestAccessCount(host, 1000 * 60 * 60));
entCount++;
}
} catch (final ConcurrentModificationException e) {} // we don't want to synchronize this
prop.put("page_list", entCount);
prop.put("page_num", entCount);
entCount = 0;
try {
for (final Map.Entry<String, Integer> bfe: serverCore.bfHost.entrySet()) {
prop.putHTML("page_bflist_" + entCount + "_host", bfe.getKey());
prop.putNum("page_bflist_" + entCount + "_countSecond", bfe.getValue());
entCount++;
}
} catch (final ConcurrentModificationException e) {} // we dont want to synchronize this
prop.put("page_bflist", entCount);
} else if (page == 1) {
String host = (post == null) ? "" : post.get("host", "");
int entCount = 0;
Collection<Track> access;
Track entry;
if (host.length() > 0) {
access = sb.accessTrack(host);
if (access != null) {
try {
final Iterator<Track> ii = listclone(access).iterator();
while (ii.hasNext()) {
entry = ii.next();
prop.putHTML("page_list_" + entCount + "_host", host);
prop.put("page_list_" + entCount + "_date", SimpleFormatter.format(new Date(entry.getTime())));
prop.putHTML("page_list_" + entCount + "_path", entry.getPath());
entCount++;
}
} catch (final ConcurrentModificationException e) {} // we don't want to synchronize this
}
} else {
try {
final Iterator<String> i = sb.accessHosts();
while ((entCount < maxCount) && (i.hasNext())) {
host = i.next();
access = sb.accessTrack(host);
final Iterator<Track> ii = listclone(access).iterator();
while (ii.hasNext()) {
entry = ii.next();
prop.putHTML("page_list_" + entCount + "_host", host);
prop.put("page_list_" + entCount + "_date", SimpleFormatter.format(new Date(entry.getTime())));