Package com.sonymobile.tools.gerrit.gerritevents.dto.rest

Examples of com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify


                // but also a different value.
                return new Option(Messages.NotificationLevel_DefaultValue(), "");
            } else if (serverName != null) {
                GerritServer server = PluginImpl.getInstance().getServer(serverName);
                if (server != null) {
                    Notify level = server.getConfig().getNotificationLevel();
                    if (level != null) {
                        String levelText = levelTextsById.get(level);
                        if (levelText == null) { // new/unknown value
                            levelText = level.toString();
                        }
                        return new Option(Messages.NotificationLevel_DefaultValueFromServer(levelText), "");
                    }
                }
            }
View Full Code Here


     * @param memoryImprint the memory
     * @param onlyBuilt only count builds that completed (no NOT_BUILT builds)
     * @return the highest configured notification level.
     */
    public Notify getHighestNotificationLevel(MemoryImprint memoryImprint, boolean onlyBuilt) {
        Notify highestLevel = Notify.NONE;
        for (Entry entry : memoryImprint.getEntries()) {
            Result result = entry.getBuild().getResult();
            if (onlyBuilt && result == Result.NOT_BUILT) {
                continue;
            }

            GerritTrigger trigger = GerritTrigger.getTrigger(entry.getProject());
            if (trigger == null || shouldSkip(trigger.getSkipVote(), result)) {
                continue;
            }

            Notify level = getNotificationLevel(trigger);
            if (level != null && level.compareTo(highestLevel) > 0) {
                highestLevel = level;
            }
        }
        return highestLevel;
    }
View Full Code Here

    private Notify getNotificationLevel(GerritTrigger trigger) {
        String level = trigger.getNotificationLevel();
        if (level != null && level.length() > 0) {
            return Notify.valueOf(level);
        }
        Notify serverLevel = config.getNotificationLevel();
        if (serverLevel != null) {
            return serverLevel;
        }
        return Config.DEFAULT_NOTIFICATION_LEVEL;
    }
View Full Code Here

            command = config.getGerritCmdBuildFailed();
        }

        int verified = 0;
        int codeReview = 0;
        Notify notifyLevel = Notify.ALL;
        if (memoryImprint.getEvent().isScorable()) {
            verified = getMinimumVerifiedValue(memoryImprint, onlyCountBuilt);
            codeReview = getMinimumCodeReviewValue(memoryImprint, onlyCountBuilt);
            notifyLevel = getHighestNotificationLevel(memoryImprint, onlyCountBuilt);
        }

        Map<String, String> parameters = createStandardParameters(null, memoryImprint.getEvent(),
                codeReview, verified, notifyLevel.name());
        parameters.put("BUILDS_STATS", createBuildsStats(memoryImprint, listener, parameters));

        AbstractBuild build = null;
        Entry[] entries = memoryImprint.getEntries();
        if (entries.length > 0 && entries[0].getBuild() != null) {
View Full Code Here

                scoredLabels.add(new ReviewLabel(
                        LABEL_VERIFIED,
                        parameterExpander.getMinimumVerifiedValue(memoryImprint, true)));
            }
        }
        Notify notificationLevel = parameterExpander.getHighestNotificationLevel(memoryImprint, true);
        List<GerritMessageProvider> gerritMessageProviders = GerritMessageProvider.all();
        Collection<CommentedFile> commentedFiles = new ArrayList<CommentedFile>();
        if (gerritMessageProviders != null) {
            for (GerritMessageProvider gerritMessageProvider : gerritMessageProviders) {
                for (BuildMemory.MemoryImprint.Entry e : memoryImprint.getEntries()) {
View Full Code Here

TOP

Related Classes of com.sonymobile.tools.gerrit.gerritevents.dto.rest.Notify

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.