public class ExportHandler extends Object
The ExportHandler
is part of the high level API for bulk exports of real
estate data.
A previously created ExportPool
can be processed with the
export(org.openestate.is24.restapi.AbstractClient, org.openestate.is24.restapi.utils.ExportPool, boolean, boolean)
method. The ExportHandler
will launch the required low level
operations of the ImportExport
-API for each pooled object.
Constructor and Description |
---|
ExportHandler()
Creates a new
ExportHandler . |
Modifier and Type | Method and Description |
---|---|
protected void |
addProgress(long value)
Calback method to track progress during the export process.
|
protected boolean |
canIgnoreContact(RealtorContactDetails contact,
String poolContactId)
Callback method to check, if a contact should be updated in the export process.
|
protected boolean |
canIgnoreObject(RealEstate object,
String poolObjectId)
Callback method to check, if a real estate should be updated in the export process.
|
protected void |
doArchiveObject(long is24ObjectId,
String externalObjectId)
Archivates a real estate object at the Webservice.
|
protected void |
doArchiveObject(RealEstate is24Object)
Archivates a real estate object at the Webservice.
|
protected void |
doArchiveObject(String externalObjectId)
Archivates a real estate object at the Webservice.
|
protected File |
doDownloadFile(URL url)
|
protected Map<Long,String> |
doListUntouchedObjects()
Returns internal and external ID's of real estates from the Webservice,
that were not changed during the current export process.
|
protected PublishChannels |
doLoadPublishChannels()
Returns publish channels for the authorized agency.
|
protected void |
doRemoveObject(long is24ObjectId,
String externalObjectId)
Removes a real estate object from the Webservice.
|
protected void |
doRemoveObject(String externalObjectId)
Removes a real estate object from the Webservice.
|
protected Long |
doUpdateContact(RealtorContactDetails contact,
String poolContactId)
Saves a contact person to the Webservice.
|
protected Long |
doUpdateObject(RealEstate object,
PublishChannels is24PublishChannels,
String poolObjectId)
Saves a real estate to the Webservice.
|
ExportMessage[] |
export(AbstractClient client,
ExportPool pool,
boolean archivateUnpublishedObjects,
boolean unpublishUntouchedObjects)
Starts the export of an
ExportPool . |
protected AbstractClient |
getClient()
Returns the client of the current export process.
|
ExportMessage[] |
getMessages()
Returns messages, that occured during the last export process.
|
ExportMessage[] |
getMessagesForContact(String externalContactId)
Returns messages for a certain contact person, that occured during the last
export process.
|
ExportMessage[] |
getMessagesForObject(String externalObjectId)
Returns messages for a certain real estate, that occured during the last
export process.
|
ExportMessage[] |
getMessagesGeneral()
Returns general messages, that occured during the last export process.
|
protected ExportPool |
getPool()
Returns the pool of the current export process.
|
protected long |
getProgress()
Returns the progress of the current export process.
|
protected long |
getTotalProgress()
Returns the total progress of the current export process.
|
boolean |
isUseNewEnergySourceEnev2014Values()
Checks, if all values for "energySourceEnev2014" are enabled.
|
protected void |
progressUpdated(long progress,
long totalProgress)
Calback method, that is called after the progress has changed.
|
protected void |
putContactMessage(String externalContactId,
ExportMessage.Code code,
Messages msgs)
Registers messages for a contact person.
|
protected void |
putContactMessage(String externalContactId,
ExportMessage.Code code,
String msg)
Registers a message for a contact person.
|
protected void |
putGeneralMessage(ExportMessage.Code code,
Messages msgs)
Registers general messages.
|
protected void |
putGeneralMessage(ExportMessage.Code code,
String msg)
Registers a general message.
|
protected void |
putObjectMessage(String externalObjectId,
ExportMessage.Code code,
Messages msgs)
Registers messages for a real estate.
|
protected void |
putObjectMessage(String externalObjectId,
ExportMessage.Code code,
String msg)
Registers a message for a real estate.
|
protected void |
setProgress(long progress)
Sets the progress of the current export process.
|
void |
setUseNewEnergySourceEnev2014Values(boolean useNewEnergySourceEnev2014Values)
Enables / disables all values for "energySourceEnev2014".
|
public ExportHandler()
ExportHandler
.protected final void addProgress(long value)
This method may be overridden by inheriting classes in order to track the progress of the export process.
value
- value of additional progressprotected boolean canIgnoreContact(RealtorContactDetails contact, String poolContactId)
contact
- contact person to updatepoolContactId
- id of the contact person within export poolprotected boolean canIgnoreObject(RealEstate object, String poolObjectId)
object
- real estate to updatepoolObjectId
- id of the real estate within export poolprotected final void doArchiveObject(String externalObjectId) throws IOException
externalObjectId
- external real estate IDIOException
- if the operation failedprotected final void doArchiveObject(long is24ObjectId, String externalObjectId) throws IOException
is24ObjectId
- real estate ID by IS24externalObjectId
- external real estate IDIOException
- if the operation failedprotected void doArchiveObject(RealEstate is24Object) throws IOException
is24Object
- real estate to archivateIOException
- if the operation failedprotected File doDownloadFile(URL url) throws IOException
url
- URL to downloadIOException
- if the operation failedprotected Map<Long,String> doListUntouchedObjects() throws IOException
IOException
- if the operation failedprotected PublishChannels doLoadPublishChannels() throws IOException
IOException
- if the operation failedprotected void doRemoveObject(String externalObjectId) throws IOException
externalObjectId
- external real estate IDIOException
- if the operation failedprotected void doRemoveObject(long is24ObjectId, String externalObjectId) throws IOException
is24ObjectId
- real estate ID by IS24externalObjectId
- external real estate IDIOException
- if the operation failedprotected Long doUpdateContact(RealtorContactDetails contact, String poolContactId) throws IOException
contact
- contact to savepoolContactId
- contact ID within export poolIOException
- if the operation failedprotected Long doUpdateObject(RealEstate object, PublishChannels is24PublishChannels, String poolObjectId) throws IOException
object
- real estate to saveis24PublishChannels
- channels, where the real estate should be publishedpoolObjectId
- real estate ID within export poolIOException
- if the operation failedpublic ExportMessage[] export(AbstractClient client, ExportPool pool, boolean archivateUnpublishedObjects, boolean unpublishUntouchedObjects) throws IOException
ExportPool
.client
- client, that is used for transferspool
- pool with exportable dataarchivateUnpublishedObjects
- archivate old real estates instead of removalunpublishUntouchedObjects
- archivate or remove untouched real estates (means full transfer instead of
incremental)IOException
- if the operation failedprotected final AbstractClient getClient()
public final ExportMessage[] getMessages()
public final ExportMessage[] getMessagesForContact(String externalContactId)
externalContactId
- external contact IDpublic final ExportMessage[] getMessagesForObject(String externalObjectId)
externalObjectId
- real estate IDpublic final ExportMessage[] getMessagesGeneral()
protected final ExportPool getPool()
protected final long getProgress()
protected final long getTotalProgress()
public boolean isUseNewEnergySourceEnev2014Values()
protected void progressUpdated(long progress, long totalProgress)
This method may be overridden by inheriting classes in order to track the progress of the export process.
progress
- current progress valuetotalProgress
- total progress valueprotected void putContactMessage(String externalContactId, ExportMessage.Code code, String msg)
externalContactId
- external contact IDcode
- message codemsg
- message textprotected void putContactMessage(String externalContactId, ExportMessage.Code code, Messages msgs)
externalContactId
- external contact IDcode
- message codemsgs
- messages, that were received from the Webserviceprotected void putGeneralMessage(ExportMessage.Code code, String msg)
code
- message codemsg
- message textprotected void putGeneralMessage(ExportMessage.Code code, Messages msgs)
code
- message codemsgs
- messages, that were received from the Webserviceprotected void putObjectMessage(String externalObjectId, ExportMessage.Code code, String msg)
externalObjectId
- external real estate IDcode
- message codemsg
- message textprotected void putObjectMessage(String externalObjectId, ExportMessage.Code code, Messages msgs)
externalObjectId
- external real estate IDcode
- message codemsgs
- messages, that were received from the Webserviceprotected final void setProgress(long progress)
progress
- current progress valuepublic void setUseNewEnergySourceEnev2014Values(boolean useNewEnergySourceEnev2014Values)
useNewEnergySourceEnev2014Values
- enabled / disabledCopyright © 2014 OpenEstate. All rights reserved.