blob: 63e35aa58e1346d01aea9227096901d7d8c3ef34 (
plain) (
tree)
|
|
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 SetMarker =7;
static final int SetPassword =8;
static final int PushMessage =100;
static final int PushLocation =101;
static final int PushMarker =102;
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
}
}
//--------------------------------------//
// Respond to set marker //
//--------------------------------------//
class ResSetMarker extends Res{
ResSetMarker(){
super(7); //for type 7
}
}
//--------------------------------------//
// Respond to set password //
//--------------------------------------//
class ResSetPassword extends Res{
ResSetPassword(){
super(8); //for type 8
}
}
//---------------------------------------------------------------------------------------------------//
//---------------------------------------------------------------------------------------------------//
//--------------------------------------//
// 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;
}
}
//--------------------------------------//
// Push Marker //
//--------------------------------------//
class ResPushMarker extends Res{
double latitude;
double longitude;
int deadline;
int level;
ResPushMarker(double lat,double lot,int dtime,int lv){
super(102); //for type 102
latitude = lat;
longitude = lot;
deadline = dtime;
level = lv;
}
}
|