@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAliasName() == null) ? 0 : getAliasName().hashCode()); hashCode = prime * hashCode + ((getAliasArn() == null) ? 0 : getAliasArn().hashCode()); hashCode = prime * hashCode + ((getTargetKeyId() == null) ? 0 : getTargetKeyId().hashCode()); return hashCode; }
public AliasListEntry unmarshall(JsonUnmarshallerContext context) throws Exception { AliasListEntry aliasListEntry = new AliasListEntry(); if (context.testExpression("AliasName", targetDepth)) { context.nextToken(); aliasListEntry.setAliasName(context.getUnmarshaller(String.class).unmarshall(context)); aliasListEntry.setAliasArn(context.getUnmarshaller(String.class).unmarshall(context)); aliasListEntry.setTargetKeyId(context.getUnmarshaller(String.class).unmarshall(context));
@Override public Set<Algorithm> call() throws BackgroundException { final AWSKMS client = client(container); try { final Map<String, String> aliases = new HashMap<String, String>(); for(AliasListEntry entry : client.listAliases().getAliases()) { aliases.put(entry.getTargetKeyId(), entry.getAliasName()); } final Set<Algorithm> keys = new HashSet<Algorithm>(); for(KeyListEntry entry : client.listKeys().getKeys()) { keys.add(new AliasedAlgorithm(entry, aliases.get(entry.getKeyId()))); } return keys; } catch(AmazonClientException e) { throw new AmazonServiceExceptionMappingService().map("Cannot read AWS KMS configuration", e); } finally { client.shutdown(); } } }, prompt));
/** * <p> * String that contains the alias. * </p> * * @param aliasName * String that contains the alias. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withAliasName(String aliasName) { setAliasName(aliasName); return this; }
/** * <p> * String that contains the key identifier referred to by the alias. * </p> * * @param targetKeyId * String that contains the key identifier referred to by the alias. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withTargetKeyId(String targetKeyId) { setTargetKeyId(targetKeyId); return this; }
/** * <p> * String that contains the key ARN. * </p> * * @param aliasArn * String that contains the key ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withAliasArn(String aliasArn) { setAliasArn(aliasArn); return this; }
if(key.getKeyId().equals(alias.getTargetKeyId())) { kmsKey.setAlias(alias); break;
/** * <p> * String that contains the alias. * </p> * * @param aliasName * String that contains the alias. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withAliasName(String aliasName) { setAliasName(aliasName); return this; }
/** * <p> * String that contains the key identifier referred to by the alias. * </p> * * @param targetKeyId * String that contains the key identifier referred to by the alias. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withTargetKeyId(String targetKeyId) { setTargetKeyId(targetKeyId); return this; }
/** * <p> * String that contains the key ARN. * </p> * * @param aliasArn * String that contains the key ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withAliasArn(String aliasArn) { setAliasArn(aliasArn); return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AliasListEntry == false) return false; AliasListEntry other = (AliasListEntry) obj; if (other.getAliasName() == null ^ this.getAliasName() == null) return false; if (other.getAliasName() != null && other.getAliasName().equals(this.getAliasName()) == false) return false; if (other.getAliasArn() == null ^ this.getAliasArn() == null) return false; if (other.getAliasArn() != null && other.getAliasArn().equals(this.getAliasArn()) == false) return false; if (other.getTargetKeyId() == null ^ this.getTargetKeyId() == null) return false; if (other.getTargetKeyId() != null && other.getTargetKeyId().equals(this.getTargetKeyId()) == false) return false; return true; }
public AliasListEntry unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } AliasListEntry aliasListEntry = new AliasListEntry(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("AliasName")) { aliasListEntry.setAliasName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("AliasArn")) { aliasListEntry.setAliasArn(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("TargetKeyId")) { aliasListEntry.setTargetKeyId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return aliasListEntry; }
/** * <p> * String that contains the alias. * </p> * * @param aliasName * String that contains the alias. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withAliasName(String aliasName) { setAliasName(aliasName); return this; }
/** * <p> * String that contains the key identifier referred to by the alias. * </p> * * @param targetKeyId * String that contains the key identifier referred to by the alias. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withTargetKeyId(String targetKeyId) { setTargetKeyId(targetKeyId); return this; }
/** * <p> * String that contains the key ARN. * </p> * * @param aliasArn * String that contains the key ARN. * @return Returns a reference to this object so that method calls can be chained together. */ public AliasListEntry withAliasArn(String aliasArn) { setAliasArn(aliasArn); 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 (getAliasName() != null) sb.append("AliasName: ").append(getAliasName()).append(","); if (getAliasArn() != null) sb.append("AliasArn: ").append(getAliasArn()).append(","); if (getTargetKeyId() != null) sb.append("TargetKeyId: ").append(getTargetKeyId()); sb.append("}"); return sb.toString(); }
public AliasListEntry unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } AliasListEntry aliasListEntry = new AliasListEntry(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("AliasName")) { aliasListEntry.setAliasName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("AliasArn")) { aliasListEntry.setAliasArn(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("TargetKeyId")) { aliasListEntry.setTargetKeyId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return aliasListEntry; }
/** * Marshall the given parameter object. */ public void marshall(AliasListEntry aliasListEntry, ProtocolMarshaller protocolMarshaller) { if (aliasListEntry == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(aliasListEntry.getAliasName(), ALIASNAME_BINDING); protocolMarshaller.marshall(aliasListEntry.getAliasArn(), ALIASARN_BINDING); protocolMarshaller.marshall(aliasListEntry.getTargetKeyId(), TARGETKEYID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
public AliasListEntry unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } AliasListEntry aliasListEntry = new AliasListEntry(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("AliasName")) { aliasListEntry.setAliasName(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("AliasArn")) { aliasListEntry.setAliasArn(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("TargetKeyId")) { aliasListEntry.setTargetKeyId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return aliasListEntry; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAliasName() == null) ? 0 : getAliasName().hashCode()); hashCode = prime * hashCode + ((getAliasArn() == null) ? 0 : getAliasArn().hashCode()); hashCode = prime * hashCode + ((getTargetKeyId() == null) ? 0 : getTargetKeyId().hashCode()); return hashCode; }