01: /*
02: * $Id: Loader.java 881 2007-02-12 07:54:31Z hengels $
03: * (c) Copyright 2004 con:cern development team.
04: *
05: * This file is part of con:cern (http://concern.sf.net).
06: *
07: * con:cern is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU Lesser General Public License
09: * as published by the Free Software Foundation; either version 2.1
10: * of the License, or (at your option) any later version.
11: *
12: * Please see COPYING for the complete licence.
13: */
14: package org.concern;
15:
16: import java.util.*;
17:
18: /**
19: * The loader is responsible for loading the subject. The implementation is dependent on the data store where the
20: * subject business information is stored. The loader is called from the controller and worklists.
21: * @version $Revision: 881 $
22: */
23: public interface Loader<S> {
24: /**
25: * Load the subject with the specified id. That is the userValue from the controller point of view.
26: * Transactional caching improves the performance.
27: * @param id identifies the subject
28: * @return the subject
29: * @throws SubjectNotFoundException
30: */
31: S load(String id) throws SubjectNotFoundException, LoaderException;
32:
33: /**
34: * Load several subjects at once. This method is called by worklists, mostly.
35: * @param ids the ids identify the subjects
36: * @return the subjects
37: * @throws SubjectNotFoundException
38: */
39: S[] load(String[] ids) throws SubjectNotFoundException,
40: LoaderException;
41:
42: /**
43: * Retrieve the userValue (pk) for the specified subject.
44: * @param subject
45: * @return the userValue
46: * @throws SubjectNotFoundException
47: */
48: String idOf(S subject) throws SubjectNotFoundException,
49: LoaderException;
50:
51: /**
52: * Create a textual representation of the subject in all supported languages
53: * @param subject
54: * @return a set of SubjectLine objects
55: * @throws LoaderException
56: */
57: Map<String, String> formatSubjectLines(S subject)
58: throws LoaderException;
59:
60: /**
61: * Who has created this subject?
62: * @param o
63: * @return
64: * @throws LoaderException
65: */
66: String getOriginator(S o) throws LoaderException;
67: }
|