Package com.ngrok

Class Session.Builder

  • Enclosing interface:
    Session

    public static class Session.Builder
    extends Object
    A builder for creating a session
    • Method Detail

      • heartbeatInterval

        public Session.Builder heartbeatInterval​(Duration duration)
        Sets the heartbeat interval for this builder
        Parameters:
        duration - the interval duration
        Returns:
        the builder instance
      • heartbeatTolerance

        public Session.Builder heartbeatTolerance​(Duration duration)
        Sets the heartbeat tolerance for this builder
        Parameters:
        duration - the tolerance duration
        Returns:
        the builder instance
      • metadata

        public Session.Builder metadata​(String metadata)
        Sets the metadata for this builder
        Parameters:
        metadata - the metadata
        Returns:
        the builder instance
      • serverAddr

        public Session.Builder serverAddr​(String addr)
        Sets the server address for this builder
        Parameters:
        addr - the server address
        Returns:
        the builder instance
      • caCert

        public Session.Builder caCert​(byte[] data)
        Sets the ca certificate for this builder
        Parameters:
        data - the ca certificate
        Returns:
        the builder instance
      • stopCallback

        public Session.Builder stopCallback​(Session.CommandHandler callback)
        Sets the stop callback handler for this builder
        Parameters:
        callback - the stop callback
        Returns:
        the builder instance
      • restartCallback

        public Session.Builder restartCallback​(Session.CommandHandler callback)
        Sets the restart callback handler for this builder
        Parameters:
        callback - the restart callback
        Returns:
        the builder instance
      • updateCallback

        public Session.Builder updateCallback​(Session.CommandHandler callback)
        Sets the update callback handler for this builder
        Parameters:
        callback - the update callback
        Returns:
        the builder instance
      • heartbeatHandler

        public Session.Builder heartbeatHandler​(Session.HeartbeatHandler heartbeatHandler)
        Sets the heartbeat handler for this builder
        Parameters:
        heartbeatHandler - the heartbeat callback
        Returns:
        the builder instance
      • addClientInfo

        public Session.Builder addClientInfo​(String name,
                                             String version)
        Adds a client info to the list of client info objects for this builder
        Parameters:
        name - the client name
        version - the client version
        Returns:
        the builder instance
      • addClientInfo

        public Session.Builder addClientInfo​(String name,
                                             String version,
                                             String comments)
        Adds a client info to the list of client info objects for this builder
        Parameters:
        name - the client name
        version - the client version
        comments - the comments
        Returns:
        the builder instance
      • getAuthtoken

        public String getAuthtoken()
        Returns the ngrok authtoken associated with this builder.
        Returns:
        the authtoken
      • getHeartbeatInterval

        public Optional<Duration> getHeartbeatInterval()
        Returns the heartbeat interval for this builder
        Returns:
        the heartbeat interval
      • getHeartbeatTolerance

        public Optional<Duration> getHeartbeatTolerance()
        Returns the heartbeat tolerance for this builder
        Returns:
        the heartbeat tolerance
      • getMetadata

        public Optional<String> getMetadata()
        Returns the metadata for this builder.
        Returns:
        the metadata
      • getServerAddr

        public Optional<String> getServerAddr()
        Returns the server address for this builder.
        Returns:
        the server address
      • getCaCert

        public byte[] getCaCert()
        Returns the certificate for this builder.
        Returns:
        the certificate
      • stopCallback

        public Session.CommandHandler stopCallback()
        Returns the stop callback handler for this builder.
        Returns:
        the stop handler
      • restartCallback

        public Session.CommandHandler restartCallback()
        Returns the restart callback handler for this builder.
        Returns:
        the restart handler
      • updateCallback

        public Session.CommandHandler updateCallback()
        Returns the update callback handler for this builder.
        Returns:
        the update handler
      • heartbeatHandler

        public Session.HeartbeatHandler heartbeatHandler()
        Returns the heartbeat handler for this builder.
        Returns:
        the heartbeat handler
      • getClientInfos

        public List<Session.ClientInfo> getClientInfos()
        Returns the list of client info objects to add for this builder
        Returns:
        the list of client info objects