Class CmdUtil
- java.lang.Object
-
- org.bedework.util.jmx.ConfBase<CmdUtilPropertiesImpl>
-
- org.bedework.tools.cmdutil.CmdUtil
-
- All Implemented Interfaces:
CmdUtilProperties,CmdUtilMBean,org.bedework.util.jmx.BaseMBean,org.bedework.util.jmx.ConfBaseMBean,org.bedework.util.logging.Logged
public class CmdUtil extends org.bedework.util.jmx.ConfBase<CmdUtilPropertiesImpl> implements CmdUtilMBean
Utility to execute various operations specified by commands.Takes one or more lines of input specifying the action. Lines starting with "#" are treated as comments. Non-comment lines are:
create category val
Creates a category. val must be quoted if it contains non-work characters.
create collection (folder| calendar) parent-path name [filter=qfexpr] (category=cat)* [owner] create collection alias parent-path name alias-target [filter=qfexpr] (category=cat)* [owner]Creates a folder or calendar collection under the given parent with the given name and optional owner.
qfexpr is a quoted filter expression.
list categories val*
List categories. If no val is supplied all categories are listed. Any supplied values are matched against the categories. Any case insignificant match results in the category being listed.
move events [addcats] from to category*
where from and to are possibly quoted paths, e.g. /public/Arts/Dance and category* is 0 or more possibly quoted categories to set on the entities events as they are moved.
If addcats is specified the events will have categories set derived from the from path. e.g. if from="/public/Arts/Dance" then the event will have categories "Arts" and "Dance" (which must exist)
stop
Terminate the utility
- Author:
- douglm
-
-
Constructor Summary
Constructors Constructor Description CmdUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringexec(String cmd)Execute a single command.Stringexecfile(String path)Execute commands from a file.StringgetAccount()StringgetDataOut()static StringgetServiceName(String name)booleangetSuperUser()StringloadConfig()voidsetAccount(String val)voidsetDataOut(String val)voidsetSuperUser(boolean val)-
Methods inherited from class org.bedework.util.jmx.ConfBase
createObjectName, getConfig, getConfigInfo, getConfigInfo, getConfigInfo, getConfigName, getConfigPname, getConfigUri, getLogger, getManagementContext, getPathSuffix, getRegisteredMBeans, getServiceName, getServiceObjectName, getStatus, getStore, isRunning, loadConfig, loadOnlyConfig, makeObject, register, register, saveConfig, setConfigName, setConfigPname, setConfigUri, setPathSuffix, setServiceName, setStatus, setStore, start, stop, unregister, unregister
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bedework.util.jmx.BaseMBean
getServiceName, isRunning, start, stop
-
Methods inherited from interface org.bedework.util.jmx.ConfBaseMBean
getConfigName, getStatus, saveConfig, setConfigName, setStatus
-
Methods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, warn
-
-
-
-
Method Detail
-
getServiceName
public static String getServiceName(String name)
- Parameters:
name- of the service- Returns:
- object name value for the mbean with this name
-
setAccount
public void setAccount(String val)
- Specified by:
setAccountin interfaceCmdUtilProperties
-
getAccount
public String getAccount()
- Specified by:
getAccountin interfaceCmdUtilProperties
-
setSuperUser
public void setSuperUser(boolean val)
- Specified by:
setSuperUserin interfaceCmdUtilProperties
-
getSuperUser
public boolean getSuperUser()
- Specified by:
getSuperUserin interfaceCmdUtilProperties
-
setDataOut
public void setDataOut(String val)
- Specified by:
setDataOutin interfaceCmdUtilProperties
-
getDataOut
public String getDataOut()
- Specified by:
getDataOutin interfaceCmdUtilProperties
-
execfile
public String execfile(String path)
Description copied from interface:CmdUtilMBeanExecute commands from a file.- Specified by:
execfilein interfaceCmdUtilMBean- Parameters:
path- to file.- Returns:
- Completion messages and stats
-
exec
public String exec(String cmd)
Description copied from interface:CmdUtilMBeanExecute a single command.- Specified by:
execin interfaceCmdUtilMBean- Parameters:
cmd- to execute.- Returns:
- Completion messages and stats
-
loadConfig
public String loadConfig()
- Specified by:
loadConfigin classorg.bedework.util.jmx.ConfBase<CmdUtilPropertiesImpl>
-
-