org.eclipse.equinox.p2.director.app_1.0.300.v20120428-0517

TION_REVERT, OPTION_DESTINATION, OPTION_DOWNLOAD_ONLY, OPTION_METADATAREPOS, OPTION_ARTIFACTREPOS, OPTION_REPOSITORIES, OPTION_VERIFY_ONLY, OPTION_TAG, OPTION_LIST_TAGS, OPTION_PROFILE, OPTION_FLAVOR, OPTION_SHARED, OPTION_BUNDLEPOOL, OPTION_PROFILE_PROPS, OPTION_IU_PROFILE_PROPS, OPTION_ROAMING, OPTION_P2_OS, OPTION_P2_WS, OPTION_P2_ARCH, OPTION_P2_NL, OPTION_PURGEHISTORY, OPTION_FOLLOW_REFERENCES };
    for (int i = 0; i < allOptions.length; i++) {
      allOptions[i].appendHelp(System.out);
    }
  }
  
  private IStatus setRoaming(IProfile profile)
  {
    ProfileChangeRequest request = new ProfileChangeRequest(profile);
    request.setProfileProperty("org.eclipse.equinox.p2.roaming", "true");
    ProvisioningContext context = new ProvisioningContext(targetAgent);
    context.setMetadataRepositories(new URI[0]);
    context.setArtifactRepositories(new URI[0]);
    IProvisioningPlan result = planner.getProvisioningPlan(request, context, new NullProgressMonitor());
    return PlanExecutionHelper.executePlan(result, engine, context, new NullProgressMonitor());
  }
  
  public Object start(IApplicationContext context)
    throws Exception
  {
    return run((String[])context.getArguments().get("application.args"));
  }
  
  private String toString(Map<String, String> context)
  {
    StringBuffer result = new StringBuffer();
    for (Iterator localIterator = context.entrySet().iterator(); localIterator.hasNext();)
    {
      Map.Entry<String, String> entry = (Map.Entry)localIterator.next();
      if (result.length() > 0) {
        result.append(',');
      }
      result.append((String)entry.getKey());
      result.append('=');
      result.append((String)entry.getValue());
    }
    return result.toString();
  }
  
  private void updateRoamingProperties(IProfile profile)
    throws CoreException
  {
    if (destination == null) {
      return;
    }
    if (noProfileId) {
      throw new ProvisionException(Messages.Missing_profileid);
    }
    if (!Boolean.valueOf(profile.getProperty("org.eclipse.equinox.p2.roaming")).booleanValue()) {
      return;
    }
    ProfileChangeRequest request = new ProfileChangeRequest(profile);
    if (!destination.equals(new File(profile.getProperty("org.eclipse.equinox.p2.installFolder")))) {
      request.setProfileProperty("org.eclipse.equinox.p2.installFolder", destination.getAbsolutePath());
    }
    File cacheLocation = null;
    if (bundlePool == null) {
      cacheLocation = sharedLocation == null ? destination.getAbsoluteFile() : sharedLocation.getAbsoluteFile();
    } else {
      cacheLocation = bundlePool.getAbsoluteFile();
    }
    if (!cacheLocation.equals(new File(profile.getProperty("org.eclipse.equinox.p2.cache")))) {
      request.setProfileProperty("org.eclipse.equinox.p2.cache", cacheLocation.getAbsolutePath());
    }
    if (request.getProfileProperties().size() == 0) {
      return;
    }
    request.setProfileProperty("org.eclipse.equinox.p2.roaming", "false");
    
    ProvisioningContext context = new ProvisioningContext(targetAgent);
    context.setMetadataRepositories(new URI[0]);
    context.setArtifactRepositories(new URI[0]);
    IProvisioningPlan result = planner.getProvisioningPlan(request, context, new NullProgressMonitor());
    IStatus status = PlanExecutionHelper.executePlan(result, engine, context, new NullProgressMonitor());
    if (!status.isOK()) {
      throw new CoreException(new MultiStatus("org.eclipse.equinox.p2.director.app", 4, new IStatus[] { status }, NLS.bind(Messages.Cant_change_roaming, profile.getProfileId()), null));
    }
  }
  
  public void stop()
  {
    IProvisioningEventBus eventBus = (IProvisioningEventBus)targetAgent.getService(IProvisioningEventBus.SERVICE_NAME);
    if (eventBus != null) {
      eventBus.removeListener(this);
    }
    if (log != null) {
      log.close();
    }
  }
  
  public void setLog(ILog log)
  {
    this.log = log;
  }
  
  private void performListInstalledRoots()
    throws CoreException
  {
    IProfile profile = initializeProfile();
    IQueryResult<IInstallableUnit> roots = profile.query(new UserVisibleRootQuery(), null);
    Set<IInstallableUnit> sorted = new TreeSet(roots.toUnmodifiableSet());
    for (Iterator localIterator = sorted.iterator(); localIterator.hasNext();)
    {
      IInstallableUnit iu = (IInstallableUnit)localIterator.next();
      System.out.println(iu.getId() + '/' + iu.getVersion());
    }
  }
  
  private void performPrintTags()
    throws CoreException
  {
    IProfile profile = initializeProfile();
    IProfileRegistry registry = (IProfileRegistry)targetAgent.getService(IProfileRegistry.SERVICE_NAME);
    Map<String, String> tags = registry.getProfileStateProperties(profile.getProfileId(), "org.eclipse.equinox.p2.state.tag");
    
    List<String> timeStamps = new ArrayList(tags.keySet());
    Collections.sort(timeStamps, Collections.reverseOrder());
    for (Iterator localIterator = timeStamps.iterator(); localIterator.hasNext();)
    {
      String timestamp = (String)localIterator.next();
      System.out.println((String)tags.get(timestamp));
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.director.app.DirectorApplication
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.director.app;

import org.eclipse.core.runtime.IStatus;

public abstract interface ILog
{
  public abstract void log(IStatus paramIStatus);
  
  public abstract void log(String paramString);
  
  public abstract void close();
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.director.app.ILog
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.director.app;

import org.eclipse.osgi.util.NLS;

public class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.equinox.internal.p2.director.app.messages";
  public static String could_not_remove_initialProfile;
  public static String Deprecated_application;
  public static String Ambigous_Command;
  public static String Application_NoManager;
  public static String Application_NoRepositories;
  public static String Bad_format;
  public static String Cant_change_roaming;
  public static String destination_commandline;
  public static String Cannot_set_iu_profile_property_iu_does_not_exist;
  public static String File_does_not_exist;
  public static String Help_A_list_of_properties_in_the_form_key_value_pairs;
  public static String Help_A_list_of_URLs_denoting_artifact_repositories;
  public static String Help_A_list_of_URLs_denoting_colocated_repositories;
  public static String Help_A_list_of_URLs_denoting_metadata_repositories;
  public static String Help_Defines_flavor_to_use_for_created_profile;
  public static String Help_Defines_what_profile_to_use_for_the_actions;
  public static String Help_Indicates_that_the_product_can_be_moved;
  public static String Help_Installs_the_listed_IUs;
  public static String Help_lb_lt_path_gt_rb;
  public static String Help_List_all_IUs_found_in_repos;
  public static String Help_List_installed_roots;
  public static String Help_lt_comma_separated_list_gt;
  public static String Help_lb_lt_comma_separated_list_gt_rb;
  public static String Help_lt_name_gt;
  public static String Help_lt_path_gt;
  public static String Help_Missing_argument;
  public static String Help_Only_verify_dont_install;
  public static String Help_path_to_IU_profile_properties_file;
  public static String Help_Prints_this_command_line_help;
  public static String Help_The_ARCH_when_profile_is_created;
  public static String Help_The_folder_in_which_the_targetd_product_is_located;
  public static String Help_The_location_where_the_plugins_and_features_will_be_stored;
  public static String Help_The_NL_when_profile_is_created;
  public static String Help_The_OS_when_profile_is_created;
  public static String Help_The_WS_when_profile_is_created;
  public static String Help_Uninstalls_the_listed_IUs;
  public static String Help_Revert_to_previous_state;
  public static String Help_Use_a_shared_location_for_the_install;
  public static String Help_Purge_the_install_registry;
  public static String Help_Follow_references;
  public static String Help_Defines_a_tag_for_provisioning_session;
  public static String Help_List_Tags;
  public static String Help_Download_Only;
  public static String Ignored_repo;
  public static String Installing;
  public static String Missing_director;
  public static String Missing_Engine;
  public static String Missing_IU;
  public static String Missing_planner;
  public static String Missing_profileid;
  public static String Missing_Required_Argument;
  public static String Missing_profile;
  public static String Operation_complete;
  public static String Operation_failed;
  public static String option_0_requires_an_argument;
  public static String unable_to_parse_0_to_uri_1;
  public static String Uninstalling;
  public static String unknown_option_0;
  public static String problem_CallingDirector;
  public static String Problem_loading_file;
  public static String problem_repoMustBeURI;
  public static String unableToWriteLogFile;
  public static String Unmatched_iu_profile_property_key_value;
  
  static
  {
    NLS.initializeMessages("org.eclipse.equinox.internal.p2.director.app.messages", Messages.class);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.director.app.Messages
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.equinox.internal.p2.director.app;

import java.util.Iterator;
import org.eclipse.equinox.p2.metadata.expression.IExpression;
import org.eclipse.equinox.p2.query.IQuery;
import org.eclipse.equinox.p2.query.IQueryResult;

public class PrettyQuery<T>
  implements IQuery<T>
{
  private IQuery<T> decorated;
  private String userString;
  
  public PrettyQuery(IQuery<T> toDecorate, String userReadable)
  {
    decorated = toDecorate;
    userString = userReadable;
  }
  
  public IQueryResult<T> perform(Iterator<T> iterator)
  {
    return decorated.perform(iterator);
  }
  
  public IExpression getExpression()
  {
    return decorated.getExpression();
  }
  
  public String toString()
  {
    if (userString != null) {
      return userString;
    }
    return decorated.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.equinox.internal.p2.director.app.PrettyQuery
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
1 2 3

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2019. Infinite Loop Ltd