Class AdbGraphClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class AdbGraphClient
    extends java.lang.Object
    implements java.lang.AutoCloseable
    ADB Graph Client. We recommend to close this
    • Constructor Detail

      • AdbGraphClient

        public AdbGraphClient​(AdbGraphClientConfiguration config)
        Creates a new ADB Graph Client.
        Parameters:
        config - the ADB Graph Client configuration.
    • Method Detail

      • isAttached

        public boolean isAttached()
        Checks if the Autonomous Database is currently attached to an environment.
        Returns:
        true if the Autonomous Database is currently attached to an environment. False otherwise.
      • startEnvironment

        public Job startEnvironment​(int memory)
        Starts attaching the Autonomous Database to a new environment.
        Parameters:
        memory - the amount of system memory (in gigabytes) to allocate on the attached environment.
        Returns:
        a Job which completes once attachment operation completes.
        Throws:
        java.lang.IllegalStateException - if the Autonomous Database is currently not in EnvironmentStatus.DETACHED state
      • stopEnvironment

        public Job stopEnvironment()
        Starts detaching the Autonomous Database from the current environment. Note: all in-memory data will be lost
        Returns:
        a Job which completes once detachment operation completes.
        Throws:
        java.lang.IllegalStateException - if the Autonomous Database is currently not in EnvironmentStatus.ATTACHED state
      • restartEnvironment

        public Job restartEnvironment()
        Starts re-attaching the Autonomous Database to a new environment.
        Returns:
        a Job which completes once re-attachment operation completes.
        Throws:
        java.lang.IllegalStateException - if the Autonomous Database is currently not in EnvironmentStatus.ATTACHED state
      • getCurrentMemory

        public double getCurrentMemory()
        Gets the current environment's allocated memory. Only returns the memory if environment is in attached status.
        Returns:
        the allocated memory for the currently attached environment. The results' units are in Gigabytes and in decimal format.
      • getAvailableMemory

        public double getAvailableMemory()
        Gets the available memory for environments to allocate. Only returns the memory if environment is in detached status.
        Returns:
        the available memory for the environments to allocate. The results' units are in Gigabytes and in decimal format.
      • close

        public void close()
        Closes this client object.
        Specified by:
        close in interface java.lang.AutoCloseable
      • getConfig

        public AdbGraphClientConfiguration getConfig()
        The configuration of this client.
        Returns:
        the configuration of this client.
      • getEndpoint

        public java.net.URI getEndpoint()
        The endpoint used by this client.
        Returns:
        the endpoint.