systemic.sif.sbpframework.persist.servcie
Class SIFSyncService

java.lang.Object
  extended by systemic.sif.sbpframework.persist.servcie.DBService
      extended by systemic.sif.sbpframework.persist.servcie.SIFSyncService

public class SIFSyncService
extends DBService

Author:
Joerg Huber

Constructor Summary
SIFSyncService()
           
 
Method Summary
 BaseDAO getDAO()
           
 void markSIFZoneAsSyncedForObject(java.lang.String sifObjectName, java.lang.String agentId, java.lang.String zoneID)
          This method will try to retrieve the Sync Info for the given SIF Object and Zone.
 boolean requiresSyncForObjectInZone(java.lang.String sifObjectName, java.lang.String agentId, java.lang.String zoneID)
          This method check if the Sync table holds an entry for the SIF Object for the given Zone.
 
Methods inherited from class systemic.sif.sbpframework.persist.servcie.DBService
commit, loadSubObject, rollback, startTransaction
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SIFSyncService

public SIFSyncService()
Method Detail

getDAO

public BaseDAO getDAO()
Specified by:
getDAO in class DBService

markSIFZoneAsSyncedForObject

public void markSIFZoneAsSyncedForObject(java.lang.String sifObjectName,
                                         java.lang.String agentId,
                                         java.lang.String zoneID)
                                  throws java.lang.IllegalArgumentException,
                                         javax.persistence.PersistenceException
This method will try to retrieve the Sync Info for the given SIF Object and Zone. If it exists if will be updated with the latest date. If id doesn't exist it will insert it.

Parameters:
sifObjectName - The name of the SIF Object for which the ObjectZoneSync info shall be updated.
zoneID - The Zone ID for which the ObjectZoneSync info shall be updated.
Throws:
IllegalArgumentException: - sifObjectName or zoneID empty or null.
PersistenceException: - There is an issue with the underlying database. An error is logged.
java.lang.IllegalArgumentException
javax.persistence.PersistenceException

requiresSyncForObjectInZone

public boolean requiresSyncForObjectInZone(java.lang.String sifObjectName,
                                           java.lang.String agentId,
                                           java.lang.String zoneID)
                                    throws java.lang.IllegalArgumentException,
                                           javax.persistence.PersistenceException
This method check if the Sync table holds an entry for the SIF Object for the given Zone. If it doesn't hold an entry then TRUE (sync required) is returned otherwise FALSE (no sync required) is returned.

Parameters:
sifObjectName - The name of the SIF Object for which the ObjectZoneSync info shall be checked.
zoneID - The Zone ID for which the ObjectZoneSync info shall be checked.
Returns:
See description.
Throws:
IllegalArgumentException: - sifObjectName or zoneID empty or null.
PersistenceException: - There is an issue with the underlying database. An error is logged.
java.lang.IllegalArgumentException
javax.persistence.PersistenceException