Exemplo n.º 1
0
  public void updateForPage(String aName) {
    // KH - we should probably set the instance information as we get the
    // responses, to avoid waiting, then doing it in serial! (not that it's
    // _that_ slow)
    MSiteConfig siteConfig = WOTaskdHandler.siteConfig();
    startReading();
    try {
      aName = ERXStringUtilities.lastPropertyKeyInKeyPath(aName);
      if (siteConfig.hostArray().count() != 0) {
        if (ApplicationsPage.class.getName().endsWith(aName)
            && (siteConfig.applicationArray().count() != 0)) {

          for (Enumeration e = siteConfig.applicationArray().objectEnumerator();
              e.hasMoreElements(); ) {
            MApplication anApp = (MApplication) e.nextElement();
            anApp.setRunningInstancesCount(0);
          }
          NSArray<MHost> hostArray = siteConfig.hostArray();
          getApplicationStatusForHosts(hostArray);
        } else if (AppDetailPage.class.getName().endsWith(aName)) {
          NSArray<MHost> hostArray = siteConfig.hostArray();

          getInstanceStatusForHosts(hostArray);
        } else if (HostsPage.class.getName().endsWith(aName)) {
          NSArray<MHost> hostArray = siteConfig.hostArray();

          getHostStatusForHosts(hostArray);
        }
      }
    } finally {
      endReading();
    }
  }
Exemplo n.º 2
0
 public void sendUpdateSiteToWotaskds() {
   startReading();
   try {
     NSMutableArray hostArray = siteConfig().hostArray();
     if (hostArray.count() != 0) {
       NSMutableDictionary updateRequestDictionary =
           createUpdateRequestDictionary(siteConfig(), null, null, null, "configure");
       WOResponse[] responses = sendRequest(updateRequestDictionary, hostArray, true);
       NSDictionary[] responseDicts = generateResponseDictionaries(responses);
       getUpdateErrors(responseDicts, "configure", false, false, false, true);
     }
   } finally {
     endReading();
   }
 }