@Override public Updater<Update, ResourceType> update() { return new Updater<>((u) -> new ResourceType(u.getName(), getPath(), getIdentityHash(), getContentHash(), getSyncHash(), u.getProperties())); }
@Override protected EntityAndPendingNotifications<BE, ResourceType> wireUpNewEntity(BE entity, ResourceType.Blueprint blueprint, CanonicalPath parentPath, BE parent, Transaction<BE> tx) { tx.update(entity, ResourceType.Update.builder().build()); ResourceType resourceType = new ResourceType(blueprint.getName(), parentPath.extend(ResourceType.SEGMENT_TYPE, tx.extractId(entity)).get(), null, null, null, blueprint.getProperties()); return new EntityAndPendingNotifications<>(entity, resourceType, emptyList()); }
/** * Provides an access interface for inspecting given resource type. * * @param resourceType the resource type to steer to. * @return the access interface to the resource type */ default ResourceTypes.Single inspect(ResourceType resourceType) throws EntityNotFoundException { return inspect(resourceType.getPath(), ResourceTypes.Single.class); }
break; case resourceType: e = new ResourceType(extractCanonicalPath(v), extractIdentityHash(v), extractContentHash(v), extractSyncHash(v)); break;
@Override public B visitResource(Resource resource, Void parameter) { //we don't want to have tenant ID and all that jazz influencing the hash, so always use //a relative path RelativePath resourceTypePath = resource.getType().getPath().relativeTo(resource.getPath()); return (B) fillCommon(resource, Resource.Blueprint.builder()) .withResourceTypePath(resourceTypePath.toString()).build(); }