Class BSimServerInfo

java.lang.Object
ghidra.features.bsim.query.BSimServerInfo
All Implemented Interfaces:
Comparable<BSimServerInfo>

public class BSimServerInfo extends Object implements Comparable<BSimServerInfo>
  • Field Details

  • Constructor Details

  • Method Details

    • isWindowsFilePath

      public boolean isWindowsFilePath()
      Determine if this server info corresponds to Windows OS file path.
      Returns:
      true if this server info corresponds to Windows OS file path.
    • toURLString

      public String toURLString()
      Return BSim server info in URL format. Warning: If userinfo with password has been specified it will be returned in the URL.
      Returns:
      BSim server info in URL format
    • toURL

      public URL toURL() throws MalformedURLException
      Return BSim server info in URL. Warning: If userinfo with password has been specified it will be returned in the URL.
      Returns:
      BSim server info in URL
      Throws:
      MalformedURLException - if unable to form supported URL
    • getDBType

      public BSimServerInfo.DBType getDBType()
      Returns:
      BSim database type
    • setUserInfo

      public void setUserInfo(org.apache.commons.dbcp2.BasicDataSource bds)
    • hasPassword

      public boolean hasPassword()
      Determine if user information includes password. NOTE: Use of passwords with this object and URLs is discouraged.
      Returns:
      true if user information includes password which
    • hasDefaultLogin

      public boolean hasDefaultLogin()
      Determine if user info was stipulated during construction
      Returns:
      true if user info was stipulated during construction
    • getUserName

      public String getUserName()
      Get the remote database user name to be used when establishing a connection. User name obtained from the user information which was provided during instantiation.
      Returns:
      remote database user information (null for BSimServerInfo.DBType.file).
    • getUserInfo

      public String getUserInfo()
      Get the remote database user information to be used when establishing a connection.
      Returns:
      remote database user information (null for BSimServerInfo.DBType.file).
    • getServerName

      public String getServerName()
      Get the server hostname or IP address as originally specified.
      Returns:
      hostname or IP address as originally specified
    • getPort

      public int getPort()
      Get the port number.
      Returns:
      port number
    • getDBName

      public String getDBName()
      Get the DB Name
      Returns:
      DB name
    • getShortDBName

      public String getShortDBName()
      Get the DB Name. In the case of BSimServerInfo.DBType.file the directory path will be excluded from returned name.
      Returns:
      shortened DB Name
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFunctionDatabase

      public FunctionDatabase getFunctionDatabase(boolean async)
      Get a BSim FunctionDatabase instance which corresponds to this DB server info. The Closeable instance should be closed when no longer in-use to ensure that any associated database connection and resources are properly closed.
      Parameters:
      async - true if database commits should be asynchronous (may not be applicable)
      Returns:
      BSim function database instance
    • compareTo

      public int compareTo(BSimServerInfo o)
      Specified by:
      compareTo in interface Comparable<BSimServerInfo>