01: /*
02: *
03: *
04: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: */
26:
27: package com.sun.midp.installer;
28:
29: /** Enables a MIDlet to respond installation warnings and status updates. */
30: public interface InstallListener {
31: /**
32: * Called with the current state of the install so the user can be
33: * asked to override the warning. To get the warning from the state
34: * call {@link InstallState#getLastException()}. If false is returned,
35: * the last exception in the state will be thrown and
36: * {@link Installer#wasStopped()} will return true if called.
37: *
38: * @param state current state of the install.
39: *
40: * @return true if the user wants to continue, false to stop the install
41: */
42: public boolean warnUser(InstallState state);
43:
44: /**
45: * Called with the current state of the install so the user can be
46: * asked to confirm the jar download.
47: * If false is returned, the an I/O exception thrown and
48: * {@link Installer#wasStopped()} will return true if called.
49: *
50: * @param state current state of the install.
51: *
52: * @return true if the user wants to continue, false to stop the install
53: */
54: public boolean confirmJarDownload(InstallState state);
55:
56: /**
57: * Called with the current status of the install. See
58: * {@link Installer} for the status codes.
59: *
60: * @param status current status of the install.
61: * @param state current state of the install.
62: */
63: public void updateStatus(int status, InstallState state);
64:
65: /**
66: * Called with the current state of the install so the user can be
67: * asked to confirm if the RMS data should be kept for new version of
68: * an updated suite.
69: * If false is returned, the an I/O exception thrown and
70: * {@link Installer#wasStopped()} will return true if called.
71: *
72: * @param state current state of the install.
73: *
74: * @return true if the user wants to keep the RMS data for the next suite
75: */
76: public boolean keepRMS(InstallState state);
77:
78: /**
79: * Called with the current state of the install so the user can be
80: * asked to confirm the authentication path.
81: * If false is returned, the an I/O exception thrown and
82: * {@link Installer#wasStopped()} will return true if called.
83: *
84: * @param state current state of the install.
85: *
86: * @return true if the user wants to continue, false to stop the install
87: */
88: public boolean confirmAuthPath(InstallState state);
89: }
|