public synchronized Optional<Plugin> getPluginByName(final String pluginName) {
        return pluginMetadata.values().stream()
            // Find the matching metadata
            .filter(pluginMetadata -> pluginName.equalsIgnoreCase(pluginMetadata.getName()))
            .findAny()
            // Find the canonical name for this plugin
            .map(PluginMetadata::getCanonicalName)
            // Finally, find the plugin
            .flatMap(canonicalName -> Optional.ofNullable(pluginsLoaded.get(canonicalName)));
    }
Returns a loaded plugin by the name contained in the plugin.xml &lt;name/&gt; tag, ignoring case.
For example: "broadcast".

@param pluginName the name of the plugin.
@return the plugin, if found
@since Openfire 4.4
xmppserver/src/main/java/org/jivesoftware/openfire/container/PluginManager.java