Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r4816 - in trunk/ps-mdm-flowsub-mp: conf src/main/java/org/perfsonar/service/measurementPoint/flowsubscription src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard

Subject: perfsonar development work

List archive

perfsonar: r4816 - in trunk/ps-mdm-flowsub-mp: conf src/main/java/org/perfsonar/service/measurementPoint/flowsubscription src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r4816 - in trunk/ps-mdm-flowsub-mp: conf src/main/java/org/perfsonar/service/measurementPoint/flowsubscription src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard
  • Date: Wed, 17 Dec 2008 22:07:57 -0500

Author: michael.bischoff
Date: 2008-12-17 22:07:57 -0500 (Wed, 17 Dec 2008)
New Revision: 4816

Added:

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/LSRegistrationControll.java
Modified:
trunk/ps-mdm-flowsub-mp/conf/components.properties

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java

trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicConfigurationWriter.java
Log:
Fixing LS

Modified: trunk/ps-mdm-flowsub-mp/conf/components.properties
===================================================================
--- trunk/ps-mdm-flowsub-mp/conf/components.properties 2008-12-18 03:03:29
UTC (rev 4815)
+++ trunk/ps-mdm-flowsub-mp/conf/components.properties 2008-12-18 03:07:57
UTC (rev 4816)
@@ -10,6 +10,9 @@
# Simple scheduler

ma_scheduler=org.perfsonar.base.auxiliary.components.simplescheduler.Scheduler

+# workaround helper
+ls_Helper=org.perfsonar.service.measurementPoint.flowsubscription.LSRegistrationControll
+
#Registration in LS
#the service will load this component depending on service.r.ls_url has a
valid value in service.properties
#registrator=org.perfsonar.service.base.registration.LSRegistrationComponent

Modified:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
===================================================================
---
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
2008-12-18 03:03:29 UTC (rev 4815)
+++
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/FlowTypeMPServiceEngine.java
2008-12-18 03:07:57 UTC (rev 4816)
@@ -21,6 +21,7 @@
*
*/
public class FlowTypeMPServiceEngine implements ServiceEngine {
+
/**
* Logger component.
*/

Added:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/LSRegistrationControll.java


Property changes on:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/LSRegistrationControll.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain

Modified:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
===================================================================
---
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
2008-12-18 03:03:29 UTC (rev 4815)
+++
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/NfReplayControll.java
2008-12-18 03:07:57 UTC (rev 4816)
@@ -36,11 +36,13 @@
private final ConcurrentLinkedQueue<Subscription>
removalQueue = new ConcurrentLinkedQueue<Subscription>();
private final File routerDirectory;
private final int port;
+ private final String name;

private long lastModified;

- public Exporter(String routerName, int port) throws
PerfSONARException {
- this.routerDirectory = getRouterDirectory(routerName);
+ public Exporter(String name, int port) throws
PerfSONARException {
+ this.name = name;
+ this.routerDirectory = getRouterDirectory(name);
this.port = port;
}

@@ -97,6 +99,10 @@
removalQueue.add(subscription);
}

+ public String getName() {
+ return name;
+ }
+
protected File getRouterDirectory(String routerName) throws
PerfSONARException {
File directory = new
File(nfcapTargetDirectory,routerName + "/");
if(!directory.exists() && !directory.mkdir()) {
@@ -171,8 +177,8 @@

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")) {
+ public boolean accept(File dir, String
fileName) {
+ if(fileName.startsWith("nfcapd.") &&
!fileName.startsWith("nfcapd.current")) {
return true;
}
return false;
@@ -189,6 +195,7 @@
return files;
}

+
}

private class NfreplayTask implements Callable<Integer> {
@@ -332,14 +339,11 @@
checkCanExecute(nfdumpExecutable, "Nfdump");
nfcapTargetDirectory =
AuxiliaryComponentManager.getInstance().getTempDirectory();

- for(int i = 1; ;i++) {
- try {
-
configuration.getProperty(EXPORTER_FIRST_PART+i+".enabled");
- } catch (PerfSONARException e) {
- break;
- }
- initExportingRouter(i);
- }
+ Set<Exporter> configuredExporters = getExporters();

+ for(Exporter exporter : configuredExporters) {
+ exporters.execute(exporter);
+ exportingRouterMap.put(exporter.getName(),
exporter);
+ }

if(exportingRouterMap.size()<1) {
throw new PerfSONARException("","No routers
where configured and enabled, check if the
'"+EXPORTER_FIRST_PART+"0"+".enabled' is defined in service.properties");
@@ -350,22 +354,40 @@
}
}

+ private Set<Exporter> getExporters() {
+ Set<Exporter> loadedExporters = new TreeSet<Exporter>();
+ for(int i = 1; ;i++) {
+ try {
+
configuration.getProperty(EXPORTER_FIRST_PART+i+".enabled");
+ } catch (PerfSONARException e) {
+ break;
+ }
+ Exporter exporter = initExporter(i);
+ if(exporter!=null) loadedExporters.add(exporter);
+ }
+ return loadedExporters;
+ }
+
+ private Exporter initExporter(int i) {
+ try {
+ String enabled =
configuration.getProperty(EXPORTER_FIRST_PART+i+".enabled");
+ if(!enabled.equalsIgnoreCase("true")) return null;
+ String name =
configuration.getProperty(EXPORTER_FIRST_PART+i+".name");
+ int port =
Integer.parseInt(configuration.getProperty(EXPORTER_FIRST_PART+i+".port"));
+ logger.debug("loaded Router(name="+name+")");
+ return new Exporter(name, port);
+ } catch (PerfSONARException e) {
+ logger.fatal("Could not load exporter '"+i+"'");
+ return null;
+ }
+ }
+
private void checkCanExecute(String path, String name) throws
PerfSONARException {
if(!new File(path).exists()) {
throw new
PerfSONARException("error.ma.configuration",name+" executable doesn't
exist.");
}
}

- private void initExportingRouter(int i) throws PerfSONARException {
- String enabled =
configuration.getProperty(EXPORTER_FIRST_PART+i+".enabled");
- if(!enabled.equalsIgnoreCase("true")) return;
- String name =
configuration.getProperty(EXPORTER_FIRST_PART+i+".name");
- int port =
Integer.parseInt(configuration.getProperty(EXPORTER_FIRST_PART+i+".port"));
- logger.debug("loaded Router(name="+name+")");
- Exporter exporter = new Exporter(name, port);
- exporters.execute(exporter);
- exportingRouterMap.put(name, exporter);
- }
/**
* Registers a subscription and unregisters it when the subscription
ends
* @param subscription

Modified:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
===================================================================
---
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
2008-12-18 03:03:29 UTC (rev 4815)
+++
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/SubscriptionService.java
2008-12-18 03:07:57 UTC (rev 4816)
@@ -146,13 +146,13 @@
@SuppressWarnings("boxing")
public Subscription subscribe(String address, Integer portNr,
List<String> routers, String filter, int anonLevel) throws PerfSONARException
{
if(subscriptions.size() >= maximumSubscriptions) {
- return null;
+ throw new
PerfSONARException("error.mp.maxsubscriptions","Reached maximum
subscriptions, all slots are filled.");
}
synchronized (createNewSubscriptionMutex) {
Integer id = getNewId();
if(id==null) {
logger.fatal("couldn't get a id");
- throw new
PerfSONARException("error.mp.flow.max_clients_reached","The maximum number of
clients is reached, try again later.");
+ throw new
PerfSONARException("error.mp.maxsubscriptions","The maximum number of clients
is reached, try again later.");
}

ZebedeeTunnel zebedeeTunnel = null;

Modified:
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicConfigurationWriter.java
===================================================================
---
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicConfigurationWriter.java
2008-12-18 03:03:29 UTC (rev 4815)
+++
trunk/ps-mdm-flowsub-mp/src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard/BasicConfigurationWriter.java
2008-12-18 03:07:57 UTC (rev 4816)
@@ -89,9 +89,8 @@
return;
}

- if ("servlet.password".equals(key)
- && !property.getValue().trim().equals("")) {
- servletProperties.setPassword(property.getValue());
+ if ("servlet.password".equals(key)) {
+ if(!property.getValue().trim().equals(""))
servletProperties.setPassword(property.getValue());
return;
}




  • perfsonar: r4816 - in trunk/ps-mdm-flowsub-mp: conf src/main/java/org/perfsonar/service/measurementPoint/flowsubscription src/main/java/org/perfsonar/service/measurementPoint/flowsubscription/wizard, svnlog, 12/17/2008

Archive powered by MHonArc 2.6.16.

Top of Page