use of org.apache.karaf.shell.support.RegexCommandLoggingFilter in project karaf by apache.
the class Activator method doStart.
@Override
protected void doStart() throws Exception {
InstanceService instanceService = new InstanceServiceImpl();
register(InstanceService.class, instanceService);
RegexCommandLoggingFilter filter = new RegexCommandLoggingFilter();
filter.addCommandOption("--password", "connect");
filter.addCommandOption("-p", "connect");
register(CommandLoggingFilter.class, filter);
InstancesMBeanImpl mbean = new InstancesMBeanImpl(instanceService);
registerMBean(mbean, "type=instance");
}
use of org.apache.karaf.shell.support.RegexCommandLoggingFilter in project karaf by apache.
the class Activator method doStart.
@Override
protected void doStart() throws Exception {
JmsServiceImpl service = new JmsServiceImpl();
service.setBundleContext(bundleContext);
register(JmsService.class, service);
JmsMBeanImpl mbean = new JmsMBeanImpl();
mbean.setJmsService(service);
registerMBean(mbean, "type=jms");
RegexCommandLoggingFilter filter = new RegexCommandLoggingFilter();
filter.addRegEx("create +.*?--password ([^ ]+)", 2);
filter.addRegEx("create +.*?-p ([^ ]+)", 2);
register(CommandLoggingFilter.class, filter);
}
use of org.apache.karaf.shell.support.RegexCommandLoggingFilter in project karaf by apache.
the class Activator method doStart.
@Override
protected void doStart() throws Exception {
SessionFactory sf = getTrackedService(SessionFactory.class);
if (sf == null) {
return;
}
RegexCommandLoggingFilter filter = new RegexCommandLoggingFilter();
filter.setPattern("ssh (.*?)-P +([^ ]+)");
filter.setGroup(2);
register(CommandLoggingFilter.class, filter);
filter = new RegexCommandLoggingFilter();
filter.setPattern("ssh (.*?)--password +([^ ]+)");
filter.setGroup(2);
register(CommandLoggingFilter.class, filter);
sessionFactory = sf;
sessionFactory.getRegistry().getService(Manager.class).register(SshAction.class);
if (Boolean.parseBoolean(bundleContext.getProperty("karaf.startRemoteShell"))) {
server = createSshServer(sessionFactory);
this.bundleContext.registerService(SshServer.class, server, null);
if (server == null) {
// can result from bad specification.
return;
}
try {
server.start();
} catch (IOException e) {
LOGGER.warn("Exception caught while starting SSH server", e);
}
}
}
Aggregations