All IMlet suites maintain a basic set of identification and state information that acts as a descriptor. This descriptor is represented by the Suite class.
Suites can be one of four types, presented in the SuiteType enumeration, and shown in Table 4-2:
Table 4-2 SuiteType Enumeration
Suite Type Description
ST_APPLICATION
The suite contains one or more MIDlets with an entry point that can be executed.
ST_LIBRARY
The suite is a library that can be used by one or more applications.
ST_SYSTEM
The suite is a system-level application.
ST_INVALID
The suite is invalid and cannot be found or executed.
In addition, suites contain binary flags that describe their state, presented in the SuiteStateFlag enumeration, and shown in Table 4-3:
Table 4-3 SuiteStageFlag Enumeration
State Description
AVAILABLE
The suite is available for use.
ENABLED
The suite is enabled. When a suite is disabled, any attempt to run application or use a library from this suite should fail.
SYSTEM
The suite is a system-level suite.
PREINSTALLED
The suite is a system-level suite that cannot be updated.
REMOVE_DENIED
The suite should not be removed.
UPDATE_DENIED
The suite should not be updated.
The following are method present in the Suite class.
java.lang.String getName()
This method returns the name for the given suite.
java.lang.String getVendor()
This method returns the vendor for the given suite.
java.lang.String getVersion()
This method returns the version of the given suite.
java.lang.String getDownloadUrl()
This method returns the URL that the JAD or JAR was downloaded from.
java.util.Iteration<String> getAttributes()
This method returns a String array that provides the names of the available properties. The properties returned are those from the JAD file and the manifest combined into a single array.
java.lang.String getAttributeValue(String name)
This method retrieves the value for the respective attribute name.
SuiteType getSuiteType()
This method returns the suite type. See Table 4-2 for more information.
public boolean isSuiteState(SuiteStateFlag state)
This method checks the current state boolean to see if it is true.
public void setSuiteStateFlag(SuiteStateFlag state, boolean value) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.SecurityException
This method sets the specified flag to the specified value. If a Suite has been created, SuiteStateFlag.ENABLED and SuiteStateFlag.AVAILABLE are always set to true, while SuiteStateFlag.REMOVE_DENIED and SuiteStateFlag.UPDATE_DENIED are set to false. These states can be changed by calling this method. The SuiteStateFlag.SYSTEM and SuiteStateFlag.PREINSTALLED flags are only set for system suites or pre-installed suites, respectively, and cannot be unset or set by this method. To be able to set suite flags, caller application should request javax.microedition.swm.SWMPermission("client", "manageSuite") or javax.microedition.swm.SWMPermission ("crossClient", "manageSuite") permission. See SWMPermission for more details.
public java.util.Iterator<java.lang.String> getMIDlets()
This method returns a list of the applications (application class names) in this suite. The first application in the enumeration is the default application as specified in the MIDlet-1 field of the descriptor.
public java.util.Iterator<Suite> getDependencies()
This method returns a list of the shared libraries this Suite depends on
public boolean isTrusted()
Checks if this Suite is trusted or not. The return value is always true if it is a SYSTEM_SUITE.
public boolean isInstalled()
Checks if this Suite is still installed or has been removed.