use of org.restlet.data.Tag in project qi4j-sdk by Qi4j.
the class EntityResource method entityHeaders.
private Representation entityHeaders(Representation representation, EntityState entityState) {
representation.setModificationDate(new Date(entityState.lastModified()));
representation.setTag(new Tag("" + entityState.version()));
representation.setCharacterSet(CharacterSet.UTF_8);
representation.setLanguages(Collections.singletonList(Language.ENGLISH));
return representation;
}
use of org.restlet.data.Tag in project qi4j-sdk by Qi4j.
the class ResourceValidity method updateResponse.
public void updateResponse(Response response) {
if (entity != null) {
EntityState state = spi.entityStateOf(entity);
Date lastModified = new Date(state.lastModified());
Tag tag = new Tag(state.identity().identity() + "/" + state.version());
response.getEntity().setModificationDate(lastModified);
response.getEntity().setTag(tag);
}
}
use of org.restlet.data.Tag in project OpenAM by OpenRock.
the class ResourceSetRegistrationEndpoint method generateETag.
private Tag generateETag(ResourceSetDescription resourceSetDescription) {
int hashCode = resourceSetDescription.hashCode();
JsonValue description = resourceSetDescription.getDescription();
if (!description.isDefined(OAuth2Constants.ResourceSets.LABELS)) {
description.put(OAuth2Constants.ResourceSets.LABELS, null);
hashCode = resourceSetDescription.hashCode();
description.remove(OAuth2Constants.ResourceSets.LABELS);
}
return new Tag(Integer.toString(hashCode), true);
}
use of org.restlet.data.Tag in project OpenAM by OpenRock.
the class ResourceSetRegistrationEndpointTest method addCondition.
private void addCondition() {
Conditions conditions = new Conditions();
conditions.setMatch(Collections.singletonList(new Tag()));
given(endpoint.getConditions()).willReturn(conditions);
}
Aggregations