Пример #1
0
 /**
  * @param monitorgroup
  * @param portalsiteview
  */
 void processGroup(MonitorGroup monitorgroup, PortalSiteView portalsiteview) {
   boolean flag = visitor.groupPre(monitorgroup, portalsiteview);
   if (flag) {
     if (addAlerts) {
       Array array = monitorgroup.getElementsOfClass("COM.dragonflow.SiteView.Rule", false, false);
       Rule rule;
       for (Enumeration enumeration1 = array.elements();
           enumeration1.hasMoreElements();
           processAlert(rule, null, monitorgroup, portalsiteview)) {
         rule = (Rule) enumeration1.nextElement();
       }
     }
     Enumeration enumeration = monitorgroup.getMonitors();
     while (enumeration.hasMoreElements()) {
       Monitor monitor = (Monitor) enumeration.nextElement();
       if (itemFilter.itemAllowed(monitor.getFullID()) && itemFilter.monitorAllowed(monitor)) {
         if (debug) {
           Monitor _tmp = monitor;
           TextUtils.debugPrint("process monitor: " + monitor.getProperty(Monitor.pName));
         }
         processMonitor(monitor, monitorgroup, portalsiteview);
       }
     }
   }
   visitor.groupPost(monitorgroup, portalsiteview);
 }
Пример #2
0
 public PortalQuery(
     HashMap hashmap, PortalQueryVisitor portalqueryvisitor, HTTPRequest httprequest) {
   itemFilter = null;
   addAlerts = false;
   findObjects = 7;
   request = null;
   config = null;
   visitor = null;
   debug = false;
   visitor = portalqueryvisitor;
   if (httprequest == null) {
     request = new HTTPRequest();
     request.setUser("administrator");
   } else {
     request = httprequest;
   }
   config = MasterConfig.getMasterConfig();
   itemFilter = new PortalFilter(hashmap);
   User user = request.getUser();
   PortalFilter portalfilter = new PortalFilter(user.getProperty("_query"));
   itemFilter.addFilter(portalfilter);
   if (TextUtils.getValue(hashmap, "serverDepth").length() > 0) {
     findObjects = 4;
   } else if (TextUtils.getValue(hashmap, "groupDepth").length() > 0) {
     findObjects = 6;
   }
   if (TextUtils.getValue(hashmap, "trace").length() > 0) {
     debug = true;
   }
   portalqueryvisitor.initialize(hashmap, this);
 }
Пример #3
0
  void processSiteView(PortalSiteView portalsiteview) {
    boolean flag = visitor.siteviewPre(portalsiteview);
    if (flag) {
      if (debug) {
        PortalSiteView _tmp = portalsiteview;
        TextUtils.debugPrint("search groups: " + portalsiteview.getProperty(PortalSiteView.pTitle));
      }
      Array array = getSortedGroupIDs(portalsiteview);
      for (int i = 0; i < array.size(); i++) {
        String s = (String) array.at(i);
        MonitorGroup monitorgroup = (MonitorGroup) portalsiteview.getElement(s);
        if (monitorgroup == null || !itemFilter.itemAllowed(monitorgroup.getFullID())) {
          continue;
        }
        if (debug) {
          MonitorGroup _tmp1 = monitorgroup;
          TextUtils.debugPrint("process group: " + monitorgroup.getProperty(MonitorGroup.pName));
        }
        processGroup(monitorgroup, portalsiteview);
      }

      if (addAlerts) {
        Array array1 =
            portalsiteview.getElementsOfClass("COM.dragonflow.SiteView.Rule", false, false);
        Rule rule;
        for (Enumeration enumeration = array1.elements();
            enumeration.hasMoreElements();
            processAlert(rule, null, null, portalsiteview)) {
          rule = (Rule) enumeration.nextElement();
        }
      }
    }
    visitor.siteviewPost(portalsiteview);
  }
Пример #4
0
 public static ArrayList findObjects(String s, int i, HTTPRequest httprequest) {
   ArrayList array = new ArrayList();
   PortalQuery portalquery = new PortalQuery(PortalFilter.queryStringToMap(s), array, httprequest);
   portalquery.findObjects = i;
   portalquery.runQuery();
   return array;
 }
Пример #5
0
 /** @return */
 public Array getServers() {
   Array array = new Array();
   Enumeration enumeration = Portal.getPortal().getElements();
   while (enumeration.hasMoreElements()) {
     PortalSiteView portalsiteview = (PortalSiteView) enumeration.nextElement();
     if (itemFilter.itemAllowed(portalsiteview.getFullID())) {
       array.add(portalsiteview);
     }
   }
   return array;
 }
Пример #6
0
 public void addFilter(PortalFilter portalfilter) {
   itemFilter.addFilter(portalfilter);
 }
Пример #7
0
 public boolean filteringOnData() {
   return itemFilter.filteringOnData();
 }