Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r5229 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: . data data/implementation data/topology handlers level1 lsinfo xml

Subject: perfsonar development work

List archive

perfsonar: r5229 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: . data data/implementation data/topology handlers level1 lsinfo xml


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r5229 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: . data data/implementation data/topology handlers level1 lsinfo xml
  • Date: Wed, 22 Jul 2009 07:46:26 -0400

Author: krzjed
Date: 2009-07-22 07:46:23 -0400 (Wed, 22 Jul 2009)
New Revision: 5229

Added:

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/ServiceMeasurementMetadataImpl.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/EndPointPairTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/EndPointTopologyElement.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/GenericTopologyElement.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NetworkInterfaceTopologyElement.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NetworkInterfaceTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NodeTopologyElement.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NodeTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/Port.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/ServicePSTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/ServiceTopologyElement.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/ServiceTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/SpecificTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/TopologyElementHandlerFactory.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/TopologyElementParser.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/TopologyElementSAXHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/UnknownTopologyElement.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/UnknownTopologyElementHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/ServiceMeasurementMetadataCollectionHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/ServiceMeasurementMetadataHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/LSMeasuredTopologyQuery.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/ServiceMeasurementMetadataSAXHandler.java
Removed:

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/LsClientExtended.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/NetworkInterface.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/NetworkInterfaceImpl.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/NetworkInterfaceCollectionHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/NetworkInterfaceHandler.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/LSMeasuredServicesQuery.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/MeasuredInterfacesHandler.java
Modified:

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/LsClientImpl.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/EventTypeImpl.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/LookupServiceImpl.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/TopologyElements.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Databases.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Namespaces.java

trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/ResponseParser.java
Log:
Retrieving ServiceMeasurementMetadata and parsing

Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/LsClientExtended.java

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/LsClientImpl.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/LsClientImpl.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/LsClientImpl.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -69,7 +69,6 @@

public Set<ServiceMeasurementMetadata> getLSQueryContent(
AuthorativeLookupservice arg0, Service arg1) {
- // TODO Auto-generated method stub
- return null;
+ return this.getLevel1().getLSQueryContent(arg0, arg1);
}
}

Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/NetworkInterface.java

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/EventTypeImpl.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/EventTypeImpl.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/EventTypeImpl.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -4,19 +4,60 @@

public class EventTypeImpl implements EventType {

- private String value;
-
- public String getValue() {
- return this.value;
- }
+ private String value;

- public void setValue(String value) {
- this.value = value;
- }
+ public EventTypeImpl() {
+ }

- public EventTypeImpl(){}
-
- public EventTypeImpl(String value){
- this.value = value;
- }
+ public EventTypeImpl(String value) {
+ this.value = value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ EventTypeImpl other = (EventTypeImpl) obj;
+ if (value == null) {
+ if (other.value != null)
+ return false;
+ } else if (!value.equals(other.value))
+ return false;
+ return true;
+ }
+
+ public String getValue() {
+ return this.value;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return value;
+ }
}

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/LookupServiceImpl.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/LookupServiceImpl.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/LookupServiceImpl.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -3,10 +3,9 @@
import java.net.URI;

import org.perfsonar.lsclient.data.AuthorativeLookupservice;
-import org.perfsonar.lsclient.data.LookupService;
import org.perfsonar.lsclient.data.Service;

-public class LookupServiceImpl implements LookupService {
+public class LookupServiceImpl implements AuthorativeLookupservice {

private AuthorativeLookupservice authorativeLookupService;


Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/NetworkInterfaceImpl.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/implementation/ServiceMeasurementMetadataImpl.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/EndPointPairTopologyElementHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/EndPointTopologyElement.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/GenericTopologyElement.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NetworkInterfaceTopologyElement.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NetworkInterfaceTopologyElementHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NodeTopologyElement.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/NodeTopologyElementHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/Port.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/ServicePSTopologyElementHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/ServiceTopologyElement.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/ServiceTopologyElementHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/SpecificTopologyElementHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/TopologyElementHandlerFactory.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/TopologyElementParser.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/TopologyElementSAXHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/UnknownTopologyElement.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/data/topology/UnknownTopologyElementHandler.java

Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/NetworkInterfaceCollectionHandler.java

Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/NetworkInterfaceHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/ServiceMeasurementMetadataCollectionHandler.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/handlers/ServiceMeasurementMetadataHandler.java

Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/LSMeasuredServicesQuery.java

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/LSMeasuredTopologyQuery.java

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/Level1Impl.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -6,7 +6,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;

import javax.xml.bind.JAXBContext;
@@ -27,204 +26,194 @@
import org.perfsonar.lsclient.data.ServiceType;
import org.perfsonar.lsclient.data.TopologyElement;
import org.perfsonar.lsclient.helpers.AbstractLevel1;
-import org.perfsonar.ri.lsclient.data.NetworkInterface;
-import org.perfsonar.ri.lsclient.handlers.NetworkInterfaceCollectionHandler;
-import org.perfsonar.ri.lsclient.handlers.NetworkInterfaceHandler;
+import
org.perfsonar.ri.lsclient.handlers.ServiceMeasurementMetadataCollectionHandler;
+import org.perfsonar.ri.lsclient.handlers.ServiceMeasurementMetadataHandler;
import org.perfsonar.ri.lsclient.level1.jaxb.JaxbTools;
import org.perfsonar.ri.lsclient.level1.jaxb.ServiceImpl;
import org.perfsonar.ri.lsclient.xml.ResponseParser;
import org.xml.sax.SAXException;

public class Level1Impl extends AbstractLevel1 implements
- Level1LsClientInterface {
+ Level1LsClientInterface {

- private static final String EAGER_SYSTEM_KEY =
"application.perfsonar.lsclient.eagerRootLses";
+ private static final String EAGER_SYSTEM_KEY =
"application.perfsonar.lsclient.eagerRootLses";

- protected final Logger logger = Logger.getLogger(getClass());
- protected final RootGlses rootGlses = new RootGlses();
- protected final JAXBContext context;
+ protected final Logger logger = Logger.getLogger(getClass());
+ protected final RootGlses rootGlses = new RootGlses();
+ protected final JAXBContext context;

- @SuppressWarnings("boxing")
- public Level1Impl(Level0LsClientInterface level0) {
- super(level0);
- JAXBContext newContext = null;
- try {
- newContext = JAXBContext
-
.newInstance("org.perfsonar.ri.lsclient.level1.jaxb");
- } catch (JAXBException e) {
- logger.error("Can't load JAXB context", e);
- }
- try {
- String value = System.getProperty(EAGER_SYSTEM_KEY);
- if (Boolean.valueOf(value)) {
- rootGlses.ensureFilled();
- }
- } catch (SecurityException e) {
- logger
- .warn("Wasn't allowed to read system
property \"application.perfsonar.lsclient.eagerRootLses\"");
- }
+ @SuppressWarnings("boxing")
+ public Level1Impl(Level0LsClientInterface level0) {
+ super(level0);
+ JAXBContext newContext = null;
+ try {
+ newContext = JAXBContext
+ .newInstance("org.perfsonar.ri.lsclient.level1.jaxb");
+ } catch (JAXBException e) {
+ logger.error("Can't load JAXB context", e);
+ }
+ try {
+ String value = System.getProperty(EAGER_SYSTEM_KEY);
+ if (Boolean.valueOf(value)) {
+ rootGlses.ensureFilled();
+ }
+ } catch (SecurityException e) {
+ logger
+ .warn("Wasn't allowed to read system property
\"application.perfsonar.lsclient.eagerRootLses\"");
+ }

- this.context = newContext;
- }
+ this.context = newContext;
+ }

- /**
- * Note: Getting the root's file must be lazy, because the root hint
file
- * might not be avail when the application starts (Internet
availability
- * might not be avail when the application starts re-attempt till we
- * actually get some glses)
- *
- * @see
org.perfsonar.lsclient.Level1LsClientInterface#startDiscovery(java.util.Set,
- * java.util.Set, java.util.Set)
- */
- public DiscoveryProcess startDiscovery(Set<TopologyElement> elements,
- Set<EventType> eventTypes, Set<ServiceType> types) {
- rootGlses.ensureFilled();
- return new DiscoveryProcessImpl(level0, context, rootGlses,
elements,
- eventTypes, types);
- }
+ /**
+ * Note: Getting the root's file must be lazy, because the root hint file
+ * might not be avail when the application starts (Internet availability
+ * might not be avail when the application starts re-attempt till we
+ * actually get some glses)
+ *
+ * @see
org.perfsonar.lsclient.Level1LsClientInterface#startDiscovery(java.util.Set,
+ * java.util.Set, java.util.Set)
+ */
+ public DiscoveryProcess startDiscovery(Set<TopologyElement> elements,
+ Set<EventType> eventTypes, Set<ServiceType> types) {
+ rootGlses.ensureFilled();
+ return new DiscoveryProcessImpl(level0, context, rootGlses, elements,
+ eventTypes, types);
+ }

- /*
- * (non-Javadoc)
- *
- * @see
- *
org.perfsonar.lsclient.Level1LsClientInterface#getLSQueryContent(org.
- * perfsonar.lsclient.data.HomeLookupService, java.util.Set,
java.util.Set,
- * java.util.Set)
- */
- public Set<ServiceMeasurementMetadata> getLSQueryContent(
- AuthorativeLookupservice hls, Set<TopologyElement>
elements,
- Set<EventType> eventTypes, Set<ServiceType> type) {
- if (logger.isDebugEnabled()) {
- logger
- .debug("quering LS for service
content from "
- + hls.getEndPoint() +
" where"
- + " topologyElements
is any " + elements == null ? ""
- :
Arrays.toString(elements.toArray())
- + "
eventypes is any " + eventTypes == null ? ""
- :
Arrays.toString(eventTypes.toArray())
-
+ " serviceType is any " + type == null ? ""
-
: Arrays.toString(type.toArray()));
- }
- LsTopologyQuery query = new LsTopologyQuery(elements,
eventTypes, type) {
- @Override
- public String toString() {
- return null;
- }
- };
- Collection<ServiceImpl> services;
- try {
- InputStream stream = level0
- .getRawQueryResult(hls,
query.toString());
- services =
JaxbTools.unMarshallPerfsonarMessage(context, stream,
- ServiceImpl.class);
- for (ServiceImpl service : services)
- service.setAuthorativeLookupservice(hls);
- return null;
- } catch (JAXBException e) {
- return null; // TODO
- } catch (XMLStreamException e) {
- return null; // TODO
- } catch (LsQueryException e) {
- return null; // TODO
- }
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.perfsonar.lsclient.Level1LsClientInterface#getLSQueryContent(org.
+ * perfsonar.lsclient.data.HomeLookupService, java.util.Set,
java.util.Set,
+ * java.util.Set)
+ */
+ public Set<ServiceMeasurementMetadata> getLSQueryContent(
+ AuthorativeLookupservice hls, Set<TopologyElement> elements,
+ Set<EventType> eventTypes, Set<ServiceType> type) {
+ if (logger.isDebugEnabled()) {
+ logger
+ .debug("quering LS for service content from "
+ + hls.getEndPoint() + " where"
+ + " topologyElements is any " + elements == null
? ""
+ : Arrays.toString(elements.toArray())
+ + " eventypes is any " + eventTypes ==
null ? ""
+ : Arrays.toString(eventTypes.toArray())
+ + " serviceType is any " + type
== null ? ""
+ :
Arrays.toString(type.toArray()));
+ }
+ LsTopologyQuery query = new LsTopologyQuery(elements, eventTypes,
type) {
+ @Override
+ public String toString() {
+ return null;
+ }
+ };
+ Collection<ServiceImpl> services;
+ try {
+ InputStream stream = level0
+ .getRawQueryResult(hls, query.toString());
+ services = JaxbTools.unMarshallPerfsonarMessage(context, stream,
+ ServiceImpl.class);
+ for (ServiceImpl service : services)
+ service.setAuthorativeLookupservice(hls);
+ return null;
+ } catch (JAXBException e) {
+ return null; // TODO
+ } catch (XMLStreamException e) {
+ return null; // TODO
+ } catch (LsQueryException e) {
+ return null; // TODO
+ }
+ }

- /*
- * (non-Javadoc)
- *
- * @see
- *
org.perfsonar.lsclient.Level1LsClientInterface#getLSQueryLocation(org
- * .perfsonar.lsclient.data.HomeLookupService, java.util.Set,
java.util.Set,
- * java.util.Set)
- */
- public Set<Service> getLSQueryLocation(AuthorativeLookupservice hls,
- Set<TopologyElement> elements, Set<EventType>
eventTypes,
- Set<ServiceType> type) {
- if (logger.isDebugEnabled()) {
- logger.debug("quering LS for service locations from "
- + hls.getEndPoint()
- + " where"
- + " topologyElements is any "
- + (elements == null ? "" :
Arrays.toString(elements
- .toArray()))
- + " eventypes is any "
- + (eventTypes == null ? "" :
Arrays.toString(eventTypes
- .toArray())) + "
serviceType is any "
- + (type == null ? "" :
Arrays.toString(type.toArray())));
- }
- DiscoveryQuery query = new DiscoveryQuery(elements,
eventTypes, type);
- try {
- InputStream stream =
level0.getRawDiscoveryResponse(hls, query
- .toString());
- Collection<ServiceImpl> result = JaxbTools
- .unMarshallPerfsonarMessage(context,
stream,
- ServiceImpl.class);
- for (ServiceImpl service : result)
- service.setAuthorativeLookupservice(hls);
- return new HashSet<Service>(result);
- } catch (JAXBException e) {
- logger.error("JAXB exception occoured while quering
for location",
- e);
- return Collections.emptySet(); // TODO
- } catch (XMLStreamException e) {
- logger.error(
- "XMLStream exception occoured while
quering for location",
- e);
- return Collections.emptySet(); // TODO
- } catch (LsQueryException e) {
- logger.error(
- "LsQuery exception occoured while
quering for location", e);
- return Collections.emptySet(); // TODO
- }
- }
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.perfsonar.lsclient.Level1LsClientInterface#getLSQueryLocation(org
+ * .perfsonar.lsclient.data.HomeLookupService, java.util.Set,
java.util.Set,
+ * java.util.Set)
+ */
+ public Set<Service> getLSQueryLocation(AuthorativeLookupservice hls,
+ Set<TopologyElement> elements, Set<EventType> eventTypes,
+ Set<ServiceType> type) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("quering LS for service locations from "
+ + hls.getEndPoint()
+ + " where"
+ + " topologyElements is any "
+ + (elements == null ? "" : Arrays.toString(elements
+ .toArray()))
+ + " eventypes is any "
+ + (eventTypes == null ? "" : Arrays.toString(eventTypes
+ .toArray())) + " serviceType is any "
+ + (type == null ? "" : Arrays.toString(type.toArray())));
+ }
+ DiscoveryQuery query = new DiscoveryQuery(elements, eventTypes,
type);
+ try {
+ InputStream stream = level0.getRawDiscoveryResponse(hls, query
+ .toString());
+ Collection<ServiceImpl> result = JaxbTools
+ .unMarshallPerfsonarMessage(context, stream,
+ ServiceImpl.class);
+ for (ServiceImpl service : result)
+ service.setAuthorativeLookupservice(hls);
+ return new HashSet<Service>(result);
+ } catch (JAXBException e) {
+ logger.error("JAXB exception occoured while quering for
location",
+ e);
+ return Collections.emptySet(); // TODO
+ } catch (XMLStreamException e) {
+ logger.error(
+ "XMLStream exception occoured while quering for
location",
+ e);
+ return Collections.emptySet(); // TODO
+ } catch (LsQueryException e) {
+ logger.error(
+ "LsQuery exception occoured while quering for location",
e);
+ return Collections.emptySet(); // TODO
+ }
+ }

- public void setKnownLookupServices(Set<LookupService> rootServices) {
- if (rootServices == null)
- throw new IllegalArgumentException(
- "new rootServices set cannot be
null");
- if (rootServices.isEmpty())
- throw new IllegalArgumentException(
- "new rootServices set cannot be
empty");
- rootGlses.stopAutoRefresh();
- rootGlses.replace(rootServices);
- }
+ public void setKnownLookupServices(Set<LookupService> rootServices) {
+ if (rootServices == null)
+ throw new IllegalArgumentException(
+ "new rootServices set cannot be null");
+ if (rootServices.isEmpty())
+ throw new IllegalArgumentException(
+ "new rootServices set cannot be empty");
+ rootGlses.stopAutoRefresh();
+ rootGlses.replace(rootServices);
+ }

- /*
- * (non-Javadoc)
- *
- * @see
- *
org.perfsonar.lsclient.Level1LsClientInterface#getLSMeasuredInterfaces
- * (org.perfsonar.lsclient.data.LookupService,
- * org.perfsonar.lsclient.data.Service)networkInterfaceHandler
- */
- public List<NetworkInterface> getLSMeasuredInterfaces(LookupService
hls,
- Service service) throws LsQueryException {
- NetworkInterfaceCollectionHandler handler = new
NetworkInterfaceCollectionHandler();
- this.processLSMeasuredInterfaces(hls, service, handler);
- return handler.getNetworkInterfaces();
-
- }
-
- public void processLSMeasuredInterfaces(LookupService hls, Service
service,
- NetworkInterfaceHandler handler) throws
LsQueryException {
- LSMeasuredServicesQuery query = new
LSMeasuredServicesQuery(service);
- logger.info("Created query: \n" + query.toString());
- InputStream stream;
- stream = level0.getRawQueryResult(hls, query.toString());
- try {
- ResponseParser.parseMeasuredInterfaces(stream,
handler);
- } catch (ParserConfigurationException e) {
- throw new LsQueryException(e);
- } catch (SAXException e) {
- throw new LsQueryException(e);
- } catch (IOException e) {
- throw new LsQueryException(e);
- }
- }
-
public Set<ServiceMeasurementMetadata> getLSQueryContent(
- AuthorativeLookupservice arg0, Service arg1) {
- // TODO Auto-generated method stub
- return null;
+ AuthorativeLookupservice hls, Service service) {
+ ServiceMeasurementMetadataCollectionHandler handler = new
ServiceMeasurementMetadataCollectionHandler();
+ try {
+ this.processLSQueryContent(hls, service, handler);
+ return handler.getMetadataSet();
+ } catch (LsQueryException e) {
+ // TODO change to throws in API
+ logger.error("Problems with LSQueryContent occured.", e);
+ return null;
+ }
}
+
+ public void processLSQueryContent(LookupService hls, Service service,
+ ServiceMeasurementMetadataHandler handler) throws
LsQueryException {
+ LSMeasuredTopologyQuery query = new LSMeasuredTopologyQuery(service);
+ logger.info("Created query: \n" + query.toString());
+ InputStream stream;
+ stream = level0.getRawQueryResult(hls, query.toString());
+ try {
+ ResponseParser.parseServiceMeasurementMetadata(stream, handler);
+ } catch (ParserConfigurationException e) {
+ throw new LsQueryException(e);
+ } catch (SAXException e) {
+ throw new LsQueryException(e);
+ } catch (IOException e) {
+ throw new LsQueryException(e);
+ }
+ }
}
\ No newline at end of file

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/TopologyElements.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/TopologyElements.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/level1/TopologyElements.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -72,6 +72,7 @@
throw new UnsupportedOperationException("Case
Link is not implemented");
}
case NODE: {
+ //TODO change to regular expression
if(value.split("\\.", 5).length == 4) {
return "<nmtb:address
xmlns:nmtb=\"http://ogf.org/schema/network/topology/base/20070828/\";
type=\"ipv4\">"
+value+

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Databases.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Databases.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Databases.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -3,7 +3,7 @@
/**
* Constants for operations with database
*
- * @author krzjed
+ * @author krzjed (PSNC)
*
*/
public class Databases {

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Namespaces.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Namespaces.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/lsinfo/Namespaces.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -3,7 +3,7 @@
/**
* Namespaces names
*
- * @author krzjed
+ * @author krzjed (PSNC)
*
*/
public class Namespaces {
@@ -14,6 +14,11 @@
public static final String NETUTIL =
"http://ggf.org/ns/nmwg/characteristic/utilization/2.0/";;
public static final String ERRORS =
"http://ggf.org/ns/nmwg/characteristic/errors/2.0/";;
public static final String DISCARD =
"http://ggf.org/ns/nmwg/characteristic/discards/2.0/";;
+ public static final String NMTB =
"http://ogf.org/schema/network/topology/base/20070828/";;
+ //TODO why is are two prefixes ntmb with differen URIs
+ public static final String __NMTB =
"http://ogf.org/schema/network/base/20070828/";;
+ public static final String NMTL3 =
"http://ogf.org/schema/network/topology/l3/20070828/";;
+ public static final String IPERF =
"http://ggf.org/ns/nmwg/tools/iperf/2.0/";;

private Namespaces() {
};

Deleted:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/MeasuredInterfacesHandler.java

Modified:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/ResponseParser.java
===================================================================
---
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/ResponseParser.java
2009-07-16 12:39:30 UTC (rev 5228)
+++
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/ResponseParser.java
2009-07-22 11:46:23 UTC (rev 5229)
@@ -2,15 +2,14 @@

import java.io.IOException;
import java.io.InputStream;
-import java.util.List;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

-import org.perfsonar.ri.lsclient.data.NetworkInterface;
-import org.perfsonar.ri.lsclient.handlers.NetworkInterfaceHandler;
-import org.perfsonar.ri.lsclient.level1.LSMeasuredServicesQuery;
+import org.perfsonar.lsclient.data.ServiceMeasurementMetadata;
+import org.perfsonar.ri.lsclient.handlers.ServiceMeasurementMetadataHandler;
+import org.perfsonar.ri.lsclient.level1.LSMeasuredTopologyQuery;
import org.xml.sax.SAXException;

/**
@@ -21,27 +20,29 @@
*/
public class ResponseParser {

- /**
- * Parses
{@link
LSMeasuredServicesQuery}
- *
- * @param is
- * stream containing response
- * @return Parsed
{@link
List} of
{@link
NetworkInterface}
- * @throws ParserConfigurationException
- * Sax problems
- * @throws SAXException
- * Sax problems
- * @throws IOException
- * Connection to LS problems
- */
- public static void parseMeasuredInterfaces(
- InputStream is, NetworkInterfaceHandler
networkInterfaceHandler)
- throws ParserConfigurationException, SAXException,
IOException {
-
- SAXParserFactory saxFact = SAXParserFactory.newInstance();
- saxFact.setNamespaceAware(true);
- SAXParser sax = saxFact.newSAXParser();
- MeasuredInterfacesHandler handler = new
MeasuredInterfacesHandler(networkInterfaceHandler);
- sax.parse(is, handler);
- }
+ /**
+ * Parses
{@link
LSMeasuredTopologyQuery} result
+ *
+ * @param is
+ * stream containing response
+ * @param metadataHandler
+ * object handling newly parsed
+ *
{@link
ServiceMeasurementMetadata}
+ * @throws ParserConfigurationException
+ * Sax problems
+ * @throws SAXException
+ * Sax problems
+ * @throws IOException
+ * Connection to LS problems
+ */
+ public static void parseServiceMeasurementMetadata(InputStream is,
+ ServiceMeasurementMetadataHandler metadataHandler)
+ throws ParserConfigurationException, SAXException, IOException {
+ SAXParserFactory saxFact = SAXParserFactory.newInstance();
+ saxFact.setNamespaceAware(true);
+ SAXParser sax = saxFact.newSAXParser();
+ ServiceMeasurementMetadataSAXHandler handler = new
ServiceMeasurementMetadataSAXHandler(
+ metadataHandler);
+ sax.parse(is, handler);
+ }
}

Added:
trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient/xml/ServiceMeasurementMetadataSAXHandler.java



  • perfsonar: r5229 - in trunk/ps-mdm-lsclient-impl/src/main/java/org/perfsonar/ri/lsclient: . data data/implementation data/topology handlers level1 lsinfo xml, svnlog, 07/22/2009

Archive powered by MHonArc 2.6.16.

Top of Page