@Override public <MT extends IBaseMetaType> MT metaGetOperation(Class<MT> theType, IIdType theId, RequestDetails theRequestDetails) { // Notify interceptors if (theRequestDetails != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); notifyInterceptors(RestOperationTypeEnum.META, requestDetails); } Set<TagDefinition> tagDefs = new HashSet<>(); BaseHasResource entity = readEntity(theId); for (BaseTag next : entity.getTags()) { tagDefs.add(next.getTag()); } MT retVal = toMetaDt(theType, tagDefs); retVal.setLastUpdated(entity.getUpdatedDate()); retVal.setVersionId(Long.toString(entity.getVersion())); return retVal; }
metaValue.setVersionId(theResource.getIdElement().getVersionIdPart());
protected void updateResourceMetadata(IBaseResourceEntity theEntity, IBaseResource theResource) { IIdType id = theEntity.getIdDt(); if (getContext().getVersion().getVersion().isRi()) { id = getContext().getVersion().newIdType().setValue(id.getValue()); } if (id.hasResourceType() == false) { id = id.withResourceType(theEntity.getResourceType()); } theResource.setId(id); if (theResource instanceof IResource) { ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, id.getVersionIdPart()); ResourceMetadataKeyEnum.UPDATED.put((IResource) theResource, theEntity.getUpdated()); } else { IBaseMetaType meta = theResource.getMeta(); meta.setVersionId(id.getVersionIdPart()); meta.setLastUpdated(theEntity.getUpdatedDate()); } }
res.getMeta().getSecurity().clear(); res.getMeta().setLastUpdated(null); res.getMeta().setVersionId(null);
@Override public <MT extends IBaseMetaType> MT metaGetOperation(Class<MT> theType, IIdType theId, RequestDetails theRequestDetails) { // Notify interceptors if (theRequestDetails != null) { ActionRequestDetails requestDetails = new ActionRequestDetails(theRequestDetails, getResourceName(), theId); notifyInterceptors(RestOperationTypeEnum.META, requestDetails); } Set<TagDefinition> tagDefs = new HashSet<>(); BaseHasResource entity = readEntity(theId); for (BaseTag next : entity.getTags()) { tagDefs.add(next.getTag()); } MT retVal = toMetaDt(theType, tagDefs); retVal.setLastUpdated(entity.getUpdatedDate()); retVal.setVersionId(Long.toString(entity.getVersion())); return retVal; }
metaValue.setVersionId(theResource.getIdElement().getVersionIdPart());
protected void updateResourceMetadata(IBaseResourceEntity theEntity, IBaseResource theResource) { IIdType id = theEntity.getIdDt(); if (getContext().getVersion().getVersion().isRi()) { id = getContext().getVersion().newIdType().setValue(id.getValue()); } if (id.hasResourceType() == false) { id = id.withResourceType(theEntity.getResourceType()); } theResource.setId(id); if (theResource instanceof IResource) { ResourceMetadataKeyEnum.VERSION.put((IResource) theResource, id.getVersionIdPart()); ResourceMetadataKeyEnum.UPDATED.put((IResource) theResource, theEntity.getUpdated()); } else { IBaseMetaType meta = theResource.getMeta(); meta.setVersionId(id.getVersionIdPart()); meta.setLastUpdated(theEntity.getUpdatedDate()); } }
res.getMeta().getSecurity().clear(); res.getMeta().setLastUpdated(null); res.getMeta().setVersionId(null);