@Override public String remove(Object key) { JiveGlobals.deleteProperty((String)key); // Always return null since XMLProperties doesn't support the normal semantics. return null; }
public void setXFFServerHeader(String header) { if (header == null || header.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_SERVER); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_SERVER, header); } }
public void setXFFHeader(String header) { if (header == null || header.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_FOR); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_FOR, header); } }
public void setXFFHostHeader(String header) { if (header == null || header.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_HOST); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_HOST, header); } }
public void setXFFHostName(String name) { if (name == null || name.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_HOST_NAME); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_HOST_NAME, name); } }
/** * Sets the password that will be used when connecting to the SMTP * server. The default is <tt>null</tt>, or no password. * * @param password the SMTP password. */ public void setPassword(String password) { this.password = password; if (password == null) { JiveGlobals.deleteProperty("mail.smtp.password"); } else { JiveGlobals.setProperty("mail.smtp.password", password); } session = null; }
/** * Sets the username that will be used when connecting to the SMTP * server. The default is <tt>null</tt>, or no username. * * @param username the SMTP username. */ public void setUsername(String username) { this.username = username; if (username == null) { JiveGlobals.deleteProperty("mail.smtp.username"); } else { JiveGlobals.setProperty("mail.smtp.username", username); } session = null; }
/** * Sets the host of the proxy to use to connect to igniterealtime.org or <tt>null</tt> * if no proxy is used. * * @param host the host of the proxy or null if no proxy is used. */ public void setProxyHost(String host) { if (host == null) { // Remove the property JiveGlobals.deleteProperty("update.proxy.host"); } else { // Create or update the property JiveGlobals.setProperty("update.proxy.host", host); } }
/** * Enables or disables script syntax. * * @param isEnabled true to enable script syntax and false to disable it. * @see #isScriptSyntaxEnabled() * @see <a href="http://www.xmpp.org/extensions/xep-0124.html#script">BOSH: Alternative Script * Syntax</a> */ public void setScriptSyntaxEnabled(boolean isEnabled) { final String property = "xmpp.httpbind.scriptSyntax.enabled"; if(!isEnabled) { JiveGlobals.deleteProperty(property); } else { JiveGlobals.setProperty(property, String.valueOf(isEnabled)); } }
/** * Set the ports on which the HTTP binding service will be running. * * @param unsecurePort the unsecured connection port which clients can connect to. * @param securePort the secured connection port which clients can connect to. * @throws Exception when there is an error configuring the HTTP binding ports. */ public void setHttpBindPorts(int unsecurePort, int securePort) throws Exception { if (unsecurePort != HTTP_BIND_PORT_DEFAULT) { JiveGlobals.setProperty(HTTP_BIND_PORT, String.valueOf(unsecurePort)); } else { JiveGlobals.deleteProperty(HTTP_BIND_PORT); } if (securePort != HTTP_BIND_SECURE_PORT_DEFAULT) { JiveGlobals.setProperty(HTTP_BIND_SECURE_PORT, String.valueOf(securePort)); } else { JiveGlobals.deleteProperty(HTTP_BIND_SECURE_PORT); } }
/** * Sets the list of IP address that are not allowed to connect to the server. This list is used for both anonymous * and non-anonymous users, and always takes precedence over a whitelist. * * @param blocked the list of IP address that are not allowed to connect to the server. Can be empty, but not null. */ public static void setBlacklistedIPs(Set<String> blocked) { if (blocked == null) { throw new NullPointerException(); } blockedIPs = blocked; if (blockedIPs.isEmpty()) { JiveGlobals.deleteProperty(ConnectionSettings.Client.LOGIN_BLOCKED); } else { // Iterate through the elements in the map. StringBuilder buf = new StringBuilder(); Iterator<String> iter = blocked.iterator(); if (iter.hasNext()) { buf.append(iter.next()); } while (iter.hasNext()) { buf.append(", ").append(iter.next()); } JiveGlobals.setProperty(ConnectionSettings.Client.LOGIN_BLOCKED, buf.toString()); } }
/** * Sets the list of IP address that are allowed to connect to the server for anonymous users. If the list is empty * then anonymous will be only restricted by {@link #getBlacklistedIPs()} and {@link #getWhitelistedIPs()}. * * @param allowed the list of IP address that are allowed to connect to the server. Can be empty, but not null. */ public static void setWhitelistedAnonymousIPs(Set<String> allowed) { if (allowed == null) { throw new NullPointerException(); } allowedAnonymIPs = allowed; if (allowedAnonymIPs.isEmpty()) { JiveGlobals.deleteProperty(ConnectionSettings.Client.LOGIN_ANONYM_ALLOWED); } else { // Iterate through the elements in the map. StringBuilder buf = new StringBuilder(); Iterator<String> iter = allowedAnonymIPs.iterator(); if (iter.hasNext()) { buf.append(iter.next()); } while (iter.hasNext()) { buf.append(", ").append(iter.next()); } JiveGlobals.setProperty(ConnectionSettings.Client.LOGIN_ANONYM_ALLOWED, buf.toString()); } }
/** * Sets the list of IP address that are allowed to connect to the server. If the list is empty then anyone not on * {@link #getBlacklistedIPs()} is allowed to connect to the server except for anonymous users that are subject to * {@link #getWhitelistedAnonymousIPs()}. This list is used for both anonymous and non-anonymous users. * * Note that blacklisting takes precedence over whitelisting: if an address is matched by both, access is denied. * * @param allowed the list of IP address that are allowed to connect to the server. Can be empty, but not null. */ public static void setWhitelistedIPs(Set<String> allowed) { if (allowed == null) { throw new NullPointerException(); } allowedIPs = allowed; if (allowedIPs.isEmpty()) { JiveGlobals.deleteProperty(ConnectionSettings.Client.LOGIN_ALLOWED); } else { // Iterate through the elements in the map. StringBuilder buf = new StringBuilder(); Iterator<String> iter = allowedIPs.iterator(); if (iter.hasNext()) { buf.append(iter.next()); } while (iter.hasNext()) { buf.append(", ").append(iter.next()); } JiveGlobals.setProperty(ConnectionSettings.Client.LOGIN_ALLOWED, buf.toString()); } }
@Override public void propertySet(String property, Map<String, Object> params) { if (property.equalsIgnoreCase(HTTP_BIND_ENABLED)) { doEnableHttpBind(Boolean.valueOf(params.get("value").toString())); } else if (property.equalsIgnoreCase(HTTP_BIND_PORT)) { try { Integer.valueOf(params.get("value").toString()); } catch (NumberFormatException ne) { JiveGlobals.deleteProperty(HTTP_BIND_PORT); return; } restartServer(); } else if (property.equalsIgnoreCase(HTTP_BIND_SECURE_PORT)) { try { Integer.valueOf(params.get("value").toString()); } catch (NumberFormatException ne) { JiveGlobals.deleteProperty(HTTP_BIND_SECURE_PORT); return; } restartServer(); } else if (HTTP_BIND_AUTH_PER_CLIENTCERT_POLICY.equalsIgnoreCase( property )) { restartServer(); } }
this.runAutoSetup(); JiveGlobals.deleteXMLProperty("autosetup"); JiveGlobals.deleteProperty("autosetup"); JiveGlobals.deleteProperty("xmpp.fqdn");
@Override public String remove(Object key) { JiveGlobals.deleteProperty((String)key); // Always return null since XMLProperties doesn't support the normal semantics. return null; }
public void setXFFHeader(String header) { if (header == null || header.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_FOR); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_FOR, header); } }
public void setXFFServerHeader(String header) { if (header == null || header.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_SERVER); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_SERVER, header); } }
public void setXFFHostHeader(String header) { if (header == null || header.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_HOST); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_HOST, header); } }
public void setXFFHostName(String name) { if (name == null || name.trim().length() == 0) { JiveGlobals.deleteProperty(HTTP_BIND_FORWARDED_HOST_NAME); } else { JiveGlobals.setProperty(HTTP_BIND_FORWARDED_HOST_NAME, name); } }