Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.MySQLServiceImpl


  }

  @Override
    public Map<String, Serializable> createConnectionParameters(Object context) {
    if( context instanceof MySQLServiceImpl ){
            MySQLServiceImpl mysql = (MySQLServiceImpl) context;
            return mysql.getConnectionParams();
        }
        URL url = toCapabilitiesURL( context );
        if( url == null ){
            // so we are not sure it is a mysql url
            // lets guess
            url = CatalogPlugin.locateURL(context);
        }
        if( url != null && MySQLServiceExtension.isMySQL(url)) { 
            // well we have a url - lets try it!           
            List<IResolve> list = CatalogPlugin.getDefault().getLocalCatalog().find( url, null );
            for( IResolve resolve : list ){
                if( resolve instanceof MySQLServiceImpl) {
                    // got a hit!
                    MySQLServiceImpl mysqlService = (MySQLServiceImpl) context;
                    return mysqlService.getConnectionParams();
                }
                else if (resolve instanceof MySQLGeoResource ){
                    MySQLGeoResource layer = (MySQLGeoResource) resolve;
                    MySQLServiceImpl mysql;
                    try {
                        mysql = (MySQLServiceImpl) layer.parent( null );
                        return mysql.getConnectionParams();
                    } catch (IOException e) {
                        toCapabilitiesURL( layer.getIdentifier() );
                    }                   
                }
            }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.catalog.MySQLServiceImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.