Package de.hybris.platform.cluster
Class DefaultClusterNodeDAO
- java.lang.Object
-
- de.hybris.platform.cluster.DefaultClusterNodeDAO
-
- All Implemented Interfaces:
ClusterNodeDAO
public class DefaultClusterNodeDAO extends java.lang.Object implements ClusterNodeDAO
-
-
Constructor Summary
Constructors Constructor Description DefaultClusterNodeDAO(HybrisDataSource dataSource, long maxAllowedPingDelay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClusterNodeAcquisition
acquireNodeID(ClusterNodeInfo newInfoTemplate)
java.util.Collection<ClusterNodeInfo>
findAll()
java.util.Collection<ClusterNodeInfo>
findStaleNodes()
ClusterNodeInfo
get(int id)
protected java.lang.String
getCreateTableSQL(HybrisDataSource hds)
protected long
getLastLegalPingTS()
protected ClusterNodeInfo
getNextStaleNodeIDToReUse(java.util.Collection<ClusterNodeInfo> all)
protected int
getNextUnusedID(java.util.Collection<ClusterNodeInfo> all)
protected java.lang.String
getTableName(HybrisDataSource hds)
void
initializePersistence()
protected boolean
insert(int id, ClusterNodeInfo newInfoTemplate)
void
ping(int id)
boolean
remove(int id)
protected boolean
reset(ClusterNodeInfo toReset, ClusterNodeInfo ownTemplate, long newPingTS)
-
-
-
Constructor Detail
-
DefaultClusterNodeDAO
public DefaultClusterNodeDAO(HybrisDataSource dataSource, long maxAllowedPingDelay)
-
-
Method Detail
-
getTableName
protected java.lang.String getTableName(HybrisDataSource hds)
-
getCreateTableSQL
protected java.lang.String getCreateTableSQL(HybrisDataSource hds)
-
initializePersistence
public void initializePersistence()
- Specified by:
initializePersistence
in interfaceClusterNodeDAO
-
findAll
public java.util.Collection<ClusterNodeInfo> findAll()
- Specified by:
findAll
in interfaceClusterNodeDAO
-
findStaleNodes
public java.util.Collection<ClusterNodeInfo> findStaleNodes()
- Specified by:
findStaleNodes
in interfaceClusterNodeDAO
-
get
public ClusterNodeInfo get(int id)
- Specified by:
get
in interfaceClusterNodeDAO
-
remove
public boolean remove(int id)
- Specified by:
remove
in interfaceClusterNodeDAO
-
ping
public void ping(int id)
- Specified by:
ping
in interfaceClusterNodeDAO
-
acquireNodeID
public ClusterNodeAcquisition acquireNodeID(ClusterNodeInfo newInfoTemplate)
- Specified by:
acquireNodeID
in interfaceClusterNodeDAO
-
reset
protected boolean reset(ClusterNodeInfo toReset, ClusterNodeInfo ownTemplate, long newPingTS)
-
insert
protected boolean insert(int id, ClusterNodeInfo newInfoTemplate)
-
getNextStaleNodeIDToReUse
protected ClusterNodeInfo getNextStaleNodeIDToReUse(java.util.Collection<ClusterNodeInfo> all)
-
getLastLegalPingTS
protected long getLastLegalPingTS()
-
getNextUnusedID
protected int getNextUnusedID(java.util.Collection<ClusterNodeInfo> all)
-
-