Coverage Report - org.kuali.rice.ksb.messaging.PersistedMessagePayload
 
Classes in this File Line Coverage Branch Coverage Complexity
PersistedMessagePayload
0%
0/21
0%
0/2
1.2
 
 1  
 /*
 2  
  * Copyright 2007-2008 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.ksb.messaging;
 17  
 
 18  
 import java.io.Serializable;
 19  
 
 20  
 import javax.persistence.Basic;
 21  
 import javax.persistence.Column;
 22  
 import javax.persistence.Entity;
 23  
 import javax.persistence.FetchType;
 24  
 import javax.persistence.Id;
 25  
 import javax.persistence.Lob;
 26  
 import javax.persistence.Table;
 27  
 import javax.persistence.Transient;
 28  
 
 29  
 import org.kuali.rice.ksb.service.KSBServiceLocator;
 30  
 
 31  
 /**
 32  
  * Holds message payload content.  Needed to proxy the content so we don't have to 
 33  
  * take the hit when grabbing large amounts of persisted messages at time.
 34  
  * 
 35  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 36  
  *
 37  
  */
 38  
 @Entity
 39  
 @Table(name="KRSB_MSG_PYLD_T")
 40  
 public class PersistedMessagePayload implements Serializable {
 41  
     
 42  
     private static final long serialVersionUID = 508778527504899029L;
 43  
     
 44  
     @Id
 45  
         @Column(name="MSG_QUE_ID")
 46  
         private Long routeQueueId;
 47  
     @Lob
 48  
         @Basic(fetch=FetchType.LAZY)
 49  
         @Column(name="MSG_PYLD", length=4000)
 50  
         private String payload;
 51  
     @Transient
 52  
     private AsynchronousCall methodCall;
 53  
     @Transient
 54  
     private PersistedMessage message;
 55  
     
 56  0
     public PersistedMessagePayload() {}
 57  
     
 58  0
     public PersistedMessagePayload (AsynchronousCall methodCall, PersistedMessage message) {
 59  0
         this.setPayload(KSBServiceLocator.getMessageHelper().serializeObject(methodCall));
 60  0
         this.methodCall = methodCall;
 61  0
         this.message = message;
 62  0
     }
 63  
     
 64  
     public String getPayload() {
 65  0
         return this.payload;
 66  
     }
 67  
     public void setPayload(String payload) {
 68  0
         this.payload = payload;
 69  0
     }
 70  
     public Long getRouteQueueId() {
 71  0
         return this.routeQueueId;
 72  
     }
 73  
     public void setRouteQueueId(Long routeQueueId) {
 74  0
         this.routeQueueId = routeQueueId;
 75  0
     }
 76  
     public AsynchronousCall getMethodCall() {
 77  0
         if (this.methodCall != null) {
 78  0
             return this.methodCall;
 79  
         } 
 80  0
         this.methodCall = (AsynchronousCall)KSBServiceLocator.getMessageHelper().deserializeObject(getPayload());
 81  0
         return this.methodCall;
 82  
     }
 83  
 
 84  
     public PersistedMessage getMessage() {
 85  0
         return this.message;
 86  
     }
 87  
 
 88  
     public void setMessage(PersistedMessage message) {
 89  0
         this.message = message;
 90  0
     }
 91  
 
 92  
     public void setMethodCall(AsynchronousCall methodCall) {
 93  0
         this.methodCall = methodCall;
 94  0
     }
 95  
     
 96  
 
 97  
 }
 98