org.objectweb.jasmine.rules.logs.impl
Class LogInterface

java.lang.Object
  extended by org.objectweb.jasmine.rules.logs.impl.LogInterface
All Implemented Interfaces:
org.objectweb.jasmine.rules.logs.beans.LogInterfaceLocal, org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote, org.objectweb.jasmine.rules.logs.beans.LogInterfaceRulesRemote

public class LogInterface
extends java.lang.Object
implements org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote, org.objectweb.jasmine.rules.logs.beans.LogInterfaceRulesRemote, org.objectweb.jasmine.rules.logs.beans.LogInterfaceLocal


Constructor Summary
LogInterface()
           
 
Method Summary
 int addLogEntity(java.util.Date date, java.lang.String level, java.lang.String message)
           
 void delAllLogs()
          Deletes all the alarms contained in the DB.
 void deleteMessageBeforeDate(java.util.Date date)
           
 void delLog(int id)
          Deletes the alarm with the specified id.
 void delLogRange(java.lang.String[] levels, java.util.Date startDate, java.util.Date endDate)
          Deletes the alarms matching the specified criteria.
 java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getAllLogs()
          Retrieves all the alarms contained in the DB.
 java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getLastLogs(int nb)
          Retrieves the last alarms.
The maximum number of alarms to retrieve must be specified.
 org.objectweb.jasmine.rules.logs.util.AlarmLog getLog(int id)
          Retrieves the alarm with the specified id.
 java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getLogRange(int lowid, int highid)
          Retrieves the alarms with an id contained in the specified range of id inclusive.
 java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getLogRange(java.lang.String[] levels, java.util.Date startDate, java.util.Date endDate)
          Retrieves the alarms matching the specified criteria.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogInterface

public LogInterface()
Method Detail

addLogEntity

public int addLogEntity(java.util.Date date,
                        java.lang.String level,
                        java.lang.String message)
                 throws org.objectweb.jasmine.rules.logs.util.DBException
Specified by:
addLogEntity in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRulesRemote
Throws:
org.objectweb.jasmine.rules.logs.util.DBException

deleteMessageBeforeDate

public void deleteMessageBeforeDate(java.util.Date date)
                             throws org.objectweb.jasmine.rules.logs.util.DBException
Specified by:
deleteMessageBeforeDate in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRulesRemote
Throws:
org.objectweb.jasmine.rules.logs.util.DBException

getLog

public org.objectweb.jasmine.rules.logs.util.AlarmLog getLog(int id)
Retrieves the alarm with the specified id.

Specified by:
getLog in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceLocal
Specified by:
getLog in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote
Parameters:
id - id of the alarm to be retrieved.
Returns:
the alarm with the specified id or null if no alarms match the id.

getAllLogs

public java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getAllLogs()
Retrieves all the alarms contained in the DB.

Specified by:
getAllLogs in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote
Returns:
a list of alarms or an empty list if no alarms have been raised.

getLastLogs

public java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getLastLogs(int nb)
Retrieves the last alarms.
The maximum number of alarms to retrieve must be specified.

Specified by:
getLastLogs in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceLocal
Parameters:
nb - the maximum number of alarm to retrieve.
Returns:
a list of alarms or an empty list if no alarms have been raised.

getLogRange

public java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getLogRange(int lowid,
                                                                                  int highid)
Retrieves the alarms with an id contained in the specified range of id inclusive.

Specified by:
getLogRange in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceLocal
Parameters:
lowid - the low threshold.
highid - the high threshold.
Returns:
a list of alarms or an empty list if no alarms match.

getLogRange

public java.util.List<org.objectweb.jasmine.rules.logs.util.AlarmLog> getLogRange(java.lang.String[] levels,
                                                                                  java.util.Date startDate,
                                                                                  java.util.Date endDate)
Retrieves the alarms matching the specified criteria. All alarms which a level in the list and raised between provided dates will be returned.

Specified by:
getLogRange in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote
Parameters:
levels - a list of levels.
startDate - the lowest date.
endDate - the highest date.
Returns:
a list of alarms or an empty list if no alarms match.

delLog

public void delLog(int id)
Deletes the alarm with the specified id.

Specified by:
delLog in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote
Parameters:
id - id of the alarm to be deleted.

delAllLogs

public void delAllLogs()
Deletes all the alarms contained in the DB.

Specified by:
delAllLogs in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote

delLogRange

public void delLogRange(java.lang.String[] levels,
                        java.util.Date startDate,
                        java.util.Date endDate)
Deletes the alarms matching the specified criteria. All alarms which a level in the list and raised between provided dates will be deleted.

Specified by:
delLogRange in interface org.objectweb.jasmine.rules.logs.beans.LogInterfaceRemote
Parameters:
levels - a list of levels.
startDate - the lowest date.
endDate - the highest date.


Copyright © 2010 OW2 Consortium. All Rights Reserved.