Examples of Notification


Examples of javax.management.Notification

            }
        }

        public void failed(ObjectName objectName) {
            if (mbeanGBeanName.equals(objectName)) {
                notificationBroadcaster.sendNotification(new Notification(NotificationType.STATE_FAILED, objectName, nextSequence()));
            }
        }
View Full Code Here

Examples of javax.management.Notification

            }
        }

        public void unloaded(ObjectName objectName) {
            if (mbeanGBeanName.equals(objectName)) {
                notificationBroadcaster.sendNotification(new Notification(NotificationType.OBJECT_DELETED, objectName, nextSequence()));
            }
        }
View Full Code Here

Examples of ke.go.moh.oec.reception.data.Notification

                        + new SimpleDateFormat("dd/MM/yyyy").format(person.getLastMoveDate()) + ".";
            } else {
                additionalInformation = this.getLongName() + " migrated from an unspecified village to '"
                        + this.getVillageName() + "' village on an unspecified date.";
            }
            notificationList.add(new Notification(this, Notification.Type.MIGRATION, person.getLastMoveDate(), additionalInformation));
        }
        if (person.getExpectedDeliveryDate() != null) {
            String additionalInformation = "";
            additionalInformation = this.getLongName() + " is pregnant. Her expected delivery date is "
                    + new SimpleDateFormat("dd/MM/yyyy").format(person.getExpectedDeliveryDate()) + ".";
            notificationList.add(new Notification(this, Notification.Type.PREGNANCY, person.getExpectedDeliveryDate(), additionalInformation));
        }
        if (person.getPregnancyEndDate() != null) {
            Person.PregnancyOutcome pregnancyOutcome = person.getPregnancyOutcome();
            String additionalInformation = this.getLongName();
            if (pregnancyOutcome != null) {
                if (pregnancyOutcome == Person.PregnancyOutcome.multipleBirths) {
                    additionalInformation = additionalInformation + " had multiple births";
                } else if (pregnancyOutcome == Person.PregnancyOutcome.singleBirth) {
                    additionalInformation = additionalInformation + " had a single birth";
                } else if (pregnancyOutcome == Person.PregnancyOutcome.stillBirth) {
                    additionalInformation = additionalInformation + " had a still birth";
                }
            } else {
                additionalInformation = additionalInformation + "'s pregnancy came to an unspecified end";
            }
            additionalInformation = additionalInformation + " on "
                    + new SimpleDateFormat("dd/MM/yyyy").format(person.getPregnancyEndDate()) + ".";
            notificationList.add(new Notification(this, Notification.Type.PREGNANCY_OUTCOME, person.getPregnancyEndDate(), additionalInformation));
        }
        if (person.getDeathdate() != null) {
            String additionalInformation = "";
            additionalInformation = this.getLongName() + " died on "
                    + new SimpleDateFormat("dd/MM/yyyy").format(person.getDeathdate()) + ".";
            notificationList.add(new Notification(this, Notification.Type.DEATH, person.getDeathdate(), additionalInformation));
        }
        return notificationList;
    }
View Full Code Here

Examples of models.Notification

          if(Content.ContentType.PHOTO == sharedContent.type) {
            ContentTag contentTag = new ContentTag(sharedContent.id, Content.ContentType.PHOTO, sharedTag);
            contentTag.save();
          }
        }
        Notification notification = new Notification();
        if(from.basic_information != null) {
          StringBuffer textSb = new StringBuffer();
          textSb.append(from.basic_information.firstName).append(" ").
          append(from.basic_information.lastName).append(" te ha enviado un mensaje.");
         
          if(sharedContents.size() > 0) {
            textSb.append(" Tiene ").append(sharedContents.size()).append(" contenidos.");
          }
          notification.message = textSb.toString();
         
        } else {
          notification.message =  "El administrador ha compartido contigo "
              + sharedContents.size() + " contenidos.";
        }
        notification.owner = receiver;
        notification.type = Notification.NotificationType.INBOX;
        notification.insert();
       
        // Creating a task for send an email with the notification.
        Queue queue = QueueFactory.getDefaultQueue();
        String residenceDomain = null;
        String username = Session.current().get(SessionConstants.USER);
View Full Code Here

Examples of net.cloudcodex.server.data.Data.Notification

    dao.save(null, note);
    return note;
  }
 
  private void createNotification(DAO dao, String message, Key to) {
    final Notification notification = new Notification();
    notification.setMessage(message);
    notification.setTo(to);
    notifications.add(notification);
  }
View Full Code Here

Examples of net.pterodactylus.util.notify.Notification

   */
  @Override
  protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
    super.processTemplate(request, templateContext);
    String notificationId = request.getHttpRequest().getPartAsStringFailsafe("notification", 36);
    Notification notification = webInterface.getNotifications().getNotification(notificationId);
    if ((notification != null) && notification.isDismissable()) {
      notification.dismiss();
    }
    String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 256);
    throw new RedirectException(returnPage);
  }
View Full Code Here

Examples of net.sf.libgrowl.Notification

        runner.executeScript(script);
      } catch (IOException e) {
        mLog.log(Level.SEVERE, "Can't execute AppleScript\n\n" + script, e);
      }
    } else {
      final Notification notification = new Notification(mApplication,
          mNotificationProgram, title, desc, program.getID());
      Icon icon = program.getChannel().getIcon();
      if (icon != null && icon instanceof ImageIcon) {
        try {
          File file = File.createTempFile("tvbrowser", ".png");
          file.deleteOnExit();
          if (IOUtilities.writeImageIconToFile((ImageIcon) icon, "png", file)) {
            notification.setIcon(file.getAbsolutePath());
          }
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
View Full Code Here

Examples of no.altinn.schemas.services.serviceengine.notification._2009._10.Notification

    ExternalContentV2 content = request.getContent();
    Assert.assertEquals( message.getMessageTitle(), content.getMessageTitle() );
    Assert.assertEquals( message.getMessageBody(), content.getMessageBody() );
    Assert.assertEquals( message.getMessageSummary(), content.getMessageSummary() );
    Assert.assertEquals( settings.getLanguageCode(), content.getLanguageCode() );
    Notification notification = request.getNotifications().getNotification().get( 0 );
    List<ReceiverEndPoint> receiverEndPoints = notification.getReceiverEndPoints().getReceiverEndPoint();
    for (ReceiverEndPoint receiverEndPoint : receiverEndPoints) {
      TransportType transportType = receiverEndPoint.getTransportType();
      if (TransportType.EMAIL.equals( transportType )) {
      } else if (TransportType.SMS.equals( transportType )) {
      } else {
View Full Code Here

Examples of org.apache.agila.services.notification.Notification

public class NotificationServiceImplTestCase extends TestCase{

    private NotificationServiceImpl notificationService;

    public void testCreateNew() {
        Notification notification = notificationService.createNew( new UserID( 1 ), "Hello World" );
       
        assertNotNull( "Notification should not be null.", notification );
        assertEquals( "UserID should be 1.", new UserID( 1 ), notification.getUserID() );
        assertEquals( "Message should be Hello World", "Hello World", notification.getMessage() );
        assertEquals( "Notification should be inserted into notification queue.", 1, notificationService.getForUserID( new UserID( 1 ) ).size() );
    }
View Full Code Here

Examples of org.apache.cocoon.Notification

        // Check if cocoon was initialized
        if (this.cocoon == null) {
            res.setStatus(res.SC_INTERNAL_SERVER_ERROR);

            Notification n = new Notification(this, this.exception);
            n.setType("internal-servlet-error");
            n.setTitle("Internal servlet error");
            n.setSource("Cocoon servlet");
            n.setMessage("Internal servlet error");
            n.setDescription("Cocoon was not initialized.");
            n.addExtraDescription("request-uri", request.getRequestURI());
            res.setContentType(Notifier.notify(n, res.getOutputStream()));;

            return;
        }

        // We got it... Process the request
        String uri = request.getServletPath();
        if (uri == null) {
            uri = "";
        }
        String pathInfo = request.getPathInfo();
        if (pathInfo != null) {
            uri += pathInfo;
        }

        if (uri.length() == 0) {
            /* empty relative URI
                 -> HTTP-redirect from /cocoon to /cocoon/ to avoid
                    StringIndexOutOfBoundsException when calling
                    "".charAt(0)
               else process URI normally
            */
            String prefix = request.getRequestURI();

            if (prefix == null) {
                prefix = "";
            }

            res.sendRedirect(res.encodeRedirectURL(prefix + "/"));
            return;
        }

        String contentType = null;
        try {
            if (uri.charAt(0) == '/') {
                uri = uri.substring(1);
            }

            Environment env = this.getEnvironment(uri, request, res);

            // Initialize a fresh log context containing the object model : it
            // will be used by the CocoonLogFormatter
            ContextMap ctxMap = org.apache.log.ContextMap.getCurrentContext();
            ctxMap.clear();
            // Add thread name (default content for empty context)
            String threadName = Thread.currentThread().getName();
            ctxMap.set("threadName", threadName);
            // Add the object model
            ctxMap.set("objectModel", env.getObjectModel());
            // Add a unique request id (threadName + currentTime
            ctxMap.set("request-id", threadName + System.currentTimeMillis());

            if (this.cocoon.process(env)) {
                contentType = env.getContentType();
            } else {
                // means SC_NOT_FOUND
                res.sendError(res.SC_NOT_FOUND);

                Notification n = new Notification(this);
                n.setType("resource-not-found");
                n.setTitle("Resource not found");
                n.setSource("Cocoon servlet");
                n.setMessage("Resource not found");
                n.setDescription("The requested URI \""
                                 + request.getRequestURI()
                                 + "\" was not found.");
                n.addExtraDescription("request-uri", request.getRequestURI());
                n.addExtraDescription("path-info", uri);
                // send the notification but don't include it in the output stream
                // as the status SC_NOT_FOUND is enough
                res.setContentType(Notifier.notify(n, (OutputStream)null));
            }
        } catch (ResourceNotFoundException rse) {
            if (log.isWarnEnabled()) {
                log.warn("The resource was not found", rse);
            }

            res.sendError(res.SC_NOT_FOUND);
            Notification n = new Notification(this);
            n.setType("resource-not-found");
            n.setTitle("Resource not found");
            n.setSource("Cocoon servlet");
            n.setMessage("Resource not found");
            n.setDescription("The requested URI \""
                             + request.getRequestURI()
                             + "\" was not found.");
            n.addExtraDescription("request-uri", request.getRequestURI());
            n.addExtraDescription("path-info", uri);
            // send the notification but don't include it in the output stream
            // as the status SC_NOT_FOUND is enough
            res.setContentType(Notifier.notify(n, (OutputStream)null));
        } catch (ConnectionResetException cre) {
            if (log.isWarnEnabled()) {
                log.warn("The connection was reset", cre);
            }

            Notification n = new Notification(this);
            n.setType("resource-not-found");
            n.setTitle("Resource not found");
            n.setSource("Cocoon servlet");
            n.setMessage("Resource not found");
            n.setDescription("The requested URI \""
                             + request.getRequestURI()
                             + "\" was not found.");
            n.addExtraDescription("request-uri", request.getRequestURI());
            n.addExtraDescription("path-info", uri);
            // send the notification but don't include it in the output stream
            // as the connection was reset anyway
            res.setContentType(Notifier.notify(n, (OutputStream)null));
        } catch (Exception e) {
            if (log.isErrorEnabled()) {
                log.error("Problem with servlet", e);
            }
            //res.setStatus(res.SC_INTERNAL_SERVER_ERROR);
            Notification n = new Notification(this, e);
            n.setType("internal-server-error");
            n.setTitle("Internal server error");
            n.setSource("Cocoon servlet");
            n.addExtraDescription("request-uri", request.getRequestURI());
            n.addExtraDescription("path-info", uri);
            res.setContentType(contentType = Notifier.notify(n, res.getOutputStream()));
        }

        long end = System.currentTimeMillis();
        String timeString = processTime(end - start);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.