org.openqa.selenium.remote.server.log
Class SessionLogsToFileRepository

java.lang.Object
  extended by org.openqa.selenium.remote.server.log.SessionLogsToFileRepository

public class SessionLogsToFileRepository
extends Object


Constructor Summary
SessionLogsToFileRepository()
           
 
Method Summary
 void createLogFileAndAddToMap(org.openqa.selenium.remote.SessionId sessionId)
          This creates log file object which represents logs in file form.
 void flushRecordsToLogFile(org.openqa.selenium.remote.SessionId sessionId, List<LogRecord> records)
          This creates a mapping between session and file representation of logs if doesnt exist already.
 List<LogRecord> getLogRecords(org.openqa.selenium.remote.SessionId sessionId)
          This returns the log records storied in the corresponding log file.
 void removeLogFile(org.openqa.selenium.remote.SessionId sessionId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionLogsToFileRepository

public SessionLogsToFileRepository()
Method Detail

createLogFileAndAddToMap

public void createLogFileAndAddToMap(org.openqa.selenium.remote.SessionId sessionId)
                              throws IOException
This creates log file object which represents logs in file form. This opens ObjectOutputStream which is used to write logRecords to log file and opens a ObjectInputStream which is used to read logRecords from the file.

Parameters:
sessionId - session-id for the log file entry needs to be created.
Throws:
IOException

flushRecordsToLogFile

public void flushRecordsToLogFile(org.openqa.selenium.remote.SessionId sessionId,
                                  List<LogRecord> records)
                           throws IOException
This creates a mapping between session and file representation of logs if doesnt exist already. Writes the log records to the log file. This does *NOT* flush the logs to file. This does *NOT* clear the records after writing to file.

Parameters:
sessionId - session-id to which the log records belong
records - logRecords that need to be stored
Throws:
IOException

getLogRecords

public List<LogRecord> getLogRecords(org.openqa.selenium.remote.SessionId sessionId)
                              throws IOException
This returns the log records storied in the corresponding log file. This does *NOT* clear the log records in the file.

Parameters:
sessionId - session-id for which the file logs needs to be returned.
Returns:
A List of LogRecord objects, which can be null.
Throws:
IOException

removeLogFile

public void removeLogFile(org.openqa.selenium.remote.SessionId sessionId)


Copyright © 2013. All rights reserved.