Class IntegrationWriterDataTrackingImpl

    • Field Detail

      • trackerMissingClasses

        protected java.util.Set<java.lang.Class<?>> trackerMissingClasses
      • pureObjects

        protected IntPresentSet pureObjects
        This is a list of the objects that did not merge with anything from a previous data source
      • writtenObjects

        protected IntPresentSet writtenObjects
        This is a list of the objects in the destination database that we have written to as a non-skeleton. This is so that we can notice if we write to a given object twice, given ignoreDuplicates, so we can tell the user if ignoreDuplicates is necessary.
      • duplicateObjects

        protected IntPresentSet duplicateObjects
        This is a list of the objects in the destination database that we have written to as a non-skeleton more than once.
      • isDuplicates

        protected boolean isDuplicates
    • Constructor Detail

      • IntegrationWriterDataTrackingImpl

        public IntegrationWriterDataTrackingImpl​(ObjectStoreWriter osw,
                                                 DataTracker dataTracker)
        Constructs a new instance of IntegrationWriterDataTrackingImpl.
        Parameters:
        osw - an instance of an ObjectStoreWriter, which we can use to access the database
        dataTracker - an instance of DataTracker, which we can use to store data tracking information
      • IntegrationWriterDataTrackingImpl

        public IntegrationWriterDataTrackingImpl​(ObjectStoreWriter osw,
                                                 DataTracker dataTracker,
                                                 java.util.Set<java.lang.Class<?>> trackerMissingClasses)
        Constructs a new instance of IntegrationWriterDataTrackingImpl.
        Parameters:
        osw - an instance of an ObjectStoreWriter, which we can use to access the database
        dataTracker - an instance of DataTracker, which we can use to store data tracking information
        trackerMissingClasses - a Set of classes for which DataTracker data is useless
    • Method Detail

      • getInstance

        public static IntegrationWriterDataTrackingImpl getInstance​(java.lang.String osAlias,
                                                                    java.util.Properties props)
                                                             throws ObjectStoreException
        Creates a new instance of this class, given the properties defining it.
        Parameters:
        osAlias - the alias of this objectstore
        props - the Properties
        Returns:
        an instance of this class
        Throws:
        ObjectStoreException - sometimes
      • getInstance

        protected static IntegrationWriterDataTrackingImpl getInstance​(java.lang.String osAlias,
                                                                       java.util.Properties props,
                                                                       java.lang.Class<? extends IntegrationWriterDataTrackingImpl> iwClass,
                                                                       java.lang.Class<? extends DataTracker> trackerClass)
                                                                throws ObjectStoreException
        Creates a new IntegrationWriter instance of the specified class and with a specified DataTracker class plus properties.
        Parameters:
        osAlias - the alias of this objectstore
        props - the Properties
        iwClass - Class of IntegrationWriter to create - IntegrationWriterDataTrackingImpl or a subclass.
        trackerClass - Class of DataTracker to use with IntegrationWriter
        Returns:
        an instance of this class
        Throws:
        ObjectStoreException - sometimes
      • getMainSource

        public Source getMainSource​(java.lang.String name,
                                    java.lang.String type)
        Converts a string describing the data source into a Source object suitable for passing to the store method as the main source.
        Parameters:
        name - the name of the data source
        type - the source type
        Returns:
        a Source
      • getSkeletonSource

        public Source getSkeletonSource​(java.lang.String name,
                                        java.lang.String type)
        Converts a string describing the data source into a Source object suitable for passing to the store method as the skeleton source.
        Parameters:
        name - the name of the data source
        type - the source type
        Returns:
        a skeleton Source
      • getDataTracker

        public DataTracker getDataTracker()
        Returns the data tracker being used.
        Returns:
        dataTracker
      • doTrackerFor

        public boolean doTrackerFor​(java.lang.Class<?> c)
        Returns true if the given class is NOT a subclass of any of the classes in trackerMissingClasses.
        Parameters:
        c - a Class
        Returns:
        a boolean
      • store

        protected InterMineObject store​(FastPathObject nimo,
                                        Source source,
                                        Source skelSource,
                                        int type)
                                 throws ObjectStoreException
        Stores the given object in the objectstore. This method recurses into the object's fields according to the type variable.
        Specified by:
        store in class IntegrationWriterAbstractImpl
        Parameters:
        nimo - the object to store
        source - the data Source to which to attribute the data
        skelSource - the data Source to which to attribute skeleton data
        type - the type of action required, from SOURCE, SKELETON, or FROM_DB
        Returns:
        the InterMineObject that was written to the database
        Throws:
        ObjectStoreException - if an error occurs in the underlying objectstore