DLESE Tools
v1.2

org.dlese.dpc.logging
Class ClfLogRecord

java.lang.Object
  extended byorg.dlese.dpc.logging.ClfLogRecord

public class ClfLogRecord
extends Object

Represents a single log record created by ClfLogger. Log files may be parsed by calling ClfLogRecord.parse.


Field Summary
 int contentLength
          The content length of the document returned to the client.
 String dleseId
          If full: DLESE ID of the record returned.
 String identity
          id.
 int numDbRecords
          Total number of records in the database
 int numSearchResults
          Number of search results for search requests; 0 otherwise
 int rankNum
          If search: rank of first result in the displayed page.
 String referrer
          The referrer, but long ago was misspelled it as the "referer" HTTP request header.
 String remoteHost
          Remote host IP number.
 String remoteUser
          The username as which the user has authenticated via password protection.
 Date requestDateUtc
          The date and time of request, UTC (GMT) time.
 String requestString
           The request line as it came from the client.
 String requestType
          The DLESE request type: search/full/other.
 String serverName
          The name of the server that received the request.
 int serverPort
          The port number of the server that received the request.
 String userAgent
          The User_Agent HTTP request header, in quotes.
 String xmlString
          An arbitrary string, generally XML.
 
Constructor Summary
ClfLogRecord()
           
 
Method Summary
static ClfLogRecord parse(String inline, int linenum)
          Creates a ClfLogRecord by parsing the specified input line.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

remoteHost

public String remoteHost
Remote host IP number.


identity

public String identity
id. See rfc1413 (obsoletes rfc931) remote logname of the user. Unreliable, seldom used. Usually appears as "-".


remoteUser

public String remoteUser
The username as which the user has authenticated via password protection.


requestDateUtc

public Date requestDateUtc
The date and time of request, UTC (GMT) time. Note: this is the time when the server wrote the log record, not the time extracted from the possibly bogus date header.


requestString

public String requestString
The request line as it came from the client. Note: this is reconstructed using HttpServletRequest calls, so there may be slight differences in formatting from the original request string.
Example: "GET /testldap/tldap HTTP/1.1"


contentLength

public int contentLength
The content length of the document returned to the client.


referrer

public String referrer
The referrer, but long ago was misspelled it as the "referer" HTTP request header. If unavailable, it appears quoted as "-", not as -.


userAgent

public String userAgent
The User_Agent HTTP request header, in quotes. If unavailable, it appears quoted as "-", not as -.


serverName

public String serverName
The name of the server that received the request.


serverPort

public int serverPort
The port number of the server that received the request.


requestType

public String requestType
The DLESE request type: search/full/other.


numSearchResults

public int numSearchResults
Number of search results for search requests; 0 otherwise


numDbRecords

public int numDbRecords
Total number of records in the database


rankNum

public int rankNum
If search: rank of first result in the displayed page. If full: rank of this result.


dleseId

public String dleseId
If full: DLESE ID of the record returned. Otherwise: "-"


xmlString

public String xmlString
An arbitrary string, generally XML.

Constructor Detail

ClfLogRecord

public ClfLogRecord()
Method Detail

toString

public String toString()

parse

public static ClfLogRecord parse(String inline,
                                 int linenum)
                          throws LogException
Creates a ClfLogRecord by parsing the specified input line. Sample use:
        int linenum = 0;
        BufferedReader rdr = new BufferedReader( new FileReader( inname));
        while (true) {
            String inline = rdr.readLine();
            if (inline == null) break;
            linenum++;
            ClfLogRecord rec = ClfLogRecord.parse( inline, linenum);
            System.out.println("\nrecord " + linenum + ":\n" + rec);
        }
        rdr.close();
 

Throws:
LogException

DLESE Tools
v1.2