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.api.KsbApiServiceLocator; |
19 | |
import org.kuali.rice.ksb.api.messaging.AsynchronousCall; |
20 | |
|
21 | |
import javax.persistence.*; |
22 | |
import java.io.Serializable; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
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 | |
|