Package org.geoserver.config

Examples of org.geoserver.config.GeoServerInfo


                    if (!propFile.exists()) {
                        // we're probably dealing with an old data dir, create
                        // the file without
                        // changing the username and password if possible
                        Properties p = new Properties();
                        GeoServerInfo global = geoServer.getGlobal();
                        if ((geoServer != null) && (global.getAdminUsername() != null)
                                && !global.getAdminUsername().trim().equals("")) {
                            p.put(global.getAdminUsername(), global.getAdminPassword()
                                    + ",ROLE_ADMINISTRATOR");
                        } else {
                            p.put("admin", "geoserver,ROLE_ADMINISTRATOR");
                        }
View Full Code Here


                + System.getProperty("java.version") + " (" + System.getProperty("java.vm.name") + ")");
       
        values.put(KEY_JAI_AVAILABLE, Boolean.toString(isNativeJAIAvailable()));
        values.put(KEY_JAI_IMAGEIO_AVAILABLE, Boolean.toString(PackageUtil.isCodecLibAvailable()));

        GeoServerInfo geoServerInfo = getGeoServer().getGlobal();
        JAIInfo jaiInfo = geoServerInfo.getJAI();
        JAI jai =  jaiInfo.getJAI();
        SunTileCache jaiCache = jaiInfo.getTileCache();

        values.put(KEY_JAI_MAX_MEM, formatMemory(jaiCache.getMemoryCapacity()));
        values.put(KEY_JAI_MEM_USAGE, formatMemory(jaiCache.getCacheMemoryUsed()));
        values.put(KEY_JAI_MEM_THRESHOLD, Float.toString(100.0f * jaiCache.getMemoryThreshold()));
        values.put(KEY_JAI_TILE_THREADS, Integer.toString(jai.getTileScheduler().getParallelism()));
        values.put(KEY_JAI_TILE_THREAD_PRIORITY, Integer.toString(jai.getTileScheduler()
                .getPriority()));

        values.put(KEY_UPDATE_SEQUENCE, Long.toString(geoServerInfo.getUpdateSequence()));
    }
View Full Code Here

        form.add(new TextField("contactEmail"));
        form.add(new Button("submit") {
            @Override
            public void onSubmit() {
                GeoServer gs = (GeoServer)geoServerModel.getObject();
                GeoServerInfo global = gs.getGlobal();
                global.setContact((ContactInfo)contactModel.getObject());
                gs.save(global);
                setResponsePage(GeoServerHomePage.class);
            }
        });
        form.add(new Button("cancel") {
View Full Code Here

   
    @Override
    protected void oneTimeSetUp() throws Exception {
        super.oneTimeSetUp();

        GeoServerInfo global = getGeoServer().getGlobal();
        global.setProxyBaseUrl("src/test/resources/geoserver");
        getGeoServer().save(global);
    }
View Full Code Here

    }

    public GeoServerInfo getGlobal() {
        if (LOGGER.isLoggable(Level.FINEST))
            LOGGER.finest("Querying geoserver global configuration");
        GeoServerInfo geoserver = this.serviceDAO.getGeoServer();
        if (geoserver == null) {
            LOGGER.warning("Database is empty");
            geoserver = null;

        } else {

            if (cachedJAI == null) {
                LOGGER.info("getGlobal: JAI was null, inizitialized.");
                cachedJAI = geoserver.getJAI();
            } else {
                // The cached jai may have been updated.
                // Updated values should already be in db, but we need
                // the transient runtime values that are stored in cachedJAI.
                geoserver.setJAI(cachedJAI);
            }
        }

        return geoserver;
    }
View Full Code Here

            LOGGER.warning("GeoServerInfo contact is not set. Creating empty one...");
            configuration.setContact(getFactory().createContact());
        }

        // retrieve existing global
        GeoServerInfo currentGlobal = getGlobal();
        GeoServerInfoImplHb merged = null;

        if (currentGlobal == null) {
            if (LOGGER.isLoggable(Level.INFO))
                LOGGER.info("Storing first instance of GeoServerInfo");
View Full Code Here

    }

    protected void initialize() {
        LOGGER.warning("Initializing " + this.getClass().getSimpleName());

        GeoServerInfo global = geoserver.getGlobal();
        if (global == null) {
            global = HibDefaultsFactoryImpl.createDefaultGeoServer(geoserver);

            HibDefaultsFactoryImpl.createDefaultServices(geoserver, global);
            HibDefaultsFactoryImpl.createDefaultXXXXspace(geoserver);

            initializeStyles(catalog);

        } else {
            JAIInfo jai = global.getJAI();
            // we are missing the JAI info. This can be due by the fact that previous
            // run was made by a unit test
            if (jai == null) {
                LOGGER.warning("Global is missing JAI info. Setting default ones...");
                global.setJAI(geoserver.getFactory().createJAI());
                geoserver.setGlobal(global);

            }

            WMSInfo wms = geoserver.getService(WMSInfo.class);
View Full Code Here

* @author ETj <etj at geo-solutions.it>
*/
public class HibDefaultsFactoryImpl {

    public static GeoServerInfo createDefaultGeoServer(GeoServer serviceCatalog) {
        GeoServerInfo geoserver = serviceCatalog.getFactory().createGlobal();
        geoserver.setContact(serviceCatalog.getFactory().createContact());

        geoserver.setNumDecimals(8);

        geoserver.setVerbose(false);
        geoserver.setVerboseExceptions(false);

        geoserver.setJAI(serviceCatalog.getFactory().createJAI());

        serviceCatalog.setGlobal(geoserver);
        return geoserver;
    }
View Full Code Here

        this.serviceCatalog = serviceCatalog;
    }

    public GeoServerInfo createBaseObjects() {

        GeoServerInfo geoserver = createDefaultGeoServer();
        createDefaultServices(geoserver);
        // NamespaceInfo defaultNameSpace = createDefaultNamespace();
        // WorkspaceInfo defaultWs = createDefaultWorkspace();

        return geoserver;
View Full Code Here

        resourceCatalog.setDefaultWorkspace(ws);
        return ws;
    }

    public GeoServerInfo createDefaultGeoServer() {
        GeoServerInfo geoserver;
        geoserver = this.serviceCatalog.getFactory().createGlobal();
        geoserver.setContact(this.serviceCatalog.getFactory().createContact());

        geoserver.setNumDecimals(8);

        geoserver.setVerbose(false);
        geoserver.setVerboseExceptions(false);

        // jai
        JAIInfo jai = serviceCatalog.getFactory().createJAI();
        jai.setMemoryCapacity((Double) 0.5);
        jai.setMemoryThreshold((Double) 0.75);
        jai.setTileThreads((Integer) 5);
        jai.setTilePriority((Integer) 5);
        jai.setImageIOCache((Boolean) false);
        jai.setJpegAcceleration((Boolean) false);
        jai.setPngAcceleration((Boolean) false);
        jai.setRecycling((Boolean) false);
        jai.setAllowNativeMosaic(false);

        geoserver.setJAI(jai);

        serviceCatalog.setGlobal(geoserver);

        return geoserver;
    }
View Full Code Here

TOP

Related Classes of org.geoserver.config.GeoServerInfo

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.