com.tekann.webservice.client
Class DefaultDataHandler

java.lang.Object
  extended by com.tekann.webservice.client.DefaultDataHandler
All Implemented Interfaces:
IDataHandler

public class DefaultDataHandler
extends java.lang.Object
implements IDataHandler

Default implementation to manage data.

Author:
evandro

Constructor Summary
DefaultDataHandler()
           
 
Method Summary
 int deleteAllData(com.tekann.codegen.pda.db.IDAO[] daos)
          Clean table data.
 int deleteLoadedData(com.tekann.codegen.pda.db.IDAO[] daos, int rowStatus)
          Update data before RECEIVE action.
 totalcross.util.Vector loadData(com.tekann.codegen.pda.db.IDAO[] daos)
          Load data in tables.
 int saveData(totalcross.io.Stream scriptStream, java.lang.String creatorID)
          Save data from SQL script.
 int saveXMLData(totalcross.io.Stream xmlStream, java.lang.String creatorID)
          Save data from DTOs XML.
 int updateLoadedData(com.tekann.codegen.pda.db.IDAO[] daos, int rowStatus)
          Update data after load.
 int updateLoadedData(totalcross.util.Vector dtos, int rowStatus)
          Update dtos with row status given.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataHandler

public DefaultDataHandler()
Method Detail

loadData

public totalcross.util.Vector loadData(com.tekann.codegen.pda.db.IDAO[] daos)
                                throws java.lang.Exception
Description copied from interface: IDataHandler
Load data in tables.

Specified by:
loadData in interface IDataHandler
Parameters:
daos - Tables to load.
Returns:
Loaded DTOs.
Throws:
java.lang.Exception

saveData

public int saveData(totalcross.io.Stream scriptStream,
                    java.lang.String creatorID)
             throws java.lang.Exception
Description copied from interface: IDataHandler
Save data from SQL script.

Specified by:
saveData in interface IDataHandler
Parameters:
scriptStream - SQL script.
creatorID - ID to Litebase connection.
Throws:
java.lang.Exception

saveXMLData

public int saveXMLData(totalcross.io.Stream xmlStream,
                       java.lang.String creatorID)
                throws java.lang.Exception
Description copied from interface: IDataHandler
Save data from DTOs XML.

Specified by:
saveXMLData in interface IDataHandler
Parameters:
xmlStream - The XML file.
creatorID - ID to Litebase connection.
Throws:
java.lang.Exception

updateLoadedData

public int updateLoadedData(totalcross.util.Vector dtos,
                            int rowStatus)
                     throws java.lang.Exception
Description copied from interface: IDataHandler
Update dtos with row status given.

Specified by:
updateLoadedData in interface IDataHandler
Parameters:
dtos - to update
rowStatus - to set in dtos at attr column
Returns:
rows affected.
Throws:
java.lang.Exception

updateLoadedData

public int updateLoadedData(com.tekann.codegen.pda.db.IDAO[] daos,
                            int rowStatus)
                     throws java.lang.Exception
Description copied from interface: IDataHandler
Update data after load.

Specified by:
updateLoadedData in interface IDataHandler
Parameters:
daos - Tables to update data.
rowStatus - Status to update 'attr' column.
Returns:
Rows affected.
Throws:
java.lang.Exception

deleteLoadedData

public int deleteLoadedData(com.tekann.codegen.pda.db.IDAO[] daos,
                            int rowStatus)
                     throws java.lang.Exception
Description copied from interface: IDataHandler
Update data before RECEIVE action.

Specified by:
deleteLoadedData in interface IDataHandler
rowStatus - Row status to delete.
Returns:
Rows affected.
Throws:
java.lang.Exception

deleteAllData

public int deleteAllData(com.tekann.codegen.pda.db.IDAO[] daos)
                  throws java.lang.Exception
Description copied from interface: IDataHandler
Clean table data.

Specified by:
deleteAllData in interface IDataHandler
Parameters:
daos - Tables to clean.
Returns:
Rows affected.
Throws:
java.lang.Exception