FileDocCategorySizeDatePackage
SuiteSettings.javaAPI DocphoneME MR2 API (J2ME)4879Wed May 02 18:00:06 BST 2007com.sun.midp.midletsuite

SuiteSettings

public class SuiteSettings extends Object
The settings for the suite.

Fields Summary
byte[]
permissions
Permissions for this suite.
byte
pushInterruptSetting
Can this MIDlet suite interrupt other suites.
int
pushOptions
Push options.
int
suiteId
The ID of this suite.
boolean
enabled
If true, MIDlet from this suite can be run.
Constructors Summary
public SuiteSettings(int id)
Public constructor for SuiteSettings.

param
id of the suite for these settings

        suiteId = id;
        enabled = true; /* default is to enable a newly installed suite */
        permissions = Permissions.getEmptySet();
    
Methods Summary
public byte[]getPermissions()
Gets list of permissions for this suite.

return
array of permissions from {@link Permissions}
see
#setPermissions

        return permissions;
    
public bytegetPushInterruptSetting()
Gets push setting for interrupting other MIDlets.

return
push setting for interrupting MIDlets the value will be permission level from {@link Permissions}
see
#setPushInterruptSetting

        return pushInterruptSetting;
    
public intgetPushOptions()
Gets push options for the suite from persistent store.

return
push options are defined in {@link PushRegistryImpl}
see
#setPushOptions

        return pushOptions;
    
public intgetSuiteId()
Gets the unique ID of the suite.

return
suite ID

        return suiteId;
    
public booleanisEnabled()
Determine if the a MIDlet from this suite can be run. Note that disable suites can still have their settings changed and their install info displayed.

return
true if suite is enabled, false otherwise

        return enabled;
    
native voidload()
Gets the suite settings suite from persistent store.

voidsave()
Saves the suite settings to persistent store. Except the enabled state.

        try {
            save0(suiteId, pushInterruptSetting, pushOptions, permissions);
        } catch (IOException ioe) {
            if (Logging.REPORT_LEVEL <= Logging.WARNING) {
                Logging.report(Logging.WARNING, LogChannels.LC_AMS,
                               "SuiteSettings.save0() threw IOException");
            }
        }
    
private native voidsave0(int suiteId, byte pushInterruptSetting, int pushOptions, byte[] permissions)
Saves the suite settings to persistent store.

throws
IOException if an I/O error occurs

public voidsetPermissions(byte[] newPermissions)
Sets new permissions for the suite.

param
newPermissions for the suite
see
#getPermissions

        permissions = newPermissions;
    
public voidsetPushInterruptSetting(byte newSetting)
Sets new PushInterruptSetting for the suite.

param
newSetting for the suite
see
#getPushInterruptSetting

        pushInterruptSetting = newSetting;
    
public voidsetPushOptions(int newOption)
Sets new PushOptions for the suite.

param
newOption for the suite
see
#getPushOptions

        pushOptions = newOption;