001 /**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.krms.api.repository;
017
018 import org.kuali.rice.core.api.criteria.QueryByCriteria;
019 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
020 import org.kuali.rice.krms.api.KrmsConstants;
021 import org.kuali.rice.krms.api.repository.agenda.AgendaDefinition;
022 import org.kuali.rice.krms.api.repository.agenda.AgendaItemDefinition;
023 import org.kuali.rice.krms.api.repository.language.NaturalLanguageUsage;
024 import org.kuali.rice.krms.api.repository.proposition.PropositionDefinition;
025 import org.kuali.rice.krms.api.repository.reference.ReferenceObjectBinding;
026 import org.kuali.rice.krms.api.repository.rule.RuleDefinition;
027 import org.springframework.cache.annotation.Cacheable;
028
029 import javax.jws.WebMethod;
030 import javax.jws.WebParam;
031 import javax.jws.WebResult;
032 import javax.jws.WebService;
033 import javax.jws.soap.SOAPBinding;
034 import javax.xml.bind.annotation.XmlElement;
035 import javax.xml.bind.annotation.XmlElementWrapper;
036 import java.util.List;
037 import java.util.Set;
038
039 /**
040 * The rule maintenance service operations facilitate management of rules and
041 * associated information.
042 *
043 * @author Kuali Rice Team (rice.collab@kuali.org)
044 */
045 @WebService(name = "ruleManagementService", targetNamespace = KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0)
046 @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
047 parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
048 public interface RuleManagementService extends RuleRepositoryService {
049
050 /**
051 * Create RefObject-KRMS object binding
052 *
053 * @param referenceObjectDefinition data for the new ReferenceObjectBinding to be created
054 * @return newly created ReferenceObjectBinding
055 * @throws RiceIllegalArgumentException if the given referenceObjectDefinition
056 * is null or invalid
057 */
058 @WebMethod(operationName = "createReferenceObjectBinding")
059 @WebResult(name = "referenceObjectBinding")
060 public ReferenceObjectBinding createReferenceObjectBinding(@WebParam(
061 name = "referenceObjectDefinition") ReferenceObjectBinding referenceObjectDefinition) throws RiceIllegalArgumentException;
062
063 /**
064 * Retrieve referenceObjectBinding given a specific id
065 *
066 * @param id identifier of the ReferenceObjectBinding to be retrieved
067 * @return a ReferenceObjectBinding with the given id value
068 * @throws RiceIllegalArgumentException if the given id is blank or
069 * invalid
070 */
071 @WebMethod(operationName = "getReferenceObjectBinding")
072 @WebResult(name = "referenceObjectBinding")
073 public ReferenceObjectBinding getReferenceObjectBinding(@WebParam(
074 name = "id") String id) throws RiceIllegalArgumentException;
075
076 /**
077 * Retrieve list of ReferenceObjectBinding objects given ids
078 *
079 * @param ids identifiers of the ReferenceObjectBinding to be retrieved
080 * @return list of ReferenceObjectBinding objects for the given ids
081 * @throws RiceIllegalArgumentException if one or more ids in the give list
082 * is blank or invalid
083 */
084 @WebMethod(operationName = "getReferenceObjectBindings")
085 @XmlElementWrapper(name = "referenceObjectBindings", required = true)
086 @XmlElement(name = "referenceObjectBinding", required = false)
087 @WebResult(name = "referenceObjectBindings")
088 List<ReferenceObjectBinding> getReferenceObjectBindings(@WebParam(
089 name = "ids") List<String> ids) throws RiceIllegalArgumentException;
090
091 /**
092 * Retrieves list of ReferenceObjectBinding objects for the given ref obj
093 * discriminator type
094 *
095 * @param referenceObjectReferenceDiscriminatorType reference object type
096 * @return list of ReferenceObjectBinding objects for the given discriminator
097 * type
098 * @throws RiceIllegalArgumentException if the given referenceObjectReferenceDiscriminatorType is
099 * blank or invalid
100 */
101 @WebMethod(operationName = "findReferenceObjectBindingsByReferenceDiscriminatorType")
102 @XmlElementWrapper(name = "referenceObjectBindings", required = true)
103 @XmlElement(name = "referenceObjectBinding", required = false)
104 @WebResult(name = "referenceObjectBindings")
105 public List<ReferenceObjectBinding> findReferenceObjectBindingsByReferenceDiscriminatorType(
106 @WebParam(name = "referenceObjectReferenceDiscriminatorType") String referenceObjectReferenceDiscriminatorType) throws RiceIllegalArgumentException;
107
108 /**
109 * Retrieves list of ReferenceObjectBinding objects for the given krms obj
110 * discriminator type
111 *
112 * @param referenceObjectKrmsDiscriminatorType reference object type
113 * @return list of ReferenceObjectBinding objects for the given discriminator
114 * type
115 * @throws RiceIllegalArgumentException if the given referenceObjectKrmsDiscriminatorType is
116 * blank or invalid
117 */
118 @WebMethod(operationName = "findReferenceObjectBindingsByKrmsDiscriminatorType")
119 @XmlElementWrapper(name = "referenceObjectBindings", required = true)
120 @XmlElement(name = "referenceObjectBinding", required = false)
121 @WebResult(name = "referenceObjectBindings")
122 public List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsDiscriminatorType(
123 @WebParam(name = "referenceObjectKrmsDiscriminatorType") String referenceObjectKrmsDiscriminatorType) throws RiceIllegalArgumentException;
124
125
126 /**
127 * Retrieves list of ReferenceObjectBinding objects for the given KRMS obj
128 * id.
129 *
130 * @param krmsObjectId identifier of the KRMS obj
131 * @return list of ReferenceObjectBinding objects for the given KRMS obj
132 * @throws RiceIllegalArgumentException if the given krmsObjectId is blank or
133 * invalid
134 */
135 @WebMethod(operationName = "findReferenceObjectBindingsByKrmsObjectId")
136 @XmlElementWrapper(name = "referenceObjectBindings", required = true)
137 @XmlElement(name = "referenceObjectBinding", required = false)
138 @WebResult(name = "referenceObjectBindings")
139 public List<ReferenceObjectBinding> findReferenceObjectBindingsByKrmsObject(
140 @WebParam(name = "krmsObjectId") String krmsObjectId) throws RiceIllegalArgumentException;
141
142 /**
143 * Update the ReferenceObjectBinding object specified by the identifier in the
144 * given DTO
145 *
146 * @param referenceObjectBindingDefinition DTO with updated info and id of the object to be updated
147 * @throws RiceIllegalArgumentException if the given referenceObjectBindingDefinition
148 * is null or invalid
149 */
150 @WebMethod(operationName = "updateReferenceObjectBinding")
151 public void updateReferenceObjectBinding(ReferenceObjectBinding referenceObjectBindingDefinition) throws RiceIllegalArgumentException;
152
153 /**
154 * Delete the specified ReferenceObjectBinding object
155 *
156 * @param id identifier of the object to be deleted
157 * @throws RiceIllegalArgumentException if the given id is null or invalid
158 */
159 @WebMethod(operationName = "deleteReferenceObjectBinding")
160 public void deleteReferenceObjectBinding(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
161
162
163 /**
164 * Query for ReferenceObjectBinding ids based on the given search criteria
165 * which is a Map of ReferenceObjectBinding field names to values. <p/> <p>
166 * This method returns it's results as a List of ReferenceObjectBinding ids
167 * that match the given search criteria. </p>
168 *
169 * @param queryByCriteria the criteria. Cannot be null.
170 * @return a list of ids matching the given criteria properties. An empty
171 * list is returned if an invalid or non-existent criteria is
172 * supplied.
173 * @throws RiceIllegalArgumentException if the queryByCriteria is null
174 */
175 @WebMethod(operationName = "findReferenceObjectBindingIds")
176 @XmlElementWrapper(name = "referenceObjectBindingIds", required = true)
177 @XmlElement(name = "referenceObjectBindingId", required = false)
178 @WebResult(name = "referenceObjectBindingIds")
179 List<String> findReferenceObjectBindingIds(@WebParam(name = "query") QueryByCriteria queryByCriteria) throws RiceIllegalArgumentException;
180
181 /**
182 * Create Agenda
183 *
184 * @param agendaDefinition data for the new Agenda to be created
185 * @return newly created Agenda
186 * @throws RiceIllegalArgumentException if the given agendaDefinition is
187 * null or invalid
188 */
189 @WebMethod(operationName = "createAgenda")
190 @WebResult(name = "agenda")
191 public AgendaDefinition createAgenda(@WebParam(name = "AgendaDefinition") AgendaDefinition agendaDefinition) throws RiceIllegalArgumentException;
192
193 /**
194 * Retrieve Agenda for the specified id
195 *
196 * @param id identifier for the Agenda
197 * @return specified Agenda
198 * @throws RiceIllegalArgumentException if the given id is null or invalid
199 */
200 @WebMethod(operationName = "getAgenda")
201 @WebResult(name = "agenda")
202 public AgendaDefinition getAgenda(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
203
204 /**
205 * Retrieve Agendas of the specified type
206 *
207 * @param typeId type of the Agenda
208 * @return list of Agendas of the specified type
209 * @throws RiceIllegalArgumentException if the given typeId is null or
210 * invalid
211 */
212 @WebMethod(operationName = "getAgendasByType")
213 @XmlElementWrapper(name = "agendas", required = true)
214 @XmlElement(name = "agenda", required = false)
215 @WebResult(name = "agendas")
216 public List<AgendaDefinition> getAgendasByType(@WebParam(name = "typeId") String typeId) throws RiceIllegalArgumentException;
217
218 /**
219 * Retrieve Agendas associated with the specified context
220 *
221 * @param contextId context of interest
222 * @return list of Agendas associated with the context
223 * @throws RiceIllegalArgumentException if the given contextId is null or
224 * invalid
225 */
226 @WebMethod(operationName = "getAgendasByContext")
227 @XmlElementWrapper(name = "agendas", required = true)
228 @XmlElement(name = "agenda", required = false)
229 @WebResult(name = "agendas")
230 public List<AgendaDefinition> getAgendasByContext(@WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
231
232 /**
233 * Retrieve Agendas of the specified type and context
234 *
235 * @param typeId type of the Agenda
236 * @param contextId context of interest
237 * @return list of Agendas associated with the specified type and context
238 * @throws RiceIllegalArgumentException if the given typeId or contextId
239 * null or invalid
240 */
241 @WebMethod(operationName = "getAgendasByTypeAndContext")
242 @XmlElementWrapper(name = "agendas", required = true)
243 @XmlElement(name = "agenda", required = false)
244 @WebResult(name = "agendas")
245 public List<AgendaDefinition> getAgendasByTypeAndContext(@WebParam(name = "typeId") String typeId,
246 @WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
247
248 /**
249 * Update the Agenda specified by the identifier in the input DTO
250 *
251 * @param agendaDefinition DTO with updated info and identifier of the object to be updated
252 * @throws RiceIllegalArgumentException if the given agendaDefinition is
253 * null or invalid
254 */
255 @WebMethod(operationName = "updateAgenda")
256 public void updateAgenda(@WebParam(name = "agendaDefinition") AgendaDefinition agendaDefinition) throws RiceIllegalArgumentException;
257
258 /**
259 * Delete the specified Agenda
260 *
261 * @param id identifier of the object to be deleted
262 * @throws RiceIllegalArgumentException if the given id is null or invalid
263 */
264 @WebMethod(operationName = "deleteAgenda")
265 public void deleteAgenda(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
266
267 /**
268 * Create AgendaItem
269 *
270 * @param agendaItemDefinition data for the new AgendaItem to be created
271 * @return newly created AgendaItem
272 * @throws RiceIllegalArgumentException if the given agendaItemDefinition is
273 * null or invalid
274 */
275 @WebMethod(operationName = "createAgendaItem")
276 @WebResult(name = "agendaItem")
277 public AgendaItemDefinition createAgendaItem(@WebParam(name = "AgendaItemDefinition") AgendaItemDefinition agendaItemDefinition) throws RiceIllegalArgumentException;
278
279 /**
280 * Retrieve AgendaItem by the specified identifier
281 *
282 * @param id identifier of the AgendaItem
283 * @return AgendaItem specified by the identifier
284 * @throws RiceIllegalArgumentException if the given id is null or invalid
285 */
286 @WebMethod(operationName = "getAgendaItem")
287 @WebResult(name = "agendaItem")
288 public AgendaItemDefinition getAgendaItem(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
289
290 /**
291 * Retrieve AgendaItems by specified type
292 *
293 * @param typeId type of the AgendaItems
294 * @return list of AgendaItems of the specified type
295 * @throws RiceIllegalArgumentException if the given typeId is null or
296 * invalid
297 */
298 @WebMethod(operationName = "getAgendaItemsByType")
299 @XmlElementWrapper(name = "agendaItems", required = true)
300 @XmlElement(name = "agendaItem", required = false)
301 @WebResult(name = "agendaItems")
302 public List<AgendaItemDefinition> getAgendaItemsByType(@WebParam(name = "typeId") String typeId) throws RiceIllegalArgumentException;
303
304 /**
305 * Retrieve AgendaItems associated with a context
306 *
307 * @param contextId context identifier
308 * @return list of AgendaItems associated with a context
309 * @throws RiceIllegalArgumentException if the given contextId is null or
310 * invalid
311 */
312 @WebMethod(operationName = "getAgendaItemsByContext")
313 @XmlElementWrapper(name = "agendaItems", required = true)
314 @XmlElement(name = "agendaItem", required = false)
315 @WebResult(name = "agendaItems")
316 public List<AgendaItemDefinition> getAgendaItemsByContext(@WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
317
318 /**
319 * Retrieve AgendaItems by type and context
320 *
321 * @param typeId type of the Agendas
322 * @param contextId context with which the Agendas are associated
323 * @return list of AgendaItems of the specified type and context
324 * @throws RiceIllegalArgumentException if the given typeId or contextId
325 * null or invalid
326 */
327 @WebMethod(operationName = "getAgendaItemsByTypeAndContext")
328 @XmlElementWrapper(name = "agendaItems", required = true)
329 @XmlElement(name = "agendaItem", required = false)
330 @WebResult(name = "agendaItems")
331 public List<AgendaItemDefinition> getAgendaItemsByTypeAndContext(@WebParam(name = "typeId") String typeId,
332 @WebParam(name = "contextId") String contextId) throws RiceIllegalArgumentException;
333
334 /**
335 * Update an AgendaItem
336 *
337 * @param agendaItemDefinition updated data for the AgendaItem, with id of the object to be updated
338 * @throws RiceIllegalArgumentException if the given agendaItemDefinition
339 * is null or invalid
340 */
341 @WebMethod(operationName = "updateAgendaItem")
342 public void updateAgendaItem(@WebParam(name = "agendaItemDefinition") AgendaItemDefinition agendaItemDefinition) throws RiceIllegalArgumentException;
343
344 /**
345 * Delete the specified AgendaItem
346 *
347 * @param id identifier of the AgendaItem to be deleted
348 * @throws RiceIllegalArgumentException if the given id is null or invalid
349 */
350 @WebMethod(operationName = "deleteAgendaItem")
351 public void deleteAgendaItem(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
352
353
354 /**
355 * Create Rule
356 *
357 * @param ruleDefinition data for the new Rule to be created
358 * @return newly created Rule
359 * @throws RiceIllegalArgumentException if the given ruleDefinition is null
360 * or invalid
361 */
362 @WebMethod(operationName = "createRule")
363 @WebResult(name = "rule")
364 public RuleDefinition createRule(@WebParam(name = "ruleDefinition") RuleDefinition ruleDefinition) throws RiceIllegalArgumentException;
365
366 /**
367 * Retrieves the rule for the given ruleId. The rule includes the
368 * propositions which define the condition that is to be evaluated on the
369 * rule. It also defines a collection of actions which will be invoked if
370 * the rule succeeds.
371 *
372 * @param ruleId the id of the rule to retrieve
373 * @return the rule definition, or null if no rule could be located for the
374 * given ruleId
375 * @throws IllegalArgumentException if the given ruleId is null
376 */
377 @WebMethod(operationName = "getRule")
378 @WebResult(name = "rule")
379 @Cacheable(value = RuleDefinition.Cache.NAME, key = "'ruleId=' + #p0")
380 public RuleDefinition getRule(@WebParam(name = "ruleId") String ruleId);
381
382 /**
383 * Retrieves all of the rules for the given list of ruleIds. The rule
384 * includes the propositions which define the condition that is to be
385 * evaluated on the rule. It also defines a collection of actions which
386 * will be invoked if the rule succeeds.
387 * <p/>
388 * <p>The list which is returned from this operation may not be the same
389 * size as the list which is passed to this method. If a rule doesn't exist
390 * for a given rule id then no result for that id will be returned in the
391 * list. As a result of this, the returned list can be empty, but it will
392 * never be null.
393 *
394 * @param ruleIds the list of rule ids for which to retrieve the rules
395 * @return the list of rules for the given ids, this list will only contain
396 * rules for the ids that were resolved successfully, it will never
397 * return null but could return an empty list if no rules could be
398 * loaded for the given set of ids
399 * @throws IllegalArgumentException if the given list of ruleIds is null
400 */
401 @WebMethod(operationName = "getRules")
402 @XmlElementWrapper(name = "rules", required = true)
403 @XmlElement(name = "rule", required = false)
404 @WebResult(name = "rules")
405 public List<RuleDefinition> getRules(@WebParam(name = "ruleIds") List<String> ruleIds);
406
407 /**
408 * Update the Rule specified by the identifier in the DTO
409 *
410 * @param ruleDefinition updated Rule information, object specified by the id
411 * @throws RiceIllegalArgumentException if the given ruleDefinition is null
412 * or invalid
413 */
414 @WebMethod(operationName = "updateRule")
415 public void updateRule(@WebParam(name = "ruleDefinition") RuleDefinition ruleDefinition) throws RiceIllegalArgumentException;
416
417 /**
418 * Delete the specified Rule
419 *
420 * @param id identifier of the Rule to be deleted
421 * @throws RiceIllegalArgumentException if the given id is null or invalid
422 */
423 @WebMethod(operationName = "deleteRule")
424 public void deleteRule(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
425
426 /**
427 * Create a Proposition
428 *
429 * @param propositionDefinition data for the new Proposition to be created
430 * @return newly created Proposition
431 * @throws RiceIllegalArgumentException if the given propositionDefinition
432 * is null or invalid
433 */
434 @WebMethod(operationName = "createProposition")
435 @WebResult(name = "proposition")
436 public PropositionDefinition createProposition(@WebParam(name = "propositionDefinition") PropositionDefinition propositionDefinition) throws RiceIllegalArgumentException;
437
438 /**
439 * Retrieve Proposition specified by the identifier
440 *
441 * @param id identifier of the Proposition to be retrieved
442 * @return specified Proposition
443 * @throws RiceIllegalArgumentException if the given id is null or invalid
444 */
445 @WebMethod(operationName = "getProposition")
446 @WebResult(name = "proposition")
447 public PropositionDefinition getProposition(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
448
449 /**
450 * Retrieve Propositions of the specified type
451 *
452 * @param typeId type of the Propositions to be retrieved
453 * @return list of Propositions of the specified type
454 * @throws RiceIllegalArgumentException if the given typeId is null or
455 * invalid
456 */
457 @WebMethod(operationName = "getPropositionsByType")
458 @XmlElementWrapper(name = "propositions", required = true)
459 @XmlElement(name = "proposition", required = false)
460 @WebResult(name = "propositions")
461 public Set<PropositionDefinition> getPropositionsByType(@WebParam(name = "typeId") String typeId) throws RiceIllegalArgumentException;
462
463 /**
464 * Retrieve Propositions associated with the specified Rule
465 *
466 * @param ruleId identifier of the Rule to which the Propositions are associated with
467 * @return list of Propositions associated with the Rule
468 * @throws RiceIllegalArgumentException if the given ruleId is null or
469 * invalid
470 */
471 @WebMethod(operationName = "getPropositionsByRule")
472 @XmlElementWrapper(name = "propositions", required = true)
473 @XmlElement(name = "proposition", required = false)
474 @WebResult(name = "propositions")
475 public Set<PropositionDefinition> getPropositionsByRule(@WebParam(name = "ruleId") String ruleId) throws RiceIllegalArgumentException;
476
477 /**
478 * Update the Proposition
479 *
480 * @param propositionDefinition updated data for the Proposition, id specifies the object to be updated
481 * @throws RiceIllegalArgumentException if the given propositionDefinition
482 * is null or invalid
483 */
484 @WebMethod(operationName = "updateProposition")
485 public void updateProposition(
486 @WebParam(name = "propositionDefinition") PropositionDefinition propositionDefinition) throws RiceIllegalArgumentException;
487
488 /**
489 * Delete the Proposition
490 *
491 * @param id identifier of the Proposition to be deleted
492 * @throws RiceIllegalArgumentException if the given id is null or invalid
493 */
494 @WebMethod(operationName = "deleteProposition")
495 public void deleteProposition(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
496
497 /**
498 * Create NaturalLanguageUsage
499 *
500 * @param naturalLanguageUsage data for the new NaturalLanguageUsage to be created
501 * @return newly created NaturalLanguageUsage
502 * @throws RiceIllegalArgumentException if the given naturalLanguageUsage is
503 * null or invalid
504 */
505 @WebMethod(operationName = "createNaturalLanguageUsage")
506 @WebResult(name = "naturalLanguageUsage")
507 public NaturalLanguageUsage createNaturalLanguageUsage(@WebParam(name = "naturalLanguageUsage") NaturalLanguageUsage naturalLanguageUsage) throws RiceIllegalArgumentException;
508
509 /**
510 * Retrieve NaturalLanguageUsage specified by the identifier
511 *
512 * @param id identifier of the NaturalLanguageUsage to be retrieved
513 * @return NaturalLanguageUsage specified by the identifier
514 * @throws RiceIllegalArgumentException if the given id is null or invalid
515 */
516 @WebMethod(operationName = "getNaturalLanguageUsage")
517 @WebResult(name = "naturalLanguageUsage")
518 public NaturalLanguageUsage getNaturalLanguageUsage(@WebParam(name = "id") String id) throws RiceIllegalArgumentException;
519
520 /**
521 * Update NaturalLanguageUsage
522 *
523 * @param naturalLanguageUsage updated data for the NaturalLanguageUsage object specified by the id
524 * @throws RiceIllegalArgumentException if the given naturalLanguageUsage is
525 * null or invalid
526 */
527 @WebMethod(operationName = "updateNaturalLanguageUsage")
528 public void updateNaturalLanguageUsage(@WebParam(name = "naturalLanguageUsage") NaturalLanguageUsage naturalLanguageUsage) throws RiceIllegalArgumentException;
529
530 /**
531 * Delete NaturalLanguageUsage
532 *
533 * @param naturalLanguageUsageId identifier of the NaturalLanguageUsage to be deleted
534 * @throws RiceIllegalArgumentException if the given naturalLanguageUsageId is null or invalid
535 */
536 @WebMethod(operationName = "deleteNaturalLanguageUsageType")
537 public void deleteNaturalLanguageUsageType(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId) throws RiceIllegalArgumentException;
538
539 /**
540 * Translates and retrieves a NaturalLanguage for a given KRMS object (e.g, proposition
541 * or agenda), NaturalLanguage usage type (context) and language into natural language
542 * TODO: Add appropriate caching annotation
543 *
544 * @param naturalLanguageUsageId Natural language usage information
545 * @param typeId KRMS object type id (for example, could refer to agenda
546 * or proposition)
547 * @param krmsObjectId KRMS object identifier
548 * @param languageCode desired
549 * @return natural language corresponding to the NaturalLanguage usage, KRMS object id, KRMS object type and desired language
550 * @throws RiceIllegalArgumentException if the given naturalLanguageUsageId, typeId,
551 * krmsObjectId or language is null or
552 * invalid
553 */
554 @WebMethod(operationName = "getNaturalLanguageForType")
555 @WebResult(name = "naturalLanguage")
556 public String getNaturalLanguageForType(@WebParam(name = "naturalLanguageUsageId") String naturalLanguageUsageId, @WebParam(name = "typeId") String typeId, @WebParam(name = "krmsObjectId") String krmsObjectId,
557 @WebParam(name = "languageCode") String languageCode) throws RiceIllegalArgumentException;
558
559 /**
560 * Retrieve all the NaturalLanguageUsages
561 *
562 * @return list of NaturalLanguageUsages
563 */
564 @WebMethod(operationName = "getNaturalLanguageUsages")
565 @XmlElementWrapper(name = "naturalLanguageUsages", required = true)
566 @XmlElement(name = "naturalLanguageUsage", required = false)
567 @WebResult(name = "naturalLanguageUsages")
568 public Set<NaturalLanguageUsage> getNaturalLanguageUsages();
569 }