macaw.persistenceLayer.demo
Class InMemorySupportingDocumentsManager

java.lang.Object
  extended by macaw.persistenceLayer.demo.InMemoryCurationConceptManager
      extended by macaw.persistenceLayer.demo.InMemorySupportingDocumentsManager

public class InMemorySupportingDocumentsManager
extends InMemoryCurationConceptManager

manages instances of SupportingDocument in memory rather than managing them in a database. This is a typical example of a manager class used by delegation classes that implement the main APIs MacawCurationAPI and MacawRetrievalAPI.

InMemorySupportingDocumentsManager supports the following operations:

Most of the editing operations have three parts:

The manager supports object persistence by adopting the following policies:

The manager generates unique identifiers for SupportingDocument in much the same way as a relational database would use an autonumbered key.


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)

Field Summary
 
Fields inherited from class macaw.persistenceLayer.demo.InMemoryCurationConceptManager
log
 
Constructor Summary
InMemorySupportingDocumentsManager(InMemoryChangeEventManager changeEventManager)
           
 
Method Summary
 void addSupportingDocument(User user, SupportingDocument supportingDocument)
           
 void checkSupportingDocumentExists(SupportingDocument candidateSupportingDocument)
           
 void clear()
           
 void deleteSupportingDocuments(User user, java.util.ArrayList<SupportingDocument> supportingDocumentsToDelete)
           
 java.util.ArrayList<SupportingDocument> getAllSupportingDocuments(User user)
           
 SupportingDocument getOriginalSupportingDocument(SupportingDocument revisedSupportingDocument)
           
 int getSupportingDocumentIdentifier(SupportingDocument targetSupportingDocument)
           
 void updateSupportingDocument(User user, SupportingDocument revisedSupportingDocument)
           
 
Methods inherited from class macaw.persistenceLayer.demo.InMemoryCurationConceptManager
registerChangeEvent, registerChangeEvents, setLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemorySupportingDocumentsManager

public InMemorySupportingDocumentsManager(InMemoryChangeEventManager changeEventManager)
Method Detail

getAllSupportingDocuments

public java.util.ArrayList<SupportingDocument> getAllSupportingDocuments(User user)
                                                                  throws MacawException
Throws:
MacawException

addSupportingDocument

public void addSupportingDocument(User user,
                                  SupportingDocument supportingDocument)
                           throws MacawException
Throws:
MacawException

updateSupportingDocument

public void updateSupportingDocument(User user,
                                     SupportingDocument revisedSupportingDocument)
                              throws MacawException
Throws:
MacawException

deleteSupportingDocuments

public void deleteSupportingDocuments(User user,
                                      java.util.ArrayList<SupportingDocument> supportingDocumentsToDelete)
                               throws MacawException
Throws:
MacawException

getOriginalSupportingDocument

public SupportingDocument getOriginalSupportingDocument(SupportingDocument revisedSupportingDocument)

getSupportingDocumentIdentifier

public int getSupportingDocumentIdentifier(SupportingDocument targetSupportingDocument)

clear

public void clear()

checkSupportingDocumentExists

public void checkSupportingDocumentExists(SupportingDocument candidateSupportingDocument)
                                   throws MacawException
Throws:
MacawException