| 1 package com.quikj.application.web.talk.plugin; 2 3 import com.quikj.server.framework.*; 4 import com.quikj.server.web.*; 5 import com.quikj.application.web.talk.messaging.*; 6 7 public class MessageEvent implements AceMessageInterface 8 { 9 public static final int CLIENT_REQUEST_MESSAGE = 1; public static final int CLIENT_RESPONSE_MESSAGE = 2; public static final int REGISTRATION_REQUEST = 3; 12 public static final int REGISTRATION_RESPONSE = 4; 13 public static final int SETUP_REQUEST = 5; 14 public static final int SETUP_RESPONSE = 6; 15 public static final int RTP_MESSAGE = 7; 16 public static final int DISCONNECT_MESSAGE = 8; 17 18 public MessageEvent(int event_type, 19 EndPointInterface from, 20 int response_status, 21 String reason, 22 TalkMessageInterface message, 23 Object user_parm, 24 int request_id) 25 { 26 eventType = event_type; 27 this.from = from; 28 responseStatus = response_status; 29 this.reason = reason; 30 this.message = message; 31 userParm = user_parm; 32 requestId = request_id; 33 } 34 35 public MessageEvent(int event_type, 36 EndPointInterface from, 37 int response_status, 38 String reason, 39 TalkMessageInterface message, 40 Object user_parm) 41 { 42 this (event_type, 43 from, 44 response_status, 45 reason, 46 message, 47 user_parm, 48 -1); 49 } 50 51 public MessageEvent(int event_type, 52 EndPointInterface from, 53 TalkMessageInterface message, 54 Object user_parm, 55 int request_id) 56 { 57 this(event_type, 58 from, 59 0, 60 null, 61 message, 62 user_parm, 63 request_id); 64 } 65 66 public MessageEvent(int event_type, 67 EndPointInterface from, 68 TalkMessageInterface message, 69 Object user_parm) 70 { 71 this(event_type, 72 from, 73 message, 74 user_parm, 75 -1); 76 } 77 78 public int getEventType() 79 { 80 return eventType; 81 } 82 83 public EndPointInterface getFrom() 84 { 85 return from; 86 } 87 88 public TalkMessageInterface getMessage() 89 { 90 return message; 91 } 92 93 94 public int getResponseStatus() 95 { 96 return responseStatus; 97 } 98 99 public String getReason() 100 { 101 return reason; 102 } 103 104 public String messageType() 105 { 106 return MESSAGE_TYPE; 107 } 108 109 public Object getUserParm() 110 { 111 return userParm; 112 } 113 114 public boolean isRequest() 115 { 116 if (responseStatus == 0) 117 { 118 return true; 119 } 120 else 121 { 122 return false; 123 } 124 } 125 126 public int getRequestId() 127 { 128 return requestId; 129 } 130 131 private static final String MESSAGE_TYPE = "TalkMessageEvent"; 132 133 private int eventType; 134 private EndPointInterface from; 135 private int responseStatus = 0; 136 private String reason; 137 private TalkMessageInterface message; 138 private Object userParm; 139 private int requestId = -1; 140 } 141 142 143 144 145 146 147 148 149 150 151 152 | Popular Tags |