[SNMP4J] SNMP4J and CORBA "Any" class

Matthias Wiesmann matthias.wiesmann at gmail.com
Mon Jan 16 12:44:57 CET 2006


On 16/01/06, Marco.Bresciani at alcatel.it <Marco.Bresciani at alcatel.it> wrote:
> Matthias Wiesmann <matthias.wiesmann at gmail.com>
> 15/01/2006 01.46
>
>         To:     Marco BRESCIANI/IT/ALCATEL at ALCATEL
>         cc:
>         Subject:        Re: [SNMP4J] SNMP4J and CORBA "Any" class
> >If I understad well you code should un-marshall SNMP traps and
> >transport the data further on using CORBA? There are multiple ways to
>
> Yes. That's right. Actually it seems CORBA is not used anymor as
> "transport layer" but it's simply going to be a common and standard
> container... Anyway I think I should use it again...
>
> >put SNMP data into a CORBA Any, technically, you could put the bytes
> >from the BER encoded values into the Any. I doubt you want this, but
> >it all depends on the format the final application expects.
>
> Uhm... Could you please explain this use of the BER encoding?

Basically, you create an instance an output stream and call the
encodeBER(java.io.OutputStream outputStream) method on each Variable.
You then put your array of bytes into the CORBA any. Doing this is
basically embeds SNMP marshalled data into the CORBA stream, probably
not the smartest thing.Honestly I doubt you would like to to this. You
data will be transmitted as an array of bytes and delivered as such on
the CORBA side (I suppose the client).

The thing I don't understand is what you are doing with your data on
the client side. That is what format is expected at the other end of
the CORBA pipe. This Any structure you are trying to create will be
delivered on the CORBA side either as a parameter to a method
invocation, or the return value of another method, but I suspect that
there is some glue code that decode the Any now?

The thing is, normally, Any are used in CORBA when you don't really
have a good idea of the types you are going to pass around. You could
use instead a sequence of structs each describing a binding, with a
union for SNMP variables. If you cannot change the IDL interface, you
can put this structure into the Any. At least, you won't have to write
the parser on the CORBA side.

Just my 0.02 €


More information about the SNMP4J mailing list