public boolean shouldDisplay() throws IOException, ServletException {
        if (!Functions.hasPermission(Jenkins.ADMINISTER)) {
            return false;
        }

        StaplerRequest req = Stapler.getCurrentRequest();

        if (req == null) {
            return false;
        }
        List<Ancestor> ancestors = req.getAncestors();

        if (ancestors == null || ancestors.size() == 0) {
            // ???
            return false;
        }

        Ancestor a = ancestors.get(ancestors.size() - 1);
        Object o = a.getObject();

        // don't show while Jenkins is loading
        if (o instanceof HudsonIsLoading) {
            return false;
        }
        // … or restarting
        if (o instanceof HudsonIsRestarting) {
            return false;
        }

        // don't show for some URLs served directly by Jenkins
        if (o instanceof Jenkins) {
            String url = a.getRestOfUrl();

            if (ignoredJenkinsRestOfUrls.contains(url)) {
                return false;
            }
        }

        if (getActiveAdministrativeMonitorsCount() == 0) {
            return false;
        }

        return true;
    }
public boolean shouldDisplay ( ) throws IOException , ServletException { if ( ! Functions . hasPermission ( Jenkins . ADMINISTER ) ) { return false ; } StaplerRequest req = Stapler . getCurrentRequest ( ) ; if ( req == null ) { return false ; } List < Ancestor > ancestors = req . getAncestors ( ) ; if ( ancestors == null || ancestors . size ( ) == 0 ) { return false ; } Ancestor a = ancestors . get ( ancestors . size ( ) - 1 ) ; Object o = a . getObject ( ) ; if ( o instanceof HudsonIsLoading ) { return false ; } if ( o instanceof HudsonIsRestarting ) { return false ; } if ( o instanceof Jenkins ) { String url = a . getRestOfUrl ( ) ; if ( ignoredJenkinsRestOfUrls . contains ( url ) ) { return false ; } } if ( getActiveAdministrativeMonitorsCount ( ) == 0 ) { return false ; } return true ; }
Whether the administrative monitors notifier should be shown.
@return true iff the administrative monitors notifier should be shown.
@throws IOException
@throws ServletException