public static void writeNotificationList(List<Notification> list, ObjectOutput out) throws IOException { out.writeInt( list.size() ); for( Notification item : list ) { // item.getNotificationType().toString() is never null out.writeUTF( item.getNotificationType().toString() ); item.writeExternal( out ); } }
public static List<Notification> readNotificationList(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); List<Notification> list = new ArrayList<Notification>(size); for ( int i = 0; i < size; i++ ) { Notification item = null; switch( NotificationType.valueOf( in.readUTF() ) ) { case Default : { item = new NotificationImpl(); break; } case Email : { item = new EmailNotificationImpl(); break; } } item.readExternal( in ); list.add( item ); } return list; }
assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
if(notifications != null) { for(Notification notification : notifications) { List<? extends OrganizationalEntity> recipients = notification.getRecipients(); if(recipients != null) { for(OrganizationalEntity recipient : recipients) { List<? extends OrganizationalEntity> administrators = notification.getBusinessAdministrators(); if(administrators != null) { for(OrganizationalEntity administrator : administrators) { if(notifications != null) { for(Notification notification : notifications) { List<? extends OrganizationalEntity> recipients = notification.getRecipients(); if(recipients != null) { for(OrganizationalEntity recipient : recipients) { List<? extends OrganizationalEntity> administrators = notification.getBusinessAdministrators(); if(administrators != null) { for(OrganizationalEntity administrator : administrators) {
if (notification.getNotificationType() == NotificationType.Email) {
assertEquals(4, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals("mary", notification.getRecipients().get(1).getId()); assertEquals("sales", notification.getRecipients().get(2).getId()); assertEquals("hr", notification.getRecipients().get(3).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
for (Escalation escalation : deadline.getEscalations()) { for (Notification notification : escalation.getNotifications()) { if (notification.getNotificationType() == NotificationType.Email) { logger.debug("Sending an Email"); NotificationListenerManager.get().broadcast(new NotificationEvent(notification, task, variables), userInfo);
assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText()); assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
public static void writeNotificationList(List<Notification> list, ObjectOutput out) throws IOException { out.writeInt( list.size() ); for( Notification item : list ) { // item.getNotificationType().toString() is never null out.writeUTF( item.getNotificationType().toString() ); item.writeExternal( out ); } }
public static List<Notification> readNotificationList(ObjectInput in) throws IOException, ClassNotFoundException { int size = in.readInt(); List<Notification> list = new ArrayList<Notification>(size); for ( int i = 0; i < size; i++ ) { Notification item = null; switch( NotificationType.valueOf( in.readUTF() ) ) { case Default : { item = new NotificationImpl(); break; } case Email : { item = new EmailNotificationImpl(); break; } } item.readExternal( in ); list.add( item ); } return list; }
assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
assertEquals(4, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals("mary", notification.getRecipients().get(1).getId()); assertEquals("sales", notification.getRecipients().get(2).getId()); assertEquals("hr", notification.getRecipients().get(3).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());
assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText()); assertEquals(1, notification.getRecipients().size()); assertEquals("john", notification.getRecipients().get(0).getId()); assertEquals(1, notification.getSubjects().size()); assertEquals("Test of notification", notification.getSubjects().get(0).getText());