Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions google-cloud-logging/clirr-ignored-differences.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- see http://www.mojohaus.org/clirr-maven-plugin/examples/ignored-differences.html -->
<differences>
<!-- TODO: remove after 2.0.0 released -->
<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/logging/v2/ConfigClient</className>
<method>* *(com.google.logging.v2.*Name*)</method>
<to>* *(com.google.logging.v2.*Name*)</to>
</difference>
<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/logging/v2/MetricsClient</className>
<method>* *LogMetric*(com.google.logging.v2.*Name*)</method>
<to>* *LogMetric*(com.google.logging.v2.*Name*)</to>
</difference>
<difference>
<differenceType>7005</differenceType>
<className>com/google/cloud/logging/v2/LoggingClient</className>
<method>* listLogs(com.google.logging.v2.ParentName)</method>
<to>* listLogs(com.google.logging.v2.ProjectName)</to>
</difference>
</differences>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.logging.v2.LogEntryOperation;
import com.google.logging.v2.LogEntrySourceLocation;
import com.google.logging.v2.ProjectLogName;
import com.google.logging.v2.LogName;
import com.google.protobuf.Timestamp;
import java.io.Serializable;
import java.util.HashMap;
Expand Down Expand Up @@ -466,7 +466,7 @@ com.google.logging.v2.LogEntry toPb(String projectId) {
com.google.logging.v2.LogEntry.Builder builder = payload.toPb();
builder.putAllLabels(labels);
if (logName != null) {
builder.setLogName(ProjectLogName.of(projectId, logName).toString());
builder.setLogName(LogName.ofProjectLogName(projectId, logName).toString());
}
if (resource != null) {
builder.setResource(resource.toPb());
Expand Down Expand Up @@ -525,7 +525,7 @@ static LogEntry fromPb(com.google.logging.v2.LogEntry entryPb) {
builder.setLabels(entryPb.getLabelsMap());
builder.setSeverity(Severity.fromPb(entryPb.getSeverity()));
if (!entryPb.getLogName().equals("")) {
builder.setLogName(ProjectLogName.parse(entryPb.getLogName()).getLog());
builder.setLogName(LogName.parse(entryPb.getLogName()).getLog());
}
if (!entryPb.getResource().equals(com.google.api.MonitoredResource.getDefaultInstance())) {
builder.setResource(MonitoredResource.fromPb(entryPb.getResource()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,7 @@
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.Uninterruptibles;
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.ProjectLogName;
import com.google.logging.v2.ProjectMetricName;
import com.google.logging.v2.ProjectName;
import com.google.logging.v2.ProjectSinkName;
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.logging.v2.*;
import com.google.protobuf.Empty;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -254,7 +232,9 @@ public Sink update(SinkInfo sink) {
public ApiFuture<Sink> updateAsync(SinkInfo sink) {
UpdateSinkRequest request =
UpdateSinkRequest.newBuilder()
.setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink.getName()).toString())
.setSinkName(
LogSinkName.ofProjectSinkName(getOptions().getProjectId(), sink.getName())
.toString())
.setSink(sink.toPb(getOptions().getProjectId()))
.build();
return transform(rpc.update(request), Sink.fromPbFunction(this));
Expand All @@ -269,7 +249,8 @@ public Sink getSink(String sink) {
public ApiFuture<Sink> getSinkAsync(String sink) {
GetSinkRequest request =
GetSinkRequest.newBuilder()
.setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink).toString())
.setSinkName(
LogSinkName.ofProjectSinkName(getOptions().getProjectId(), sink).toString())
.build();
return transform(rpc.get(request), Sink.fromPbFunction(this));
}
Expand Down Expand Up @@ -333,7 +314,8 @@ public boolean deleteSink(String sink) {
public ApiFuture<Boolean> deleteSinkAsync(String sink) {
DeleteSinkRequest request =
DeleteSinkRequest.newBuilder()
.setSinkName(ProjectSinkName.of(getOptions().getProjectId(), sink).toString())
.setSinkName(
LogSinkName.ofProjectSinkName(getOptions().getProjectId(), sink).toString())
.build();
return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION);
}
Expand All @@ -345,7 +327,7 @@ public boolean deleteLog(String log) {
public ApiFuture<Boolean> deleteLogAsync(String log) {
DeleteLogRequest request =
DeleteLogRequest.newBuilder()
.setLogName(ProjectLogName.of(getOptions().getProjectId(), log).toString())
.setLogName(LogName.ofProjectLogName(getOptions().getProjectId(), log).toString())
.build();
return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION);
}
Expand Down Expand Up @@ -441,7 +423,7 @@ public ApiFuture<Metric> updateAsync(MetricInfo metric) {
UpdateLogMetricRequest request =
UpdateLogMetricRequest.newBuilder()
.setMetricName(
ProjectMetricName.of(getOptions().getProjectId(), metric.getName()).toString())
LogMetricName.of(getOptions().getProjectId(), metric.getName()).toString())
.setMetric(metric.toPb())
.build();
return transform(rpc.update(request), Metric.fromPbFunction(this));
Expand All @@ -456,7 +438,7 @@ public Metric getMetric(String metric) {
public ApiFuture<Metric> getMetricAsync(String metric) {
GetLogMetricRequest request =
GetLogMetricRequest.newBuilder()
.setMetricName(ProjectMetricName.of(getOptions().getProjectId(), metric).toString())
.setMetricName(LogMetricName.of(getOptions().getProjectId(), metric).toString())
.build();
return transform(rpc.get(request), Metric.fromPbFunction(this));
}
Expand Down Expand Up @@ -520,7 +502,7 @@ public boolean deleteMetric(String metric) {
public ApiFuture<Boolean> deleteMetricAsync(String metric) {
DeleteLogMetricRequest request =
DeleteLogMetricRequest.newBuilder()
.setMetricName(ProjectMetricName.of(getOptions().getProjectId(), metric).toString())
.setMetricName(LogMetricName.of(getOptions().getProjectId(), metric).toString())
.build();
return transform(rpc.delete(request), EMPTY_TO_BOOLEAN_FUNCTION);
}
Expand All @@ -533,7 +515,7 @@ private static WriteLogEntriesRequest writeLogEntriesRequest(
WriteLogEntriesRequest.Builder builder = WriteLogEntriesRequest.newBuilder();
String logName = LOG_NAME.get(options);
if (logName != null) {
builder.setLogName(ProjectLogName.of(projectId, logName).toString());
builder.setLogName(LogName.ofProjectLogName(projectId, logName).toString());
}
MonitoredResource resource = RESOURCE.get(options);
if (resource != null) {
Expand Down
Loading