|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ptc.elog.Elog
Field Summary | |
static String |
ALL
|
private static String |
DEFAULT_ELOG_FILE
|
private static byte[] |
EOL
|
(package private) long |
lEOFRecord
|
private boolean |
m_bFilterApp
|
private boolean |
m_bFilterClass
|
private boolean |
m_bFilterDate
|
private boolean |
m_bFilterNode
|
private boolean |
m_bFilterThread
|
private boolean |
m_bFilterUser
|
private boolean |
m_bFilterVerbosity
|
private boolean |
m_bLoggingOn
|
private byte[] |
m_buffer
|
private Date |
m_date
|
private Date |
m_date1
|
private Date |
m_date2
|
private long |
m_lEOF
|
private long |
m_lTime
|
private int |
m_nRVerbosity
|
private int |
m_nVerbosity
|
private int |
m_nWVerbosity
|
private RandomAccessFile |
m_raf
|
private ElogRecord |
m_record
|
private ElogRecord[] |
m_records
|
private StringBuffer |
m_sbuffer
|
private String |
m_strApp
|
private String[] |
m_strApps
|
private String |
m_strClass
|
private String[] |
m_strClasses
|
private String |
m_strFile
|
private String |
m_strLine
|
private String |
m_strMsg
|
private String |
m_strNode
|
private String[] |
m_strNodes
|
private String |
m_strThread
|
private String[] |
m_strThreads
|
private String |
m_strUser
|
private String[] |
m_strUsers
|
static int |
MAX_LAST_ROWS
|
static String |
MULTIPLE
|
private static String |
PAD
|
(package private) ElogRecord |
record
|
private static String[] |
STAT
|
static String[] |
STATUS
|
(package private) String |
strClass
|
private static String |
UNKNOWN
|
static int |
V_DEBUG
|
static int |
V_DUMP
|
static int |
V_ERROR
|
static int |
V_INFO
|
private static int |
V_OFFSET
|
static int |
V_WARN
|
(package private) Vector |
vClasses
|
Constructor Summary | |
Elog()
This is just to prevent it's being used by apps. |
|
Elog(Object obj,
String s)
Constructor |
|
Elog(Object obj,
String s,
int v)
Constructor |
Method Summary | |
void |
close(Object obj)
This method closes the Elog. |
private ElogRecord |
filterRecord(ElogRecord record)
This method tests whether the an ElogRecord passes each filter. |
String[] |
getFilterApps()
This method returns the String[] array of app values that determine whether an ElogRecord is read. |
String[] |
getFilterClasses()
This method returns the String[] array of class values that determine whether an ElogRecord is read. |
Date[] |
getFilterDates()
This method returns the current low/high date/time values for filtering Elog reads. |
String[] |
getFilterNodes()
This method returns the String[] array of Node values that determine whether an ElogRecord is read. |
String[] |
getFilterThreads()
This method returns the String[] array of thread values that determine whether an ElogRecord is read. |
String[] |
getFilterUsers()
This method returns the String[] array of User values that determine whether an ElogRecord is read. |
int |
getFilterVerbosity()
This method returns the current Read verbosity. |
String[] |
getUniqueAppsFromElog(long lMaxRead,
int nMaxGet)
This method returns the String[] array of unique App values currently in the Elog. |
String[] |
getUniqueClassesFromElog(long lMaxRead,
int nMaxGet)
This method returns the String[] array of unique Class values currently in the Elog. |
String[] |
getUniqueNodesFromElog(long lMaxRead,
int nMaxGet)
This method returns the String[] array of unique Node values currently in the Elog. |
String[] |
getUniqueThreadsFromElog(long lMaxRead,
int nMaxGet)
This method returns the String[] array of unique Thread values currently in the Elog. |
String[] |
getUniqueUsersFromElog(long lMaxRead,
int nMaxGet)
This method returns the String[] array of unique User values currently in the Elog. |
int |
getWriteVerbosity()
This method gets the application's current write verbosity. |
private void |
init(Object obj)
This private method is shared by the real constructors |
private boolean |
isValidApp(ElogRecord record)
This method tests whether the app in an ElogRecord is within the app Filter range. |
private boolean |
isValidClass(ElogRecord record)
This method tests whether the Class in an ElogRecord is within the Class Filter range. |
private boolean |
isValidDate(ElogRecord record)
This method tests whether the date/time in an ElogRecord is within the Date Filter range. |
private boolean |
isValidNode(ElogRecord record)
This method tests whether the Node in an ElogRecord is within the Node Filter range. |
private boolean |
isValidThread(ElogRecord record)
This method tests whether the thread in an ElogRecord is within the thread Filter range. |
private boolean |
isValidUser(ElogRecord record)
This method tests whether the User in an ElogRecord is within the User Filter range. |
private boolean |
isValidVerbosity(ElogRecord record)
This method tests whether the Verbosity in an ElogRecord is equal to or less than the Read Verbosity filter value. |
String |
read(long lRecord)
This method reads an Elog record and returns it as a String. |
ElogRecord[] |
readLastRecords(long lCount)
This method reads the last N-records in the Elog and returns an array of ElogRecords. |
ElogRecord |
readRecord(long lRecord)
Reads an Elog record and returns a parsed ElogRecord. |
void |
setFilterApps(String[] s)
This method sets the App values that an ElogRecord must have to allow an Elog read. |
void |
setFilterAppsEnabled(boolean b)
This method turns on/off the filtering by application of Elog reads. |
void |
setFilterClasses(String[] s)
This method sets the Class values that an ElogRecord must have to allow an Elog read. |
void |
setFilterClassesEnabled(boolean b)
This method turns on/off the filtering by classes of Elog reads. |
void |
setFilterDates(Date d1,
Date d2)
This method sets the low/high date/time values for filtering Elog reads. |
void |
setFilterDates(int d)
This method indirectly sets the low/high Date filters. |
void |
setFilterDatesEnabled(boolean b)
This method turns on/off the filtering by dates of Elog reads. |
void |
setFilterNodes(String[] s)
This method sets the Node values that an ElogRecord must have to allow an Elog read. |
void |
setFilterNodesEnabled(boolean b)
This method turns on/off the filtering by Nodes of Elog reads. |
void |
setFilterThreads(String[] s)
This method sets the thread values that an ElogRecord must have to allow an Elog read. |
void |
setFilterThreadsEnabled(boolean b)
This method turns on/off the filtering by threads of Elog reads. |
void |
setFilterUsers(String[] s)
This method sets the User values that an ElogRecord must have to allow an Elog read. |
void |
setFilterUsersEnabled(boolean b)
This method turns on/off the filtering by users of Elog reads. |
void |
setFilterVerbosity(int n)
This method sets the highest Verbosity value that an ElogRecord may have to allow an Elog read. |
void |
setFilterVerbosityEnabled(boolean b)
This method turns on/off the filtering by verbosity of Elog reads. |
void |
setLoggingEnabled(boolean b)
This method controls whether an application writes to the Elog. |
void |
setWriteVerbosity(int n)
This method sets an application's verbosity for writing to the Elog. |
private String |
toSize(String s,
int n)
This method forces a string to a set size, blankpadding right as needed. |
void |
write(Object obj,
int nVerbosity,
String strMsg)
This writes an Elog record. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String DEFAULT_ELOG_FILE
private static final String UNKNOWN
private static final String PAD
private static final byte[] EOL
private static final String[] STAT
private static final int V_OFFSET
public static final int V_DUMP
public static final int V_DEBUG
public static final int V_INFO
public static final int V_WARN
public static final int V_ERROR
public static final String[] STATUS
public static final int MAX_LAST_ROWS
public static final String ALL
public static final String MULTIPLE
private String m_strFile
private RandomAccessFile m_raf
private ElogRecord m_record
private byte[] m_buffer
private StringBuffer m_sbuffer
private String m_strLine
private String m_strUser
private String m_strNode
private String m_strApp
private ElogRecord[] m_records
private long m_lEOF
private Date m_date
private String m_strThread
private String m_strClass
private int m_nVerbosity
private String m_strMsg
private int m_nWVerbosity
private int m_nRVerbosity
private Date m_date1
private Date m_date2
private long m_lTime
private String[] m_strNodes
private String[] m_strApps
private String[] m_strThreads
private String[] m_strUsers
private String[] m_strClasses
private boolean m_bFilterDate
private boolean m_bFilterNode
private boolean m_bFilterApp
private boolean m_bFilterThread
private boolean m_bFilterUser
private boolean m_bFilterClass
private boolean m_bFilterVerbosity
private boolean m_bLoggingOn
Vector vClasses
ElogRecord record
String strClass
long lEOFRecord
Constructor Detail |
public Elog()
public Elog(Object obj, String s, int v)
obj
- - Is used to ID the Application that is creating the Elog.s
- - The name of the Elog file. If null or empty, it defaults to "elog.txt"v
- - The write verbosity. Must be V_INFO, V_DEBUG, or V_DUMP.public Elog(Object obj, String s)
obj
- - Is used to ID the Application that is creating the Elog.s
- - The name of the Elog file. If null or empty, it defaults to "elog.txt"Method Detail |
private void init(Object obj)
obj
- - The Application object
public void close(Object obj)
obj
- - This object is what Elog uses to ID the calling class.
public void write(Object obj, int nVerbosity, String strMsg)
obj
- This Object is what Elog uses to ID the calling class.nVerbosity
- This int is what Elog uses to determine the Verbosity of what is written to the Elog.strMsg
- This String is the message the user writes to the Elog.
public String read(long lRecord)
lRecord
- This long is the Elog record number to read.
It is 1-based.
If a negative number is entered, the method returns the final record in the Elog.
If a number beyond the end of Elog is entered, the method returns a null.
public ElogRecord readRecord(long lRecord)
lRecord
- This long is the Elog record number to read.
public ElogRecord[] readLastRecords(long lCount)
lCount
- This long is the number of records to read.
public void setLoggingEnabled(boolean b)
b
- This boolean turns Elog writing on/off.
public void setWriteVerbosity(int n)
n
- This int is either V_INFO, V_DEBUG, V_DUMP. It controls the write verbosity.
public int getWriteVerbosity()
public void setFilterDatesEnabled(boolean b)
b
- Boolean turns elog date filtering on/off.
public void setFilterDates(Date d1, Date d2)
d1
- This Date is the lowest date/time value that Elog will read.d2
- This Date is the highest date/time that Elog will read.
public void setFilterDates(int d)
d
- This is the number of seconds delta.
public Date[] getFilterDates()
private boolean isValidDate(ElogRecord record)
record
- This ElogRecord is the record that is being tested.
public void setFilterNodesEnabled(boolean b)
b
- Boolean turns elog Node filtering on/off.
public void setFilterNodes(String[] s)
s
- This String[] is the array of Node values that ElogRecord is tested against.public String[] getFilterNodes()
public String[] getUniqueNodesFromElog(long lMaxRead, int nMaxGet)
lMaxRead
- This is the maximum number of Elog records to read.nMaxGet
- This is the maximum number of unique values to return.
private boolean isValidNode(ElogRecord record)
record
- This ElogRecord is the record that is being tested.
public void setFilterAppsEnabled(boolean b)
b
- Boolean turns elog app filtering on/off.
public void setFilterApps(String[] s)
s
- This String[] is the array of app values that ElogRecord is tested against.
public String[] getFilterApps()
public String[] getUniqueAppsFromElog(long lMaxRead, int nMaxGet)
lMaxRead
- This is the maximum number of Elog records to read.nMaxGet
- This is the maximum number of unique values to return.
private boolean isValidApp(ElogRecord record)
record
- This is the ElogRecord being tested.
public void setFilterThreadsEnabled(boolean b)
b
- Boolean turns elog thread filtering on/off.
public void setFilterThreads(String[] s)
s
- This String[] is the array of thread values that ElogRecord is tested against.public String[] getFilterThreads()
public String[] getUniqueThreadsFromElog(long lMaxRead, int nMaxGet)
lMaxRead
- This is the maximum number of Elog records to read.nMaxGet
- This is the maximum number of unique values to return.
private boolean isValidThread(ElogRecord record)
record
- ElogRecord being tested.
public void setFilterUsersEnabled(boolean b)
b
- Boolean turns elog user filtering on/off.
public void setFilterUsers(String[] s)
s
- This String[] is the array of Usere values that ElogRecord is tested against.
public String[] getFilterUsers()
public String[] getUniqueUsersFromElog(long lMaxRead, int nMaxGet)
lMaxRead
- This is the maximum number of Elog records to read.nMaxGet
- This is the maximum number of unique values to return.
private boolean isValidUser(ElogRecord record)
record
- ElogRecord being tested
public void setFilterClassesEnabled(boolean b)
b
- Boolean turns elog class filtering on/off.
public void setFilterClasses(String[] s)
s
- This String[] is the array of class values that ElogRecord is tested against.
public String[] getFilterClasses()
public String[] getUniqueClassesFromElog(long lMaxRead, int nMaxGet)
lMaxRead
- This is the maximum number of Elog records to read.nMaxGet
- This is the maximum number of unique values to return.
private boolean isValidClass(ElogRecord record)
record
- ElogRecord being tested
public void setFilterVerbosityEnabled(boolean b)
b
- Boolean turns elog verbosity filtering on/off.
public void setFilterVerbosity(int n)
n
- This int is either V_INFO, V_DEBUG, or V_DUMP. It sets the highest verbosity Elog will read.public int getFilterVerbosity()
private boolean isValidVerbosity(ElogRecord record)
record
- ElogRecord being tested.
private ElogRecord filterRecord(ElogRecord record)
record
- ElogRecord being tested.
private String toSize(String s, int n)
s
- String to be adjusted.n
- Length to which that string is to be set.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |