01: /*
02: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
04: *
05: * This program is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU General Public License version
07: * 2 only, as published by the Free Software Foundation.
08: *
09: * This program is distributed in the hope that it will be useful, but
10: * WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * General Public License version 2 for more details (a copy is
13: * included at /legal/license.txt).
14: *
15: * You should have received a copy of the GNU General Public License
16: * version 2 along with this work; if not, write to the Free Software
17: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18: * 02110-1301 USA
19: *
20: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
21: * Clara, CA 95054 or visit www.sun.com if you need additional
22: * information or have any questions.
23: */
24:
25: package com.sun.midp.jump.push.executive.ota;
26:
27: import com.sun.midp.jump.push.executive.JUMPConnectionInfo;
28: import java.io.IOException;
29: import javax.microedition.io.ConnectionNotFoundException;
30:
31: /** Push services exposed to installer system. */
32: public interface InstallerInterface {
33: /**
34: * Installs connections.
35: *
36: * <p>
37: * If connection installation succeeds, these connections are disabled (i.e.
38: * events on these connections won't lead to <code>MIDlet</code> suite
39: * activation.) To enable connections one should use
40: * <code>enableConnections</code> method. If for any reason installation of
41: * the suite fails, one MUST call <code>uninstallConnections</code> to
42: * uninstall connections before invoking <code>enableConnections</code>.
43: * </p>
44: *
45: * <p>
46: * <strong>Precondition</strong>: <code>midletSuiteId</code> MUST
47: * refer to a suite without any registered Push connections (this
48: * precondition isn't checked and violation leads to undefined
49: * behaviour.)
50: * </p>
51: *
52: * <p>
53: * <strong>Precondition</strong>: <code>connections</code> array MUST be
54: * non-empty and not have duplicate connections (i.e. it should be non-empty
55: * set).
56: * </p>
57: *
58: * @param midletSuiteId ID of <code>MIDlet suite</code> to install
59: * connections for
60: * @param connections Connections to install
61: *
62: * @throws ConnectionNotFoundException
63: * @throws SecurityException
64: */
65: void installConnections(int midletSuiteId,
66: JUMPConnectionInfo[] connections)
67: throws ConnectionNotFoundException, IOException,
68: SecurityException;
69:
70: /**
71: * Uninstalls connections.
72: *
73: * <p>
74: * <strong>Precondition</strong>: connections for this suite should have
75: * been already installed with <code>installConnections</code> method.
76: * </p>
77: *
78: * @param midletSuiteId ID of <code>MIDlet suite</code> to uninstall
79: * connections of
80: */
81: void uninstallConnections(int midletSuiteId);
82: }
|