Class CreateCommand
- java.lang.Object
-
- org.apache.activemq.console.command.AbstractCommand
-
- org.apache.activemq.console.command.CreateCommand
-
- All Implemented Interfaces:
Command
public class CreateCommand extends AbstractCommand
-
-
Field Summary
Fields Modifier and Type Field Description protected StringamqConfprotected FileamqHomeprotected String[]BASE_SUB_DIRSprotected StringBROKER_NAME_REGEXprotected StringbrokerNameprotected StringDEFAULT_BROKERNAME_XPATHprotected StringDEFAULT_TARGET_ACTIVEMQ_CONFprotected String[][]fileWriteMapprotected String[]helpFileprotected FiletargetAmqBase-
Fields inherited from class org.apache.activemq.console.command.AbstractCommand
COMMAND_OPTION_DELIMETER, context
-
-
Constructor Summary
Constructors Constructor Description CreateCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyActivemqConf(File srcBase, File targetBase, String activemqConf)protected voidcreateSubDirs(File target, String[] subDirs)StringgetName()StringgetOneLineDescription()protected voidhandleOption(String token, List<String> tokens)Handle the --amqconf options.protected voidprintHelp()Print the help messages for the specific taskprotected voidrunTask(List<String> tokens)Run the specific task.protected voidwriteFileMapping(File targetBase, String[][] fileWriteMapping)-
Methods inherited from class org.apache.activemq.console.command.AbstractCommand
execute, handleException, parseOptions, printHelpFromFile, setCommandContext
-
-
-
-
Field Detail
-
helpFile
protected final String[] helpFile
-
DEFAULT_TARGET_ACTIVEMQ_CONF
protected final String DEFAULT_TARGET_ACTIVEMQ_CONF
- See Also:
- Constant Field Values
-
DEFAULT_BROKERNAME_XPATH
protected final String DEFAULT_BROKERNAME_XPATH
- See Also:
- Constant Field Values
-
BASE_SUB_DIRS
protected final String[] BASE_SUB_DIRS
-
BROKER_NAME_REGEX
protected final String BROKER_NAME_REGEX
- See Also:
- Constant Field Values
-
amqConf
protected String amqConf
-
fileWriteMap
protected String[][] fileWriteMap
-
brokerName
protected String brokerName
-
amqHome
protected File amqHome
-
targetAmqBase
protected File targetAmqBase
-
-
Method Detail
-
getName
public String getName()
-
getOneLineDescription
public String getOneLineDescription()
-
runTask
protected void runTask(List<String> tokens) throws Exception
Description copied from class:AbstractCommandRun the specific task.- Specified by:
runTaskin classAbstractCommand- Parameters:
tokens- - command arguments- Throws:
Exception
-
handleOption
protected void handleOption(String token, List<String> tokens) throws Exception
Handle the --amqconf options.- Overrides:
handleOptionin classAbstractCommand- Parameters:
token- - option token to handletokens- - succeeding command arguments- Throws:
Exception
-
createSubDirs
protected void createSubDirs(File target, String[] subDirs) throws IOException
- Throws:
IOException
-
writeFileMapping
protected void writeFileMapping(File targetBase, String[][] fileWriteMapping) throws IOException
- Throws:
IOException
-
copyActivemqConf
protected void copyActivemqConf(File srcBase, File targetBase, String activemqConf) throws IOException, ParserConfigurationException, SAXException, TransformerException, XPathExpressionException
-
printHelp
protected void printHelp()
Description copied from class:AbstractCommandPrint the help messages for the specific task- Specified by:
printHelpin classAbstractCommand
-
-