001package org.kuali.student.enrollment.courseseatcount.service;
002
003
004import org.kuali.student.enrollment.academicrecord.service.SubscriptionActionEnum;
005import org.kuali.student.r2.common.dto.ContextInfo;
006import org.kuali.student.r2.common.dto.StatusInfo;
007import org.kuali.student.r2.common.exceptions.DoesNotExistException;
008import org.kuali.student.r2.common.exceptions.InvalidParameterException;
009import org.kuali.student.r2.common.exceptions.MissingParameterException;
010import org.kuali.student.r2.common.exceptions.OperationFailedException;
011import org.kuali.student.r2.common.exceptions.PermissionDeniedException;
012
013import javax.jws.WebParam;
014import javax.jws.WebService;
015import javax.jws.soap.SOAPBinding;
016import java.util.List;
017
018@WebService(name = "CourseSeatCountSubscriptionService", targetNamespace = CourseSeatCountSubscriptionNamespaceConstants.NAMESPACE)
019@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
020public interface CourseSeatCountSubscriptionService {
021
022    /**
023     * Subscribe a callback to listen for CourseSeatCounts.
024     *
025     * @param action action to listen for
026     * @param courseSeatCountCallbackService callback executable code to be invoked when the change event executes.
027     * @param contextInfo information containing the principalId and locale information about the caller of the service operation
028     * @return callback registration id that can be used to explicitly desubscribe the listener.
029     * @throws InvalidParameterException contextInfo is not valid
030     * @throws MissingParameterException action, courseSeatCountCallbackService or contextInfo is missing or null
031     * @throws OperationFailedException unable to complete request
032     * @throws PermissionDeniedException an authorization failure occurred
033     */
034    public String subscribeToCourseSeatCounts(
035
036            @WebParam(name = "action") SubscriptionActionEnum action,
037            @WebParam(name = "courseSeatCountCallbackService") CourseSeatCountCallbackService courseSeatCountCallbackService,
038            @WebParam(name = "contextInfo") ContextInfo contextInfo)
039            throws InvalidParameterException,
040            MissingParameterException,
041            OperationFailedException,
042            PermissionDeniedException;
043
044
045    /**
046     * Subscribe a callback to listen for CourseSeatCounts for the given Ids.
047     *
048     * @param action action to listen for
049     * @param courseSeatCountId the identifier for the CourseSeatCounts to listen for.
050     * @param courseSeatCountCallbackService callback executable code to be invoked when the change event executes
051     * @param contextInfo information containing the principalId and locale information about the caller of the service operation
052     * @return callback registration id that can be used to explicitly desubscribe the listener.
053     * @throws InvalidParameterException contextInfo is not valid
054     * @throws MissingParameterException action, courseSeatCountId, courseSeatCountCallbackService  or contextInfo is missing or null
055     * @throws OperationFailedException unable to complete request
056     * @throws PermissionDeniedException an authorization failure occurred
057     */
058    public String subscribeToCourseSeatCountsByIds(
059
060            @WebParam(name = "action") SubscriptionActionEnum action,
061            @WebParam(name = "courseSeatCountId") List<String> courseSeatCountId,
062            @WebParam(name = "courseSeatCountCallbackService") CourseSeatCountCallbackService courseSeatCountCallbackService,
063            @WebParam(name = "contextInfo") ContextInfo contextInfo)
064            throws InvalidParameterException,
065            MissingParameterException,
066            OperationFailedException,
067            PermissionDeniedException;
068    /**
069     * Subscribe a callback to listen for CourseSeatCounts for a given ActivityOffering.
070     *
071     * @param action action to listen for
072     * @param activityOfferingId the identifier for the ActivityOffering to be retrieved.
073     * @param courseSeatCountCallbackService callback executable code to be invoked when the change event executes
074     * @param contextInfo information containing the principalId and locale information about the caller of the service operation
075     * @return callback registration id that can be used to explicitly desubscribe the listener.
076     * @throws InvalidParameterException contextInfo is not valid
077     * @throws MissingParameterException action, activityOfferingId, courseSeatCountCallbackService or contextInfo is missing or null
078     * @throws OperationFailedException unable to complete request
079     * @throws PermissionDeniedException an authorization failure occurred
080     */
081    public String subscribeToCourseSeatCountsByActivityOffering(
082
083            @WebParam(name = "action") SubscriptionActionEnum action,
084            @WebParam(name = "activityOfferingId") String activityOfferingId,
085            @WebParam(name = "courseSeatCountCallbackService") CourseSeatCountCallbackService courseSeatCountCallbackService,
086            @WebParam(name = "contextInfo") ContextInfo contextInfo)
087            throws InvalidParameterException,
088            MissingParameterException,
089            OperationFailedException,
090            PermissionDeniedException;
091    /**
092     * Subscribe a callback to listen for CourseSeatCounts for a given ActivityOfferings.
093     *
094     * @param action action to listen for
095     * @param activityOfferingIds the identifier for the ActivityOffering to be retrieved.
096     * @param courseSeatCountCallbackService callback executable code to be invoked when the change event executes
097     * @param contextInfo information containing the principalId and locale information about the caller of the service operation
098     * @return callback registration id that can be used to explicitly desubscribe the listener.
099     * @throws InvalidParameterException contextInfo is not valid
100     * @throws MissingParameterException action, activityOfferingIds, courseSeatCountCallbackService or contextInfo is missing or null
101     * @throws OperationFailedException unable to complete request
102     * @throws PermissionDeniedException an authorization failure occurred
103     */
104    public String subscribeToCourseSeatCountsByActivityOfferings(
105
106            @WebParam(name = "action") SubscriptionActionEnum action,
107            @WebParam(name = "activityOfferingIds") List<String> activityOfferingIds,
108            @WebParam(name = "courseSeatCountCallbackService") CourseSeatCountCallbackService courseSeatCountCallbackService,
109            @WebParam(name = "contextInfo") ContextInfo contextInfo)
110            throws InvalidParameterException,
111            MissingParameterException,
112            OperationFailedException,
113            PermissionDeniedException;
114
115    /**
116     * Subscribe a callback to listen for CourseSeatCounts for a given type.
117     *
118     * @param action action to listen for
119     * @param courseSeatCountTypeKey the identifier for the CourseSeatCount type to be retrieved.
120     * @param courseSeatCountCallbackService callback executable code to be invoked when the change event executes
121     * @param contextInfo information containing the principalId and locale information about the caller of the service operation
122     * @return callback registration id that can be used to explicitly desubscribe the listener.
123     * @throws InvalidParameterException contextInfo is not valid
124     * @throws MissingParameterException action, courseSeatCountCallbackService or contextInfo is missing or null
125     * @throws OperationFailedException unable to complete request
126     * @throws PermissionDeniedException an authorization failure occurred
127     */
128    public String subscribeToCourseSeatCountsByType(
129
130            @WebParam(name = "action") SubscriptionActionEnum action,
131            @WebParam(name = "courseSeatCountTypeKey") String courseSeatCountTypeKey,
132            @WebParam(name = "courseSeatCountCallbackService") CourseSeatCountCallbackService courseSeatCountCallbackService,
133            @WebParam(name = "contextInfo") ContextInfo contextInfo)
134            throws InvalidParameterException,
135            MissingParameterException,
136            OperationFailedException,
137            PermissionDeniedException;
138    /**
139     * Remove the subscription of callback to stop listening.
140     *
141     * @param subscriptionId the identifier for the subscription
142     * @param contextInfo information containing the principalId and locale information about the caller of the service operation
143     * @return status indicating if it it unsubscribed
144     * @throws org.kuali.student.r2.common.exceptions.DoesNotExistException courseRegistrationId is not found
145     * @throws InvalidParameterException contextInfo is not valid
146     * @throws MissingParameterException courseRegistrationId or contextInfo is missing or null
147     * @throws OperationFailedException unable to complete request
148     * @throws PermissionDeniedException an authorization failure occurred
149     */
150    public StatusInfo removeSubscription(
151            @WebParam(name = "subscriptionId") String subscriptionId,
152            @WebParam(name = "contextInfo") ContextInfo contextInfo)
153            throws DoesNotExistException,
154            InvalidParameterException,
155            MissingParameterException,
156            OperationFailedException,
157            PermissionDeniedException;
158
159
160}