| 1 |  |  | 
            
  
    | 2 |  |  | 
            
  
    | 3 |  |  | 
            
  
    | 4 |  |  | 
            
  
    | 5 |  |  | 
            
  
    | 6 |  |  | 
            
  
    | 7 |  |  | 
            
  
    | 8 |  |  | 
            
  
    | 9 |  |  | 
            
  
    | 10 |  |  | 
            
  
    | 11 |  |  | 
            
  
    | 12 |  |  | 
            
  
    | 13 |  |  | 
            
  
    | 14 |  |  | 
            
  
    | 15 |  |  | 
            
  
    | 16 |  |  | 
            
  
    | 17 |  |  | 
            
  
    | 18 |  |  | 
            
  
    | 19 |  |  | 
            
  
    | 20 |  |  | 
            
  
    | 21 |  |  | 
            
  
    | 22 |  |  | 
            
  
    | 23 |  |  | 
            
  
    | 24 |  |  | 
            
  
    | 25 |  |  | 
            
  
    | 26 |  |  | 
            
  
    | 27 |  |  | 
            
  
    | 28 |  |  | 
            
  
    | 29 |  |  | 
            
  
    | 30 |  |  | 
            
  
    | 31 |  |  | 
            
  
    | 32 |  | package net.sourceforge.pebble.event.response; | 
            
  
    | 33 |  |  | 
            
  
    | 34 |  | import net.sourceforge.pebble.domain.Response; | 
            
  
    | 35 |  | import net.sourceforge.pebble.api.event.comment.CommentEvent; | 
            
  
    | 36 |  | import net.sourceforge.pebble.api.event.trackback.TrackBackEvent; | 
            
  
    | 37 |  | import org.apache.commons.logging.Log; | 
            
  
    | 38 |  | import org.apache.commons.logging.LogFactory; | 
            
  
    | 39 |  |  | 
            
  
    | 40 |  |  | 
            
  
    | 41 |  |  | 
            
  
    | 42 |  |  | 
            
  
    | 43 |  | @author | 
            
  
    | 44 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 33 (33) | Complexity: 10 | Complexity Density: 0,5 |  | 
  
  
    | 45 |  | public class DeleteRejectedListener extends BlogEntryResponseListenerSupport { | 
            
  
    | 46 |  |  | 
            
  
    | 47 |  |  | 
            
  
    | 48 |  | private static final Log log = LogFactory.getLog(DeleteRejectedListener.class); | 
            
  
    | 49 |  |  | 
            
  
    | 50 |  |  | 
            
  
    | 51 |  |  | 
            
  
    | 52 |  |  | 
            
  
    | 53 |  |  | 
            
  
    | 54 |  | @param | 
            
  
    | 55 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 5 (5) | Complexity: 2 | Complexity Density: 0,67 |  | 
  
  
    | 56 | 0 |  public void commentAdded(CommentEvent event) {... | 
            
  
    | 57 | 0 | super.commentAdded(event); | 
            
  
    | 58 | 0 | if (event.getComment().isRejected()) { | 
            
  
    | 59 | 0 | event.veto(); | 
            
  
    | 60 |  | } | 
            
  
    | 61 |  | } | 
            
  
    | 62 |  |  | 
            
  
    | 63 |  |  | 
            
  
    | 64 |  |  | 
            
  
    | 65 |  |  | 
            
  
    | 66 |  | @param | 
            
  
    | 67 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0,5 |  | 
  
  
    | 68 | 0 |  public void commentRejected(CommentEvent event) {... | 
            
  
    | 69 | 0 | super.commentRejected(event); | 
            
  
    | 70 | 0 | event.veto(); | 
            
  
    | 71 |  | } | 
            
  
    | 72 |  |  | 
            
  
    | 73 |  |  | 
            
  
    | 74 |  |  | 
            
  
    | 75 |  |  | 
            
  
    | 76 |  | @param | 
            
  
    | 77 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 5 (5) | Complexity: 2 | Complexity Density: 0,67 |  | 
  
  
    | 78 | 0 |  public void trackBackAdded(TrackBackEvent event) {... | 
            
  
    | 79 | 0 | super.trackBackAdded(event); | 
            
  
    | 80 | 0 | if (event.getTrackBack().isRejected()) { | 
            
  
    | 81 | 0 | event.veto(); | 
            
  
    | 82 |  | } | 
            
  
    | 83 |  | } | 
            
  
    | 84 |  |  | 
            
  
    | 85 |  |  | 
            
  
    | 86 |  |  | 
            
  
    | 87 |  |  | 
            
  
    | 88 |  | @param | 
            
  
    | 89 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 2 (2) | Complexity: 1 | Complexity Density: 0,5 |  | 
  
  
    | 90 | 0 |  public void trackBackRejected(TrackBackEvent event) {... | 
            
  
    | 91 | 0 | super.trackBackRejected(event); | 
            
  
    | 92 | 0 | event.veto(); | 
            
  
    | 93 |  | } | 
            
  
    | 94 |  |  | 
            
  
    | 95 |  |  | 
            
  
    | 96 |  |  | 
            
  
    | 97 |  |  | 
            
  
    | 98 |  | @param | 
            
  
    | 99 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 4 (4) | Complexity: 2 | Complexity Density: 1 |  | 
  
  
    | 100 | 0 |  protected void blogEntryResponseAdded(Response response) {... | 
            
  
    | 101 | 0 | if (response.isRejected()) { | 
            
  
    | 102 | 0 | deleteRejectedResponse(response); | 
            
  
    | 103 |  | } | 
            
  
    | 104 |  | } | 
            
  
    | 105 |  |  | 
            
  
    | 106 |  |  | 
            
  
    | 107 |  |  | 
            
  
    | 108 |  |  | 
            
  
    | 109 |  | @param | 
            
  
    | 110 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 1 (1) | Complexity: 1 | Complexity Density: 1 |  | 
  
  
    | 111 | 0 |  protected void blogEntryResponseRejected(Response response) {... | 
            
  
    | 112 | 0 | deleteRejectedResponse(response); | 
            
  
    | 113 |  | } | 
            
  
    | 114 |  |  | 
            
  
    | 115 |  |  | 
            
  
    | 116 |  |  | 
            
  
    | 117 |  |  | 
               
        |  |  | 
           
           |  | 0% | Uncovered Elements: 7 (7) | Complexity: 1 | Complexity Density: 0,14 |  | 
  
  
    | 118 | 0 |  private void deleteRejectedResponse(Response response) {... | 
            
  
    | 119 | 0 | log.info("Deleting rejected response for " + response.getBlogEntry().getTitle()); | 
            
  
    | 120 | 0 | log.info(response.getTitle()); | 
            
  
    | 121 | 0 | log.info(response.getContent()); | 
            
  
    | 122 | 0 | log.info(response.getSourceName()); | 
            
  
    | 123 | 0 | log.info(response.getSourceLink()); | 
            
  
    | 124 | 0 | log.info(response.getIpAddress()); | 
            
  
    | 125 | 0 | response.getBlogEntry().removeResponse(response); | 
            
  
    | 126 |  | } | 
            
  
    | 127 |  |  | 
            
  
    | 128 |  | } |