Merge "Issue #2361 Harvester JAXB fixed up" into development
Former-commit-id:c45f619260
[formerlya5f2414070
] [formerly4879c19e0b
[formerly 2421a960399e6deeb911cf25f968e6eead666bd6]] Former-commit-id:4879c19e0b
Former-commit-id:4929a59b3e
This commit is contained in:
commit
96c901b958
8 changed files with 129 additions and 27 deletions
|
@ -1,5 +1,25 @@
|
||||||
package com.raytheon.uf.common.datadelivery.harvester;
|
package com.raytheon.uf.common.datadelivery.harvester;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -7,7 +27,6 @@ import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.serialization.SerializationException;
|
import com.raytheon.uf.common.serialization.SerializationException;
|
||||||
import com.raytheon.uf.common.serialization.SingleTypeJAXBManager;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -22,6 +41,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* --/--/---- dhladky Initial creation
|
* --/--/---- dhladky Initial creation
|
||||||
* Oct 23, 2013 2361 njensen Use JAXBManager for XML
|
* Oct 23, 2013 2361 njensen Use JAXBManager for XML
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -33,9 +53,6 @@ public class HarvesterConfigurationManager {
|
||||||
private static final IUFStatusHandler statusHandler = UFStatus
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(HarvesterConfigurationManager.class);
|
.getHandler(HarvesterConfigurationManager.class);
|
||||||
|
|
||||||
private static final SingleTypeJAXBManager<HarvesterConfig> jaxb = SingleTypeJAXBManager
|
|
||||||
.createWithoutException(HarvesterConfig.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets site and base level configs for harvesters
|
* Gets site and base level configs for harvesters
|
||||||
*
|
*
|
||||||
|
@ -63,7 +80,7 @@ public class HarvesterConfigurationManager {
|
||||||
for (LocalizationFile lf : getLocalizedFiles()) {
|
for (LocalizationFile lf : getLocalizedFiles()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config = jaxb.unmarshalFromXmlFile(lf.getFile());
|
config = HarvesterJaxbManager.getJaxb().unmarshalFromXmlFile(HarvesterConfig.class, lf.getFile());
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR,
|
||||||
"Can't deserialize harvester config at "
|
"Can't deserialize harvester config at "
|
||||||
|
@ -94,7 +111,7 @@ public class HarvesterConfigurationManager {
|
||||||
for (LocalizationFile lf : getLocalizedFiles()) {
|
for (LocalizationFile lf : getLocalizedFiles()) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config = jaxb.unmarshalFromXmlFile(lf.getFile());
|
config = HarvesterJaxbManager.getJaxb().unmarshalFromXmlFile(HarvesterConfig.class, lf.getFile());
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR,
|
||||||
"Can't deserialize harvester config at "
|
"Can't deserialize harvester config at "
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.raytheon.uf.common.datadelivery.harvester;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This software was developed and / or modified by Raytheon Company,
|
||||||
|
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||||
|
*
|
||||||
|
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||||
|
* This software product contains export-restricted data whose
|
||||||
|
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||||
|
* to non-U.S. persons whether in the United States or abroad requires
|
||||||
|
* an export license or other authorization.
|
||||||
|
*
|
||||||
|
* Contractor Name: Raytheon Company
|
||||||
|
* Contractor Address: 6825 Pine Street, Suite 340
|
||||||
|
* Mail Stop B8
|
||||||
|
* Omaha, NE 68106
|
||||||
|
* 402.291.0100
|
||||||
|
*
|
||||||
|
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||||
|
* further licensing information.
|
||||||
|
**/
|
||||||
|
|
||||||
|
import javax.xml.bind.JAXBException;
|
||||||
|
|
||||||
|
import com.raytheon.uf.common.datadelivery.registry.Connection;
|
||||||
|
import com.raytheon.uf.common.datadelivery.registry.Provider;
|
||||||
|
import com.raytheon.uf.common.datadelivery.registry.Provider.ServiceType;
|
||||||
|
import com.raytheon.uf.common.datadelivery.registry.ProviderType;
|
||||||
|
import com.raytheon.uf.common.serialization.JAXBManager;
|
||||||
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
/**
|
||||||
|
* JAXB for Harvester
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ----------- --------------------------
|
||||||
|
* Oct 23, 2013 2361 dhladky Initial creation
|
||||||
|
*
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* @author dhladky
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class HarvesterJaxbManager {
|
||||||
|
|
||||||
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
|
.getHandler(HarvesterJaxbManager.class);
|
||||||
|
|
||||||
|
private static Class<?>[] clazzess = new Class<?>[] {
|
||||||
|
HarvesterConfig.class, Provider.class, Connection.class,
|
||||||
|
ProviderType.class, ServiceType.class, Agent.class,
|
||||||
|
CrawlAgent.class, OGCAgent.class, ConfigLayer.class };
|
||||||
|
|
||||||
|
private JAXBManager jaxb = null;
|
||||||
|
|
||||||
|
private static HarvesterJaxbManager instance = new HarvesterJaxbManager();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* marshall and unmarshall harvester objects
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static JAXBManager getJaxb() {
|
||||||
|
|
||||||
|
if (instance.jaxb == null) {
|
||||||
|
try {
|
||||||
|
instance.jaxb = new JAXBManager(clazzess);
|
||||||
|
|
||||||
|
} catch (JAXBException e) {
|
||||||
|
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(),
|
||||||
|
e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return instance.jaxb;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -15,6 +15,7 @@ import java.util.Set;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||||
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterJaxbManager;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Collection;
|
import com.raytheon.uf.common.datadelivery.registry.Collection;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Provider;
|
import com.raytheon.uf.common.datadelivery.registry.Provider;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Utils;
|
import com.raytheon.uf.common.datadelivery.registry.Utils;
|
||||||
|
@ -63,6 +64,7 @@ import com.raytheon.uf.edex.registry.ebxml.init.RegistryInitializedListener;
|
||||||
* Feb 05, 2013 1580 mpduff EventBus refactor.
|
* Feb 05, 2013 1580 mpduff EventBus refactor.
|
||||||
* 3/18/2013 1802 bphillip Modified to insert provider object after database is initialized
|
* 3/18/2013 1802 bphillip Modified to insert provider object after database is initialized
|
||||||
* Jun 24, 2013 2106 djohnson Accepts ProviderHandler as a constructor argument.
|
* Jun 24, 2013 2106 djohnson Accepts ProviderHandler as a constructor argument.
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -76,7 +78,7 @@ public class CrawlMetaDataHandler implements RegistryInitializedListener {
|
||||||
|
|
||||||
private static final IUFStatusHandler statusHandler = UFStatus
|
private static final IUFStatusHandler statusHandler = UFStatus
|
||||||
.getHandler(CrawlMetaDataHandler.class);
|
.getHandler(CrawlMetaDataHandler.class);
|
||||||
|
|
||||||
/** Path to crawler links directory. */
|
/** Path to crawler links directory. */
|
||||||
private static final String PROCESSED_DIR = StringUtil.join(new String[] {
|
private static final String PROCESSED_DIR = StringUtil.join(new String[] {
|
||||||
"datadelivery", "harvester", "processed" }, File.separatorChar);
|
"datadelivery", "harvester", "processed" }, File.separatorChar);
|
||||||
|
@ -99,11 +101,7 @@ public class CrawlMetaDataHandler implements RegistryInitializedListener {
|
||||||
for (LocalizationFile file : files) {
|
for (LocalizationFile file : files) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
HarvesterConfig hc = HarvesterJaxbManager.getJaxb().unmarshalFromXmlFile(HarvesterConfig.class, file.getFile());
|
||||||
HarvesterConfig hc = SerializationUtil
|
|
||||||
.jaxbUnmarshalFromXmlFile(HarvesterConfig.class,
|
|
||||||
file.getFile());
|
|
||||||
|
|
||||||
Agent agent = hc.getAgent();
|
Agent agent = hc.getAgent();
|
||||||
|
|
||||||
if (agent != null) {
|
if (agent != null) {
|
||||||
|
@ -117,7 +115,7 @@ public class CrawlMetaDataHandler implements RegistryInitializedListener {
|
||||||
hcs.put(hc.getProvider().getName(), hc);
|
hcs.put(hc.getProvider().getName(), hc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (SerializationException e1) {
|
} catch (Exception e1) {
|
||||||
statusHandler.error(
|
statusHandler.error(
|
||||||
"Serialization Error Reading Crawler Config files",
|
"Serialization Error Reading Crawler Config files",
|
||||||
e1);
|
e1);
|
||||||
|
|
|
@ -12,13 +12,13 @@ import org.quartz.JobExecutionException;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||||
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterJaxbManager;
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -33,6 +33,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 4, 2012 1038 dhladky Initial creation
|
* Oct 4, 2012 1038 dhladky Initial creation
|
||||||
* Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
|
* Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -141,11 +142,10 @@ public abstract class CrawlLauncher implements Job {
|
||||||
.getLocalizedFiles();
|
.getLocalizedFiles();
|
||||||
|
|
||||||
if (files != null) {
|
if (files != null) {
|
||||||
JAXBManager jaxbMan = new JAXBManager(HarvesterConfig.class);
|
|
||||||
for (LocalizationFile lf : files) {
|
for (LocalizationFile lf : files) {
|
||||||
|
HarvesterConfig hc = HarvesterJaxbManager.getJaxb()
|
||||||
HarvesterConfig hc = (HarvesterConfig) jaxbMan
|
.unmarshalFromXmlFile(HarvesterConfig.class,
|
||||||
.unmarshalFromXmlFile(lf.getFile());
|
lf.getFile());
|
||||||
if (hc.getAgent() != null) {
|
if (hc.getAgent() != null) {
|
||||||
// we only want crawler types for CrawlerMetadata
|
// we only want crawler types for CrawlerMetadata
|
||||||
Agent agent = hc.getAgent();
|
Agent agent = hc.getAgent();
|
||||||
|
|
|
@ -16,9 +16,9 @@ import com.raytheon.edex.util.Util;
|
||||||
import com.raytheon.uf.common.comm.ProxyConfiguration;
|
import com.raytheon.uf.common.comm.ProxyConfiguration;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||||
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterJaxbManager;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Collection;
|
import com.raytheon.uf.common.datadelivery.registry.Collection;
|
||||||
import com.raytheon.uf.common.serialization.SerializationException;
|
import com.raytheon.uf.common.serialization.SerializationException;
|
||||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -38,6 +38,7 @@ import edu.uci.ics.crawler4j.crawler.CrawlConfig;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 4, 2012 1038 dhladky Initial creation
|
* Oct 4, 2012 1038 dhladky Initial creation
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -138,7 +139,7 @@ public abstract class Crawler {
|
||||||
HarvesterConfig hc = null;
|
HarvesterConfig hc = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
hc = SerializationUtil.jaxbUnmarshalFromXmlFile(
|
hc = HarvesterJaxbManager.getJaxb().unmarshalFromXmlFile(
|
||||||
HarvesterConfig.class, configFile);
|
HarvesterConfig.class, configFile);
|
||||||
} catch (SerializationException e1) {
|
} catch (SerializationException e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
|
|
|
@ -34,6 +34,7 @@ import java.util.regex.Pattern;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||||
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterJaxbManager;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.ProtoCollection;
|
import com.raytheon.uf.common.datadelivery.harvester.ProtoCollection;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Collection;
|
import com.raytheon.uf.common.datadelivery.registry.Collection;
|
||||||
import com.raytheon.uf.common.datadelivery.registry.Provider;
|
import com.raytheon.uf.common.datadelivery.registry.Provider;
|
||||||
|
@ -73,6 +74,7 @@ import com.raytheon.uf.edex.datadelivery.retrieval.ProviderCollectionLinkStore;
|
||||||
* Aug 06, 2012 1022 djohnson Add shutdown(), write out millis with filename to prevent overwriting.
|
* Aug 06, 2012 1022 djohnson Add shutdown(), write out millis with filename to prevent overwriting.
|
||||||
* Sep 10, 2012 1154 djohnson Use JAXB instead of thrift, allowing introspection of links, return files in ascending order.
|
* Sep 10, 2012 1154 djohnson Use JAXB instead of thrift, allowing introspection of links, return files in ascending order.
|
||||||
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
|
* Mar 14, 2013 1794 djohnson Consolidate common FilenameFilter implementations.
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -373,7 +375,7 @@ class FileCommunicationStrategy implements CommunicationStrategy {
|
||||||
File file = lf.getFile();
|
File file = lf.getFile();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SerializationUtil.jaxbMarshalToXmlFile(hconfig,
|
HarvesterJaxbManager.getJaxb().marshalToXmlFile(hconfig,
|
||||||
file.getAbsolutePath());
|
file.getAbsolutePath());
|
||||||
lf.save();
|
lf.save();
|
||||||
} catch (SerializationException e) {
|
} catch (SerializationException e) {
|
||||||
|
|
|
@ -6,13 +6,13 @@ import java.util.List;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||||
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterJaxbManager;
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -29,6 +29,7 @@ import com.raytheon.uf.edex.datadelivery.harvester.cron.HarvesterJobController;
|
||||||
* Mar 14, 2012 00357 dhladky Initial creation
|
* Mar 14, 2012 00357 dhladky Initial creation
|
||||||
* Jun 12, 2012 00609 djohnson Update path to crawl script.
|
* Jun 12, 2012 00609 djohnson Update path to crawl script.
|
||||||
* Aug 06, 2012 01022 djohnson Launch the crawler in the same JVM.
|
* Aug 06, 2012 01022 djohnson Launch the crawler in the same JVM.
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -78,8 +79,8 @@ public class MainSequenceCrawlLauncher extends CrawlLauncher {
|
||||||
// if many, start many
|
// if many, start many
|
||||||
for (LocalizationFile lf : getLocalizedFiles()) {
|
for (LocalizationFile lf : getLocalizedFiles()) {
|
||||||
|
|
||||||
HarvesterConfig hc = SerializationUtil
|
HarvesterConfig hc = HarvesterJaxbManager.getJaxb()
|
||||||
.jaxbUnmarshalFromXmlFile(HarvesterConfig.class,
|
.unmarshalFromXmlFile(HarvesterConfig.class,
|
||||||
lf.getFile());
|
lf.getFile());
|
||||||
if (hc.getProvider().getName().equals(providerName)) {
|
if (hc.getProvider().getName().equals(providerName)) {
|
||||||
if (hc.getAgent() != null) {
|
if (hc.getAgent() != null) {
|
||||||
|
|
|
@ -6,13 +6,13 @@ import java.util.List;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
import com.raytheon.uf.common.datadelivery.harvester.Agent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
import com.raytheon.uf.common.datadelivery.harvester.CrawlAgent;
|
||||||
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterConfig;
|
||||||
|
import com.raytheon.uf.common.datadelivery.harvester.HarvesterJaxbManager;
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext;
|
import com.raytheon.uf.common.localization.LocalizationContext;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationLevel;
|
||||||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
import com.raytheon.uf.common.serialization.JAXBManager;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -28,6 +28,7 @@ import com.raytheon.uf.edex.datadelivery.harvester.cron.HarvesterJobController;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Oct 4, 2012 1038 dhladky Initial creation
|
* Oct 4, 2012 1038 dhladky Initial creation
|
||||||
* Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
|
* Nov 19, 2012 1166 djohnson Clean up JAXB representation of registry objects.
|
||||||
|
* Oct 28, 2013 2361 dhladky Fixed up JAXBManager.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -76,8 +77,8 @@ public class SeedCrawlLauncher extends CrawlLauncher {
|
||||||
// if many, start many
|
// if many, start many
|
||||||
for (LocalizationFile lf : getLocalizedFiles()) {
|
for (LocalizationFile lf : getLocalizedFiles()) {
|
||||||
|
|
||||||
HarvesterConfig hc = (HarvesterConfig) new JAXBManager(
|
HarvesterConfig hc = HarvesterJaxbManager.getJaxb()
|
||||||
HarvesterConfig.class).unmarshalFromXmlFile(
|
.unmarshalFromXmlFile(HarvesterConfig.class,
|
||||||
lf.getFile());
|
lf.getFile());
|
||||||
|
|
||||||
if (hc.getProvider().getName().equals(providerName)) {
|
if (hc.getProvider().getName().equals(providerName)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue