|
Eclipse Platform Release 3.7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IProfileRegistry
This encapsulates the access to the profile registry. It deals with persistence in a transparent way.
Field Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Field Detail |
---|
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
Method Detail |
---|
IProfile getProfile(String id)
null
.
id
- the profile identifier
null
IProfile getProfile(String id, long timestamp)
null
.
id
- the profile identifiertimestamp
- the profile's timestamp
null
long[] listProfileTimestamps(String id)
id
- the id of the profile to list timestamps for
IProfile[] getProfiles()
IProfile addProfile(String id) throws ProvisionException
id
- the profile id
ProvisionException
- 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 properties
ProvisionException
- 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 for
true
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 remove
ProvisionException
- 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 check
IStatus 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 profile
NullPointerException
- 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 set
NullPointerException
- 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 timestamp
NullPointerException
- 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 key
NullPointerException
- 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
.
|
Eclipse Platform Release 3.7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.