@Override
  public void doExecute(final IOpenShiftConnection connection) {
    final List<IDomain> domains = connection.getDomains();
    final Map<IDomain, List<IApplication>> applicationByDomains =
        new HashMap<IDomain, List<IApplication>>();
    final Map<IApplication, List<IEmbeddedCartridge>> embeddedCartridgesByApp =
        new HashMap<IApplication, List<IEmbeddedCartridge>>();

    for (final IDomain domain : domains) {
      final List<IApplication> applications = domain.getApplications();
      applicationByDomains.put(domain, applications);
      for (final IApplication app : applications) {
        embeddedCartridgesByApp.put(app, app.getEmbeddedCartridges());
      }
    }

    emptyLine();
    getLog().info("Standalone domains:");
    emptyLine();
    for (final IDomain domain : domains) {
      getLog().info("Id: " + domain.getId());
      getLog().info("Suffix: " + domain.getSuffix());
      for (final IApplication application : applicationByDomains.get(domain)) {
        dumpApplication(SPACE + SPACE, application, embeddedCartridgesByApp.get(application));
        emptyLine();
      }
      emptyLine();
    }
  }
Ejemplo n.º 2
0
 @Override
 protected Object doExecute() throws Exception {
   IOpenShiftConnection connection = getOrCreateConnection();
   System.out.println("[id]");
   for (IDomain domain : connection.getDomains()) {
     System.out.println(domain.getId());
   }
   return null;
 }
Ejemplo n.º 3
0
 @Override
 protected Object doExecute() throws Exception {
   IOpenShiftConnection connection = getOrCreateConnection();
   for (IDomain domain : connection.getDomains()) {
     if (domainId == null || domainId.equals(domain.getId())) {
       IApplication application = domain.getApplicationByName(applicationName);
       application.start();
     }
   }
   return null;
 }