Class HistoryLoadTask

    • Constructor Detail

      • HistoryLoadTask

        public HistoryLoadTask()
        Constructs a new HistoryLoadTask.
      • HistoryLoadTask

        public HistoryLoadTask​(java.awt.Component parent)
        Constructs a new HistoryLoadTask.
        Parameters:
        parent - the component to be used as reference to find the parent for PleaseWaitDialog. Must not be null.
        Throws:
        java.lang.NullPointerException - if parent is null
    • Method Detail

      • add

        public HistoryLoadTask add​(PrimitiveId pid)
        Adds an object whose history is to be loaded.
        Parameters:
        pid - the primitive id. Must not be null. Id > 0 required.
        Returns:
        this task
      • add

        public HistoryLoadTask add​(HistoryOsmPrimitive primitive)
        Adds an object to be loaded, the object is specified by a history item.
        Parameters:
        primitive - the history item
        Returns:
        this task
        Throws:
        java.lang.NullPointerException - if primitive is null
      • add

        public HistoryLoadTask add​(History history)
        Adds an object to be loaded, the object is specified by an already loaded object history.
        Parameters:
        history - the history. Must not be null.
        Returns:
        this task
        Throws:
        java.lang.NullPointerException - if history is null
      • add

        public HistoryLoadTask add​(OsmPrimitive primitive)
        Adds an object to be loaded, the object is specified by an OSM primitive.
        Parameters:
        primitive - the OSM primitive. Must not be null. primitive.getOsmId() > 0 required.
        Returns:
        this task
        Throws:
        java.lang.NullPointerException - if the primitive is null
        java.lang.IllegalArgumentException - if primitive.getOsmId() <= 0
      • addPrimitiveIds

        public HistoryLoadTask addPrimitiveIds​(java.util.Collection<? extends PrimitiveId> primitives)
        Adds a collection of objects to loaded, specified by a collection of OSM primitives.
        Parameters:
        primitives - the OSM primitives. Must not be null. primitive.getId() > 0 required.
        Returns:
        this task
        Throws:
        java.lang.NullPointerException - if primitives is null
        java.lang.IllegalArgumentException - if one of the ids in the collection <= 0
        Since:
        16123
      • addOsmPrimitives

        public HistoryLoadTask addOsmPrimitives​(java.util.Collection<? extends OsmPrimitive> primitives)
        Adds a collection of objects to loaded, specified by a collection of OSM primitives.
        Parameters:
        primitives - the OSM primitives. Must not be null. primitive.getId() > 0 required.
        Returns:
        this task
        Throws:
        java.lang.NullPointerException - if primitives is null
        java.lang.IllegalArgumentException - if one of the ids in the collection <= 0
        Since:
        16123
      • finish

        protected void finish()
        Description copied from class: PleaseWaitRunnable
        Finish up the data work. Is guaranteed to be called if realRun is called. Finish is called in the gui thread just after the dialog disappeared.
        Specified by:
        finish in class PleaseWaitRunnable
      • realRun

        protected void realRun()
                        throws org.xml.sax.SAXException,
                               java.io.IOException,
                               OsmTransferException
        Description copied from class: PleaseWaitRunnable
        Called in the worker thread to do the actual work. When any of the exception is thrown, a message box will be displayed and closeDialog is called. finish() is called in any case.
        Specified by:
        realRun in class PleaseWaitRunnable
        Throws:
        org.xml.sax.SAXException - if a SAX error occurs
        java.io.IOException - if an I/O error occurs
        OsmTransferException - if a communication error with the OSM server occurs
      • isCanceled

        public boolean isCanceled()
        Determines if this task has ben canceled.
        Returns:
        true if this task has ben canceled
      • getLastException

        public java.lang.Exception getLastException()
        Returns the last exception that occurred during loading, if any.
        Returns:
        the last exception that occurred during loading, or null
      • setChangesetDataNeeded

        public void setChangesetDataNeeded​(boolean b)
        Determine if changeset information is needed. By default it is retrieved.
        Parameters:
        b - false means don't retrieve changeset data.
        Since:
        14763
      • setCollectMissing

        public void setCollectMissing​(boolean b)
        Determine if missing primitives should be collected. By default they are not collected and the first missing object terminates the task.
        Parameters:
        b - true means collect missing data and continue.
        Since:
        16205
      • getMissingPrimitives

        public java.util.Set<PrimitiveIdgetMissingPrimitives()
        replies the set of ids of all primitives for which a fetch request to the server was submitted but which are not available from the server (the server replied a return code of 404)
        Returns:
        the set of ids of missing primitives
        Since:
        16205