1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.ksb.messaging; |
17 | |
|
18 | |
import org.kuali.rice.ksb.service.KSBServiceLocator; |
19 | |
|
20 | |
import javax.persistence.*; |
21 | |
import java.io.Serializable; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
@Entity |
31 | |
@Table(name="KRSB_MSG_PYLD_T") |
32 | |
public class PersistedMessagePayload implements Serializable { |
33 | |
|
34 | |
private static final long serialVersionUID = 508778527504899029L; |
35 | |
|
36 | |
@Id |
37 | |
@Column(name="MSG_QUE_ID") |
38 | |
private Long routeQueueId; |
39 | |
@Lob |
40 | |
@Basic(fetch=FetchType.LAZY) |
41 | |
@Column(name="MSG_PYLD", length=4000) |
42 | |
private String payload; |
43 | |
@Transient |
44 | |
private AsynchronousCall methodCall; |
45 | |
@Transient |
46 | |
private PersistedMessageBO message; |
47 | |
|
48 | 0 | public PersistedMessagePayload() {} |
49 | |
|
50 | 0 | public PersistedMessagePayload (AsynchronousCall methodCall, PersistedMessageBO message) { |
51 | 0 | this.setPayload(KSBServiceLocator.getMessageHelper().serializeObject(methodCall)); |
52 | 0 | this.methodCall = methodCall; |
53 | 0 | this.message = message; |
54 | 0 | } |
55 | |
|
56 | |
public String getPayload() { |
57 | 0 | return this.payload; |
58 | |
} |
59 | |
public void setPayload(String payload) { |
60 | 0 | this.payload = payload; |
61 | 0 | } |
62 | |
public Long getRouteQueueId() { |
63 | 0 | return this.routeQueueId; |
64 | |
} |
65 | |
public void setRouteQueueId(Long routeQueueId) { |
66 | 0 | this.routeQueueId = routeQueueId; |
67 | 0 | } |
68 | |
public AsynchronousCall getMethodCall() { |
69 | 0 | if (this.methodCall != null) { |
70 | 0 | return this.methodCall; |
71 | |
} |
72 | 0 | this.methodCall = (AsynchronousCall)KSBServiceLocator.getMessageHelper().deserializeObject(getPayload()); |
73 | 0 | return this.methodCall; |
74 | |
} |
75 | |
|
76 | |
public PersistedMessageBO getMessage() { |
77 | 0 | return this.message; |
78 | |
} |
79 | |
|
80 | |
public void setMessage(PersistedMessageBO message) { |
81 | 0 | this.message = message; |
82 | 0 | } |
83 | |
|
84 | |
public void setMethodCall(AsynchronousCall methodCall) { |
85 | 0 | this.methodCall = methodCall; |
86 | 0 | } |
87 | |
|
88 | |
|
89 | |
} |
90 | |
|