Class ContentFeatureStore

    • Field Detail

      • WRITER_ADD

        protected final int WRITER_ADD
        Flag writer for adding new content
        See Also:
        Constant Field Values
      • WRITER_UPDATE

        protected final int WRITER_UPDATE
        Flag writer for updating content in place
        See Also:
        Constant Field Values
      • WRITER_COMMIT

        protected final int WRITER_COMMIT
        Flag writer for commit (AUTO_COMMIT with no events)
        See Also:
        Constant Field Values
    • Constructor Detail

      • ContentFeatureStore

        public ContentFeatureStore​(ContentEntry entry,
                                   Query query)
        Creates the content feature store.
        Parameters:
        entry - The entry for the feature store.
        query - The defining query.
    • Method Detail

      • getWriter

        public final FeatureWriter<SimpleFeatureType,​SimpleFeature> getWriter​(Filter filter,
                                                                                    int flags)
                                                                             throws IOException
        Returns a writer over features specified by a filter.
        Parameters:
        filter - The filter
        flags - flags specifying writing mode
        Throws:
        IOException
      • getWriter

        public final FeatureWriter<SimpleFeatureType,​SimpleFeature> getWriter​(Query query,
                                                                                    int flags)
                                                                             throws IOException
        Returns a writer over features specified by a query.
        Parameters:
        query - The query
        flags - flags specifying writing mode
        Throws:
        IOException
      • addFeatures

        public List<FeatureId> addFeatures​(Collection collection)
                                    throws IOException
        Adds a collection of features to the store.

        This method operates by getting an appending feature writer and writing all the features in collection to it. Directly after a feature is written its id is obtained and added to the returned set.

        Throws:
        IOException
      • modifyFeatures

        public void modifyFeatures​(AttributeDescriptor[] type,
                                   Object[] value,
                                   Filter filter)
                            throws IOException
        Throws:
        IOException
      • modifyFeatures

        public void modifyFeatures​(Name[] type,
                                   Object[] value,
                                   Filter filter)
                            throws IOException
        Modifies/updates the features of the store which match the specified filter.

        This method operates by obtaining an updating feature writer based on the specified filter and writing the updated values to it.

        The filter must not be null, in this case this method will throw an IllegalArgumentException.

        Specified by:
        modifyFeatures in interface FeatureStore<SimpleFeatureType,​SimpleFeature>
        Parameters:
        type - the attributes to modify
        value - the new values for the attributes
        filter - an OpenGIS filter
        Throws:
        IOException - if the attribute and object arrays are not equal in length; if the value types do not match the attribute types; if modification is not supported; or if there errors accessing the data source
      • modifyFeatures

        public final void modifyFeatures​(String name,
                                         Object attributeValue,
                                         Filter filter)
                                  throws IOException
        Specified by:
        modifyFeatures in interface SimpleFeatureStore
        Throws:
        IOException
      • modifyFeatures

        public final void modifyFeatures​(String[] names,
                                         Object[] values,
                                         Filter filter)
                                  throws IOException
        Specified by:
        modifyFeatures in interface SimpleFeatureStore
        Throws:
        IOException
      • modifyFeatures

        public final void modifyFeatures​(Name name,
                                         Object value,
                                         Filter filter)
                                  throws IOException
        Specified by:
        modifyFeatures in interface FeatureStore<SimpleFeatureType,​SimpleFeature>
        Parameters:
        name - the attribute to modify
        value - the new value for the attribute
        filter - an OpenGIS filter
        Throws:
        IOException - if modification is not supported; if the value type does not match the attribute type; or if there errors accessing the data source
      • removeFeatures

        public void removeFeatures​(Filter filter)
                            throws IOException
        Removes the features from the store which match the specified filter.

        This method operates by obtaining an updating feature writer based on the specified filter and removing every feature from it.

        The filter must not be null, in this case this method will throw an IllegalArgumentException.

        Specified by:
        removeFeatures in interface FeatureStore<SimpleFeatureType,​SimpleFeature>
        Parameters:
        filter - an OpenGIS filter
        Throws:
        IOException - if an error occurs modifying the data source