1 18 package sync4j.server.notification; 19 20 import sync4j.framework.notification.*; 21 22 28 public class GenericNotificationMessageBuilder implements NotificationMessageBuilder { 29 30 31 33 34 public byte[] buildMessage(int sessionId, String phoneNumber, String serverId, 35 String serverPw, byte[] serverNonce, float dmProtocolVersion) 36 throws NotificationException { 37 38 TriggerHeaderNotificationMessage header = new TriggerHeaderNotificationMessage(); 39 header.setInitiator(header.INITIATOR_CLIENT); 40 header.setUiMode(header.UI_MODE_NOT_SPECIFIED); 41 header.setVersion(dmProtocolVersion); 42 43 header.setServerIdentifier(serverId); 44 45 header.setSessionId(sessionId); 46 47 DigestNotificationMessage digestMessage = new DigestNotificationMessage(); 48 digestMessage.setNonce(serverNonce); 49 digestMessage.setServerId(serverId); 50 digestMessage.setServerPw(serverPw); 51 52 58 59 TriggerNotificationMessage notificationMsg = new TriggerNotificationMessage(); 60 notificationMsg.setDigest(digestMessage); 61 notificationMsg.setHeader(header); 62 63 67 68 byte[] msg = notificationMsg.computeTriggerNotificationMessage(); 69 70 return msg; 71 } 72 73 74 } | Popular Tags |