Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.IServiceFactory


  IService service;
 
  @Before
  public void setUp() throws Exception {
    //get a georesource
    IServiceFactory sFactory
      = CatalogPlugin.getDefault().getServiceFactory();
   
    HashMap<String, Serializable> map = new HashMap<String, Serializable>();
    map.put("dummy", DummyService.url); //$NON-NLS-1$
   
    List<IService> services = sFactory.createService(map);
    service = services.get(0);
//        catalog.add(service);
  }
View Full Code Here


     */
    @Deprecated
    public static Collection<IService> constructServices( IProgressMonitor monitor, Map<String, Serializable> params, Collection<URL> urls ) {
        // use the parameters/url to acquire a set of services
        //
        IServiceFactory sFactory = CatalogPlugin.getDefault().getServiceFactory();
       
        monitor.setTaskName(Messages.ConnectionState_task);

        Collection<IService> services = new HashSet<IService>();
        if (urls != null && !urls.isEmpty()) {       
            for( URL url : urls ) {
                Collection<IService> searchResult = searchLocalCatalog(url, monitor);
                if (searchResult.isEmpty()) {
                    List<IService> created = sFactory.createService(url);
                    services.addAll(created);
                } else {
                    services.addAll(searchResult);
                }
            }
        }
       
        if( params!=null && !params.isEmpty()){
            Set<IService> results = new HashSet<IService>(sFactory.createService(params));           
            for( IService service : results ) {
                Collection<IService> searchResult = searchLocalCatalog(service.getIdentifier(), monitor);
                if (searchResult.isEmpty() ) {
                    services.add(service);
                } else {
View Full Code Here

     */
    public static synchronized void addServiceToCatalog( String serviceFile, IProgressMonitor progressMonitor ) {
        try {
            URL fileUrl = new File(serviceFile).toURI().toURL();
            // add the service to the catalog and map
            IServiceFactory sFactory = CatalogPlugin.getDefault().getServiceFactory();
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            List<IService> services = sFactory.createService(fileUrl);
            for( IService service : services ) {
                catalog.add(service);
            }
        } catch (Exception e) {
            JGrassPlugin.log(
View Full Code Here

             */
            if (originalJGrassService == null)
                return;
            final URL ID = originalJGrassService.getIdentifier();
            Map<String, Serializable> connectionParams = originalJGrassService.getConnectionParams();
            IServiceFactory locator = CatalogPlugin.getDefault().getServiceFactory();
            final List<IService> rereadService = locator.acquire(ID, connectionParams);

            /*
             * replace the service
             */
            if (rereadService.size() > 0) {
View Full Code Here

    }

  @Ignore("Connection refused ..")
    @Test
    public void testMemoryDataStoreType() throws Exception {
        IServiceFactory serviceFactory = CatalogPlugin.getDefault().getServiceFactory();
        URL dragNdrop = new URL("http://localhost/scratch/TestNewFeatureTypeOp");
        List<IService> services = serviceFactory.createService(dragNdrop); //$NON-NLS-1$
       
        NewFeatureTypeOp op=new NewFeatureTypeOp();
        op.testingSetTesting(true);
        op.op(Display.getCurrent(), services.get(0), new NullProgressMonitor());
       
View Full Code Here

TOP

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

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.