Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.engine
Interface IProfileRegistry


public interface IProfileRegistry

This encapsulates the access to the profile registry. It deals with persistence in a transparent way.

Since:
2.0

Field Summary
static String SELF
           
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.
 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 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.
 

Field Detail

SELF

static final String SELF
See Also:
Constant Field Values

SERVICE_NAME

static final String SERVICE_NAME
Service name constant for the profile registry service.

Method Detail

getProfile

IProfile getProfile(String id)
Return the profile in the registry that has the given id. If it does not exist, then return null.

Parameters:
id - the profile identifier
Returns:
the profile or null

getProfile

IProfile getProfile(String id,
                    long timestamp)
Return the profile in the registry that has the given id and timestamp. If it does not exist, then return null.

Parameters:
id - the profile identifier
timestamp - the profile's timestamp
Returns:
the profile or null

listProfileTimestamps

long[] listProfileTimestamps(String id)
Return an array of timestamps in ascending order for the profile in question. If there are none, then return an empty array.

Returns:
the array of timestamps

getProfiles

IProfile[] getProfiles()
Return an array of profiles known to this registry. If there are none, then return an empty array.

Returns:
the array of profiles

addProfile

IProfile addProfile(String id)
                    throws ProvisionException
Add the given profile to this profile registry.

Parameters:
id - the profile id
Throws:
ProvisionException - if a profile with the same id is already present in the registry.

addProfile

IProfile addProfile(String id,
                    Map<String,String> properties)
                    throws ProvisionException
Add the given profile to this profile registry.

Parameters:
id - the profile id
properties - the profile properties
Throws:
ProvisionException - if a profile with the same id is already present in the registry.

containsProfile

boolean containsProfile(String profileId)
Returns whether this profile registry contains a profile with the given id.

Parameters:
profileId - The id of the profile to search for
Returns:
true if this registry contains a profile with the given id, and false otherwise.

removeProfile

void removeProfile(String id,
                   long timestamp)
                   throws ProvisionException
Remove the given profile snapshot from this profile registry. This method has no effect if this registry does not contain a profile with the given id and timestamp. The current profile cannot be removed using this method.

Parameters:
id - the profile to remove
timestamp - the timestamp of the profile to remove
Throws:
ProvisionException - if the profile with the specified id and timestamp is the current profile.

removeProfile

void removeProfile(String id)
Remove the given profile from this profile registry. This method has no effect if this registry does not contain a profile with the given id.

Parameters:
id - the profile to remove

isCurrent

boolean isCurrent(IProfile profile)
Check if the given profile from this profile registry is up-to-date.

Parameters:
profile - the profile to check
Returns:
boolean true if the profile is current; false otherwise.

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.