1 /*
2 * Copyright (c) 2002-2014, Mairie de Paris
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright notice
10 * and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright notice
13 * and the following disclaimer in the documentation and/or other materials
14 * provided with the distribution.
15 *
16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 *
32 * License 1.0
33 */
34 package fr.paris.lutece.plugins.crmclient.service;
35
36 import fr.paris.lutece.plugins.crmclient.service.queue.ICRMClientQueue;
37 import fr.paris.lutece.plugins.crmclient.util.CRMException;
38
39
40 /**
41 *
42 * ICRMClientService
43 *
44 */
45 public interface ICRMClientService
46 {
47 String BEAN_SERVICE = "crmclient.crmClientService";
48
49 /**
50 * Get the queue
51 * @return the queue
52 */
53 ICRMClientQueue getQueue( );
54
55 /**
56 * Notify a demand
57 * @param strIdDemand the id demand
58 * @param strObject the object
59 * @param strMessage the message
60 * @param strSender the sender
61 */
62 void notify( String strIdDemand, String strObject, String strMessage, String strSender );
63
64 /**
65 * Notify a demand
66 * @param strIdDemand the id demand
67 * @param strObject the object
68 * @param strMessage the message
69 * @param strSender the sender
70 * @param strCRMWebAppCode the CRM webapp code
71 */
72 void notify( String strIdDemand, String strObject, String strMessage, String strSender, String strCRMWebAppCode );
73
74 /**
75 * Update a demand
76 * @param strIdDemand the id demand
77 * @param strStatusText the status text
78 * @throws CRMException CRMException
79 */
80 void sendUpdateDemand( String strIdDemand, String strStatusText )
81 throws CRMException;
82
83 /**
84 * Update a demand
85 * @param strIdDemand the id demand
86 * @param strStatusText the status text
87 * @param strCRMWebAppCode the CRM webapp code
88 * @throws CRMException CRMException
89 */
90 void sendUpdateDemand( String strIdDemand, String strStatusText, String strCRMWebAppCode )
91 throws CRMException;
92
93 /**
94 * Update a demand
95 * @param strIdDemand the id demand
96 * @param strStatusText the status text
97 * @param strCRMWebAppCode the CRM webapp code
98 * @param strIdStatusCRM id of CRM status
99 * @throws CRMException CRMException
100 *
101 */
102 void sendUpdateDemand( String strIdDemand, String strStatusText, String strCRMWebAppCode, String strIdStatusCRM )
103 throws CRMException;
104
105 /**
106 * Update a demand
107 * @param strIdDemand the id demand
108 * @param strStatusText the status text
109 * @param strCRMWebAppCode the CRM webapp code
110 * @param strIdStatusCRM id of CRM status
111 * @param strData the value of the parameter demand_data insert in the demand link
112 * @throws CRMException the exception if there is a problem
113 */
114 void sendUpdateDemand( String strIdDemand, String strStatusText, String strCRMWebAppCode, String strIdStatusCRM,
115 String strData ) throws CRMException;
116
117 /**
118 * This method calls create a new demand and gets the id demand
119 * @param strIdDemandType id of demand type
120 * @param strUserGuid login of user auth
121 * @param strIdStatusCRM id of CRM status
122 * @param strStatusText status text
123 * @param strData the value of the parameter demand_data insert in the demand link
124 * @return id demand
125 * @throws CRMException the exception if there is a problem
126 */
127 String sendCreateDemandByUserGuid( String strIdDemandType, String strUserGuid, String strIdStatusCRM,
128 String strStatusText, String strData ) throws CRMException;
129
130 /**
131 * This method calls create a new demand and gets the id demand
132 * @param strIdDemandType id of demand type
133 * @param strUserGuid login of user auth
134 * @param strIdStatusCRM id of CRM status
135 * @param strStatusText status text
136 * @param strData the value of the parameter demand_data insert in the demand link
137 * @param strCRMWebAppCode the CRM webapp code
138 * @return id demand
139 * @throws CRMException the exception if there is a problem
140 */
141 String sendCreateDemandByUserGuid( String strIdDemandType, String strUserGuid, String strIdStatusCRM,
142 String strStatusText, String strData, String strCRMWebAppCode )
143 throws CRMException;
144
145 /**
146 * This method calls create a new demand and get id demand
147 * @param strIdDemandType id of demand type
148 * @param strIdCRMUser the id crm user
149 * @param strIdStatusCRM id of CRM status
150 * @param strStatusText status text
151 * @param strData the value of the parameter demand_data insert in the demand link
152 * @return id demand
153 * @throws CRMException the exception if there is a problem
154 */
155 @Deprecated
156 String sendCreateDemandByIdCRMUser( String strIdDemandType, String strIdCRMUser, String strIdStatusCRM,
157 String strStatusText, String strData ) throws CRMException;
158
159 /**
160 * This method calls create a new demand and get id demand
161 * @param strIdDemandType id of demand type
162 * @param strIdCRMUser the id crm user
163 * @param strIdStatusCRM id of CRM status
164 * @param strStatusText status text
165 * @param strData the value of the parameter demand_data insert in the demand link
166 * @param strCRMWebAppCode the CRM webapp code
167 * @return id demand
168 * @throws CRMException the exception if there is a problem
169 */
170 @Deprecated
171 String sendCreateDemandByIdCRMUser( String strIdDemandType, String strIdCRMUser, String strIdStatusCRM,
172 String strStatusText, String strData, String strCRMWebAppCode )
173 throws CRMException;
174
175 /**
176 * This method delete a demand
177 * @param strIdDemand the id of the demand
178 * @throws HttpAccessException the exception if there is a problem
179 */
180 void sendDeleteDemand( String strIdDemand ) throws CRMException;
181
182 /**
183 * This method delete a demand
184 * @param strIdDemand the id of the demand
185 * @param strCRMWebAppCode the CRM webapp code
186 * @throws CRMException the exception if there is a problem
187 */
188 void sendDeleteDemand( String strIdDemand, String strCRMWebAppCode )
189 throws CRMException;
190
191 /**
192 * This method calls Rest WS to get the user guid from a given id demand
193 * @param strIdDemand the id demand
194 * @return the user guid
195 * @throws CRMException the exception if there is a problem
196 */
197 String getUserGuidFromIdDemand( String strIdDemand )
198 throws CRMException;
199
200 /**
201 * This method calls Rest WS to get the user guid from a given id demand
202 * @param strIdDemand the id demand
203 * @param strCRMWebAppCode the CRM webapp code
204 * @return the user guid
205 * @throws CRMException the exception if there is a problem
206 */
207 String getUserGuidFromIdDemand( String strIdDemand, String strCRMWebAppCode )
208 throws CRMException;
209
210 /**
211 * This method calls Rest WS to get the user guid from a given id crm user
212 * @param strIdCRMUser the id user
213 * @return the user guid
214 * @throws CRMException the exception if there is a problem
215 */
216 @Deprecated
217 String getUserGuidFromIdCRMUser( String strIdCRMUser )
218 throws CRMException;
219
220 /**
221 * This method calls Rest WS to get the user guid from a given id crm user
222 * @param strIdCRMUser the id user
223 * @param strCRMWebAppCode the CRM webapp code
224 * @return the user guid
225 * @throws CRMException the exception if there is a problem
226 */
227 @Deprecated
228 String getUserGuidFromIdCRMUser( String strIdCRMUser, String strCRMWebAppCode )
229 throws CRMException;
230
231 /**
232 * Get the XML of the demand
233 * @param strIdDemand the id demand
234 * @return the XML of the demand
235 * @throws CRMException the exception if there is a problem
236 */
237 String getDemandXml( String strIdDemand ) throws CRMException;
238
239 /**
240 * Get the XML of the demand
241 * @param strIdDemand the id demand
242 * @param strCRMWebAppCode the CRM webapp code
243 * @return the XML of the demand
244 * @throws CRMException the exception if there is a problem
245 */
246 String getDemandXml( String strIdDemand, String strCRMWebAppCode )
247 throws CRMException;
248
249 /**
250 * Get the Json of the demand
251 * @param strIdDemand the id of the demand
252 * @return the Json of the demand
253 * @throws CRMException the exception if there is a problem
254 */
255 String getDemandJson( String strIdDemand ) throws CRMException;
256
257 /**
258 * Get the Json of the demand
259 * @param strIdDemand the id of the demand
260 * @param strCRMWebAppCode the CRM webapp code
261 * @return the Json of the demand
262 * @throws CRMException the exception if there is a problem
263 */
264 String getDemandJson( String strIdDemand, String strCRMWebAppCode )
265 throws CRMException;
266
267 /**
268 * Get the CRMUser attribute value
269 * @param strUserGuid the user guid
270 * @param strAttribute the attribute
271 * @return the attribute value
272 * @throws CRMException the exception if there is a problem
273 */
274 String getCRMUserAttribute( String strUserGuid, String strAttribute )
275 throws CRMException;
276
277 /**
278 * Get the CRMUser attribute value
279 * @param strUserGuid the user guid
280 * @param strAttribute the attribute
281 * @param strCRMWebAppCode the CRM webapp code
282 * @return the attribute value
283 * @throws CRMException the exception if there is a problem
284 */
285 String getCRMUserAttribute( String strUserGuid, String strAttribute, String strCRMWebAppCode )
286 throws CRMException;
287
288 /**
289 * Get the CRMUser attributes in XML
290 * @param strUserGuid the user guid
291 * @return the CRMUser attributes
292 * @throws CRMException the exception if there is a problem
293 */
294 String getCRMUserAttributesXml( String strUserGuid )
295 throws CRMException;
296
297 /**
298 * Get the CRMUser attributes in XML
299 * @param strUserGuid the user guid
300 * @param strCRMWebAppCode the CRM webapp code
301 * @return the CRMUser attributes
302 * @throws CRMException the exception if there is a problem
303 */
304 String getCRMUserAttributesXml( String strUserGuid, String strCRMWebAppCode )
305 throws CRMException;
306
307 /**
308 * Get the CRMUser attributes in JSON
309 * @param strUserGuid the user guid
310 * @return the attributes
311 * @throws CRMException the exception if there is a problem
312 */
313 String getCRMUserAttributesJson( String strUserGuid )
314 throws CRMException;
315
316 /**
317 * Get the CRMUser attributes in JSON
318 * @param strUserGuid the user guid
319 * @param strCRMWebAppCode the CRM webapp code
320 * @return the attributes
321 * @throws CRMException the exception if there is a problem
322 */
323 String getCRMUserAttributesJson( String strUserGuid, String strCRMWebAppCode )
324 throws CRMException;
325 }