KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > engine > dm > ManagementProcessor


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
19 package sync4j.framework.engine.dm;
20
21 import java.security.Principal JavaDoc;
22
23 import sync4j.framework.engine.dm.DeviceDMState;
24 import sync4j.framework.core.dm.ddf.DevInfo;
25
26 /**
27  * The ManagementProcessor interface defines the structure of an object able
28  * to handle management sessions.
29  *
30  * @author Stefano Fornari @ Funambol
31  */

32 public interface ManagementProcessor {
33     
34     /**
35      * Called when a management session is started for the given principal.
36      * sessionId is the content of the SessionID element of the OTA DM message.
37      *
38      * @param sessionId the content of the SessionID element of the OTA DM message
39      * @param principal the principal who started the management session
40      * @param type the management session type (as specified in the message Alert)
41      * @param devInfo device info of the device under management
42      * @param dmstate device management state
43      *
44      * @throws ManagementException in case of errors
45      */

46     void beginSession(String JavaDoc sessionId,
47                       Principal JavaDoc p ,
48                       int type ,
49                       DevInfo devInfo ,
50                       DeviceDMState dmstate )
51     throws ManagementException;
52     
53     /**
54      * Called when the management session is closed. CompletionCode can be one
55      * of:
56      * <ul>
57      * <li>DM_SESSION_SUCCESS</li>
58      * <li>DM_SESSION_ABORT</li>
59      * <li>DM_SESSION_FAILED</li>
60      *
61      * @param completionCode the management session competion code
62      *
63      * @throws ManagementException in case of errors
64      */

65     void endSession(int completionCode)
66     throws ManagementException;
67     
68     /**
69      * Called to retrieve the next management operations to be performed.
70      *
71      * @returns an array of ManagementOperation representing the management
72      * operations to be performed.
73      *
74      * @throws ManagementException in case of errors
75      */

76     ManagementOperation[] getNextOperations()
77     throws ManagementException;
78     
79     /**
80      * Called to set the results of a set of management operations.
81      *
82      * @param results the results of a set of management operations.
83      *
84      * @throws ManagementException in case of errors
85      */

86     void setOperationResults(ManagementOperationResult[] results)
87     throws ManagementException;
88     
89     /**
90      * Name to uniquely identify the management processor instance (each
91      * installed management processor should have a different name in its
92      * configuration file).
93      *
94      * @return the management processor name
95      */

96     String JavaDoc getName();
97 }
Popular Tags