macaw.persistenceLayer.demo
Class InMemoryChangeEventManager

java.lang.Object
  extended by macaw.persistenceLayer.demo.InMemoryChangeEventManager

public class InMemoryChangeEventManager
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 memory.


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
InMemoryChangeEventManager()
           
 
Method Summary
 void clear()
          remove all change events
 java.util.ArrayList<MacawChangeEvent> getAllChanges()
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryByUser(User user)
           
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForListChoices()
          retrieve all change events that are associated with curation changes made to list choice classes, such as AvailabilityState, CleaningState, Category and AliasFilePath.
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForSupportingDocument(User user, SupportingDocument supportingDocument)
          provides the collection of change events associated with curating a given supporting document.
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForValueLabels(User user, Variable variable)
          provides a collection of change events for value labels associated with a given variable
 java.util.ArrayList<MacawChangeEvent> getChangeHistoryForVariable(User user, Variable variable)
          provides a collection of change events that are associated with the curation of a given variable.
 void registerChangeEvent(MacawChangeEvent event)
          add a change event that is a result of some curation operation.
 void registerChangeEvents(java.util.ArrayList<MacawChangeEvent> events)
          add a collection of change events that are a result of some curation operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryChangeEventManager

public InMemoryChangeEventManager()
Method Detail

getChangeHistoryForVariable

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForVariable(User user,
                                                                         Variable variable)
                                                                  throws MacawException
provides a collection of change events that are associated with the curation of a given variable. These changes can include:

Throws:
MacawException

getChangeHistoryForSupportingDocument

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForSupportingDocument(User user,
                                                                                   SupportingDocument supportingDocument)
                                                                            throws MacawException
provides the collection of change events associated with curating a given supporting document.

Parameters:
user -
supportingDocument - the target of change.
Throws:
MacawException

getChangeHistoryForValueLabels

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForValueLabels(User user,
                                                                            Variable variable)
                                                                     throws MacawException
provides a collection of change events for value labels associated with a given variable

Parameters:
user -
variable - - the variable that owns the value labels
Throws:
MacawException

getChangeHistoryByUser

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryByUser(User user)
                                                             throws MacawException
Throws:
MacawException

getChangeHistoryForListChoices

public java.util.ArrayList<MacawChangeEvent> getChangeHistoryForListChoices()
                                                                     throws MacawException
retrieve all change events that are associated with curation changes made to list choice classes, such as AvailabilityState, CleaningState, Category and AliasFilePath.

Throws:
MacawException

registerChangeEvent

public void registerChangeEvent(MacawChangeEvent event)
                         throws MacawException
add a change event that is a result of some curation operation.

Parameters:
event -
Throws:
MacawException

registerChangeEvents

public void registerChangeEvents(java.util.ArrayList<MacawChangeEvent> events)
                          throws MacawException
add a collection of change events that are a result of some curation operation.

Parameters:
events -
Throws:
MacawException

clear

public void clear()
remove all change events


getAllChanges

public java.util.ArrayList<MacawChangeEvent> getAllChanges()