macaw.persistenceLayer.production
Class SQLChangeEventManager

java.lang.Object
  extended by macaw.persistenceLayer.production.SQLChangeEventManager

public class SQLChangeEventManager
extends java.lang.Object

A manager class that is called by various classes to make a record of editing changes made to instances of objects found in macaw.model. It stores records of these changes in a MySQL database.


Copyright 2010 Medical Research Council Unit for Lifelong Health and Ageing Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Version:
1.0
Author:
Kevin Garwood (kgarwood@users.sourceforge.net)

Constructor Summary
SQLChangeEventManager(Log log)
           
 
Method Summary
 void clear(java.sql.Connection connection)
           
 void clearAllChanges(java.sql.Connection connection)
           
 void createTable(java.sql.Connection connection)
           
 java.util.ArrayList<MacawChangeEvent> getAllChanges(java.sql.Connection connection)
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForListChoices(java.sql.Connection connection)
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForSupportingDocument(java.sql.Connection connection, SupportingDocument supportingDocument)
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForUser(java.sql.Connection connection, User user)
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForValueLabels(java.sql.Connection connection, Variable variable)
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForVariable(java.sql.Connection connection, Variable variable)
           
 void registerChangeEvent(java.sql.Connection connection, MacawChangeEvent changeEvent)
           
 void registerChangeEvents(java.sql.Connection connection, java.util.ArrayList<MacawChangeEvent> changeEvents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLChangeEventManager

public SQLChangeEventManager(Log log)
Method Detail

createTable

public void createTable(java.sql.Connection connection)
                 throws MacawException
Throws:
MacawException

registerChangeEvent

public void registerChangeEvent(java.sql.Connection connection,
                                MacawChangeEvent changeEvent)
                         throws MacawException
Throws:
MacawException

registerChangeEvents

public void registerChangeEvents(java.sql.Connection connection,
                                 java.util.ArrayList<MacawChangeEvent> changeEvents)
                          throws MacawException
Throws:
MacawException

getChangeHistoryForVariable

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForVariable(java.sql.Connection connection,
                                                                         Variable variable)
                                                                  throws MacawException
Throws:
MacawException

getChangeHistoryForSupportingDocument

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForSupportingDocument(java.sql.Connection connection,
                                                                                   SupportingDocument supportingDocument)
                                                                            throws MacawException
Throws:
MacawException

getChangeHistoryForValueLabels

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForValueLabels(java.sql.Connection connection,
                                                                            Variable variable)
                                                                     throws MacawException
Throws:
MacawException

getChangeHistoryForListChoices

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForListChoices(java.sql.Connection connection)
                                                                     throws MacawException
Throws:
MacawException

getChangeHistoryForUser

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForUser(java.sql.Connection connection,
                                                                     User user)
                                                              throws MacawException
Throws:
MacawException

clear

public void clear(java.sql.Connection connection)
           throws MacawException
Throws:
MacawException

clearAllChanges

public void clearAllChanges(java.sql.Connection connection)
                     throws MacawException
Throws:
MacawException

getAllChanges

public java.util.ArrayList<MacawChangeEvent> getAllChanges(java.sql.Connection connection)
                                                    throws MacawException
Throws:
MacawException