Eclipse Platform
Release 3.6

org.eclipse.equinox.p2.operations
Class ProvisioningSession

java.lang.Object
  extended by org.eclipse.equinox.p2.operations.ProvisioningSession

public class ProvisioningSession
extends Object

ProvisioningSession provides the context for a provisioning session, including the provisioning services that should be used. It also provides utility methods for commonly performed provisioning tasks.

Since:
2.0
Restriction:
This class is not intended to be subclassed by clients.

Field Summary
static long SIZE_NOTAPPLICABLE
          A constant indicating that there was nothing to size (there was no valid plan that could be used to compute size).
static long SIZE_UNAVAILABLE
          Indicates that the size is unavailable (an attempt was made to compute size but it failed)
static long SIZE_UNKNOWN
          Indicates that the size is currently unknown
static int STATUS_INVALID_REPOSITORY_LOCATION
          A status code used to indicate that a repository location was not valid.
static int STATUS_NOTHING_TO_UPDATE
          A status code used to indicate that there were no updates found when looking for updates.
 
Constructor Summary
ProvisioningSession(IProvisioningAgent agent)
          Create a provisioning session using the services of the supplied agent.
 
Method Summary
 IAgentLocation getAgentLocation()
          Return the agent location for this session
 IArtifactRepositoryManager getArtifactRepositoryManager()
          Return the artifact repository manager for this session
 IEngine getEngine()
          Return the provisioning engine for this session
 Collection<IInstallableUnit> getInstalledIUs(String profileId, boolean all)
          Get the IInstallable units for the specified profile
 IMetadataRepositoryManager getMetadataRepositoryManager()
          Return the metadata repository manager for this session
 org.eclipse.equinox.p2.planner.IPlanner getPlanner()
          Return the planner used for this session
 IProfileRegistry getProfileRegistry()
          Return the profile registry for this session
 IProvisioningAgent getProvisioningAgent()
          Return the provisioning agent used to retrieve provisioning services.
 org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus getProvisioningEventBus()
          Return the provisioning event bus used for dispatching events.
 long getSize(IProvisioningPlan plan, ProvisioningContext context, IProgressMonitor monitor)
          Get sizing information about the specified plan.
 boolean hasScheduledOperationsFor(String profileId)
          Return a boolean indicating whether any other provisioning operations are scheduled for the specified profile.
 IStatus performProvisioningPlan(IProvisioningPlan plan, IPhaseSet phaseSet, ProvisioningContext context, IProgressMonitor monitor)
          Perform the specified provisioning plan.
 void rememberJob(Job job)
          Remember the specified job.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE_NOTAPPLICABLE

public static final long SIZE_NOTAPPLICABLE
A constant indicating that there was nothing to size (there was no valid plan that could be used to compute size).

See Also:
Constant Field Values

SIZE_UNAVAILABLE

public static final long SIZE_UNAVAILABLE
Indicates that the size is unavailable (an attempt was made to compute size but it failed)

See Also:
Constant Field Values

SIZE_UNKNOWN

public static final long SIZE_UNKNOWN
Indicates that the size is currently unknown

See Also:
Constant Field Values

STATUS_NOTHING_TO_UPDATE

public static final int STATUS_NOTHING_TO_UPDATE
A status code used to indicate that there were no updates found when looking for updates.

See Also:
Constant Field Values

STATUS_INVALID_REPOSITORY_LOCATION

public static final int STATUS_INVALID_REPOSITORY_LOCATION
A status code used to indicate that a repository location was not valid.

See Also:
Constant Field Values
Constructor Detail

ProvisioningSession

public ProvisioningSession(IProvisioningAgent agent)
Create a provisioning session using the services of the supplied agent.

Parameters:
agent - the provisioning agent that supplies services. Must not be null.
Method Detail

getProvisioningAgent

public IProvisioningAgent getProvisioningAgent()
Return the provisioning agent used to retrieve provisioning services.

Returns:
the provisioning agent

getAgentLocation

public IAgentLocation getAgentLocation()
Return the agent location for this session

Returns:
the agent location

getArtifactRepositoryManager

public IArtifactRepositoryManager getArtifactRepositoryManager()
Return the artifact repository manager for this session

Returns:
the repository manager

getMetadataRepositoryManager

public IMetadataRepositoryManager getMetadataRepositoryManager()
Return the metadata repository manager for this session

Returns:
the repository manager

getProfileRegistry

public IProfileRegistry getProfileRegistry()
Return the profile registry for this session

Returns:
the profile registry

getEngine

public IEngine getEngine()
Return the provisioning engine for this session

Returns:
the provisioning engine

getProvisioningEventBus

public org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus getProvisioningEventBus()
Return the provisioning event bus used for dispatching events.

Returns:
the event bus

getPlanner

public org.eclipse.equinox.p2.planner.IPlanner getPlanner()
Return the planner used for this session

Returns:
the planner

getSize

public long getSize(IProvisioningPlan plan,
                    ProvisioningContext context,
                    IProgressMonitor monitor)
Get sizing information about the specified plan.

Parameters:
plan - the provisioning plan
context - the provisioning context to be used for the sizing
monitor - the progress monitor
Returns:
a long integer describing the disk size required for the provisioning plan.
See Also:
SIZE_UNKNOWN, SIZE_UNAVAILABLE, SIZE_NOTAPPLICABLE

performProvisioningPlan

public IStatus performProvisioningPlan(IProvisioningPlan plan,
                                       IPhaseSet phaseSet,
                                       ProvisioningContext context,
                                       IProgressMonitor monitor)
Perform the specified provisioning plan.

Parameters:
plan - the provisioning plan to be performed
phaseSet - the phase set to be used for the plan
context - the provisioning context to be used during provisioning
monitor - the progress monitor to use while performing the plan
Returns:
a status describing the result of performing the plan

hasScheduledOperationsFor

public boolean hasScheduledOperationsFor(String profileId)
Return a boolean indicating whether any other provisioning operations are scheduled for the specified profile.

Parameters:
profileId - the id of the profile in question
Returns:
true if there are pending provisioning operations for this profile, false if there are not.
See Also:
rememberJob(Job)

rememberJob

public void rememberJob(Job job)
Remember the specified job. Remembered jobs are checked when callers want to know what work is scheduled for a particular profile.

Parameters:
job - the job to be remembered
See Also:
hasScheduledOperationsFor(String)

getInstalledIUs

public Collection<IInstallableUnit> getInstalledIUs(String profileId,
                                                    boolean all)
Get the IInstallable units for the specified profile

Parameters:
profileId - the profile in question
all - true if all IInstallableUnits in the profile should be returned, false only those IInstallableUnits marked as (user visible) roots should be returned.
Returns:
an array of IInstallableUnits installed in the profile.

Eclipse Platform
Release 3.6

Guidelines for using Eclipse APIs.

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