Package com.webobjects.monitor._private

Examples of com.webobjects.monitor._private.MObject


        NSArray<MApplication> objects = ERXQ.filtered(siteConfig().applicationArray(), ERXQ.is("name", obj));
        return objects.size() == 0 ? null : objects.objectAtIndex(0);
    }

    public Object createObjectOfEntityWithID(EOClassDescription entity, Object id, ERXRestContext context) {
        return new MApplication((String)id, siteConfig());
    }
View Full Code Here


    }

    public WOComponent stopAllClicked() {

        final NSArray instances = selectedInstances().immutableClone();
        final MApplication application = myApplication();

        return ConfirmationPage.create(context(), new ConfirmationPage.Delegate() {

            public WOComponent cancel() {
                return AppDetailPage.create(context(), application, instances);
            }

            public WOComponent confirm() {
                handler().startReading();
                try {
                    if (application.hostArray().count() != 0) {
                        handler().sendStopInstancesToWotaskds(instances, application.hostArray());
                    }

                    for (int i = 0; i < instances.count(); i++) {
                        MInstance anInst = (MInstance) instances.objectAtIndex(i);
                        if (anInst.state != MObject.DEAD) {
                            anInst.state = MObject.STOPPING;
                        }
                    }
                } finally {
                    handler().endReading();
                }
                return AppDetailPage.create(context(), application, instances);
            }

            public String explaination() {
                return "Selecting 'Yes' will shutdown the selected instances of this application.";
            }

            public int pageType() {
                return APP_PAGE;
            }

            public String question() {
                return "Are you sure you want to stop the " + instances.count() + " instances of " + application.name() + "?";
            }

        });
    }
View Full Code Here

    }

    public WOComponent deleteAllInstancesClicked() {

        final NSArray instances = selectedInstances().immutableClone();
        final MApplication application = myApplication();

        return ConfirmationPage.create(context(), new ConfirmationPage.Delegate() {

            public WOComponent cancel() {
                return AppDetailPage.create(context(), application, instances);
            }

            public WOComponent confirm() {
                handler().startWriting();
                try {
                    siteConfig().removeInstances_M(application, instances);

                    if (siteConfig().hostArray().count() != 0) {
                        handler().sendRemoveInstancesToWotaskds(instances, siteConfig().hostArray());
                    }
                } finally {
                    handler().endWriting();
                }
                return AppDetailPage.create(context(), application, instances);
            }

            public String explaination() {
                return "Selecting 'Yes' will shutdown any shutdown the selected instances of this application, and delete all matching instance configurations.";
            }

            public int pageType() {
                return APP_PAGE;
            }

            public String question() {
                return "Are you sure you want to delete the selected <i>" + instances.count() + "</i> instances of application " + application.name() + "?";
            }

        });
    }
View Full Code Here

  @Override
  public WOActionResults createAction() throws Throwable {
    checkPassword();
    ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
    MApplication application = create(filter);
    siteConfig().addApplication_M(application);
    if (siteConfig().hostArray().count() != 0) {
      handler().sendAddApplicationToWotaskds(application, siteConfig().hostArray());
    }   
    pushValues(application);
View Full Code Here

  }

  @Override
  public WOActionResults destroyAction() throws Throwable {
    checkPassword();
    MApplication application = (MApplication) routeObjectForKey("mApplication");   
    deleteApplication(application);
    return response(application, ERXKeyFilter.filterWithNone());
  }
View Full Code Here

  }

  @Override
  public WOActionResults showAction() throws Throwable {
    checkPassword();
    MApplication application = (MApplication) routeObjectForKey("mApplication")
    return response(application, ERXKeyFilter.filterWithAttributes());
  }
View Full Code Here

  }

  @Override
  public WOActionResults updateAction() throws Throwable {
    checkPassword();
    MApplication application = (MApplication) routeObjectForKey("mApplication");   
    update(application, ERXKeyFilter.filterWithAttributes());
    pushValues(application);
    return response(application, ERXKeyFilter.filterWithAttributes());
  }
View Full Code Here

    return response(application, ERXKeyFilter.filterWithAttributes());
  }

  public WOActionResults addInstanceAction() throws Throwable {
    checkPassword();
    MApplication application = (MApplication) routeObjectForKey("name");
    // Old code. The if statement replaces this code along with the addInstanceOnAllHostsAction() method. kib 20110622
    //    addInstance(application, (MHost)routeObjectForKey("host"), false);
    if (request().stringFormValueForKey("host") != null) {
      MHost mHost = siteConfig().hostWithName(request().stringFormValueForKey("host"));
      addInstance(application, mHost, false);
View Full Code Here

    return response(application, ERXKeyFilter.filterWithNone());
  }

  public WOActionResults deleteInstanceAction() throws Throwable {
    checkPassword();
    MApplication application = (MApplication) routeObjectForKey("name");
    deleteInstance(application, Integer.valueOf(request().stringFormValueForKey("id")));
    return response(application, ERXKeyFilter.filterWithNone());
  }
View Full Code Here

    return response(application, ERXKeyFilter.filterWithNone());
  }

  public WOActionResults addInstanceOnAllHostsAction() throws Throwable {
    checkPassword();
    MApplication application = (MApplication) routeObjectForKey("name");
    addInstance(application, null, true);
    return response(application, ERXKeyFilter.filterWithNone());
  }
View Full Code Here

TOP

Related Classes of com.webobjects.monitor._private.MObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.