Package org.locationtech.udig.catalog

Examples of org.locationtech.udig.catalog.ICatalog.find()


        try {

            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();

            // first search the local catalog.
            List<IResolve> matches = catalog.find(url, new SubProgressMonitor(progressMonitor, 2));

            for (IResolve resolve : matches) {
                if (resolve instanceof ExpectedService) {
                    // found the resource now we have to search it for the
                    // resource we want
View Full Code Here


        final Layer theLayer = layer;

        ICatalog localCatalog = local;
        ID layerResourceID = layer.getResourceID();
        IProgressMonitor monitor = ProgressManager.instance().get();
        List<IResolve> resolves = localCatalog.find(layerResourceID, monitor);
        if (resolves.isEmpty()) {
            // Identifier lookup is being inconsistent; this often happens when code trips up over
            // converting URLs to and from Files
            throw new IOException("Could not find " + layerResourceID + " in local catalog");
        }
View Full Code Here

                IProgressMonitor monitor = new NullProgressMonitor();

                IRunnableWithProgress object = new IRunnableWithProgress() {
                    public void run(IProgressMonitor monitor) throws InvocationTargetException {
                        try {
                            List<IResolve> resources = connections.find(id.toURL(), monitor);
                            for (IResolve resolve : resources) {
                                if (resolve.getStatus() == Status.BROKEN
                                        || resolve.getStatus() == Status.BROKEN)
                                    continue;
                                if (resolve instanceof IGeoResource) {
View Full Code Here

  }

  private IGeoResource obtainResource(
      Pair<URL, Map<String, Serializable>> params) throws IOException {
    ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
    List<IGeoResource> resource = localCatalog.find(IGeoResource.class, params.getLeft(), new NullProgressMonitor());
   
    if( resource.isEmpty() ){
      List<IService> services = CatalogPlugin.getDefault().getServiceFactory().createService(params.getRight());
      if ( !services.isEmpty() ){
        for (IService service : services) {
View Full Code Here

     * @param type The returned service must resolve to this type
     * @return URL of resulting service
     */
    static final private URL service( URL url, Class<?> type ) {
        ICatalog local = CatalogPlugin.getDefault().getLocalCatalog();
        List<IResolve> services = local.find(url, ProgressManager.instance().get());
        for( IResolve service : services ) {
            if (service.canResolve(type)) {
                return service.getIdentifier();
            }
        }
View Full Code Here

    }

    private static IGeoResource findResource( URL url, String name ) throws IOException {
        URL appended = new URL(url.toString() + "#" + name); //$NON-NLS-1$
        ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
        List<IResolve> results = localCatalog.find(appended, null);
        if (results.isEmpty()) {
            List<IService> services = CatalogPlugin.getDefault().getServiceFactory().createService(url);
            for( IService service : services ) {
                localCatalog.add(service);
                for( IGeoResource resource : service.resources(null) ) {
View Full Code Here

       * Creates a MemoryDatastore service from an array of features.  Does not add to catalog.
       * @param deleteService
       */
      public static IService getService(SimpleFeature[] features, boolean deleteService) throws IOException {
        ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
        List<IResolve> services = catalog.find(MemoryServiceExtensionImpl.URL, new NullProgressMonitor());
        IService service=null;
        if( services.isEmpty() ){
          service = createService(catalog);
        }else{
          IResolve resolve=services.get(0);
View Full Code Here

    }

    private static Collection<IService> searchLocalCatalog( URL url, IProgressMonitor monitor ) {
        ICatalog localCatalog = CatalogPlugin.getDefault().getLocalCatalog();
       
        List<IResolve> resolves = localCatalog.find(url, monitor);
        ArrayList<IService> services = new ArrayList<IService>();
        for( IResolve iResolve : resolves ) {
            if (iResolve instanceof IService) {
                IService service = (IService) iResolve;
                services.add(service);
View Full Code Here

    public static void addResourceFromUrlToMap( URL url, IProgressMonitor progressMonitor, int addPosition, IMap map ) {

        synchronized (url) {
            ICatalog catalog = CatalogPlugin.getDefault().getLocalCatalog();
            // first search the local catalog.
            List<IResolve> matches = catalog.find(url, new SubProgressMonitor(progressMonitor, 2));

            for( IResolve resolve : matches ) {
                List<IResolve> members = null;
                try {
                    List<IGeoResource> geoResources = new ArrayList<IGeoResource>();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.