You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2017/07/17 23:05:25 UTC
[10/88] [abbrv] [partial] oodt git commit: Record change for OODT-836,
OODT-837.
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
deleted file mode 100644
index 9e25a25..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/RemoteSpecs.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.oodt.cas.pushpull.config;
-
-import org.apache.oodt.cas.metadata.util.PathUtils;
-import org.apache.oodt.cas.pushpull.exceptions.ConfigException;
-import org.apache.oodt.cas.pushpull.filerestrictions.Parser;
-import org.apache.oodt.cas.pushpull.filerestrictions.renamingconventions.RenamingConvention;
-import org.apache.oodt.cas.pushpull.objectfactory.PushPullObjectFactory;
-import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
-import org.apache.oodt.commons.xml.XMLUtils;
-
-import com.google.common.base.Strings;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.net.URL;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.LinkedList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-
-/**
- * Remote Site Crawling specifications.
- *
- * @author bfoster (Brian Foster)
- */
-public class RemoteSpecs implements ConfigParserMetKeys {
- private static Logger LOG = Logger.getLogger(RemoteSpecs.class.getName());
- LinkedList<Parser> parsers;
-
- LinkedList<RenamingConvention> renamingConvs;
-
- LinkedList<DaemonInfo> daemonInfoList;
-
- SiteInfo siteInfo;
-
- public RemoteSpecs() {
- this.parsers = new LinkedList<Parser>();
- this.renamingConvs = new LinkedList<RenamingConvention>();
- daemonInfoList = new LinkedList<DaemonInfo>();
- siteInfo = new SiteInfo();
- }
-
- public void loadRemoteSpecs(File remoteSpecsFile) throws ConfigException {
- try {
-
- Element root = XMLUtils.getDocumentRoot(
- new FileInputStream(remoteSpecsFile)).getDocumentElement();
- NodeList aliasSpecList = root.getElementsByTagName(ALIAS_SPEC_TAG);
- for (int i = 0; i < aliasSpecList.getLength(); i++) {
- this.parseAndStoreLoginInfo(new File(PathUtils
- .replaceEnvVariables(((Element) aliasSpecList.item(i))
- .getAttribute(FILE_ATTR))));
- }
-
- // get DAEMON elements
- NodeList daemonList = root.getElementsByTagName(DAEMON_TAG);
- for (int i = 0; i < daemonList.getLength(); i++) {
- Node daemonNode = daemonList.item(i);
-
- // check if set to active (skip otherwise)
- if (PathUtils.replaceEnvVariables(
- ((Element) daemonNode).getAttribute(ACTIVE_ATTR))
- .equals("no")) {
- continue;
- }
-
- DaemonInfo di = null;
-
- // get site alias
- String siteAlias = PathUtils
- .replaceEnvVariables(((Element) daemonNode)
- .getAttribute(ALIAS_ATTR));
- RemoteSite dataFilesRemoteSite = this.siteInfo
- .getSiteByAlias(siteAlias);
- if (dataFilesRemoteSite == null) {
- throw new ConfigException("Alias '" + siteAlias
- + "' in SiteInfo file '"
- + remoteSpecsFile.getAbsolutePath()
- + "' has not been defined");
- }
-
- // get RUNINFO element
- NodeList runInfoList = ((Element) daemonNode)
- .getElementsByTagName(RUN_INFO_TAG);
- String firstRunDateTimeString = null, period = null, epsilon = null;
- boolean runOnReboot = false;
- if (runInfoList.getLength() > 0) {
- Element runInfo = (Element) runInfoList.item(0);
- firstRunDateTimeString = runInfo
- .getAttribute(FIRSTRUN_DATETIME_ATTR);
- period = runInfo.getAttribute(PERIOD_ATTR);
- runOnReboot = (runInfo.getAttribute(RUNONREBOOT_ATTR)
- .toLowerCase().equals("yes"));
- epsilon = runInfo.getAttribute(EPSILON_ATTR);
- if (epsilon.equals("")) {
- epsilon = "0s";
- }
- }
-
- // get PROPINFO elements
- NodeList propInfoList = ((Element) daemonNode)
- .getElementsByTagName(PROP_INFO_TAG);
- LinkedList<PropFilesInfo> pfiList = new LinkedList<PropFilesInfo>();
- PropFilesInfo pfi;
- if (propInfoList.getLength() > 0) {
- Node propInfoNode = propInfoList.item(0);
-
- // get directory where the property files are
- File propertyFilesDir = new File(PathUtils
- .replaceEnvVariables(((Element) propInfoNode)
- .getAttribute(DIR_ATTR)));
-
- pfi = new PropFilesInfo(propertyFilesDir);
-
- // get PROPFILES elements
- NodeList propFilesList = ((Element) propInfoNode)
- .getElementsByTagName(PROP_FILES_TAG);
- String propFilesRegExp = null;
- if (propFilesList.getLength() > 0) {
- for (int k = 0; k < propFilesList.getLength(); k++) {
- Node propFilesNode = propFilesList.item(k);
- propFilesRegExp = ((Element) propFilesNode)
- .getAttribute(REG_EXP_ATTR);
- pfi
- .addPropFiles(
- propFilesRegExp,
- PushPullObjectFactory
- .createNewInstance((Class<Parser>) Class
- .forName(PathUtils
- .replaceEnvVariables(((Element) propFilesNode)
- .getAttribute(PARSER_ATTR)))));
- }
- } else {
- throw new ConfigException(
- "No propFiles element specified for deamon with alias '"
- + siteAlias + "' in RemoteSpecs file '"
- + remoteSpecsFile.getAbsolutePath()
- + "'");
- }
-
- // get DOWNLOADINFO element if given
- NodeList downloadInfoList = ((Element) propInfoNode)
- .getElementsByTagName(DOWNLOAD_INFO_TAG);
- if (downloadInfoList.getLength() > 0) {
- Node downloadInfo = downloadInfoList.item(0);
- String propFilesAlias = PathUtils
- .replaceEnvVariables(((Element) downloadInfo)
- .getAttribute(ALIAS_ATTR));
- String propFilesRenamingConv = ((Element) downloadInfo)
- .getAttribute(RENAMING_CONV_ATTR);
- boolean allowAliasOverride = PathUtils
- .replaceEnvVariables(
- ((Element) downloadInfo)
- .getAttribute(ALLOW_ALIAS_OVERRIDE_ATTR))
- .equals("yes");
- boolean deleteFromServer = PathUtils
- .replaceEnvVariables(
- ((Element) downloadInfo)
- .getAttribute(DELETE_FROM_SERVER_ATTR))
- .equals("yes");
- RemoteSite propFilesRemoteSite = this.siteInfo
- .getSiteByAlias(propFilesAlias);
- if (propFilesRemoteSite == null) {
- throw new ConfigException("Alias '"
- + propFilesAlias
- + "' in RemoteSpecs file '"
- + remoteSpecsFile.getAbsolutePath()
- + "' has not been defined");
- }
- String regExp = ((Element) downloadInfo)
- .getAttribute(REG_EXP_ATTR);
- if (regExp.equals("")) {
- regExp = propFilesRegExp;
- }
- NodeList propsList = ((Element) propInfoNode)
- .getElementsByTagName(PROP_FILE_TAG);
- ConcurrentHashMap<File, Parser> propFileToParserMap = new ConcurrentHashMap<File, Parser>();
- for (int p = 0; p < propsList.getLength(); p++) {
- Element propElem = (Element) propsList.item(p);
- propFileToParserMap
- .put(
- new File(
- PathUtils
- .replaceEnvVariables(propElem
- .getAttribute(PATH_ATTR))),
- PushPullObjectFactory
- .createNewInstance((Class<Parser>) Class
- .forName(PathUtils
- .replaceEnvVariables(propElem
- .getAttribute(PARSER_ATTR)))));
- }
- pfi.setDownloadInfo(new DownloadInfo(
- propFilesRemoteSite, propFilesRenamingConv,
- deleteFromServer, propertyFilesDir,
- allowAliasOverride), propFileToParserMap);
- }
-
- // get AFTERUSE element
- NodeList afterUseList = ((Element) propInfoNode)
- .getElementsByTagName(AFTER_USE_TAG);
- if (afterUseList.getLength() > 0) {
- Element afterUse = (Element) afterUseList.item(0);
- File onSuccessDir = new File(PathUtils
- .replaceEnvVariables(afterUse
- .getAttribute(MOVEON_TO_SUCCESS_ATTR)));
- File onFailDir = new File(PathUtils
- .replaceEnvVariables(afterUse
- .getAttribute(MOVEON_TO_FAIL_ATTR)));
- pfi.setAfterUseEffects(onSuccessDir, onFailDir);
- boolean deleteOnSuccess = Boolean.parseBoolean(PathUtils
- .replaceEnvVariables(afterUse
- .getAttribute(DELETE_ON_SUCCESS_ATTR)));
- pfi.setDeleteOnSuccess(deleteOnSuccess);
- }
-
- } else {
- throw new ConfigException(
- "No propInfo element specified for deamon with alias '"
- + siteAlias + "' in RemoteSpecs file '"
- + remoteSpecsFile.getAbsolutePath() + "'");
- }
-
- // get DATAINFO elements
- NodeList dataInfoList = ((Element) daemonNode)
- .getElementsByTagName(DATA_INFO_TAG);
- DataFilesInfo dfi = null;
- if (dataInfoList.getLength() > 0) {
- Node dataInfo = dataInfoList.item(0);
- String queryElement = ((Element) dataInfo)
- .getAttribute(QUERY_ELEM_ATTR);
- if (Strings.isNullOrEmpty(queryElement)) {
- queryElement = null;
- } else {
- queryElement = PathUtils.replaceEnvVariables(queryElement);
- }
- String renamingConv = ((Element) dataInfo)
- .getAttribute(RENAMING_CONV_ATTR);
- if (Strings.isNullOrEmpty(renamingConv)) {
- renamingConv = null;
- }
- boolean allowAliasOverride = PathUtils.replaceEnvVariables(
- ((Element) dataInfo)
- .getAttribute(ALLOW_ALIAS_OVERRIDE_ATTR))
- .equals("yes");
- File stagingArea = new File(PathUtils
- .replaceEnvVariables(((Element) dataInfo)
- .getAttribute(STAGING_AREA_ATTR)));
- boolean deleteFromServer = PathUtils.replaceEnvVariables(
- ((Element) dataInfo)
- .getAttribute(DELETE_FROM_SERVER_ATTR))
- .equals("yes");
- dfi = new DataFilesInfo(queryElement, new DownloadInfo(
- dataFilesRemoteSite, renamingConv,
- deleteFromServer, stagingArea, allowAliasOverride));
- } else {
- throw new ConfigException(
- "No dataInfo element specified for deamon with alias '"
- + siteAlias + "' in RemoteSpecs file '"
- + remoteSpecsFile.getAbsolutePath() + "'");
- }
-
- daemonInfoList.add(new DaemonInfo(firstRunDateTimeString,
- period, epsilon, runOnReboot, pfi, dfi));
- }
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- throw new ConfigException("Failed to load crawl elements : "
- + e.getMessage());
- }
- }
-
- void parseAndStoreLoginInfo(File loginInfoFile) throws ConfigException {
- try {
- NodeList sourceList = XMLUtils.getDocumentRoot(new FileInputStream(loginInfoFile))
- .getElementsByTagName(SOURCE_TAG);
- for (int i = 0; i < sourceList.getLength(); i++) {
-
- // get source element
- Node sourceNode = sourceList.item(i);
-
- // get host of this source
- String host = PathUtils
- .replaceEnvVariables(((Element) sourceNode)
- .getAttribute(HOST_ATTR));
-
- // get all login info for this source
- NodeList loginList = ((Element) sourceNode)
- .getElementsByTagName(LOGIN_ATTR);
- for (int j = 0; j < loginList.getLength(); j++) {
-
- // get a single login info
- Node loginNode = loginList.item(j);
- String type = PathUtils
- .replaceEnvVariables(((Element) loginNode)
- .getAttribute(TYPE_ATTR));
- String alias = PathUtils
- .replaceEnvVariables(((Element) loginNode)
- .getAttribute(ALIAS_ATTR));
- String username = null, password = null, cdTestDir = null;
- int maxConnections = -1;
-
- // parse this login info
- NodeList loginInfo = loginNode.getChildNodes();
- for (int k = 0; k < loginInfo.getLength(); k++) {
-
- // get a single login info element
- Node node = loginInfo.item(k);
-
- // determine what element type it is
- if (node.getNodeName().equals(USERNAME_TAG)) {
- username = PathUtils.replaceEnvVariables(
- XMLUtils.getSimpleElementText((Element) node, true));
- } else if (node.getNodeName().equals(PASSWORD_TAG)) {
- password = PathUtils.replaceEnvVariables(
- XMLUtils.getSimpleElementText((Element) node, true));
- } else if (node.getNodeName().equals(CD_TEST_DIR_TAG)) {
- cdTestDir = PathUtils.replaceEnvVariables(
- XMLUtils.getSimpleElementText((Element) node, true));
- } else if (node.getNodeName().equals(MAX_CONN_TAG)) {
- maxConnections = Integer.parseInt(PathUtils.replaceEnvVariables(
- XMLUtils.getSimpleElementText((Element) node, true)));
- }
- }
-
- this.siteInfo.addSite(new RemoteSite(alias, new URL(type
- + "://" + host), username, password, cdTestDir, maxConnections));
- }
- }
- } catch (Exception e) {
- throw new ConfigException("Failed to load external source info : "
- + e.getMessage(), e);
- }
- }
-
- public LinkedList<DaemonInfo> getDaemonInfoList() {
- return this.daemonInfoList;
- }
-
- public SiteInfo getSiteInfo() {
- return this.siteInfo;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
deleted file mode 100644
index 63ed83c..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/config/SiteInfo.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.config;
-
-//JDK imports
-import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
-
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.LinkedList;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-//OODT imports
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class SiteInfo {
-
- /* our log stream */
- private final static Logger LOG = Logger.getLogger(SiteInfo.class
- .getName());
-
- private ConcurrentHashMap<String, RemoteSite> aliasAndRemoteSite;
-
- public SiteInfo() {
- aliasAndRemoteSite = new ConcurrentHashMap<String, RemoteSite>();
- }
-
- public void addSite(RemoteSite rs) {
- this.aliasAndRemoteSite.put(rs.getAlias(), rs);
- }
-
- public RemoteSite getSiteByAlias(String alias) {
- return this.aliasAndRemoteSite.get(alias);
- }
-
- public LinkedList<RemoteSite> getPossibleRemoteSites(String alias, URL url,
- String username, String password) {
- LinkedList<RemoteSite> remoteSites = new LinkedList<RemoteSite>();
- if (alias != null) {
- RemoteSite rs = this.aliasAndRemoteSite.get(alias);
- if (rs != null) {
- remoteSites.add(rs);
- } else if (url != null && username != null & password != null) {
- remoteSites.add(new RemoteSite(alias, url, username, password));
- }
- } else if (url != null) {
- Set<Entry<String, RemoteSite>> set = this.aliasAndRemoteSite
- .entrySet();
- for (Entry<String, RemoteSite> entry : set) {
- RemoteSite rs = entry.getValue();
- try {
- if (rs.getURL().toURI().equals(url.toURI())
- && (username == null || rs.getUsername().equals(
- username))
- && (password == null || rs.getPassword().equals(
- password))) {
- remoteSites.add(rs);
- }
- } catch (URISyntaxException e) {
- LOG.log(Level.SEVERE, "Could not convert URL to URI Message: "+e.getMessage());
- }
- }
- if (remoteSites.size() == 0) {
- if (username != null && password != null) {
- remoteSites.add(new RemoteSite(url.toString(), url,
- username, password));
- }
- }
- } else if (username != null) {
- Set<Entry<String, RemoteSite>> set = this.aliasAndRemoteSite
- .entrySet();
- for (Entry<String, RemoteSite> entry : set) {
- RemoteSite rs = entry.getValue();
- if (rs.getUsername().equals(username)
- && (password == null || rs.getPassword().equals(
- password))) {
- remoteSites.add(rs);
- }
- }
- } else if (password != null) {
- Set<Entry<String, RemoteSite>> set = this.aliasAndRemoteSite
- .entrySet();
- for (Entry<String, RemoteSite> entry : set) {
- RemoteSite rs = entry.getValue();
- if (rs.getPassword().equals(password)) {
- remoteSites.add(rs);
- }
- }
- }
- return remoteSites;
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
deleted file mode 100644
index 3e12268..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/Daemon.java
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-//OODT imports
-import org.apache.oodt.cas.pushpull.config.Config;
-import org.apache.oodt.cas.pushpull.config.DaemonInfo;
-import org.apache.oodt.cas.pushpull.config.SiteInfo;
-import org.apache.oodt.cas.pushpull.protocol.RemoteSite;
-import org.apache.oodt.cas.pushpull.retrievalsystem.RetrievalSetup;
-
-//JDK imports
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.net.MalformedURLException;
-import java.rmi.AlreadyBoundException;
-import java.rmi.Naming;
-import java.rmi.NotBoundException;
-import java.rmi.RemoteException;
-import java.rmi.registry.LocateRegistry;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-//JMX imports
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-/**
- * Controls the execution times of the Crawler it is given. The Crawler is
- * specified by the properties file passed in. A Crawler will be created per the
- * properties file and executed at six hour intervals. This class can be
- * controlled by CrawlDaemonController after is has been started up.
- *
- * @author bfoster
- */
-public class Daemon extends UnicastRemoteObject implements DaemonRmiInterface,
- DaemonMBean {
-
- private static final long serialVersionUID = 7660972939723142802L;
-
- private DaemonListener daemonListener;
-
- /* our log stream */
- private static final Logger LOG = Logger.getLogger(Daemon.class.getName());
-
- /**
- * Keeps track of whether the Crawler is running or not
- */
- private boolean isRunning;
-
- /**
- * If set to false the CrawlDaemon will terminate after the Crawler finishes
- * crawling its current site.
- */
- private boolean keepRunning;
-
- /**
- * The time at which the Constructor is called
- */
- private long daemonCreationTime;
-
- /**
- * The total time during which the Crawl is actually running -- wait() time
- * is not included.
- */
- private long daemonTotalRuntime;
-
- /**
- * Total number of times the Crawler has been run
- */
- private int numberOfCrawls;
-
- private File propFilesDir;
-
- private int daemonID;
-
- private RetrievalSetup rs;
-
- private Config config;
-
- private DaemonInfo daemonInfo;
-
- private MBeanServer mbs;
-
- private int rmiRegPort;
-
- /**
- * Constructor
- *
- * @throws RemoteException
- * @throws RemoteException
- * @throws InstantiationException
- * @throws IOException
- * @throws SecurityException
- */
- public Daemon(int rmiRegPort, int daemonID, Config config,
- DaemonInfo daemonInfo, SiteInfo siteInfo) throws RemoteException {
- super();
-
- this.rmiRegPort = rmiRegPort;
- this.daemonID = daemonID;
- rs = new RetrievalSetup(config, siteInfo);
- this.config = config;
- this.daemonInfo = daemonInfo;
-
- daemonCreationTime = System.currentTimeMillis();
- daemonTotalRuntime = 0;
- numberOfCrawls = 0;
- isRunning = false;
-
- try {
- registerRMIServer();
- } catch (Exception e) {
- LOG.log(Level.SEVERE, "Failed to bind to RMI server : "
- + e.getMessage());
- }
-
- try {
- // registry CrawlDaemon as MBean so it can be used with jconsole
- mbs = ManagementFactory.getPlatformMBeanServer();
- ObjectName name = new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=Daemon"
- + this.getDaemonID());
- mbs.registerMBean(this, name);
- } catch (Exception e) {
- LOG.log(Level.SEVERE,
- "Failed to register CrawlDaemon as a MBean Object : "
- + e.getMessage());
- }
- }
-
- public String getName() {
- return "Daemon" + this.getDaemonID();
- }
-
- private void registerRMIServer() throws RemoteException {
- try {
- Naming.bind("//localhost:" + this.rmiRegPort + "/daemon"
- + this.getDaemonID(), this);
- LOG.log(Level.INFO, "Created Daemon ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort);
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- throw new RemoteException("Failed to bind Daemon with ID = "
- + this.getDaemonID() + " to RMI registry at port "
- + this.rmiRegPort);
- }
- }
-
- public void registerDaemonListener(DaemonListener daemonListener) {
- this.daemonListener = daemonListener;
- this.daemonListener.wasRegisteredWith(this);
- }
-
- /**
- * Loads and executes the Crawler specified by the properties file. It will
- * crawl the URLs specified in the properties file in the sequence
- * given--one at a time.
- *
- * @throws DirStructException
- */
- public void startDaemon() {
- new Thread(new Runnable() {
-
- public void run() {
-
- // check if Daemon should sleep first
- long timeTilNextRun;
- if ((timeTilNextRun = Daemon.this.calculateTimeTilNextRun()) != 0
- && !(Daemon.this.beforeToday(daemonInfo
- .getFirstRunDateTime()) && daemonInfo
- .runOnReboot())) {
- sleep(timeTilNextRun);
- }
-
- for (keepRunning = true; keepRunning;) {
- long startTime = System.currentTimeMillis();
-
- // get permission to run
- Daemon.this.notifyDaemonListenerOfStart();
- if (!keepRunning) {
- Daemon.this.notifyDaemonListenerOfFinish();
- System.out.println("BREAKING OUT");
- break;
- }
-
- // run
- Daemon.this.isRunning = true;
-
- try {
- rs.retrieveFiles(daemonInfo.getPropFilesInfo(),
- daemonInfo.getDataFilesInfo());
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- } finally {
- numberOfCrawls++;
- }
-
- Daemon.this.isRunning = false;
-
- // calculate performance and sleep
- Daemon.this.notifyDaemonListenerOfFinish();
- Daemon.this.calculateAndStoreElapsedTime(startTime);
- if (Daemon.this.keepRunning
- && daemonInfo.getTimeIntervalInMilliseconds() >= 0) {
- sleep(Daemon.this.calculateTimeTilNextRun());
- } else {
- break;
- }
- }
- LOG.log(Level.INFO, "Daemon with ID = "
- + Daemon.this.getDaemonID() + " on RMI registry port "
- + Daemon.this.rmiRegPort + " is shutting down");
- Daemon.this.unregister();
- }
- }).start();
- }
-
- private void unregister() {
- try {
- // unregister CrawlDaemon from RMI registry
- Naming.unbind("//localhost:" + this.rmiRegPort + "/daemon"
- + this.getDaemonID());
- this.mbs.unregisterMBean(new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=Daemon"
- + this.getDaemonID()));
- UnicastRemoteObject.unexportObject(this, true);
- this.daemonListener.wasUnregisteredWith(this);
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }
- }
-
- public int getDaemonID() {
- return Integer.parseInt(this.rmiRegPort + "" + this.daemonID);
- }
-
- private long calculateTimeTilNextRun() {
- GregorianCalendar now = new GregorianCalendar();
- GregorianCalendar gcStartDateTime = new GregorianCalendar();
- gcStartDateTime.setTime(daemonInfo.getFirstRunDateTime());
- long diff = now.getTimeInMillis() - gcStartDateTime.getTimeInMillis();
- if (Math.abs(diff) <= daemonInfo.getEpsilonInMilliseconds()) {
- return 0;
- } else if (diff < 0) {
- return gcStartDateTime.getTimeInMillis() - now.getTimeInMillis();
- } else if (daemonInfo.getTimeIntervalInMilliseconds() == 0) {
- return 0;
- } else {
- int numOfPeriods = (int) (diff / daemonInfo
- .getTimeIntervalInMilliseconds());
- long nextRunTime = gcStartDateTime.getTimeInMillis()
- + ((numOfPeriods + 1) * daemonInfo
- .getTimeIntervalInMilliseconds());
- return nextRunTime - now.getTimeInMillis();
- }
- }
-
- private boolean beforeToday(Date date) {
- return date.before(new Date(System.currentTimeMillis()));
- }
-
- private void notifyDaemonListenerOfStart() {
- if (this.daemonListener != null) {
- this.daemonListener.daemonStarting(this);
- }
- }
-
- private void notifyDaemonListenerOfFinish() {
- if (this.daemonListener != null) {
- this.daemonListener.daemonFinished(this);
- }
- }
-
- private void sleep(long length) {
- if (length > 0) {
- LOG.log(Level.INFO, "Daemon with ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort
- + " is going to sleep until "
- + new Date(System.currentTimeMillis() + length));
- synchronized (this) {
- try {
- wait(length);
- } catch (InterruptedException ignored) {
- }
- }
- }
- }
-
- private long calculateAndStoreElapsedTime(long startTime) {
- long elapsedTime = System.currentTimeMillis() - startTime;
- daemonTotalRuntime += elapsedTime;
- return elapsedTime;
- }
-
- public synchronized void pauseDaemon() {
- try {
- LOG.log(Level.INFO, "Daemon with ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort
- + " has been stopped");
- this.wait(0);
- } catch (Exception ignored) {
- }
- LOG.log(Level.INFO, "Daemon with ID = " + this.getDaemonID()
- + " on RMI registry port " + this.rmiRegPort + " has resumed");
- }
-
- /**
- * Wakes up the CrawlDaemon if it is sleeping
- */
- public synchronized void resume() {
- notify();
- }
-
- /**
- * Will terminate the CrawlDaemon. If its Crawler is crawling a site when
- * this method is called, the terminate won't take place until after the
- * Crawler has complete crawling that site.
- */
- public synchronized void quit() {
- keepRunning = false;
- resume();
- }
-
- /**
- * Can be used to determine if Crawler is presently running
- *
- * @return true if Crawler is runnning
- * @uml.property name="isRunning"
- */
- public boolean isRunning() {
- return isRunning;
- }
-
- /**
- * Average runtime for the Crawler
- *
- * @return average runtime for the Crawler
- */
- public long getAverageRunTime() {
- return daemonTotalRuntime / numberOfCrawls;
- }
-
- /**
- * Gets the total crawling time of the Crawler
- *
- * @return Total crawling time of Crawler
- */
- public long getMillisCrawling() {
- return daemonTotalRuntime;
- }
-
- /**
- * Gets the time between the start of Crawler executions
- *
- * @return Time interval between Crawler start times
- */
- public long getTimeInterval() {
- return daemonInfo.getTimeIntervalInMilliseconds();
- }
-
- /**
- * Gets the total number of times the Crawler has been run
- *
- * @return The number of times Crawler has run
- */
- public int getNumCrawls() {
- return numberOfCrawls;
- }
-
- public String[] downloadedFilesInStagingArea() {
- return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getStagingArea().list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return !name.startsWith("Downloading_")
- && !(name.endsWith("info.tmp") || name
- .endsWith("cas"));
- }
- });
- }
-
- public String[] downloadingFilesInStagingArea() {
- return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getStagingArea().list(new FilenameFilter() {
- public boolean accept(File dir, String name) {
- return name.startsWith("Downloading_")
- && !(name.endsWith("info.tmp") || name
- .endsWith("cas"));
- }
- });
- }
-
- public int numberOfFilesDownloadingInStagingArea() {
- return this.downloadingFilesInStagingArea().length;
- }
-
- public int numberOfFilesDownloadedInStagingArea() {
- return this.downloadedFilesInStagingArea().length;
- }
-
- // ***************DaemonInfo******************
- public long getTimeIntervalInMilliseconds() {
- return this.daemonInfo.getTimeIntervalInMilliseconds();
- }
-
- public long getEpsilonInMilliseconds() {
- return this.daemonInfo.getEpsilonInMilliseconds();
- }
-
- public boolean getRunOnReboot() {
- return this.daemonInfo.runOnReboot();
- }
-
- public Date getFirstRunDateTime() {
- return this.daemonInfo.getFirstRunDateTime();
- }
-
- // ***************DaemonInfo******************
-
- // ***************DataFilesInfo*******************
- public String getDataFilesRemoteSite() {
- RemoteSite remoteSite = this.daemonInfo.getDataFilesInfo()
- .getDownloadInfo().getRemoteSite();
- return (remoteSite == null) ? "" : remoteSite.toString();
- }
-
- public String getDataFilesRenamingConv() {
- return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getRenamingConv();
- }
-
- public boolean getDeleteDataFilesFromServer() {
- return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .deleteFromServer();
- }
-
- public String getQueryMetadataElementName() {
- String element = this.daemonInfo.getDataFilesInfo()
- .getQueryMetadataElementName();
- if (element == null || element.equals("")) {
- element = "Filename";
- }
- return this.daemonInfo.getDataFilesInfo().getQueryMetadataElementName();
- }
-
- public File getDataFilesStagingArea() {
- return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .getStagingArea();
- }
-
- public boolean getAllowAliasOverride() {
- return this.daemonInfo.getDataFilesInfo().getDownloadInfo()
- .isAllowAliasOverride();
- }
-
- // **************DataFilesInfo********************
-
- // **************PropFilesInfo********************
- public String getPropertyFilesRemoteSite() {
- RemoteSite remoteSite = this.daemonInfo.getPropFilesInfo()
- .getDownloadInfo().getRemoteSite();
- return (remoteSite == null) ? "" : remoteSite.toString();
- }
-
- public String getPropertyFilesRenamingConv() {
- return this.daemonInfo.getPropFilesInfo().getDownloadInfo()
- .getRenamingConv();
- }
-
- public boolean getDeletePropertyFilesFromServer() {
- return this.daemonInfo.getPropFilesInfo().getDownloadInfo()
- .deleteFromServer();
- }
-
- public String getPropertyFilesOnSuccessDir() {
- File successDir = this.daemonInfo.getPropFilesInfo().getOnSuccessDir();
- return successDir == null ? "" : successDir.getAbsolutePath();
- }
-
- public String getPropertyFilesOnFailDir() {
- File failDir = this.daemonInfo.getPropFilesInfo().getOnFailDir();
- return failDir == null ? "" : failDir.getAbsolutePath();
- }
-
- public File getPropertyFilesLocalDir() {
- return this.daemonInfo.getPropFilesInfo().getLocalDir();
- }
-
- // **************PropFilesInfo********************
-
- /**
- * Gets the time in milliseconds for when the CrawlDaemon constructor was
- * invoked.
- *
- * @return
- * @uml.property name="daemonCreationTime"
- */
- public long getDaemonCreationTime() {
- return daemonCreationTime;
- }
-
- public boolean getHasBeenToldToQuit() {
- return !this.keepRunning;
- }
-
- public String toString() {
- return this.getName();
- }
-
- /**
- * Starts the program
- *
- * @param args
- * Not Used
- * @throws IOException
- * @throws SecurityException
- */
- public static void main(String[] args) {
- try {
-
- int rmiPort = -1;
- boolean waitForCrawlNotification = false;
-
- for (int i = 0; i < args.length; ++i) {
- if (args[i].equals("--rmiPort")) {
- rmiPort = Integer.parseInt(args[++i]);
- } else if (args[i].equals("--waitForNotification")) {
- waitForCrawlNotification = true;
- }
- }
-
- LocateRegistry.createRegistry(rmiPort);
-
- try {
- // registry CrawlDaemon as MBean so it can be used with jconsole
- MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
- ObjectName name = new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=Daemon");
- } catch (Exception e) {
- LOG.log(Level.SEVERE,
- "Failed to register CrawlDaemon as a MBean Object : "
- + e.getMessage());
- }
-
- } catch (Exception e) {
- LOG.log(Level.SEVERE, "Failed to create CrawlDaemon : "
- + e.getMessage());
- } finally {
- // terminate the CrawlDaemon
- LOG.log(Level.INFO, "Terminating CrawlDaemon");
- }
-
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonController.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonController.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonController.java
deleted file mode 100644
index 40b7ca9..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonController.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-//JDK imports
-
-import java.rmi.Naming;
-import java.rmi.RemoteException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * @author bfoster
- *
- * <p>
- * After the CrawlDaemon has been started, this class can control the
- * CrawlDaemon through webserver communication, thus it can be control from
- * computers other than the one it is executing on. This class has control over
- * pausing, resuming, and killing the CrawlDaemon process. It also has the
- * ability of getting the status on several variables within the CrawlDaemon
- * class. See CrawlDaemon for more info.
- * </p>.
- */
-public class DaemonController {
- private static Logger LOG = Logger.getLogger(DaemonController.class.getName());
- private DaemonRmiInterface daemon;
-
- /**
- * Constructor -- initializes the XmlRpcClient
- *
- * @throws InstantiationException
- */
- public DaemonController(String rmiUrl) {
- try {
- daemon = (DaemonRmiInterface) Naming.lookup(rmiUrl);
- System.out.println(!daemon.getHasBeenToldToQuit());
- } catch (Exception e) {
- LOG.log(Level.SEVERE, e.getMessage());
- }
- }
-
- /**
- * Get the average time for each run of the Crawler controlled by the
- * CrawlDaemons
- *
- * @return Average runtime of Crawler
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public long getAverageRunTime() throws RemoteException {
- return daemon.getAverageRunTime();
- }
-
- /**
- * Gets the total milliseconds for which the Crawler in CrawlDaemon has been
- * crawling since the CrawlDaemon was created.
- *
- * @return The total milliseconds which the Crawler has been crawling
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public long getMillisCrawling() throws RemoteException {
- return daemon.getMillisCrawling();
- }
-
- /**
- * Gets the time between the start of each scheduled run.
- *
- * @return The time between the start of each execution of the Crawler
- * controlled by the CrawlDaemon
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public long getWaitInterval() throws RemoteException {
- return daemon.getTimeInterval();
- }
-
- /**
- * Gets the numbers of times the Crawler has been run by the CrawlDaemon
- *
- * @return The of times Crawler has executed
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public int getNumCrawls() throws RemoteException {
- return daemon.getNumCrawls();
- }
-
- /**
- * Used to determine if the Crawler in the CrawlDaemon is running
- *
- * @return true is Crawler is running
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public boolean isRunning() throws RemoteException {
- return daemon.isRunning();
- }
-
- /**
- * Wakes the CrawlDaemon up and tells it to start crawling again. If stop()
- * was called, this method will have the CrawlDaemon continue from where it
- * left off. This method will also wake up the CrawlDaemon from its sleep
- * between scheduled runs.
- *
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public void resume() throws RemoteException {
- daemon.resume();
- }
-
- public void quit() throws RemoteException {
- daemon.quit();
- }
-
- /**
- * Gets the time in milliseconds of when the CrawlDaemon was created
- *
- * @return The time the CrawlDaemon was created
- * @throws RemoteException
- * @throws XmlRpcCommunicationException
- * Error communicating with server
- */
- public long getDaemonCreationTime() throws RemoteException {
- return daemon.getDaemonCreationTime();
- }
-
- /**
- * Driver method -- starts the CrawlDaemonController
- *
- * @param args
- * See documentation
- * @throws Exception
- * On error! :)
- */
- public static void main(String[] args) throws RemoteException {
- String avgCrawlOperation = "--getAverageRunTime\n";
- String getMilisCrawlOperation = "--getMilisCrawling\n";
- String getNumCrawlsOperation = "--getNumCrawls\n";
- String getWaitIntervalOperation = "--getWaitInterval\n";
- String isRunningOperation = "--isRunning\n";
- String stopOperation = "--stop\n";
- String usage = "CrawlController --url <url to xml rpc service> "
- + "--operation [<operation> [params]]\n" + "operations:\n"
- + avgCrawlOperation + getMilisCrawlOperation
- + getNumCrawlsOperation + getWaitIntervalOperation
- + isRunningOperation + stopOperation;
- String operation = null, url = null;
-
- for (int i = 0; i < args.length; i++) {
- if (args[i].equals("--operation")) {
- operation = args[++i];
- } else if (args[i].equals("--url")) {
- url = args[++i];
- }
- }
- if (operation == null) {
- System.err.println(usage);
- System.exit(1);
- }
-
- // create the controller
- DaemonController controller = new DaemonController(url);
- if (operation.equals("--getAverageRunTime")) {
- double avgCrawlTime = controller.getAverageRunTime();
- System.out.println("Average Crawl Time: [" + avgCrawlTime + "]");
- } else if (operation.equals("--getMilisCrawling")) {
- long crawlTime = controller.getMillisCrawling();
- System.out.println("Total Crawl Time: [" + crawlTime
- + "] miliseconds");
- } else if (operation.equals("--getNumCrawls")) {
- int numCrawls = controller.getNumCrawls();
- System.out.println("Num Crawls: [" + numCrawls + "]");
- } else if (operation.equals("--getWaitInterval")) {
- long waitInterval = controller.getWaitInterval();
- System.out.println("Wait Interval: [" + waitInterval + "]");
- } else if (operation.equals("--isRunning")) {
- boolean running = controller.isRunning();
- System.out.println(running ? "Yes" : "No");
- } else {
- throw new IllegalArgumentException("Unknown Operation!");
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncher.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncher.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncher.java
deleted file mode 100644
index c9a45d6..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncher.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-//OODT imports
-import org.apache.oodt.cas.pushpull.config.Config;
-import org.apache.oodt.cas.pushpull.config.DaemonInfo;
-import org.apache.oodt.cas.pushpull.config.RemoteSpecs;
-
-//JDK imports
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.rmi.registry.LocateRegistry;
-import java.util.LinkedList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-//JMX imports
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>Describe your class here</p>.
- */
-public class DaemonLauncher implements DaemonLauncherMBean {
-
- /* our log stream */
- private static final Logger LOG = Logger.getLogger(DaemonLauncher.class
- .getName());
-
- private Config config;
-
- private RemoteSpecs rs;
-
- private int rmiRegistryPort;
-
- private int nextDaemonId;
-
- private DaemonManager dm;
-
- private LinkedList<Daemon> activeDaemonList;
-
- private LinkedList<File> sitesFiles;
-
- private File propertiesFile;
-
- private MBeanServer mbs;
-
- public DaemonLauncher(int rmiRegistryPort, File propertiesFile,
- LinkedList<File> sitesFiles) {
- this.rmiRegistryPort = rmiRegistryPort;
- nextDaemonId = 0;
- dm = new DaemonManager();
- activeDaemonList = new LinkedList<Daemon>();
- this.sitesFiles = sitesFiles;
- this.propertiesFile = propertiesFile;
- registerJMX();
- this.configure();
- }
-
- private void registerJMX() {
- try {
- LocateRegistry.createRegistry(this.rmiRegistryPort);
- mbs = ManagementFactory.getPlatformMBeanServer();
- ObjectName name = new ObjectName(
- "org.apache.oodt.cas.pushpull.daemon:type=DaemonLauncher"
- + this.rmiRegistryPort);
- mbs.registerMBean(this, name);
- } catch (Exception e) {
- LOG.log(Level.SEVERE,
- "Failed to register DaemonLauncher as a MBean Object : "
- + e.getMessage());
- }
- }
-
- private synchronized void configure() {
- try {
- LOG.log(Level.INFO, "Configuring DaemonLauncher. . .");
- config = new Config();
- config.loadConfigFile(propertiesFile);
- rs = new RemoteSpecs();
- for (File sitesFile : sitesFiles) {
- LOG
- .log(Level.INFO, "Loading SiteInfo file '" + sitesFile
- + "'");
- rs.loadRemoteSpecs(sitesFile);
- }
- } catch (Exception e) {
- LOG.log(Level.SEVERE, "Failed to configure DaemonLauncher : "
- + e.getMessage());
- }
- }
-
- public synchronized void launchDaemons() {
- LOG.log(Level.INFO, "Launching Daemons . . .");
- for (DaemonInfo daemonInfo : rs.getDaemonInfoList()) {
- int curDaemonID = this.getNextDaemonId();
- try {
- Daemon daemon = new Daemon(this.rmiRegistryPort, curDaemonID,
- this.config, daemonInfo, rs.getSiteInfo());
- LOG.log(Level.INFO, "Creating Daemon with ID = " + curDaemonID);
- daemon.registerDaemonListener(dm);
- daemon.startDaemon();
- activeDaemonList.add(daemon);
- } catch (Exception e) {
- LOG.log(Level.SEVERE, "Failed to create Daemon with ID = "
- + curDaemonID + " : " + e.getMessage());
- }
- }
- }
-
- private synchronized int getNextDaemonId() {
- while (this.dm.getUsedIDs().contains(++this.nextDaemonId)) {
-
- }
- return this.nextDaemonId;
- }
-
- public void refreshDaemons() {
- this.killAllDaemons();
-
- LOG.log(Level.INFO, "Refreshing Daemons . . .");
- this.configure();
- launchDaemons();
- }
-
- public synchronized void killAllDaemons() {
- LOG.log(Level.INFO, "Killing current Daemons . . .");
- this.nextDaemonId = 0;
- for (Daemon daemon : this.activeDaemonList) {
- if (!daemon.getHasBeenToldToQuit()) {
- daemon.quit();
- }
- }
- activeDaemonList.clear();
- }
-
- public String[] viewDaemonWaitingList() {
- return this.dm.getQueueList();
- }
-
- public synchronized void quit() {
- this.killAllDaemons();
- this.notify();
- }
-
- public static void main(String[] args) {
-
- int rmiRegPort = -1;
- File propertiesFile = null;
- LinkedList<File> sitesFiles = new LinkedList<File>();
-
- for (int i = 0; i < args.length; ++i) {
- if (args[i].equals("--rmiRegistryPort")) {
- rmiRegPort = Integer.parseInt(args[++i]);
- } else if (args[i].equals("--propertiesFile")) {
- propertiesFile = new File(args[++i]);
- } else if (args[i].equals("--remoteSpecsFile")) {
- sitesFiles.add(new File(args[++i]));
- }
- }
-
- DaemonLauncher daemonLauncher = new DaemonLauncher(rmiRegPort,
- propertiesFile, sitesFiles);
-
- daemonLauncher.launchDaemons();
- synchronized (daemonLauncher) {
- try {
- daemonLauncher.wait();
- } catch (Exception ignored) {
- }
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncherMBean.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncherMBean.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncherMBean.java
deleted file mode 100644
index 880316b..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonLauncherMBean.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>Describe your class here</p>.
- */
-public interface DaemonLauncherMBean {
-
- void killAllDaemons();
-
- void refreshDaemons();
-
- void quit();
-
- String[] viewDaemonWaitingList();
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonListener.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonListener.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonListener.java
deleted file mode 100644
index 40f4cf8..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonListener.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public interface DaemonListener {
-
- void wasRegisteredWith(Daemon daemon);
-
- void wasUnregisteredWith(Daemon daemon);
-
- void daemonStarting(Daemon daemon);
-
- void daemonFinished(Daemon daemon);
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonMBean.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonMBean.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonMBean.java
deleted file mode 100644
index a133bdd..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonMBean.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-//JDK imports
-import java.io.File;
-import java.util.Date;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public interface DaemonMBean {
-
- /**
- * Will terminate the CrawlDaemon. If its Crawler is crawling a site when
- * this method is called, the terminate won't take place until after the
- * Crawler has complete crawling that site.
- *
- * @return
- */
- void quit();
-
- /**
- * Can be used to determine if Crawler is presently running
- *
- * @return true if Crawler is runnning
- * @uml.property name="isRunning"
- */
- boolean isRunning();
-
- boolean getHasBeenToldToQuit();
-
- long getTimeIntervalInMilliseconds();
-
- long getEpsilonInMilliseconds();
-
- boolean getRunOnReboot();
-
- Date getFirstRunDateTime();
-
- String[] downloadedFilesInStagingArea();
-
- String[] downloadingFilesInStagingArea();
-
- int numberOfFilesDownloadedInStagingArea();
-
- int numberOfFilesDownloadingInStagingArea();
-
- String getDataFilesRemoteSite();
-
- String getDataFilesRenamingConv();
-
- boolean getDeleteDataFilesFromServer();
-
- String getQueryMetadataElementName();
-
- File getDataFilesStagingArea();
-
- boolean getAllowAliasOverride();
-
- String getPropertyFilesRemoteSite();
-
- String getPropertyFilesRenamingConv();
-
- boolean getDeletePropertyFilesFromServer();
-
- String getPropertyFilesOnSuccessDir();
-
- String getPropertyFilesOnFailDir();
-
- File getPropertyFilesLocalDir();
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonManager.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonManager.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonManager.java
deleted file mode 100644
index 04de6dc..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonManager.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-//JDK imports
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class DaemonManager implements DaemonListener {
-
- private LinkedList<Daemon> waitingList;
-
- private HashSet<Integer> usedIDs;
-
- private Daemon runningDaemon;
-
- /* our log stream */
- private static final Logger LOG = Logger.getLogger(DaemonManager.class
- .getName());
-
- public DaemonManager() {
- waitingList = new LinkedList<Daemon>();
- usedIDs = new HashSet<Integer>();
- runningDaemon = null;
- }
-
- public synchronized boolean hasRunningDaemons() {
- return this.waitingList.size() > 0 || this.runningDaemon != null;
- }
-
- public synchronized void clearWaitingList() {
- this.waitingList.clear();
- }
-
- public synchronized void wasRegisteredWith(Daemon daemon) {
- this.usedIDs.add(daemon.getDaemonID());
- }
-
- public synchronized void wasUnregisteredWith(Daemon daemon) {
- this.usedIDs.remove(Integer.valueOf(daemon.getDaemonID()));
- }
-
- public void daemonStarting(Daemon daemon) {
- if (!this.setAsRunning(daemon)) {
- daemon.pauseDaemon();
- }
- }
-
- public void daemonFinished(Daemon daemon) {
- if (daemon.equals(this.runningDaemon)) {
- this.startNextOnWaitingList();
- } else {
- this.waitingList.remove(daemon);
- }
- }
-
- public synchronized HashSet<Integer> getUsedIDs() {
- return this.usedIDs;
- }
-
- private synchronized boolean setAsRunning(Daemon daemon) {
- if (runningDaemon == null) {
- runningDaemon = daemon;
- LOG.log(Level.INFO, "Daemon with ID = " + daemon.getDaemonID()
- + " was given permission to run");
- return true;
- } else {
- LOG.log(Level.INFO, "Daemon with ID = " + daemon.getDaemonID()
- + " was added to the DaemonManager's waiting list");
- waitingList.add(daemon);
- return false;
- }
- }
-
- private synchronized void startNextOnWaitingList() {
- if (waitingList.size() > 0) {
- runningDaemon = waitingList.removeFirst();
- LOG.log(Level.INFO, "Daemon with ID = "
- + runningDaemon.getDaemonID()
- + " was given permission to run");
- runningDaemon.resume();
- } else {
- runningDaemon = null;
- }
- }
-
- public synchronized String[] getQueueList() {
- String[] queue = new String[this.waitingList.size()];
- int counter = 0;
- for (Daemon daemon : this.waitingList) {
- queue[counter++] = daemon.getName();
- }
- return queue;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonRmiInterface.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonRmiInterface.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonRmiInterface.java
deleted file mode 100644
index 1cb5f53..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/daemon/DaemonRmiInterface.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.daemon;
-
-//JDK imports
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>Describe your class here</p>.
- */
-public interface DaemonRmiInterface extends Remote {
-
- /**
- * Wakes up the CrawlDaemon if it is sleeping
- *
- * @return Always true -- done because of XmlRpc communication
- */
- void resume() throws RemoteException;
-
- /**
- * Will terminate the CrawlDaemon. If its Crawler is crawling a site when
- * this method is called, the terminate won't take place until after the
- * Crawler has complete crawling that site.
- *
- * @return
- */
- void quit() throws RemoteException;
-
- /**
- * Can be used to determine if Crawler is presently running
- *
- * @return true if Crawler is runnning
- * @uml.property name="isRunning"
- */
- boolean isRunning() throws RemoteException;
-
- /**
- * Average runtime for the Crawler
- *
- * @return average runtime for the Crawler
- */
- long getAverageRunTime() throws RemoteException;
-
- /**
- * Gets the total crawling time of the Crawler
- *
- * @return Total crawling time of Crawler
- */
- long getMillisCrawling() throws RemoteException;
-
- /**
- * Gets the time between the start of Crawler executions
- *
- * @return Time interval between Crawler start times
- */
- long getTimeInterval() throws RemoteException;
-
- /**
- * Gets the total number of times the Crawler has been run
- *
- * @return The number of times Crawler has run
- */
- int getNumCrawls() throws RemoteException;
-
- /**
- * Gets the time in milliseconds for when the CrawlDaemon constructor was
- * invoked.
- *
- * @return
- * @uml.property name="daemonCreationTime"
- */
- long getDaemonCreationTime() throws RemoteException;
-
- boolean getHasBeenToldToQuit() throws RemoteException;
-
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/AlreadyInDatabaseException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/AlreadyInDatabaseException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/AlreadyInDatabaseException.java
deleted file mode 100644
index 988a2f5..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/AlreadyInDatabaseException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class AlreadyInDatabaseException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = 5268322663053758675L;
-
- public AlreadyInDatabaseException() {
- super();
- }
-
- public AlreadyInDatabaseException(String msg) {
- super(msg);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ConfigException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ConfigException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ConfigException.java
deleted file mode 100644
index 508444c..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ConfigException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class ConfigException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = 2756721958068217752L;
-
- public ConfigException() {
- super();
- }
-
- public ConfigException(String message) {
- super(message);
- }
-
- public ConfigException(String message, Throwable t) {
- super(message, t);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlDaemonException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlDaemonException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlDaemonException.java
deleted file mode 100644
index 245f81f..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlDaemonException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class CrawlDaemonException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = 4813134079371402218L;
-
- public CrawlDaemonException() {
- super();
- }
-
- public CrawlDaemonException(String message) {
- super(message);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlerException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlerException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlerException.java
deleted file mode 100644
index 96d3579..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/CrawlerException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class CrawlerException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = 6812263687830031390L;
-
- public CrawlerException() {
- super();
- }
-
- public CrawlerException(String msg) {
- super(msg);
- }
-
- public CrawlerException(String msg, Throwable t) {
- super(msg, t);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/FileRestrictionsException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/FileRestrictionsException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/FileRestrictionsException.java
deleted file mode 100644
index 72beffa..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/FileRestrictionsException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class FileRestrictionsException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = 2429807743624154441L;
-
- public FileRestrictionsException() {
- super();
- }
-
- public FileRestrictionsException(String msg) {
- super(msg);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MetExtractorException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MetExtractorException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MetExtractorException.java
deleted file mode 100644
index b85d48f..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MetExtractorException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class MetExtractorException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = -5075869090098570091L;
-
- public MetExtractorException() {
- super();
- }
-
- public MetExtractorException(String msg) {
- super(msg);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MethodException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MethodException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MethodException.java
deleted file mode 100644
index bc7d933..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/MethodException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class MethodException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = -8717114929851891812L;
-
- public MethodException() {
- super();
- }
-
- public MethodException(String msg) {
- super(msg);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ParserException.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ParserException.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ParserException.java
deleted file mode 100644
index 30df44a..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ParserException.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class ParserException extends PushPullFrameworkException {
-
- private static final long serialVersionUID = 4654971837246731057L;
-
- public ParserException() {
- super();
- }
-
- public ParserException(String msg) {
- super(msg);
- }
-
- public ParserException(String msg, Throwable t) {
- super(msg, t);
- }
-}
http://git-wip-us.apache.org/repos/asf/oodt/blob/098cc4fa/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ProtocolDeletionError.java
----------------------------------------------------------------------
diff --git a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ProtocolDeletionError.java b/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ProtocolDeletionError.java
deleted file mode 100644
index 15eda47..0000000
--- a/pushpull/src/main/java/org/apache/oodt/cas/pushpull/exceptions/ProtocolDeletionError.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.oodt.cas.pushpull.exceptions;
-
-/**
- *
- * @author bfoster
- * @version $Revision$
- *
- * <p>
- * Describe your class here
- * </p>.
- */
-public class ProtocolDeletionError extends ProtocolException {
-
- private static final long serialVersionUID = 2209601187397273414L;
-
- public ProtocolDeletionError() {
- super();
- }
-
- public ProtocolDeletionError(String msg) {
- super(msg);
- }
-}