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 org.kuali.rice.ksb.api.KsbApiServiceLocator;
 19  
 import org.kuali.rice.ksb.api.messaging.AsynchronousCall;
 20  
 
 21  
 import javax.persistence.*;
 22  
 import java.io.Serializable;
 23  
 
 24  
 /**
 25  
  * Holds message payload content.  Needed to proxy the content so we don't have to 
 26  
  * take the hit when grabbing large amounts of persisted messages at time.
 27  
  * 
 28  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 29  
  *
 30  
  */
 31  
 @Entity
 32  
 @Table(name="KRSB_MSG_PYLD_T")
 33  
 public class PersistedMessagePayload implements Serializable {
 34  
     
 35  
     private static final long serialVersionUID = 508778527504899029L;
 36  
     
 37  
     @Id
 38  
         @Column(name="MSG_QUE_ID")
 39  
         private Long routeQueueId;
 40  
     @Lob
 41  
         @Basic(fetch=FetchType.LAZY)
 42  
         @Column(name="MSG_PYLD", length=4000)
 43  
         private String payload;
 44  
     @Transient
 45  
     private AsynchronousCall methodCall;
 46  
     @Transient
 47  
     private PersistedMessageBO message;
 48  
     
 49  0
     public PersistedMessagePayload() {}
 50  
     
 51  0
     public PersistedMessagePayload (AsynchronousCall methodCall, PersistedMessageBO message) {
 52  0
         this.setPayload(KsbApiServiceLocator.getMessageHelper().serializeObject(methodCall));
 53  0
         this.methodCall = methodCall;
 54  0
         this.message = message;
 55  0
     }
 56  
     
 57  
     public String getPayload() {
 58  0
         return this.payload;
 59  
     }
 60  
     public void setPayload(String payload) {
 61  0
         this.payload = payload;
 62  0
     }
 63  
     public Long getRouteQueueId() {
 64  0
         return this.routeQueueId;
 65  
     }
 66  
     public void setRouteQueueId(Long routeQueueId) {
 67  0
         this.routeQueueId = routeQueueId;
 68  0
     }
 69  
     public AsynchronousCall getMethodCall() {
 70  0
         if (this.methodCall != null) {
 71  0
             return this.methodCall;
 72  
         } 
 73  0
         this.methodCall = (AsynchronousCall) KsbApiServiceLocator.getMessageHelper().deserializeObject(getPayload());
 74  0
         return this.methodCall;
 75  
     }
 76  
 
 77  
     public PersistedMessageBO getMessage() {
 78  0
         return this.message;
 79  
     }
 80  
 
 81  
     public void setMessage(PersistedMessageBO message) {
 82  0
         this.message = message;
 83  0
     }
 84  
 
 85  
     public void setMethodCall(AsynchronousCall methodCall) {
 86  0
         this.methodCall = methodCall;
 87  0
     }
 88  
     
 89  
 
 90  
 }
 91