Package org.geoserver.config

Examples of org.geoserver.config.ServiceInfo


        WorkspaceInfo ws1 = geoServer.getCatalog().getFactory().createWorkspace();
        ws1.setName("TEST-WORKSPACE-1");
        geoServer.getCatalog().add(ws1);
       
        // Make a service for that workspace
        ServiceInfo ws1wms = new org.geoserver.wms.WMSInfoImpl();
        ws1wms.setWorkspace(ws1);
        ws1wms.setName("WMS1");
        ws1wms.setTitle("WMS for WS1");
        geoServer.add(ws1wms);
       
        // Make a second for that workspace
        ServiceInfo ws1wfs = new org.geoserver.wfs.WFSInfoImpl();
        ws1wfs.setWorkspace(ws1);
        ws1wfs.setName("WFS1");
        ws1wfs.setTitle("WFS for WS1");
        geoServer.add(ws1wfs);
       
        // Make a global service
        ServiceInfo gwms = new org.geoserver.wms.WMSInfoImpl();
        gwms.setName("WMSG");
        gwms.setTitle("Global WMS");
        geoServer.add(gwms);
       
        // Make a second global service
        ServiceInfo gwfs = new org.geoserver.wfs.WFSInfoImpl();
        gwfs.setName("WFSG");
        gwfs.setTitle("Global WFS");
        geoServer.add(gwfs);
       
        // Make a workspace
        WorkspaceInfo ws2 = geoServer.getCatalog().getFactory().createWorkspace();
        ws2.setName("TEST-WORKSPACE-2");
        geoServer.getCatalog().add(ws2);
       
        // Make a service for that workspace
        ServiceInfo ws2wms = new org.geoserver.wms.WMSInfoImpl();
        ws2wms.setWorkspace(ws2);
        ws2wms.setName("WMS2");
        ws2wms.setTitle("WMS for WS2");
        geoServer.add(ws2wms);
       
        // Make a second for that workspace
        ServiceInfo ws2wfs = new org.geoserver.wfs.WFSInfoImpl();
        ws2wfs.setWorkspace(ws2);
        ws2wfs.setName("WFS2");
        ws2wfs.setTitle("WFS for WS2");
        geoServer.add(ws2wfs);

        // Check that we get the services we expect to
        assertThat(geoServer.getService(org.geoserver.wms.WMSInfo.class), equalTo(gwms));
        assertThat(geoServer.getService(org.geoserver.wfs.WFSInfo.class), equalTo(gwfs));
View Full Code Here


        ServiceInfo create() {
            //create it
            GeoServer gs = GeoServerApplication.get().getGeoServer();
           
            ServiceInfo newService = gs.getFactory().create(serviceClass);

            //initialize from global service
            ServiceInfo global = gs.getService(serviceClass);
            OwsUtils.copy(global,newService, serviceClass);
            newService.setWorkspace(wsModel.getObject());

            //hack, but need id to be null so its considered unattached
            ((ServiceInfoImpl)newService).setId(null);
View Full Code Here

    }

    @Override
    protected Object handleObjectGet() throws Exception {
        String workspace = getAttribute("workspace");
        ServiceInfo service;
        if (workspace != null) {
            WorkspaceInfo ws = geoServer.getCatalog().getWorkspaceByName(workspace);
           
            service = geoServer.getService(ws, clazz);
        } else {
View Full Code Here

    protected void handleObjectPut(Object object) throws Exception {
        String workspace = getAttribute("workspace");
        WorkspaceInfo ws = null;
        if(workspace!=null) ws = geoServer.getCatalog().getWorkspaceByName(workspace);

        ServiceInfo serviceInfo = (ServiceInfo) object;
        ServiceInfo originalInfo;
        if(ws!=null){
            originalInfo = geoServer.getService(ws, clazz);
        } else {
            originalInfo = geoServer.getService(clazz);
        }
View Full Code Here

    @Override
    protected void handleObjectDelete() throws Exception {
        String workspace = getAttribute("workspace");
        if (workspace != null) {
            WorkspaceInfo ws = geoServer.getCatalog().getWorkspaceByName(workspace);
            ServiceInfo serviceInfo = geoServer.getService(ws, clazz);
            if (serviceInfo != null) {
                geoServer.remove(serviceInfo);
            }
        }
    }
View Full Code Here

            m = OwsUtils.getter( s.getClass(), "serviceInfo", ServiceInfo.class );
        }
       
        if ( m != null ) {
            try {
                ServiceInfo info = (ServiceInfo) m.invoke( s , null );
               
                //check if the service is enabled
                if (!info.isEnabled()) {
                    throw new ServiceException( "Service " + info.getName() + " is disabled" );
                }
            }
            catch (Exception e) {
                //TODO: log this
                throw new ServiceException( e );
View Full Code Here

TOP

Related Classes of org.geoserver.config.ServiceInfo

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.