Package org.apache.maven.continuum.web.model

Examples of org.apache.maven.continuum.web.model.NotifierSummary


        List<NotifierSummary> summaryList = new ArrayList<NotifierSummary>();
        projectGroup = getContinuum().getProjectGroupWithBuildDetails( projectGroupId );

        for ( ProjectNotifier pn : (List<ProjectNotifier>) projectGroup.getNotifiers() )
        {
            NotifierSummary ns = generateGroupNotifierSummary( pn );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here


     * @param notifier
     * @return
     */
    private NotifierSummary generateNotifierSummary( ProjectNotifier notifier, int projectGroupId, Project project )
    {
        NotifierSummary ns = new NotifierSummary();
        ns.setId( notifier.getId() );
        ns.setType( notifier.getType() );
        ns.setProjectGroupId( projectGroupId );
        if ( project != null )
        {
            ns.setProjectId( project.getId() );
            ns.setProjectName( project.getName() );
        }

        if ( notifier.isFromProject() )
        {
            ns.setFromProject( true );
        }
        else
        {
            ns.setFromProject( false );
        }

        String recipient = GenerateRecipentNotifier.generate( notifier );

        ns.setRecipient( recipient );

        // XXX: Hack - just for testing :)
        StringBuffer sb = new StringBuffer();
        if ( notifier.isSendOnError() )
        {
            sb.append( "Error" );
        }
        if ( notifier.isSendOnFailure() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Failure" );
        }
        if ( notifier.isSendOnSuccess() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Success" );
        }
        if ( notifier.isSendOnWarning() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Warning" );
        }
        if ( notifier.isSendOnScmFailure() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "SCM Failure" );
        }
        ns.setEvents( sb.toString() );

        ns.setEnabled( notifier.isEnabled() );
        return ns;
    }
View Full Code Here

        List<NotifierSummary> summaryList = new ArrayList<NotifierSummary>();
        Project project = getContinuum().getProjectWithAllDetails( projectId );

        for ( ProjectNotifier pn : (List<ProjectNotifier>) project.getNotifiers() )
        {
            NotifierSummary ns = generateProjectNotifierSummary( pn, project );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here

        List<NotifierSummary> summaryList = new ArrayList<NotifierSummary>();
        projectGroup = getContinuum().getProjectGroupWithBuildDetails( projectGroupId );

        for ( ProjectNotifier pn : (List<ProjectNotifier>) projectGroup.getNotifiers() )
        {
            NotifierSummary ns = generateGroupNotifierSummary( pn );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here

     * @param notifier
     * @return
     */
    private NotifierSummary generateNotifierSummary( ProjectNotifier notifier, int projectGroupId, Project project )
    {
        NotifierSummary ns = new NotifierSummary();
        ns.setId( notifier.getId() );
        ns.setType( notifier.getType() );
        ns.setProjectGroupId( projectGroupId );
        if ( project != null )
        {
            ns.setProjectId( project.getId() );
            ns.setProjectName( project.getName() );
        }

        if ( notifier.isFromProject() )
        {
            ns.setFromProject( true );
        }
        else
        {
            ns.setFromProject( false );
        }

        String recipient = GenerateRecipentNotifier.generate( notifier );

        ns.setRecipient( recipient );

        // XXX: Hack - just for testing :)
        StringBuffer sb = new StringBuffer();
        if ( notifier.isSendOnError() )
        {
            sb.append( "Error" );
        }
        if ( notifier.isSendOnFailure() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Failure" );
        }
        if ( notifier.isSendOnSuccess() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Success" );
        }
        if ( notifier.isSendOnWarning() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Warning" );
        }
        if ( notifier.isSendOnScmFailure() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "SCM Failure" );
        }
        ns.setEvents( sb.toString() );

        ns.setEnabled( notifier.isEnabled() );
        return ns;
    }
View Full Code Here

        List<NotifierSummary> summaryList = new ArrayList<NotifierSummary>();
        Project project = getContinuum().getProjectWithAllDetails( projectId );

        for ( ProjectNotifier pn : (List<ProjectNotifier>) project.getNotifiers() )
        {
            NotifierSummary ns = generateProjectNotifierSummary( pn, project );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here

        List<NotifierSummary> summaryList = new ArrayList<NotifierSummary>();
        projectGroup = getContinuum().getProjectGroupWithBuildDetails( projectGroupId );

        for ( ProjectNotifier pn : (List<ProjectNotifier>) projectGroup.getNotifiers() )
        {
            NotifierSummary ns = generateGroupNotifierSummary( pn );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here

     * @param notifier
     * @return
     */
    private NotifierSummary generateNotifierSummary( ProjectNotifier notifier, int projectGroupId, Project project )
    {
        NotifierSummary ns = new NotifierSummary();
        ns.setId( notifier.getId() );
        ns.setType( notifier.getType() );
        ns.setProjectGroupId( projectGroupId );
        if ( project != null )
        {
            ns.setProjectId( project.getId() );
            ns.setProjectName( project.getName() );
        }

        if ( notifier.isFromProject() )
        {
            ns.setFromProject( true );
        }
        else
        {
            ns.setFromProject( false );
        }

        // Source the recipient
        Map configuration = notifier.getConfiguration();

        String recipient = "unknown";

        if ( ( "mail".equals( notifier.getType() ) ) || ( "msn".equals( notifier.getType() ) ) ||
            ( "jabber".equals( notifier.getType() ) ) )
        {
            if ( StringUtils.isNotEmpty( (String) configuration.get( AbstractContinuumNotifier.ADDRESS_FIELD ) ) )
            {
                recipient = (String) configuration.get( AbstractContinuumNotifier.ADDRESS_FIELD );
            }
            if ( StringUtils.isNotEmpty( (String) configuration.get( AbstractContinuumNotifier.COMMITTER_FIELD ) ) )
            {
                if ( Boolean.parseBoolean( (String) configuration.get( AbstractContinuumNotifier.COMMITTER_FIELD ) ) )
                {
                    if ( "unknown".equals( recipient ) )
                    {
                        recipient = "latest committers";
                    }
                    else
                    {
                        recipient += ", " + "latest committers";
                    }
                }
            }
        }

        if ( "irc".equals( notifier.getType() ) )
        {
            recipient = (String) configuration.get( "host" );

            if ( configuration.get( "port" ) != null )
            {
                recipient = recipient + ":" + (String) configuration.get( "port" );
            }

            recipient = recipient + ":" + (String) configuration.get( "channel" );
        }

        if ( "wagon".equals( notifier.getType() ) )
        {
            recipient = (String) configuration.get( "url" );
        }

        ns.setRecipient( recipient );

        // XXX: Hack - just for testing :)
        StringBuffer sb = new StringBuffer();
        if ( notifier.isSendOnError() )
        {
            sb.append( "Error" );
        }
        if ( notifier.isSendOnFailure() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Failure" );
        }
        if ( notifier.isSendOnSuccess() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Success" );
        }
        if ( notifier.isSendOnWarning() )
        {
            if ( sb.length() > 0 )
            {
                sb.append( '/' );
            }
            sb.append( "Warning" );
        }
        ns.setEvents( sb.toString() );

        ns.setEnabled( notifier.isEnabled() );
        return ns;
    }
View Full Code Here

        List summaryList = new ArrayList();
        Project project = getContinuum().getProjectWithAllDetails( projectId );

        for ( Iterator i = project.getNotifiers().iterator(); i.hasNext(); )
        {
            NotifierSummary ns = generateProjectNotifierSummary( (ProjectNotifier) i.next(), project );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here

        List summaryList = new ArrayList();
        projectGroup = getContinuum().getProjectGroupWithBuildDetails( projectGroupId );

        for ( Iterator i = projectGroup.getNotifiers().iterator(); i.hasNext(); )
        {
            NotifierSummary ns = generateGroupNotifierSummary( (ProjectNotifier) i.next() );
            summaryList.add( ns );
        }

        return summaryList;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.continuum.web.model.NotifierSummary

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.