org.wso2.carbon.registry.core.jdbc.dao
Class JDBCLogsDAO

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.dao.JDBCLogsDAO
All Implemented Interfaces:
LogsDAO

public class JDBCLogsDAO
extends Object
implements LogsDAO

An implementation of the LogsDAO to store logs on a JDBC-based database.


Constructor Summary
JDBCLogsDAO()
           
 
Method Summary
 List getLogs(String resourcePath, int action, String userName, Date from, Date to, boolean descending)
          Method to get a list of log entries.
 LogEntry[] getLogs(String resourcePath, int action, String userName, Date from, Date to, boolean descending, DataAccessManager dataAccessManager)
          Method to get a list of log entries.
 LogEntry[] getLogs(String resourcePath, int action, String userName, Date from, Date to, boolean descending, int start, int pageLen, DataAccessManager dataAccessManager)
          Method to get a list of log entries.
 int getLogsCount(String resourcePath, int action, String userName, Date from, Date to, boolean descending)
          Method to get the number of log entries available
 void saveLogBatch(LogRecord[] logRecords)
          Save batch of log records
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCLogsDAO

public JDBCLogsDAO()
Method Detail

saveLogBatch

public void saveLogBatch(LogRecord[] logRecords)
                  throws RegistryException
Description copied from interface: LogsDAO
Save batch of log records

Specified by:
saveLogBatch in interface LogsDAO
Parameters:
logRecords - an array of log records to save.
Throws:
RegistryException - if the operation failed.

getLogs

public List getLogs(String resourcePath,
                    int action,
                    String userName,
                    Date from,
                    Date to,
                    boolean descending)
             throws RegistryException
Description copied from interface: LogsDAO
Method to get a list of log entries.

Specified by:
getLogs in interface LogsDAO
Parameters:
resourcePath - the resource path.
action - the action in concern.
userName - the name of the user who we want to get logs for.
from - the starting date.
to - the ending date.
descending - whether descending or ascending.
Returns:
an array of log entries.
Throws:
RegistryException - if an error occurred while obtaining logs.

getLogs

public LogEntry[] getLogs(String resourcePath,
                          int action,
                          String userName,
                          Date from,
                          Date to,
                          boolean descending,
                          int start,
                          int pageLen,
                          DataAccessManager dataAccessManager)
                   throws RegistryException
Description copied from interface: LogsDAO
Method to get a list of log entries.

Specified by:
getLogs in interface LogsDAO
Parameters:
resourcePath - the resource path.
action - the action in concern.
userName - the name of the user who we want to get logs for.
from - the starting date.
to - the ending date.
descending - whether descending or ascending.
start - the starting index
pageLen - the length of the array returned.
dataAccessManager - the data access manager used to connect to the database.
Returns:
an array of log entries.
Throws:
RegistryException - if an error occurred while obtaining logs.

getLogs

public LogEntry[] getLogs(String resourcePath,
                          int action,
                          String userName,
                          Date from,
                          Date to,
                          boolean descending,
                          DataAccessManager dataAccessManager)
                   throws RegistryException
Description copied from interface: LogsDAO
Method to get a list of log entries.

Specified by:
getLogs in interface LogsDAO
Parameters:
resourcePath - the resource path.
action - the action in concern.
userName - the name of the user who we want to get logs for.
from - the starting date.
to - the ending date.
descending - whether descending or ascending.
dataAccessManager - the data access manager used to connect to the database.
Returns:
an array of log entries.
Throws:
RegistryException - if an error occurred while obtaining logs.

getLogsCount

public int getLogsCount(String resourcePath,
                        int action,
                        String userName,
                        Date from,
                        Date to,
                        boolean descending)
                 throws RegistryException
Description copied from interface: LogsDAO
Method to get the number of log entries available

Specified by:
getLogsCount in interface LogsDAO
Parameters:
resourcePath - the resource path.
action - the action in concern.
userName - the name of the user who we want to get logs for.
from - the starting date.
to - the ending date.
descending - whether descending or ascending.
Returns:
the number of logs.
Throws:
RegistryException - if an error occurred.


Copyright © 2013 WSO2 Inc. All Rights Reserved.