当前位置: 首页>>代码示例>>Java>>正文


Java ModificationNotAllowedException类代码示例

本文整理汇总了Java中org.jivesoftware.util.ModificationNotAllowedException的典型用法代码示例。如果您正苦于以下问题:Java ModificationNotAllowedException类的具体用法?Java ModificationNotAllowedException怎么用?Java ModificationNotAllowedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ModificationNotAllowedException类属于org.jivesoftware.util包,在下文中一共展示了ModificationNotAllowedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: blockAccess

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * Blocks an external component from connecting to the local server. If the component was
 * connected when the permission was revoked then the connection of the entity will be closed.
 *
 * @param subdomain the subdomain of the external component that is not allowed to connect.
 * @throws ModificationNotAllowedException if the operation was denied.
 */
public static void blockAccess(String subdomain) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.componentBlocked(subdomain);
    }
    // Remove any previous configuration for this external component
    deleteConfigurationFromDB(getConfiguration(subdomain, false));
    // Update the database with the new revoked permission
    ExternalComponentConfiguration config = new ExternalComponentConfiguration(subdomain, false, Permission.blocked, null);
    addConfiguration(config);
    // Check if the component was connected and proceed to close the connection
    String domain = subdomain + "." + XMPPServer.getInstance().getServerInfo().getXMPPDomain();
    Session session = SessionManager.getInstance().getComponentSession(domain);
    if (session != null) {
        session.close();
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:25,代码来源:ExternalComponentManager.java

示例2: updateComponentSecret

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public static void updateComponentSecret(String subdomain, String secret) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.componentSecretUpdated(subdomain, secret);
    }
    ExternalComponentConfiguration configuration = getConfiguration(subdomain, false);
    if (configuration != null) {
        configuration.setPermission(Permission.allowed);
        configuration.setSecret(secret);
        // Remove any previous configuration for this external component
        deleteConfigurationFromDB(configuration);
    }
    else {
        configuration = new ExternalComponentConfiguration(subdomain, false, Permission.allowed, secret);
    }
    addConfiguration(configuration);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:18,代码来源:ExternalComponentManager.java

示例3: setPermissionPolicy

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * Sets the permission policy being used for new XMPP entities that are trying to
 * connect to the server. There are two types of policies: 1) blacklist: where any entity
 * is allowed to connect to the server except for those listed in the black list and
 * 2) whitelist: where only the entities listed in the white list are allowed to connect to
 * the server.
 *
 * @param policy the new PermissionPolicy to use.
 * @throws ModificationNotAllowedException if the operation was denied.
 */
public static void setPermissionPolicy(PermissionPolicy policy) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.permissionPolicyChanged(policy);
    }
    JiveGlobals.setProperty("xmpp.component.permission", policy.toString());
    // Check if connected components can remain connected to the server
    for (ComponentSession session : SessionManager.getInstance().getComponentSessions()) {
        for (String domain : session.getExternalComponent().getSubdomains()) {
            if (!canAccess(domain)) {
                session.close();
                break;
            }
        }
    }
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:27,代码来源:ExternalComponentManager.java

示例4: setSharedSecret

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * Sets the shared secret for the Clearspace service we're connecting to.
 *
 * @param sharedSecret the password configured in Clearspace to authenticate Openfire.
 */
public void setSharedSecret(String sharedSecret) {
    // Set new password for external component
    ExternalComponentConfiguration configuration = new ExternalComponentConfiguration("clearspace", true,
            ExternalComponentConfiguration.Permission.allowed, sharedSecret);
    try {
        ExternalComponentManager.allowAccess(configuration);
    }
    catch (ModificationNotAllowedException e) {
        Log.warn("Failed to configure password for Clearspace", e);
    }

    // After updating the component information we can update the field, but not before.
    // If it is done before, OF won't be able to execute the updateSharedsecret webservice
    // since it would try with the new password.
    this.sharedSecret = sharedSecret;
    properties.put("clearspace.sharedSecret", sharedSecret);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:23,代码来源:ClearspaceManager.java

示例5: setServiceEnabled

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
 */
@Deprecated
public static void setServiceEnabled(boolean enabled) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.serviceEnabled(enabled);
    }
    ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
    connectionManager.enableComponentListener(enabled);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:13,代码来源:ExternalComponentManager.java

示例6: setServicePort

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
 */
@Deprecated
public static void setServicePort(int port) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.portChanged(port);
    }
    ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
    connectionManager.setComponentListenerPort(port);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:13,代码来源:ExternalComponentManager.java

示例7: allowAccess

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * Allows an external component to connect to the local server with the specified configuration.
 *
 * @param configuration the configuration for the external component.
 * @throws ModificationNotAllowedException if the operation was denied.
 */
public static void allowAccess(ExternalComponentConfiguration configuration) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.componentAllowed(configuration.getSubdomain(), configuration);
    }
    // Remove any previous configuration for this external component
    deleteConfigurationFromDB(configuration);
    // Update the database with the new granted permission and configuration
    configuration.setPermission(Permission.allowed);
    addConfiguration(configuration);
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:18,代码来源:ExternalComponentManager.java

示例8: deleteConfiguration

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
/**
 * Removes any existing defined permission and configuration for the specified
 * external component.
 *
 * @param subdomain the subdomain of the external component.
 * @throws ModificationNotAllowedException if the operation was denied.
 */
public static void deleteConfiguration(String subdomain) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.componentConfigurationDeleted(subdomain);
    }

    // Proceed to delete the configuration of the component
    deleteConfigurationFromDB(getConfiguration(subdomain, false));
}
 
开发者ID:igniterealtime,项目名称:Openfire,代码行数:17,代码来源:ExternalComponentManager.java

示例9: setServiceEnabled

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public static void setServiceEnabled(boolean enabled) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.serviceEnabled(enabled);
    }
    ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
    connectionManager.enableComponentListener(enabled);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:9,代码来源:ExternalComponentManager.java

示例10: setServicePort

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public static void setServicePort(int port) throws ModificationNotAllowedException {
    // Alert listeners about this event
    for (ExternalComponentManagerListener listener : listeners) {
        listener.portChanged(port);
    }
    ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
    connectionManager.setComponentListenerPort(port);
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:9,代码来源:ExternalComponentManager.java

示例11: serviceEnabled

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public void serviceEnabled(boolean enabled) throws ModificationNotAllowedException {
    // Do not let admins shutdown the external component service
    if (!enabled) {
        throw new ModificationNotAllowedException("Service cannot be disabled when integrated with Clearspace.");
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:7,代码来源:ClearspaceManager.java

示例12: portChanged

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public void portChanged(int newPort) throws ModificationNotAllowedException {
    startClearspaceConfig();
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:4,代码来源:ClearspaceManager.java

示例13: defaultSecretChanged

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public void defaultSecretChanged(String newSecret) throws ModificationNotAllowedException {
    // Do nothing
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:4,代码来源:ClearspaceManager.java

示例14: permissionPolicyChanged

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public void permissionPolicyChanged(ExternalComponentManager.PermissionPolicy newPolicy)
        throws ModificationNotAllowedException {
    // Do nothing
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:5,代码来源:ClearspaceManager.java

示例15: componentAllowed

import org.jivesoftware.util.ModificationNotAllowedException; //导入依赖的package包/类
public void componentAllowed(String subdomain, ExternalComponentConfiguration configuration)
        throws ModificationNotAllowedException {
    if (subdomain.startsWith("clearspace")) {
        updateClearspaceSharedSecret(configuration.getSecret());
    }
}
 
开发者ID:coodeer,项目名称:g3server,代码行数:7,代码来源:ClearspaceManager.java


注:本文中的org.jivesoftware.util.ModificationNotAllowedException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。