perfsonar-dev - perfsonar: r3882 - in trunk/surfnet_java-flowsubscription-mp: conf conf/axis-1.4/graphics src/main/java/org/perfsonar/service/measurementPoint/flowsubscription
Subject: perfsonar development work
List archive
perfsonar: r3882 - in trunk/surfnet_java-flowsubscription-mp: conf conf/axis-1.4/graphics src/main/java/org/perfsonar/service/measurementPoint/flowsubscription
Chronological Thread
- From:
- To:
- Subject: perfsonar: r3882 - in trunk/surfnet_java-flowsubscription-mp: conf conf/axis-1.4/graphics src/main/java/org/perfsonar/service/measurementPoint/flowsubscription
- Date: Tue, 27 May 2008 11:18:22 -0400
Author: michael.bischoff
Date: 2008-05-27 11:18:22 -0400 (Tue, 27 May 2008)
New Revision: 3882
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/admin_home_target.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/apply_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/apply_button_2.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/arrow_icon.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/arrow_icon2.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_1_large.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_1_small.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_2_large.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_2_small.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/cancel_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/create_resource_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/delete_red_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/edit_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/edit_green_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/login_panel.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/logos.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/logout_button.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_collections_off_tab.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_collections_on_tab.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_users_off_tab.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_users_on_tab.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_bottom.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_slice.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_top.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_bottom.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_slice.gif
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_top.gif
Modified:
trunk/surfnet_java-flowsubscription-mp/conf/service.properties
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpRequest.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpResponse.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NamedthreadFactory.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/ZebedeeControl.java
Log:
* Fixed graphics
* Fixed javadoc
* Added debug statements
* Fixed destroying nfcapd processes.
* Fixed various small bugs and style errors.
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/admin_home_target.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/admin_home_target.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/apply_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/apply_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/apply_button_2.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/apply_button_2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/arrow_icon.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/arrow_icon.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/arrow_icon2.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/arrow_icon2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_1_large.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_1_large.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_1_small.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_1_small.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_2_large.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_2_large.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_2_small.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/button_2_small.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/cancel_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/cancel_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/create_resource_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/create_resource_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/delete_red_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/delete_red_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/edit_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/edit_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/edit_green_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/edit_green_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/login_panel.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/login_panel.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/logos.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/logos.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/logout_button.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/logout_button.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_collections_off_tab.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_collections_off_tab.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_collections_on_tab.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_collections_on_tab.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_users_off_tab.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_users_off_tab.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_users_on_tab.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/manage_users_on_tab.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_bottom.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_bottom.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_slice.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_slice.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_top.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_1_top.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_bottom.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_bottom.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_slice.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_slice.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_top.gif
Property changes on:
trunk/surfnet_java-flowsubscription-mp/conf/axis-1.4/graphics/step_2_top.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/surfnet_java-flowsubscription-mp/conf/service.properties
===================================================================
--- trunk/surfnet_java-flowsubscription-mp/conf/service.properties
2008-05-27 15:14:09 UTC (rev 3881)
+++ trunk/surfnet_java-flowsubscription-mp/conf/service.properties
2008-05-27 15:18:22 UTC (rev 3882)
@@ -3,60 +3,97 @@
# ----------------------------------------------
# === Service Type ===
-#Group=ServiceType
+
+# Group=ServiceType
+# Description= Type should be MP
service.r.type=mp
-#Group=ServiceType
+
+# Group=ServiceType
+# Description= Type should be MP
service.r.service_type=mp
-#Group=ServiceType
+
+# Group=ServiceType
+# Description= The name of this service
service.r.service_name=Java flowSubscription MP
-#Group=ServiceType
-service.r.ls_url=http://localhost:8080/XML-LS-1.1.2/services/LookupService
-#Group=ServiceType
+
+# Group=ServiceType
+# Description= Type should be MP
service.r.access_point=http://sonar1.amsterdam.surfnet.nl:8080/flowsubscription-mp/services/flowsubscriptionMeasurementArchiveService
# === Measurement Archive general properties ===
-#Group=MaGeneral
+
+# Group=MaGeneral
+# Description= Service engine classname
service.mp.class_name=org.perfsonar.service.measurementPoint.flowsubscription.FlowTypeMPServiceEngine
-#Group=MaGeneral
+
+# Group=MaGeneral
+# Description= message types
service.mp.message_types=SubscriptionRequest,UnSubscriptionRequest,SubscriptionKeepaliveRequest
-#Group=MaGeneral
+
+# Group=MaGeneral
+# Description= Configuration file for this ma
service.mp.conf_file=config.xml
-# === Logger properties ===
+# Group=Other properties
+# Description=logging configuration file
service.log.log4j.config=/perfsonar/conf/log4j.properties
-# === nmwg ===
+# Group=Other properties
+# Description=nmwg configuration file
service.sax_parser.config=/perfsonar/conf/objects.config
#=== LS registrator ===
+
+# Group=LS
+# Description= LS adress
+service.r.ls_url=http://localhost:8080/XML-LS-1.1.2/services/LookupService
+
+# Group=LS
+# Description=Secduler Component should be ma_scheduler
component.registrator.scheduler_component=ma_scheduler
+
+# Group=LS
+# Description= Interval
component.registrator.interval=30000
-service.ls.service_content_type=context
#=== Authentication ===
+
+# Group=Authentication
+# Description= Authentication activation status
service.as.authn_active=off
-service.as.authn_for_msg_types=SetupDataRequest
+
+# Group=Authentication
+# Description= Message types for which authentication is needed
+service.as.authn_for_msg_types=SubscriptionRequest,UnSubscriptionRequest,SubscriptionKeepaliveRequest
+
+# Group=Authentication
+# Description= AS adress
service.as.point=http://homer.rediris.es:8080/perfSONAR-AS/services/AuthService
#=== Flow subscription specific config shizzle ===
-# port (and up) that the zebedee client should receive data at
+# Group=Subscription
+# Description= port (and up) that the zebedee client should receive data at
service.mp.flow.inPort=11110
-# port (and up) that the zebedee client should use for sending
-# data (and listen for reverse connection setup from server)
+# Group=Subscription
+# Description= port port (and up) that the zebedee client should use for
sending data (and listen for reverse connection setup from server)
service.mp.flow.betweenPort=22220
-# which versions of netflow can we export
+# Group=Subscription
+# Description= which versions of netflow can we export
service.mp.flow.netflow_versions = netflow_v9,netflow_v5,sflow
-# what t.p. for netflow data do we support
+# Group=Subscription
+# Description= what t.p. for netflow data do we support
service.mp.flow.transport_protocols = udp,tcp,sctp,pr-sctp
-# at what rate is the netflow data sampled
+# Group=Subscription
+# Description= at what rate is the netflow data sampled
service.mp.flow.sample_rate = 100
-# maximum client netflow subscriptions
+# Group=Subscription
+# Description= maximum client netflow subscriptions
service.mp.flow.max_conn = 20
### network layout
@@ -85,7 +122,19 @@
service.mp.flow.router.3.interfaces=1,2,3,4,5,6
### application locations
+
+# Group=Applications
+# Description= Zebedee for tunnels
service.mp.flow.zebedee=/usr/bin/zebedee
+
+# Group=Applications
+# Description=nfdump for reading nfcapd files
service.mp.flow.nfdump=/usr/local/bin/nfdump
+
+# Group=Applications
+# Description=Deamon for capturing data
service.mp.flow.nfcapd=/usr/local/bin/nfcapd
+
+# Group=Applications
+# Description=for replaying nfdump data
service.mp.flow.nfreplay=/usr/local/bin/nfreplay
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpRequest.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpRequest.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpRequest.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -5,7 +5,6 @@
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
-import java.util.zip.DataFormatException;
import org.ggf.ns.nmwg.base.v2_0.Data;
import org.ggf.ns.nmwg.base.v2_0.Message;
@@ -58,12 +57,10 @@
* The incomming request (should be subscription request).
*
* @return a hashtable with key,value pairs of common parameters.
- * @throws DataFormatException
- * When parameters aren't properly formatted.
*/
- private Map<String, String> filterCommonParams(Message request)
throws PerfSONARException {
+ private Map<String, String> filterCommonParams(Message request) {
// TODO validate parameter list
- Hashtable<String, String> params = new Hashtable<String,
String>();
+ Hashtable<String, String> parameters = new Hashtable<String,
String>();
// Meta data items (routers and common options)
for (Metadata meta : request.getMetadataArray()) {
@@ -73,11 +70,11 @@
logger.debug("Common router selection
information:");
for (Parameter param :
((org.ggf.ns.nmwg.tools.netflow.v2_0.Parameters)
meta.getParameters()).getParameterArray()) {
logger.debug("" +
param.getParameterName() + " = "+ param.getParameterValue());
- params.put(param.getParameterName(),
param.getParameterValue());
+
parameters.put(param.getParameterName(), param.getParameterValue());
}
}
}
- return params;
+ return parameters;
}
/**
@@ -86,13 +83,10 @@
* @param request
* The incomming request (should be subscription request).
* @return an ArrayList with routernames (Strings).
- * @throws DataFormatException
- * When there are no routers in the list, or the
routernames
- * aren't properly formatted.
*/
- private List<String> filterRouters(Message request) throws
PerfSONARException {
+ private List<String> filterRouters(Message request) {
// TODO validate routerlist
- ArrayList<String> routers = new ArrayList<String>();
+ final ArrayList<String> specifiedRouters = new
ArrayList<String>();
// Meta data items (routers and common options)
for (Metadata meta : request.getMetadataArray()) {
@@ -101,11 +95,11 @@
logger.debug("" +
subj.getRouter().getName().getName());
// add the routers to the list by name
-
routers.add(subj.getRouter().getName().getName());
+
specifiedRouters.add(subj.getRouter().getName().getName());
}
}
// TODO check routernames with configured list
- return routers;
+ return specifiedRouters;
}
/**
@@ -116,9 +110,7 @@
* The incomming request (should be subscription request).
* @return a Hashtable with key,value pairs containing the client
address
* and the client portnumber.
- * @throws DataFormatException
- * When the client endpoint parameters aren't properly
- * formatted.
+ * @throws PerfSONARException
*/
private Map<String, String> filterEndPointParams(Message request)
throws PerfSONARException {
Hashtable<String, String> clientParams = new
Hashtable<String, String>();
@@ -165,7 +157,7 @@
* @param request
* A unsubscription/keepalive request containing the key.
* @return the unique key from the request.
- * @throws DataFormatException
+ * @throws PerfSONARException
* if the key is not properly formatted, or does not
exist.
*/
private Integer filterKey(Message request) throws PerfSONARException {
@@ -177,12 +169,11 @@
if
(meta.getKey().getParameterByName("maSubscription") != null) {
Parameter param =
meta.getKey().getParameterByName(KEY_SUBSCRIPTION);
if (param != null &&
param.getParameterValue() != null) {
- Integer key =
Integer.parseInt(param.getParameterValue());
- if (key != null && key > 0) {
- return key;
- } else {
- throw new
PerfSONARException("Key is not positive numeric.");
+ Integer keyFromParameters =
new Integer(param.getParameterValue());
+ if
(keyFromParameters.intValue() > 0) {
+ return
keyFromParameters;
}
+ throw new
PerfSONARException("Key is not positive numeric.");
}
}
}
@@ -216,9 +207,9 @@
public Integer getTargetPort() {
try {
- return Integer.parseInt(params.get(KEY_CLIENT_PORT));
+ return new Integer(params.get(KEY_CLIENT_PORT));
} catch (NumberFormatException e) {
- return -1;
+ return Integer.valueOf(-1);
}
}
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpResponse.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpResponse.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowMpResponse.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -27,10 +27,7 @@
* The response type.
* @param key
* The unique tunnel key.
- * @param a
- * message to explain the response.
- *
- * @return a ready-to-send response Message.
+ * @param message
*/
public FlowMpResponse(String responseType, Integer key, String
message) {
setType(responseType);
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -32,6 +32,7 @@
/**
* Instantiates the FlowTypeMPServiceEngine.
+ * @throws PerfSONARException
*/
public FlowTypeMPServiceEngine() throws PerfSONARException {
this.logger = (LoggerComponent)
AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
@@ -85,11 +86,12 @@
/**
* Helper method to subscribe a client to a tunnel.
*
- * @param flowMpRequest
+ * @param request
* a subscription request.
*
* @return a Message object that should be returned to the client.
*/
+ @SuppressWarnings("boxing")
protected Message subscribe(FlowMpRequest request) throws
PerfSONARException{
List<String> routers = request.getRouters();
Subscription subscription = null;
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NamedthreadFactory.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NamedthreadFactory.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NamedthreadFactory.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -10,7 +10,7 @@
* Mostly unimportant class, it simply ensures that the thread priority is
not
* higher than the thread that creates it. It also sets names so that when
* profiling/debugging threads are recognizable. Other then that it's
identical
- * to
{@link
Executors.DefaultThreadFactory}
+ * to DefaultThreadFactory(private) in
{@link
Executors}
* @author Michael Bischoff
*/
public class NamedthreadFactory implements ThreadFactory {
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -1,5 +1,6 @@
package org.perfsonar.service.measurementPoint.flowsubscription;
+import java.io.BufferedInputStream;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
@@ -34,15 +35,18 @@
private final int port;
private long lastModified;
-
+
public Exporter(String routerName, int port) throws
PerfSONARException {
this.routerDirectory = getRouterDirectory(routerName);
this.port = port;
}
public void run() {
- startNfcapd();
+ Process nfcapdProcess = null;
+ BufferedInputStream stream = null;
try {
+ nfcapdProcess = startNfcapd();
+ stream = new
BufferedInputStream(nfcapdProcess.getInputStream());
while(true) {
mergeFromQueue();
if(isDirectoryModified()) {
@@ -51,13 +55,37 @@
processNewFile(file);
}
}
+ flushNfcapd(stream);
Thread.sleep(500);
- }
+ }
} catch (InterruptedException e) {
logger.warn("ending polling directory");
+ } finally {
+ if(stream!=null) {
+ close(stream);
+ }
+ if(nfcapdProcess!=null)
nfcapdProcess.destroy();
}
}
+ private void close(BufferedInputStream stream) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void flushNfcapd(BufferedInputStream stream) {
+ try {
+ int available = stream.available();
+ long skipped = stream.skip(available);
+ if(skipped<available) return;
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
public void add(Subscription subscription) {
entryQueue.add(subscription);
}
@@ -107,15 +135,17 @@
for(int i=0;i<submitted;i++) {
task.take();
}
- if(!target.delete()) logger.error("Couldn't delete
file("+target+") after processing it");
+ if(!target.delete()) logger.error("processNewFile()
Couldn't delete file("+target+") after processing it");
+ else logger.debug("processNewFile() deleted "+
target) ;
}
- protected void startNfcapd() {
- ProcessBuilder builder = new
ProcessBuilder(nfcapdExecutable,"-t","55s","-p",String.valueOf(port),"-l",routerDirectory.getAbsolutePath(),"-D");
+ protected Process startNfcapd() {
+ ProcessBuilder builder = new
ProcessBuilder(nfcapdExecutable,"-t","55s","-p",String.valueOf(port),"-l",routerDirectory.getAbsolutePath());
+ builder.redirectErrorStream(true);
try {
- builder.start();
+ return builder.start();
} catch (IOException e) {
- e.printStackTrace();
+ throw new RuntimeException(e);
}
}
@@ -127,8 +157,8 @@
return false;
}
- protected File[] getTargets(File routerDirectory) {
- File[] files = routerDirectory.listFiles(new
FilenameFilter() {
+ protected File[] getTargets(File directory) {
+ File[] files = directory.listFiles(new
FilenameFilter() {
public boolean accept(File dir, String name) {
if(name.startsWith("nfcapd.") &&
!name.startsWith("nfcapd.current")) {
return true;
@@ -147,7 +177,7 @@
private final ProcessBuilder builder = new ProcessBuilder();
- private NfreplayTask(File target, String filter, String
anonomisingKey, int port) {
+ NfreplayTask(File target, String filter, String
anonomisingKey, int port) {
builder.redirectErrorStream(true);
List<String> commands = builder.command();
if(anonomisingKey!=null) {
@@ -176,9 +206,12 @@
Process proces = null;
try {
try {
+ logger.debug("Executing replay: " +
Arrays.toString(builder.command().toArray()) );
proces = builder.start();
InputStream input =
proces.getInputStream();
- while(input.read() != -1);
+ while(input.read() != -1) {
+ /* ignore */
+ }
} catch (IOException e) {
logger.warn("Error relaying output");
}
@@ -254,7 +287,7 @@
}
/**
* Registers a subscription and unregisters it when the subscription
ends
- * @param newSubscription
+ * @param subscription
* @throws PerfSONARException
*/
public void register(final Subscription subscription) throws
PerfSONARException {
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/Subscription.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -29,6 +29,7 @@
* Creates a subscription
*
* @param id
+ * @param owner
* @param routers
* @param anonLevel
* @param filter
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -87,8 +87,8 @@
logger.debug("Creating SubscriptionService");
maximumSubscriptions =
Integer.parseInt(configuration.getProperty("service.mp.flow.max_conn"));
- inPortBase =
Integer.parseInt(configuration.getProperty("service.mp.flow.inPort"));
- betweenPortBase =
Integer.parseInt(configuration.getProperty("service.mp.flow.betweenPort"));
+ inPortBase = new
Integer(configuration.getProperty("service.mp.flow.inPort"));
+ betweenPortBase = new
Integer(configuration.getProperty("service.mp.flow.betweenPort"));
} catch (PerfSONARException e) {
//fail fast a correctly configured service should
never throw this.
throw new RuntimeException(e);
@@ -134,12 +134,12 @@
* @param address
* @param portNr
* @param routers
- * @param params
* @param filter
* @param anonLevel
* @return a integer with the client id or null
* @throws PerfSONARException
*/
+ @SuppressWarnings("boxing")
public Subscription subscribe(String address, Integer portNr,
List<String> routers, String filter, int anonLevel) throws PerfSONARException
{
if(subscriptions.size() >= maximumSubscriptions) {
return null;
Modified:
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/ZebedeeControl.java
===================================================================
---
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/ZebedeeControl.java
2008-05-27 15:14:09 UTC (rev 3881)
+++
trunk/surfnet_java-flowsubscription-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/ZebedeeControl.java
2008-05-27 15:18:22 UTC (rev 3882)
@@ -6,7 +6,6 @@
import org.perfsonar.base.auxiliary.ComponentNames;
import
org.perfsonar.base.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.base.auxiliary.components.logger.LoggerComponent;
-import org.perfsonar.base.exceptions.PerfSONARException;
/**
* Controls a list of active zebedee tunnels, with keepalive feature.
@@ -33,9 +32,6 @@
/**
* Singleton constructor.
- * @param inPortBase
- * @param betweenPortBase
- *
* @throws RuntimeException
* if configuration items can not be read.
*/
@@ -74,16 +70,16 @@
/**
*
- * @param key
- * Unique key identifying the client (supplied by the
service).
+ * @param inPort
* @param clientIP
* The flow subscribers ip address.
* @param outPort
* The port on wich the client wants to receive the flows.
This
* port is supplied by the subscriber.
+ * @param serverTunnelPort
+ * @return a ZedebeeTunnel
* @throws IOException
* When the program execution failed.
- * @throws PerfSONARException
*/
public ZebedeeTunnel startTunnel(int inPort, String clientIP, int
outPort, int serverTunnelPort) throws IOException {
// get the commandline options formatted.
- perfsonar: r3882 - in trunk/surfnet_java-flowsubscription-mp: conf conf/axis-1.4/graphics src/main/java/org/perfsonar/service/measurementPoint/flowsubscription, svnlog, 05/27/2008
Archive powered by MHonArc 2.6.16.