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()
Create 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)
Archivate a real estate object at the Webservice.
|
protected void |
doArchiveObject(RealEstate is24Object)
Archivate a real estate object at the Webservice.
|
protected void |
doArchiveObject(String externalObjectId)
Archivate a real estate object at the Webservice.
|
protected File |
doDownloadFile(URL url)
|
protected Map<Long,String> |
doListUntouchedObjects()
Return internal and external ID's of published real estates from the
Webservice, that were not changed during the current export process.
|
protected PublishChannels |
doLoadPublishChannels()
Return publish channels for the authorized agency.
|
protected void |
doPublishObject(long is24ObjectId,
String externalObjectId,
PublishChannels is24PublishChannels)
Publish a real estate at the Webservice.
|
protected void |
doRemoveObject(long is24ObjectId,
String externalObjectId)
Remove a real estate object from the Webservice.
|
protected void |
doRemoveObject(String externalObjectId)
Remove a real estate object from the Webservice.
|
protected Long |
doUpdateContact(RealtorContactDetails contact,
String poolContactId)
Save a contact person to the Webservice.
|
protected Long |
doUpdateObject(RealEstate object,
String poolObjectId)
Save a real estate to the Webservice.
|
ExportMessage[] |
export(AbstractClient client,
ExportPool pool,
boolean disableUnpublishedObjects,
boolean unpublishUntouchedObjects)
Start the bulk export of an
ExportPool . |
protected AbstractClient |
getClient()
Return the client of the current export process.
|
ExportMessage[] |
getMessages()
Return messages, that occured during the last export process.
|
ExportMessage[] |
getMessagesForContact(String externalContactId)
Return messages for a certain contact person, that occured during the last
export process.
|
ExportMessage[] |
getMessagesForObject(String externalObjectId)
Return messages for a certain real estate, that occured during the last
export process.
|
ExportMessage[] |
getMessagesGeneral()
Return general messages, that occured during the last export process.
|
protected ExportPool |
getPool()
Return the
ExportPool of the current export process. |
protected long |
getProgress()
Return the progress of the current export process.
|
protected long |
getTotalProgress()
Return the total progress of the current export process.
|
boolean |
isUseNewEnergySourceEnev2014Values()
Check, 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,
RequestFailedException ex)
Register error messages for a contact person.
|
protected void |
putContactMessage(String externalContactId,
ExportMessage.Code code,
String msg)
Register a message for a contact person.
|
protected void |
putContactMessage(String externalContactId,
ExportMessage.Code code,
String msg,
String errorRequestRefNumber)
Register a message for a contact person.
|
protected void |
putGeneralMessage(ExportMessage.Code code,
RequestFailedException ex)
Register general error messages.
|
protected void |
putGeneralMessage(ExportMessage.Code code,
String msg)
Register a general message.
|
protected void |
putGeneralMessage(ExportMessage.Code code,
String msg,
String errorRequestRefNumber)
Register a general message.
|
protected void |
putObjectMessage(String externalObjectId,
ExportMessage.Code code,
RequestFailedException ex)
Register error messages for a real estate.
|
protected void |
putObjectMessage(String externalObjectId,
ExportMessage.Code code,
String msg)
Register a message for a real estate.
|
protected void |
putObjectMessage(String externalObjectId,
ExportMessage.Code code,
String msg,
String errorRequestRefNumber)
Register a message for a real estate.
|
protected void |
setProgress(long progress)
Set the progress of the current export process.
|
void |
setUseNewEnergySourceEnev2014Values(boolean useNewEnergySourceEnev2014Values)
Enable / disable 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 doPublishObject(long is24ObjectId, String externalObjectId, PublishChannels is24PublishChannels) throws IOException
is24ObjectId
- real estate ID by IS24externalObjectId
- external real estate IDis24PublishChannels
- channels, where the real estate should be publishedIOException
- 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, String poolObjectId) throws IOException
object
- real estate to savepoolObjectId
- real estate ID within export poolIOException
- if the operation failedpublic ExportMessage[] export(AbstractClient client, ExportPool pool, boolean disableUnpublishedObjects, boolean unpublishUntouchedObjects) throws IOException
ExportPool
.client
- client, that is used for transferspool
- pool with exportable datadisableUnpublishedObjects
- disable 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()
ExportPool
of the current export process.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 final void putContactMessage(String externalContactId, ExportMessage.Code code, String msg)
externalContactId
- external contact IDcode
- message codemsg
- message textprotected void putContactMessage(String externalContactId, ExportMessage.Code code, String msg, String errorRequestRefNumber)
externalContactId
- external contact IDcode
- message codemsg
- message texterrorRequestRefNumber
- unique identifier of the failed HTTP requestprotected final void putContactMessage(String externalContactId, ExportMessage.Code code, RequestFailedException ex)
externalContactId
- external contact IDcode
- message codeex
- exception of the failed requestprotected final void putGeneralMessage(ExportMessage.Code code, String msg)
code
- message codemsg
- message textprotected void putGeneralMessage(ExportMessage.Code code, String msg, String errorRequestRefNumber)
code
- message codemsg
- message texterrorRequestRefNumber
- unique identifier of the failed HTTP requestprotected final void putGeneralMessage(ExportMessage.Code code, RequestFailedException ex)
code
- message codeex
- exception of the failed requestprotected final 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, String msg, String errorRequestRefNumber)
externalObjectId
- external real estate IDcode
- message codemsg
- message texterrorRequestRefNumber
- unique identifier of the failed HTTP requestprotected final void putObjectMessage(String externalObjectId, ExportMessage.Code code, RequestFailedException ex)
externalObjectId
- external real estate IDcode
- message codeex
- exception of the failed requestprotected final void setProgress(long progress)
progress
- current progress valuepublic void setUseNewEnergySourceEnev2014Values(boolean useNewEnergySourceEnev2014Values)
useNewEnergySourceEnev2014Values
- enabled / disabledCopyright © 2016 OpenEstate. All rights reserved.