responseindexlistener.java

### File Source: responseindexlistener.java

             /*
        P/P   *  Method: net.sourceforge.pebble.index.ResponseIndexListener__static_init
              */
         1  package net.sourceforge.pebble.index;
         2
         3  import net.sourceforge.pebble.domain.Comment;
         4  import net.sourceforge.pebble.domain.TrackBack;
         5  import net.sourceforge.pebble.api.event.comment.CommentEvent;
         6  import net.sourceforge.pebble.api.event.comment.CommentListener;
         7  import net.sourceforge.pebble.api.event.trackback.TrackBackEvent;
         8  import net.sourceforge.pebble.api.event.trackback.TrackBackListener;
         9
        10  /**
        11   * Listens to comment/TrackBack events and keeps the response index up to date.
        12   *
        13   * @author    Simon Brown
        14   */
             /*
        P/P   *  Method: void net.sourceforge.pebble.index.ResponseIndexListener()
              */
        15  public class ResponseIndexListener implements CommentListener, TrackBackListener {
        16
        17    /**
        18     * Called when a comment has been added.
        19     *
        20     * @param event a CommentEvent instance
        21     */
        22    public void commentAdded(CommentEvent event) {
                 /*
        P/P       *  Method: void commentAdded(CommentEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).name != null
                  *
                  *  Presumptions:
                  *    comment.blogEntry@23 != null
                  *    comment.date@23 != null
                  *    comment.state@23 != null
                  *    getBlogEntry(...).blog@23 != null
                  *    getBlog(...).responseIndex@23 != null
                  *    ...
                  */
        23      Comment comment = event.getComment();
        24      comment.getBlogEntry().getBlog().getResponseIndex().index(comment);
        25    }
        26
        27    /**
        28     * Called when a comment has been removed.
        29     *
        30     * @param event a CommentEvent instance
        31     */
        32    public void commentRemoved(CommentEvent event) {
                 /*
        P/P       *  Method: void commentRemoved(CommentEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *
                  *  Presumptions:
                  *    comment.blogEntry@33 != null
                  *    comment.date@33 != null
                  *    getBlogEntry(...).blog@33 != null
                  *    net.sourceforge.pebble.api.event.comment.CommentEvent:getSource(...)@72 != null
                  *    getBlog(...).responseIndex@33 != null
                  *    ...
                  */
        33      Comment comment = event.getComment();
        34      comment.getBlogEntry().getBlog().getResponseIndex().unindex(comment);
        35    }
        36
        37    /**
        38     * Called when a comment has been approved.
        39     *
        40     * @param event a CommentEvent instance
        41     */
        42    public void commentApproved(CommentEvent event) {
                 /*
        P/P       *  Method: void commentApproved(CommentEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).name != null
                  *
                  *  Presumptions:
                  *    comment.blogEntry@43 != null
                  *    comment.blogEntry@44 != null
                  *    comment.date@43 != null
                  *    comment.date@44 != null
                  *    comment.state@44 != null
                  *    ...
                  */
        43      Comment comment = event.getComment();
        44      comment.getBlogEntry().getBlog().getResponseIndex().unindex(comment);
        45      comment.getBlogEntry().getBlog().getResponseIndex().index(comment);
        46    }
        47
        48    /**
        49     * Called when a comment has been rejected.
        50     *
        51     * @param event a CommentEvent instance
        52     */
        53    public void commentRejected(CommentEvent event) {
                 /*
        P/P       *  Method: void commentRejected(CommentEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).name != null
                  *
                  *  Presumptions:
                  *    comment.blogEntry@54 != null
                  *    comment.blogEntry@55 != null
                  *    comment.date@54 != null
                  *    comment.date@55 != null
                  *    comment.state@55 != null
                  *    ...
                  */
        54      Comment comment = event.getComment();
        55      comment.getBlogEntry().getBlog().getResponseIndex().unindex(comment);
        56      comment.getBlogEntry().getBlog().getResponseIndex().index(comment);
        57    }
        58
        59    /**
        60     * Called when a TrackBack has been added.
        61     *
        62     * @param event a TrackBackEvent instance
        63     */
        64    public void trackBackAdded(TrackBackEvent event) {
                 /*
        P/P       *  Method: void trackBackAdded(TrackBackEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).name != null
                  *
                  *  Presumptions:
                  *    getBlogEntry(...).blog@65 != null
                  *    net.sourceforge.pebble.api.event.trackback.TrackBackEvent:getSource(...)@72 != null
                  *    trackBack.blogEntry@65 != null
                  *    trackBack.date@65 != null
                  *    trackBack.state@65 != null
                  *    ...
                  */
        65      TrackBack trackBack = event.getTrackBack();
        66      trackBack.getBlogEntry().getBlog().getResponseIndex().index(trackBack);
        67    }
        68
        69    /**
        70     * Called when a TrackBack has been removed.
        71     *
        72     * @param event a TrackBackEvent instance
        73     */
        74    public void trackBackRemoved(TrackBackEvent event) {
                 /*
        P/P       *  Method: void trackBackRemoved(TrackBackEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *
                  *  Presumptions:
                  *    getBlogEntry(...).blog@75 != null
                  *    net.sourceforge.pebble.api.event.trackback.TrackBackEvent:getSource(...)@72 != null
                  *    trackBack.blogEntry@75 != null
                  *    trackBack.date@75 != null
                  *    getBlog(...).responseIndex@75 != null
                  *    ...
                  */
        75      TrackBack trackBack = event.getTrackBack();
        76      trackBack.getBlogEntry().getBlog().getResponseIndex().unindex(trackBack);
        77    }
        78
        79    /**
        80     * Called when a TrackBack has been approved.
        81     *
        82     * @param event a TrackBackEvent instance
        83     */
        84    public void trackBackApproved(TrackBackEvent event) {
                 /*
        P/P       *  Method: void trackBackApproved(TrackBackEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).name != null
                  *
                  *  Presumptions:
                  *    getBlogEntry(...).blog@85 != null
                  *    getBlogEntry(...).blog@86 != null
                  *    net.sourceforge.pebble.api.event.trackback.TrackBackEvent:getSource(...)@72 != null
                  *    trackBack.blogEntry@85 != null
                  *    trackBack.blogEntry@86 != null
                  *    ...
                  */
        85      TrackBack trackBack = event.getTrackBack();
        86      trackBack.getBlogEntry().getBlog().getResponseIndex().unindex(trackBack);
        87      trackBack.getBlogEntry().getBlog().getResponseIndex().index(trackBack);
        88    }
        89
        90    /**
        91     * Called when a TrackBack has been rejected.
        92     *
        93     * @param event a TrackBackEvent instance
        94     */
        95    public void trackBackRejected(TrackBackEvent event) {
                 /*
        P/P       *  Method: void trackBackRejected(TrackBackEvent)
                  *
                  *  Preconditions:
                  *    event != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#1).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#2).name != null
                  *    (soft) net.sourceforge.pebble.domain.State__static_init.new State(State__static_init#3).name != null
                  *
                  *  Presumptions:
                  *    getBlogEntry(...).blog@96 != null
                  *    getBlogEntry(...).blog@97 != null
                  *    net.sourceforge.pebble.api.event.trackback.TrackBackEvent:getSource(...)@72 != null
                  *    trackBack.blogEntry@96 != null
                  *    trackBack.blogEntry@97 != null
                  *    ...
                  */
        96      TrackBack trackBack = event.getTrackBack();
        97      trackBack.getBlogEntry().getBlog().getResponseIndex().unindex(trackBack);
        98      trackBack.getBlogEntry().getBlog().getResponseIndex().index(trackBack);
        99    }
       100
       101  }

SofCheck Inspector Build Version : 2.22510

responseindexlistener.java | 2010-Jun-25 19:40:32
responseindexlistener.class | 2010-Jul-19 20:23:38