Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.ServiceExtension2


           
            try{
                ServiceExtension extension = (ServiceExtension) element.createExecutableExtension("class"); //$NON-NLS-1$
                if( extension instanceof ServiceExtension2 ){
                    ServiceExtension2 e2=(ServiceExtension2) extension;
                    if( params!=null ){
                        data.add(new Data( id, name, e2.reasonForFailure(params)) );
                    }else{
                        for( URL url : urls ) {
                            data.add(new Data( id, name, e2.reasonForFailure(url), url) );
                        }
                    }
                }
                if( data.isEmpty())
                    data.add(new Data(id, name, "Implementation does not provide any debug information"));
View Full Code Here


     * false.
     */
    @SuppressWarnings("unchecked")
    @Override
    public final boolean canProcess( Object context ) {
        ServiceExtension2 serviceExtension = getServiceExtension();
        if( context instanceof ID){
            ID id=(ID) context;
            return canProcess(serviceExtension, id);
        }
        if( context instanceof URL){
View Full Code Here

     * able to consume it).  Otherwise {@link #doCreateConnectionParameters(Object)} will be called.
     */
    @SuppressWarnings("unchecked")
    @Override
    public final Map<String, Serializable> createConnectionParameters( Object context ) {
        ServiceExtension2 serviceExtension = getServiceExtension();
        if( context instanceof URL){
            URL url=(URL) context;
            if( canProcess(serviceExtension, url) )
                return serviceExtension.createParams(url);
        }
        if( context instanceof String){
           
            // if the string cannot be processed we want to fall through so
            // that doOtherChecks() can be called.
            String string=(String) context;
            try{
                URL url=new URL(string);
                if ( canProcess(serviceExtension, url) )
                    return serviceExtension.createParams(url);;
            }catch (MalformedURLException e) {
                // continue.
            }
        }
       
        if (context instanceof Map) {
            Map params = (Map) context;
            if( canProcess(serviceExtension, params) )
                return params;
           
        }
        URL locateURL = CatalogPlugin.locateURL(context);
        if( locateURL!=null ){
            if( canProcess(serviceExtension, locateURL))
                return serviceExtension.createParams(locateURL);
        }
        return doCreateConnectionParameters(context);
    }
View Full Code Here

     * claims to be able to process them).  If the context anything else then
     * {@link #doCreateConnectionURL(Object)} will be called.
     */
    @Override
    public final URL createConnectionURL( Object context ) {
        ServiceExtension2 serviceExtension = getServiceExtension();
        if( context instanceof URL){
            URL url=(URL) context;
            if( canProcess(serviceExtension, url) )
                return url;
        }
View Full Code Here

TOP

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

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.