org.geotools.data.store
Interface TypeEntry

All Known Implementing Classes:
ActiveTypeEntry

public interface TypeEntry

Starting place for holding information about a FeatureType.

Like say for instance the FeatureType, its metadata and so on.

The default implemenation should contain enough information to wean us off of AbstractDataStore. That is it should provide its own locking and event notification.

There is a naming convention:

  • Feedback:

    Author:
    jgarnett
    Module:
    modules/library/main (gt-main.jar)

    Method Summary
     FeatureSource<SimpleFeatureType,SimpleFeature> createFeatureSource()
              Create a new FeatueSource allowing interaction with content.
     boolean equals(Object obj)
              Equals based only on resource definition information (not connection information).
     void fireAdded(SimpleFeature newFeature, Transaction transaction)
              Change notifcation
     void fireChanged(SimpleFeature before, SimpleFeature after, Transaction transaction)
              Change notifcation
     void fireRemoved(SimpleFeature removedFeature, Transaction transaction)
              Change notifcation
     InternationalString getDescription()
               
     InternationalString getDisplayName()
               
     SimpleFeatureType getFeatureType()
               
     int hashCode()
              This hashcode is *VERY* important!
     

    Method Detail

    getDisplayName

    InternationalString getDisplayName()
    Returns:
    user name for this feature collection

    getDescription

    InternationalString getDescription()
    Returns:
    Description of this feature collection

    getFeatureType

    SimpleFeatureType getFeatureType()
                                     throws IOException
    Returns:
    Schema of this feature collection
    Throws:
    IOException - If resoruce is unavailable

    createFeatureSource

    FeatureSource<SimpleFeatureType,SimpleFeature> createFeatureSource()
                                                                       throws IOException
    Create a new FeatueSource allowing interaction with content.

    Subclass may optionally implement:

    • FeatureStore - to allow read/write access
    • FeatureLocking - for locking support
    This choice may even be made a runtime (allowing the api to represent a readonly file).

    Several default implemenations are provided

    Returns:
    FeatureLocking allowing access to content.
    Throws:
    IOException

    fireAdded

    void fireAdded(SimpleFeature newFeature,
                   Transaction transaction)
    Change notifcation

    Parameters:
    newFeature -
    transaction -

    fireRemoved

    void fireRemoved(SimpleFeature removedFeature,
                     Transaction transaction)
    Change notifcation

    Parameters:
    removedFeature -
    transaction -

    fireChanged

    void fireChanged(SimpleFeature before,
                     SimpleFeature after,
                     Transaction transaction)
    Change notifcation

    Parameters:
    before -
    after -
    transaction -

    equals

    boolean equals(Object obj)
    Equals based only on resource definition information (not connection information).

    Overrides:
    equals in class Object
    Parameters:
    obj -
    Returns:
    true if TypeEntry represents the same resource
    See Also:
    Object.equals(java.lang.Object)

    hashCode

    int hashCode()
    This hashcode is *VERY* important!

    The hascode must be dependent only on the parameters that "define" the resource, not those that control opperation.

    • when representing a URL the hashcode must be: url.hashCode()
    • when representing a File the hashcode must be: file.toURI().toURL().hashcode()
    • when representing a database connection: hascode of jdbc url w/ out username, password

    Implemetnation tip - URL.hashCode is a blocking operation, so you calculate and cache when the URL changes, rather than block this method.

    Overrides:
    hashCode in class Object
    Returns:
    hashCode based on resource definition
    See Also:
    Object.hashCode()


    Copyright © 1996-2010 Geotools. All Rights Reserved.