1 /*
2 * Copyright 2010 James Pether Sörling
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * $Id$
17 * $HeadURL$
18 */
19 package com.hack23.cia.service.external.riksdagen.api;
20
21 import java.util.List;
22
23 import com.hack23.cia.model.external.riksdagen.documentcontent.impl.DocumentContentData;
24 import com.hack23.cia.model.external.riksdagen.dokumentlista.impl.DocumentElement;
25 import com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentStatusContainer;
26 import com.hack23.cia.model.external.riksdagen.dokumentstatus.impl.DocumentType;
27 import com.hack23.cia.service.external.common.api.ProcessDataStrategy;
28
29
30 /**
31 * The Interface RiksdagenDocumentApi.
32 */
33 public interface RiksdagenDocumentApi {
34
35 /**
36 * Gets the document content.
37 *
38 * @param id
39 * the id
40 * @return the document content
41 * @throws DataFailureException
42 * the data failure exception
43 */
44 DocumentContentData getDocumentContent(String id) throws DataFailureException;
45
46 /**
47 * Gets the document list.
48 *
49 * @param documentType
50 * the document type
51 * @param maxNumberPages
52 * the max number pages
53 * @return the document list
54 * @throws DataFailureException
55 * the data failure exception
56 */
57 List<DocumentElement> getDocumentList(DocumentType documentType, int maxNumberPages) throws DataFailureException;
58
59
60 /**
61 * Gets the document list.
62 *
63 * @param year
64 * the year
65 * @param maxNumberPages
66 * the max number pages
67 * @return the document list
68 * @throws DataFailureException
69 * the data failure exception
70 */
71 List<DocumentElement> getDocumentList(Integer year, int maxNumberPages) throws DataFailureException;
72
73 /**
74 * Gets the document list.
75 *
76 * @param changedSinceDate
77 * the changed since date
78 * @param changedToDate
79 * the changed to date
80 * @param maxNumberPages
81 * the max number pages
82 * @return the document list
83 * @throws DataFailureException
84 * the data failure exception
85 */
86 List<DocumentElement> getDocumentList(String changedSinceDate,String changedToDate, int maxNumberPages) throws DataFailureException;
87
88 /**
89 * Gets the document status.
90 *
91 * @param id
92 * the id
93 * @return the document status
94 * @throws DataFailureException
95 * the data failure exception
96 */
97 DocumentStatusContainer getDocumentStatus(String id) throws DataFailureException;
98
99
100 /**
101 * Process document list.
102 *
103 * @param changedSinceDate
104 * the changed since date
105 * @param changedToDate
106 * the changed to date
107 * @param processStrategy
108 * the process strategy
109 * @throws DataFailureException
110 * the data failure exception
111 */
112 void processDocumentList(String changedSinceDate, String changedToDate,
113 ProcessDataStrategy<DocumentElement> processStrategy) throws DataFailureException;
114
115 }