perfsonar-dev - perfsonar: r3392 - in trunk/surfnet_java-flowsa-ma: . conf conf/axis-1.4 conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders
Subject: perfsonar development work
List archive
perfsonar: r3392 - in trunk/surfnet_java-flowsa-ma: . conf conf/axis-1.4 conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders
Chronological Thread
- From:
- To:
- Subject: perfsonar: r3392 - in trunk/surfnet_java-flowsa-ma: . conf conf/axis-1.4 conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders
- Date: Fri, 22 Feb 2008 17:28:01 -0500
Author: michael.bischoff
Date: 2008-02-22 17:28:00 -0500 (Fri, 22 Feb 2008)
New Revision: 3392
Added:
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/default.css
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/main.css
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/partners.gif
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/perfsonar_logo.gif
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/top_slice.gif
trunk/surfnet_java-flowsa-ma/conf/wizard.properties
trunk/surfnet_java-flowsa-ma/conf/wizardproperties.dtd
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/ConfFileServlet.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalAggregationRuleException.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalFilterException.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalNfdumpSyntaxException.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TimeRange.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/WorkaroundProcess.java
Removed:
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/i18nLib.jsp
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/index.jsp
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalFilterSyntaxException.java
Modified:
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/web.xml
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/index.html
trunk/surfnet_java-flowsa-ma/conf/service.properties
trunk/surfnet_java-flowsa-ma/pom.xml
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowStatisticsResponse.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/Statistics.java
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump1_5_5OutputReaderImpl.java
Log:
RESOLVED - bug 259: FlowSA client: an incorrect IP filter yields zero results
instead of an error
https://bugzilla.perfsonar.net/show_bug.cgi?id=259
RESOLVED - bug 345: statistics don't report the range.
https://bugzilla.perfsonar.net/show_bug.cgi?id=345
RESOLVED - bug 244: Flow S&A client ignores multiple router selection
https://bugzilla.perfsonar.net/show_bug.cgi?id=244
RESOLVED - bug 261: FlowSA MA: raw flow aggregation does not work
https://bugzilla.perfsonar.net/show_bug.cgi?id=261
Modified: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/web.xml
===================================================================
--- trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/web.xml 2008-02-22
14:20:53 UTC (rev 3391)
+++ trunk/surfnet_java-flowsa-ma/conf/axis-1.4/WEB-INF/web.xml 2008-02-22
22:28:00 UTC (rev 3392)
@@ -3,46 +3,67 @@
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
- <display-name>Apache-Axis</display-name>
+<web-app>
+ <display-name>Apache-Axis</display-name>
+
+ <filter>
+ <filter-name>ipfilter</filter-name>
+ <filter-class>nl.surfnet.web.IpAccessFilter</filter-class>
+ <init-param>
+ <param-name>ips</param-name>
+ <param-value>127.0.0.1
2001:610:508:109:20b:dbff:fee9:61f3 62.131.17.150 192.87.109.151
192.87.109.84 192.87.102.208 78.27.8.39 192.87.117.149
192.87.109.186</param-value>
+ <description>
+ A space separated list of ips that are
allowed to access
+ resources.
+ </description>
+ </init-param>
+ </filter>
+ <filter-mapping>
+ <filter-name>ipfilter</filter-name>
+ <url-pattern>/servlet/*</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>ipfilter</filter-name>
+ <url-pattern>/services/*</url-pattern>
+ </filter-mapping>
- <filter>
- <filter-name>ipfilter</filter-name>
- <filter-class>nl.surfnet.web.IpAccessFilter</filter-class>
- <init-param>
- <param-name>ips</param-name>
- <param-value>127.0.0.1
2001:610:508:109:20b:dbff:fee9:61f3 62.131.17.150 192.87.109.151
192.87.109.84 192.87.102.208 78.27.8.39 192.87.117.149
192.87.109.186</param-value>
- <description>
- A space separated list of ips that are
allowed to access
- resources.
- </description>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>ipfilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
<listener>
<listener-class>
org.apache.axis.transport.http.AxisHTTPSessionListener
</listener-class>
</listener>
-
<listener>
<listener-class>
org.perfsonar.service.base.container.listeners.StartupInitializer
</listener-class>
- </listener>
-
+ </listener>
+
<servlet>
<servlet-name>AxisServlet</servlet-name>
<display-name>Apache-Axis Servlet</display-name>
<servlet-class>
org.apache.axis.transport.http.AxisServlet
</servlet-class>
- </servlet>
-
+ </servlet>
+ <servlet>
+ <servlet-name>ConfFile</servlet-name>
+ <display-name>Config File for LS</display-name>
+ <servlet-class>
+
org.perfsonar.service.measurementArchive.flowsa.ConfFileServlet
+ </servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>ServiceAdmin</servlet-name>
+ <servlet-class>
+ perfSONARWebAdmin.admin.service.Admin
+ </servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>Wizard</servlet-name>
+ <servlet-class>
+ perfSONARWebAdmin.admin.wizard.Wizard
+ </servlet-class>
+ </servlet>
<servlet>
<servlet-name>SOAPMonitorService</servlet-name>
<display-name>SOAPMonitorService</display-name>
@@ -60,22 +81,30 @@
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/servlet/AxisServlet</url-pattern>
</servlet-mapping>
-
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>*.jws</url-pattern>
</servlet-mapping>
-
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>ConfFile</servlet-name>
+ <url-pattern>/config.xml</url-pattern>
</servlet-mapping>
-
<servlet-mapping>
<servlet-name>SOAPMonitorService</servlet-name>
<url-pattern>/SOAPMonitor</url-pattern>
</servlet-mapping>
-
+ <servlet-mapping>
+ <servlet-name>ServiceAdmin</servlet-name>
+ <url-pattern>/ServiceAdmin</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>Wizard</servlet-name>
+ <url-pattern>/Wizard</url-pattern>
+ </servlet-mapping>
<session-config>
<!-- Default to 5 minute session timeouts -->
<session-timeout>5</session-timeout>
@@ -89,16 +118,15 @@
<mime-type>text/xml</mime-type>
</mime-mapping>
-
<mime-mapping>
<extension>xsd</extension>
<mime-type>text/xml</mime-type>
</mime-mapping>
<welcome-file-list id="WelcomeFileList">
+ <welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
- <welcome-file>index.html</welcome-file>
<welcome-file>index.jws</welcome-file>
</welcome-file-list>
-
+
</web-app>
Added: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/default.css
Deleted: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/i18nLib.jsp
Modified: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/index.html
===================================================================
--- trunk/surfnet_java-flowsa-ma/conf/axis-1.4/index.html 2008-02-22
14:20:53 UTC (rev 3391)
+++ trunk/surfnet_java-flowsa-ma/conf/axis-1.4/index.html 2008-02-22
22:28:00 UTC (rev 3392)
@@ -1,21 +1,75 @@
-<html>
-
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta http-equiv="Refresh" content="5;url=index.jsp">
- <title>Apache-Axis</title>
-</head>
-
-<body bgcolor="#FFFFFF">
-
-<h1 align="center">Apache-AXIS</h1>
-
-<blockquote>
- We've moved to an internationalized <a href="index.jsp">top page</a>. The
new URL should be automatically loaded after 5 seconds.<br>
-If you want to visit the new site immediately, please click the above link.
-</blockquote>
-
-<hr>
-Copyright © 2005 The Apache Software Foundation. All rights reserved.
-</body>
-</html>
+<html>
+
+ <head>
+ <title>perfSONAR Service Web Administration page</title>
+ <link rel="stylesheet" type="text/css" href="main.css" />
+ <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"><style type="text/css">
+<!--
+body,td,th {
+ font-family: arial;
+}
+a:hover {
+ color: #000000;
+}
+-->
+</style></head>
+ <body>
+<div class="adminPanel" >
+
+<div class="banner">
+<table border="0" align="left" cellpadding="0" cellspacing="0">
+<tr>
+ <td><img src="perfsonar_logo.gif" alt="perfSONAR" width="192" height="94"
border="0" align="right"></td>
+</tr>
+</table>
+
+</div>
+
+<div class="mainWindow" >
+
+<div class="sidebar" >
+<table border="0" cellpadding="0" cellspacing="0">
+<tr >
+<th>Administration</th>
+</tr>
+<tr>
+ <td>
+ <p><a href="Wizard" target="main" class="navtex" >Service Configuration
Wizard</a></p>
+ </td>
+</tr>
+<tr>
+ <td>
+ <p><a href="ServiceAdmin?serviceProperties" target="main"
class="navtex" >Service configuration</a></p>
+ </td>
+</tr>
+<tr>
+ <td>
+ <p><a href="ServiceAdmin?loggingProperties" target="main" class="navtex"
>logging configuration</a></p>
+ </td>
+</tr>
+</table>
+<a href="http://www.perfsonar.net/partners.html"></a> <br>
+<img src="partners.gif" alt="perfSONAR project partners" border="0"/>
</a></div>
+
+<div class="centerWindow" >
+ <object data="http://www.perfsonar.net" type="text/html" name="main"
width="101%" height="106%" class="main" >
+ <p>Sorry for the inconvenience we are having connectiong to the main
page...</p>
+ </object>
+</div>
+
+
+</div>
+
+<div class="footer" >PERFormance Service-Oriented Network monitoring
ARchitecture </div>
+
+
+
+
+
+</div>
+
+
+ </body>
+</html>
+
+
Deleted: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/index.jsp
Added: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/main.css
Added: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/partners.gif
Property changes on: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/partners.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/perfsonar_logo.gif
Property changes on:
trunk/surfnet_java-flowsa-ma/conf/axis-1.4/perfsonar_logo.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/top_slice.gif
Property changes on: trunk/surfnet_java-flowsa-ma/conf/axis-1.4/top_slice.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/surfnet_java-flowsa-ma/conf/service.properties
===================================================================
--- trunk/surfnet_java-flowsa-ma/conf/service.properties 2008-02-22
14:20:53 UTC (rev 3391)
+++ trunk/surfnet_java-flowsa-ma/conf/service.properties 2008-02-22
22:28:00 UTC (rev 3392)
@@ -5,30 +5,71 @@
# === Service Type ===
service.r.type=ma
service.r.service_name=Java flowSA MA
+service.r.ls_url=http://sonar1.amsterdam.surfnet.nl:8080/LS/services/LookupService
# === Measurement Archive general properties ===
service.ma.class_name=org.perfsonar.service.measurementArchive.flowsa.FlowsaMAServiceEngine
service.ma.message_types=SetupDataRequest
-service.ma.conf_file=@TODO
+service.ma.conf_file=config.xml
# === Flowsa specific properties ===
# service.ma.flowsa.exporters - a number indicating the amount of different
sources
-# service.ma.flowsa.exporter1.hostname -
-# service.ma.flowsa.exporter1.port -
-# service.ma.flowsa.exporter1.description -
+# service.ma.flowsa.exporter1.hostname - required
+# service.ma.flowsa.exporter1.port - required
+# service.ma.flowsa.exporter1.description - required
+# service.ma.flowsa.exporter1.flow-version - required
+# service.ma.flowsa.exporter1.sample-rate - required
+# service.ma.flowsa.exporter1.operating-system - optional
+# service.ma.flowsa.exporter1.location.institution - optional
+# service.ma.flowsa.exporter1.location.city - optional
+# service.ma.flowsa.exporter1.location.country - optional
+# service.ma.flowsa.exporter1.location.latitude - optional
+# service.ma.flowsa.exporter1.location.longitude - optional
service.ma.flowsa.exporters=4
service.ma.flowsa.exporter1.hostname=xsr01.asd001a.surf.net
service.ma.flowsa.exporter1.port=29001
service.ma.flowsa.exporter1.description=SURFnet6 Core Router Amsterdam1
+service.ma.flowsa.exporter1.flow-version=netflow_v9
+service.ma.flowsa.exporter1.sample-rate=100
+service.ma.flowsa.exporter1.operating-system=
+service.ma.flowsa.exporter1.location.institution=
+service.ma.flowsa.exporter1.location.city=
+service.ma.flowsa.exporter1.location.country=
+service.ma.flowsa.exporter1.location.latitude=
+service.ma.flowsa.exporter1.location.longitude=
service.ma.flowsa.exporter2.hostname=xsr01.asd002a.surf.net
service.ma.flowsa.exporter2.port=29003
service.ma.flowsa.exporter2.description=SURFnet6 Core Router Amsterdam2
+service.ma.flowsa.exporter2.flow-version=netflow_v9
+service.ma.flowsa.exporter2.sample-rate=100
+service.ma.flowsa.exporter2.operating-system=
+service.ma.flowsa.exporter2.location.institution=
+service.ma.flowsa.exporter2.location.city=
+service.ma.flowsa.exporter2.location.country=
+service.ma.flowsa.exporter2.location.latitude=
+service.ma.flowsa.exporter2.location.longitude=
service.ma.flowsa.exporter3.hostname=xsr03.asd001a.surf.net
service.ma.flowsa.exporter3.port=29002
service.ma.flowsa.exporter3.description=SURFnet6 Border Router Amsterdam1
+service.ma.flowsa.exporter3.flow-version=netflow_v9
+service.ma.flowsa.exporter3.sample-rate=100
+service.ma.flowsa.exporter3.operating-system=
+service.ma.flowsa.exporter3.location.institution=
+service.ma.flowsa.exporter3.location.city=
+service.ma.flowsa.exporter3.location.country=
+service.ma.flowsa.exporter3.location.latitude=
+service.ma.flowsa.exporter3.location.longitude=
service.ma.flowsa.exporter4.hostname=xsr03.asd002a.surf.net
service.ma.flowsa.exporter4.port=29004
service.ma.flowsa.exporter4.description=SURFnet6 Border Router Amsterdam2
+service.ma.flowsa.exporter4.flow-version=netflow_v9
+service.ma.flowsa.exporter4.sample-rate=100
+service.ma.flowsa.exporter4.operating-system=
+service.ma.flowsa.exporter4.location.institution=
+service.ma.flowsa.exporter4.location.city=
+service.ma.flowsa.exporter4.location.country=
+service.ma.flowsa.exporter4.location.latitude=
+service.ma.flowsa.exporter4.location.longitude=
# --- query properties ---
# query.timeout - timeout/max execution time of a query (value is in seconds)
@@ -55,6 +96,6 @@
service.sax_parser.config=/perfsonar/conf/objects.config
#=== LS registrator ===
-component.registrator.scheduler_component=ma_scheduler
-component.registrator.interval=30000
+#component.registrator.scheduler_component=ma_scheduler
+#component.registrator.interval=30000
Added: trunk/surfnet_java-flowsa-ma/conf/wizard.properties
Added: trunk/surfnet_java-flowsa-ma/conf/wizardproperties.dtd
Modified: trunk/surfnet_java-flowsa-ma/pom.xml
===================================================================
--- trunk/surfnet_java-flowsa-ma/pom.xml 2008-02-22 14:20:53 UTC (rev
3391)
+++ trunk/surfnet_java-flowsa-ma/pom.xml 2008-02-22 22:28:00 UTC (rev
3392)
@@ -1,240 +1,228 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>perfsonar</groupId>
- <artifactId>flowsa-ma</artifactId>
- <packaging>war</packaging>
- <name>Flowsa Measurement Archive</name>
- <version>0.7.0</version>
- <description>
- Flow selection and aggregation Measurement Archive for
- perfSONAR. For more information see the wiki-page.
- </description>
- <url>
-
http://wiki.perfsonar.net/jra1-wiki/index.php/Flow_Selection_and_Aggregation_MA
- </url>
- <issueManagement>
- <system>bugzilla</system>
- <url>http://bugzilla.perfsonar.net</url>
- </issueManagement>
- <inceptionYear>2007</inceptionYear>
- <developers>
- <developer>
- <id>gijs</id>
- <name>Gijs Molenaar</name>
- <organization>SURFnet bv</organization>
-
<organizationUrl>http://www.surfnet.nl</organizationUrl>
- </developer>
- <developer>
- <name>Hans Trompert</name>
- <organization>SURFnet bv</organization>
-
<organizationUrl>http://www.surfnet.nl</organizationUrl>
- </developer>
- <developer>
- <id>michael.bischoff</id>
- <name>Michael Bischoff</name>
- <organization>SURFnet bv</organization>
-
<organizationUrl>http://www.surfnet.nl</organizationUrl>
- </developer>
- </developers>
- <scm>
- <connection>scm:svn:anonsvn.internet2.edu/svn/</connection>
- <developerConnection>
- scm:svn:svn.internet2.edu/svn/perfsonar/
- </developerConnection>
- </scm>
- <organization>
- <name>perfSONAR</name>
- <url>http://www.perfsonar.net</url>
- </organization>
- <build>
- <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
- <testSourceDirectory>
- ${basedir}/src/test/java
- </testSourceDirectory>
- <outputDirectory>${basedir}/bin</outputDirectory>
- <directory>${basedir}/build</directory>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <configuration>
- <container>
-
<containerId>tomcat5x</containerId>
- <type>remote</type>
- </container>
- <configuration>
- <type>runtime</type>
- <properties>
-
<cargo.tomcat.manager.url>
-
http://${tomcatHostname}/manager/html
-
</cargo.tomcat.manager.url>
- <cargo.hostname>
-
${tomcatHostname}
- </cargo.hostname>
-
<cargo.remote.username>
-
${tomcatUsername}
-
</cargo.remote.username>
-
<cargo.remote.password>
-
${tomcatPassword}
-
</cargo.remote.password>
- </properties>
- </configuration>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>Update
server-config.wsdd</id>
- <phase>process-classes</phase>
- <configuration>
- <tasks>
- <!-- update
server-config.wsdd -->
- <java
-
classname="org.apache.axis.utils.Admin" fork="true"
-
classpathref="maven.compile.classpath"
-
dir="${basedir}/conf/axis-1.4/WEB-INF/">
- <arg
value="server" />
- <arg
-
value="${basedir}/conf/wsdd/service-deploy.wsdd" />
- </java>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <configuration>
- <webResources>
- <resource>
- <directory>
-
${basedir}/conf/axis-1.4/
- </directory>
- <includes>
-
<include>**/*</include>
- </includes>
- </resource>
- <resource>
-
<directory>${basedir}/conf/wsdd/</directory>
- <includes>
-
<include>**/*</include>
- </includes>
-
<targetPath>wsdd</targetPath>
- </resource>
- <resource>
-
<directory>${basedir}/conf/</directory>
- <includes>
-
<include>**/*</include>
- </includes>
- <excludes>
-
<exclude>axis-1.4/**/*</exclude>
-
<exclude>wsdd/**/*</exclude>
- </excludes>
- <!-- this should
really be changed to WEB-INF/conf -->
- <targetPath>
-
WEB-INF/classes/perfsonar/conf
- </targetPath>
- </resource>
- </webResources>
- <webXml>
-
${basedir}/conf/axis-1.4/WEB-INF/web.xml
- </webXml>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <repositories>
- <repository>
- <id>personar</id>
- <name>personar repository</name>
- <url>
-
http://anonsvn.internet2.edu/svn/perfsonar/trunk/jar-repository/
- </url>
- </repository>
- <repository>
- <id>personar_leg</id>
- <name>personar repository</name>
- <url>
-
http://anonsvn.internet2.edu/svn/perfsonar/trunk/jar-repository/
- </url>
- <layout>legacy</layout>
- </repository>
- <repository>
- <id>codehaus-release-repo</id>
- <name>Codehaus Release Repo</name>
- <url>http://repository.codehaus.org</url>
- </repository>
- </repositories>
- <dependencies>
- <dependency>
- <groupId>perfsonar</groupId>
- <artifactId>perfsonar-base</artifactId>
- <version>1.0.20071121</version>
- </dependency>
- </dependencies>
- <reporting>
- <excludeDefaults>true</excludeDefaults>
- <outputDirectory>${basedir}/doc/site</outputDirectory>
- <plugins>
- <plugin>
- <artifactId>
- maven-project-info-reports-plugin
- </artifactId>
- <reportSets>
- <reportSet>
- <reports>
- <report>index</report>
-
<report>summary</report>
-
<report>project-team</report>
-
<report>dependencies</report>
-
<report>mailing-list</report>
-
<report>issue-tracking</report>
- <report>scm</report>
- </reports>
- </reportSet>
- </reportSets>
- </plugin>
- <plugin>
- <artifactId>maven-javadoc-plugin</artifactId>
- </plugin>
- <plugin>
- <artifactId>maven-jxr-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>taglist-maven-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javancss-maven-plugin</artifactId>
- <configuration>
- <failOnViolation>false</failOnViolation>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-pmd-plugin</artifactId>
- <configuration>
- <linkXref>true</linkXref>
- <sourceEncoding>utf-8</sourceEncoding>
- <minimumTokens>100</minimumTokens>
- <targetJdk>1.5</targetJdk>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>perfsonar</groupId>
+ <artifactId>flowsa-ma</artifactId>
+ <packaging>war</packaging>
+ <name>Flowsa Measurement Archive</name>
+ <version>0.7.0</version>
+ <description>Flow selection and aggregation Measurement Archive for
+ perfSONAR. For more information see the
wiki-page.</description>
+
<url>http://wiki.perfsonar.net/jra1-wiki/index.php/Flow_Selection_and_Aggregation_MA</url>
+ <issueManagement>
+ <system>bugzilla</system>
+ <url>http://bugzilla.perfsonar.net</url>
+ </issueManagement>
+ <inceptionYear>2007</inceptionYear>
+ <developers>
+ <developer>
+ <id>gijs</id>
+ <name>Gijs Molenaar</name>
+ <organization>SURFnet bv</organization>
+ <organizationUrl>http://www.surfnet.nl</organizationUrl>
+ </developer>
+ <developer>
+ <name>Hans Trompert</name>
+ <organization>SURFnet bv</organization>
+ <organizationUrl>http://www.surfnet.nl</organizationUrl>
+ </developer>
+ <developer>
+ <id>michael.bischoff</id>
+ <name>Michael Bischoff</name>
+ <organization>SURFnet bv</organization>
+ <organizationUrl>http://www.surfnet.nl</organizationUrl>
+ </developer>
+ </developers>
+ <scm>
+ <connection>scm:svn:anonsvn.internet2.edu/svn/</connection>
+
<developerConnection>scm:svn:svn.internet2.edu/svn/perfsonar/</developerConnection>
+ </scm>
+ <organization>
+ <name>perfSONAR</name>
+ <url>http://www.perfsonar.net</url>
+ </organization>
+ <build>
+ <sourceDirectory>${basedir}/src/main/java</sourceDirectory>
+ <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
+ <outputDirectory>${basedir}/bin</outputDirectory>
+ <directory>${basedir}/build</directory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <configuration>
+ <container>
+ <containerId>tomcat5x</containerId>
+ <type>remote</type>
+ </container>
+ <configuration>
+ <type>runtime</type>
+ <properties>
+
<cargo.tomcat.manager.url>http://${tomcatHostname}/manager/html</cargo.tomcat.manager.url>
+ <cargo.hostname>${tomcatHostname}</cargo.hostname>
+
<cargo.remote.username>${tomcatUsername}</cargo.remote.username>
+
<cargo.remote.password>${tomcatPassword}</cargo.remote.password>
+ </properties>
+ </configuration>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>Update server-config.wsdd</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <java fork="true" dir="${basedir}/conf/axis-1.4/WEB-INF/"
classname="org.apache.axis.utils.Admin"
classpathref="maven.compile.classpath">
+ <arg value="server" />
+ <arg value="${basedir}/conf/wsdd/service-deploy.wsdd" />
+ </java>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>${basedir}/conf/axis-1.4/</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>${basedir}/conf/wsdd/</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <targetPath>wsdd</targetPath>
+ </resource>
+ <resource>
+ <directory>${basedir}/conf/</directory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>axis-1.4/**/*</exclude>
+ <exclude>wsdd/**/*</exclude>
+ </excludes>
+ <targetPath>WEB-INF/classes/perfsonar/conf</targetPath>
+ </resource>
+ </webResources>
+ <webXml>${basedir}/conf/axis-1.4/WEB-INF/web.xml</webXml>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <id>personar</id>
+ <name>personar repository</name>
+
<url>http://anonsvn.internet2.edu/svn/perfsonar/trunk/jar-repository/</url>
+ </repository>
+ <repository>
+ <id>personar_leg</id>
+ <name>personar repository</name>
+
<url>http://anonsvn.internet2.edu/svn/perfsonar/trunk/jar-repository/</url>
+ <layout>legacy</layout>
+ </repository>
+ <repository>
+ <id>codehaus-release-repo</id>
+ <name>Codehaus Release Repo</name>
+ <url>http://repository.codehaus.org</url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>perfsonar</groupId>
+ <artifactId>perfsonar-base</artifactId>
+ <version>1.0.20071121</version>
+ </dependency>
+ <dependency>
+ <groupId>perfsonar</groupId>
+ <artifactId>perfsonar-web-admin</artifactId>
+ <version>0.6b</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <excludeDefaults>true</excludeDefaults>
+ <outputDirectory>${basedir}/doc/site</outputDirectory>
+ <plugins>
+ <plugin>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>index</report>
+ <report>summary</report>
+ <report>project-team</report>
+ <report>dependencies</report>
+ <report>mailing-list</report>
+ <report>issue-tracking</report>
+ <report>scm</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>javancss-maven-plugin</artifactId>
+ <configuration>
+ <failOnViolation>false</failOnViolation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <linkXref>true</linkXref>
+ <sourceEncoding>utf-8</sourceEncoding>
+ <minimumTokens>100</minimumTokens>
+ <targetJdk>1.5</targetJdk>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
\ No newline at end of file
Added:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/ConfFileServlet.java
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowStatisticsResponse.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowStatisticsResponse.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowStatisticsResponse.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -1,12 +1,21 @@
package org.perfsonar.service.measurementArchive.flowsa;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Metadata;
+import org.ggf.ns.nmwg.time.v2_0.End;
+import org.ggf.ns.nmwg.time.v2_0.Start;
+import org.ggf.ns.nmwg.time.v2_0.Time;
import org.ggf.ns.nmwg.tools.flow.v2_0.Datum;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Statistics;
+import org.perfsonar.service.measurementArchive.flowsa.nfdump.TimeRange;
public class FlowStatisticsResponse extends FlowsaGetResponse {
+ private static final String ISO8601_PATTERN =
"yyyy-MM-dd'T'HH:mm:ssZ";
+
public FlowStatisticsResponse(Metadata[] metadatas, Statistics
statistics) {
super(metadatas);
setData(convertToData(statistics));
@@ -36,9 +45,32 @@
datum.setMsecFirst(statistics.getMsecFirst());
datum.setMsecLast(statistics.getMsecLast());
datum.setSequenceFailures(statistics.getSequenceFailures());
+ datum.addChild(convertToTime(statistics.getRange()));
data.addChild(datum);
return data;
}
-
+
+
+ private Time convertToTime(TimeRange range) {
+ if(range==null) {
+ new IllegalArgumentException("statistics.getRange()
cannot be null for a valid statistic");
+ }
+
+ DateFormat iso = new SimpleDateFormat(ISO8601_PATTERN);
+
+ Start start = new Start();
+ start.addAttr("type", "ISO", null);
+ start.addAttr("value", iso.format(range.getStart()), null);
+
+ End end = new End();
+ end.addAttr("type", "ISO", null);
+ end.addAttr("value", iso.format(range.getEnd()), null);
+
+ Time time = new Time();
+ time.setType("Range");
+ time.addChild(start);
+ time.addChild(end);
+ return time;
+ }
}
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/FlowsaMAServiceEngine.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -21,6 +21,8 @@
import org.perfsonar.service.measurementArchive.flowsa.nfcapd.NfcapdControll;
import
org.perfsonar.service.measurementArchive.flowsa.nfcapd.NfcapdControll.FileData;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Flow;
+import
org.perfsonar.service.measurementArchive.flowsa.nfdump.IllegalAggregationRuleException;
+import
org.perfsonar.service.measurementArchive.flowsa.nfdump.IllegalFilterException;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpControll;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.RawFlowsQuery;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Statistics;
@@ -59,10 +61,18 @@
protected static final String NFCAPDLOCATION_PROPERTY_KEY =
"service.ma.flowsa.nfcapd.location";
protected static final String SHOULDSTARTNFCAPDPROCESSES_PROPERTY_KEY
= "service.ma.flowsa.nfcapd.start-processes";
protected static final String EXPORTERS_PROPERTY_KEY =
"service.ma.flowsa.exporters";
-
protected static final String EXPORTER_PROPERTY_PART =
"service.ma.flowsa.exporter";
protected static final String EXPORTERHOST_PROPERTY_PART =
".hostname";
protected static final String EXPORTERPORT_PROPERTY_PART = ".port";
+ protected static final String EXPORTERDESCRIPTION_PROPERTY_PART =
".description";
+ protected static final String EXPORTEROS_PROPERTY_PART =
".operating-system";
+ protected static final String EXPORTERFLOWVERSION_PROPERTY_PART =
".flow-version";
+ protected static final String EXPORTERFLOWRATE_PROPERTY_PART =
".sample-rate";
+ protected static final String
EXPORTERLOCATIONINSTITUTION_PROPERTY_PART = ".location.institution";
+ protected static final String EXPORTERLOCATIONCITY_PROPERTY_PART =
".location.city";
+ protected static final String EXPORTERLOCATIONCOUNTRY_PROPERTY_PART =
".location.country";
+ protected static final String EXPORTERLOCATIONLATITUDE_PROPERTY_PART
= ".location.latitude";
+ protected static final String
EXPORTERLOCATIONLONGTITUDE_PROPERTY_PART = ".location.longitude";
protected final LoggerComponent logger;
protected final ConfigurationComponent configuration;
@@ -108,11 +118,16 @@
logger.error("Fetching data was interrupted (" +
e.getLocalizedMessage() +")");
throw new
PerfSONARException("error.ma.fetching.interrupted","Fetching was
interrupted",e);
} catch (ExecutionException e) {
+ logger.error("Exception while fetching a
"+e.getCause()+" was thrown(" + e.getLocalizedMessage() +")");
if(e.getCause() instanceof TooManyResultsException) {
- logger.error("Exception while fetching, query
yielded too many results.");
throw new
PerfSONARException("error.ma.flowsa.fetching.too_many_results","Query yielded
too many results.");
}
- logger.error("Exception while fetching(" +
e.getLocalizedMessage() +")");
+ if(e.getCause() instanceof IllegalFilterException) {
+ throw new
PerfSONARException("error.ma.flowsa.fetching.filter","Filter was
illegal("+e.getLocalizedMessage()+")");
+ }
+ if(e.getCause() instanceof
IllegalAggregationRuleException) {;
+ throw new
PerfSONARException("error.ma.flowsa.fetching.aggregationRule","Aggregation
rule was illegal("+e.getLocalizedMessage()+")");
+ }
throw new
PerfSONARException("error.ma.fetching","Exception while fetching data",e);
} catch (TimeoutException e) {
logger.error("Fetching timed out.");
@@ -168,17 +183,8 @@
* @throws PerfSONARException
*/
protected RawFlowsResponse handleRawFlowRequest(FlowsaGetRequest
request) throws InterruptedException, ExecutionException, TimeoutException,
PerfSONARException {
- FileData fileData;
- try {
- fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
- } catch (FileNotFoundException e) {
- throw new PerfSONARException("error.ma.query","No
data avail for specified range");
- }
+ FileData fileData = getFileDataFrom(request);
- if(fileData.empty()) {
- throw new PerfSONARException("error.ma.query","Query didn't
contain a subject known by this MA");
- }
-
RawFlowsQuery query = new RawFlowsQuery(
request.getStartTime(),
request.getEndTime(),
@@ -193,7 +199,7 @@
logger.debug("FlowsaMAServiceEngine.handleRawFlowRequest: Creating
response.");
return new RawFlowsResponse(request.getMetadata(), result,
request.getFieldsToShow());
}
- /**
+ /**
* handles a Statistics request. creates a query from
* the request and executes it in nfdump, the result
* is put into a response or a exception is thrown
@@ -205,18 +211,9 @@
* @throws PerfSONARException
*/
protected Message handleStatisticsFlowRequest(FlowsaGetRequest request)
throws InterruptedException, ExecutionException, TimeoutException,
PerfSONARException {
- FileData fileData;
- try {
- fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
- } catch (FileNotFoundException e) {
- throw new PerfSONARException("error.ma.query","No
data avail for specified range");
- }
-
- if(fileData.empty()) {
- throw new PerfSONARException("error.ma.query","Query didn't
contain a subject known by this MA");
- }
-
- StatisticsQuery query = new StatisticsQuery(
+ FileData fileData = getFileDataFrom(request);
+
+ StatisticsQuery query = new StatisticsQuery(
request.getStartTime(),
request.getEndTime(),
fileData.getDirectories(),
@@ -229,7 +226,6 @@
logger.debug("FlowsaMAServiceEngine.handleRawFlowRequest: Creating
response.");
return new FlowStatisticsResponse(request.getMetadata(), result);
}
-
/**
* handles a TopFlowRequest. creates a query from
* the request and executes it in nfdump, the result
@@ -242,17 +238,8 @@
* @throws PerfSONARException
*/
protected Message handleTopFlowRequest(FlowsaGetRequest request) throws
InterruptedException, ExecutionException, TimeoutException,
PerfSONARException {
- FileData fileData;
- try {
- fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
- } catch (FileNotFoundException e) {
- throw new PerfSONARException("error.ma.query","No
data avail for specified range");
- }
+ FileData fileData = getFileDataFrom(request);
- if(fileData.empty()) {
- throw new PerfSONARException("error.ma.query","Query didn't
contain a subject known by this MA");
- }
-
TopQuery query = new TopQuery(
request.getStartTime(),
request.getEndTime(),
@@ -272,7 +259,6 @@
logger.debug("FlowsaMAServiceEngine.handleTopFlowRequest: Creating
response.");
return new TopFlowsResponse(request.getMetadata(), result);
}
-
/**
* @return
* @throws PerfSONARException
@@ -282,7 +268,7 @@
if (!nfdumpExecutable.exists()) {
logger.error("Nfdump executable not found!
("+nfdumpExecutable+")");
throw new PerfSONARException(
- "", //TODO errorcode
+ "error.ma.configuration",
"Nfdump executable not found. "
);
}
@@ -295,7 +281,7 @@
} catch (Exception e) {
logger.error("Couldn't create nfdump controll. Underlaying
exception: " + e.getLocalizedMessage());
throw new PerfSONARException(
- "", //TODO errorcode
+ "error.ma.configuration",
"Couldn't create nfdump controll.",
e
);
@@ -334,7 +320,7 @@
File nfcapdExecutable =
getNfcapdExecutableFrom(configuration);
if (!nfcapdExecutable.exists()) {
- logger.error("Nfdump executable not found!
("+nfcapdExecutable+")");
+ logger.error("nfcapd executable not found!
("+nfcapdExecutable+")");
throw new PerfSONARException(
"error.ma.configuration",
"Nfdump executable not found. "
@@ -344,6 +330,24 @@
return new NfcapdControll(nfcapdExecutable, exporters,
startNfcapdProcesses);
}
/**
+ * @param request
+ * @return FileData based on the request
+ * @throws PerfSONARException if FileData couldn't be found.
+ */
+ protected FileData getFileDataFrom(FlowsaGetRequest request) throws
PerfSONARException {
+ FileData fileData;
+ try {
+ fileData = nfcapd.getFileData(request.getHostNames(),
request.getStartTime(), request.getEndTime());
+ } catch (FileNotFoundException e) {
+ logger.error(e.getLocalizedMessage());
+ throw new PerfSONARException("error.ma.query","No
data avail for specified range");
+ } catch (IOException e) {
+ logger.error(e.getLocalizedMessage());
+ throw new PerfSONARException("error.ma.query","Query
contained a subject not known to this MA");
+ }
+ return fileData;
+ }
+ /**
* looks up the property from the specified source. returns the
default value
* if the source didn't supply one.
* @param source
@@ -383,7 +387,7 @@
if(exporter!=null) {
exporters.add(exporter);
} else {
- logger.warn("FlowsaMAServiceEngine.getExporters:
could not create exporter "+i+".");
+ logger.info("FlowsaMAServiceEngine.getExporters:
could not create exporter "+i+".");
}
}
return exporters;
@@ -394,13 +398,32 @@
try {
String host =
source.getProperty(EXPORTER_PROPERTY_PART + i + EXPORTERHOST_PROPERTY_PART);
int port =
Integer.parseInt(source.getProperty(EXPORTER_PROPERTY_PART + i +
EXPORTERPORT_PROPERTY_PART));
- exporter = new Exporter(sourceDir, host, port);
+ String flowVersion =
source.getProperty(EXPORTER_PROPERTY_PART + i +
EXPORTERFLOWVERSION_PROPERTY_PART);
+ int flowRate =
Integer.parseInt(source.getProperty(EXPORTER_PROPERTY_PART + i +
EXPORTERFLOWRATE_PROPERTY_PART));
+ exporter = new Exporter(sourceDir, host, port,
flowVersion, flowRate);
} catch (Exception e) {
+ logger.warn("FlowsaMAServiceEngine.getExporter:
Couldn't create exporter (" + e.getLocalizedMessage() + ")");
return null;
}
- //TODO set optional properties.
+ exporter.setDescription(getExporterProperty(source, i,
EXPORTERDESCRIPTION_PROPERTY_PART));
+ exporter.setOperatingSystem(getExporterProperty(source, i,
EXPORTEROS_PROPERTY_PART));
+ exporter.setInstitution(getExporterProperty(source, i,
EXPORTERLOCATIONINSTITUTION_PROPERTY_PART));
+ exporter.setCity(getExporterProperty(source, i,
EXPORTERLOCATIONCITY_PROPERTY_PART));
+ exporter.setCountry(getExporterProperty(source, i,
EXPORTERLOCATIONCOUNTRY_PROPERTY_PART));
+ exporter.setLatitude(getExporterProperty(source, i,
EXPORTERLOCATIONLATITUDE_PROPERTY_PART));
+ exporter.setLongtitude(getExporterProperty(source, i,
EXPORTERLOCATIONLONGTITUDE_PROPERTY_PART));
+
return exporter;
}
+
+ private String getExporterProperty(ConfigurationComponent source,int
i, String property) {
+ try {
+ return source.getProperty(EXPORTER_PROPERTY_PART + i
+ property);
+ } catch (PerfSONARException e) {
+ logger.warn(EXPORTER_PROPERTY_PART + i + property + "
could not be read");
+ }
+ return null;
+ }
/**
* looks up the property from the specified source. returns the
default value
* if the source didn't supply one.
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/Exporter.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -16,18 +16,28 @@
private final String hostName;
private final int port;
private final File myDirectory;
-
+ private final String flowVersion;
+ private final int flowRate;
+
private String description;
+ private String operatingSystem;
+ private String institution;
+ private String city;
+ private String country;
+ private String latitude;
+ private String longtitude;
- public Exporter(File outputDirectory, String hostName, int port) {
+ public Exporter(File outputDirectory, String hostName, int port,
String flowVersion, int flowRate) {
if(hostName==null) {
throw new IllegalArgumentException("hostname cannot
be null.");
}
this.hostName = hostName;
this.port = port;
this.myDirectory = new File(outputDirectory, hostName);
+ this.flowVersion = flowVersion;
+ this.flowRate = flowRate;
}
-
+
public String getDirectory() {
if(myDirectory.exists()) {
return myDirectory.getAbsolutePath();
@@ -125,7 +135,70 @@
* @return
*/
public boolean hasFiles(String startFile, String endFile) {
+ if(!myDirectory.canRead()) return false;
SortedSet<String> files = new
TreeSet<String>(Arrays.asList(myDirectory.list()));
return files.contains(startFile) && files.contains(endFile);
}
+
+
+ public void setOperatingSystem(String operatingSystem) {
+ this.operatingSystem = operatingSystem;
+ }
+
+ public void setInstitution(String institution) {
+ this.institution = institution;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+
+ }
+
+ public void setLongtitude(String longtitude) {
+ this.longtitude = longtitude;
+ }
+
+ public File getMyDirectory() {
+ return myDirectory;
+ }
+
+ public String getFlowVersion() {
+ return flowVersion;
+ }
+
+ public int getFlowRate() {
+ return flowRate;
+ }
+
+ public String getOperatingSystem() {
+ return operatingSystem;
+ }
+
+ public String getInstitution() {
+ return institution;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public String getLatitude() {
+ return latitude;
+ }
+
+ public String getLongtitude() {
+ return longtitude;
+ }
}
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd/NfcapdControll.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -76,6 +76,10 @@
new NfcapdProcessesControllThread().start();
}
+ /**
+ * @param hostname
+ * @return exporter belonging to the hostname or Null
+ */
public Exporter getExporterByHostName(String hostname) {
for(Exporter exporter: exporters) {
if(exporter.getHostName().equalsIgnoreCase(hostname))
{
@@ -89,20 +93,31 @@
return startingNfcapdProcesses;
}
- public FileData getFileData(Collection<String> hostnames, Date
startTime, Date endTime) throws FileNotFoundException {
+ /**
+ * @param hostnames
+ * @param startTime
+ * @param endTime
+ * @return FileData
+ * @throws IOException when it cannot read from an exporter because
it is ukown
+ * @throws FileNotFoundException when one of the source files cannot
be found.
+ */
+ public FileData getFileData(Collection<String> hostnames, Date
startTime, Date endTime) throws IOException, FileNotFoundException {
String startFile = null;
String endFile = null;
Set<String> directories = new TreeSet<String>();
+
for(String hostName : hostnames) {
Exporter exporter = getExporterByHostName(hostName);
- if(exporter==null) break;
+ if(exporter==null) {
+ throw new IOException("Cannot find / unkown
Exporter("+hostName+"), no data avail.");
+ }
if(startFile!=null) {
// here we presume that files for exporters
are all written at the same interval leading
// to the same names among the directories
this might cause problems
if(!exporter.hasFiles(startFile, endFile))
throw new FileNotFoundException("Data not avail for specified interval");
directories.add(exporter.getDirectory());
- break;
+ continue;
}
startFile = exporter.getClosestFileBefore(startTime);
endFile = exporter.getClosestFileAfter(endTime);
Added:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalAggregationRuleException.java
Copied:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalFilterException.java
(from rev 3338,
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalFilterSyntaxException.java)
Deleted:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalFilterSyntaxException.java
Added:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/IllegalNfdumpSyntaxException.java
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpControll.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -5,10 +5,11 @@
import java.io.File;
import java.text.DateFormat;
+import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
+import java.util.Date;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
@@ -36,7 +37,7 @@
* @param <Type> Type of the result of this task
*/
protected static abstract class NfdumpTask<Type> implements
Callable<Type> {
- protected final List<String> commands;
+ protected final List<String> commands = new ArrayList<String>();
protected final NfdumpOutputReaderFactory readerFactory;
/**
@@ -45,7 +46,7 @@
* @param readerFactory factory to create the reader from.
*/
public NfdumpTask(List<String> commands, NfdumpOutputReaderFactory
readerFactory) {
- this.commands = Collections.unmodifiableList(commands);
+ this.commands.addAll(commands);
this.readerFactory = readerFactory;
}
@@ -56,9 +57,11 @@
Process process = null;
NfdumpOutputReader reader = null;
try {
+ ProcessBuilder builder= new ProcessBuilder(commands);
+ builder.redirectErrorStream(true);
// TODO remove?
System.out.println(Arrays.toString(commands.toArray()));
- process = new ProcessBuilder(commands).start();
+ process = new WorkaroundProcess(builder.start());
reader = readerFactory.create(process.getInputStream());
return call(reader);
} finally {
@@ -66,7 +69,7 @@
reader.destroy();
}
if(process!=null) {
- process.destroy();
+ process.destroy();
}
}
}
@@ -118,7 +121,7 @@
this.maxResults = maxResults;
this.timeoutValue = timeoutValue;
}
- /**
+ /**
* This method takes a RecordQuery, executes it and returns the result.
* @param query to be executed
* @return List of Records
@@ -159,7 +162,7 @@
* @throws ExecutionException when something went wrong executing the
query-task
* @throws TimeoutException when the query-task took too long
*/
- public Statistics execute(StatisticsQuery query) throws
InterruptedException, ExecutionException, TimeoutException {
+ public Statistics execute(final StatisticsQuery query) throws
InterruptedException, ExecutionException, TimeoutException {
List<String> commands;
try {
commands = createCommandsFrom(query);
@@ -170,11 +173,20 @@
Callable<Statistics> task = new
NfdumpTask<Statistics>(commands,readerFactory) {
@Override
public Statistics call(NfdumpOutputReader reader) throws
Exception {
- return reader.readStatistics();
+ return reader.readStatistics();
}
};
- return submit(task);
+ Statistics statistics = submit(task);
+ DateFormat dateFormat = new
SimpleDateFormat("'nfcapd.'yyyyMMddHHmm");
+ try {
+ Date start = dateFormat.parse(query.getStartFile());
+ Date end = dateFormat.parse(query.getEndFile());
+ statistics.setRange(new TimeRange(start,end));
+ } catch (ParseException e) {
+ new RuntimeException("couldn't parse date, this
should never happen here and this exception indicates a bug");
+ }
+ return statistics;
}
/**
* This method takes a TopQuery, executes it and returns the result.
@@ -401,7 +413,7 @@
*/
private static final class MyThreadFactory implements ThreadFactory {
private final ThreadGroup threadGroup;
- private int i = 0;
+ private volatile int i = 0;
protected MyThreadFactory() {
this.threadGroup = new ThreadGroup("nfdump-workers");
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/NfdumpOutputReader.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -24,26 +24,26 @@
* @return the record encountered at stream or null if end of stream has
* been reached
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader#readRecord()
- * @throws IllegalFilterSyntaxException if the filter-syntax used in
the initial command is illegal
+ * @throws IllegalNfdumpSyntaxException if the filter-syntax used in
the initial command is illegal
* @throws IOException if the reader has input but couldn't parse
*/
- public Flow readRecord() throws IllegalFilterSyntaxException,
IOException;
+ public Flow readRecord() throws IllegalNfdumpSyntaxException,
IOException;
/**
* @return the statistic encountered at stream or null if end of
stream has
* been reached
- * @throws IllegalFilterSyntaxException if the filter-syntax used in the
initial command is illegal
+ * @throws IllegalNfdumpSyntaxException if the filter-syntax used in the
initial command is illegal
* @throws IOException if the reader has input but couldn't parse
*/
- public Statistics readStatistics() throws
IllegalFilterSyntaxException, IOException;
+ public Statistics readStatistics() throws
IllegalNfdumpSyntaxException, IOException;
/**
* @return the topDatum encountered at stream or null if end of
stream has
* been reached
- * @throws IllegalFilterSyntaxException if the filter-syntax used in the
initial command is illegal
+ * @throws IllegalNfdumpSyntaxException if the filter-syntax used in the
initial command is illegal
* @throws IOException if the reader has input but couldn't parse
*/
- public TopDatum readTopDatum() throws IllegalFilterSyntaxException,
IOException;
+ public TopDatum readTopDatum() throws IllegalNfdumpSyntaxException,
IOException;
/**
* Method to allow the reader to clean up resources such as
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/Statistics.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/Statistics.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/Statistics.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -27,6 +27,7 @@
private String msecFirst;
private String msecLast;
private String sequenceFailures;
+ private TimeRange range;
public String getFlows() {
return flows;
@@ -148,4 +149,10 @@
public void setSequenceFailures(String sequenceFailures) {
this.sequenceFailures = sequenceFailures;
}
+ public TimeRange getRange() {
+ return range;
+ }
+ public void setRange(TimeRange range) {
+ this.range = range;
+ }
}
Added:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/TimeRange.java
Added:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/WorkaroundProcess.java
Modified:
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump1_5_5OutputReaderImpl.java
===================================================================
---
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump1_5_5OutputReaderImpl.java
2008-02-22 14:20:53 UTC (rev 3391)
+++
trunk/surfnet_java-flowsa-ma/src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders/Nfdump1_5_5OutputReaderImpl.java
2008-02-22 22:28:00 UTC (rev 3392)
@@ -6,7 +6,9 @@
import java.io.InputStreamReader;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Flow;
-import
org.perfsonar.service.measurementArchive.flowsa.nfdump.IllegalFilterSyntaxException;
+import
org.perfsonar.service.measurementArchive.flowsa.nfdump.IllegalAggregationRuleException;
+import
org.perfsonar.service.measurementArchive.flowsa.nfdump.IllegalFilterException;
+import
org.perfsonar.service.measurementArchive.flowsa.nfdump.IllegalNfdumpSyntaxException;
import
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.Statistics;
import org.perfsonar.service.measurementArchive.flowsa.nfdump.TopDatum;
@@ -41,7 +43,7 @@
*
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader#readRecord()
*/
- public Flow readRecord() throws IOException {
+ public Flow readRecord() throws IllegalNfdumpSyntaxException,
IOException {
String line;
if ((line = myReader.readLine()) != null) {
catchOutputError(line);
@@ -55,7 +57,7 @@
*
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader#readStatistics()
*/
- public Statistics readStatistics() throws IOException {
+ public Statistics readStatistics() throws
IllegalNfdumpSyntaxException, IOException {
Statistics statistics = new Statistics();
String line;
for (int lineNumber = 1; (line = myReader.readLine()) !=
null; lineNumber++) {
@@ -168,7 +170,7 @@
*
* @see
org.perfsonar.service.measurementArchive.flowsa.nfdump.NfdumpOutputReader#readTopData()
*/
- public TopDatum readTopDatum() throws IOException {
+ public TopDatum readTopDatum() throws IllegalNfdumpSyntaxException,
IOException {
String line;
while ((line = myReader.readLine()) != null) {
TopDatum datum = parseTopDatum(line);
@@ -179,7 +181,7 @@
return null;
}
- private TopDatum parseTopDatum(String line) throws IOException {
+ private TopDatum parseTopDatum(String line) throws
IllegalNfdumpSyntaxException, IOException {
catchOutputError(line);
if("".equals(line)) { // FIX 1.5.5 Topdata ends with a
useless empty line while using the piped format.
return null;
@@ -344,17 +346,26 @@
/**
* Method to catch more typical output errors, like invalid filters
and aggregation rules.
* @param line
- * @throws IllegalFilterSyntaxException
+ * @throws IllegalFilterException
* FIXME checking validness could be done in java and this could be
an exception indicating
* a bug in the validator. Allowing one to remove
IllegalFilterSyntaxException from the
*
{@link
NfdumpOutputReader} because the exception would be raised before it ever
hit's nfdump
* -> since reading output of nfdump occurs after hitting nfdump.
*/
- protected void catchOutputError(String line) throws
IllegalFilterSyntaxException {
+ protected void catchOutputError(String line) throws
IllegalNfdumpSyntaxException {
if(line.startsWith("line 1: syntax error at '")) {
- throw new IllegalFilterSyntaxException(
+ throw new IllegalFilterException(
line.substring("line 1:".length())
);
}
+ if(line.startsWith("Option -A requires")) {
+ throw new IllegalAggregationRuleException(
+ "An aggregation rule should be a " +
+ line.substring("Option -A
requires".length())
+ );
+ }
+ if(line.startsWith("Unknown aggregate field")) {
+ throw new IllegalAggregationRuleException(line);
+ }
}
}
- perfsonar: r3392 - in trunk/surfnet_java-flowsa-ma: . conf conf/axis-1.4 conf/axis-1.4/WEB-INF src/main/java/org/perfsonar/service/measurementArchive/flowsa src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfcapd src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump src/main/java/org/perfsonar/service/measurementArchive/flowsa/nfdump/outputreaders, svnlog, 02/22/2008
Archive powered by MHonArc 2.6.16.