private EntityInvocationHandler( final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, service); final String name = typeRef.getAnnotation(org.apache.olingo.ext.proxy.api.annotations.EntityType.class).name(); final String namespace = typeRef.getAnnotation(Namespace.class).value(); this.internal = service.getClient().getObjectFactory().newEntity(new FullQualifiedName(namespace, name)); ClientEntity.class.cast(this.internal).setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.uuid = new EntityUUID(null, typeRef, null); }
private EntityInvocationHandler( final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, service); final String name = typeRef.getAnnotation(org.apache.olingo.ext.proxy.api.annotations.EntityType.class).name(); final String namespace = typeRef.getAnnotation(Namespace.class).value(); this.internal = service.getClient().getObjectFactory().newEntity(new FullQualifiedName(namespace, name)); ClientEntity.class.cast(this.internal).setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.uuid = new EntityUUID(null, typeRef, null); }
private EntityInvocationHandler( final URI entityURI, final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, service); final String name = typeRef.getAnnotation(org.apache.olingo.ext.proxy.api.annotations.EntityType.class).name(); final String namespace = typeRef.getAnnotation(Namespace.class).value(); this.internal = service.getClient().getObjectFactory().newEntity(new FullQualifiedName(namespace, name)); ClientEntity.class.cast(this.internal).setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.baseURI = entityURI; this.uri = entityURI == null ? null : getClient().newURIBuilder(baseURI.toASCIIString()); this.uuid = new EntityUUID(null, typeRef, null); }
private EntityInvocationHandler( final ClientEntity entity, final URI entitySetURI, final URI entityURI, final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, entity, service); if (entityURI != null) { this.baseURI = entityURI; this.uri = getClient().newURIBuilder(baseURI.toASCIIString()); } else { this.baseURI = null; this.uri = null; } this.internal = entity; getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.uuid = new EntityUUID(entitySetURI, typeRef, null); }
private EntityInvocationHandler( final URI entityURI, final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, service); final String name = typeRef.getAnnotation(org.apache.olingo.ext.proxy.api.annotations.EntityType.class).name(); final String namespace = typeRef.getAnnotation(Namespace.class).value(); this.internal = service.getClient().getObjectFactory().newEntity(new FullQualifiedName(namespace, name)); ClientEntity.class.cast(this.internal).setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.baseURI = entityURI; this.uri = entityURI == null ? null : getClient().newURIBuilder(baseURI.toASCIIString()); this.uuid = new EntityUUID(null, typeRef, null); }
private EntityInvocationHandler( final ClientEntity entity, final URI entitySetURI, final URI entityURI, final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, entity, service); if (entityURI != null) { this.baseURI = entityURI; this.uri = getClient().newURIBuilder(baseURI.toASCIIString()); } else { this.baseURI = null; this.uri = null; } this.internal = entity; getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.uuid = new EntityUUID(entitySetURI, typeRef, null); }
public void setEntity(final ClientEntity entity) { this.internal = entity; getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); final Object key = CoreUtils.getKey(getClient(), this, typeRef, entity); this.uuid = new EntityUUID(getUUID().getEntitySetURI(), getUUID().getType(), key); // fix for OLINGO-353 if (this.uri == null) { final URIBuilder uriBuilder = entity.getEditLink() == null ? CoreUtils.buildEditLink(getClient(), getUUID().getEntitySetURI().toASCIIString(), key) : getClient().newURIBuilder(entity.getEditLink().toASCIIString()); this.uri = uriBuilder; this.baseURI = this.uri == null ? null : this.uri.build(); } this.streamedPropertyChanges.clear(); this.streamedPropertyCache.clear(); this.propertyChanges.clear(); this.propertyCache.clear(); this.linkChanges.clear(); this.linkCache.clear(); this.annotations.clear(); }
public void setEntity(final ClientEntity entity) { this.internal = entity; getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); final Object key = CoreUtils.getKey(getClient(), this, typeRef, entity); this.uuid = new EntityUUID(getUUID().getEntitySetURI(), getUUID().getType(), key); // fix for OLINGO-353 if (this.uri == null) { final URIBuilder uriBuilder = entity.getEditLink() == null ? CoreUtils.buildEditLink(getClient(), getUUID().getEntitySetURI().toASCIIString(), key) : getClient().newURIBuilder(entity.getEditLink().toASCIIString()); this.uri = uriBuilder; this.baseURI = this.uri == null ? null : this.uri.build(); } this.streamedPropertyChanges.clear(); this.streamedPropertyCache.clear(); this.propertyChanges.clear(); this.propertyCache.clear(); this.linkChanges.clear(); this.linkCache.clear(); this.annotations.clear(); }
private EntityInvocationHandler( final Object entityKey, final ClientEntity entity, final URI entitySetURI, final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, entity, service); final Object key = entityKey == null ? CoreUtils.getKey(getClient(), this, typeRef, entity) : entityKey; if (entity.getEditLink() != null) { this.baseURI = entity.getEditLink(); this.uri = getClient().newURIBuilder(baseURI.toASCIIString()); } else if (key != null) { final URIBuilder uriBuilder = CoreUtils.buildEditLink(getClient(), entitySetURI.toASCIIString(), key); this.uri = uriBuilder; this.baseURI = this.uri.build(); entity.setEditLink(this.baseURI); } else { this.baseURI = null; this.uri = null; } this.internal = entity; getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.uuid = new EntityUUID(entitySetURI, typeRef, key); }
private EntityInvocationHandler( final Object entityKey, final ClientEntity entity, final URI entitySetURI, final Class<?> typeRef, final AbstractService<?> service) { super(typeRef, entity, service); final Object key = entityKey == null ? CoreUtils.getKey(getClient(), this, typeRef, entity) : entityKey; if (entity.getEditLink() != null) { this.baseURI = entity.getEditLink(); this.uri = getClient().newURIBuilder(baseURI.toASCIIString()); } else if (key != null) { final URIBuilder uriBuilder = CoreUtils.buildEditLink(getClient(), entitySetURI.toASCIIString(), key); this.uri = uriBuilder; this.baseURI = this.uri.build(); entity.setEditLink(this.baseURI); } else { this.baseURI = null; this.uri = null; } this.internal = entity; getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream()); this.uuid = new EntityUUID(entitySetURI, typeRef, key); }
entity.setMediaEntity(true); entity.setMediaContentSource(URIUtils.getURI(base, resource.getPayload().getMediaContentSource())); entity.setMediaContentType(resource.getPayload().getMediaContentType());
entity.setMediaEntity(true); entity.setMediaContentSource(URIUtils.getURI(base, resource.getPayload().getMediaContentSource())); entity.setMediaContentType(resource.getPayload().getMediaContentType());