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