KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > notification > NotificationEngine


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package sync4j.framework.notification;
19
20 import sync4j.framework.core.dm.ddf.DMAcc;
21 import sync4j.framework.core.dm.ddf.SyncMLDM;
22 import sync4j.framework.core.bootstrap.BootStrap;
23
24
25 /**
26  * Represent a engine for bootstrap and notification process
27  * @author Stefano Nichele @ Funambol
28  *
29  * @version $Id: NotificationEngine.java,v 1.1 2005/05/16 17:32:55 nichele Exp $
30  */

31 public interface NotificationEngine {
32
33     // --------------------------------------------------------------- Constants
34
public static final String JavaDoc CONTENT_TYPE_BOOTSTRAP = "application/vnd.syncml.dm+wbxml";
35
36
37     // ---------------------------------------------------------- Public Methods
38

39     /**
40      * Sends a notification message.
41      * @param messageType the type of the message. See {@link NotificationConstants} for details.
42      * @param transportType the transport type used to send the message. See {@link NotificationConstants} for details.
43      * @param sessionId the session id
44      * @param phoneNumber the phone number of the target device
45      * @param info application specific info
46      * @param serverId the server identifier (necessary to calculate the digest of the message)
47      * @param serverPassword the server password (necessary to calculate the digest of the message)
48      * @param serverNonce the server nonce (necessary to calculate the digest of the message)
49      * @throws NotificationException if a error occurs
50      */

51     public void sendNotificationMessage(int messageType,
52                                         int transportType,
53                                         int sessionId,
54                                         String JavaDoc phoneNumber,
55                                         String JavaDoc info,
56                                         String JavaDoc serverId,
57                                         String JavaDoc serverPassword,
58                                         byte[] serverNonce) throws NotificationException;
59
60
61     /**
62      * Sends more notification messages.
63      * @param messageType the type of the message. See {@link NotificationConstants} for details.
64      * @param transportType the transport type used to send the message. See {@link NotificationConstants} for details.
65      * @param sessionIds the session identifiers
66      * @param phoneNumbers the phone numbers list of the target devices
67      * @param info application specific info
68      * @param serverId the server identifier (necessary to calculate the digest of the message)
69      * @param serverPassword the server passwords list (necessary to calculate the digest of the message)
70      * @param serverNonce the server nonces list (necessary to calculate the digest of the message)
71      * @throws NotificationException if a error occurs
72      */

73     public void sendNotificationMessages(int messageType,
74                                          int transportType,
75                                          int[] sessionIds,
76                                          String JavaDoc[] phoneNumbers,
77                                          String JavaDoc info,
78                                          String JavaDoc serverId,
79                                          String JavaDoc[] serverPasswords,
80                                          byte[][] serverNonces) throws NotificationException;
81
82
83     /**
84      * Sends a bootstrap message.
85      * @param messageType the type of the message. See {@link NotificationConstants} for details.
86      * @param transportType the transport type used to send the message. See {@link NotificationConstants} for details.
87      * @param serverUri the server uri
88      * @param deviceUri the device uri
89      * @param phoneNumber the phone number of the target device
90      * @param syncMLDM the message to send
91      * @param info application specific info
92      * @throws NotificationException if a error occurs
93      */

94     public void sendBootstrapMessage(int messageType,
95                                      int transportType,
96                                      String JavaDoc serverUri,
97                                      String JavaDoc deviceUri,
98                                      String JavaDoc phoneNumber,
99                                      SyncMLDM syncMLDM,
100                                      String JavaDoc info) throws NotificationException;
101
102
103     /**
104      * Sends bootstrap messages.
105      * @param messageType the type of the message. See {@link NotificationConstants} for details.
106      * @param transportType the transport type used to send the message. See {@link NotificationConstants} for details.
107      * @param bootstrap the bootstrap list
108      * @param serverUri the server uri list
109      * @param deviceUri the device uri list
110      * @param phoneNumber the phone number list
111      * @param syncMLDM the message list to send
112      * @param info application specific info
113      * @param
114      * @throws NotificationException
115      */

116     public void sendBootstrapMessages(int messageType,
117                                       int transportType,
118                                       BootStrap[] bootstrap,
119                                       String JavaDoc serverUri,
120                                       SyncMLDM[] syncMLDM,
121                                       String JavaDoc info) throws NotificationException;
122
123
124     /**
125      * Prepare bootstrap message
126      * @param messageType the type of the message. See {@link NotificationConstants} for details.
127      * @param bootstrap the bootstrap list
128      * @param serverUri the server uri list
129      * @param syncMLDM the message list to send
130      * @param info application specific info
131      */

132     public BootStrap[] prepareBootstrap(int messageType,
133                                         BootStrap[] bootstrap,
134                                         String JavaDoc serverUri,
135                                         SyncMLDM[] syncMLDM,
136                                         String JavaDoc info) throws NotificationException;
137
138
139     /**
140      * Sends a bootstrap message.
141      * @param messageType the type of the message. See {@link NotificationConstants} for details.
142      * @param transportType the transport type used to send the message. See {@link NotificationConstants} for details.
143      * @param phoneNumbers the phone numbers
144      * @param authMethods the authentication methods
145      * @param messages the messages
146      * @param info application specific info
147      * @throws NotificationException if a error occurs
148      */

149     public void sendBootstrapMessages(int messageType,
150                                       int transportType,
151                                       String JavaDoc[] phoneNumbers,
152                                       String JavaDoc[] macs,
153                                       int[] authMethods,
154                                       byte[][] messages,
155                                       String JavaDoc info) throws NotificationException;
156
157
158 }
Popular Tags