com.openindex.openestate.tool.agency
Class AgencyImportTask

java.lang.Object
  extended by javax.swing.SwingWorker<T,V>
      extended by org.jdesktop.application.Task<ResultType,Void>
          extended by com.openindex.openestate.tool.ImmoToolTask<AgencyImportTask.ImportResult>
              extended by com.openindex.openestate.tool.agency.AgencyImportTask
All Implemented Interfaces:
Runnable, Future<AgencyImportTask.ImportResult>, RunnableFuture<AgencyImportTask.ImportResult>

public abstract class AgencyImportTask
extends ImmoToolTask<AgencyImportTask.ImportResult>

allgemeiner ImmoToolTask zum Import in den Immobilienbestand.
$Id: AgencyImportTask.java 1829 2012-10-14 14:24:52Z andy $

Author:
Andreas Rudolph

Nested Class Summary
static class AgencyImportTask.ImportResult
           
 
Nested classes/interfaces inherited from class com.openindex.openestate.tool.ImmoToolTask
ImmoToolTask.Callback, ImmoToolTask.TaskMessageListener
 
Nested classes/interfaces inherited from class org.jdesktop.application.Task
org.jdesktop.application.Task.BlockingScope, org.jdesktop.application.Task.InputBlocker
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
 
Field Summary
static int DELETE_EXPLICITLY
           
static int DELETE_NOTHING
           
static int DELETE_UNMODIFIED
           
static String KEY_IMPORT_HASH
           
 
Fields inherited from class org.jdesktop.application.Task
PROP_COMPLETED, PROP_DESCRIPTION, PROP_DONE, PROP_INPUTBLOCKER, PROP_MESSAGE, PROP_STARTED, PROP_TASKSERVICE, PROP_TITLE, PROP_USERCANCANCEL
 
Constructor Summary
AgencyImportTask(File importFile)
           
 
Method Summary
protected  boolean deleteEstate(AgencyEstate estate)
           
protected  void finished()
           
 Map<Long,String> getImportContacts()
           
 File getImportFile()
           
protected  AgencyImportTask.ImportResult importAgency(AgencyImpl agency, String status, int deleteMethod, boolean ignoreUpdates)
           
protected  String importContact(AgentContactImpl contact, String status)
           
protected  Long importEstate(EstateImpl estate, String status, boolean ignoreUpdates, AgencyImportTask.ImportResult result)
           
protected  AgencyImportTask.ImportResult importTransfer(TransferImpl transfer, String status, int deleteMethod, boolean ignoreUpdates)
           
protected  void logDefaultSettings(String status, int deleteMethod, Locale locale)
           
protected  void logDialogSettings(AgencyImportDialog dlg)
           
protected  void logSetting(String key, String value)
           
protected  File lookupAttachmentFile(EstateAttachmentImpl attachment, File importFileDir)
           
protected  AgencyEstate lookupEstateByImportHash(EstateImpl estate)
           
 File openImportFile(String[] suffixes)
           
 org.dom4j.Document openImportFileAsDocument()
           
protected  InputStream readAttachment(EstateAttachmentImpl attachment, int pos)
           
protected  AgencyImportDialog showImportDialog(Window parent, int format)
           
 
Methods inherited from class com.openindex.openestate.tool.ImmoToolTask
addMessageListener, cancelled, checkCancelled, createCallback, doInBackground, executeTask, failed, getTaskDialog, removeMessageListener, setMessage, setTaskDialog, succeeded
 
Methods inherited from class org.jdesktop.application.Task
addTaskListener, done, getApplication, getContext, getDescription, getExecutionDuration, getInputBlocker, getMessage, getMessageDuration, getResourceMap, getTaskListeners, getTaskService, getTitle, getUserCanCancel, interrupted, isPending, isProgressPropertyValid, isStarted, message, process, removeTaskListener, resourceName, setDescription, setInputBlocker, setProgress, setProgress, setProgress, setTitle, setUserCanCancel
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_IMPORT_HASH

public static final String KEY_IMPORT_HASH
See Also:
Constant Field Values

DELETE_NOTHING

public static final int DELETE_NOTHING
See Also:
Constant Field Values

DELETE_EXPLICITLY

public static final int DELETE_EXPLICITLY
See Also:
Constant Field Values

DELETE_UNMODIFIED

public static final int DELETE_UNMODIFIED
See Also:
Constant Field Values
Constructor Detail

AgencyImportTask

public AgencyImportTask(File importFile)
Method Detail

deleteEstate

protected boolean deleteEstate(AgencyEstate estate)

finished

protected void finished()
Overrides:
finished in class ImmoToolTask<AgencyImportTask.ImportResult>

getImportContacts

public Map<Long,String> getImportContacts()

getImportFile

public File getImportFile()

importAgency

protected AgencyImportTask.ImportResult importAgency(AgencyImpl agency,
                                                     String status,
                                                     int deleteMethod,
                                                     boolean ignoreUpdates)
                                              throws ImmoToolDbException
Throws:
ImmoToolDbException

importContact

protected String importContact(AgentContactImpl contact,
                               String status)
                        throws ImmoToolDbException
Throws:
ImmoToolDbException

importEstate

protected Long importEstate(EstateImpl estate,
                            String status,
                            boolean ignoreUpdates,
                            AgencyImportTask.ImportResult result)
                     throws ImmoToolDbException
Throws:
ImmoToolDbException

importTransfer

protected AgencyImportTask.ImportResult importTransfer(TransferImpl transfer,
                                                       String status,
                                                       int deleteMethod,
                                                       boolean ignoreUpdates)
                                                throws ImmoToolDbException
Throws:
ImmoToolDbException

logDefaultSettings

protected void logDefaultSettings(String status,
                                  int deleteMethod,
                                  Locale locale)

logDialogSettings

protected void logDialogSettings(AgencyImportDialog dlg)

logSetting

protected void logSetting(String key,
                          String value)

lookupAttachmentFile

protected File lookupAttachmentFile(EstateAttachmentImpl attachment,
                                    File importFileDir)

lookupEstateByImportHash

protected AgencyEstate lookupEstateByImportHash(EstateImpl estate)
                                         throws ImmoToolDbException
Throws:
ImmoToolDbException

openImportFile

public File openImportFile(String[] suffixes)
                    throws org.dom4j.DocumentException,
                           IOException
Throws:
org.dom4j.DocumentException
IOException

openImportFileAsDocument

public org.dom4j.Document openImportFileAsDocument()
                                            throws org.dom4j.DocumentException,
                                                   IOException
Throws:
org.dom4j.DocumentException
IOException

readAttachment

protected InputStream readAttachment(EstateAttachmentImpl attachment,
                                     int pos)
                              throws IOException,
                                     URISyntaxException,
                                     gnu.inet.encoding.IDNAException
Throws:
IOException
URISyntaxException
gnu.inet.encoding.IDNAException

showImportDialog

protected AgencyImportDialog showImportDialog(Window parent,
                                              int format)


Copyright © 2012 OpenEstate. All Rights Reserved.