@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetUserResult == false) return false; GetUserResult other = (GetUserResult) obj; if (other.getUser() == null ^ this.getUser() == null) return false; if (other.getUser() != null && other.getUser().equals(this.getUser()) == false) return false; return true; }
public GetUserResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetUserResult getUserResult = new GetUserResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getUserResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("User", targetDepth)) { getUserResult.setUser(UserStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getUserResult; } } } }
setUser(user); return this;
setUser(user); return this;
public GetUserResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetUserResult getUserResult = new GetUserResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getUserResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("User", targetDepth)) { getUserResult.setUser(UserStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getUserResult; } } } }
/** * 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 (getUser() != null) sb.append("User: ").append(getUser()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetUserResult == false) return false; GetUserResult other = (GetUserResult) obj; if (other.getUser() == null ^ this.getUser() == null) return false; if (other.getUser() != null && other.getUser().equals(this.getUser()) == false) return false; return true; }
/** * 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 (getUser() != null) sb.append("User: ").append(getUser()); sb.append("}"); return sb.toString(); }
private User fetchAwsUser(String username) { User user = null; try { GetUserRequest r = new GetUserRequest().withUserName(username); GetUserResult ur = aim.getUser(r); user = ur.getUser(); } catch (NoSuchEntityException e) { log.error("User {} not found: {}", username, e.getMessage()); } return user; } }
arn = user.getUser().getArn(); } catch (AmazonServiceException e) { if (e.getErrorCode().compareTo("AccessDenied") == 0) {
user = client.getUser(new GetUserRequest().withUserName(username)).getUser();
/** * Unfortunately Amazon AWS mandates to use ARN notation to get the tags. Therefore we first need to get the account * number through the IAM service and then construct the ARN out of the account no and region * * @return the arn string used to query the tags */ private String getDbInstanceResourceName() { String userArn = this.identityManagement.getUser().getUser().getArn(); AmazonResourceName userResourceName = AmazonResourceName.fromString(userArn); AmazonResourceName dbResourceArn = new AmazonResourceName.Builder(). withService("rds"). withRegion(getRegion()). withAccount(userResourceName.getAccount()). withResourceType("db"). withResourceName(getDbInstanceIdentifier()). withResourceTypeDelimiter(":"). build(); return dbResourceArn.toString(); } }
/** * Unfortunately Amazon AWS mandates to use ARN notation to get the tags. Therefore we first need to get the account * number through the IAM service and then construct the ARN out of the account no and region * * @return the arn string used to query the tags */ private String getDbInstanceResourceName() { String userArn = this.identityManagement.getUser().getUser().getArn(); AmazonResourceName userResourceName = AmazonResourceName.fromString(userArn); AmazonResourceName dbResourceArn = new AmazonResourceName.Builder(). withService("rds"). withRegion(getRegion()). withAccount(userResourceName.getAccount()). withResourceType("db"). withResourceName(getDbInstanceIdentifier()). withResourceTypeDelimiter(":"). build(); return dbResourceArn.toString(); } }