All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.logging.spi.LoggingRpc Maven / Gradle / Ivy

There is a newer version: 0.2.8
Show newest version
/*
 * Copyright 2016 Google Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.logging.spi;

import com.google.logging.v2.CreateLogMetricRequest;
import com.google.logging.v2.CreateSinkRequest;
import com.google.logging.v2.DeleteLogMetricRequest;
import com.google.logging.v2.DeleteLogRequest;
import com.google.logging.v2.DeleteSinkRequest;
import com.google.logging.v2.GetLogMetricRequest;
import com.google.logging.v2.GetSinkRequest;
import com.google.logging.v2.ListLogEntriesRequest;
import com.google.logging.v2.ListLogEntriesResponse;
import com.google.logging.v2.ListLogMetricsRequest;
import com.google.logging.v2.ListLogMetricsResponse;
import com.google.logging.v2.ListMonitoredResourceDescriptorsRequest;
import com.google.logging.v2.ListMonitoredResourceDescriptorsResponse;
import com.google.logging.v2.ListSinksRequest;
import com.google.logging.v2.ListSinksResponse;
import com.google.logging.v2.LogMetric;
import com.google.logging.v2.LogSink;
import com.google.logging.v2.UpdateLogMetricRequest;
import com.google.logging.v2.UpdateSinkRequest;
import com.google.logging.v2.WriteLogEntriesRequest;
import com.google.logging.v2.WriteLogEntriesResponse;
import com.google.protobuf.Empty;

import java.util.concurrent.Future;

public interface LoggingRpc extends AutoCloseable {

  /**
   * Sends a request to create a sink. This method returns a {@code Future} object to consume the
   * result. {@link Future#get()} returns the created sink.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future create(CreateSinkRequest request);

  /**
   * Sends a request to update a sink. If the sink does not exist, it is created. This method
   * returns a {@code Future} object to consume the result. {@link Future#get()} returns the updated
   * or created sink.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future update(UpdateSinkRequest request);

  /**
   * Sends a request to get a sink. This method returns a {@code Future} object to consume the
   * result. {@link Future#get()} returns the requested sink or {@code null} if not found.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future get(GetSinkRequest request);

  /**
   * Sends a request to list the sinks in a project. This method returns a {@code Future} object to
   * consume the result. {@link Future#get()} returns a response object containing the listing
   * result.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future list(ListSinksRequest request);

  /**
   * Sends a request to delete a sink. This method returns a {@code Future} object to consume the
   * result. {@link Future#get()} returns {@link Empty#getDefaultInstance()} or {@code null} if the
   * sink was not found.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future delete(DeleteSinkRequest request);

  /**
   * Sends a request to deletes a log. This method returns a {@code Future} object to consume the
   * result. {@link Future#get()} returns {@link Empty#getDefaultInstance()} or {@code null} if the
   * log was not found. The deleted log will reappear if it receives new log entries.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future delete(DeleteLogRequest request);

  /**
   * Sends a request to write log entries to Stackdriver Logging. This method returns a
   * {@code Future} object to consume the result. {@link Future#get()} returns a response object for
   * the write operation.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future write(WriteLogEntriesRequest request);

  /**
   * Sends a request to list log entries. Use this method to retrieve log entries from Cloud
   * Logging. This method returns a {@code Future} object to consume the result.
   * {@link Future#get()} returns a response object containing the listing result.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future list(ListLogEntriesRequest request);

  /**
   * Sends a request to list monitored resource descriptors. This method returns a {@code Future}
   * object to consume the result. {@link Future#get()} returns a response object containing the
   * listing result.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future list(
      ListMonitoredResourceDescriptorsRequest request);

  /**
   * Sends a request to create a log metric. This method returns a {@code Future} object to consume
   * the result. {@link Future#get()} returns the created metric.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future create(CreateLogMetricRequest request);

  /**
   * Sends a request to update a log metric. If the log metric does not exist, it is created. This
   * method returns a {@code Future} object to consume the result. {@link Future#get()} returns the
   * updated or created log metric.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future update(UpdateLogMetricRequest request);

  /**
   * Sends a request to get a log metric. This method returns a {@code Future} object to consume the
   * result. {@link Future#get()} returns the requested log metric or {@code null} if not found.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future get(GetLogMetricRequest request);

  /**
   * Sends a request to list the log metrics in a project. This method returns a {@code Future}
   * object to consume the result. {@link Future#get()} returns a response object containing the
   * listing result.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future list(ListLogMetricsRequest request);

  /**
   * Sends a request to delete a log metric. This method returns a {@code Future} object to consume
   * the result. {@link Future#get()} returns {@link Empty#getDefaultInstance()} or {@code null} if
   * the log was not found.
   *
   * @param request the request object containing all of the parameters for the API call
   */
  Future delete(DeleteLogMetricRequest request);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy