Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.component
Class ExternalComponentManager

    java.lang.Object
      org.jivesoftware.openfire.component.ExternalComponentManager

    public class ExternalComponentManager

extends Object

Manages the connection permissions for external components. When an external component is allowed to connect to this server then a special configuration for the component will be kept. The configuration holds information such as the shared secret that the component should use when authenticating with the server.

Author:
  Gaston Dombiak

Nested Class Summary
`static class` | `ExternalComponentManager.PermissionPolicy`

Constructor Summary
`ExternalComponentManager()`

Method Summary
`static void` | `addListener(ExternalComponentManagerListener listener)` Registers a listener to receive events when a configuration change happens.
`static void` | `allowAccess(ExternalComponentConfiguration configuration)` Allows an external component to connect to the local server with the specified configuration.
`static void` | `blockAccess(String subdomain)` Blocks an external component from connecting to the local server.
`static boolean` | `canAccess(String subdomain)` Returns true if the external component with the specified subdomain can connect to the local server.
`static void` | `deleteConfiguration(String subdomain)` Removes any existing defined permission and configuration for the specified external component.
`static Collection<ExternalComponentConfiguration>` | `getAllowedComponents()` Returns the list of registered external components that are allowed to connect to this server when using a whitelist policy.
`static Collection<ExternalComponentConfiguration>` | `getBlockedComponents()` Returns the list of external components that are NOT allowed to connect to this server.
`static String` | `getDefaultSecret()` Returns the default secret key to use for those external components that don't have an individual configuration.
`static ExternalComponentManager.PermissionPolicy` | `getPermissionPolicy()` Returns the permission policy being used for new XMPP entities that are trying to connect to the server.
`static String` | `getSecretForComponent(String subdomain)` Returns the shared secret with the specified external component.
`static int` | `getServicePort()`
`static boolean` | `hasConfiguration(String subdomain)` Returns true if there is a configuration for the specified subdomain.
`static boolean` | `isServiceEnabled()`
`static void` | `removeListener(ExternalComponentManagerListener listener)` Unregisters a listener to receive events.
`static void` | `setDefaultSecret(String defaultSecret)` Sets the default secret key to use for those external components that don't have an individual configuration.
`static void` | `setPermissionPolicy(ExternalComponentManager.PermissionPolicy policy)` Sets the permission policy being used for new XMPP entities that are trying to connect to the server.
`static void` | `setPermissionPolicy(String policy)` Sets the permission policy being used for new XMPP entities that are trying to connect to the server.
`static void` | `setServiceEnabled(boolean enabled)`
`static void` | `setServicePort(int port)`
`static void` | `updateComponentSecret(String subdomain, String secret)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ExternalComponentManager

    public ExternalComponentManager()

Method Detail

### setServiceEnabled

    public static void setServiceEnabled(boolean enabled)
                                  throws ModificationNotAllowedException

  Throws:
    `ModificationNotAllowedException`

### isServiceEnabled

    public static boolean isServiceEnabled()

### setServicePort

    public static void setServicePort(int port)
                               throws ModificationNotAllowedException

  Throws:
    `ModificationNotAllowedException`

### getServicePort

    public static int getServicePort()

### allowAccess

    public static void allowAccess(ExternalComponentConfiguration configuration)
                            throws ModificationNotAllowedException

  Allows an external component to connect to the local server with the specified configuration.

  Parameters:
    `configuration` - the configuration for the external component.
  Throws:
    `ModificationNotAllowedException` - if the operation was denied.

### blockAccess

    public static void blockAccess(String subdomain)
                            throws ModificationNotAllowedException

  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.

  Parameters:
    `subdomain` - the subdomain of the external component that is not allowed to connect.
  Throws:
    `ModificationNotAllowedException` - if the operation was denied.

### canAccess

    public static boolean canAccess(String subdomain)

  Returns true if the external component with the specified subdomain can connect to the local server.

  Parameters:
    `subdomain` - the subdomain of the external component.
  Returns:
    true if the external component with the specified subdomain can connect to the local server.

### hasConfiguration

    public static boolean hasConfiguration(String subdomain)

  Returns true if there is a configuration for the specified subdomain. This checking can be used as an indirect way of checking that the specified subdomain belongs to an external component.

  Parameters:
    `subdomain` - the subdomain of the external component.
  Returns:
    true if there is a configuration for the specified subdomain.

### getAllowedComponents

    public static Collection<ExternalComponentConfiguration> getAllowedComponents()

  Returns the list of registered external components that are allowed to connect to this server when using a whitelist policy. However, when using a blacklist policy (i.e. anyone may connect to the server) the returned list of configurations will be used for obtaining the shared secret specific for each component.

  Returns:
    the configuration of the registered external components.

### getBlockedComponents

    public static Collection<ExternalComponentConfiguration> getBlockedComponents()

  Returns the list of external components that are NOT allowed to connect to this server.

  Returns:
    the configuration of the blocked external components.

### updateComponentSecret

    public static void updateComponentSecret(String subdomain,
                                             String secret)
                                      throws ModificationNotAllowedException

  Throws:
    `ModificationNotAllowedException`

### deleteConfiguration

    public static void deleteConfiguration(String subdomain)
                                    throws ModificationNotAllowedException

  Removes any existing defined permission and configuration for the specified external component.

  Parameters:
    `subdomain` - the subdomain of the external component.
  Throws:
    `ModificationNotAllowedException` - if the operation was denied.

### getDefaultSecret

    public static String getDefaultSecret()

  Returns the default secret key to use for those external components that don't have an individual configuration.

  Returns:
    the default secret key to use for those external components that don't have an individual configuration.

### setDefaultSecret

    public static void setDefaultSecret(String defaultSecret)
                                 throws ModificationNotAllowedException

  Sets the default secret key to use for those external components that don't have an individual configuration.

  Parameters:
    `defaultSecret` - the default secret key to use for those external components that don't have an individual configuration.
  Throws:
    `ModificationNotAllowedException` - if the operation was denied.

### getSecretForComponent

    public static String getSecretForComponent(String subdomain)

  Returns the shared secret with the specified external component. If no shared secret was defined then use the default shared secret.

  Parameters:
    `subdomain` - the subdomain of the external component to get his shared secret. (e.g. conference)
  Returns:
    the shared secret with the specified external component or the default shared secret.

### getPermissionPolicy

    public static ExternalComponentManager.PermissionPolicy getPermissionPolicy()

  Returns 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.

  Returns:
    the permission policy being used for new XMPP entities that are trying to connect to the server.

### setPermissionPolicy

    public static void setPermissionPolicy(ExternalComponentManager.PermissionPolicy policy)
                                    throws ModificationNotAllowedException

  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.

  Parameters:
    `policy` - the new PermissionPolicy to use.
  Throws:
    `ModificationNotAllowedException` - if the operation was denied.

### setPermissionPolicy

    public static void setPermissionPolicy(String policy)
                                    throws ModificationNotAllowedException

  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.

  Parameters:
    `policy` - the new policy to use.
  Throws:
    `ModificationNotAllowedException` - if the operation was denied.

### addListener

    public static void addListener(ExternalComponentManagerListener listener)

  Registers a listener to receive events when a configuration change happens. Listeners have the chance to deny the operation from happening.

  Parameters:
    `listener` - the listener.

### removeListener

    public static void removeListener(ExternalComponentManagerListener listener)

  Unregisters a listener to receive events.

  Parameters:
    `listener` - the listener.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.