4 * Copyright 2015 TJ <hacker@iam.tj>.
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 package uk.ac.ntu.n0521366.wsyd.libs.message;
26 import uk.ac.ntu.n0521366.wsyd.libs.WSYD_Member;
29 * A specialised message containing a WSYD_Member.
31 * @author TJ <hacker@iam.tj>
33 public class MessageMember extends MessageAbstract {
35 public static enum STATE {UNREGISTERED, REGISTERED};
36 private static final String _type = "WSYD_Member";
38 private WSYD_Member _member;
39 private STATE _registered;
40 private String _status;
42 public static String getType() {
47 public String getMessageType() {
51 public MessageMember(WSYD_Member member, STATE registered, String status) {
53 _registered = registered;
57 public MessageMember(WSYD_Member member) {
58 this(member, STATE.UNREGISTERED, null);
61 public MessageMember() {
62 this(null, STATE.UNREGISTERED, null);
66 * Get the Member contained in this message.
70 public WSYD_Member getMember() {
75 * Current registration state of the member record contained in this message.
79 public STATE getRegistered() {
84 * Update the registration state of the member record contained in this message.
88 public void setRegistered(STATE registered) {
89 _registered = registered;
93 * Get registration status message.
97 public String getStatus() {
102 * Set registration status message.
104 * ServerSocial may set this with text describing why a registration failed.
107 public void setStatus(String status) {