public class DataFlowDaoImpl extends Object implements DataFlowDao
Modifier and Type | Class and Description |
---|---|
private static class |
DataFlowDaoImpl.ClusterMetadata |
Modifier and Type | Field and Description |
---|---|
private boolean |
autoStart |
static String |
CLUSTER_INFO_FILENAME |
static String |
CONTROLLER_SERVICES_FILENAME |
static String |
FLOW_PACKAGE |
static String |
FLOW_XML_FILENAME |
private String |
generatedRootGroupId |
private static org.slf4j.Logger |
logger |
private File |
primaryDirectory |
static String |
REPORTING_TASKS_FILENAME |
private File |
restoreDirectory |
static String |
SNIPPETS_FILENAME |
static String |
STALE_EXT |
static String |
TEMPLATES_FILENAME |
static String |
UNKNOWN_EXT |
Constructor and Description |
---|
DataFlowDaoImpl(File primaryDirectory) |
DataFlowDaoImpl(File primaryDirectory,
File restoreDirectory,
boolean autoStart) |
private final File primaryDirectory
private final File restoreDirectory
private final boolean autoStart
private final String generatedRootGroupId
public static final String STALE_EXT
public static final String UNKNOWN_EXT
public static final String FLOW_PACKAGE
public static final String FLOW_XML_FILENAME
public static final String TEMPLATES_FILENAME
public static final String SNIPPETS_FILENAME
public static final String CONTROLLER_SERVICES_FILENAME
public static final String REPORTING_TASKS_FILENAME
public static final String CLUSTER_INFO_FILENAME
private static final org.slf4j.Logger logger
public DataFlowDaoImpl(File primaryDirectory) throws DaoException
DaoException
public DataFlowDaoImpl(File primaryDirectory, File restoreDirectory, boolean autoStart) throws DaoException
DaoException
private void syncWithRestore(File primaryFile, File restoreFile) throws IOException
IOException
private byte[] calculateMd5(InputStream in) throws IOException
IOException
public ClusterDataFlow loadDataFlow() throws DaoException
DataFlowDao
loadDataFlow
in interface DataFlowDao
DaoException
- if the dataflow was unable to be loadedpublic void saveDataFlow(ClusterDataFlow dataFlow) throws DaoException
DataFlowDao
saveDataFlow
in interface DataFlowDao
dataFlow
- flowDaoException
- if the dataflow was unable to be savedpublic PersistedFlowState getPersistedFlowState()
DataFlowDao
getPersistedFlowState
in interface DataFlowDao
public void setPersistedFlowState(PersistedFlowState flowState) throws DaoException
DataFlowDao
setPersistedFlowState
in interface DataFlowDao
flowState
- the state of the dataflowDaoException
- if the state was unable to be updatedprivate File ensureSingleCurrentStateFile(File dir) throws IOException, JAXBException
IOException
JAXBException
private PersistedFlowState getPersistedFlowState(File file)
private File addStateFileExtension(File file, PersistedFlowState state)
private File createNewFlowStateFile(File dir) throws IOException, JAXBException
IOException
JAXBException
private byte[] getEmptyFlowBytes() throws IOException
IOException
private Element createTextElement(Document document, String elementName, String value)
private void renameFlowStateFile(File flowStateFile, PersistedFlowState newState) throws DaoException
DaoException
private ClusterDataFlow parseDataFlow(File file) throws IOException, JAXBException, DaoException
IOException
JAXBException
DaoException
private void writeDataFlow(File file, ClusterDataFlow clusterDataFlow) throws IOException, JAXBException
IOException
JAXBException
private void writeTarEntry(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream tarOut, String filename, byte[] bytes) throws IOException
IOException
private void writeDataFlow(File file, ClusterDataFlow clusterDataFlow, DataFlowDaoImpl.ClusterMetadata clusterMetadata) throws IOException, JAXBException
IOException
JAXBException
private void writeClusterMetadata(DataFlowDaoImpl.ClusterMetadata clusterMetadata, OutputStream os) throws IOException, JAXBException
IOException
JAXBException
Copyright © 2016 Apache NiFi Project. All rights reserved.