summaryrefslogtreecommitdiff
path: root/client/Piztor/src/com/macaroon/piztor/Res.java
blob: 699de459f633567f21b870d9813a7214318e671d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
package com.macaroon.piztor;

import java.util.Vector;

public class Res{
	
	static final int Login =0;
	static final int Update =1;
	static final int UserInfo =2;
	static final int Subscription =3;
	static final int Logout =4;
	static final int StartPush =5;
	static final int SendMessage =6;
	static final int PushMessage =100;
	static final int PushLocation =101;	
	
	int type;
	Res(int t){
		type = t;
	}
}

//--------------------------------------//
//			Respond to login			//
//--------------------------------------//

class ResLogin extends Res{
	String t;	//user token
	RUserInfo uinfo;      //userinfo
	Vector<RGroup> sublist;   //list of users subscribed
	int subscribeNumber;   //number of users subscribed

	ResLogin(String token,RUserInfo rui,Vector<RGroup> slist,int subn){
		super(0);	//for type 0
		t = token;
		uinfo = rui;
		sublist = slist;
		subscribeNumber = subn;
	}
}

//--------------------------------------//
//		Respond to update location		//
//--------------------------------------//

class ResUpdate extends Res{

	ResUpdate(){
		super(1);	//for type 1
	}
}

//--------------------------------------//
//			Respond to User Info	    //
//--------------------------------------//

class ResUserInfo extends Res{
	int number;        //number of users
	Vector<RUserInfo> uinfo;

	ResUserInfo(int n,Vector<RUserInfo> rui){
		super(2);	//for type 2
		number = n;
		uinfo = rui;
	}
}

//--------------------------------------//
//	Respond to Update Subscription		//
//--------------------------------------//

class ResSubscription extends Res{

	ResSubscription(){
		super(3);	//for type 3
	}
}

//--------------------------------------//
//			Respond to logout			//
//--------------------------------------//

class ResLogout extends Res{

	ResLogout(){
		super(4);	//for type 4
	}
}

//--------------------------------------//
//		Respond to start push     		//
//--------------------------------------//

class ResStartPush extends Res{

	ResStartPush(){
		super(5);	//for type 5
	}
}

//--------------------------------------//
//			Respond to send Message    	//
//--------------------------------------//

class ResSendMessage extends Res{

	ResSendMessage(){
		super(6);	//for type 6
	}
}

//---------------------------------------------------------------------------------------------------//



//---------------------------------------------------------------------------------------------------//



//--------------------------------------//
//			Push Message    			//
//--------------------------------------//

class ResPushMessage extends Res{
	String message;

	ResPushMessage(String s){
		super(100);	//for type 100
		message = s;
	}
}

//--------------------------------------//
//			Push Location			    //
//--------------------------------------//

class ResPushLocation extends Res{
	Vector<RLocation> l;	//vector for location info
	int n;					//number of location info

	ResPushLocation(int num,Vector<RLocation> locationvec){
		super(101);	//for type 101
		l = locationvec;
		n = num;
	}
}