Commit ee3d9d61 authored by Thibaut Guinoiseau's avatar Thibaut Guinoiseau
Browse files

Add shell's README.txt (to be finished), shell samples (target: shell_server)...

Add shell's README.txt (to be finished), shell samples (target: shell_server) with corresponding conf (config_shell.properties)
+ minor modifications 
parent 54af634e
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
################################
# Framework config properties. #
################################
# To override the packages the framework exports by default from the
# class path, set this variable.
#org.osgi.framework.system.packages=
# To append packages to the default set of exported system packages,
# set this value.
#org.osgi.framework.system.packages.extra=
# The following property makes specified packages from the class path
# available to all bundles. You should avoid using this property.
#org.osgi.framework.bootdelegation=sun.*,com.sun.*
# Felix tries to guess when to implicitly boot delegate in certain
# situations to ease integration without outside code. This feature
# is enabled by default, uncomment the following line to disable it.
#felix.bootdelegation.implicit=false
# The following property explicitly specifies the location of the bundle
# cache, which defaults to "felix-cache" in the current working directory.
# If this value is not absolute, then the felix.cache.rootdir controls
# how the absolute location is calculated. (See next property)
#org.osgi.framework.storage=${felix.cache.rootdir}/felix-cache
# The following property is used to convert a relative bundle cache
# location into an absolute one by specifying the root to prepend to
# the relative cache path. The default for this property is the
# current working directory.
#felix.cache.rootdir=${user.dir}
# The following property controls whether the bundle cache is flushed
# the first time the framework is initialized. Possible values are
# "none" and "onFirstInit"; the default is "none".
org.osgi.framework.storage.clean=onFirstInit
# The following property determines which actions are performed when
# processing the auto-deploy directory. It is a comma-delimited list of
# the following values: 'install', 'start', 'update', and 'uninstall'.
# An undefined or blank value is equivalent to disabling auto-deploy
# processing.
felix.auto.deploy.action=install,start
# The following property specifies the directory to use as the bundle
# auto-deploy directory; the default is 'bundle' in the working directory.
# felix.auto.deploy.dir=../ship/bundle
# The following property is a space-delimited list of bundle URLs
# to install and start when the framework starts. The ending numerical
# component is the target start level. Any number of these properties
# may be specified for different start levels.
felix.auto.start.1= \
file:../../../ship/bundle/org.apache.felix.shell.remote.jar \
file:../../../ship/bundle/monolog.jar \
file:../../../ship/bundle/a3-common.jar \
file:../../../ship/bundle/a3-rt.jar \
file:../../../ship/bundle/jcup.jar \
file:../../../ship/bundle/jndi-shared.jar \
file:../../../ship/bundle/jndi-server.jar \
file:../../../ship/bundle/joram-shared.jar \
file:../../../ship/bundle/joram-mom-core.jar \
file:../../../ship/bundle/a3-osgi.jar \
file:../../../ship/bundle/org.apache.felix.gogo.runtime.jar \
file:../../../ship/bundle/org.apache.felix.gogo.shell.jar \
file:../../../ship/bundle/org.apache.felix.gogo.command.jar \
file:../../../ship/bundle/shell-mom.jar \
file:../../../ship/bundle/shell-jndi.jar \
file:../../../ship/bundle/shell-a3.jar
felix.log.level=1
# Sets the initial start level of the framework upon startup.
#org.osgi.framework.startlevel.beginning=1
# Sets the start level of newly installed bundles.
felix.startlevel.bundle=1
# Felix installs a stream and content handler factories by default,
# uncomment the following line to not install them.
#felix.service.urlhandlers=false
# The launcher registers a shutdown hook to cleanly stop the framework
# by default, uncomment the following line to disable it.
#felix.shutdown.hook=false
#############################
# Bundle config properties. #
#############################
# IP Address on which the remote shell is accessible (since 1.0.4).
# Note: Starting with version 1.0.4 the remote shell does not listen on
# all interfaces by default but on the localhost only. That is, by default
# the remote shell is only accessible from the host on which the remote
# shell is running. To access the system from another host, you have to
# configure the IP address of the interface to which the remote shell
# should be attached.
osgi.shell.telnet.ip=127.0.0.1
# Port on which the remote shell is accessible.
osgi.shell.telnet.port=6666
# The maximum number of simultaneous connections.
#osgi.shell.telnet.maxconn=2
# Sets the SO_TIMEOUT socket option to the given number of milliseconds.
# The default is no timeout.
#osgi.shell.telnet.socketTimeout=0
# Sets the identifier of the JORAM agent server to start, as defined in
# a3servers.xml file. Server 0 is started by default.
#fr.dyade.aaa.agent.AgentServer.id=0
# Sets the directory name where the agent server stores its persistent data.
#fr.dyade.aaa.agent.AgentServer.storage=s${fr.dyade.aaa.agent.AgentServer.id}
......@@ -9,7 +9,7 @@
<property name="lib.dir" location="${ship.dir}/lib"/>
<property name="run.dir" location="../../run"/>
<property name="conf.dir" location="../../config"/>
<property name="felix.dir" location="${ship.dir}/bin"/>
<property name="felix.dir" location="/home/thibaut/bin/felix-framework-4.0.2/bin/"/>
<property name="bundle.dir" location="${ship.dir}/bundle" />
<!-- Project classpath needed for execution -->
......@@ -70,7 +70,7 @@
<copy file="${conf.dir}/a3debug.cfg" todir="${run.dir}/server${sid}"/>
<copy file="${a3.conf}" tofile="${run.dir}/server${sid}/a3servers.xml"/>
<copy file="${osgi.conf}" tofile="${run.dir}/server${sid}/config.properties"/>
<copy file="${monit.conf}" tofile="${run.dir}/server${sid}/MonitoringConfig.xml"/>
<!--copy file="${monit.conf}" tofile="${run.dir}/server${sid}/MonitoringConfig.xml"/-->
</target>
<target name="simple_init" depends="init">
......@@ -98,6 +98,16 @@
<param name="monit.conf" value="${conf.dir}/MonitoringConfig_0.xml"/>
</antcall>
</target>
<!-- Start a single server with the shell commands -->
<target name="shell_server" depends="init"
description="--> Starts a single server with the shell commands">
<antcall target="server">
<param name="sid" value="0"/>
<param name="a3.conf" value="${conf.dir}/centralized_a3servers.xml"/>
<param name="osgi.conf" value="${conf.dir}/config_shell.properties"/>
</antcall>
</target>
<!-- Start a single server with NGTransaction component -->
<target name="ngt_server" depends="init"
......
......@@ -6,6 +6,8 @@ By: Scalagent D.T.
I\ Installation
1) Required bundles
* Apache Felix bundles
- Remote Shell
* Apache Felix Gogo bundles:
- Gogo Runtime
- Gogo Shell : simple TUI
......@@ -14,5 +16,85 @@ I\ Installation
- Shell A3 : A3 commands
- Shell MOM : MOM commands
- Shell JNDI : JNDI commands
2) Connect to Joram Shell
The Remote Shell bundle allows you to connect to Joram via Telnet. Make sure you have Telnet available.
Command: telnet <host> <port>
RQ: - osgi.shell.telnet.ip : IP address of the server's interface to which telnet connections are authorized.
For instance, there are two interfaces:
- loopback with IP address 127.0.0.1
- eth0 with address 192.168.1.42 linked to the company network
If the JORAM server has to be only accessible from the machine on which it runs, set the property to 127.0.0.1. Else, it must be accessible from other computer (such as administration computer), use the 129.168.1.42 address.
Take care though, for there is no authentification, make sure only authorized stations have access to the JORAM server.
- osgi.shell.telnet.port : Port used for the connection
II\ Using JORAM Shell Commands
1) A3 commands
- joram:a3:close :
Stops Joram and exit OSGi.
- joram:a3:engineLoad
Displays the average engine load for the last minute.
- joram:a3:garbageRatio
Displays the garbage ratio of the transactionnal persistence system.
- joram:a3:info
Displays info about the engine.
- joram:a3:restartServer
Stops and restarts the server.
- joram:a3:startServer
Starts the server, reinitialiazing the configuration.
- joram:a3:stopServer
Stops the server and resets the configuration.
2) MOM commands
- joram:mom:create
Creates a new user or a destination
- joram:mom:delete
Deletes a user or a destination
- joram:mom:deleteMsg
Not yet implemented.
- joram:mom:help
Shows help about a MOM command.
- joram:mom:info
Gives useful info about topic/queue/subscription.
- joram:mom:list
Lists users/destinations/queues/topics/subscriptions.
- joram:mom:lsMsg
Displays messages from a queue or a subscription. A range of indexes can be selected for displaying.
- joram:mom:ping
Checks whether a JoramAdminTopic exists. This is a temporary implementation.
- joram:mom:queueLoad
Displays the load of a queue.
- joram:mom:receiveMsg
Not yet implemented.
- joram:mom:sendMsg
Not yet implemented.
- joram:mom:subscriptionLoad
Displays the load of a subscription.
3) JNDI commands
- joram:jndi:createSubcontext
- joram:jndi:destroySubcontext
- joram:jndi:getNamingContext
- joram:jndi:getStrOwnerId
- joram:jndi:lookup
- joram:jndi:setStrOwnerId
- joram:jndi:unbind
II\ U
......@@ -93,7 +93,7 @@ public class MOMCommandsImpl implements MOMCommands {
"sendMsg", "receiveMsg",
"help"};
//TODO: retrieve help from file (easier to maintain)
//TODO: retrieve help from file?
/**
* Print the descrption of the given command
*/
......@@ -110,56 +110,57 @@ public class MOMCommandsImpl implements MOMCommands {
* @param command Name of the command to describe
*/
public static void help(String command) {
StringBuffer buf = new StringBuffer();
//Checks whether the command name contains the namespace
if(command.length()>NAMESPACE.length()
&& command.substring(0, NAMESPACE.length()).equalsIgnoreCase(NAMESPACE)) {
//If so, remove the namespace part
command = command.substring(NAMESPACE.length()+1, command.length());
}
String fullCommand = "["+NAMESPACE+":]"+command;
StringBuffer buf = new StringBuffer();
buf.append("Usage: ").append(fullCommand).append(" ");
if(command.equals("list")) {
if(command.equalsIgnoreCase("list")) {
buf.append("<category> [username]");
buf.append("\n\tPossible categories: destination, topic, queue, user, subscription");
buf.append("\n\tNB: For the subscription category, you must provide the user name.");
} else if(command.equals("create")) {
buf.append("<topic|queue> <name> [option...]\n");
} else if(command.equalsIgnoreCase("help")) {
buf.append("<command>");
buf.append("\nShows this help.");
} else if(command.equalsIgnoreCase("create")) {
buf.append("<topic|queue> <name> [option...]");
buf.append("\nOr ").append(fullCommand).append(" ");
buf.append("user [<name>]\n");
buf.append("Options: -sid <server id>\tSpecifies on which server the destination is to be created\n");
buf.append(" \tDefault: This server\n");
buf.append(" -ext <extension>\tSpecifies which extension class to instanciate\n");
buf.append(" \tDefault: None");
} else if(command.equals("queueLoad")) {
} else if(command.equalsIgnoreCase("queueLoad")) {
buf.append("<queueName>");
} else if(command.equals("subscriptionLoad")) {
} else if(command.equalsIgnoreCase("subscriptionLoad")) {
buf.append("<userName> <subscriptionName>");
} else if(command.equals("delete")) {
} else if(command.equalsIgnoreCase("delete")) {
buf.append("<topic|queue|user> <name>");
} else if(command.equals("addUser")) {
} else if(command.equalsIgnoreCase("addUser")) {
buf.append("[name]");
} else if(command.equals("info")) {
} else if(command.equalsIgnoreCase("info")) {
buf.append("<queue|topic> <name>");
buf.append("\n ").append(fullCommand).append(" ");
buf.append("subscription <username> <subscription name>");
} else if(command.equals("lsMsg")) {
} else if(command.equalsIgnoreCase("lsMsg")) {
buf.append("queue <queue name> [[first msg idx]:[last msg idx]]");
buf.append("\n ").append(fullCommand).append(" ");
buf.append("subscription <username> <subscription name> [[first msg idx]:[last msg idx]]");
} else if(command.equals("deleteMsg")) {
buf.append("queue <queue name> <msg id>");
buf.append("\n ").append(fullCommand).append(" ");
buf.append("subscription <username> <subscription name> <msg id>");
} else if(command.equals("receiveMsg")) {
buf.append("<queue name> [options]");
buf.append("Options: -n <x>\tReceive only <x> messages");
buf.append(" -t <x>\tTimes out after <x> seconds");
} else if(command.equals("sendMsg")) {
buf.append("(queue/topic) <destination name> <text>");
} else if(command.equals("ping")) {
} else if(command.equalsIgnoreCase("deleteMsg")) {
buf.append("queue <queue name> <msg id>");
buf.append("\n ").append(fullCommand).append(" ");
buf.append("subscription <username> <subscription name> <msg id>");
} else if(command.equalsIgnoreCase("receiveMsg")) {
buf.append("<queue name> [options]");
buf.append("Options: -n <x>\tReceive only <x> messages");
buf.append(" -t <x>\tTimes out after <x> seconds");
} else if(command.equalsIgnoreCase("sendMsg")) {
buf.append("(queue/topic) <destination name> <text>");
} else if(command.equalsIgnoreCase("ping")) {
buf.append("\nChecks whether a JoramAdminTopic exists.");
} else {
System.err.println("Unknown command: "+command);
......@@ -767,7 +768,12 @@ public class MOMCommandsImpl implements MOMCommands {
public static void main(String[] args) {
help("list");
help("create");
Scanner s = new Scanner(System.in);
String cmd = null;
System.out.print("Command? "); System.out.flush();
while(!(cmd=s.nextLine()).equalsIgnoreCase("exit")) {
help(cmd);
System.out.print("Command? "); System.out.flush();
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment