@Override public void init() { PluginContext context = getContext(); this.username = context.getProperty(SIMPLE_USERNAME); this.password = context.getProperty(SIMPLE_PASSWORD); }
@Override public void init() { smtpHost = getContext().getProperty(SMTP_HOST); smtpPort = getContext().getProperty(SMTP_PORT); smtpSecure = getContext().getProperty(SMTP_SECURE); smtpUsername = getContext().getProperty(SMTP_USERNAME); smtpPassword = getContext().getProperty(SMTP_PASSWORD); smtpFrom = getContext().getProperty(SMTP_FROM); debug = getContext().getProperty(DEBUG); }
synchronized void start() { if (!started) { // Start refresh Integer refreshRate = getProperty(PropertyDescriptor.VFS_REFRESH_PERIOD); TimeUnit timeUnit = getProperty(PropertyDescriptor.VFS_REFRESH_UNIT); if (refreshRate != null && refreshRate > 0) { TimeUnit tu = timeUnit != null ? timeUnit : TimeUnit.SECONDS; scannerFuture = scanner.scheduleWithFixedDelay(new Runnable() { public void run() { refresh(); } }, 0, refreshRate, tu); } // Init plugins manager.getPlugins(Object.class); // started = true; } else { log.log(Level.WARNING, "Attempt to double start"); } }
private void configureProperty(PluginContext context, Properties props, PropertyDescriptor<?> desc) { String key = "crash." + desc.name; String value = props.getProperty(key); if (value != null) { try { if (context.getProperty(desc) == null) { log.log(Level.INFO, "Configuring property " + desc.name + "=" + value + " from properties"); context.setProperty(desc, value); } } catch (IllegalArgumentException e) { log.log(Level.SEVERE, "Could not configure property", e); } } } }
@Override public void init() { String authorizedKeyPath = getContext().getProperty(AUTHORIZED_KEY_PATH); if (authorizedKeyPath != null) { File f = new File(authorizedKeyPath); if (f.exists() && f.isFile()) { log.log(Level.FINE, "Found authorized key path " + authorizedKeyPath); Set<PublicKey> keys; keys = new LinkedHashSet<PublicKey>(); KeyPairProvider provider = new FilePublicKeyProvider(new String[]{authorizedKeyPath}); for (String type : TYPES) { KeyPair pair = provider.loadKey(type); if (pair != null) { PublicKey key = pair.getPublic(); if (key != null) { keys.add(key); } } } authorizedKeys = keys; } else { log.log(Level.FINE, "Ignoring invalid authorized key path " + authorizedKeyPath); } } }
public boolean authenticate(final String username, final String password) throws Exception { String domain = getContext().getProperty(JAAS_DOMAIN); if (domain != null) { log.log(Level.FINE, "Will use the JAAS domain '" + domain + "' for authenticating user " + username);
String configPath = getContext().getProperty(CRON_CONFIG_PATH); if (configPath != null) { File configFile = new File(configPath);
@OnOpen public void start(Session wsSession) { current.set(wsSession); try { URI uri = wsSession.getRequestURI(); String path = uri.getPath(); log.fine("Establishing session for " + path); String contextPath = path.substring(0, path.lastIndexOf('/')); PluginContext context = WebPluginLifeCycle.getPluginContext(contextPath); if (context != null) { Boolean enabled = context.getProperty(WebPlugin.ENABLED); if (enabled != null && enabled) { log.fine("Using shell " + context); ShellFactory factory = context.getPlugin(ShellFactory.class); Principal user = wsSession.getUserPrincipal(); Shell shell = factory.create(user); CRaSHSession session = new CRaSHSession(wsSession, shell); sessions.put(wsSession.getId(), session); log.fine("Established session " + wsSession.getId()); } else { log.fine("Web plugin disabled"); } } else { log.fine("No shell found"); } } finally { current.set(null); } }
Integer port = getContext().getProperty(SSH_PORT); if (port == null) { log.log(Level.INFO, "Could not boot SSHD due to missing due to missing port configuration"); Integer idleTimeout = getContext().getProperty(SSH_SERVER_IDLE_TIMEOUT); if (idleTimeout == null) { idleTimeout = SSH_SERVER_IDLE_DEFAULT_TIMEOUT; Integer authTimeout = getContext().getProperty(SSH_SERVER_AUTH_TIMEOUT); if (authTimeout == null) { authTimeout = SSH_SERVER_AUTH_DEFAULT_TIMEOUT; String serverKeyPath = getContext().getProperty(SSH_SERVER_KEYPATH); if (serverKeyPath != null) { log.log(Level.FINE, "Found server key path " + serverKeyPath); File f = new File(serverKeyPath); String keyGen = getContext().getProperty(SSH_SERVER_KEYGEN); if (keyGen != null && keyGen.equals("true")) { keyPairProvider = new PEMGeneratorHostKeyProvider(serverKeyPath, "RSA"); List authentication = getContext().getProperty(AuthenticationPlugin.AUTH); if (authentication != null) { for (AuthenticationPlugin authenticationPlugin : getContext().getPlugins(AuthenticationPlugin.class)) { Charset encoding = getContext().getProperty(SSH_ENCODING); if (encoding == null) { encoding = Utils.UTF_8;
Integer port = context.getProperty(TELNET_PORT); if (port == null) { port = TELNET_PORT.defaultValue;
@Override public void init() { PluginContext context = getContext(); this.username = context.getProperty(SIMPLE_USERNAME); this.password = context.getProperty(SIMPLE_PASSWORD); }
@Override public void init() { PluginContext context = getContext(); this.username = context.getProperty(SIMPLE_USERNAME); this.password = context.getProperty(SIMPLE_PASSWORD); }
@Override public void init() { PluginContext context = getContext(); this.username = context.getProperty(SIMPLE_USERNAME); this.password = context.getProperty(SIMPLE_PASSWORD); }
@Override public void init() { smtpHost = getContext().getProperty(SMTP_HOST); smtpPort = getContext().getProperty(SMTP_PORT); smtpSecure = getContext().getProperty(SMTP_SECURE); smtpUsername = getContext().getProperty(SMTP_USERNAME); smtpPassword = getContext().getProperty(SMTP_PASSWORD); smtpFrom = getContext().getProperty(SMTP_FROM); debug = getContext().getProperty(DEBUG); }
@Override public void init() { smtpHost = getContext().getProperty(SMTP_HOST); smtpPort = getContext().getProperty(SMTP_PORT); smtpSecure = getContext().getProperty(SMTP_SECURE); smtpUsername = getContext().getProperty(SMTP_USERNAME); smtpPassword = getContext().getProperty(SMTP_PASSWORD); smtpFrom = getContext().getProperty(SMTP_FROM); debug = getContext().getProperty(DEBUG); }
synchronized void start() { if (!started) { // Start refresh Integer refreshRate = getProperty(PropertyDescriptor.VFS_REFRESH_PERIOD); TimeUnit timeUnit = getProperty(PropertyDescriptor.VFS_REFRESH_UNIT); if (refreshRate != null && refreshRate > 0) { TimeUnit tu = timeUnit != null ? timeUnit : TimeUnit.SECONDS; scannerFuture = scanner.scheduleWithFixedDelay(new Runnable() { public void run() { refresh(); } }, 0, refreshRate, tu); } // Init plugins manager.getPlugins(Object.class); // started = true; } else { log.log(Level.WARNING, "Attempt to double start"); } }
synchronized void start() { if (!started) { // Start refresh Integer refreshRate = getProperty(PropertyDescriptor.VFS_REFRESH_PERIOD); TimeUnit timeUnit = getProperty(PropertyDescriptor.VFS_REFRESH_UNIT); if (refreshRate != null && refreshRate > 0) { TimeUnit tu = timeUnit != null ? timeUnit : TimeUnit.SECONDS; scannerFuture = scanner.scheduleWithFixedDelay(new Runnable() { public void run() { refresh(); } }, 0, refreshRate, tu); } // Init plugins manager.getPlugins(Object.class); // started = true; } else { log.log(Level.WARNING, "Attempt to double start"); } }
private void configureProperty(PluginContext context, Properties props, PropertyDescriptor<?> desc) { String key = "crash." + desc.name; String value = props.getProperty(key); if (value != null) { try { if (context.getProperty(desc) == null) { log.log(Level.INFO, "Configuring property " + desc.name + "=" + value + " from properties"); context.setProperty(desc, value); } } catch (IllegalArgumentException e) { log.log(Level.SEVERE, "Could not configure property", e); } } } }
private void configureProperty(PluginContext context, Properties props, PropertyDescriptor<?> desc) { String key = "crash." + desc.name; String value = props.getProperty(key); if (value != null) { try { if (context.getProperty(desc) == null) { log.log(Level.INFO, "Configuring property " + desc.name + "=" + value + " from properties"); context.setProperty(desc, value); } } catch (IllegalArgumentException e) { log.log(Level.SEVERE, "Could not configure property", e); } } } }
private void configureProperty(PluginContext context, Properties props, PropertyDescriptor<?> desc) { String key = "crash." + desc.name; String value = props.getProperty(key); if (value != null) { try { if (context.getProperty(desc) == null) { log.log(Level.INFO, "Configuring property " + desc.name + "=" + value + " from properties"); context.setProperty(desc, value); } } catch (IllegalArgumentException e) { log.log(Level.SEVERE, "Could not configure property", e); } } } }