View Javadoc
1   package com.foxinmy.weixin4j.socket;
2   
3   import java.io.Serializable;
4   import java.util.Set;
5   
6   import com.foxinmy.weixin4j.type.AccountType;
7   import com.foxinmy.weixin4j.type.EncryptType;
8   import com.foxinmy.weixin4j.util.AesToken;
9   
10  /**
11   * 消息传递
12   * 
13   * @className WeixinMessageTransfer
14   * @author jinyu(foxinmy@gmail.com)
15   * @date 2015年6月23日
16   * @since JDK 1.6
17   * @see
18   */
19  public class WeixinMessageTransfer implements Serializable {
20  
21  	private static final long serialVersionUID = 7779948135156353261L;
22  
23  	/**
24  	 * aes & token
25  	 */
26  	private AesToken aesToken;
27  	/**
28  	 * 加密类型
29  	 */
30  	private EncryptType encryptType;
31  	/**
32  	 * 消息接收方
33  	 */
34  	private String toUserName;
35  	/**
36  	 * 消息发送方
37  	 */
38  	private String fromUserName;
39  	/**
40  	 * 账号
41  	 */
42  	private AccountType accountType;
43  	/**
44  	 * 消息类型
45  	 */
46  	private String msgType;
47  	/**
48  	 * 事件类型
49  	 */
50  	private String eventType;
51  	/**
52  	 * 节点集合
53  	 */
54  	private Set<String> nodeNames;
55  
56  	public WeixinMessageTransfer(AesToken aesToken, EncryptType encryptType,
57  			String toUserName, String fromUserName, AccountType accountType,
58  			String msgType, String eventType, Set<String> nodeNames) {
59  		this.aesToken = aesToken;
60  		this.encryptType = encryptType;
61  		this.toUserName = toUserName;
62  		this.fromUserName = fromUserName;
63  		this.accountType = accountType;
64  		this.msgType = msgType;
65  		this.eventType = eventType;
66  		this.nodeNames = nodeNames;
67  	}
68  
69  	public AesToken getAesToken() {
70  		return aesToken;
71  	}
72  
73  	public EncryptType getEncryptType() {
74  		return encryptType;
75  	}
76  
77  	public String getToUserName() {
78  		return toUserName;
79  	}
80  
81  	public String getFromUserName() {
82  		return fromUserName;
83  	}
84  
85  	public AccountType getAccountType() {
86  		return accountType;
87  	}
88  
89  	public String getMsgType() {
90  		return msgType;
91  	}
92  
93  	public String getEventType() {
94  		return eventType;
95  	}
96  
97  	public Set<String> getNodeNames() {
98  		return nodeNames;
99  	}
100 
101 	@Override
102 	public String toString() {
103 		return "WeixinMessageTransfer [aesToken=" + aesToken + ", encryptType="
104 				+ encryptType + ", toUserName=" + toUserName
105 				+ ", fromUserName=" + fromUserName + ", accountType="
106 				+ accountType + ", msgType=" + msgType + ", eventType="
107 				+ eventType + ", nodeNames=" + nodeNames + "]";
108 	}
109 }