Package jifx.commons.messages

Examples of jifx.commons.messages.IMessage


    msg.setElement("62", "0017001");

    return msg;
  }
  public static IMessage createPOSResponse(String id) {
    IMessage msg = new ISOJPOSMessage();
    msg.setElement("0", "0210");
    msg.setElement("3", "000000");
    msg.setElement("4", "000000001800");
    msg.setElement("7", "1223094851");
    msg.setElement("11",  String.format("%06d", Integer.valueOf(id)));
    msg.setElement("24", "0001");
    msg.setElement("25", "00");
    msg.setElement("37", "97320");
    msg.setElement("38", "48113");
    msg.setElement("39", "00");
    msg.setElement("41", "11111110");
    msg.setElement("42", "201105190001");
    msg.setElement("46", "0000000000000000000000000000");
    msg.setElement("48", "000");
    msg.setElement("49", "858");
    return msg;
  }
View Full Code Here


  private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd hh:MM:ss");
 
  public IMessage makeResponse(Context ctx, boolean commited) {
    if (commited) {
      String id = (String) ctx.get("ClientTerminalSeqId");
      IMessage msg = IFXMessageFactory.createMessageATMResponse(id);
     
      /*Object tmp = ctx.get("BankSvcRq.DebitAddRq.CustId.CardLogicalData.CardEmbossNum"); if (tmp != null) { msg.setElement("BankSvcRs.DebitAddRs.CustId.CardLogicalData.CardEmbossNum", tmp.toString()); }
     
      tmp = ctx.get("BankSvcRq.DebitAddRq.DebitInfo.CompositeCurAmt.CurAmt.Amt"); if (tmp != null) { msg.setElement("BankSvcRs.DebitAddRs.DebitInfo.CompositeCurAmt.CurAmt.Amt", tmp.toString()); }
     
View Full Code Here

      logger.debug(connectorIFX.getChannelName()+"| Cliente conectado: "+session.getRemoteAddress()+"|");
   
  }

  public void messageReceived(IoSession session, Object message) {
    IMessage im = (IMessage) message;
    if (logger.isDebugEnabled())
      logger.debug(connectorIFX.getChannelName()+"|Mensaje recibido: |"+message);
    connectorIFX.messageProcessTM(im);
  }
View Full Code Here


public class IFXProtocolEncoder implements ProtocolEncoder {

  public void encode(IoSession arg0, Object arg1, ProtocolEncoderOutput out) throws Exception {
    IMessage message = (IMessage) arg1;
        ByteBuffer buf = ByteBuffer.allocate(512);
        buf.setAutoExpand(true); // Enable auto-expand for easier encoding
       
        buf.put(message.toString().getBytes());
        buf.flip();
        out.write(buf);   
  }
View Full Code Here

   * know where to send the response. When a message comes
   * as a response to a message, its remove from the table.
   * @param msg
   */
  public void onMessage(Message msg) {
    IMessage message = null;
    try {
      message = (IMessage) ((ObjectMessage)msg).getObject();
      String owner = msg.getStringProperty("owner");
      MessageID idMsg = new MessageID(messageIDInfo, message);
      String tv = null;
View Full Code Here

 
  /* (non-Javadoc)
   * @see jifx.connection.configurator.ejb.ILink#sendReceiveMessage(jifx.commons.messages.IMessage)
   */
  public IMessage sendReceiveMessage(IMessage message) throws ComunicationException {
    IMessage iMsg = null;
    long initialTime = System.currentTimeMillis();
    long currentTime = initialTime;
    Context jndiContext = null;
    LinkFactory linkLocate = LinkFactory.getFactory();

View Full Code Here

  /* (non-Javadoc)
   * @see jifx.connection.configurator.ejb.ILink#sendMessage(jifx.commons.messages.IMessage)
   */
  public IMessage sendMessage(IMessage message) {
    IMessage iMsg = null;
    Context jndiContext = null;

    try {
      Hashtable<String, String> env = new Hashtable<String, String>();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.NamingContextFactory");
View Full Code Here

   * Method invoked when a message is received by the transaction manager.
   * @param message: message received by the TM and wants to be
   */
  private void onMessage(Message message) {
    try {     
      IMessage m = (IMessage)((ObjectMessage)message).getObject();
      if (logger.isDebugEnabled())
        logger.debug(tmInformation.getIdtrn()+"|Mensaje recibido por el Trans.Manager|"+m.toString());
      TransactionInformation ti = tmInformation.getTransactionInformation(m);
      String trnName = tmInformation.getIdtrn()+"-" + new GregorianCalendar().getTimeInMillis();
      Transaction trn = new Transaction(trnName, ti , message.getStringProperty("connection"));
     
      AttributeChangeNotificationFilter nf = new AttributeChangeNotificationFilter();
View Full Code Here

  }

  @Override
  public void messageReceived(IoSession session, Object message) {
    try {
      IMessage im = (IMessage) message;
      MessageID msgId = new MessageID(messageIDInfo, im);
      registerSession(msgId, session);
      if (logger.isDebugEnabled())
        logger.debug(session.getAttachment()+"|Mensaje recibido: |"+message);
      server.messageProcessTM(im);
View Full Code Here


public class ISOProtocolEncoder implements ProtocolEncoder {

  public void encode(IoSession arg0, Object arg1, ProtocolEncoderOutput out) throws Exception {
    IMessage message = (IMessage) arg1;
        ByteBuffer buf = ByteBuffer.allocate(512);
        buf.setAutoExpand(true); // Enable auto-expand for easier encoding
       
        buf.put((message.toString()+"\r\n").getBytes());
        buf.flip();
        out.write(buf);   
  }
View Full Code Here

TOP

Related Classes of jifx.commons.messages.IMessage

Copyright © 2018 www.massapicom. 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.