[or-cvs] r16547: {} As always, I forgot to svn add some new task files (puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks)

sebastian at seul.org sebastian at seul.org
Thu Aug 14 14:49:44 UTC 2008


Author: sebastian
Date: 2008-08-14 10:49:44 -0400 (Thu, 14 Aug 2008)
New Revision: 16547

Added:
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/BuildCircuitsTask.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateDirectoryAuthorityTask.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateProxyTask.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateRouterTask.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/ShutdownNodesTask.java
   puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/StartNodesTask.java
Log:
As always, I forgot to svn add some new task files

Added: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/BuildCircuitsTask.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/BuildCircuitsTask.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/BuildCircuitsTask.java	2008-08-14 14:49:44 UTC (rev 16547)
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.tasks;
+
+import java.rmi.RemoteException;
+
+import de.uniba.wiai.lspi.puppetor.Network;
+import de.uniba.wiai.lspi.puppetor.NetworkFactory;
+import de.uniba.wiai.lspi.puppetor.PuppeTorException;
+import de.uniba.wiai.lspi.puppetor.rmi.impl.AbstractTaskImpl;
+
+public class BuildCircuitsTask extends AbstractTaskImpl {
+
+	/**
+	 * Required for serialization. Needs to change for new released versions.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	public BuildCircuitsTask(final int id, final String networkName) {
+		super(id, networkName);
+	}
+
+	@Override
+	public void execute() throws InterruptedException, RemoteException {
+		final Network network = NetworkFactory.getNetworkByName(name);
+		try {
+			if (!network.hupUntilUp(50, 10000)) {
+				reportResult(false);
+			}
+		} catch (final PuppeTorException e) {
+			e.printStackTrace();
+			reportResult(false);
+		}
+		reportResult(true);
+	}
+
+}

Added: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateDirectoryAuthorityTask.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateDirectoryAuthorityTask.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateDirectoryAuthorityTask.java	2008-08-14 14:49:44 UTC (rev 16547)
@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.tasks;
+
+import java.rmi.RemoteException;
+
+import de.uniba.wiai.lspi.puppetor.Network;
+import de.uniba.wiai.lspi.puppetor.NetworkFactory;
+import de.uniba.wiai.lspi.puppetor.PuppeTorException;
+import de.uniba.wiai.lspi.puppetor.rmi.impl.AbstractTaskImpl;
+
+public class CreateDirectoryAuthorityTask extends AbstractTaskImpl {
+
+	/**
+	 * Required for serialization. Needs to change for new released versions.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * The name of this tor authority.
+	 */
+	private final String authorityName;
+
+	public CreateDirectoryAuthorityTask(final int id, final String networkName,
+			final String authorityName) {
+		super(id, networkName);
+		this.authorityName = authorityName;
+	}
+
+	@Override
+	public void execute() throws InterruptedException, RemoteException {
+		final Network network = NetworkFactory.getNetworkByName(name);
+		network.createDirectory(authorityName);
+
+		// write configuration of proxy node
+		try {
+			network.writeConfigurations();
+			System.out.println("wrote authority configuration");
+		} catch (final PuppeTorException e) {
+			e.printStackTrace();
+			reportResult(false);
+		}
+		reportResult(true);
+	}
+}

Added: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateProxyTask.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateProxyTask.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateProxyTask.java	2008-08-14 14:49:44 UTC (rev 16547)
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.tasks;
+
+import java.rmi.RemoteException;
+
+import de.uniba.wiai.lspi.puppetor.Network;
+import de.uniba.wiai.lspi.puppetor.NetworkFactory;
+import de.uniba.wiai.lspi.puppetor.PuppeTorException;
+import de.uniba.wiai.lspi.puppetor.rmi.impl.AbstractTaskImpl;
+
+public class CreateProxyTask extends AbstractTaskImpl {
+
+	/**
+	 * Required for serialization. Needs to change for new released versions.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * The name of this tor proxy.
+	 */
+	private final String proxyName;
+
+	public CreateProxyTask(final int id, final String networkName,
+			final String proxyName) {
+		super(id, networkName);
+		this.proxyName = proxyName;
+	}
+
+	@Override
+	public void execute() throws InterruptedException, RemoteException {
+		final Network network = NetworkFactory.getNetworkByName(name);
+		network.createProxy(proxyName);
+
+		// write configuration of proxy node
+		try {
+			network.writeConfigurations();
+			System.out.println("wrote proxy configuration");
+		} catch (final PuppeTorException e) {
+			e.printStackTrace();
+			reportResult(false);
+		}
+		reportResult(true);
+	}
+
+}

Added: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateRouterTask.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateRouterTask.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/CreateRouterTask.java	2008-08-14 14:49:44 UTC (rev 16547)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.tasks;
+
+import java.rmi.RemoteException;
+
+import de.uniba.wiai.lspi.puppetor.Network;
+import de.uniba.wiai.lspi.puppetor.NetworkFactory;
+import de.uniba.wiai.lspi.puppetor.PuppeTorException;
+import de.uniba.wiai.lspi.puppetor.rmi.impl.AbstractTaskImpl;
+
+public class CreateRouterTask extends AbstractTaskImpl {
+
+	/**
+	 * Required for serialization. Needs to change for new released versions.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * The name of this router.
+	 */
+	private final String routerName;
+
+	public CreateRouterTask(final int id, final String networkName,
+			final String routerName) {
+		super(id, networkName);
+		this.routerName = routerName;
+	}
+
+	@Override
+	public void execute() throws InterruptedException, RemoteException {
+		final Network network = NetworkFactory.getNetworkByName(name);
+		network.createRouter(routerName);
+		// write configuration of router node
+		try {
+			network.writeConfigurations();
+			System.out.println("wrote authority configuration");
+		} catch (final PuppeTorException e) {
+			e.printStackTrace();
+			reportResult(false);
+		}
+		reportResult(true);
+	}
+}

Added: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/ShutdownNodesTask.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/ShutdownNodesTask.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/ShutdownNodesTask.java	2008-08-14 14:49:44 UTC (rev 16547)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.tasks;
+
+import java.rmi.RemoteException;
+
+import de.uniba.wiai.lspi.puppetor.Network;
+import de.uniba.wiai.lspi.puppetor.NetworkFactory;
+import de.uniba.wiai.lspi.puppetor.PuppeTorException;
+import de.uniba.wiai.lspi.puppetor.rmi.impl.AbstractTaskImpl;
+
+public class ShutdownNodesTask extends AbstractTaskImpl {
+
+	/**
+	 * Required for serialization. Needs to change for new released versions.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	public ShutdownNodesTask(final int id, final String name) {
+		super(id, name);
+	}
+
+	@Override
+	public void execute() throws InterruptedException, RemoteException {
+		final Network network = NetworkFactory.getNetworkByName(name);
+		try {
+			network.shutdownNodes();
+			reportResult(true);
+		} catch (final PuppeTorException e) {
+			reportResult(false);
+		}
+	}
+
+}

Added: puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/StartNodesTask.java
===================================================================
--- puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/StartNodesTask.java	                        (rev 0)
+++ puppetor/branches/gsoc2008/src/de/uniba/wiai/lspi/puppetor/rmi/tasks/StartNodesTask.java	2008-08-14 14:49:44 UTC (rev 16547)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2008, Sebastian Hahn
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ *     * Neither the names of the copyright owners nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package de.uniba.wiai.lspi.puppetor.rmi.tasks;
+
+import java.rmi.RemoteException;
+
+import de.uniba.wiai.lspi.puppetor.Network;
+import de.uniba.wiai.lspi.puppetor.NetworkFactory;
+import de.uniba.wiai.lspi.puppetor.PuppeTorException;
+import de.uniba.wiai.lspi.puppetor.rmi.impl.AbstractTaskImpl;
+
+public class StartNodesTask extends AbstractTaskImpl {
+
+	/**
+	 * Required for serialization. Needs to change for new released versions.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	public StartNodesTask(final int id, final String networkName) {
+		super(id, networkName);
+	}
+
+	@Override
+	public void execute() throws InterruptedException, RemoteException {
+		final Network network = NetworkFactory.getNetworkByName(name);
+		try {
+			if (!network.startNodes(5000)) {
+				// failed to start the proxy
+				reportResult(false);
+			}
+		} catch (final PuppeTorException e) {
+			e.printStackTrace();
+			reportResult(false);
+		}
+		reportResult(true);
+	}
+
+}



More information about the tor-commits mailing list