public interface IProfileRegistry
Modifier and Type | Field and Description |
---|---|
static String |
SELF
A special profile id representing the profile of the currently running system.
|
static String |
SERVICE_NAME
Service name constant for the profile registry service.
|
Modifier and Type | Method and Description |
---|---|
IProfile |
addProfile(String id)
Add the given profile to this profile registry.
|
IProfile |
addProfile(String id,
Map<String,String> properties)
Add the given profile to this profile registry.
|
boolean |
containsProfile(String profileId)
Returns whether this profile registry contains a profile with the given id.
|
IProfile |
getProfile(String id)
Return the profile in the registry that has the given id.
|
IProfile |
getProfile(String id,
long timestamp)
Return the profile in the registry that has the given id and timestamp.
|
IProfile[] |
getProfiles()
Return an array of profiles known to this registry.
|
Map<String,String> |
getProfileStateProperties(String id,
long timestamp)
Return all properties for a particular profile state.
|
Map<String,String> |
getProfileStateProperties(String id,
String key)
Return a map of profile timestamps to values for all profile states that contain the given property key.
|
boolean |
isCurrent(IProfile profile)
Check if the given profile from this profile registry is up-to-date.
|
long[] |
listProfileTimestamps(String id)
Return an array of timestamps in ascending order for the profile id in question.
|
void |
removeProfile(String id)
Remove the given profile from this profile registry.
|
void |
removeProfile(String id,
long timestamp)
Remove the given profile snapshot from this profile registry.
|
IStatus |
removeProfileStateProperties(String id,
long timestamp,
Collection<String> keys)
Remove all properties with matching keys from the given profile state.
|
IStatus |
setProfileStateProperties(String id,
long timestamp,
Map<String,String> properties)
Set properties on a specific profile state.
|
IStatus |
setProfileStateProperty(String id,
long timestamp,
String key,
String value)
Set a specific property on a specific profile state.
|
static final String SELF
getProfile(String)
to obtain
the profile of the currently running system. Note that a given profile registry
may not have a defined self profile, for example if the running system doesn't
have a profile, or resides in a different profile registry.static final String SERVICE_NAME
IProfile getProfile(String id)
null
.id
- the profile identifiernull
IProfile getProfile(String id, long timestamp)
null
.id
- the profile identifiertimestamp
- the profile's timestampnull
long[] listProfileTimestamps(String id)
id
- the id of the profile to list timestamps forIProfile[] getProfiles()
IProfile addProfile(String id) throws ProvisionException
id
- the profile idProvisionException
- if a profile
with the same id is already present in the registry.IProfile addProfile(String id, Map<String,String> properties) throws ProvisionException
id
- the profile idproperties
- the profile propertiesProvisionException
- if a profile
with the same id is already present in the registry.boolean containsProfile(String profileId)
profileId
- The id of the profile to search fortrue
if this registry contains a profile with the given id,
and false
otherwise.void removeProfile(String id, long timestamp) throws ProvisionException
id
- the profile to removetimestamp
- the timestamp of the profile to removeProvisionException
- if the profile with the specified id and timestamp is the current profile.void removeProfile(String id)
id
- the profile to removeboolean isCurrent(IProfile profile)
profile
- the profile to checkIStatus setProfileStateProperties(String id, long timestamp, Map<String,String> properties)
id
- the identifier of the profiletimestamp
- the timestamp of the profileproperties
- the properties to set on the profileNullPointerException
- if either id or properties are null
IStatus setProfileStateProperty(String id, long timestamp, String key, String value)
Use of this method is discouraged if multiple properties will be set on the same state since
the implementation of this method may access the file-system with each call. Callers should use
setProfileStateProperties(String, long, Map)
instead.
id
- the profile identifiertimestamp
- the timestamp of the profilekey
- the property key to setvalue
- the property value to setNullPointerException
- if any of id, key or value is null
Map<String,String> getProfileStateProperties(String id, long timestamp)
String
.
Return an empty map if there was a problem accessing the properties.
There is no guarantee that all state timestamps returned will still exist in the registry since the user could delete profile states from the file system.
id
- the profile identifiertimestamp
- the profile timestampNullPointerException
- if profile id is null
.Map<String,String> getProfileStateProperties(String id, String key)
String
.
Return an empty map if there was a problem accessing the properties.
There is no guarantee that all state timestamps returned will still exist in the registry since the user could delete profile states from the file system.
id
- the profile identifierkey
- the property keyNullPointerException
- if the profile id or key is null
.IStatus removeProfileStateProperties(String id, long timestamp, Collection<String> keys)
null
then remove all properties from the profile state.id
- the profile identifiertimestamp
- the profile timestampkeys
- the property keys to remove, or null
NullPointerException
- if the profile id is null
.
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.