Package org.geoserver.catalog

Examples of org.geoserver.catalog.DataStoreInfo


    @Test
    public void testAddFeatureType() throws Exception {
        testAddDataStore();
        testAddNamespace();
       
        DataStoreInfo ds =
            dao.getStoreByName(dao.getWorkspaceByName("acme"), "widgets", DataStoreInfo.class );
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
       
        assertNull(dao.getResourceByName(ns, "anvil", FeatureTypeInfo.class));
       
View Full Code Here


    public void testGetFeatureType() throws Exception {
        testAddFeatureType();
       
        WorkspaceInfo ws = dao.getWorkspaceByName("acme");
        NamespaceInfo ns = dao.getNamespaceByPrefix("acme");
        DataStoreInfo ds = dao.getStoreByName(ws, "widgets", DataStoreInfo.class);
       
        assertNotNull(dao.getResourceByStore(ds, "anvil", FeatureTypeInfo.class));
        assertEquals(1, dao.getResourcesByStore(ds, FeatureTypeInfo.class).size());
       
        assertNotNull(dao.getResourceByName(ns, "anvil", FeatureTypeInfo.class));
View Full Code Here

    Component newFeatureTypeLink() {
        return new AjaxLink("createFeatureType") {
           
            @Override
            public void onClick(AjaxRequestTarget target) {
                DataStoreInfo ds = getCatalog().getStore(storeId, DataStoreInfo.class);
                PageParameters pp = new PageParameters("wsName=" + ds.getWorkspace().getName() + ",storeName=" + ds.getName());
                setResponsePage(NewFeatureTypePage.class, pp);               
            }
        };
    }
View Full Code Here

    Component newSQLViewLink() {
        return new AjaxLink("createSQLView") {
           
            @Override
            public void onClick(AjaxRequestTarget target) {
                DataStoreInfo ds = getCatalog().getStore(storeId, DataStoreInfo.class);
                PageParameters pp = new PageParameters("wsName=" + ds.getWorkspace().getName() + ",storeName=" + ds.getName());
                setResponsePage(SQLViewNewPage.class, pp);
            }
        };
    }
View Full Code Here

    private synchronized int getLockCount(){
        int count = 0;

        for (Iterator i = getDataStores().iterator(); i.hasNext();) {
            DataStoreInfo meta = (DataStoreInfo) i.next();

            if (!meta.isEnabled()) {
                // Don't count locks from disabled datastores.
                continue;
            }

            try {
                DataAccess store = meta.getDataStore(null);
                if(store instanceof DataStore) {
                    LockingManager lockingManager = ((DataStore) store).getLockingManager();
                    if (lockingManager != null){
                        // we can't actually *count* locks right now?
                        // count += lockingManager.getLockSet().size();
View Full Code Here

    private synchronized int getConnectionCount() {
        int count = 0;

        for (Iterator i = getDataStores().iterator(); i.hasNext();) {
            DataStoreInfo meta = (DataStoreInfo) i.next();

            if (!meta.isEnabled()) {
                // Don't count connections from disabled datastores.
                continue;
            }

            try {
                meta.getDataStore(null);
            } catch (Throwable notAvailable) {
                //TODO: Logging.
                continue;
            }
View Full Code Here

            }

            @Override
            protected void onSubmit(AjaxRequestTarget target, Form form) {
                try {
                    DataStoreInfo dataStore = (DataStoreInfo) form.getModelObject();
                    onSaveDataStore(dataStore, target);
                } catch (IllegalArgumentException e) {
                    paramsForm.error(e.getMessage());
                    target.addComponent(paramsForm);
                }
View Full Code Here

       
        tester.assertLabel("form:panel:removedObjects:storesRemoved:stores", "cite");
       
        String layers = tester.getComponentFromLastRenderedPage("form:panel:removedObjects:layersRemoved:layers").getDefaultModelObjectAsString();
        String[] layerArray = layers.split(", ");
        DataStoreInfo citeStore = getCatalog().getStoreByName("cite", DataStoreInfo.class);
        List<FeatureTypeInfo> typeInfos = getCatalog().getResourcesByStore(citeStore, FeatureTypeInfo.class);
        assertEquals(typeInfos.size(), layerArray.length);
    }
View Full Code Here

     * @param parameters
     */
    public DataAccessEditPage(PageParameters parameters) {
        String wsName = parameters.getString(WS_NAME);
        String storeName = parameters.getString(STORE_NAME);
        DataStoreInfo dsi = getCatalog().getDataStoreByName(wsName, storeName);
       
        if(dsi == null) {
            error(new ParamResourceModel("DataAccessEditPage.notFound", this, wsName, storeName).getString());
            setResponsePage(StorePage.class);
            return;
View Full Code Here

     * @param dataStoreInfoId
     *            the datastore id to modify, as per {@link DataStoreInfo#getId()}
     */
    public DataAccessEditPage(final String dataStoreInfoId) throws IllegalArgumentException {
        final Catalog catalog = getCatalog();
        final DataStoreInfo dataStoreInfo = catalog.getDataStore(dataStoreInfoId);

        if (null == dataStoreInfo) {
            throw new IllegalArgumentException("DataStore " + dataStoreInfoId + " not found");
        }

View Full Code Here

TOP

Related Classes of org.geoserver.catalog.DataStoreInfo

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.