class OSMServerSourceController extends UrlServerSourceController {

    @Override
    protected boolean handleActivateSource(IDataSource source)
    {
        boolean pingSuccess = false;

        try (TaskActivity activity = TaskActivity.createActive(source.getName() + " is loading..."))
        {
            getToolbox().getUIRegistry().getMenuBarRegistry().addTaskActivity(activity);

            DataModelCategory category = XYZTileUtils.newLayersCategory(((UrlDataSource)source).getURL(), OSMUtil.PROVIDER);
            XYZServerInfo serverInfo = new XYZServerInfo(source.getName(), ((UrlDataSource)source).getURL());
            XYZTileLayerInfo layerInfo = null;
            if (serverInfo.getServerUrl().contains("osm_tiles_pc"))
            {
                layerInfo = new XYZTileLayerInfo(OSMUtil.PROVIDER, source.getName(), Projection.EPSG_4326, 2, false, 2,
                        serverInfo);
            }
            else
            {
                layerInfo = new XYZTileLayerInfo(OSMUtil.PROVIDER, source.getName(), Projection.EPSG_3857, 1, false, 5,
                        serverInfo);
            }

            /* Ping server to verify connection */
            pingSuccess = new OSMTileEnvoy(getToolbox()).ping(category);
            if (pingSuccess)
            {
                getToolbox().getDataRegistry().addModels(
                        new SimpleSessionOnlyCacheDeposit<>(category, XYZTileUtils.LAYERS_DESCRIPTOR, New.list(layerInfo)));
            }
        }
        return pingSuccess;
    }

}