Examples of Message


Examples of org.vosao.business.mq.Message

      getDao().getPluginDao().save(plugin);
    }
  }

  private void updatePages() {
    Message msg = new SimpleMessage(PageTitleUpdate.class);
    getBusiness().getMessageQueue().publish(msg);
  }
View Full Code Here

Examples of org.vraptor.i18n.Message

                        if (msg instanceof FixedMessage) {
                            FixedMessage m = (FixedMessage) msg;
                            String content = bundle.getString(m.getKey());
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else if (msg instanceof Message) {
                            Message m = (Message) msg;
                            String content = bundle.getString(m.getKey());
                            content = MessageFormat.format(content, new Object[]{m.getParameters()});
                            errors.add(new FixedMessage(msg.getPath(), content, msg.getCategory()));
                        } else {
                            throw new IllegalArgumentException("Unsupported validation message type: " + msg.getClass().getName());
                        }
                    }
View Full Code Here

Examples of org.waveprotocol.pst.model.Message

        String templateName = properties.hasTemplateName() ?
            properties.getTemplateName() : "";
        StringTemplateGroup group = new StringTemplateGroup(groupName + "Group", dir(template));
        StringTemplate st = group.getInstanceOf(groupName);
        for (Descriptor messageDescriptor : fd.getMessageTypes()) {
          Message message = new Message(messageDescriptor, templateName, properties);
          st.reset();
          st.setAttribute("m", message);
          write(st, new File(
              outputDir.getPath() + File.separator +
              message.getFullJavaType().replace('.', File.separatorChar) + "." +
              (properties.hasFileExtension() ? properties.getFileExtension() : "java")));
        }
      } catch (Exception e) {
        exceptions.add(new PstException.TemplateException(template.getPath(), e));
      }
View Full Code Here

Examples of org.wicketstuff.iolite.persistence.domain.Message

public class DaoTest extends TestSupport {

  private Logger log = Logger.getLogger(DaoTest.class);

  public void testIsSomethingWorking() {
    Message message = new Message("Hello world");
    generalRepository.add(message);
   
    assertEquals(1, generalRepository.getAll(Message.class).size());
  }
View Full Code Here

Examples of org.wijiscommons.ssaf.message.Message

         
          // Create a MessageID
          String messageID = IDGeneratorUtility.getNextMessageID();
         
          // Create a Message Object
          Message message = new MessageImpl();
          Calendar cal = Calendar.getInstance();
          cal.setTimeInMillis(currentFiles.get(fileName));
          message.setFolderArrivalTimestamp(cal);
          message.setFolderSource(folderName);
          message.setIncomingMessageXML(XMLToStringConversionUtility.convertXMLFileToString(fileName));
          message.setMessageID(messageID);
          try {
            SSAFMessageReceivalProcess mr = new MessageReceivalImpl();
            boolean isExecuted = mr.receiveMessage(message);
            if (isExecuted)
            {
View Full Code Here

Examples of org.wso2.carbon.event.core.Message

//            ActivityEvent<MessageContext> event = null;
//            event = new ActivityThresholdEvent<MessageContext>(eventMsgCtx);
//            ((ActivityThresholdEvent<MessageContext>) event).setResourcePath(ActivityPublisherConstants.BAM_REG_PATH);
//            EventBrokerService<MessageContext> ebs = PublisherUtils.getEventBrokerService();
            EventBroker eb = PublisherUtils.getEventBroker();
            Message message = new Message();
            message.setMessage(eventBody);

            try {
                SuperTenantCarbonContext.startTenantFlow();
                int tenantId = SuperTenantCarbonContext.getCurrentContext(PublisherUtils.getConfigurationContext()).getTenantId();
                SuperTenantCarbonContext.getCurrentContext().setTenantId(tenantId);
View Full Code Here

Examples of org.wso2.carbon.registry.social.api.message.Message

     * @param msgResource The registry resource to retrieve message attributes from
     * @param fields      The attributes of the message to be set
     * @return
     */
    private Message getPropertiesAddedMessageOjb(Resource msgResource, Set<String> fields) {
        Message messageObj = new MessageImpl();
        for (String field : fields) {
            if (SocialImplConstants.MSG_APP_URL.equalsIgnoreCase(field.trim())) {
                messageObj.setAppUrl(msgResource.getProperty(SocialImplConstants.MSG_APP_URL));
            } else if (SocialImplConstants.MSG_BODY.equalsIgnoreCase(field.trim())) {
                messageObj.setBody(msgResource.getProperty(SocialImplConstants.MSG_BODY));
            } else if (SocialImplConstants.MSG_BODY_ID.equalsIgnoreCase(field.trim())) {
                messageObj.setBodyId(msgResource.getProperty(SocialImplConstants.MSG_BODY_ID));
            } else if (SocialImplConstants.MSG_ID.equalsIgnoreCase(field.trim())) {
                messageObj.setId(msgResource.getProperty(SocialImplConstants.MSG_ID));
            } else if (SocialImplConstants.MSG_IN_REPLY_TO.equalsIgnoreCase(field.trim())) {
                messageObj.setInReplyTo(
                        msgResource.getProperty(SocialImplConstants.MSG_IN_REPLY_TO));
            } else if (SocialImplConstants.MSG_SENDER_ID.equalsIgnoreCase(field.trim())) {
                messageObj.setSenderId(msgResource.getProperty(SocialImplConstants.MSG_SENDER_ID));
            } else if (SocialImplConstants.MSG_STATUS.equalsIgnoreCase(field.trim())) {
                messageObj.setStatus(Message.Status.valueOf(
                        msgResource.getProperty(SocialImplConstants.MSG_STATUS)));
            } else if (SocialImplConstants.MSG_TIME_SENT.equalsIgnoreCase(field.trim())) {
                messageObj.setTimeSent(new Date(Long.valueOf(
                        msgResource.getProperty(SocialImplConstants.MSG_TIME_SENT))));
            } else if (SocialImplConstants.MSG_TITLE.equalsIgnoreCase(field.trim())) {
                messageObj.setTitle(msgResource.getProperty(SocialImplConstants.MSG_TITLE));
            } else if (SocialImplConstants.MSG_TITLE_ID.equalsIgnoreCase(field.trim())) {
                messageObj.setTitleId(msgResource.getProperty(SocialImplConstants.MSG_TITLE_ID));
            } else if (SocialImplConstants.MSG_TYPE.equalsIgnoreCase(field.trim())) {
                messageObj.setType(Message.Type.valueOf(
                        msgResource.getProperty(SocialImplConstants.MSG_TYPE)));
            } else if (SocialImplConstants.MSG_UPDATED.equalsIgnoreCase(field.trim())) {
                messageObj.setUpdated(new Date(Long.valueOf(
                        msgResource.getProperty(SocialImplConstants.MSG_UPDATED))));
            }
        }


View Full Code Here

Examples of org.wso2.carbon.registry.synchronization.message.Message

        if (!isCollection && file.exists()) {
            fileAlreadyExist = true;
            // File already exists, we are asking whether we will skip the file or overwrite it.
            // The default behaviour is to overwrite.
            if (callback != null &&
                    !callback.getConfirmation(new Message(
                            MessageCode.FILE_OVERWRITE_CONFIRMATION,
                            new String[]{filePath}),
                            SynchronizationConstants.OVERWRITE_CONFIRMATION_CONTEXT)) {
                overwrite = false;
            }
        }
        try {
            // Create file if it does not exist
            if (isCollection) {
                boolean ignore = file.mkdir(); // ignores the return value purposely
            } else if (overwrite) {
                boolean ignore = file.createNewFile(); // ignores the return value purposely
            }
        } catch (IOException e) {
            throw new SynchronizationException(MessageCode.FILE_CREATION_FAILED, e,
                    new String[]{
                            "file: " + filePath});
        }

        // we are extracting the content from the meta element.
        Iterator children = root.getChildren();
        while (children.hasNext()) {
            OMElement child = (OMElement) children.next();
            String localName = child.getLocalName();

            // LastModified
            if (localName.equals("lastModified")) {
                OMText text = (OMText) child.getFirstOMChild();
                if (text != null) {
                    long date = Long.parseLong(text.getText());
                    // We are not bothered whether this failed to set the last-modified time. If we
                    // cannot modify the file, we would fail when attempting to write to it anyway.
                    boolean ignore = file.setLastModified(date);
                }
            }
            // get content
            else if (localName.equals("content")) {
                OMText text = (OMText) child.getFirstOMChild();
                // we keep content as base64 encoded
                if (text != null) {
                    contentBytes = Base64.decode(text.getText());
                }
                String md5 = Utils.getMD5(contentBytes);
                root.addAttribute("md5", md5, null);
                child.detach();
            }
        }

        if (!isCollection && overwrite) {
            try {
                FileOutputStream fileStream = null;
                try {
                    fileStream = new FileOutputStream(file);
                    fileStream.write(contentBytes);
                    fileStream.flush();
                } finally {
                    if (fileStream != null) {
                        fileStream.close();
                    }
                }
            } catch (IOException e) {
                throw new SynchronizationException(MessageCode.PROBLEM_IN_CREATING_CONTENT,
                        e,
                        new String[]{"file: " + filePath});
            }
        }

        String parentDirName = file.getParent();
        // creating the meta directory
        String metaDirectoryName;
        if (isCollection) {
            metaDirectoryName = filePath + File.separator + SynchronizationConstants.META_DIRECTORY;
        } else {
            metaDirectoryName =
                    parentDirName + File.separator + SynchronizationConstants.META_DIRECTORY;
        }
        File metaDirectory = new File(metaDirectoryName);
        if (!metaDirectory.exists() && !metaDirectory.mkdir()) {
            throw new SynchronizationException(MessageCode.ERROR_CREATING_META_FILE,
                    new String[]{"file: " + metaDirectoryName});
        }

        // creating the meta file
        String metaFilePath;
        if (isCollection) {
            metaFilePath = filePath + File.separator + SynchronizationConstants.META_DIRECTORY +
                    File.separator +
                    SynchronizationConstants.META_FILE_PREFIX +
                    SynchronizationConstants.META_FILE_EXTENSION;
        } else {
            metaFilePath =
                    parentDirName + File.separator + SynchronizationConstants.META_DIRECTORY +
                            File.separator + SynchronizationConstants.META_FILE_PREFIX +
                            Utils.encodeResourceName(name) +
                            SynchronizationConstants.META_FILE_EXTENSION;
        }
        Utils.createMetaFile(metaFilePath, root);

        // printing out the information of the file
        if (!fileAlreadyExist) {
            if (callback != null) {
                callback.displayMessage(new Message(MessageCode.ADDED, new String[]{filePath}));
            }
            addedCount++;
        } else {
            if (overwrite) {
                if (callback != null) {
                    callback.displayMessage(
                            new Message(MessageCode.OVERWRITTEN, new String[]{filePath}));
                }
                overwrittenCount++;
            } else {
                if (callback != null) {
                    callback.displayMessage(
                            new Message(MessageCode.NON_OVERWRITTEN, new String[]{filePath}));
                }
                nonOverwrittenCount++;
            }
        }
View Full Code Here

Examples of org.wso2.carbon.rulecep.adapters.Message

            BaseXPath baseXPath = resourceDescription.getExpression();
            if (baseXPath != null) {
                name = baseXPath.toString();
            }
        }
        Message fact = null;
        if (tobeAdapted instanceof Boolean) {
            if (((Boolean) tobeAdapted).booleanValue()) {
                fact = new Message();
            }
        } else if (tobeAdapted instanceof String) {
            if (Boolean.parseBoolean((String) tobeAdapted)) {
                fact = new Message();
            }
        } else if (tobeAdapted instanceof OMText) {
            OMText omText = (OMText) tobeAdapted;
            if (Boolean.parseBoolean(omText.getText())) {
                fact = new Message();
            }
        } else if (tobeAdapted instanceof OMElement) {
            fact = new Message((OMElement) tobeAdapted, resourceDescription.getXPathCache());
        }
        if (fact != null && name != null) {
            fact.setName(name);
        }
        return fact;
    }
View Full Code Here

Examples of org.xbill.DNS.Message

      DataOutputStream dataOut;
      dataOut = new DataOutputStream(s.getOutputStream());
      int id = query.getHeader().getID();
      while (it.hasNext()) {
        RRset rrset = (RRset) it.next();
        Message response = new Message(id);
        Header header = response.getHeader();
        header.setFlag(Flags.QR);
        header.setFlag(Flags.AA);
        addRRset(rrset.getName(), response, rrset, Section.ANSWER, FLAG_DNSSECOK);
        if (tsig != null) {
          tsig.applyStream(response, qtsig, first);
          qtsig = response.getTSIG();
        }
        first = false;
        byte[] out = response.toWire();
        dataOut.writeShort(out.length);
        dataOut.write(out);
      }
    } catch (IOException ex) {
      log.warn("AXFR failed", ex);
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.