class PermalinkUrlProviderImpl implements PermalinkUrlProvider {

    @Override
    public String getPermalinkUrl(String host)
    {
        String permalinkUrl = null;

        String serverName = null;

        for (ServerConnectionParams params : myServerListManager.getActiveServers())
        {
            ServerConfiguration configuration = params.getServerConfiguration();
            if (configuration != null && host.equals(configuration.getHost()))
            {
                serverName = params.getServerTitle();
                break;
            }
        }

        if (StringUtils.isNotEmpty(serverName))
        {
            for (ServerSourceController controller : myControllerManager.getControllers())
            {
                for (IDataSource server : controller.getSourceList())
                {
                    if (server instanceof OGCServerSource)
                    {
                        OGCServerSource ogcServer = (OGCServerSource)server;
                        if (StringUtils.equals(serverName, ogcServer.getName()))
                        {
                            permalinkUrl = ogcServer.getPermalinkUrl();
                            break;
                        }
                    }
                }

                if (StringUtils.isNotEmpty(permalinkUrl))
                {
                    break;
                }
            }
        }

        return permalinkUrl;
    }

    public  PermalinkUrlProviderImpl(ServerSourceControllerManager controllerManager, ServerListManager serverListManager);

}