1 18 package sync4j.server.notification; 19 20 import java.util.logging.Logger ; 21 import java.util.logging.Level ; 22 23 import sync4j.framework.logging.Sync4jLogger; 24 import sync4j.framework.notification.Sender; 25 import sync4j.framework.notification.NotificationException; 26 27 28 36 public class SimpleSender implements Sender { 37 38 39 41 49 public void sendMessage(int messageType, 50 String phoneNumber, 51 byte[] message , 52 String info ) 53 throws NotificationException { 54 Logger log = Sync4jLogger.getLogger(); 55 56 if (log.isLoggable(Level.INFO)) { 57 log.info( "Send message(\n\tmessageType: " 58 + messageType 59 + "\n\tphoneNumber: " 60 + phoneNumber 61 + "\n\tmessage length: " 62 + ((message != null) ? String.valueOf(message.length) : "unknown") 63 + "\n\tinfo: " 64 + info 65 ); 66 } 67 } 68 69 77 public void sendMessages(int messageType, 78 String [] phoneNumbers, 79 byte[][] message, 80 String info) throws NotificationException { 81 Logger log = Sync4jLogger.getLogger(); 82 83 if (log.isLoggable(Level.INFO)) { 84 log.info( "Sends messages(\n\tmessageType: " 85 + messageType 86 + "\n\tnum. devices: " 87 + phoneNumbers.length 88 + "\n\tinfo: " 89 + info 90 ); 91 log.info("sendMessages with empty implementation"); 92 } 93 } 94 95 106 public void sendMessages(int messageType, 107 String contentType, 108 String [] digest, 109 int[] authMethods, 110 String [] phoneNumbers, 111 byte[][] messages, 112 String info) throws NotificationException { 113 114 } 115 116 117 118 } | Popular Tags |