@JsonIgnore public String getETagValue() { Date etagDate = getLastChangeDate() == null ? getCreationDate() : getLastChangeDate(); return etagDate == null ? StringUtils.EMPTY : String.valueOf(etagDate.getTime()); }
add(new Label("creationDate", new Model<>(sysInfoTO.getCreationDate() != null ? SyncopeConsoleSession.get().getDateFormat().format(sysInfoTO.getCreationDate()) : ""))); add(new Label("lastChangeDate", new Model<>(sysInfoTO.getLastChangeDate() != null ? SyncopeConsoleSession.get().getDateFormat().format(sysInfoTO.getLastChangeDate()) : ""))); add(new Label("creator", new Model<>(sysInfoTO.getCreator() != null ? sysInfoTO.getCreator() : ""))); add(new Label("lastModifier", new Model<>(sysInfoTO.getLastModifier() != null ? sysInfoTO.getLastModifier() : "")));
@Override public int hashCode() { return new HashCodeBuilder(). appendSuper(super.hashCode()). append(key). append(type). append(realm). append(dynRealms). append(status). append(auxClasses). append(plainAttrs). append(derAttrs). append(virAttrs). append(resources). build(); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AnyTO other = (AnyTO) obj; return new EqualsBuilder(). appendSuper(super.equals(obj)). append(key, other.key). append(type, other.type). append(realm, other.realm). append(dynRealms, other.dynRealms). append(status, other.status). append(auxClasses, other.auxClasses). append(plainAttrs, other.plainAttrs). append(derAttrs, other.derAttrs). append(virAttrs, other.virAttrs). append(resources, other.resources). build(); } }
@Override public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException { if (resCtx.getEntityTag() == null) { AbstractAnnotatedBean annotated = null; if (resCtx.getEntity() instanceof AbstractAnnotatedBean) { annotated = (AbstractAnnotatedBean) resCtx.getEntity(); } else if (resCtx.getEntity() instanceof ProvisioningResult) { EntityTO entity = ((ProvisioningResult<?>) resCtx.getEntity()).getEntity(); if (entity instanceof AbstractAnnotatedBean) { annotated = (AbstractAnnotatedBean) entity; } } if (annotated != null) { String etagValue = annotated.getETagValue(); if (StringUtils.isNotBlank(etagValue)) { resCtx.getHeaders().add(HttpHeaders.ETAG, new EntityTag(etagValue).toString()); } } } } }
@Override public int hashCode() { return new HashCodeBuilder(). appendSuper(super.hashCode()). append(key). append(type). append(realm). append(dynRealms). append(status). append(auxClasses). append(plainAttrs). append(derAttrs). append(virAttrs). append(resources). build(); }
@Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final AnyTO other = (AnyTO) obj; return new EqualsBuilder(). appendSuper(super.equals(obj)). append(key, other.key). append(type, other.type). append(realm, other.realm). append(dynRealms, other.dynRealms). append(status, other.status). append(auxClasses, other.auxClasses). append(plainAttrs, other.plainAttrs). append(derAttrs, other.derAttrs). append(virAttrs, other.virAttrs). append(resources, other.resources). build(); } }
@JsonIgnore public String getETagValue() { Date etagDate = getLastChangeDate() == null ? getCreationDate() : getLastChangeDate(); return etagDate == null ? StringUtils.EMPTY : String.valueOf(etagDate.getTime()); }