public interface PermissionStorage
This class is used to provide methods to manage persistent storage of bundle permissions. The PermissionStorage object is returned by the FrameworkAdaptor object and is called to persistently store bundle permissions.
The permission data will typically take the form of encoded PermissionInfo Strings. See org.osgi.service.permissionadmin.PermissionInfo.
For example
PermissionStorage storage = adaptor.getPermissionStorage(); try { storage.setPermissionData(location, permissions); } catch (IOException e) { // Take some error action. }
Clients may implement this interface.
Modifier and Type | Method and Description |
---|---|
String[] |
getConditionalPermissionInfos()
Returns the persistent array of encoded ConditionalPermissionInfo strings
|
String[] |
getLocations()
Returns the locations that have permission data assigned to them,
that is, locations for which permission data
exists in persistent storage.
|
String[] |
getPermissionData(String location)
Gets the permission data assigned to the specified
location.
|
void |
saveConditionalPermissionInfos(String[] infos)
Persists the array of encoded ConditionalPermissionInfo strings
|
void |
setPermissionData(String location,
String[] data)
Assigns the specified permission data to the specified
location.
|
String[] getLocations() throws IOException
IOException
- If a failure occurs accessing persistent storage.String[] getPermissionData(String location) throws IOException
location
- The location whose permission data is to
be returned.
The location can be null for the default permission data.IOException
- If a failure occurs accessing persistent storage.void setPermissionData(String location, String[] data) throws IOException
location
- The location that will be assigned the
permissions.
The location can be null for the default permission data.data
- The permission data to be assigned, or null
if the specified location is to be removed from persistent storaqe.IOException
- If a failure occurs modifying persistent storage.void saveConditionalPermissionInfos(String[] infos) throws IOException
infos
- an array of encoded ConditionalPermissionInfo stringsIOException
- If a failure occurs modifying persistent storage.String[] getConditionalPermissionInfos() throws IOException
IOException
- If a failure occurs accessing persistent storage.Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.