org.usergrid.tools
Class ExportingToolBase
java.lang.Object
org.usergrid.tools.ToolBase
org.usergrid.tools.ExportingToolBase
- Direct Known Subclasses:
- Export, Metrics
public abstract class ExportingToolBase
- extends ToolBase
- Author:
- zznate
Methods inherited from class org.usergrid.tools.ToolBase |
getToolName, printCliHelp, runTool, setCassandraService, setEntityManagerFactory, setManagementService, setProperties, setServiceManagerFactory, setupCassandra, startEmbedded, startSpring, startTool, teardownEmbedded |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected org.slf4j.Logger logger
outputDir
protected static File outputDir
OUTPUT_DIR
protected static final String OUTPUT_DIR
- Output dir option: -outputDir
- See Also:
- Constant Field Values
baseOutputDirName
protected String baseOutputDirName
orgId
protected UUID orgId
startTime
protected long startTime
ExportingToolBase
public ExportingToolBase()
createOptions
public org.apache.commons.cli.Options createOptions()
- Overrides:
createOptions
in class ToolBase
prepareBaseOutputFileName
protected void prepareBaseOutputFileName(org.apache.commons.cli.CommandLine line)
applyOrgId
protected void applyOrgId(org.apache.commons.cli.CommandLine line)
writeOutput
protected void writeOutput(PrintWriter out,
String content)
- Write the string onto the writer and check if verbose is enabled to log
also an echo of what is being written to the writer.
- Parameters:
out
- PrintWritercontent
- string to be written
createOutputParentDir
protected File createOutputParentDir()
createOutputFile
protected File createOutputFile(String type,
String name)
createOutputFile
protected File createOutputFile(File parent,
String type,
String name)
createCollectionsDir
protected File createCollectionsDir(String applicationName)
createDir
protected File createDir(String dirName)
createDir
protected File createDir(File parent,
String dirName)
prepareOutputFileName
protected String prepareOutputFileName(String type,
String name)
- Parameters:
type
- just a label such us: organization, application.name
-
- Returns:
- the file name concatenated with the type and the name of the
collection
getJsonGenerator
protected org.codehaus.jackson.JsonGenerator getJsonGenerator(String outFile)
throws IOException
- Throws:
IOException
getJsonGenerator
protected org.codehaus.jackson.JsonGenerator getJsonGenerator(File outFile)
throws IOException
- Throws:
IOException
Copyright © 2012. All Rights Reserved.