Class KEYCLOAK_JDBC_PING2

java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Discovery
org.jgroups.protocols.FILE_PING
org.jgroups.protocols.JDBC_PING2
org.keycloak.jgroups.protocol.KEYCLOAK_JDBC_PING2
All Implemented Interfaces:
org.jgroups.Lifecycle

public class KEYCLOAK_JDBC_PING2 extends org.jgroups.protocols.JDBC_PING2
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     

    Nested classes/interfaces inherited from class org.jgroups.protocols.FILE_PING

    org.jgroups.protocols.FILE_PING.InfoWriter

    Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery

    org.jgroups.protocols.Discovery.DiscoveryCacheDisseminationTask
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
     

    Fields inherited from class org.jgroups.protocols.JDBC_PING2

    call_insert_sp, clear_sql, connection_driver, connection_password, connection_url, connection_username, dataSource, datasource_injecter_class, datasource_jndi_name, delete_single_sql, initialize_sql, insert_single_sql, insert_sp, lock, select_all_pingdata_sql

    Fields inherited from class org.jgroups.protocols.FILE_PING

    filter, info_writer, info_writer_max_writes_after_view, info_writer_sleep_time, location, num_read_loops, read_sleep, reads, regexp, register_shutdown_hook, remove_all_data_on_view_change, remove_old_coords_on_view_change, root_dir, SUFFIX, update_store_on_view_change, write_data_on_find, writes

    Fields inherited from class org.jgroups.protocols.Discovery

    async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, view, WHITESPACE

    Fields inherited from class org.jgroups.stack.Protocol

    after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Connection
     
    protected void
    handleView(org.jgroups.View new_view, org.jgroups.View old_view, boolean coord_changed)
     
    Detects a network partition and decides if the node belongs to the winning partition.
    void
     
    protected void
    insert(Connection connection, org.jgroups.protocols.PingData data, String clustername)
     
    protected void
     
    protected List<org.jgroups.protocols.PingData>
    readFromDB(String cluster)
     
    protected void
     
    protected void
     
    void
     
    protected void
    The infowriter will run on the coordinator only.

    Methods inherited from class org.jgroups.protocols.JDBC_PING2

    assertNonNull, callInsertStoredProcedure, clearTable, createInsertStoredProcedure, createRootDir, createSchema, delete, delete, dump, findMembers, findMembersInitialDiscovery, getCallInsertSp, getClearSql, getConnectionDriver, getConnectionPassword, getConnectionUrl, getConnectionUsername, getDataSource, getDataSourceFromJNDI, getDatasourceInjecterClass, getDatasourceJndiName, getDeleteSingleSql, getInitializeSql, getInsertSingleSql, getInsertSp, getSelectAllPingdataSql, injectDataSource, isInfoWriterRunning, learnExistingAddresses, main, prepare, readAll, remove, removeAll, setCallInsertSp, setClearSql, setConnectionDriver, setConnectionPassword, setConnectionUrl, setConnectionUsername, setDataSource, setDatasourceInjecterClass, setDatasourceJndiName, setDeleteSingleSql, setInitializeSql, setInsertSingleSql, setInsertSp, setSelectAllPingdataSql, write, writeLocalAddress, writeToDB

    Methods inherited from class org.jgroups.protocols.FILE_PING

    addressToFilename, deleteFile, down, getInfoWriterMaxWritesAfterView, getInfoWriterSleepTime, getLocation, isDynamic, read, read, registerShutdownHook, registerShutdownHook, removeAllDataOnViewChange, removeAllDataOnViewChange, removeOldCoordsOnViewChange, removeOldCoordsOnViewChange, resetStats, setInfoWriterMaxWritesAfterView, setInfoWriterSleepTime, setLocation, stop, stopInfoWriter, updateStoreOnViewChange, updateStoreOnViewChange, write, writeAll, writeAll, writeDataOnFind, writeDataOnFind, writeInfo

    Methods inherited from class org.jgroups.protocols.Discovery

    addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, asyncDiscovery, asyncDiscovery, asyncDiscoveryUseSeparateThread, asyncDiscoveryUseSeparateThread, breakOnCoordResponse, breakOnCoordResponse, callFindMembersInAllDiscoveryProtocols, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, dumpCache, findInitialMembersAsString, findMembers, findTopmostDiscoveryProtocol, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handle, handleConnect, handleDisconnect, handleDiscoveryResponse, handleDiscoveryResponse, isCoord, isMergeRunning, marshal, marshal, marshal, maxRankToReply, maxRankToReply, print, providedUpServices, readPingData, returnEntireCache, returnEntireCache, sendCacheInformation, sendCacheOnJoin, sendCacheOnJoin, sendDiscoveryResponse, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, transportSupportsMulticasting, up, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses

    Methods inherited from class org.jgroups.stack.Protocol

    accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • staleness_timeout

      protected long staleness_timeout
  • Constructor Details

    • KEYCLOAK_JDBC_PING2

      public KEYCLOAK_JDBC_PING2()
  • Method Details

    • loadDriver

      protected void loadDriver()
      Overrides:
      loadDriver in class org.jgroups.protocols.JDBC_PING2
    • getConnection

      protected Connection getConnection() throws SQLException
      Overrides:
      getConnection in class org.jgroups.protocols.JDBC_PING2
      Throws:
      SQLException
    • init

      public void init() throws Exception
      Specified by:
      init in interface org.jgroups.Lifecycle
      Overrides:
      init in class org.jgroups.protocols.JDBC_PING2
      Throws:
      Exception
    • insert

      protected void insert(Connection connection, org.jgroups.protocols.PingData data, String clustername) throws SQLException
      Overrides:
      insert in class org.jgroups.protocols.JDBC_PING2
      Throws:
      SQLException
    • handleView

      protected void handleView(org.jgroups.View new_view, org.jgroups.View old_view, boolean coord_changed)
      Overrides:
      handleView in class org.jgroups.protocols.JDBC_PING2
    • removeAllNotInCurrentView

      protected void removeAllNotInCurrentView()
      Overrides:
      removeAllNotInCurrentView in class org.jgroups.protocols.JDBC_PING2
    • startInfoWriter

      protected void startInfoWriter()
      The infowriter will run on the coordinator only. It will continue to run while this is the coordinator, not only after the view change
      Overrides:
      startInfoWriter in class org.jgroups.protocols.FILE_PING
    • readFromDB

      protected List<org.jgroups.protocols.PingData> readFromDB(String cluster) throws Exception
      Overrides:
      readFromDB in class org.jgroups.protocols.JDBC_PING2
      Throws:
      Exception
    • removeStaleEntries

      protected void removeStaleEntries() throws Exception
      Throws:
      Exception
    • setJpaConnectionProviderFactory

      public void setJpaConnectionProviderFactory(JpaConnectionProviderFactory factory)
    • healthStatus

      public KEYCLOAK_JDBC_PING2.HealthStatus healthStatus()
      Detects a network partition and decides if the node belongs to the winning partition.

      The algorithm performs the following steps

      Returns:
      The KEYCLOAK_JDBC_PING2.HealthStatus.
      See Also: