public class SqlSpacesSender extends java.lang.Object implements DistributableSenderInterface
| Modifier and Type | Field and Description | 
|---|---|
protected DDBSEntityManager<DDBSEntity<DDBSEntityProperty>> | 
ddbsEntityManager
DDBS Entity manager 
 | 
| Constructor and Description | 
|---|
SqlSpacesSender(java.lang.String clusterName,
               java.lang.String peerName)
Create a SqlSpaces Sender using localhost server 
 | 
SqlSpacesSender(java.lang.String clusterName,
               java.lang.String peerName,
               java.lang.String ipAddress,
               int port)
Create a SqlSpaces Sender using an external server 
 | 
| Modifier and Type | Method and Description | 
|---|---|
boolean | 
add(IEntity objectToAdd)
Add an element to a data source 
 | 
void | 
close()
Close the data source connection 
 | 
void | 
commit(DDBSTransaction transaction)
Commit a transaction 
 | 
boolean | 
createEntity(IEntity objectToCreate)
Create the structure of the entity 
 | 
boolean | 
delete(IEntity objectToDelete)
Delete an object in a data source 
 | 
DDBSTransaction | 
executeTransaction(DDBSTransaction transaction)
Execute a list of actions 
 | 
java.util.List<Peer> | 
getListPeers()
Get the list of peers 
 | 
boolean | 
isOpen()
Check if the connection is open 
 | 
<T extends IEntity> | 
listAll(T object,
       Conditions conditions,
       OrderBy orderBy)
List all entities of a specific object 
 | 
<T extends IEntity> | 
listAllWithQueryString(T object,
                      java.lang.String conditionQueryString,
                      OrderBy orderBy)
List all entities of a specific object 
 | 
<T extends IEntity> | 
loadArray(T objectToLoad,
         java.lang.String field,
         OrderBy orderBy)
Load a property of the object corresponding to an array 
 | 
void | 
open()
Open the data source connection 
 | 
<T extends IEntity> | 
read(T object)
Read details about an object 
 | 
<T extends IEntity> | 
readLastElement(T object)
Read the last element added of a table or a type of data source (Id annotation has to be used) 
 | 
void | 
rollback(DDBSTransaction transaction)
Rollback the transaction 
 | 
void | 
setAutoCommit(boolean isAutoCommit)
Set the auto-commit for the data source 
 | 
void | 
setTimeout(int timeout)
Set a timeout 
 | 
boolean | 
update(IEntity objectToUpdate)
Update an element in a data source 
 | 
protected DDBSEntityManager<DDBSEntity<DDBSEntityProperty>> ddbsEntityManager
public SqlSpacesSender(java.lang.String clusterName,
                       java.lang.String peerName)
clusterName - Name of the clusterpeerName - Name of the peerpublic SqlSpacesSender(java.lang.String clusterName,
                       java.lang.String peerName,
                       java.lang.String ipAddress,
                       int port)
clusterName - Name of the clusterpeerName - Name of the peeripAddress - Ip address of the SQLSpaces Serverport - Port of the SQLSpaces Serverpublic boolean isOpen()
DistributableEntityManagerisOpen in interface DistributableEntityManagerpublic void setTimeout(int timeout)
DistributableSenderInterfacesetTimeout in interface DistributableSenderInterfacetimeout - Timeout for this interfacepublic void open()
          throws DDBSToolkitException
DistributableEntityManageropen in interface DistributableEntityManagerDDBSToolkitException - : Error to open the connectionpublic void close()
           throws DDBSToolkitException
DistributableEntityManagerclose in interface DistributableEntityManagerDDBSToolkitException - : Error to close the connectionpublic <T extends IEntity> java.util.List<T> listAllWithQueryString(T object, java.lang.String conditionQueryString, OrderBy orderBy) throws DDBSToolkitException
DistributableEntityManagerlistAllWithQueryString in interface DistributableEntityManagerT - IEntity extended entityobject - Object to searchconditionQueryString - Condition query string to filter the resultsorderBy - Order By ObjectDDBSToolkitException - Error during the processpublic <T extends IEntity> T read(T object) throws DDBSToolkitException
DistributableEntityManagerread in interface DistributableEntityManagerT - IEntity extended entityobject - object to readDDBSToolkitException - Error during readingpublic <T extends IEntity> T readLastElement(T object) throws DDBSToolkitException
DistributableEntityManagerreadLastElement in interface DistributableEntityManagerT - IEntity extended entityobject - object to readDDBSToolkitException - Error during readingpublic boolean add(IEntity objectToAdd) throws DDBSToolkitException
UpdatableEntityManageradd in interface UpdatableEntityManagerobjectToAdd - Object to add in a data sourceDDBSToolkitException - Problem during operationpublic boolean update(IEntity objectToUpdate) throws DDBSToolkitException
UpdatableEntityManagerupdate in interface UpdatableEntityManagerobjectToUpdate - Object to updateDDBSToolkitException - Problem during operationpublic boolean delete(IEntity objectToDelete) throws DDBSToolkitException
UpdatableEntityManagerdelete in interface UpdatableEntityManagerobjectToDelete - Object to deleteDDBSToolkitException - Problem during operationpublic boolean createEntity(IEntity objectToCreate) throws DDBSToolkitException
UpdatableEntityManagercreateEntity in interface UpdatableEntityManagerobjectToCreate - Object to createDDBSToolkitException - Problem during operationpublic <T extends IEntity> T loadArray(T objectToLoad, java.lang.String field, OrderBy orderBy) throws DDBSToolkitException
DistributableEntityManagerloadArray in interface DistributableEntityManagerT - IEntity extended entityobjectToLoad - Object to loadfield - Array to loadorderBy - Order By ObjectDDBSToolkitException - Problem during operationpublic java.util.List<Peer> getListPeers() throws java.lang.Exception
DistributableSenderInterfacegetListPeers in interface DistributableSenderInterfacejava.lang.Exception - Error occuring when retrieving the list of peerspublic <T extends IEntity> java.util.List<T> listAll(T object, Conditions conditions, OrderBy orderBy) throws DDBSToolkitException
DistributableEntityManagerlistAll in interface DistributableEntityManagerT - IEntity extended entityobject - Object to searchconditions - Conditions to filter the resultsorderBy - Order By ObjectDDBSToolkitException - Error during the processpublic void setAutoCommit(boolean isAutoCommit)
                   throws DDBSToolkitException
DistributableEntityManagersetAutoCommit in interface DistributableEntityManagerisAutoCommit - Boolean returning if there is auto-commit in the transactionDDBSToolkitException - : Error to set the auto-commit valuepublic void commit(DDBSTransaction transaction) throws DDBSToolkitException
DistributableEntityManagercommit in interface DistributableEntityManagertransaction - TransactionDDBSToolkitException - : Error to commit the transactionpublic void rollback(DDBSTransaction transaction) throws DDBSToolkitException
DistributableEntityManagerrollback in interface DistributableEntityManagertransaction - TransactionDDBSToolkitException - : Error to rollback the connectionpublic DDBSTransaction executeTransaction(DDBSTransaction transaction) throws DDBSToolkitException
DistributableEntityManagerexecuteTransaction in interface DistributableEntityManagertransaction - List of commandsDDBSToolkitException - : Error to execute the transaction