Examples of Message


Examples of org.quna.rsc.data.message.Message

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jTextField5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField5ActionPerformed
        String message = jTextField5.getText ();
        Message msg = new Message (message, Date.from (Instant.now ()), "asdf", MessageType.MESSAGE);
        ByteBuffer buffer = StringByteBufferConverter.ByteBufferFromString (msg.toString ()) ;
        try {
            socket.write (buffer);
        } catch (IOException ex) {
            Logger.getLogger (ClientFrame.class.getName())
                .log (Level.SEVERE, null, ex);
View Full Code Here

Examples of org.rhq.coregui.client.util.message.Message

                public void onSuccess(Subject checked) {
                    Log.info("Successfully registered LDAP subject '" + checked + "'.");
                    checked.setSessionId(Integer.valueOf(populatedForm.getValueAsString(SESSIONID)));

                    CoreGUI.getMessageCenter().notify(
                        new Message(MSG.view_login_registerLdapSuccess(), Message.Severity.Info));
                    window.destroy();
                    loginShowing = false;
                    //indicate to login callback success
                    callback.onSuccess(checked);
                }
View Full Code Here

Examples of org.richfaces.javascript.Message

    protected String getJavaScriptFunctionName() {
        return "sendMessage";
    }

    protected Message getErrorMessage() {
        return new Message(2, "error summary", "error description");
    }
View Full Code Here

Examples of org.rzo.yajsw.controller.Message

  static final CharsetEncoder  encoder  = Charset.defaultCharset().newEncoder();

  @Override
  protected Object encode(ChannelHandlerContext ctx, Channel channel, Object message) throws Exception
  {
    Message m = (Message) message;
    ChannelBuffer buffer = buffer(m.getMessage().length() + 2);
    buffer.writeByte(m.getCode());
    buffer.writeBytes(encoder.encode(CharBuffer.wrap(m.getMessage())));
    buffer.writeByte((byte) 0);
    // System.out.println("encode " + buffer.toString("UTF-8"));
    return buffer;
  }
View Full Code Here

Examples of org.sbml.jsbml.util.Message

   * @param level
   * @param version
   */
  public SBMLTypeUndefinedException(Class<?> clazz, int level, int version) {
    super();
    Message message = new Message();
    message.setMessage(MessageFormat.format(
      "The element \"{0}\" is not defined in SBML Level {1,number,integer} Version {2,number,integer}.",
      clazz.getSimpleName(), level, version));
    setMessage(message);
  }
View Full Code Here

Examples of org.smslib.Message

        tfr.setSkipBlanksAndComment(false);
       
        tfr.init("java/org/ajwcc/pduUtils/testData/testMessages.txt");
        String currentLine;
       
        Message message = null;
       
        ArrayList<String> expectedPdus = new ArrayList<String>();
       
        main: while ((currentLine = tfr.next()) != null)
        {
            if (currentLine.trim().equals(""))
            {
                System.out.println(currentLine);
            }
            else if (currentLine.trim().startsWith("#"))
            {
                System.out.println(currentLine);
            }
            else
            {
                String[] data = new String[2];
                int colon = currentLine.indexOf(':');
                data[0] = currentLine.substring(0, colon);
                data[1] = currentLine.substring(colon+1);
               
                if (data[0].equals("messageType"))
                {
                    message = (Message) Class.forName(data[1]).newInstance();
                    testCount++;
                }
                else if (data[0].equals("messageEnd"))
                {
                    if (message!=null)
                    {
                        // display pdus
                        List<String> pdus = ((OutboundMessage) message).getPdus(smscNo, 123 );
   
                        StringBuffer sb = new StringBuffer();
                        for( String pduString  : pdus )
                        {
                            Pdu pdu = new PduParser().parsePdu(pduString);
                           
                            System.out.println(pdu);
                           
                            if (message instanceof OutboundBinaryMessage)
                            {
                                sb.append(PduUtils.bytesToPdu(pdu.getUserDataAsBytes()));
                            }
                            else if (message instanceof OutboundMessage)
                            {
                                sb.append(pdu.getDecodedText());
                            }
                        }
                        System.out.println("EXPECTED PDUs   : "+expectedPdus.size());
                        System.out.println("GENERATED PDUs  : "+pdus.size());
                       
                        if (message instanceof OutboundBinaryMessage)
                        {
                            OutboundBinaryMessage bin = (OutboundBinaryMessage) message;
                            System.out.println("EXPECTED BYTES : "+PduUtils.bytesToPdu(bin.getDataBytes()));
                            System.out.println("GENERATED BYTES: "+sb.toString());    
                           
                            boolean match = sb.toString().equals(PduUtils.bytesToPdu(bin.getDataBytes()));
                            System.out.println("MATCH: "+match);                              
                            if (match) passCount++;
                        }
                        else if (message instanceof OutboundMessage)
                        {
                            System.out.println("EXPECTED TEXT : "+message.getText());
                            System.out.println("GENERATED TEXT: "+sb.toString());  
                           
                            boolean match = sb.toString().equals(message.getText());
                            System.out.println("MATCH: "+match);  
                            if (match) passCount++;
                        }                           
                    }
                   
                    System.out.println();
                    expectedPdus.clear();
                    message = null;
                    smscNo = "";
                }
                else if (data[0].equals("encoding"))
                {
                    if (data[1].equals("7"))
                    {
                        ((OutboundMessage) message).setEncoding(MessageEncodings.ENC7BIT);
                    }
                    else if (data[1].equals("8"))
                    {
                        ((OutboundMessage) message).setEncoding(MessageEncodings.ENC8BIT);                   
                    }
                    else if (data[1].equals("ucs2"))
                    {
                        ((OutboundMessage) message).setEncoding(MessageEncodings.ENCUCS2);                   
                    }
                }
                else if (data[0].equals("expectedPdu"))
                {
                    expectedPdus.add(data[1]);
                }
                else if (data[0].equals("smscNumber"))
                {
                    smscNo = data[1];
                }
                else if (data[0].equals("dataBytes"))
                {
                    ((OutboundBinaryMessage) message).setDataBytes(PduUtils.pduToBytes(data[1]));
                }
                else
                {
                    // reflection
                        // retrieve method getter for data[0]
                        // get return type
                    Class<?> currentClass = message.getClass();
                    while(currentClass!=Object.class)
                    {
                        try
                        {
                            Method getter = message.getClass().getMethod("get"+Character.toUpperCase(data[0].charAt(0))+data[0].substring(1));
                            Class<?> returnType = getter.getReturnType();

                                // retrieve setter for data[0]
                                    // invoke with the data[1] based on type
                            Method setter = currentClass.getDeclaredMethod("set"+Character.toUpperCase(data[0].charAt(0))+data[0].substring(1), returnType);
View Full Code Here

Examples of org.sonar.server.exceptions.Message

    assertThat(context.getPage()).isEqualTo(1);
  }

  private void checkBadRequestException(Exception e, String key, Object... params) {
    BadRequestException exception = (BadRequestException) e;
    Message msg = exception.errors().messages().get(0);
    assertThat(msg.getKey()).isEqualTo(key);
    assertThat(msg.getParams()).containsOnly(params);
  }
View Full Code Here

Examples of org.spout.api.protocol.Message

  @SuppressWarnings ({"unchecked", "rawtypes"})
  public void testMessageEncoding() throws IOException {
    for (Message message : testMessages) {
      MessageCodec codec = codecLookup.find(message.getClass());
      ByteBuf encoded;
      Message decoded;
      try {
        encoded = codec.encodeToServer(message);
        decoded = codec.decodeFromClient(encoded);
      } catch (Throwable t) {
        t.printStackTrace();
View Full Code Here

Examples of org.springbyexample.schema.beans.response.Message

    @RequestMapping(value = SAVE_REQUEST, method = RequestMethod.POST)
    public ProfessionalResponse create(@RequestBody Professional request) {
        logger.info("Save Professional.  id={}", request.getId());

        return new ProfessionalResponse().withMessageList(
                    new Message().withMessageType(MessageType.INFO)
                                 .withMessage(String.format("Successfully saved record.  id='%d'", request.getId())))
                    .withResults(request);
    }
View Full Code Here

Examples of org.springframework.amqp.core.Message

            String routingKey = routingKeyHeader != null ? routingKeyHeader : endpoint.routingKey;

            try {
                if(exchange.getPattern().isOutCapable()) {
                    LOG.debug("Synchronous send and request for exchange {}", exchange.getExchangeId());
                    Message amqpResponse = endpoint.getAmqpTemplate().sendAndReceive(endpoint.exchangeName, routingKey, inMessage.toAMQPMessage(msgConverter));
                    SpringAMQPMessage camelResponse = SpringAMQPMessage.fromAMQPMessage(msgConverter, amqpResponse);

                    Boolean isExceptionCaught = (Boolean)camelResponse.getHeader(SpringAMQPMessage.IS_EXCEPTION_CAUGHT);
                    if (isExceptionCaught != null && isExceptionCaught.equals(Boolean.TRUE)) {
                        Object caughtObject = camelResponse.getBody();
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.