Right Java tools for J2EE, Web Service, Grid and more
|Home | Products | Documents | Downloads | Purchase | Support | Company | Partners | Contact |

com.acelet.logging
Interface SuperLogging

All Superinterfaces:
javax.ejb.EJBObject, java.rmi.Remote

public interface SuperLogging
extends javax.ejb.EJBObject

This is the class for configuring SuperLogging programmatically.

Users should look up JNDI name and get SuperLoggingHome object, create an instance, then call a desired method.

The JNDI name is AceletSuperLogging

Example:

 import javax.naming.InitialContext;
 import javax.rmi.PortableRemoteObject;
 import com.acelet.logging.*;
 
 public class Test {
   public static void main(String[] args) throws Exception {
     InitialContext initialContext = new InitialContext();
     Object obj = initialContext.lookup("AceletSuperLogging");
     Object homeObject =
       PortableRemoteObject.narrow(obj, SuperLoggingHome.class);
     SuperLoggingHome home = (SuperLoggingHome) homeObject;
     SuperLogging superLogging = home.create("");
     String registeredClasses = superLogging.getRegisteredClasses();
     superLogging.remove();
     System.out.println("Registered classes are: " + registeredClasses);
   }
 }
 
Note:
1. There are many different ways to get initialContext. See your server's document for detailed information, especially if you call from remote client.
2. SuperLoggingEJB's client jar file must on the CLASSPATH.


Method Summary
 void addRegisteredClasses(java.lang.String classesString)
          adds classes into registered class list.
 void alert(java.lang.String subject, java.lang.String message)
          Sends an alert email to registered email recipients.
 void alert(java.lang.String subject, java.lang.String message, java.lang.String sender)
          Sends an alert email to registered email recipients.
 int deleteAlarmEmail(java.lang.String subject)
          Delete alarm email in log database.
 java.util.Vector dumpMessageFromDatabase(int timeout, long start, long end)
          Select log messages in log database.
 java.util.Hashtable getAlertEmail()
          Get alert email information.
 java.util.Hashtable getAttribute()
          Get attribute.
 java.util.Properties getLicenseProperties()
          Get Library license information.
 java.util.Vector getLogDatabaseIds()
          Get information from log database.
 java.util.Hashtable getLogDatabaseParameters()
          Get log database parameters from the log database.
 java.lang.String getRegisteredClasses()
          Get registered class names.
 java.lang.String getServerName()
          Get Vendor Id.
 java.lang.String getVersion()
          Get SuperLogging version number.
 void globalReset(char[] password, boolean forceReset)
          Re-init all instances of SuperLoggingLibraries, including re-connect the log database.
 int insertAlarmEmail(java.lang.String subject, java.lang.String address, int interval)
          Insert alarm email into log database.
 int installLicesne(java.lang.String licenseData)
          Install SuperLogging license
 boolean isConnected()
          Test connection.
 java.util.Vector readMessageFromDatabase(int timeout, long start, long end)
          Read log messages from log database.
 void removeRegisteredClasses(java.lang.String classesString)
          Remore registered class.
 java.util.Hashtable selectAlarmEmail(java.lang.String subject)
          Select alarm email
 java.util.Vector selectAllAlarmEmails()
          Select all alarm emails.
 java.lang.String[][] selectLogMessage(int timeout, java.lang.String whereClause)
          Select log messages in log database.
 java.util.Vector selectLogMessageVector(int timeout, java.lang.String whereClause)
          Select messages in the log database.
 void sendAlarmEmail(java.lang.String subject, java.lang.String text, java.lang.String sender)
          Send alarm email for business warnings.
 void sendMail(java.lang.String to, java.lang.String from, java.lang.String subject, java.lang.String text)
          Send email.
 void setAlertEmail(java.util.Hashtable parameterHashtable)
          Set alertEmail information.
 void setAttributeNoScope(java.util.Hashtable parameterHashtable)
          Set attributes.
 void setScope(int scope)
          Set scope.
 java.lang.String[][] tail(int queryTimeout, int rows, long bookmark, java.lang.String whereClause)
          Select last log records.
 void testAlarm(java.lang.String alarmAddress)
          Test alarm.
 void testAlert(java.util.Hashtable parameterHashtable)
          Test alert.
 int updateAlarmEmail(java.lang.String subject, java.lang.String address, int interval, long nextAlarmTime)
          update alarm email
 void writeToDatabase(java.util.Hashtable input)
          This is for internal use.
 java.util.Vector xService(java.lang.String input)
          This is for internal use.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

addRegisteredClasses

public void addRegisteredClasses(java.lang.String classesString)
                          throws java.lang.Exception,
                                 java.rmi.RemoteException
adds classes into registered class list.
Note: Only registered classes will generate logging messages.

Throws:
java.lang.Exception
java.rmi.RemoteException

alert

public void alert(java.lang.String subject,
                  java.lang.String message)
           throws java.lang.Exception,
                  java.rmi.RemoteException
Sends an alert email to registered email recipients. No email will be sent out without a valid administrator's email address.

This method calls JavaMail, so you need a package which implements JavaMail.

Throws:
java.lang.Exception
java.rmi.RemoteException

alert

public void alert(java.lang.String subject,
                  java.lang.String message,
                  java.lang.String sender)
           throws java.lang.Exception,
                  java.rmi.RemoteException
Sends an alert email to registered email recipients. No email will be sent out without a valid administrator's email address.

This method calls JavaMail, so you need a package which implements JavaMail.

Throws:
java.lang.Exception
java.rmi.RemoteException

deleteAlarmEmail

public int deleteAlarmEmail(java.lang.String subject)
                     throws java.lang.Exception,
                            java.rmi.RemoteException
Delete alarm email in log database.

Throws:
java.lang.Exception
java.rmi.RemoteException

dumpMessageFromDatabase

public java.util.Vector dumpMessageFromDatabase(int timeout,
                                                long start,
                                                long end)
                                         throws java.lang.Exception,
                                                java.rmi.RemoteException
Select log messages in log database.

Throws:
java.lang.Exception
java.rmi.RemoteException

getAlertEmail

public java.util.Hashtable getAlertEmail()
                                  throws java.lang.Exception,
                                         java.rmi.RemoteException
Get alert email information.

Returns:
a Hashtable with the following elements: adminEmailAddress (String), alertEmailAddress (String), alertInterval (Integer), mailHostName (String), mailHostUserName (String), mailHostPassword (String)
Throws:
java.lang.Exception
java.rmi.RemoteException

getAttribute

public java.util.Hashtable getAttribute()
                                 throws java.lang.Exception,
                                        java.rmi.RemoteException
Get attribute.

Returns:
a Hashtable with the following elements: scope (Integer), mode (Integer), logLevel (Integer), errDevice (Integer), logDevice (Integer), queryTimeout (Integer), isSuperLoggingChangeTopicAvailable (Boolean).
Throws:
java.lang.Exception
java.rmi.RemoteException

getLicenseProperties

public java.util.Properties getLicenseProperties()
                                          throws java.lang.Exception,
                                                 java.rmi.RemoteException
Get Library license information.

Throws:
java.lang.Exception
java.rmi.RemoteException

getLogDatabaseIds

public java.util.Vector getLogDatabaseIds()
                                   throws java.lang.Exception,
                                          java.rmi.RemoteException
Get information from log database.

Returns:
a Vector with the following elements (in the order): firstId and lastId.
Throws:
java.lang.Exception
java.rmi.RemoteException

getLogDatabaseParameters

public java.util.Hashtable getLogDatabaseParameters()
                                             throws java.lang.Exception,
                                                    java.rmi.RemoteException
Get log database parameters from the log database.

Returns:
a Hashtable with the following elements: driverName, databaseUrl, databaseUserName, queryTimeout.
Throws:
java.lang.Exception
java.rmi.RemoteException

getRegisteredClasses

public java.lang.String getRegisteredClasses()
                                      throws java.lang.Exception,
                                             java.rmi.RemoteException
Get registered class names.

Returns:
a long String which is comma separated full class names.
Throws:
java.lang.Exception
java.rmi.RemoteException

getServerName

public java.lang.String getServerName()
                               throws java.lang.Exception,
                                      java.rmi.RemoteException
Get Vendor Id. This method tells the Application server vender name.

Throws:
java.lang.Exception
java.rmi.RemoteException

getVersion

public java.lang.String getVersion()
                            throws java.lang.Exception,
                                   java.rmi.RemoteException
Get SuperLogging version number.

Throws:
java.lang.Exception
java.rmi.RemoteException

globalReset

public void globalReset(char[] password,
                        boolean forceReset)
                 throws java.lang.Exception,
                        java.rmi.RemoteException
Re-init all instances of SuperLoggingLibraries, including re-connect the log database.

Throws:
java.lang.Exception
java.rmi.RemoteException

insertAlarmEmail

public int insertAlarmEmail(java.lang.String subject,
                            java.lang.String address,
                            int interval)
                     throws java.lang.Exception,
                            java.rmi.RemoteException
Insert alarm email into log database.

Throws:
java.lang.Exception
java.rmi.RemoteException

installLicesne

public int installLicesne(java.lang.String licenseData)
                   throws java.lang.Exception,
                          java.rmi.RemoteException
Install SuperLogging license

Throws:
java.lang.Exception
java.rmi.RemoteException

isConnected

public boolean isConnected()
                    throws java.lang.Exception,
                           java.rmi.RemoteException
Test connection.

Throws:
java.lang.Exception
java.rmi.RemoteException

readMessageFromDatabase

public java.util.Vector readMessageFromDatabase(int timeout,
                                                long start,
                                                long end)
                                         throws java.lang.Exception,
                                                java.rmi.RemoteException
Read log messages from log database.

Parameters:
start - is the begining ID (enclusive) to fetch.
end - is the last ID (enclusive) to fetch.
Returns:
a Vector containing log messages.
Throws:
java.lang.Exception
java.rmi.RemoteException

removeRegisteredClasses

public void removeRegisteredClasses(java.lang.String classesString)
                             throws java.lang.Exception,
                                    java.rmi.RemoteException
Remore registered class.

Throws:
java.lang.Exception
java.rmi.RemoteException

selectAlarmEmail

public java.util.Hashtable selectAlarmEmail(java.lang.String subject)
                                     throws java.lang.Exception,
                                            java.rmi.RemoteException
Select alarm email

Returns:
A Hashtable contains the following: subject (String), address (String), interval (Integer), nextAlarmTime (Long)
Throws:
java.lang.Exception
java.rmi.RemoteException

selectAllAlarmEmails

public java.util.Vector selectAllAlarmEmails()
                                      throws java.lang.Exception,
                                             java.rmi.RemoteException
Select all alarm emails.

Returns:
a vector, each element is an AlarmEmail
Throws:
java.lang.Exception
java.rmi.RemoteException

selectLogMessage

public java.lang.String[][] selectLogMessage(int timeout,
                                             java.lang.String whereClause)
                                      throws java.lang.Exception,
                                             java.rmi.RemoteException
Select log messages in log database.

Throws:
java.lang.Exception
java.rmi.RemoteException

selectLogMessageVector

public java.util.Vector selectLogMessageVector(int timeout,
                                               java.lang.String whereClause)
                                        throws java.lang.Exception,
                                               java.rmi.RemoteException
Select messages in the log database.

Returns:
a vector, each element is a log message.
Throws:
java.lang.Exception
java.rmi.RemoteException

sendAlarmEmail

public void sendAlarmEmail(java.lang.String subject,
                           java.lang.String text,
                           java.lang.String sender)
                    throws java.lang.Exception,
                           java.rmi.RemoteException
Send alarm email for business warnings.

Throws:
java.lang.Exception
java.rmi.RemoteException
See Also:
Logging

sendMail

public void sendMail(java.lang.String to,
                     java.lang.String from,
                     java.lang.String subject,
                     java.lang.String text)
              throws java.lang.Exception,
                     java.rmi.RemoteException
Send email.

Throws:
java.lang.Exception
java.rmi.RemoteException
See Also:
Logging

setAlertEmail

public void setAlertEmail(java.util.Hashtable parameterHashtable)
                   throws java.lang.Exception,
                          java.rmi.RemoteException
Set alertEmail information.

Throws:
java.lang.Exception
java.rmi.RemoteException

setAttributeNoScope

public void setAttributeNoScope(java.util.Hashtable parameterHashtable)
                         throws java.lang.Exception,
                                java.rmi.RemoteException
Set attributes.

Throws:
java.lang.Exception
java.rmi.RemoteException

setScope

public void setScope(int scope)
              throws java.lang.Exception,
                     java.rmi.RemoteException
Set scope.

Throws:
java.lang.Exception
java.rmi.RemoteException

tail

public java.lang.String[][] tail(int queryTimeout,
                                 int rows,
                                 long bookmark,
                                 java.lang.String whereClause)
                          throws java.lang.Exception,
                                 java.rmi.RemoteException
Select last log records.

Parameters:
queryTimeout - The time out, in seconds.
rows - The number of rows to be selected.
bookmark - The start point of the search. Select rows newer that bookmark.
Throws:
java.lang.Exception
java.rmi.RemoteException

testAlarm

public void testAlarm(java.lang.String alarmAddress)
               throws java.lang.Exception,
                      java.rmi.RemoteException
Test alarm.

Throws:
java.lang.Exception
java.rmi.RemoteException

testAlert

public void testAlert(java.util.Hashtable parameterHashtable)
               throws java.lang.Exception,
                      java.rmi.RemoteException
Test alert.

Throws:
java.lang.Exception
java.rmi.RemoteException

updateAlarmEmail

public int updateAlarmEmail(java.lang.String subject,
                            java.lang.String address,
                            int interval,
                            long nextAlarmTime)
                     throws java.lang.Exception,
                            java.rmi.RemoteException
update alarm email

Throws:
java.lang.Exception
java.rmi.RemoteException

xService

public java.util.Vector xService(java.lang.String input)
                          throws java.lang.Exception,
                                 java.rmi.RemoteException
This is for internal use. Do you call it.

Throws:
java.lang.Exception
java.rmi.RemoteException

writeToDatabase

public void writeToDatabase(java.util.Hashtable input)
                     throws java.lang.Exception,
                            java.rmi.RemoteException
This is for internal use. Do you call it.

Throws:
java.lang.Exception
java.rmi.RemoteException

Copyright Acelet Corporation. 2000-2007. All rights reserved.