001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.krms.framework.type;
017
018import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
019import org.kuali.rice.core.api.exception.RiceIllegalStateException;
020import org.kuali.rice.krms.api.KrmsConstants;
021import org.kuali.rice.krms.api.repository.action.ActionDefinition;
022
023import javax.jws.WebMethod;
024import javax.jws.WebParam;
025import javax.jws.WebResult;
026import javax.jws.WebService;
027import javax.jws.soap.SOAPBinding;
028
029/**
030 *
031 * Service for {@link ValidationActions}
032 *
033 * @author Kuali Rice Team (rice.collab@kuali.org)
034 */
035@WebService(name = "validationActionService", targetNamespace = KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0)
036@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
037public interface ValidationActionService {
038
039    /**
040     * Return the {@link ActionDefinition} given the validationId
041     * @param validationId of the {@link ActionDefinition} to return
042     * @return {@link ActionDefinition} whose value is of the given validationId
043     * @throws {@link RiceIllegalArgumentException}
044     */
045    @WebMethod(operationName = "getValidation")
046    @WebResult(name = "validation")
047    ActionDefinition getValidation(@WebParam(name = "validationId") String validationId)
048            throws RiceIllegalArgumentException;
049
050    /**
051     * Return the {@link ActionDefinition} given the namespaceCode and name
052     * @param namespaceCode of the {@link ActionDefinition} to return
053     * @param name of the {@link ActionDefinition} to return
054     * @return {@link ActionDefinition} whose namespaceCode and name are of those given
055     * @throws {@link RiceIllegalArgumentException}
056     */
057    @WebMethod(operationName = "getValidationByName")
058    @WebResult(name = "validation")
059    ActionDefinition getValidationByName(
060            @WebParam(name = "namespaceCode") String namespaceCode,
061            @WebParam(name = "name") String name)
062        throws RiceIllegalArgumentException;
063
064    /**
065     * Create a Validation Action
066     *
067     * @param validation {@link ActionDefinition} to create 
068     * @return {@link ActionDefinition} created
069     *
070     * @throws {@link RiceIllegalArgumentException} if the given Validation definition is null
071     * @throws {@link RiceIllegalArgumentException} if the given Validation definition has a non-null id.  When creating a new
072     * Validation definition, the ID will be generated.
073     * @throws {@link RiceIllegalStateException} if a Validation with the given namespace code and name already exists
074     */
075    @WebMethod(operationName = "createValidationAction")
076    @WebResult(name = "validation")
077    ActionDefinition createValidation(@WebParam(name = "validation") ActionDefinition validation)
078        throws RiceIllegalArgumentException, RiceIllegalStateException;
079
080    /**
081     * Update a Validation Action
082     *
083     * @param validation {@link ActionDefinition} to create
084     *
085     * @return {@link ActionDefinition} updated
086     *
087     * @throws {@link RiceIllegalArgumentException} if the given Validation definition is null
088     * @throws {@link RiceIllegalStateException} if the Validation does not exist in the system under the given validationId
089     */
090    @WebMethod(operationName = "updateValidationAction")
091    @WebResult(name = "validation")
092    ActionDefinition updateValidation(@WebParam(name = "validation") ActionDefinition validation)
093        throws RiceIllegalArgumentException, RiceIllegalStateException;
094
095
096}