Java Code Examples for org.jivesoftware.util.JiveGlobals#deleteProperty()

The following examples show how to use org.jivesoftware.util.JiveGlobals#deleteProperty() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocalClientSession.java    From Openfire with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example 2
Source File: LocalClientSession.java    From Openfire with Apache License 2.0 6 votes vote down vote up
/**
 * 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());
    }
}
 
Example 3
Source File: HttpBindManager.java    From Openfire with Apache License 2.0 5 votes vote down vote up
/**
 * 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));
    }
}
 
Example 4
Source File: SystemPropertiesServlet.java    From Openfire with Apache License 2.0 5 votes vote down vote up
private void deleteProperty(final HttpServletRequest request, final WebManager webManager) {
    final String key = request.getParameter("key");
    JiveGlobals.deleteProperty(key);
    webManager.logEvent("deleted server property " + key, null);
    request.getSession().setAttribute("successMessage",
        String.format("The property %s was deleted", StringEscapeUtils.escapeXml11(key)));
}
 
Example 5
Source File: HttpBindManager.java    From Openfire with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example 6
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 5 votes vote down vote up
public void setInviteOptions( List<String> options )
{
    if (options == null || options.isEmpty() )
    {
        JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.inviteOptions" );
    }
    else
    {
        JiveGlobals.setProperty( "org.jitsi.videobridge.ofmeet.inviteOptions", options);
    }
}
 
Example 7
Source File: HttpBindManager.java    From Openfire with Apache License 2.0 5 votes vote down vote up
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);
    }
}
 
Example 8
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetStunMappingHarversterAddresses()
{
    JiveGlobals.deleteProperty( "org.ice4j.ice.harvest.STUN_MAPPING_HARVESTER_ADDRESSES" );
}
 
Example 9
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetFilmstripMaxHeight()
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.film.strip.max.height" );
}
 
Example 10
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetFocusPassword()
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.focus.user.password" );
}
 
Example 11
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetLipSync()
{
    JiveGlobals.deleteProperty( "ofmeet.lipSync.enabled" );
}
 
Example 12
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetVideoConstraintsMinHeight()
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.constraints.video.height.min" );
}
 
Example 13
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetVideoConstraintsMaxHeight( int maxHeight )
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.constraints.video.height.max" );
}
 
Example 14
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetVideoConstraintsIdealHeight()
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.constraints.video.height.ideal" );
}
 
Example 15
Source File: LdapManager.java    From Openfire with Apache License 2.0 4 votes vote down vote up
@Override
public String remove(Object key) {
    JiveGlobals.deleteProperty((String)key);
    // Always return null since XMLProperties doesn't support the normal semantics.
    return null;
}
 
Example 16
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetStartAudioOnly()
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.startaudioonly" );
}
 
Example 17
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetP2pUseStunTurn()
{
    JiveGlobals.deleteProperty( "ofmeet.p2p.useStunTurn" );
}
 
Example 18
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetP2pDisableH264()
{
    JiveGlobals.deleteProperty( "ofmeet.p2p.disableH264" );
}
 
Example 19
Source File: ConfigProperty.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void reset()
{
    JiveGlobals.deleteProperty( propertyName );
}
 
Example 20
Source File: OFMeetConfig.java    From openfire-ofmeet-plugin with Apache License 2.0 4 votes vote down vote up
public void resetInviteOptions()
{
    JiveGlobals.deleteProperty( "org.jitsi.videobridge.ofmeet.inviteOptions" );
}