some basic stuff
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 4 Jun 2008 06:33:08 +0000 (08:33 +0200)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 4 Jun 2008 06:33:08 +0000 (08:33 +0200)
src/net/pterodactylus/fac/core/Core.java [new file with mode: 0644]
src/net/pterodactylus/fac/core/Insert.java [new file with mode: 0644]
src/net/pterodactylus/fac/core/InsertManager.java [new file with mode: 0644]
src/net/pterodactylus/fac/main/Main.java [new file with mode: 0644]

diff --git a/src/net/pterodactylus/fac/core/Core.java b/src/net/pterodactylus/fac/core/Core.java
new file mode 100644 (file)
index 0000000..25312aa
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * fac - Core.java -
+ * Copyright © 2008 David Roden
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+package net.pterodactylus.fac.core;
+
+/**
+ * TODO
+ * 
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+ */
+public class Core {
+
+       /** The shutdown hook. */
+       @SuppressWarnings("synthetic-access")
+       private final Runnable shutdownHook = new ShutdownHook();
+
+       /**
+        * Constructor.
+        */
+       public Core() {
+               Runtime.getRuntime().addShutdownHook(new Thread(shutdownHook));
+       }
+
+       //
+       // ACTIONS
+       //
+
+       /**
+        * Starts the core.
+        */
+       public void start() {
+               /* TODO */
+       }
+
+       /**
+        * Shutdown hook.
+        * 
+        * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+        */
+       private class ShutdownHook implements Runnable {
+
+               /**
+                * {@inheritDoc}
+                */
+               public void run() {
+                       /* TODO */
+               }
+
+       }
+
+}
diff --git a/src/net/pterodactylus/fac/core/Insert.java b/src/net/pterodactylus/fac/core/Insert.java
new file mode 100644 (file)
index 0000000..2482717
--- /dev/null
@@ -0,0 +1,145 @@
+/*
+ * fac - Insert.java -
+ * Copyright © 2008 David Roden
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+package net.pterodactylus.fac.core;
+
+/**
+ * Data container that keeps statistics of an insert.
+ * 
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+ */
+public class Insert {
+
+       /** The time the data was inserted. */
+       private long insertTime;
+
+       /** The URI the data generated. */
+       private String uri;
+
+       /** The time the data should be retrieved. */
+       private long checkTime;
+
+       /** Whether the data was already checked. */
+       private boolean checked;
+
+       /** Whether the data was successfully downloaded. */
+       private boolean successful;
+
+       /**
+        * Returns the time the data was inserted.
+        * 
+        * @return The time the data was inserted
+        */
+       public long getInsertTime() {
+               return insertTime;
+       }
+
+       /**
+        * Sets the time the data was inserted.
+        * 
+        * @param insertTime
+        *            The time the data was inserted
+        */
+       public void setInsertTime(long insertTime) {
+               this.insertTime = insertTime;
+       }
+
+       /**
+        * Returns the URI generated by the data.
+        * 
+        * @return The URI of the data
+        */
+       public String getURI() {
+               return uri;
+       }
+
+       /**
+        * Sets the URI generated by the data
+        * 
+        * @param uri
+        *            The URI of the data
+        */
+       public void setURI(String uri) {
+               this.uri = uri;
+       }
+
+       /**
+        * Returns the time the data should be checked.
+        * 
+        * @return The time the data should be checked
+        */
+       public long getCheckTime() {
+               return checkTime;
+       }
+
+       /**
+        * Sets the time the data should be checked.
+        * 
+        * @param checkTime
+        *            The time the data should be checked
+        */
+       public void setCheckTime(long checkTime) {
+               this.checkTime = checkTime;
+       }
+
+       /**
+        * Returns whether the data has already been checked, i.e. a check already
+        * returned a result.
+        * 
+        * @return <code>true</code> if the data was already checked,
+        *         <code>false</code> otherwise
+        */
+       public boolean isChecked() {
+               return checked;
+       }
+
+       /**
+        * Sets whether the data has already been checked, i.e. a check already
+        * returned a result.
+        * 
+        * @param checked
+        *            <code>true</code> if the data was already checked,
+        *            <code>false</code> otherwise
+        */
+       public void setChecked(boolean checked) {
+               this.checked = checked;
+       }
+
+       /**
+        * Returns whether the data was checked successfully.
+        * 
+        * @return <code>true</code> if the data was checked successfully,
+        *         <code>false</code> otherwise
+        */
+       public boolean isSuccessful() {
+               return successful;
+       }
+
+       /**
+        * Sets whether the data was checked successfully.
+        * 
+        * @param successful
+        *            <code>true</code> if the data was checked successfully,
+        *            <code>false</code> otherwise
+        */
+       public void setSuccessful(boolean successful) {
+               this.successful = successful;
+       }
+
+}
diff --git a/src/net/pterodactylus/fac/core/InsertManager.java b/src/net/pterodactylus/fac/core/InsertManager.java
new file mode 100644 (file)
index 0000000..92062a5
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * fac - InsertManager.java -
+ * Copyright © 2008 David Roden
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+package net.pterodactylus.fac.core;
+
+
+/**
+ * TODO
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+ */
+public class InsertManager {
+
+       /* TODO */
+
+}
diff --git a/src/net/pterodactylus/fac/main/Main.java b/src/net/pterodactylus/fac/main/Main.java
new file mode 100644 (file)
index 0000000..f522b83
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * fac - Main.java -
+ * Copyright © 2008 David Roden
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+package net.pterodactylus.fac.main;
+
+import net.pterodactylus.fac.core.Core;
+
+/**
+ * Main class.
+ * 
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
+ */
+public class Main {
+
+       /**
+        * Starts the core.
+        * 
+        * @param commandLine
+        *            Command-line parameters (ignored)
+        */
+       public static void main(String[] commandLine) {
+               Core core = new Core();
+
+               core.start();
+       }
+
+}