com.amazonaws.services.lakeformation.model.QuerySessionContext Maven / Gradle / Ivy
Show all versions of aws-java-sdk-lakeformation 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.lakeformation.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* A structure used as a protocol between query engines and Lake Formation or Glue. Contains both a Lake Formation
* generated authorization identifier and information from the request's authorization context.
*
*
* @see AWS
* API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class QuerySessionContext implements Serializable, Cloneable, StructuredPojo {
/**
*
* A unique identifier generated by the query engine for the query.
*
*/
private String queryId;
/**
*
* A timestamp provided by the query engine for when the query started.
*
*/
private java.util.Date queryStartTime;
/**
*
* An identifier string for the consumer cluster.
*
*/
private String clusterId;
/**
*
* A cryptographically generated query identifier generated by Glue or Lake Formation.
*
*/
private String queryAuthorizationId;
/**
*
* An opaque string-string map passed by the query engine.
*
*/
private java.util.Map additionalContext;
/**
*
* A unique identifier generated by the query engine for the query.
*
*
* @param queryId
* A unique identifier generated by the query engine for the query.
*/
public void setQueryId(String queryId) {
this.queryId = queryId;
}
/**
*
* A unique identifier generated by the query engine for the query.
*
*
* @return A unique identifier generated by the query engine for the query.
*/
public String getQueryId() {
return this.queryId;
}
/**
*
* A unique identifier generated by the query engine for the query.
*
*
* @param queryId
* A unique identifier generated by the query engine for the query.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext withQueryId(String queryId) {
setQueryId(queryId);
return this;
}
/**
*
* A timestamp provided by the query engine for when the query started.
*
*
* @param queryStartTime
* A timestamp provided by the query engine for when the query started.
*/
public void setQueryStartTime(java.util.Date queryStartTime) {
this.queryStartTime = queryStartTime;
}
/**
*
* A timestamp provided by the query engine for when the query started.
*
*
* @return A timestamp provided by the query engine for when the query started.
*/
public java.util.Date getQueryStartTime() {
return this.queryStartTime;
}
/**
*
* A timestamp provided by the query engine for when the query started.
*
*
* @param queryStartTime
* A timestamp provided by the query engine for when the query started.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext withQueryStartTime(java.util.Date queryStartTime) {
setQueryStartTime(queryStartTime);
return this;
}
/**
*
* An identifier string for the consumer cluster.
*
*
* @param clusterId
* An identifier string for the consumer cluster.
*/
public void setClusterId(String clusterId) {
this.clusterId = clusterId;
}
/**
*
* An identifier string for the consumer cluster.
*
*
* @return An identifier string for the consumer cluster.
*/
public String getClusterId() {
return this.clusterId;
}
/**
*
* An identifier string for the consumer cluster.
*
*
* @param clusterId
* An identifier string for the consumer cluster.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext withClusterId(String clusterId) {
setClusterId(clusterId);
return this;
}
/**
*
* A cryptographically generated query identifier generated by Glue or Lake Formation.
*
*
* @param queryAuthorizationId
* A cryptographically generated query identifier generated by Glue or Lake Formation.
*/
public void setQueryAuthorizationId(String queryAuthorizationId) {
this.queryAuthorizationId = queryAuthorizationId;
}
/**
*
* A cryptographically generated query identifier generated by Glue or Lake Formation.
*
*
* @return A cryptographically generated query identifier generated by Glue or Lake Formation.
*/
public String getQueryAuthorizationId() {
return this.queryAuthorizationId;
}
/**
*
* A cryptographically generated query identifier generated by Glue or Lake Formation.
*
*
* @param queryAuthorizationId
* A cryptographically generated query identifier generated by Glue or Lake Formation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext withQueryAuthorizationId(String queryAuthorizationId) {
setQueryAuthorizationId(queryAuthorizationId);
return this;
}
/**
*
* An opaque string-string map passed by the query engine.
*
*
* @return An opaque string-string map passed by the query engine.
*/
public java.util.Map getAdditionalContext() {
return additionalContext;
}
/**
*
* An opaque string-string map passed by the query engine.
*
*
* @param additionalContext
* An opaque string-string map passed by the query engine.
*/
public void setAdditionalContext(java.util.Map additionalContext) {
this.additionalContext = additionalContext;
}
/**
*
* An opaque string-string map passed by the query engine.
*
*
* @param additionalContext
* An opaque string-string map passed by the query engine.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext withAdditionalContext(java.util.Map additionalContext) {
setAdditionalContext(additionalContext);
return this;
}
/**
* Add a single AdditionalContext entry
*
* @see QuerySessionContext#withAdditionalContext
* @returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext addAdditionalContextEntry(String key, String value) {
if (null == this.additionalContext) {
this.additionalContext = new java.util.HashMap();
}
if (this.additionalContext.containsKey(key))
throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided.");
this.additionalContext.put(key, value);
return this;
}
/**
* Removes all the entries added into AdditionalContext.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public QuerySessionContext clearAdditionalContextEntries() {
this.additionalContext = null;
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 (getQueryId() != null)
sb.append("QueryId: ").append(getQueryId()).append(",");
if (getQueryStartTime() != null)
sb.append("QueryStartTime: ").append(getQueryStartTime()).append(",");
if (getClusterId() != null)
sb.append("ClusterId: ").append(getClusterId()).append(",");
if (getQueryAuthorizationId() != null)
sb.append("QueryAuthorizationId: ").append(getQueryAuthorizationId()).append(",");
if (getAdditionalContext() != null)
sb.append("AdditionalContext: ").append(getAdditionalContext());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof QuerySessionContext == false)
return false;
QuerySessionContext other = (QuerySessionContext) obj;
if (other.getQueryId() == null ^ this.getQueryId() == null)
return false;
if (other.getQueryId() != null && other.getQueryId().equals(this.getQueryId()) == false)
return false;
if (other.getQueryStartTime() == null ^ this.getQueryStartTime() == null)
return false;
if (other.getQueryStartTime() != null && other.getQueryStartTime().equals(this.getQueryStartTime()) == false)
return false;
if (other.getClusterId() == null ^ this.getClusterId() == null)
return false;
if (other.getClusterId() != null && other.getClusterId().equals(this.getClusterId()) == false)
return false;
if (other.getQueryAuthorizationId() == null ^ this.getQueryAuthorizationId() == null)
return false;
if (other.getQueryAuthorizationId() != null && other.getQueryAuthorizationId().equals(this.getQueryAuthorizationId()) == false)
return false;
if (other.getAdditionalContext() == null ^ this.getAdditionalContext() == null)
return false;
if (other.getAdditionalContext() != null && other.getAdditionalContext().equals(this.getAdditionalContext()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getQueryId() == null) ? 0 : getQueryId().hashCode());
hashCode = prime * hashCode + ((getQueryStartTime() == null) ? 0 : getQueryStartTime().hashCode());
hashCode = prime * hashCode + ((getClusterId() == null) ? 0 : getClusterId().hashCode());
hashCode = prime * hashCode + ((getQueryAuthorizationId() == null) ? 0 : getQueryAuthorizationId().hashCode());
hashCode = prime * hashCode + ((getAdditionalContext() == null) ? 0 : getAdditionalContext().hashCode());
return hashCode;
}
@Override
public QuerySessionContext clone() {
try {
return (QuerySessionContext) 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.lakeformation.model.transform.QuerySessionContextMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}