1 /**
2 * Copyright 2011-2013 The Kuali Foundation Licensed under the Educational
3 * Community License, Version 2.0 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of the License
5 * at
6 *
7 * http://www.osedu.org/licenses/ECL-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 * License for the specific language governing permissions and limitations under
13 * the License.
14 */
15 package org.kuali.mobility.push.service;
16
17 import java.util.List;
18
19 import org.kuali.mobility.push.entity.Device;
20 import org.kuali.mobility.push.entity.Push;
21
22 /**
23 * This is an interface for an service that can send Push messages to devices.
24 * The implementation of this service should understand how to send a message to each.
25 *
26 * @author Kuali Mobility Team (mobility.dev@kuali.org)
27 * @since 2.1.0
28 */
29 public interface SendService {
30
31 /**
32 * Sends a <code>Push</code> message to one specific device.
33 * If the implementation can not send a message to the specified device
34 * eg. The implementation can only send to Android devices and a iOS device is specified, an
35 * InvalidArgumentException can be thrown.
36 *
37 * @param push The <code>Push</code> message to send.
38 * @param devices The device to send the message to.
39 */
40 void sendPush(Push push, Device device) throws IllegalArgumentException;
41
42
43 /**
44 * Sends a <code>Push</code> message to a list of devices.
45 * If the implementation can not send a message to one (or more) of
46 * the devices in the list, the service may throw an IllegalArgumentException
47 * and not send further to any other devices in the list.
48 *
49 * @param push The <code>Push</code> message to send.
50 * @param devices The list of devices to send the message to.
51 */
52 void sendPush(Push push, List<Device> devices) throws IllegalArgumentException;
53 }