Set<OperationDefinition> opDefList = resourceType.getOperationDefinitions();
List<OperationDefinitionRest> resultList = new ArrayList<OperationDefinitionRest>(opDefList.size());
for (OperationDefinition def : opDefList) {
putToCache(def.getId(),OperationDefinition.class,def);
OperationDefinitionRest odr = new OperationDefinitionRest();
odr.setId(def.getId());
odr.setName(def.getName());
copyParamsForDefinition(def,odr);
UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
uriBuilder.path("/operation/definition/{id}");
uriBuilder.queryParam("resourceId",resourceId);
Link createLink = new Link("create",uriBuilder.build(def.getId()).toString());
odr.addLink(createLink);
resultList.add(odr);
}
GenericEntity<List<OperationDefinitionRest>> entity = new GenericEntity<List<OperationDefinitionRest>>(resultList){};