org.netarchivesuite.heritrix3wrapper.EngineResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of heritrix3-wrapper Show documentation
Show all versions of heritrix3-wrapper Show documentation
Wrapper library for unpacking and communicating with Heritrix 3.
package org.netarchivesuite.heritrix3wrapper;
import java.io.ByteArrayInputStream;
import javax.xml.bind.JAXBException;
import javax.xml.stream.XMLStreamException;
import org.netarchivesuite.heritrix3wrapper.jaxb.Engine;
import org.netarchivesuite.heritrix3wrapper.xmlutils.XmlValidationResult;
import org.netarchivesuite.heritrix3wrapper.xmlutils.XmlValidator;
/*
* Finished: CREATED
* Unbuilt
*
* NASCENT
* Ready
Launched
PREPARING
Active: PREPARING
Launched in paused state
PAUSED
Active: PAUSED
Running
RUNNING
Active: RUNNING
Finished
FINISHED
FINISHED
Finished: FINISHED
Terminated
FINISHED
ABORTED
Ready
*/
public class EngineResult extends ResultAbstract {
public Engine engine;
public void parse(XmlValidator xmlValidator) throws JAXBException, XMLStreamException {
ByteArrayInputStream bIn;
result = new XmlValidationResult();
bIn = new ByteArrayInputStream(response);
xmlValidator.testStructuralValidity(bIn, null, null, result);
bIn = new ByteArrayInputStream(response);
engine = Engine.unmarshall(bIn);
}
}