perfsonar-dev - FW: [pS-dev] Java Package issues
Subject: perfsonar development work
List archive
- From: Michael Michalis <>
- To:
- Subject: FW: [pS-dev] Java Package issues
- Date: Thu, 01 Feb 2007 17:41:51 +0200
-----Original Message-----
From: Michael Michalis
[mailto:]
Sent: Thursday, February 01, 2007 5:41 PM
To: 'Stijn Melis'
Subject: RE: [pS-dev] Java Package issues
Stijn,
As I understand you are trying to functional test the BWCTL MP.IMHO for that
purpose I don't think its wise to create your requests using those base
classes, since by functional testing perfsonar services you are actually
testing the base classes as well. I know that bwctl MP is written in perl
and not in Java, but still I think it would be good to use independent tools
for developing your code. You could use Jdom wich has a very simple API for
creating XML Elements. I hope I helped and I didn't confuse more.
Michalis Michael
> -----Original Message-----
> From: Stijn Melis
> [mailto:]
> Sent: Thursday, February 01, 2007 5:24 PM
> To:
>
> Cc:
>
> Subject: Re: [pS-dev] Java Package issues
>
> Jason Zurawski wrote:
> > Stijn;
> >
> >> Hi,
> >>
> >>
> >> I am using the java packages to create a SetupDataRequest and a
> >> MetadataKeyRequest for testing purposes. I need to have a
> >> perfsonar:subject element, that contains an nmwgt:endPointPair.
> >>
> >> I tried using org.ggf.ns.nmwg.tools.org.perfsonar.v1_0.Subject, but
> >> that doesn't seem to support an EndPointPair object as its child
> >> (Error: see below).
> >
> >
> > The perfsonar subject is defined to contain service descriptions or
> > interfaces currently (see
> >
> https://svn.internet2.edu/svn/perfsonar/trunk/perfsonar/schema/sonar.rnc).
> > Is there a particular reason why you need to use a perfsonar:subject in
> > this case?
>
> In the BWCTL MP interface specification rnc file perfsonar:subject is
> used. I need to test the correctness of the functionality of the BWCTL
> MP, so I need to follow those specifications myself.
>
> >> As a workaround, I now create a nmwg:subject element (package
> >> org.ggf.ns.nmwg.base.v2_0) and then use String operations afterwards
> >> to change it to perfsonar:subject.
> >
> > This does not sound very efficient, we can talk about adding what you
> > need to the element instead of trying to work around the problem in this
> > manner.
>
> I only need a perfsonar:subject element that can contain a
> nmwgt:endPointPair.
>
> >> Likewise for the EndPointPair, I use the EndPointPair from the package
> >> org.ggf.ns.nmwg.topology.v2_0 and that doesn't result in
> >> nmwgt:endPointPair, but generates nmwgtopo:endPointPair instead. Again
> >> I use String operations afterwards to convert that to
> nmwgt:endPointPair.
> >
> > The prefix (nmwgt or nmwgtopo) is really just a shortcut that maps to a
> > namespace. The actual prefix doesnt matter, as long as it maps to the
> > same namespace. So we could have:
> >
> > xmlns:foo="http://ggf.org/ns/nmwg/topology/2.0/"
> > xmlns:bar="http://ggf.org/ns/nmwg/topology/2.0/"
> > xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/"
> >
> > In the same document, and all prefixes would really mean the same
> > thing. Again, using string operations to coerce what you want is
> > unecessary here. So you are using the proper classes.
>
> Ok, so if I understand correctly, I can use nmwgtopo:endPointPair
> instead of nmwgt:endPointPair, if I also change the corresponding
> namespace at the top?
>
> >>
> >> As far as I am concerned, I am ok with using String operations, but I
> >> don't think that's the point of having these packages and classes. Is
> >> this a fault in the classes, or am I using them the wrong way?
> >>
> >> Regards,
> >>
> >> Stijn
> >>
> >> The error I get if I use a
> >> org.ggf.ns.nmwg.tools.org.perfsonar.service.v1_0.Subject instead of a
> >> org.ggf.ns.nmwg.base.v2_0.Subject:
> >>
> >
> > The service:subject is a little different than the perfsonar:subject,
> > which do you think you should be using?
>
> Since the perfsonar:subject is mentioned in the specification, I think I
> should use that one.
> Sorry, I just noticed that the ...perfsonar.service.v1_0.Subject
> generates a psservice:subject instead of a perfsonar:subject. However, I
> retried the same using org.ggf.ns.nmwg.tools.org.perfsonar.v1_0.Subject
> and I get the same error.
>
> > Do you have an example instance document I can see?
>
> This is the output I would like to have (and that I now have using
> String operations):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <nmwg:message id="datarq2-1" type="SetupDataRequest"
> xmlns="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"
> xmlns:perfsonar="http://ggf.org/ns/nmwg/tools/org/perfsonar/1.0/"
> xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"
> xmlns:nmtm="http://ggf.org/ns/nmwg/time/2.0/"
> xmlns:select="http://ggf.org/ns/nmwg/ops/select/2.0/"
> xmlns:nmwgt="http://ggf.org/ns/nmwg/topology/2.0/">
> <nmwg:metadata id="meta1">
> <perfsonar:subject id="subj1">
> <nmwgt:endPointPair>
> <nmwgt:src type="ipv4" value="192.168.217.129"/>
> <nmwgt:dst type="ipv4" value="192.168.217.130"/>
> </nmwgt:endPointPair>
> </perfsonar:subject>
> <nmwg:parameters id="params1">
> <nmwg:parameter name="protocol">TCP</nmwg:parameter>
> <nmwg:parameter name="windowSize">50000</nmwg:parameter>
> <nmwg:parameter name="interval">2</nmwg:parameter>
> <nmwg:parameter name="duration">5</nmwg:parameter>
> </nmwg:parameters>
> <nmwg:eventType>bwctl</nmwg:eventType>
> </nmwg:metadata>
> <nmwg:data id="1" metadataIdRef="meta1"/>
> </nmwg:message>
>
> >> Error: org/ggf/ns/nmwg/tools/org/perfsonar/service/v1_0/Subject.java
> >> addChild(Element) unrecognized child:
> >> org/ggf/ns/nmwg/topology/v2_0/EndPointPair.java: --->
> >> org/ggf/ns/nmwg/topology/v2_0/Src.java: ---> 192.168.217.129 type:ipv4
> >> port: dst:org/ggf/ns/nmwg/topology/v2_0/Dst.java: ---> 192.168.217.130
> >> type:ipv4 port:
> >>
> >>
> >
> > -jason
>
> Stijn
- FW: [pS-dev] Java Package issues, Michael Michalis, 02/01/2007
Archive powered by MHonArc 2.6.16.