Class ClientConnection

  • All Implemented Interfaces:
    java.lang.AutoCloseable, Connection

    public final class ClientConnection
    extends java.lang.Object
    implements Connection
    A Connection implementation that uses the Proton engine for AMQP protocol support.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void checkClosedOrFailed()  
      ClientInstance client()  
      void close()
      Requests a close of the Connection at the remote and waits until the Connection has been fully closed or until the configured ConnectionOptions.closeTimeout() is exceeded.
      void close​(ErrorCondition error)
      Requests a close of the Connection at the remote and waits until the Connection has been fully closed or until the configured ConnectionOptions.closeTimeout() is exceeded.
      java.util.concurrent.Future<Connection> closeAsync()
      Requests a close of the Connection at the remote and returns a Future that will be completed once the Connection has been fully closed.
      java.util.concurrent.Future<Connection> closeAsync​(ErrorCondition error)
      Requests a close of the Connection at the remote and returns a Future that will be completed once the Connection has been fully closed.
      Sender defaultSender()
      Returns the default anonymous sender used by this Connection for Connection.send(Message) calls.
      Session defaultSession()
      Returns the default Session instance that is used by this Connection to create the default anonymous connection Sender as well as creating those resources created from the Connection such as Sender and Receiver instances not married to a specific Session.
      java.lang.String[] desiredCapabilities()
      Returns the desired capabilities that the remote provided upon successfully opening the Connection.
      Receiver nextReceiver()
      Waits indefinitely for a receiver created from the connection default session to have a delivery ready for receipt.
      Receiver nextReceiver​(long timeout, java.util.concurrent.TimeUnit unit)
      Waits for the configured time interval for a receiver created from the connection default session to have a delivery ready for receipt.
      Receiver nextReceiver​(NextReceiverPolicy policy)
      Waits indefinitely for a receiver created from the connection default session to have a delivery ready for receipt.
      Receiver nextReceiver​(NextReceiverPolicy policy, long timeout, java.util.concurrent.TimeUnit unit)
      Waits for the configured time interval for a receiver created from the connection default session to have a delivery ready for receipt.
      java.lang.String[] offeredCapabilities()
      Returns the offered capabilities that the remote provided upon successfully opening the Connection.
      Sender openAnonymousSender()
      Creates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field.
      Sender openAnonymousSender​(SenderOptions senderOptions)
      Creates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field.
      Receiver openDurableReceiver​(java.lang.String address, java.lang.String subscriptionName)
      Creates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node.
      Receiver openDurableReceiver​(java.lang.String address, java.lang.String subscriptionName, ReceiverOptions receiverOptions)
      Creates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node.
      Receiver openDynamicReceiver()
      Creates a dynamic receiver used to consume messages from the given node address.
      Receiver openDynamicReceiver​(java.util.Map<java.lang.String,​java.lang.Object> dynamicNodeProperties)
      Creates a dynamic receiver used to consume messages from a dynamically generated node on the remote..
      Receiver openDynamicReceiver​(java.util.Map<java.lang.String,​java.lang.Object> dynamicNodeProperties, ReceiverOptions receiverOptions)
      Creates a dynamic receiver used to consume messages from the given node address.
      Receiver openDynamicReceiver​(ReceiverOptions receiverOptions)
      Creates a dynamic receiver used to consume messages from a dynamically generated node on the remote..
      java.util.concurrent.Future<Connection> openFuture()
      When a Connection is created it may not be opened on the remote peer, the future returned from this method allows the caller to await the completion of the Connection open by the remote before proceeding on to other messaging operations.
      Receiver openReceiver​(java.lang.String address)
      Creates a receiver used to consumer messages from the given node address.
      Receiver openReceiver​(java.lang.String address, ReceiverOptions receiverOptions)
      Creates a receiver used to consumer messages from the given node address.
      Sender openSender​(java.lang.String address)
      Creates a sender used to send messages to the given node address.
      Sender openSender​(java.lang.String address, SenderOptions senderOptions)
      Creates a sender used to send messages to the given node address.
      Session openSession()
      Creates a new Session instance for use by the client application.
      Session openSession​(SessionOptions sessionOptions)
      Creates a new Session instance for use by the client application.
      StreamReceiver openStreamReceiver​(java.lang.String address)
      Creates a streaming message receiver used to consume large messages from the given node address.
      StreamReceiver openStreamReceiver​(java.lang.String address, StreamReceiverOptions receiverOptions)
      Creates a streaming message receiver used to consume large messages from the given node address.
      StreamSender openStreamSender​(java.lang.String address)
      Creates a stream sender used to send large messages to the given node address.
      StreamSender openStreamSender​(java.lang.String address, StreamSenderOptions senderOptions)
      Creates a streaming sender used to send large messages to the given node address.
      java.util.Map<java.lang.String,​java.lang.Object> properties()
      Returns the properties that the remote provided upon successfully opening the Connection.
      Tracker send​(Message<?> message)
      Sends the given Message using the internal connection sender.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • openFuture

        public java.util.concurrent.Future<Connection> openFuture()
        Description copied from interface: Connection
        When a Connection is created it may not be opened on the remote peer, the future returned from this method allows the caller to await the completion of the Connection open by the remote before proceeding on to other messaging operations. If the open of the connection fails at the remote an Exception is thrown from the Future.get() method when called.
        Specified by:
        openFuture in interface Connection
        Returns:
        a Future that will be completed when the remote opens this Connection.
      • close

        public void close()
        Description copied from interface: Connection
        Requests a close of the Connection at the remote and waits until the Connection has been fully closed or until the configured ConnectionOptions.closeTimeout() is exceeded.
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface Connection
      • closeAsync

        public java.util.concurrent.Future<Connection> closeAsync()
        Description copied from interface: Connection
        Requests a close of the Connection at the remote and returns a Future that will be completed once the Connection has been fully closed.
        Specified by:
        closeAsync in interface Connection
        Returns:
        a Future that will be completed when the remote closes this Connection.
      • closeAsync

        public java.util.concurrent.Future<Connection> closeAsync​(ErrorCondition error)
        Description copied from interface: Connection
        Requests a close of the Connection at the remote and returns a Future that will be completed once the Connection has been fully closed.
        Specified by:
        closeAsync in interface Connection
        Parameters:
        error - The ErrorCondition to transmit to the remote along with the close operation.
        Returns:
        a Future that will be completed when the remote closes this Connection.
      • openSession

        public Session openSession()
                            throws ClientException
        Description copied from interface: Connection
        Creates a new Session instance for use by the client application. The returned session will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned Session may not have been opened on the remote when it is returned. Some methods of the Session can block until the remote fully opens the session, the user can wait for the remote to respond to the open request by calling the Session.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openSession in interface Connection
        Returns:
        a new Session instance.
        Throws:
        ClientException - if an internal error occurs.
      • openSession

        public Session openSession​(SessionOptions sessionOptions)
                            throws ClientException
        Description copied from interface: Connection
        Creates a new Session instance for use by the client application. The returned Session may not have been opened on the remote when it is returned. Some methods of the Session can block until the remote fully opens the session, the user can wait for the remote to respond to the open request by calling the Session.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openSession in interface Connection
        Parameters:
        sessionOptions - The SessionOptions that control properties of the created session.
        Returns:
        a new Session instance.
        Throws:
        ClientException - if an internal error occurs.
      • openReceiver

        public Receiver openReceiver​(java.lang.String address)
                              throws ClientException
        Description copied from interface: Connection
        Creates a receiver used to consumer messages from the given node address. The returned receiver will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openReceiver in interface Connection
        Parameters:
        address - The source address to attach the consumer to.
        Returns:
        the consumer.
        Throws:
        ClientException - if an internal error occurs.
      • openReceiver

        public Receiver openReceiver​(java.lang.String address,
                                     ReceiverOptions receiverOptions)
                              throws ClientException
        Description copied from interface: Connection
        Creates a receiver used to consumer messages from the given node address. The returned receiver will be configured using the options provided in the given ReceiverOptions instance. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openReceiver in interface Connection
        Parameters:
        address - The source address to attach the consumer to.
        receiverOptions - The options for this receiver.
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openDurableReceiver

        public Receiver openDurableReceiver​(java.lang.String address,
                                            java.lang.String subscriptionName)
                                     throws ClientException
        Description copied from interface: Connection
        Creates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node. The returned receiver will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openDurableReceiver in interface Connection
        Parameters:
        address - The source address to attach the consumer to.
        subscriptionName - The name to give the subscription (link name).
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openDurableReceiver

        public Receiver openDurableReceiver​(java.lang.String address,
                                            java.lang.String subscriptionName,
                                            ReceiverOptions receiverOptions)
                                     throws ClientException
        Description copied from interface: Connection
        Creates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node. The returned receiver will be configured using provided options. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openDurableReceiver in interface Connection
        Parameters:
        address - The source address to attach the consumer to.
        subscriptionName - The name to give the subscription (link name).
        receiverOptions - The options for this receiver.
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openDynamicReceiver

        public Receiver openDynamicReceiver()
                                     throws ClientException
        Description copied from interface: Connection
        Creates a dynamic receiver used to consume messages from the given node address. The returned receiver will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openDynamicReceiver in interface Connection
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openDynamicReceiver

        public Receiver openDynamicReceiver​(java.util.Map<java.lang.String,​java.lang.Object> dynamicNodeProperties)
                                     throws ClientException
        Description copied from interface: Connection
        Creates a dynamic receiver used to consume messages from a dynamically generated node on the remote.. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openDynamicReceiver in interface Connection
        Parameters:
        dynamicNodeProperties - The dynamic node properties to be applied to the node created by the remote.
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openDynamicReceiver

        public Receiver openDynamicReceiver​(ReceiverOptions receiverOptions)
                                     throws ClientException
        Description copied from interface: Connection
        Creates a dynamic receiver used to consume messages from a dynamically generated node on the remote.. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openDynamicReceiver in interface Connection
        Parameters:
        receiverOptions - The options for this receiver.
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openDynamicReceiver

        public Receiver openDynamicReceiver​(java.util.Map<java.lang.String,​java.lang.Object> dynamicNodeProperties,
                                            ReceiverOptions receiverOptions)
                                     throws ClientException
        Description copied from interface: Connection
        Creates a dynamic receiver used to consume messages from the given node address. The returned receiver may not have been opened on the remote when it is returned. Some methods of the Receiver can block until the remote fully opens the receiver, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openDynamicReceiver in interface Connection
        Parameters:
        dynamicNodeProperties - The dynamic node properties to be applied to the node created by the remote.
        receiverOptions - The options for this receiver.
        Returns:
        the newly created Receiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openStreamReceiver

        public StreamReceiver openStreamReceiver​(java.lang.String address)
                                          throws ClientException
        Description copied from interface: Connection
        Creates a streaming message receiver used to consume large messages from the given node address. The returned StreamReceiver will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned stream receiver may not have been opened on the remote when it is returned. Some methods of the StreamReceiver can block until the remote fully opens the receiver link, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openStreamReceiver in interface Connection
        Parameters:
        address - The source address to attach the consumer to.
        Returns:
        the newly created StreamReceiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openStreamReceiver

        public StreamReceiver openStreamReceiver​(java.lang.String address,
                                                 StreamReceiverOptions receiverOptions)
                                          throws ClientException
        Description copied from interface: Connection
        Creates a streaming message receiver used to consume large messages from the given node address. The returned receiver will be configured using the options provided in the given ReceiverOptions instance. The returned StreamReceiver may not have been opened on the remote when it is returned. Some methods of the StreamReceiver can block until the remote fully opens the receiver link, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openStreamReceiver in interface Connection
        Parameters:
        address - The source address to attach the consumer to.
        receiverOptions - The options for this receiver.
        Returns:
        the newly created StreamReceiver instance.
        Throws:
        ClientException - if an internal error occurs.
      • openSender

        public Sender openSender​(java.lang.String address)
                          throws ClientException
        Description copied from interface: Connection
        Creates a sender used to send messages to the given node address. The returned sender will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned Sender may not have been opened on the remote when it is returned. Some methods of the Sender can block until the remote fully opens the sender, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openSender in interface Connection
        Parameters:
        address - The target address to attach to, cannot be null.
        Returns:
        the sender.
        Throws:
        ClientException - if an internal error occurs.
      • openSender

        public Sender openSender​(java.lang.String address,
                                 SenderOptions senderOptions)
                          throws ClientException
        Description copied from interface: Connection
        Creates a sender used to send messages to the given node address. The returned Sender may not have been opened on the remote when it is returned. Some methods of the Sender can block until the remote fully opens the sender, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openSender in interface Connection
        Parameters:
        address - The target address to attach to, cannot be null.
        senderOptions - The options for this sender.
        Returns:
        the sender.
        Throws:
        ClientException - if an internal error occurs.
      • openAnonymousSender

        public Sender openAnonymousSender()
                                   throws ClientException
        Description copied from interface: Connection
        Creates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field. The returned sender will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned Sender may not have been opened on the remote when it is returned. Some methods of the Sender can block until the remote fully opens the sender, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openAnonymousSender in interface Connection
        Returns:
        the sender.
        Throws:
        ClientException - if an internal error occurs.
        ClientUnsupportedOperationException - if the remote did not signal support for anonymous relays.
      • openAnonymousSender

        public Sender openAnonymousSender​(SenderOptions senderOptions)
                                   throws ClientException
        Description copied from interface: Connection
        Creates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field. The returned Sender may not have been opened on the remote when it is returned. Some methods of the Sender can block until the remote fully opens the sender, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openAnonymousSender in interface Connection
        Parameters:
        senderOptions - The options for this sender.
        Returns:
        the sender.
        Throws:
        ClientException - if an internal error occurs.
        ClientUnsupportedOperationException - if the remote did not signal support for anonymous relays.
      • openStreamSender

        public StreamSender openStreamSender​(java.lang.String address)
                                      throws ClientException
        Description copied from interface: Connection
        Creates a stream sender used to send large messages to the given node address. The returned sender will be configured using default options and will take its timeout configuration values from those specified in the parent Connection. The returned StreamSender may not have been opened on the remote when it is returned. Some methods of the StreamSender can block until the remote fully opens the sender, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.
        Specified by:
        openStreamSender in interface Connection
        Parameters:
        address - The target address to attach to, cannot be null.
        Returns:
        the stream sender.
        Throws:
        ClientException - if an internal error occurs.
      • openStreamSender

        public StreamSender openStreamSender​(java.lang.String address,
                                             StreamSenderOptions senderOptions)
                                      throws ClientException
        Description copied from interface: Connection
        Creates a streaming sender used to send large messages to the given node address.

        The returned StreamSender may not have been opened on the remote when it is returned. Some methods of the StreamSender can block until the remote fully opens the sender, the user can wait for the remote to respond to the open request by calling the Link.openFuture() method and using the Future.get() methods to wait for completion.

        Specified by:
        openStreamSender in interface Connection
        Parameters:
        address - The target address to attach to, cannot be null.
        senderOptions - The options for this sender.
        Returns:
        the sender.
        Throws:
        ClientException - if an internal error occurs.
      • send

        public Tracker send​(Message<?> message)
                     throws ClientException
        Description copied from interface: Connection
        Sends the given Message using the internal connection sender.

        The connection Sender is an anonymous AMQP sender which requires that the given message has a valid to value set.

        Specified by:
        send in interface Connection
        Parameters:
        message - The message to send
        Returns:
        a Tracker that allows the client to track settlement of the message.
        Throws:
        ClientException - if an internal error occurs.
      • nextReceiver

        public Receiver nextReceiver()
                              throws ClientException
        Description copied from interface: Connection
        Waits indefinitely for a receiver created from the connection default session to have a delivery ready for receipt. The selection of the next receiver when more than one exists which has pending deliveries is based upon the configured value of the ConnectionOptions.defaultNextReceiverPolicy().
        Specified by:
        nextReceiver in interface Connection
        Returns:
        the next receiver that has a pending delivery available based on policy.
        Throws:
        ClientException - if an internal error occurs.
      • nextReceiver

        public Receiver nextReceiver​(long timeout,
                                     java.util.concurrent.TimeUnit unit)
                              throws ClientException
        Description copied from interface: Connection
        Waits for the configured time interval for a receiver created from the connection default session to have a delivery ready for receipt. The selection of the next receiver when more than one exists which has pending deliveries is based upon the configured value of the ConnectionOptions.defaultNextReceiverPolicy(). If no receiver has an incoming delivery before the given timeout expires the method returns null.
        Specified by:
        nextReceiver in interface Connection
        Parameters:
        timeout - The timeout value used to control how long the method waits for a new Delivery to be available.
        unit - The unit of time that the given timeout represents.
        Returns:
        the next receiver that has a pending delivery available based on policy or null if the timeout is reached.
        Throws:
        ClientException - if an internal error occurs.
      • nextReceiver

        public Receiver nextReceiver​(NextReceiverPolicy policy)
                              throws ClientException
        Description copied from interface: Connection
        Waits indefinitely for a receiver created from the connection default session to have a delivery ready for receipt. The selection of the next receiver when more than one exists which has pending deliveries is based upon the value of the NextReceiverPolicy that is provided by the caller.
        Specified by:
        nextReceiver in interface Connection
        Parameters:
        policy - The policy to apply when selecting the next receiver.
        Returns:
        the next receiver that has a pending delivery available based on policy.
        Throws:
        ClientException - if an internal error occurs.
      • nextReceiver

        public Receiver nextReceiver​(NextReceiverPolicy policy,
                                     long timeout,
                                     java.util.concurrent.TimeUnit unit)
                              throws ClientException
        Description copied from interface: Connection
        Waits for the configured time interval for a receiver created from the connection default session to have a delivery ready for receipt. The selection of the next receiver when more than one exists which has pending deliveries is based upon the NextReceiverPolicy provided by the caller. If no receiver has an incoming delivery before the given timeout expires the method returns null.
        Specified by:
        nextReceiver in interface Connection
        Parameters:
        policy - The policy to apply when selecting the next receiver.
        timeout - The timeout value used to control how long the method waits for a new Delivery to be available.
        unit - The unit of time that the given timeout represents.
        Returns:
        the next receiver that has a pending delivery available based on policy or null if the timeout is reached.
        Throws:
        ClientException - if an internal error occurs.
      • properties

        public java.util.Map<java.lang.String,​java.lang.Object> properties()
                                                                          throws ClientException
        Description copied from interface: Connection
        Returns the properties that the remote provided upon successfully opening the Connection. If the open has not completed yet this method will block to await the open response which carries the remote properties. If the remote provides no properties this method will return null.
        Specified by:
        properties in interface Connection
        Returns:
        any properties provided from the remote once the connection has successfully opened.
        Throws:
        ClientException - if an error occurs while obtaining the Connection remote properties.
      • offeredCapabilities

        public java.lang.String[] offeredCapabilities()
                                               throws ClientException
        Description copied from interface: Connection
        Returns the offered capabilities that the remote provided upon successfully opening the Connection. If the open has not completed yet this method will block to await the open response which carries the remote offered capabilities. If the remote provides no capabilities this method will return null.
        Specified by:
        offeredCapabilities in interface Connection
        Returns:
        any capabilities provided from the remote once the connection has successfully opened.
        Throws:
        ClientException - if an error occurs while obtaining the Connection remote offered capabilities.
      • desiredCapabilities

        public java.lang.String[] desiredCapabilities()
                                               throws ClientException
        Description copied from interface: Connection
        Returns the desired capabilities that the remote provided upon successfully opening the Connection. If the open has not completed yet this method will block to await the open response which carries the remote desired capabilities. If the remote provides no capabilities this method will return null.
        Specified by:
        desiredCapabilities in interface Connection
        Returns:
        any desired capabilities provided from the remote once the connection has successfully opened.
        Throws:
        ClientException - if an error occurs while obtaining the Connection remote desired capabilities.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object