Class Sink

    • Method Detail

      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class SinkInfo
      • getLogging

        public Logging getLogging()
        Returns the sinks's Logging object used to issue requests.
      • delete

        public boolean delete()
        Deletes this sink.

        Example of deleting the sink.

        
         boolean deleted = sink.delete();
         if (deleted) {
           // the sink was deleted
         } else {
           // the sink was not found
         }
         
        Returns:
        true if the sink was deleted, false if it was not found
        Throws:
        LoggingException - upon failure
      • deleteAsync

        public com.google.api.core.ApiFuture<Boolean> deleteAsync()
        Sends a request for deleting this sink. This method returns a ApiFuture object to consume the result. Future.get() returns true if the sink was deleted, false if it was not found.

        Example of asynchronously deleting the sink.

        
         ApiFuture<Boolean> future = sink.deleteAsync();
         // ...
         boolean deleted = future.get();
         if (deleted) {
           // the sink was deleted
         } else {
           // the sink was not found
         }
         
        Throws:
        LoggingException - upon failure
      • reload

        public Sink reload()
        Fetches current sink's latest information. Returns null if the sink does not exist.

        Example of getting the sink's latest information.

        
         Sink latestSink = sink.reload();
         if (latestSink == null) {
           // the sink was not found
         }
         
        Returns:
        a Sink object with latest information or null if not found
        Throws:
        LoggingException - upon failure
      • reloadAsync

        public com.google.api.core.ApiFuture<Sink> reloadAsync()
        Sends a request to fetch current sink's latest information. This method returns a ApiFuture object to consume the result. Future.get() returns a Sink object with latest information or null if not found.

        Example of asynchronously getting the sink's latest information.

        
         ApiFuture<Sink> future = sink.reloadAsync();
         // ...
         Sink latestSink = future.get();
         if (latestSink == null) {
           // the sink was not found
         }
         
        Throws:
        LoggingException - upon failure
      • update

        public Sink update()
        Updates current sink. If the sink does not exist, it is created.

        Example of updating the sink's information.

        
         Sink updatedSink = sink.toBuilder()
             .setFilter("severity<=ERROR")
             .build()
             .update();
         
        Returns:
        a Sink object with updated information
        Throws:
        LoggingException - upon failure
      • updateAsync

        public com.google.api.core.ApiFuture<Sink> updateAsync()
        Sends a request to update current sink. If the sink does not exist, it is created. This method returns a ApiFuture object to consume the result. Future.get() returns a Sink object with updated information.

        Example of asynchronously updating the sink's information.

        
         ApiFuture<Sink> future = sink.toBuilder()
             .setFilter("severity<=ERROR")
             .build()
             .updateAsync();
         // ...
         Sink updatedSink = future.get();
         
        Throws:
        LoggingException - upon failure