1 | /** |
---|
2 | * MailArchiver is an application that provides services for storing and managing e-mail messages through a Web Services SOAP interface. |
---|
3 | * Copyright (C) 2012 Marcio Andre Scholl Levien and Fernando Alberto Reuter Wendt and Jose Ronaldo Nogueira Fonseca Junior |
---|
4 | * |
---|
5 | * This program is free software: you can redistribute it and/or modify |
---|
6 | * it under the terms of the GNU Affero General Public License as |
---|
7 | * published by the Free Software Foundation, either version 3 of the |
---|
8 | * License, or (at your option) any later version. |
---|
9 | * |
---|
10 | * This program is distributed in the hope that it will be useful, |
---|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | * GNU Affero General Public License for more details. |
---|
14 | * |
---|
15 | * You should have received a copy of the GNU Affero General Public License |
---|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
17 | */ |
---|
18 | |
---|
19 | /******************************************************************************\ |
---|
20 | * |
---|
21 | * This product was developed by |
---|
22 | * |
---|
23 | * SERVIÃO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), |
---|
24 | * |
---|
25 | * a government company established under Brazilian law (5.615/70), |
---|
26 | * at Department of Development of Porto Alegre. |
---|
27 | * |
---|
28 | \******************************************************************************/ |
---|
29 | |
---|
30 | package serpro.mailarchiver.service.web; |
---|
31 | |
---|
32 | import javax.jws.WebParam; |
---|
33 | import javax.jws.WebService; |
---|
34 | import javax.jws.soap.SOAPBinding; |
---|
35 | import javax.jws.soap.SOAPBinding.ParameterStyle; |
---|
36 | import javax.jws.soap.SOAPBinding.Style; |
---|
37 | import javax.jws.soap.SOAPBinding.Use; |
---|
38 | import javax.xml.bind.annotation.XmlSeeAlso; |
---|
39 | |
---|
40 | import org.apache.cxf.feature.Features; |
---|
41 | import org.apache.cxf.interceptor.InFaultInterceptors; |
---|
42 | import org.apache.cxf.interceptor.InInterceptors; |
---|
43 | import org.apache.cxf.interceptor.OutFaultInterceptors; |
---|
44 | import org.apache.cxf.interceptor.OutInterceptors; |
---|
45 | |
---|
46 | import serpro.mailarchiver.service.dto.TAttachment; |
---|
47 | import serpro.mailarchiver.service.dto.TFault; |
---|
48 | import serpro.mailarchiver.service.dto.TFolder; |
---|
49 | import serpro.mailarchiver.service.dto.TMessage; |
---|
50 | import serpro.mailarchiver.service.dto.TSession; |
---|
51 | |
---|
52 | @WebService |
---|
53 | @SOAPBinding( |
---|
54 | style=Style.DOCUMENT, |
---|
55 | use=Use.LITERAL, |
---|
56 | parameterStyle= |
---|
57 | ParameterStyle.WRAPPED |
---|
58 | // ParameterStyle.BARE |
---|
59 | ) |
---|
60 | @InInterceptors (interceptors = {"serpro.mailarchiver.util.SoapInterceptors$Receive"}) |
---|
61 | @InFaultInterceptors (interceptors = {"serpro.mailarchiver.util.SoapInterceptors$ReceiveFault"}) |
---|
62 | @OutInterceptors (interceptors = {"serpro.mailarchiver.util.SoapInterceptors$Setup"}) |
---|
63 | @OutFaultInterceptors (interceptors = {"serpro.mailarchiver.util.SoapInterceptors$SetupFault"}) |
---|
64 | @Features(features = "org.apache.cxf.feature.LoggingFeature") |
---|
65 | @XmlSeeAlso({ServiceFault.class}) |
---|
66 | public interface ArchiveServices { |
---|
67 | |
---|
68 | TFault getFaultInfo( |
---|
69 | @WebParam(name="sessionId") String sessionId |
---|
70 | ); |
---|
71 | |
---|
72 | TSession login( |
---|
73 | @WebParam(name="userId") String userId, |
---|
74 | @WebParam(name="password") String password, |
---|
75 | @WebParam(name="phpSessId") String phpSessId, |
---|
76 | @WebParam(name="balanceId") String balanceId |
---|
77 | ) throws ServiceFault; |
---|
78 | |
---|
79 | Integer logout( |
---|
80 | @WebParam(name="sessionId") String sessionId |
---|
81 | ) throws ServiceFault; |
---|
82 | |
---|
83 | TFolder[] listFolders( |
---|
84 | @WebParam(name="sessionId") String sessionId, |
---|
85 | @WebParam(name="folderId") String folderId |
---|
86 | ) throws ServiceFault; |
---|
87 | |
---|
88 | TMessage[] listMessages( |
---|
89 | @WebParam(name="sessionId") String sessionId, |
---|
90 | @WebParam(name="queryConfig") String queryConfig |
---|
91 | ) throws ServiceFault; |
---|
92 | |
---|
93 | //TODO: remover? propriedade "attachments" em TMessage será suficiente? |
---|
94 | TAttachment[] listAttachments( |
---|
95 | @WebParam(name="sessionId") String sessionId, |
---|
96 | @WebParam(name="messageId") String messageId |
---|
97 | ) throws ServiceFault; |
---|
98 | |
---|
99 | String getMessageBody( |
---|
100 | @WebParam(name="sessionId") String sessionId, |
---|
101 | @WebParam(name="messageId") String messageId |
---|
102 | ) throws ServiceFault; |
---|
103 | |
---|
104 | String getRawBinaryBody( |
---|
105 | @WebParam(name="sessionId") String sessionId, |
---|
106 | @WebParam(name="bodyId") String bodyId |
---|
107 | ) throws ServiceFault; |
---|
108 | |
---|
109 | Integer copyMessages( |
---|
110 | @WebParam(name="sessionId") String sessionId, |
---|
111 | @WebParam(name="folderId") String folderId, |
---|
112 | @WebParam(name="messagesId") String... messagesId |
---|
113 | ) throws ServiceFault; |
---|
114 | |
---|
115 | Integer moveMessages( |
---|
116 | @WebParam(name="sessionId") String sessionId, |
---|
117 | @WebParam(name="folderId") String folderId, |
---|
118 | @WebParam(name="messagesId") String... messagesId |
---|
119 | ) throws ServiceFault; |
---|
120 | |
---|
121 | Integer deleteMessages( |
---|
122 | @WebParam(name="sessionId") String sessionId, |
---|
123 | @WebParam(name="messagesId") String... messagesId |
---|
124 | ) throws ServiceFault; |
---|
125 | |
---|
126 | Integer tagMessages( |
---|
127 | @WebParam(name="sessionId") String sessionId, |
---|
128 | @WebParam(name="tagConfig") String tagConfig |
---|
129 | ) throws ServiceFault; |
---|
130 | |
---|
131 | String zipMessages( |
---|
132 | @WebParam(name="sessionId") String sessionId, |
---|
133 | @WebParam(name="zipConfig") String zipConfig |
---|
134 | ) throws ServiceFault; |
---|
135 | |
---|
136 | TFolder createFolder( |
---|
137 | @WebParam(name="sessionId") String sessionId, |
---|
138 | @WebParam(name="parentFolderId") String parentFolderId, |
---|
139 | @WebParam(name="name") String name |
---|
140 | ) throws ServiceFault; |
---|
141 | |
---|
142 | TFolder createAbsoluteFolder( |
---|
143 | @WebParam(name="sessionId") String sessionId, |
---|
144 | @WebParam(name="path") String path |
---|
145 | ) throws ServiceFault; |
---|
146 | |
---|
147 | TFolder renameFolder( |
---|
148 | @WebParam(name="sessionId") String sessionId, |
---|
149 | @WebParam(name="folderId") String folderId, |
---|
150 | @WebParam(name="newName") String newName |
---|
151 | ) throws ServiceFault; |
---|
152 | |
---|
153 | TFolder moveFolder( |
---|
154 | @WebParam(name="sessionId") String sessionId, |
---|
155 | @WebParam(name="newParentFolderId") String newParentFolderId, |
---|
156 | @WebParam(name="folderId") String folderId |
---|
157 | ) throws ServiceFault; |
---|
158 | |
---|
159 | Integer deleteFolder( |
---|
160 | @WebParam(name="sessionId") String sessionId, |
---|
161 | @WebParam(name="folderId") String folderId, |
---|
162 | @WebParam(name="recursive") boolean recursive |
---|
163 | ) throws ServiceFault; |
---|
164 | |
---|
165 | TMessage archive( |
---|
166 | @WebParam(name="sessionId") String sessionId, |
---|
167 | @WebParam(name="folderId") String folderId, |
---|
168 | @WebParam(name="message") String message |
---|
169 | ) throws ServiceFault; |
---|
170 | |
---|
171 | TFolder getFolderInfo( |
---|
172 | @WebParam(name="sessionId") String sessionId, |
---|
173 | @WebParam(name="folderId") String folderId |
---|
174 | ) throws ServiceFault; |
---|
175 | |
---|
176 | TMessage getMessageInfo( |
---|
177 | @WebParam(name="sessionId") String sessionId, |
---|
178 | @WebParam(name="messageId") String messageId |
---|
179 | ) throws ServiceFault; |
---|
180 | |
---|
181 | String getState() throws ServiceFault; |
---|
182 | |
---|
183 | } |
---|