org.openrdf.sesame.admin
Class AdminMsgCollector

java.lang.Object
  extended byorg.openrdf.sesame.admin.AdminMsgCollector
All Implemented Interfaces:
AdminListener

public class AdminMsgCollector
extends Object
implements AdminListener

An implementation of the AdminListener interface that collects the reported messages and allows them to be checked after the performed action has (sucessfully or unsuccessfully) been completed.


Constructor Summary
AdminMsgCollector()
          Creates a new AdminMsgCollector object.
 
Method Summary
 void error(String msg, int lineNo, int columnNo, Statement stat)
          An error message with optionally line and column number and the statement to indicate the source of the error.
 List getErrors()
          Gets all collected error messages.
 List getMessages()
          Gets all collected messages.
 List getNotifications()
          Gets all collected notifications.
 List getWarnings()
          Gets all collected warnings.
 boolean hasErrors()
          Return true if any errors have been collected, false otherwise.
 boolean hasNotifications()
          Return true if any notifications have been collected, false otherwise.
 boolean hasWarnings()
          Return true if any warnings have been collected, false otherwise.
 void notification(String msg, int lineNo, int columnNo, Statement stat)
          A notification message (not an error) with optionally line and column number and the statement to indicate the source of the notification.
 void status(String msg, int lineNo, int columnNo)
          A status message with optional line and column number to indicate progress.
 void transactionEnd()
          Indicates the end of a transaction.
 void transactionStart()
          Indicates the start of a transaction.
 void warning(String msg, int lineNo, int columnNo, Statement stat)
          A warning message with optionally line and column number and the statement to indicate the source of the warning.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminMsgCollector

public AdminMsgCollector()
Creates a new AdminMsgCollector object.

Method Detail

getMessages

public List getMessages()
Gets all collected messages.

Returns:
a List of AdminMsg objects.
See Also:
AdminMsg

hasErrors

public boolean hasErrors()
Return true if any errors have been collected, false otherwise.


getErrors

public List getErrors()
Gets all collected error messages.

Returns:
a List of AdminMsg objects of type ERROR.
See Also:
AdminMsg

hasWarnings

public boolean hasWarnings()
Return true if any warnings have been collected, false otherwise.


getWarnings

public List getWarnings()
Gets all collected warnings.

Returns:
a List of AdminMsg objects of type WARNING.
See Also:
AdminMsg

hasNotifications

public boolean hasNotifications()
Return true if any notifications have been collected, false otherwise.


getNotifications

public List getNotifications()
Gets all collected notifications.

Returns:
a List of AdminMsg objects of type NOTIFICATION.
See Also:
AdminMsg

transactionStart

public void transactionStart()
Description copied from interface: AdminListener
Indicates the start of a transaction.

Specified by:
transactionStart in interface AdminListener

transactionEnd

public void transactionEnd()
Description copied from interface: AdminListener
Indicates the end of a transaction.

Specified by:
transactionEnd in interface AdminListener

status

public void status(String msg,
                   int lineNo,
                   int columnNo)
Description copied from interface: AdminListener
A status message with optional line and column number to indicate progress.

Specified by:
status in interface AdminListener
Parameters:
msg - The status message.
lineNo - A line number, or -1 if unavailable or irrelevant.
columnNo - A column number, or -1 if unavailable or irrelevant.

notification

public void notification(String msg,
                         int lineNo,
                         int columnNo,
                         Statement stat)
Description copied from interface: AdminListener
A notification message (not an error) with optionally line and column number and the statement to indicate the source of the notification.

Specified by:
notification in interface AdminListener
Parameters:
msg - The notification message.
lineNo - A line number, or -1 if unavailable or irrelevant.
columnNo - A column number, or -1 if unavailable or irrelevant.
stat - The statement, or null if unavailable or irrelevant.

warning

public void warning(String msg,
                    int lineNo,
                    int columnNo,
                    Statement stat)
Description copied from interface: AdminListener
A warning message with optionally line and column number and the statement to indicate the source of the warning.

Specified by:
warning in interface AdminListener
Parameters:
msg - The warning message.
lineNo - A line number, or -1 if unavailable or irrelevant.
columnNo - A column number, or -1 if unavailable or irrelevant.
stat - The statement, or null if unavailable or irrelevant.

error

public void error(String msg,
                  int lineNo,
                  int columnNo,
                  Statement stat)
Description copied from interface: AdminListener
An error message with optionally line and column number and the statement to indicate the source of the error.

Specified by:
error in interface AdminListener
Parameters:
msg - The error message.
lineNo - A line number, or -1 if unavailable or irrelevant.
columnNo - A column number, or -1 if unavailable or irrelevant.
stat - The statement, or null if unavailable or irrelevant.


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.