Giter VIP home page Giter VIP logo

Comments (5)

demsey avatar demsey commented on September 25, 2024 1

@ar Could you see the updated commit demsey/jPOS@7d1dbe463?
Unfortunately, I already know why it is still not ready for the public repository - My solution breaks the possibility of using different TLV sizes (tag, length) in the packager configuration. It only supports fixed T=2, L=3 (which suits me)

To solve this, more radical action is needed. Introduction of the tagSize and lenSize attributes at the GenericTaggedFieldsPackager level and abandoning the use of TLV suited packagers in GenericTaggedFieldsPackager such as org.jpos.iso.IFA_TTLLCHAR, org.jpos.iso.IFA_TTLLBINARY in favor of generic org.jpos.iso.IFA_CHAR, org.jpos.iso.IFA_BINARY, org.jpos.iso.IFA_BINARY,

Instead actual

  <isofieldpackager
      id="48"
      length="999"
      name="Additional Data Private Use"
      class="org.jpos.iso.IFA_LLLCHAR"
      tagMapper="org.jpos.iso.packager.TTDecimalTagMapper"
      packager="org.jpos.iso.packager.GenericTaggedFieldsPackager">
      <isofield
          id="1"
          length="29"
          name="Some ascii value 1"
          class="org.jpos.iso.IFA_TTLLCHAR"/>
      <isofield
          id="2"
          length="12"
          name="Some binary value 2"
          class="org.jpos.iso.IFA_TTLLBINARY"/>
      <isofield
          id="3"
          length="8"
          name="Some ascii value 3"
          class="org.jpos.iso.IFA_TTLLCHAR"/>
  </isofieldpackager>

we get:

  <isofieldpackager
      id="48"
      length="999"
      name="Additional Data Private Use"
      class="org.jpos.iso.IFA_LLLCHAR"
      tagMapper="org.jpos.iso.packager.TTDecimalTagMapper"
      tagSize="2", lenSize="2"
      packager="org.jpos.iso.packager.GenericTaggedFieldsPackager">
      <isofield
          id="1"
          length="29"
          name="Some ascii value 1"
          class="org.jpos.iso.IFA_CHAR"/>
      <isofield
          id="2"
          length="12"
          name="Some binary value 2"
          class="org.jpos.iso.IFA_BINARY"/>
      <isofield
          id="3"
          length="8"
          name="Some ascii value 3"
          class="org.jpos.iso.IFA_CHAR"/>
  </isofieldpackager>

This description is much more consistent (does not allow mixing tag types, that are not allowed in TLV datasets)
Also is possible to introduce swapTagAndLen="true" attribute to emulate packagers family like org.jpos.iso.IFA_LLTTCHAR

Ultimately, you can get rid of all packagers families like IFA_TTLLCHAR, IFA_TTLLLCHAR, IFA_TTTLLLCHAR, IFA_LLTTCHAR, IFA_LLLTTCHAR and so on...

from jpos.

ar avatar ar commented on September 25, 2024

Do you have this solution running? Can you send a PR?

from jpos.

demsey avatar demsey commented on September 25, 2024

Yes, this solution has been in production since 2016, but we have recently withdrawn to the stock 686be85 commit.
I can clean up the https://github.com/demsey/jPOS/commits/tlvfield branch and make PR.

Any suggestions for class names: org.jpos.tlv.TagMap, org.jpos.tlv.Tag ?
I think that package org.jpos.tlv is ok, but I don't like the class names

from jpos.

ar avatar ar commented on September 25, 2024

TagMap and Tag look OK to me, we can always change it later and break some code :) :)

from jpos.

ar avatar ar commented on September 25, 2024

I like where this is heading. The swapTagAndLen would be great, I have TLV and LTV custom implementations here and there. Wonder if you want to commit a work-around the 100% CPU usage issue first, until we can work on this further.

from jpos.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.