Package ghidra.features.bsim.gui

# Class BSimServerManager

java.lang.Object
ghidra.features.bsim.gui.BSimServerManager

public class BSimServerManager extends Object
Managers BSim database server definitions and connections

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addListener(BSimServerManagerListener listener)`
  `void`
  `addServer(BSimServerInfo newServerInfo)`
  Add server to list.
  `static BSimJDBCDataSource`
  `getDataSource(BSimServerInfo serverInfo)`
  Convenience method to get a new or existing BSim JDBC datasource
  `static BSimJDBCDataSource`
  `getDataSourceIfExists(BSimServerInfo serverInfo)`
  Convenience method to get existing BSim JDBC datasource
  `Set<BSimServerInfo>`
  `getServerInfos()`
  Get list of defined servers.
  `void`
  `removeListener(BSimServerManagerListener listener)`
  `boolean`
  `removeServer(BSimServerInfo info, boolean force)`
  Remove BSim DB server from list.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### getServerInfos

    public Set<BSimServerInfo> getServerInfos()
    Get list of defined servers. Method must be invoked from swing thread only.
    Returns:
      list of defined servers

  - ### addServer

    public void addServer(BSimServerInfo newServerInfo)
    Add server to list. Method must be invoked from swing thread only.
    Parameters:
      `newServerInfo` - new BSim DB server

  - ### removeServer

    public boolean removeServer(BSimServerInfo info, boolean force)
    Remove BSim DB server from list. Method must be invoked from swing thread only. Specified server datasource will be dispose unless it is active or force is true.
    Parameters:
      `info` - BSim DB server to be removed
      `force` - true if server datasource should be disposed even when active.
    Returns:
      true if server disposed and removed from list

  - ### addListener

    public void addListener(BSimServerManagerListener listener)

  - ### removeListener

    public void removeListener(BSimServerManagerListener listener)

  - ### getDataSourceIfExists

    public static BSimJDBCDataSource getDataSourceIfExists(BSimServerInfo serverInfo)
    Convenience method to get existing BSim JDBC datasource
    Parameters:
      `serverInfo` - BSim DB server info
    Returns:
      BSim DB datasource or null if not instantiated or server does not support a `BSimJDBCDataSource`.

  - ### getDataSource

    public static BSimJDBCDataSource getDataSource(BSimServerInfo serverInfo)
    Convenience method to get a new or existing BSim JDBC datasource
    Parameters:
      `serverInfo` - BSim DB server info
    Returns:
      BSim DB datasource or null if server does not support a `BSimJDBCDataSource`.