public class JGroupSender extends org.jgroups.ReceiverAdapter implements DistributableSenderInterface
| Modifier and Type | Field and Description |
|---|---|
protected DDBSEntityManager<DDBSEntity<DDBSEntityProperty>> |
ddbsEntityManager
DDBS Entity manager
|
| Constructor and Description |
|---|
JGroupSender(java.lang.String clusterName,
java.lang.String peerName)
Constructor of the sender
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(IEntity objectToAdd)
Add an object
|
void |
close()
Stop connections
|
void |
commit(DDBSTransaction transaction)
Commit a transaction
|
boolean |
createEntity(IEntity objectToCreate)
Create the structure of the entity
|
boolean |
delete(IEntity objectToDelete)
Delete an object
|
DDBSTransaction |
executeTransaction(DDBSTransaction transaction)
Execute a list of actions
|
java.util.List<Peer> |
getListPeers()
Get the list of peers
|
boolean |
isOpen()
Indicates if the object can send commands
|
<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 objects in a network
|
<T extends IEntity> |
loadArray(T objectToLoad,
java.lang.String field,
OrderBy orderBy)
Load an array
|
void |
open()
Open connections
|
<T extends IEntity> |
read(T object)
Read an object in the network
|
<T extends IEntity> |
readLastElement(T object)
Read the last element added
|
void |
rollback(DDBSTransaction transaction)
Rollback the transaction
|
void |
setAutoCommit(boolean isAutoCommit)
Set the auto-commit for the data source
|
void |
setTimeout(int timeout)
Set the maximum timeout of each request
|
boolean |
update(IEntity objectToUpdate)
Update an object
|
protected DDBSEntityManager<DDBSEntity<DDBSEntityProperty>> ddbsEntityManager
public JGroupSender(java.lang.String clusterName,
java.lang.String peerName)
clusterName - name of the clusterpeerName - name of the peerpublic java.util.List<Peer> getListPeers() throws java.lang.Exception
getListPeers in interface DistributableSenderInterfacejava.lang.Exception - Exceptionpublic void setTimeout(int timeout)
setTimeout in interface DistributableSenderInterfacetimeout - Timeout for this interfacepublic boolean isOpen()
isOpen in interface DistributableEntityManagerpublic void open()
throws DDBSToolkitException
open in interface DistributableEntityManagerDDBSToolkitException - DDBS Toolkit exceptionpublic void close()
close in interface DistributableEntityManagerpublic 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 <T extends IEntity> java.util.List<T> listAll(T object, Conditions conditions, OrderBy orderBy) throws DDBSToolkitException
listAll in interface DistributableEntityManagerT - IEntity extended entityobject - Object to searchconditions - Conditions to filter the resultsorderBy - Order By ObjectDDBSToolkitException - Error during the processpublic <T extends IEntity> java.util.List<T> listAllWithQueryString(T object, java.lang.String conditionQueryString, OrderBy orderBy) throws DDBSToolkitException
listAllWithQueryString in interface DistributableEntityManagerT - IEntity extended entityobject - Object to searchconditionQueryString - Conditions query stringorderBy - String to order the resultsDDBSToolkitException - DDBS Toolkit exceptionpublic <T extends IEntity> T read(T object) throws DDBSToolkitException
read in interface DistributableEntityManagerT - IEntity extended entityobject - object to readDDBSToolkitException - DDBS Toolkit exceptionpublic <T extends IEntity> T readLastElement(T object) throws DDBSToolkitException
readLastElement in interface DistributableEntityManagerT - IEntity extended entityobject - object to readDDBSToolkitException - DDBS Toolkit exceptionpublic boolean add(IEntity objectToAdd) throws DDBSToolkitException
add in interface UpdatableEntityManagerobjectToAdd - Add an object to the database or data sourceDDBSToolkitException - DDBS Toolkit exceptionpublic boolean update(IEntity objectToUpdate) throws DDBSToolkitException
update in interface UpdatableEntityManagerobjectToUpdate - Object to updateDDBSToolkitException - DDBS Toolkit exceptionpublic boolean delete(IEntity objectToDelete) throws DDBSToolkitException
delete in interface UpdatableEntityManagerobjectToDelete - Object to deleteDDBSToolkitException - DDBS Toolkit exceptionpublic 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
loadArray in interface DistributableEntityManagerT - IEntity extended entityobjectToLoad - Object to loadfield - Array to loadorderBy - order by fieldDDBSToolkitException - DDBS Toolkit exceptionpublic 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