Package org.geoserver.platform

Examples of org.geoserver.platform.Service


        };
       

        callback = createProxy(callback);
        callback.operationDispatched(new Request(),
            new Operation("foo", new Service("bar", null, null, null), null, null));
       
        assertEquals(Status.RUNNING, data.getStatus());
    }
View Full Code Here


       
        return new MapLayerInfo(l);
    }
   
    Operation op(String name, String service, String version, Object request) {
        return new Operation(name, new Service(service, null, new Version(version), null),
            null, new Object[]{request});
    }
View Full Code Here

    private Map<String, String> params;

    protected void setUp() throws Exception {
        geoServerImpl = new GeoServerImpl();
        List<String> operations = new ArrayList<String>();
        csw = new Service("csw", new DefaultWebCatalogService(geoServerImpl), new Version("2.0.2"), operations);

        params = new HashMap<String, String>();
    }
View Full Code Here

        //set request / response
        request.setHttpRequest(httpRequest);
        request.setHttpResponse(httpResponse);

        Service service = null;

        try {
            // initialize the request and allow callbacks to override it
            request = init(request);
View Full Code Here

            throw new ServiceException("Could not determine service", "MissingParameterValue",
                "service");
        }

        //load from teh context
        Service serviceDescriptor = findService(service, req.getVersion(), req.getNamespace());
        if (serviceDescriptor == null) {
            //hack for backwards compatability, try finding the service with the context instead
            // of the service
            if (req.getContext() != null) {
                serviceDescriptor = findService(req.getContext(), req.getVersion(), req.getNamespace());
View Full Code Here

        return fireServiceDispatchedCallback(req,serviceDescriptor);
    }
   
    Service fireServiceDispatchedCallback(Request req, Service service ) {
        for ( DispatcherCallback cb : callbacks ) {
            Service s = cb.serviceDispatched( req, service );
            service = s != null ? s : service;
        }
        return service;
    }
View Full Code Here

                    //make sure the versoin actually exists
                    boolean found = false;
                    Version version = new Version(req.getVersion());

                    for (Iterator s = loadServices().iterator(); s.hasNext();) {
                        Service service = (Service) s.next();

                        if (version.equals(service.getVersion())) {
                            found = true;

                            break;
                        }
                    }
View Full Code Here

        return null;
    }

    Object execute(Request req, Operation opDescriptor)
        throws Throwable {
        Service serviceDescriptor = opDescriptor.getService();
        Object serviceBean = serviceDescriptor.getService();
        Object[] parameters = opDescriptor.getParameters();

        //step 5: execute
        Object result = null;
       
View Full Code Here

        //first just match on service,request
        List matches = new ArrayList();

        for (Iterator itr = services.iterator(); itr.hasNext();) {
            Service sBean = (Service) itr.next();

            if (sBean.getId().equalsIgnoreCase(id)) {
                matches.add(sBean);
            }
        }

        if (matches.isEmpty()) {
            return null;
        }

        Service sBean = null;

        //if multiple, use version to filter match
        if (matches.size() > 1) {
            List vmatches = new ArrayList(matches);

            //match up the version
            if (version != null) {
                //version specified, look for a match
                for (Iterator itr = vmatches.iterator(); itr.hasNext();) {
                    Service s = (Service) itr.next();

                    if (version.equals(s.getVersion())) {
                        continue;
                    }

                    itr.remove();
                }

                if (vmatches.isEmpty()) {
                    //no matching version found, drop out and next step
                    // will sort to return highest version
                    vmatches = new ArrayList(matches);
                }
            }

            //if still multiple matches use namespace, if available, to filter
            if (namespace != null && vmatches.size() > 1) {
                List nmatches = new ArrayList(vmatches);
                for (Iterator itr = nmatches.iterator(); itr.hasNext();) {
                    Service s = (Service) itr.next();
                    if (s.getNamespace() != null && !s.getNamespace().equals(namespace)) {
                        //service declares namespace, kick it out if there is no match
                        itr.remove();
                    }
                    else {
                        //service does not declare namespace, leave it along
                    }
                }

                if (!nmatches.isEmpty()) {
                    vmatches = nmatches;
                }
            }
           
            //multiple services found, sort by version
            if (vmatches.size() > 1) {
                //use highest version
                Comparator comparator = new Comparator() {
                        public int compare(Object o1, Object o2) {
                            Service s1 = (Service) o1;
                            Service s2 = (Service) o2;

                            return s1.getVersion().compareTo(s2.getVersion());
                        }
                    };

                Collections.sort(vmatches, comparator);
            }
View Full Code Here

        ogr.setGdalData(Ogr2OgrTestUtil.getGdalData());

        // the EMF objects used to talk with the output format
        gft = WfsFactory.eINSTANCE.createGetFeatureType();
        fct = WfsFactory.eINSTANCE.createFeatureCollectionType();
        op = new Operation("GetFeature", new Service("WFS", null, new Version("1.0.0"),
                Arrays.asList("GetFeature")), null, new Object[] { gft });
    }
View Full Code Here

TOP

Related Classes of org.geoserver.platform.Service

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.