The Common Reusable SHell (CRaSH) deploys in a Java runtime and provides interactions with the JVM. Commands are written in Groovy and can be developed at runtime making the extension of the shell very easy with fast development cycle.
JCR Extension
The CRaSH JCR extension allow to connect and interract with Java Content Repository implementations.
SCP usage
Secure copy can be used to import or export content. The username/password prompted by the SSH server will be used for authentication against the repository when the import or the export is performed.
Export a JCR node
The following command will export the node /gadgets in the repository portal-system of the portal container portal:
scp -P 2000 root@localhost:portal:portal-system:/production/app:gadgets gadgets.xml
The node will be exported as app_gadgets.xml.
Note that the portal container name is used for GateIn. If you do omit it, then the root container will be used.
Appendix A: Commands reference
cd
NAME cd - changes the current node SYNOPSIS cd [-h | --help] <path> STREAM cd <java.lang.Void, java.lang.Object> DESCRIPTION The cd command changes the current node path. The command used with no argument changes to the root node. A relative or absolute path argument can be provided to specify a new current node path. [/]% cd /gadgets [/gadgets]% cd /gadgets [/gadgets]% cd [/]% PARAMETERS [-h | --help] Display this help message <path> The new path that will change the current node navigation
commit
NAME commit - saves changes SYNOPSIS commit [-h | --help] <path> STREAM commit <java.lang.Void, java.lang.Object> DESCRIPTION Saves the changes done to the current session. A node can be provided to save the state of the this nodes and its descendants only. PARAMETERS [-h | --help] Display this help message <path> The path of the node to commit
cp
NAME cp - copy a node to another SYNOPSIS cp [-h | --help] <source> <target> STREAM cp <java.lang.Void, java.lang.Object> DESCRIPTION The cp command copies a node to a target location in the JCR tree. [/registry]% cp foo bar PARAMETERS [-h | --help] Display this help message <source> The path of the source node to copy <target> The path of the target node to be copied
dashboard
NAME dashboard - a monitoring dashboard SYNOPSIS dashboard [-h | --help] STREAM dashboard <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
egrep
NAME egrep - search file(s) for lines that match a pattern SYNOPSIS egrep [-h | --help] <pattern> STREAM egrep <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <pattern> the search pattern
env
NAME env - display the term env SYNOPSIS env [-h | --help] STREAM env <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
filter
NAME filter - a filter for a stream of map SYNOPSIS filter [-p | --pattern] [-h | --help] STREAM filter <java.util.Map, java.util.Map> PARAMETERS [-p | --pattern] format <key>:<value> [-h | --help] Display this help message
java
NAME java - various java language commands SYNOPSIS java [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS type print information about a java type
jdbc
NAME jdbc - JDBC connection SYNOPSIS jdbc [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS props show the database properties close close the current connection table describe the tables open open a connection from JNDI bound datasource connect connect to database with a JDBC connection string info describe the database tables describe the tables execute execute a SQL statement select select SQL statement
jdbc props
NAME jdbc props - show the database properties SYNOPSIS jdbc [-h | --help] props STREAM jdbc props <java.lang.Void, java.util.Map> PARAMETERS [-h | --help] Display this help message
jdbc close
NAME jdbc close - close the current connection SYNOPSIS jdbc [-h | --help] close STREAM jdbc close <java.lang.Void, java.lang.String> PARAMETERS [-h | --help] Display this help message
jdbc table
NAME jdbc table - describe the tables SYNOPSIS jdbc [-h | --help] table <tableNames>... STREAM jdbc table <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <tableNames>... the table names
jdbc open
NAME jdbc open - open a connection from JNDI bound datasource SYNOPSIS jdbc [-h | --help] open <globalName> STREAM jdbc open <java.lang.Void, java.lang.String> PARAMETERS [-h | --help] Display this help message <globalName> The datasource JNDI name
jdbc connect
NAME jdbc connect - connect to database with a JDBC connection string SYNOPSIS jdbc [-h | --help] connect [-u | --username] [-p | --password] [--properties] <connectionString> STREAM jdbc connect <java.lang.Void, java.lang.String> PARAMETERS [-h | --help] Display this help message [-u | --username] The username [-p | --password] The password [--properties] The extra properties <connectionString> The connection string
jdbc info
NAME jdbc info - describe the database SYNOPSIS jdbc [-h | --help] info STREAM jdbc info <java.lang.Void, java.util.Map> PARAMETERS [-h | --help] Display this help message
jdbc tables
NAME jdbc tables - describe the tables SYNOPSIS jdbc [-h | --help] tables STREAM jdbc tables <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
jmx
NAME jmx - Java Management Extensions SYNOPSIS jmx [-h | --help] COMMAND [ARGS] DESCRIPTION The jmx commands interracts with the JMX registry allowing several kind JMX operations. PARAMETERS [-h | --help] Display this help message COMMANDS get Retrieves the attributes of a stream of managed beans, this command can be used by specifying managed bean arguments % jmx get java.lang:type=ClassLoading It also accepts a managed bean stream: % jmx query -p java.lang:* | jmx get By default all managed bean attributes will be retrieved, the attributes option allow to use a list of attributes: % jmx query -p java.lang:* | jmx get -a TotalSwapSpaceSize query Create a stream of managed beans, by default the stream will contain all the registered managed beans: % jmx query ... The stream can be filtered with the pattern option: % jmx query -p java.lang:* ... info Provide the mbean info for a managed bean: % jmx info java.lang:type=ClassLoading sun.management.ClassLoadingImpl +- ClassName sun.management.ClassLoadingImpl | Description Information on the management interface of the MBean +-Descriptor | +-immutableInfo true | interfaceClassName java.lang.management.ClassLoadingMXBean | mxbean true +-Attributes | +-NAME TYPE DESCRIPTION | Verbose boolean Verbose | TotalLoadedClassCount long TotalLoadedClassCount | LoadedClassCount int LoadedClassCount | UnloadedClassCount long UnloadedClassCount | ObjectName javax.management.ObjectName ObjectName +-Operations
jmx get
NAME jmx get - get attributes of a managed bean SYNOPSIS jmx [-h | --help] get [-s | --silent] [-n | --name] [-a | --attributes] <mbean>... STREAM jmx get <javax.management.ObjectName, java.util.Map> DESCRIPTION Retrieves the attributes of a stream of managed beans, this command can be used by specifying managed bean arguments % jmx get java.lang:type=ClassLoading It also accepts a managed bean stream: % jmx query -p java.lang:* | jmx get By default all managed bean attributes will be retrieved, the attributes option allow to use a list of attributes: % jmx query -p java.lang:* | jmx get -a TotalSwapSpaceSize PARAMETERS [-h | --help] Display this help message [-s | --silent] silent mode ignores any attribute runtime failures [-n | --name] add a column with the option value with the managed bean name [-a | --attributes] specifies a managed bean attribute name <mbean>... a managed bean object name
jmx query
NAME jmx query - query mbeans SYNOPSIS jmx [-h | --help] query <arg> STREAM jmx query <java.lang.Void, javax.management.ObjectName> DESCRIPTION Create a stream of managed beans, by default the stream will contain all the registered managed beans: % jmx query ... The stream can be filtered with the pattern option: % jmx query -p java.lang:* ... PARAMETERS [-h | --help] Display this help message <arg> the object name pattern for the query
jmx info
NAME jmx info - provide the mbean info of a managed bean SYNOPSIS jmx [-h | --help] info <arg> STREAM jmx info <java.lang.Void, javax.management.MBeanInfo> DESCRIPTION Provide the mbean info for a managed bean: % jmx info java.lang:type=ClassLoading sun.management.ClassLoadingImpl +- ClassName sun.management.ClassLoadingImpl | Description Information on the management interface of the MBean +-Descriptor | +-immutableInfo true | interfaceClassName java.lang.management.ClassLoadingMXBean | mxbean true +-Attributes | +-NAME TYPE DESCRIPTION | Verbose boolean Verbose | TotalLoadedClassCount long TotalLoadedClassCount | LoadedClassCount int LoadedClassCount | UnloadedClassCount long UnloadedClassCount | ObjectName javax.management.ObjectName ObjectName +-Operations PARAMETERS [-h | --help] Display this help message <arg> a managed bean object name
jndi
NAME jndi - Java Naming and Directory Interface SYNOPSIS jndi [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS find List JNDI resources
jndi find
NAME jndi find - List JNDI resources SYNOPSIS jndi [-h | --help] find [-f | --filter] [-n | --name] [-v | --verbose] [-d | --datasources] [-e | --emf] [-m | --mail] STREAM jndi find <java.lang.Void, org.crsh.text.renderers.BindingRenderer$BindingData> PARAMETERS [-h | --help] Display this help message [-f | --filter] Filter displayed resources using FQN type' [-n | --name] Filter displayed resources using name' [-v | --verbose] Display resource type' [-d | --datasources] Apply a filter on 'javax.sql.DataSource' [-e | --emf] Apply a filter on 'javax.persistence.EntityManagerFactory' [-m | --mail] Apply a filter on 'javax.mail.Session'
jpa
NAME jpa - Java persistance API SYNOPSIS jpa [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS close Close the current JPA session open Open a JPA session entity Display JPA entity entities List JPA entities select Execute select JPA query
jpa close
NAME jpa close - Close the current JPA session SYNOPSIS jpa [-h | --help] close STREAM jpa close <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
jpa open
NAME jpa open - Open a JPA session SYNOPSIS jpa [-h | --help] open <jndiName> STREAM jpa open <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <jndiName>
jpa entity
NAME jpa entity - Display JPA entity SYNOPSIS jpa [-h | --help] entity <name> STREAM jpa entity <java.lang.Void, org.crsh.text.renderers.EntityTypeRenderer$EntityTypeData> PARAMETERS [-h | --help] Display this help message <name>
jul
NAME jul - java.util.logging commands SYNOPSIS jul [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS add create one or several loggers set The set command sets the level of a logger. One or several logger names can be specified as arguments and the -l option specify the level among the finest, finer, fine, info, warn and severe levels. When no level is specified, the level is cleared and the level will be inherited from its ancestors. % jul set -l trace foo % jul set foo The logger name can be omitted and instead stream of logger can be consumed as it is a <Logger,Void> command. The following set the level warn on all the available loggers: % jul ls | jul set -l warn tail The tail command provides a tail view of a list of loggers. One or several logger names can be specified as argument and the -l option configures the level threshold. When no logger name is specified, the root logger will be tailed, when no level is specified, the info level will be used: % jul tail Feb 10, 2014 1:50:36 PM java_util_logging_Logger$log call INFO: HELLO The tail process will end upon interruption (ctrl-c). ls The jul ls command list all the available loggers, for instance: % jul ls org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[default] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/eXoGadgetServer].[concat] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/dashboard].[jsp] ... The -f switch provides filtering with a Java regular expression % jul ls -f javax.* javax.management.mbeanserver javax.management.modelmbean The jul ls command is a <Void,Logger> command, therefore any logger produced can be consumed. send The send command log one or several loggers with a specified message. For instance the following impersonates the javax.management.mbeanserver class and send a message on its own logger. #% jul send -m hello javax.management.mbeanserver Send is a <Logger, Void> command, it can log messages to consumed log objects: % jul ls | jul send -m hello -l warn
jul add
NAME jul add - create one or several loggers SYNOPSIS jul [-h | --help] add <name>... STREAM jul add <java.lang.Void, java.util.logging.Logger> PARAMETERS [-h | --help] Display this help message <name>... The name of the logger
jul set
NAME jul set - configures the level of one of several loggers SYNOPSIS jul [-h | --help] set [-l | --level] <name>... STREAM jul set <java.util.logging.Logger, java.lang.Object> DESCRIPTION The set command sets the level of a logger. One or several logger names can be specified as arguments and the -l option specify the level among the finest, finer, fine, info, warn and severe levels. When no level is specified, the level is cleared and the level will be inherited from its ancestors. % jul set -l trace foo % jul set foo The logger name can be omitted and instead stream of logger can be consumed as it is a <Logger,Void> command. The following set the level warn on all the available loggers: % jul ls | jul set -l warn PARAMETERS [-h | --help] Display this help message [-l | --level] The logger level to assign among {trace, debug, info, warn, error} <name>... The name of the logger
jul tail
NAME jul tail - tail loggers SYNOPSIS jul [-h | --help] tail [-l | --level] <name>... STREAM jul tail <java.lang.Void, java.util.logging.LogRecord> DESCRIPTION The tail command provides a tail view of a list of loggers. One or several logger names can be specified as argument and the -l option configures the level threshold. When no logger name is specified, the root logger will be tailed, when no level is specified, the info level will be used: % jul tail Feb 10, 2014 1:50:36 PM java_util_logging_Logger$log call INFO: HELLO The tail process will end upon interruption (ctrl-c). PARAMETERS [-h | --help] Display this help message [-l | --level] The logger level to assign among {trace, debug, info, warn, error} <name>... The name of the logger
jul ls
NAME jul ls - list the available loggers SYNOPSIS jul [-h | --help] ls [-f | --filter] STREAM jul ls <java.lang.Void, java.util.logging.Logger> DESCRIPTION The jul ls command list all the available loggers, for instance: % jul ls org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[default] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/eXoGadgetServer].[concat] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/dashboard].[jsp] ... The -f switch provides filtering with a Java regular expression % jul ls -f javax.* javax.management.mbeanserver javax.management.modelmbean The jul ls command is a <Void,Logger> command, therefore any logger produced can be consumed. PARAMETERS [-h | --help] Display this help message [-f | --filter] A regular expressions used to filter the loggers
jul send
NAME jul send - send a message to a jul logger SYNOPSIS jul [-h | --help] send [-m | --message] [-l | --level] <name> STREAM jul send <java.util.logging.Logger, java.lang.Object> DESCRIPTION The send command log one or several loggers with a specified message. For instance the following impersonates the javax.management.mbeanserver class and send a message on its own logger. #% jul send -m hello javax.management.mbeanserver Send is a <Logger, Void> command, it can log messages to consumed log objects: % jul ls | jul send -m hello -l warn PARAMETERS [-h | --help] Display this help message [-m | --message] The message to log [-l | --level] The logger level to assign among {trace, debug, info, warn, error} <name> The name of the logger
jvm
NAME jvm - JVM informations SYNOPSIS jvm [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS gc Show JVM garbage collection system Show JVM operating system runtime Show JVM runtime pool Show JVM memory pool heap Show JVM memory heap classloading Show JVM classloding compilation Show JVM compilation nonheap Show JVM memory non heap pools Show JVM memory pools top
jvm gc
NAME jvm gc - Show JVM garbage collection SYNOPSIS jvm [-h | --help] gc STREAM jvm gc <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
jvm system
NAME jvm system - Show JVM operating system SYNOPSIS jvm [-h | --help] system STREAM jvm system <java.lang.Void, java.util.Map> PARAMETERS [-h | --help] Display this help message
jvm runtime
NAME jvm runtime - Show JVM runtime SYNOPSIS jvm [-h | --help] runtime STREAM jvm runtime <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
jvm pool
NAME jvm pool - Show JVM memory pool SYNOPSIS jvm [-h | --help] pool <pools>... STREAM jvm pool <java.lang.String, java.lang.management.MemoryUsage> PARAMETERS [-h | --help] Display this help message <pools>...
jvm heap
NAME jvm heap - Show JVM memory heap SYNOPSIS jvm [-h | --help] heap STREAM jvm heap <java.lang.Void, java.lang.management.MemoryUsage> PARAMETERS [-h | --help] Display this help message
jvm classloading
NAME jvm classloading - Show JVM classloding SYNOPSIS jvm [-h | --help] classloading STREAM jvm classloading <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
jvm compilation
NAME jvm compilation - Show JVM compilation SYNOPSIS jvm [-h | --help] compilation STREAM jvm compilation <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
jvm nonheap
NAME jvm nonheap - Show JVM memory non heap SYNOPSIS jvm [-h | --help] nonheap STREAM jvm nonheap <java.lang.Void, java.lang.management.MemoryUsage> PARAMETERS [-h | --help] Display this help message
less
NAME less - opposite of more SYNOPSIS less [-h | --help] STREAM less <java.lang.CharSequence, java.lang.Object> DESCRIPTION Less is a program similar to more, but which allows backward movement in the file as well as forward movement. The following commands are available while less is running: SPACE - Scroll forward one page UP - Scroll forward one line DOWN - Scroll backward one line q - Quit PARAMETERS [-h | --help] Display this help message
ls
NAME ls - list the content of a node SYNOPSIS ls [-d | --depth] [-h | --help] <path> STREAM ls <java.lang.Void, java.lang.Object> DESCRIPTION The ls command displays the content of a node. By default it lists the content of the current node, however it also accepts a path argument that can be absolute or relative. [/]% ls / +-properties | +-jcr:primaryType: nt:unstructured | +-jcr:mixinTypes: [exo:owneable,exo:privilegeable] | +-exo:owner: '__system' | +-exo:permissions: [any read,*:/platform/administrators read] +-children | +-/workspace | +-/contents | +-/Users | +-/gadgets | +-/folder PARAMETERS [-d | --depth] The depth of the printed tree [-h | --help] Display this help message <path> The path of the node content to list
man
NAME man - format and display the on-line manual pages SYNOPSIS man [-h | --help] <command> STREAM man <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <command> the command
mixin
NAME mixin - mixin commands SYNOPSIS mixin [-h | --help] COMMAND [ARGS] DESCRIPTION The mixin command manipulates JCR node mixins. Mixins can be added to or removed from nodes. PARAMETERS [-h | --help] Display this help message COMMANDS add The add command addds a mixin to one or several nodes, this command is a <Node,Void> command, and can add a mixin from an incoming node stream, for instance: [/]% select * from mynode | mixin add mix:versionable remove The remove command removes a mixin from one or several nodes, this command is a <Node,Void> command, and can remove a mixin from an incoming node stream, for instance: [/]% select * from mynode | mixin remove mix:versionable
mixin add
NAME mixin add - add a mixin to one or several nodes SYNOPSIS mixin [-h | --help] add <mixin> <paths>... STREAM mixin add <javax.jcr.Node, javax.jcr.Node> DESCRIPTION The add command addds a mixin to one or several nodes, this command is a <Node,Void> command, and can add a mixin from an incoming node stream, for instance: [/]% select * from mynode | mixin add mix:versionable PARAMETERS [-h | --help] Display this help message <mixin> the mixin name to add <paths>... the paths of the node receiving the mixin
mixin remove
NAME mixin remove - removes a mixin from one or several nodes SYNOPSIS mixin [-h | --help] remove <mixin> <paths>... STREAM mixin remove <javax.jcr.Node, javax.jcr.Node> DESCRIPTION The remove command removes a mixin from one or several nodes, this command is a <Node,Void> command, and can remove a mixin from an incoming node stream, for instance: [/]% select * from mynode | mixin remove mix:versionable PARAMETERS [-h | --help] Display this help message <mixin> the mixin name to remove <paths>... the paths of the node receiving the mixin
mv
NAME mv - move a node SYNOPSIS mv [-h | --help] <sources>... <destination> STREAM mv <javax.jcr.Node, javax.jcr.Node> DESCRIPTION The mv command can move a node to a target location in the JCR tree. It can be used also to rename a node. The mv command is a <Node,Node> command consuming a stream of node to move them and producing nodes that were moved. [/registry]% mv Registry Registry2 PARAMETERS [-h | --help] Display this help message <sources>... The path of the source nodes to move, absolute or relative <destination> The destination path absolute or relative
node
NAME node - node commands SYNOPSIS node [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS add The addnode command creates one or several nodes. The command takes at least one node as argument, but it can take more. Each path can be either absolute or relative, relative path creates nodes relative to the current node. By default the node type is the default repository node type, but the option -t can be used to specify another one. [/registry]% addnode foo Node /foo created [/registry]% addnode -t nt:file bar juu Node /bar /juu created The addnode command is a <Void,Node> command that produces all the nodes that were created. set The set command updates the property of a node. Create or destroy property foo with the value bar on the root node: [/]% set / foo bar Property created Update the existing foo property: [/]% set / foo juu When a property is created and does not have a property descriptor that constraint its type, you can specify it with the -t option [/]% set -t LONG long_property 3 set is a <Node,Node> command updating the property of the consumed node stream. export Exports a node as an nt file in the same workspace: [/]% node export gadgets /gadgets.xml The node has been exported unset The unset command removes the property of a node. [/]% unset / foo unset is a <Node,Void> command updating the property of the consumed node stream. import Imports a node from an nt:file node located in the workspace: [/]% importnode /gadgets.xml / Node imported
node add
NAME node add - creates one or several nodes SYNOPSIS node [-h | --help] add [-t | --type] <paths>... STREAM node add <java.lang.Void, javax.jcr.Node> DESCRIPTION The addnode command creates one or several nodes. The command takes at least one node as argument, but it can take more. Each path can be either absolute or relative, relative path creates nodes relative to the current node. By default the node type is the default repository node type, but the option -t can be used to specify another one. [/registry]% addnode foo Node /foo created [/registry]% addnode -t nt:file bar juu Node /bar /juu created The addnode command is a <Void,Node> command that produces all the nodes that were created. PARAMETERS [-h | --help] Display this help message [-t | --type] The name of the primary node type to create. <paths>... The paths of the new node to be created, the paths can either be absolute or relative.
node set
NAME node set - set a property on nodes SYNOPSIS node [-h | --help] set [-t | --type] <path>... <propertyName> <propertyValue> STREAM node set <javax.jcr.Node, javax.jcr.Node> DESCRIPTION The set command updates the property of a node. Create or destroy property foo with the value bar on the root node: [/]% set / foo bar Property created Update the existing foo property: [/]% set / foo juu When a property is created and does not have a property descriptor that constraint its type, you can specify it with the -t option [/]% set -t LONG long_property 3 set is a <Node,Node> command updating the property of the consumed node stream. PARAMETERS [-h | --help] Display this help message [-t | --type] The property type to use when it cannot be inferred <path>... The source nodes to move, absolute or relative <propertyName> The name of the property to alter <propertyValue> The new value of the property
node export
NAME node export - export a node to an nt file SYNOPSIS node [-h | --help] export <source> <target> STREAM node export <java.lang.Void, java.lang.Object> DESCRIPTION Exports a node as an nt file in the same workspace: [/]% node export gadgets /gadgets.xml The node has been exported PARAMETERS [-h | --help] Display this help message <source> The path of the exported node <target> The path of the exported nt:file node
node unset
NAME node unset - remove a property on nodes SYNOPSIS node [-h | --help] unset <path>... <propertyName> STREAM node unset <javax.jcr.Node, javax.jcr.Node> DESCRIPTION The unset command removes the property of a node. [/]% unset / foo unset is a <Node,Void> command updating the property of the consumed node stream. PARAMETERS [-h | --help] Display this help message <path>... The source nodes to move, absolute or relative <propertyName> The name of the property to remove
node import
NAME node import - imports a node from an nt file SYNOPSIS node [-h | --help] import <source> <target> STREAM node import <java.lang.Void, java.lang.Object> DESCRIPTION Imports a node from an nt:file node located in the workspace: [/]% importnode /gadgets.xml / Node imported PARAMETERS [-h | --help] Display this help message <source> The path of the imported nt:file node <target> The path of the parent imported node
pwd
NAME pwd - print the current node path SYNOPSIS pwd [-h | --help] STREAM pwd <java.lang.Void, groovy.util.Node> DESCRIPTION The pwd command prints the current node path, the current node is produced by this command. [/gadgets]% pwd /gadgets PARAMETERS [-h | --help] Display this help message
repo
NAME repo - repository interaction commands SYNOPSIS repo [-h | --help] COMMAND [ARGS] DESCRIPTION The repo commands allow to select a repository to use, it is the main entry point for using JCR commands. The set of available repository plugins can be discovered with the ls command: % repo ls Available JCR plugins: exo - Exo JCR plugin - You can use a container bound repository: 'repo use container=portal' A repository can then be selected with the use command. For the eXo repository you can use a container bound repository: % repo use container=portal jackrabbit - Jackrabbit JCR Plugin. JackRabbit must be properly configured to provide any of the following access methods. For the details, see the following resources. * http://jackrabbit.apache.org/deployment-models.html * http://wiki.apache.org/jackrabbit/RemoteAccess * http://jackrabbit.apache.org/shared-j2ee-resource-howto.html Connect via RMI: % repo use org.apache.jackrabbit.repository.uri=rmi://localhost:1099/jackrabbit Connect via JNDI: % repo use org.apache.jackrabbit.repository.uri=jndi:java:comp/env/jcr/jackrabbit Connect via WebDAV: % repo use org.apache.jackrabbit.repository.uri=http://localhost:8080/jackrabbit-webapp/repository/ PARAMETERS [-h | --help] Display this help message COMMANDS info The info command print the descriptor of the current repository. ls The ls command print the available repository plugins. use The use command changes the current repository used by for JCR commands. The command accepts a set of properties as main command argument that will be used to select a repository: % repo use parameterName=parameterValue;nextParameterName=nextParameterValue The parameters is specific to JCR plugin implementations, more details can be found thanks to the ls command.
repo info
NAME repo info - show info about the current repository SYNOPSIS repo [-h | --help] info STREAM repo info <java.lang.Void, java.lang.Object> DESCRIPTION The info command print the descriptor of the current repository. PARAMETERS [-h | --help] Display this help message
repo ls
NAME repo ls - list the available repository plugins SYNOPSIS repo [-h | --help] ls STREAM repo ls <java.lang.Void, java.lang.Object> DESCRIPTION The ls command print the available repository plugins. PARAMETERS [-h | --help] Display this help message
repo use
NAME repo use - changes the current repository SYNOPSIS repo [-h | --help] use <parameters> STREAM repo use <java.lang.Void, java.lang.Object> DESCRIPTION The use command changes the current repository used by for JCR commands. The command accepts a set of properties as main command argument that will be used to select a repository: % repo use parameterName=parameterValue;nextParameterName=nextParameterValue The parameters is specific to JCR plugin implementations, more details can be found thanks to the ls command. PARAMETERS [-h | --help] Display this help message <parameters> The parameters used to instantiate the repository to be used in this session
rm
NAME rm - remove one or several node or a property SYNOPSIS rm [-h | --help] <paths>... STREAM rm <javax.jcr.Node, java.lang.Void> DESCRIPTION The rm command removes a node or property specified by its path either absolute or relative. This operation is executed against the JCR session, meaning that it will not be effective until it is commited to the JCR server. [/]% rm foo Node /foo removed It is possible to specify several nodes. [/]% rm foo bar Node /foo /bar removed rm is a <Node,Void> command removing all the consumed nodes. PARAMETERS [-h | --help] Display this help message <paths>... The paths of the node to remove
rollback
NAME rollback - rollback changes SYNOPSIS rollback [-h | --help] <path> STREAM rollback <java.lang.Void, java.lang.Object> DESCRIPTION Rollbacks the changes of the current session. A node can be provided to rollback the state of the this nodes and its descendants only. PARAMETERS [-h | --help] Display this help message <path> the path to rollback
select
NAME select - execute a JCR sql query SYNOPSIS select [-o | --offset] [-l | --limit] [-a | --all] [-h | --help] <query>... STREAM select <java.lang.Void, javax.jcr.Node> DESCRIPTION Queries in SQL format are possible via the ##select## command. You can write a query with the same syntax defined by the specification and add options to control the number of results returned. By default the number of nodes is limited to 5 results: [/]% select * from nt:base The query matched 1114 nodes +-/ | +-properties | | +-jcr:primaryType: nt:unstructured | | +-jcr:mixinTypes: [exo:owneable,exo:privilegeable] | | +-exo:owner: '__system' | | +-exo:permissions: [any read,*:/platform/administrators read] +-/workspace | +-properties | | +-jcr:primaryType: mop:workspace | | +-jcr:uuid: 'a69f226ec0a80002007ca83e5845cdac' ... Display 20 nodes from the offset 10: [/]% select -o 10 -l 20 * from nt:base The query matched 1114 nodes ... It is possible also to remove the limit of displayed nodes with the -a option (you should use this option with care) : [/]% select -a * from nt:base The query matched 1114 nodes ... select is a <Void,Node> command producing all the matched nodes. PARAMETERS [-o | --offset] The offset of the first node to display [-l | --limit] The number of nodes displayed, by default this value is equals to 5 [-a | --all] Display all the results by ignoring the limit argument, this should be used with care for large result set [-h | --help] Display this help message <query>... The query, as is
shell
NAME shell - shell related command SYNOPSIS shell [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS properties list the configuration properties and their description plugins list the loaded plugins and their configuration
sleep
NAME sleep - sleep for some time SYNOPSIS sleep [-h | --help] <time> STREAM sleep <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <time> sleep time in seconds
sort
NAME sort - sort a map SYNOPSIS sort [-f | --fields] [-h | --help] STREAM sort <java.util.Map, java.util.Map> PARAMETERS [-f | --fields] Filed used to sort [-h | --help] Display this help message
system
NAME system - vm system properties commands SYNOPSIS system [-h | --help] COMMAND [ARGS] PARAMETERS [-h | --help] Display this help message COMMANDS gc call garbage collector freemem show free memory propget get a system property propset set a system property propls list the vm system properties proprm remove a system property totalmem show total memory
system gc
NAME system gc - call garbage collector SYNOPSIS system [-h | --help] gc STREAM system gc <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message
system freemem
NAME system freemem - show free memory SYNOPSIS system [-h | --help] freemem [-u | --unit] [-d | --decimal] STREAM system freemem <java.lang.Void, java.lang.String> PARAMETERS [-h | --help] Display this help message [-u | --unit] The unit of the memory space size {(B)yte, (O)ctet, (M)egaOctet, (G)igaOctet} [-d | --decimal] The number of decimal (default 0)
system propget
NAME system propget - get a system property SYNOPSIS system [-h | --help] propget <name> STREAM system propget <java.lang.Void, java.lang.String> PARAMETERS [-h | --help] Display this help message <name> The name of the property
system propset
NAME system propset - set a system property SYNOPSIS system [-h | --help] propset <name> <value> STREAM system propset <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <name> The name of the property <value> The value of the property
system propls
NAME system propls - list the vm system properties SYNOPSIS system [-h | --help] propls [-f | --filter] STREAM system propls <java.lang.Void, java.util.Map> PARAMETERS [-h | --help] Display this help message [-f | --filter] filter the property with a regular expression on their name
system proprm
NAME system proprm - remove a system property SYNOPSIS system [-h | --help] proprm <name> STREAM system proprm <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message <name> The name of the property
system totalmem
NAME system totalmem - show total memory SYNOPSIS system [-h | --help] totalmem [-u | --unit] [-d | --decimal] STREAM system totalmem <java.lang.Void, java.lang.String> PARAMETERS [-h | --help] Display this help message [-u | --unit] The unit of the memory space size {(B)yte, (O)ctet, (M)egaOctet, (G)igaOctet} [-d | --decimal] The number of decimal (default 0)
thread
NAME thread - JVM thread commands SYNOPSIS thread [-h | --help] COMMAND [ARGS] DESCRIPTION The thread command provides introspection and control over JVM threads: % thread ls ID PRIORITY STATE INTERRUPTED DAEMON NAME 2 10 WAITING false true Reference Handler 3 8 WAITING false true Finalizer 6 9 RUNNABLE false true Signal Dispatcher 1 5 WAITING false false main 13 1 TIMED_WAITING false true Poller SunPKCS11-Darwin 14 5 WAITING false false pool-1-thread-1 15 5 WAITING false false pool-1-thread-2 16 5 WAITING false false pool-1-thread-3 17 5 WAITING false false pool-1-thread-4 27 5 WAITING false false pool-1-thread-6 19 5 RUNNABLE false false org.crsh.standalone.CRaSH.main() % thread stop 14 Stopped thread Thread[pool-1-thread-1,5,main] % thread interrupt 17 Interrupted thread Thread[pool-1-thread-1,5,main] In addition of the classical usage, the various commands (ls, stop, interrupt) can be combined with a pipe, the most common operation is to combine the ls command with the stop, interrupt or dump command, for instance the following command will interrupt all the thread having a name starting with the 'pool' prefix: % thread ls --filter pool.* | thread interrupt Interrupted thread Thread[pool-1-thread-1,5,main] Interrupted thread Thread[pool-1-thread-2,5,main] Interrupted thread Thread[pool-1-thread-3,5,main] Interrupted thread Thread[pool-1-thread-4,5,main] Interrupted thread Thread[pool-1-thread-5,5,main] PARAMETERS [-h | --help] Display this help message COMMANDS stop Stop VM threads. interrupt Interrup VM threads. ls list the vm threads dump Dump VM threads. top thread top
thread stop
NAME thread stop - stop vm threads SYNOPSIS thread [-h | --help] stop <threads>... STREAM thread stop <java.lang.Thread, java.lang.Thread> DESCRIPTION Stop VM threads. PARAMETERS [-h | --help] Display this help message <threads>... the thread ids to stop
thread interrupt
NAME thread interrupt - interrupt vm threads SYNOPSIS thread [-h | --help] interrupt <threads>... STREAM thread interrupt <java.lang.Thread, java.lang.Thread> DESCRIPTION Interrup VM threads. PARAMETERS [-h | --help] Display this help message <threads>... the thread ids to interrupt
thread ls
NAME thread ls - list the vm threads SYNOPSIS thread [-h | --help] ls [-n | --name] [-g | --group] [-s | --state] STREAM thread ls <java.lang.Void, java.lang.Thread> PARAMETERS [-h | --help] Display this help message [-n | --name] Filter the threads with a glob expression on their name [-g | --group] Filter the threads with a glob expression on their group [-s | --state] Filter the threads by their status (new,runnable,blocked,waiting,timed_waiting,terminated)
thread dump
NAME thread dump - dump vm threads SYNOPSIS thread [-h | --help] dump <threads>... STREAM thread dump <java.lang.Thread, java.lang.Object> DESCRIPTION Dump VM threads. PARAMETERS [-h | --help] Display this help message <threads>... the thread ids to dump
thread top
NAME thread top - thread top SYNOPSIS thread [-h | --help] top [-n | --name] [-g | --group] [-s | --state] STREAM thread top <java.lang.Void, java.lang.Object> PARAMETERS [-h | --help] Display this help message [-n | --name] Filter the threads with a glob expression on their name [-g | --group] Filter the threads with a glob expression on their group [-s | --state] Filter the threads by their status (new,runnable,blocked,waiting,timed_waiting,terminated)
version
NAME version - versioning commands SYNOPSIS version [-h | --help] COMMAND [ARGS] DESCRIPTION Versionning commands PARAMETERS [-h | --help] Display this help message COMMANDS checkin Perform a node checkin checkout Perform a node checkout
ws
NAME ws - workspace commands SYNOPSIS ws [-h | --help] COMMAND [ARGS] DESCRIPTION The ws command provides a set of commands interacting with JCR workspace. PARAMETERS [-h | --help] Display this help message COMMANDS login This command login to a JCR workspace and establish a session with the repository. When you are connected the shell maintain a JCR session and allows you to interact with the session in a shell oriented fashion. The repository name must be specified and optionally you can specify a user name and password to have more privileges. Before performing a login operation, a repository must be first selected with the repo command, for instance: % repo use container=portal Once a repository is obtained the login operation can be done: % ws login portal-system Connected to workspace portal-system % ws login -u root -p gtn portal-system Connected to workspace portal-system logout This command logout from the currently connected JCR workspace
ws login
NAME ws login - login to a workspace SYNOPSIS ws [-h | --help] login [-u | --username] [-p | --password] [-c | --container] <workspaceName> STREAM ws login <java.lang.Void, java.lang.Object> DESCRIPTION This command login to a JCR workspace and establish a session with the repository. When you are connected the shell maintain a JCR session and allows you to interact with the session in a shell oriented fashion. The repository name must be specified and optionally you can specify a user name and password to have more privileges. Before performing a login operation, a repository must be first selected with the repo command, for instance: % repo use container=portal Once a repository is obtained the login operation can be done: % ws login portal-system Connected to workspace portal-system % ws login -u root -p gtn portal-system Connected to workspace portal-system PARAMETERS [-h | --help] Display this help message [-u | --username] The user name [-p | --password] The user password [-c | --container] The portal container name (eXo JCR specific) <workspaceName> The name of the workspace to connect to
xpath
NAME xpath - execute a JCR xpath query SYNOPSIS xpath [-o | --offset] [-l | --limit] [-a | --all] [-h | --help] <query> STREAM xpath <java.lang.Void, java.lang.Object> DESCRIPTION Executes a JCR query with the xpath dialect, by default results are limited to 5. All results matched by the query are produced by this command. PARAMETERS [-o | --offset] The offset of the first node to display [-l | --limit] The number of nodes displayed, by default this value is equals to 5 [-a | --all] Display all the results by ignoring the limit argument, this should be used with care for large result set [-h | --help] Display this help message <query> The query