|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Storage
Storage abstraction. This module is responsible for managing the Framework's and bundles' persistent storage.
| Field Summary | |
|---|---|
static int |
ADMIN_PERMISSIONS
|
static int |
CONDITIONAL_PERMISSIONS
|
static int |
FRAMEWORK_STATE
|
static int |
START_LEVEL
|
| Method Summary | |
|---|---|
short |
addJar(java.lang.String url,
java.io.InputStream is,
java.lang.Object rec,
boolean keepData,
java.lang.String fileName,
boolean fromFile,
boolean inMainStorage,
java.lang.String storageRoot,
boolean isSymbolicNameSet)
Adds a new version of the bundle's jar in the storage. |
java.lang.String[] |
clearGarbage()
Clears the garbage files from the underlying file system. |
void |
clearZombies()
Removes all bundles' data of bundles that were not installed or uninstalled properly (for example when some crash situation occurred). |
void |
close()
Closes the storage. |
short |
copy(java.lang.Object rec,
short oldVer)
Copy the system files with the old bundle version to the new bundle version |
void |
delDataFiles(java.lang.Object rec,
short ver)
Deletes all data files of the specified version of the bundle |
void |
delJars(java.lang.Object rec,
short ver,
boolean toDelOnlySubJars)
|
void |
dirStateChanged(java.lang.String dirName,
boolean isPlugged)
Notify the framework that a flashcard with an installed bundle is unplugged or plugged. |
java.io.File |
getArchiveFile(java.lang.Object rec)
|
int |
getArchiveLength(java.lang.Object rec)
Returns the length of the specified archive. |
java.lang.String |
getArchiveName(java.lang.Object rec)
Returns the absolute pathname of the specified archive. |
void |
getBundleAllocations(java.lang.String location,
java.lang.Object rec,
java.util.Vector v1,
java.util.Dictionary dic)
|
java.lang.String |
getBundleLocation(java.lang.String dataFileName)
Returns the location of the bundle in which private storage area is the specified data file. |
java.io.File |
getDataDir()
|
java.io.File |
getDataFile(java.lang.String fileName,
java.lang.Object rec,
short ver,
boolean root)
Returns a File from the bundle's data directory. |
java.lang.String[] |
getEntries(java.lang.Object subJar,
java.lang.Object rec,
short ver)
Parses the archive and returns the bundle entries. |
java.io.InputStream |
getJarEntry(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver)
|
byte[] |
getJarEntryBytes(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver)
|
java.net.URLConnection |
getJarEntryURLConnection(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver,
java.net.URL url,
boolean dirConns)
|
java.util.Dictionary |
getJarManifest(java.lang.Object rec)
Returns an Dictionary containg the manifest headers of the bundle's jar. |
long |
getLastMountTime(java.lang.String storageRoot)
This method returns the last time, when that storage was mounted (e.g. |
boolean |
getNativeFlag()
Returns true if and only if jdk11 native model is used. |
java.lang.String |
getNativeLibrary(java.lang.String path,
java.lang.Object rec,
boolean install)
Extracts the specified entry from the bundle's main jar into the bundle's native directory, and returns the full canonical path to the resulting File |
XProperties |
getProperties(int type)
Returns dictionary containing information about framework's state, bundle permissions or bundle start levels depending on |
java.lang.Object |
getRec(Bundle b)
Creates a new Object, that is unique for the bundle and is used in the other methods of Storage module as an identifier of that bundle. |
int |
getSize(java.lang.Object entry)
|
java.io.InputStream |
getStateFileInputStream(int type,
boolean backup)
Gets the input stream of framework's state, bundle permissions, certificate store or bundle start levels depending on |
java.io.OutputStream |
getStateFileOutputStream(int type)
Gets the output stream of framework's state, bundle permissions, certificate store or bundle start levels depending on |
java.lang.String[] |
getStorageRoots()
Get all registered storage root directories. |
java.lang.Object |
getSubJar(int subJarIndex,
java.lang.String jarName,
java.lang.Object rec,
short ver)
The subjar from specify bundle will be return if it exists or null. |
int |
getTime(java.lang.Object entry)
|
boolean |
hasDir(java.lang.Object subJar,
java.lang.String dirName,
java.lang.Object rec,
short ver)
|
boolean |
hasJarEntry(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver)
|
boolean |
isBundleInStorageRoot(java.lang.Object bundleRec,
java.lang.String storageRoot)
This method will check if the bundle, identified by the bundle record is installed in the specified root |
boolean |
isInTrustedStorage(java.lang.Object rec)
Checks if the given bundle is in trusted storage |
boolean |
isUnsigned(java.lang.Object rec)
Returns whether the bundle jar archive is marked as unsigned in the persistent storage. |
short |
loadBundle(java.lang.Object brec,
java.lang.String url,
Key key,
byte[] locationb,
int verIndex,
java.lang.String fileName,
boolean fromFile,
boolean inMainStorage,
java.lang.String storageRoot,
boolean isSymbolicNameSet,
long checksum)
Loads the specified bundle from the storage. |
java.io.InputStream |
openStream(java.lang.Object pzip,
java.lang.Object entry,
Bundle b)
|
boolean |
persistentlyStarted(java.lang.Object rec)
Indicates whether a bundle is persistently marked as started in storage. |
boolean |
setPersistentState(java.lang.Object rec,
boolean started)
Marks the bundle as started or stopped in storage, depending on the second parameter. |
boolean |
setUnresolvableState(java.lang.Object rec,
boolean unresolvable)
Marks the bundle as resolvable or unresolvable in storage, depending on the second parameter. |
void |
setUnsigned(java.lang.Object rec)
Marks the bundle archive as unsigned in persistent storage. |
| Field Detail |
|---|
static final int FRAMEWORK_STATE
static final int START_LEVEL
static final int ADMIN_PERMISSIONS
static final int CONDITIONAL_PERMISSIONS
| Method Detail |
|---|
java.lang.Object getRec(Bundle b)
b - the bundle associated with the new rec
short addJar(java.lang.String url,
java.io.InputStream is,
java.lang.Object rec,
boolean keepData,
java.lang.String fileName,
boolean fromFile,
boolean inMainStorage,
java.lang.String storageRoot,
boolean isSymbolicNameSet)
throws java.io.IOException
url - the url from which the new jar must be downloaded, or null if InputStream
is specifiedis - InputStream for downloading the jar, or null if url is specifiedrec - identifies the Bundle which we add in storagekeepData - indicates if the old data files of the bundle should be kept when
a bundle is updated
java.io.IOException
short loadBundle(java.lang.Object brec,
java.lang.String url,
Key key,
byte[] locationb,
int verIndex,
java.lang.String fileName,
boolean fromFile,
boolean inMainStorage,
java.lang.String storageRoot,
boolean isSymbolicNameSet,
long checksum)
throws java.io.IOException
brec - identifies the Bundle to loadurl - the location of the bundlekey - the key for the bundle in f.st properties filelocationb - the value for the bundle in f.st properties fileverIndex - the index in locationb, at which bundle version is specifiedfileName - absolute path to the file, when from file is usedfromFile - indicates whether the bundle is installed from fileinMainStorage - indicates whether the bundle storage data is in the main storagestorageRoot - the storage root if the bundle storage data is not it the main storageisSymbolicNameSet - if it's true the parameter locationb must not contain the bundle symbolic namechecksum - the checksum of the bundle, that is stored in the f.st. If set to -1 checksum verification will not be performed
java.io.IOException
void delJars(java.lang.Object rec,
short ver,
boolean toDelOnlySubJars)
throws java.io.IOException
toDelOnlySubJars - if it's true, this method will delete only subjars
java.io.IOException
java.util.Dictionary getJarManifest(java.lang.Object rec)
throws java.io.IOException
rec - identifies the Bundle which jar manifest is wanted
java.io.IOException
java.io.InputStream getJarEntry(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver)
throws java.io.IOException
subJar - the subJar returned from method getSubJar. If it is null,
the main jar will be searched for the entry
java.io.IOException
byte[] getJarEntryBytes(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver)
throws java.io.IOException
subJar - the subJar returned from method getSubJar. If it is null,
the main jar will be searched for the entry
java.io.IOException
java.net.URLConnection getJarEntryURLConnection(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver,
java.net.URL url,
boolean dirConns)
throws java.io.IOException
subJar - the subJar returned from method getSubJar. If it is null,
the main jar will be searched for the entry
java.io.IOException
java.io.InputStream openStream(java.lang.Object pzip,
java.lang.Object entry,
Bundle b)
throws java.io.IOException
java.io.IOExceptionint getTime(java.lang.Object entry)
int getSize(java.lang.Object entry)
boolean hasJarEntry(java.lang.Object subJar,
java.lang.String fileName,
java.lang.Object rec,
short ver)
throws java.io.IOException
subJar - the subJar returned from method getSubJar. If it is null,
the main jar will be searched for the entry
java.io.IOException
java.lang.String[] getEntries(java.lang.Object subJar,
java.lang.Object rec,
short ver)
throws java.io.IOException
subJar - the subJar returned from method getSubJar. If it is null,
the entries from main jar will returned.rec - The bundle component, which must be checked for resources.ver - The version of the bundle's jar.
java.io.IOException
boolean hasDir(java.lang.Object subJar,
java.lang.String dirName,
java.lang.Object rec,
short ver)
throws java.io.IOException
java.io.IOException
java.lang.Object getSubJar(int subJarIndex,
java.lang.String jarName,
java.lang.Object rec,
short ver)
throws java.io.IOException
subJarIndex - the index of the subjar. It must be different from -1jarName - the full file name of the subjarrec - The bundle componentver - The version of the bundle's jar.
java.io.IOException - if an I/O problem existsjava.lang.String getArchiveName(java.lang.Object rec)
rec - identifies the Bundle
int getArchiveLength(java.lang.Object rec)
throws java.io.IOException
rec - identifies the Bundle
java.io.IOException
java.io.File getArchiveFile(java.lang.Object rec)
throws java.io.IOException
java.io.IOException
java.io.File getDataFile(java.lang.String fileName,
java.lang.Object rec,
short ver,
boolean root)
throws java.io.IOException
fileName - the file namerec - identifies the Bundlever - the version of the bundleroot - if the bundle should have access to the root of the storage
java.io.IOException
java.lang.String getNativeLibrary(java.lang.String path,
java.lang.Object rec,
boolean install)
throws java.io.IOException
path - the entry namerec - identifies the Bundleinstall - indicates if it is called when first start of the server or restarting
java.io.IOException
void delDataFiles(java.lang.Object rec,
short ver)
throws java.io.IOException
rec - identifies the Bundlever - the bundle version. if it is -1, the data files of all versions will be deleted.
java.io.IOException
void dirStateChanged(java.lang.String dirName,
boolean isPlugged)
dirName - a folder (flash) which is unplugged or plugged.isPlugged - indicate if the folder is unplugged or plugged
short copy(java.lang.Object rec,
short oldVer)
throws java.io.IOException
rec - identifies the bundleoldVer - the old bundle version.
java.io.IOExceptionXProperties getProperties(int type)
type -
java.io.InputStream getStateFileInputStream(int type,
boolean backup)
throws java.lang.Exception
type - 1 - reserved for framework state (f.st)
2 - reserved for bundle start levels (sl.st)
3 - reserved for bundle admin permissions (perms.st)
8 - bundle conditional permissions (condperms.st)backup - whether to return primary or backup input stream
java.lang.Exception
java.io.OutputStream getStateFileOutputStream(int type)
throws java.lang.Exception
type - 1 - reserved for framework state (f.st)
2 - reserved for bundle start levels (sl.st)
3 - reserved for bundle admin permissions (perms.st)
8 - bundle conditional permissions (condperms.st)
java.lang.Exceptionboolean persistentlyStarted(java.lang.Object rec)
rec - identifies the Bundle
boolean setPersistentState(java.lang.Object rec,
boolean started)
rec - identifies the Bundle
boolean setUnresolvableState(java.lang.Object rec,
boolean unresolvable)
rec - identifies the bundleunresolvable - true if the bundle should be marked as unresolvable
void setUnsigned(java.lang.Object rec)
rec - identifies the Bundleboolean isUnsigned(java.lang.Object rec)
rec - identifies the Bundle
void getBundleAllocations(java.lang.String location,
java.lang.Object rec,
java.util.Vector v1,
java.util.Dictionary dic)
v1 - contains the bundle classpath; used when deflate is supportedjava.lang.String getBundleLocation(java.lang.String dataFileName)
dataFileName -
boolean getNativeFlag()
java.io.File getDataDir()
java.lang.String[] getStorageRoots()
boolean isBundleInStorageRoot(java.lang.Object bundleRec,
java.lang.String storageRoot)
bundleRec - the bundle record objectstorageRoot - the storage root.
true if bundle is installed in that rootlong getLastMountTime(java.lang.String storageRoot)
storageRoot - when the card was last inserted
java.util.NoSuchElementException - if the storage is unknown.boolean isInTrustedStorage(java.lang.Object rec)
rec - identifies the Bundle
void close()
java.lang.String[] clearGarbage()
void clearZombies()
|
Framework Professional Edition Package |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||