com.amazonaws.services.xray.model.Service Maven / Gradle / Ivy
Show all versions of aws-java-sdk-xray Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.xray.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Information about an application that processed requests, users that made requests, or downstream services,
* resources, and applications that an application used.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Service implements Serializable, Cloneable, StructuredPojo {
/**
*
* Identifier for the service. Unique within the service map.
*
*/
private Integer referenceId;
/**
*
* The canonical name of the service.
*
*/
private String name;
/**
*
* A list of names for the service, including the canonical name.
*
*/
private java.util.List names;
/**
*
* Indicates that the service was the first service to process a request.
*
*/
private Boolean root;
/**
*
* Identifier of the Amazon Web Services account in which the service runs.
*
*/
private String accountId;
/**
*
* The type of service.
*
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or AWS::DynamoDB::Table
for
* an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example, AWS::DynamoDB
* for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
*
*/
private String type;
/**
*
* The service's state.
*
*/
private String state;
/**
*
* The start time of the first segment that the service generated.
*
*/
private java.util.Date startTime;
/**
*
* The end time of the last segment that the service generated.
*
*/
private java.util.Date endTime;
/**
*
* Connections to downstream services.
*
*/
private java.util.List edges;
/**
*
* Aggregated statistics for the service.
*
*/
private ServiceStatistics summaryStatistics;
/**
*
* A histogram that maps the spread of service durations.
*
*/
private java.util.List durationHistogram;
/**
*
* A histogram that maps the spread of service response times.
*
*/
private java.util.List responseTimeHistogram;
/**
*
* Identifier for the service. Unique within the service map.
*
*
* @param referenceId
* Identifier for the service. Unique within the service map.
*/
public void setReferenceId(Integer referenceId) {
this.referenceId = referenceId;
}
/**
*
* Identifier for the service. Unique within the service map.
*
*
* @return Identifier for the service. Unique within the service map.
*/
public Integer getReferenceId() {
return this.referenceId;
}
/**
*
* Identifier for the service. Unique within the service map.
*
*
* @param referenceId
* Identifier for the service. Unique within the service map.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withReferenceId(Integer referenceId) {
setReferenceId(referenceId);
return this;
}
/**
*
* The canonical name of the service.
*
*
* @param name
* The canonical name of the service.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The canonical name of the service.
*
*
* @return The canonical name of the service.
*/
public String getName() {
return this.name;
}
/**
*
* The canonical name of the service.
*
*
* @param name
* The canonical name of the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withName(String name) {
setName(name);
return this;
}
/**
*
* A list of names for the service, including the canonical name.
*
*
* @return A list of names for the service, including the canonical name.
*/
public java.util.List getNames() {
return names;
}
/**
*
* A list of names for the service, including the canonical name.
*
*
* @param names
* A list of names for the service, including the canonical name.
*/
public void setNames(java.util.Collection names) {
if (names == null) {
this.names = null;
return;
}
this.names = new java.util.ArrayList(names);
}
/**
*
* A list of names for the service, including the canonical name.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setNames(java.util.Collection)} or {@link #withNames(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param names
* A list of names for the service, including the canonical name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withNames(String... names) {
if (this.names == null) {
setNames(new java.util.ArrayList(names.length));
}
for (String ele : names) {
this.names.add(ele);
}
return this;
}
/**
*
* A list of names for the service, including the canonical name.
*
*
* @param names
* A list of names for the service, including the canonical name.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withNames(java.util.Collection names) {
setNames(names);
return this;
}
/**
*
* Indicates that the service was the first service to process a request.
*
*
* @param root
* Indicates that the service was the first service to process a request.
*/
public void setRoot(Boolean root) {
this.root = root;
}
/**
*
* Indicates that the service was the first service to process a request.
*
*
* @return Indicates that the service was the first service to process a request.
*/
public Boolean getRoot() {
return this.root;
}
/**
*
* Indicates that the service was the first service to process a request.
*
*
* @param root
* Indicates that the service was the first service to process a request.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withRoot(Boolean root) {
setRoot(root);
return this;
}
/**
*
* Indicates that the service was the first service to process a request.
*
*
* @return Indicates that the service was the first service to process a request.
*/
public Boolean isRoot() {
return this.root;
}
/**
*
* Identifier of the Amazon Web Services account in which the service runs.
*
*
* @param accountId
* Identifier of the Amazon Web Services account in which the service runs.
*/
public void setAccountId(String accountId) {
this.accountId = accountId;
}
/**
*
* Identifier of the Amazon Web Services account in which the service runs.
*
*
* @return Identifier of the Amazon Web Services account in which the service runs.
*/
public String getAccountId() {
return this.accountId;
}
/**
*
* Identifier of the Amazon Web Services account in which the service runs.
*
*
* @param accountId
* Identifier of the Amazon Web Services account in which the service runs.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withAccountId(String accountId) {
setAccountId(accountId);
return this;
}
/**
*
* The type of service.
*
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or AWS::DynamoDB::Table
for
* an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example, AWS::DynamoDB
* for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
*
*
* @param type
* The type of service.
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or
* AWS::DynamoDB::Table
for an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example,
* AWS::DynamoDB
for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of service.
*
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or AWS::DynamoDB::Table
for
* an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example, AWS::DynamoDB
* for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
*
*
* @return The type of service.
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or
* AWS::DynamoDB::Table
for an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example,
* AWS::DynamoDB
for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
*/
public String getType() {
return this.type;
}
/**
*
* The type of service.
*
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or AWS::DynamoDB::Table
for
* an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example, AWS::DynamoDB
* for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
*
*
* @param type
* The type of service.
*
* -
*
* Amazon Web Services Resource - The type of an Amazon Web Services resource. For example,
* AWS::EC2::Instance
for an application running on Amazon EC2 or
* AWS::DynamoDB::Table
for an Amazon DynamoDB table that the application used.
*
*
* -
*
* Amazon Web Services Service - The type of an Amazon Web Services service. For example,
* AWS::DynamoDB
for downstream calls to Amazon DynamoDB that didn't target a specific table.
*
*
* -
*
* client
- Represents the clients that sent requests to a root service.
*
*
* -
*
* remote
- A downstream service of indeterminate type.
*
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withType(String type) {
setType(type);
return this;
}
/**
*
* The service's state.
*
*
* @param state
* The service's state.
*/
public void setState(String state) {
this.state = state;
}
/**
*
* The service's state.
*
*
* @return The service's state.
*/
public String getState() {
return this.state;
}
/**
*
* The service's state.
*
*
* @param state
* The service's state.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withState(String state) {
setState(state);
return this;
}
/**
*
* The start time of the first segment that the service generated.
*
*
* @param startTime
* The start time of the first segment that the service generated.
*/
public void setStartTime(java.util.Date startTime) {
this.startTime = startTime;
}
/**
*
* The start time of the first segment that the service generated.
*
*
* @return The start time of the first segment that the service generated.
*/
public java.util.Date getStartTime() {
return this.startTime;
}
/**
*
* The start time of the first segment that the service generated.
*
*
* @param startTime
* The start time of the first segment that the service generated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withStartTime(java.util.Date startTime) {
setStartTime(startTime);
return this;
}
/**
*
* The end time of the last segment that the service generated.
*
*
* @param endTime
* The end time of the last segment that the service generated.
*/
public void setEndTime(java.util.Date endTime) {
this.endTime = endTime;
}
/**
*
* The end time of the last segment that the service generated.
*
*
* @return The end time of the last segment that the service generated.
*/
public java.util.Date getEndTime() {
return this.endTime;
}
/**
*
* The end time of the last segment that the service generated.
*
*
* @param endTime
* The end time of the last segment that the service generated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withEndTime(java.util.Date endTime) {
setEndTime(endTime);
return this;
}
/**
*
* Connections to downstream services.
*
*
* @return Connections to downstream services.
*/
public java.util.List getEdges() {
return edges;
}
/**
*
* Connections to downstream services.
*
*
* @param edges
* Connections to downstream services.
*/
public void setEdges(java.util.Collection edges) {
if (edges == null) {
this.edges = null;
return;
}
this.edges = new java.util.ArrayList(edges);
}
/**
*
* Connections to downstream services.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEdges(java.util.Collection)} or {@link #withEdges(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param edges
* Connections to downstream services.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withEdges(Edge... edges) {
if (this.edges == null) {
setEdges(new java.util.ArrayList(edges.length));
}
for (Edge ele : edges) {
this.edges.add(ele);
}
return this;
}
/**
*
* Connections to downstream services.
*
*
* @param edges
* Connections to downstream services.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withEdges(java.util.Collection edges) {
setEdges(edges);
return this;
}
/**
*
* Aggregated statistics for the service.
*
*
* @param summaryStatistics
* Aggregated statistics for the service.
*/
public void setSummaryStatistics(ServiceStatistics summaryStatistics) {
this.summaryStatistics = summaryStatistics;
}
/**
*
* Aggregated statistics for the service.
*
*
* @return Aggregated statistics for the service.
*/
public ServiceStatistics getSummaryStatistics() {
return this.summaryStatistics;
}
/**
*
* Aggregated statistics for the service.
*
*
* @param summaryStatistics
* Aggregated statistics for the service.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withSummaryStatistics(ServiceStatistics summaryStatistics) {
setSummaryStatistics(summaryStatistics);
return this;
}
/**
*
* A histogram that maps the spread of service durations.
*
*
* @return A histogram that maps the spread of service durations.
*/
public java.util.List getDurationHistogram() {
return durationHistogram;
}
/**
*
* A histogram that maps the spread of service durations.
*
*
* @param durationHistogram
* A histogram that maps the spread of service durations.
*/
public void setDurationHistogram(java.util.Collection durationHistogram) {
if (durationHistogram == null) {
this.durationHistogram = null;
return;
}
this.durationHistogram = new java.util.ArrayList(durationHistogram);
}
/**
*
* A histogram that maps the spread of service durations.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDurationHistogram(java.util.Collection)} or {@link #withDurationHistogram(java.util.Collection)} if
* you want to override the existing values.
*
*
* @param durationHistogram
* A histogram that maps the spread of service durations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withDurationHistogram(HistogramEntry... durationHistogram) {
if (this.durationHistogram == null) {
setDurationHistogram(new java.util.ArrayList(durationHistogram.length));
}
for (HistogramEntry ele : durationHistogram) {
this.durationHistogram.add(ele);
}
return this;
}
/**
*
* A histogram that maps the spread of service durations.
*
*
* @param durationHistogram
* A histogram that maps the spread of service durations.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withDurationHistogram(java.util.Collection durationHistogram) {
setDurationHistogram(durationHistogram);
return this;
}
/**
*
* A histogram that maps the spread of service response times.
*
*
* @return A histogram that maps the spread of service response times.
*/
public java.util.List getResponseTimeHistogram() {
return responseTimeHistogram;
}
/**
*
* A histogram that maps the spread of service response times.
*
*
* @param responseTimeHistogram
* A histogram that maps the spread of service response times.
*/
public void setResponseTimeHistogram(java.util.Collection responseTimeHistogram) {
if (responseTimeHistogram == null) {
this.responseTimeHistogram = null;
return;
}
this.responseTimeHistogram = new java.util.ArrayList(responseTimeHistogram);
}
/**
*
* A histogram that maps the spread of service response times.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setResponseTimeHistogram(java.util.Collection)} or
* {@link #withResponseTimeHistogram(java.util.Collection)} if you want to override the existing values.
*
*
* @param responseTimeHistogram
* A histogram that maps the spread of service response times.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withResponseTimeHistogram(HistogramEntry... responseTimeHistogram) {
if (this.responseTimeHistogram == null) {
setResponseTimeHistogram(new java.util.ArrayList(responseTimeHistogram.length));
}
for (HistogramEntry ele : responseTimeHistogram) {
this.responseTimeHistogram.add(ele);
}
return this;
}
/**
*
* A histogram that maps the spread of service response times.
*
*
* @param responseTimeHistogram
* A histogram that maps the spread of service response times.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Service withResponseTimeHistogram(java.util.Collection responseTimeHistogram) {
setResponseTimeHistogram(responseTimeHistogram);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getReferenceId() != null)
sb.append("ReferenceId: ").append(getReferenceId()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getNames() != null)
sb.append("Names: ").append(getNames()).append(",");
if (getRoot() != null)
sb.append("Root: ").append(getRoot()).append(",");
if (getAccountId() != null)
sb.append("AccountId: ").append(getAccountId()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getState() != null)
sb.append("State: ").append(getState()).append(",");
if (getStartTime() != null)
sb.append("StartTime: ").append(getStartTime()).append(",");
if (getEndTime() != null)
sb.append("EndTime: ").append(getEndTime()).append(",");
if (getEdges() != null)
sb.append("Edges: ").append(getEdges()).append(",");
if (getSummaryStatistics() != null)
sb.append("SummaryStatistics: ").append(getSummaryStatistics()).append(",");
if (getDurationHistogram() != null)
sb.append("DurationHistogram: ").append(getDurationHistogram()).append(",");
if (getResponseTimeHistogram() != null)
sb.append("ResponseTimeHistogram: ").append(getResponseTimeHistogram());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Service == false)
return false;
Service other = (Service) obj;
if (other.getReferenceId() == null ^ this.getReferenceId() == null)
return false;
if (other.getReferenceId() != null && other.getReferenceId().equals(this.getReferenceId()) == false)
return false;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getNames() == null ^ this.getNames() == null)
return false;
if (other.getNames() != null && other.getNames().equals(this.getNames()) == false)
return false;
if (other.getRoot() == null ^ this.getRoot() == null)
return false;
if (other.getRoot() != null && other.getRoot().equals(this.getRoot()) == false)
return false;
if (other.getAccountId() == null ^ this.getAccountId() == null)
return false;
if (other.getAccountId() != null && other.getAccountId().equals(this.getAccountId()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getState() == null ^ this.getState() == null)
return false;
if (other.getState() != null && other.getState().equals(this.getState()) == false)
return false;
if (other.getStartTime() == null ^ this.getStartTime() == null)
return false;
if (other.getStartTime() != null && other.getStartTime().equals(this.getStartTime()) == false)
return false;
if (other.getEndTime() == null ^ this.getEndTime() == null)
return false;
if (other.getEndTime() != null && other.getEndTime().equals(this.getEndTime()) == false)
return false;
if (other.getEdges() == null ^ this.getEdges() == null)
return false;
if (other.getEdges() != null && other.getEdges().equals(this.getEdges()) == false)
return false;
if (other.getSummaryStatistics() == null ^ this.getSummaryStatistics() == null)
return false;
if (other.getSummaryStatistics() != null && other.getSummaryStatistics().equals(this.getSummaryStatistics()) == false)
return false;
if (other.getDurationHistogram() == null ^ this.getDurationHistogram() == null)
return false;
if (other.getDurationHistogram() != null && other.getDurationHistogram().equals(this.getDurationHistogram()) == false)
return false;
if (other.getResponseTimeHistogram() == null ^ this.getResponseTimeHistogram() == null)
return false;
if (other.getResponseTimeHistogram() != null && other.getResponseTimeHistogram().equals(this.getResponseTimeHistogram()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getReferenceId() == null) ? 0 : getReferenceId().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getNames() == null) ? 0 : getNames().hashCode());
hashCode = prime * hashCode + ((getRoot() == null) ? 0 : getRoot().hashCode());
hashCode = prime * hashCode + ((getAccountId() == null) ? 0 : getAccountId().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
hashCode = prime * hashCode + ((getStartTime() == null) ? 0 : getStartTime().hashCode());
hashCode = prime * hashCode + ((getEndTime() == null) ? 0 : getEndTime().hashCode());
hashCode = prime * hashCode + ((getEdges() == null) ? 0 : getEdges().hashCode());
hashCode = prime * hashCode + ((getSummaryStatistics() == null) ? 0 : getSummaryStatistics().hashCode());
hashCode = prime * hashCode + ((getDurationHistogram() == null) ? 0 : getDurationHistogram().hashCode());
hashCode = prime * hashCode + ((getResponseTimeHistogram() == null) ? 0 : getResponseTimeHistogram().hashCode());
return hashCode;
}
@Override
public Service clone() {
try {
return (Service) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.xray.model.transform.ServiceMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}