Author: jsorel
Date: Wed Feb 14 09:38:28 2018
New Revision: 1824206

URL: http://svn.apache.org/viewvc?rev=1824206&view=rev
Log:
DataStore : add FeatureSet.updateType and FileSystemResource

Added:
    
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/FileSystemResource.java
Modified:
    
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java

Added: 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/FileSystemResource.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/FileSystemResource.java?rev=1824206&view=auto
==============================================================================
--- 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/FileSystemResource.java
 (added)
+++ 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/FileSystemResource.java
 Wed Feb 14 09:38:28 2018
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.storage;
+
+import java.nio.file.Path;
+import org.apache.sis.storage.DataStoreException;
+import org.apache.sis.storage.Resource;
+
+/**
+ * Files-related {@linkplain org.apache.sis.storage.Resource resource}.
+ * This interface allows a resource to indicate it's used files, it
+ * can then be used to improve data management.
+ *
+ * @author Johann Sorel (Geomatys)
+ * @since 1.0
+ * @module
+ */
+public interface FileSystemResource extends Resource {
+
+    /**
+     * Get all files used by this {@linkplain org.apache.sis.storage.DataStore 
data store}.
+     *
+     * @return Files used by this store. Should never be {@code null}.
+     * @throws org.apache.sis.storage.DataStoreException if an error on the 
file system prevent
+     *          the creation of the list.
+     */
+    Path[] getResourcePaths() throws DataStoreException;
+
+}

Modified: 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
URL: 
http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java?rev=1824206&r1=1824205&r2=1824206&view=diff
==============================================================================
--- 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
 [UTF-8] (original)
+++ 
sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/storage/FeatureSet.java
 [UTF-8] Wed Feb 14 09:38:28 2018
@@ -75,6 +75,33 @@ public interface FeatureSet extends Data
     FeatureType getType() throws DataStoreException;
 
     /**
+     * Redefine the feature type of this feature set, including all features.
+     * This operation may take an undefined time since all features in the set 
must be transformed.
+     *
+     * <p>
+     * An {@linkplain  org.apache.sis.storage.IllegalFeatureTypeException} 
will be throw
+     * when the provided type contains incompatible attribute changes.
+     * </p>
+     *
+     * <p>
+     * In the case of a newly created feature set, this method can be used to 
define
+     * stored feature type.
+     * </p>
+     *
+     * <p>
+     * Default implementation throw a {@linkplain  
org.apache.sis.storage.ReadOnlyStorageException}.
+     * </p>
+     *
+     * @param newType new feature type definition, (not {@code null}).
+     * @throws ReadOnlyStorageException if this instance does not support 
schema update
+     * @throws IllegalFeatureTypeException if the given type is not compatible
+     * @throws DataStoreException if another error occurred while changing 
feature type.
+     */
+    default void updateType(FeatureType newType) throws 
ReadOnlyStorageException, IllegalFeatureTypeException, DataStoreException {
+        throw new ReadOnlyStorageException(this, 
Resources.Keys.StoreIsReadOnly);
+    }
+
+    /**
      * Requests a subset of features and feature properties from this resource.
      * The filtering can be applied in two domains:
      *


Reply via email to