01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tctest.spring.bean;
05:
06: public class PersistentSubobject {
07:
08: public static final String NOT_SENT = "NotSent";
09:
10: public static final String QUEUED = "Queued";
11:
12: private static final String PENDING = "Pending";
13:
14: public static final String SENT = "Sent";
15:
16: public static final String FAILED = "Failed";
17:
18: public static final String DELIVERED = "Delivered";
19:
20: private int messageId;
21:
22: private String statusCode;
23:
24: private String smscMessageId;
25:
26: PersistentSubobject() {
27: }
28:
29: public PersistentSubobject(String code) {
30: statusCode = code;
31: }
32:
33: public PersistentSubobject(int messageId, String statusCode,
34: String smscMessageId) {
35: this .messageId = messageId;
36: this .statusCode = statusCode;
37: this .smscMessageId = smscMessageId;
38: }
39:
40: public int getMessageId() {
41: return messageId;
42: }
43:
44: public void noteQueued() {
45: this .statusCode = QUEUED;
46: }
47:
48: public boolean isSentOrDelivered() {
49: return statusCode.equals(SENT) || statusCode.equals(DELIVERED);
50: }
51:
52: public String getSMSCMessageId() {
53: return smscMessageId;
54: }
55:
56: public String getStatusCode() {
57: return statusCode;
58: }
59:
60: }
|