private void queueDelete( final EntityInvocationHandler handler, final ClientEntity entity, final PersistenceChanges changeset) { final URI deleteURI = entity.getEditLink() == null ? handler.getEntityURI() : entity.getEditLink(); changeset.addChange(buildDeleteRequest(deleteURI, handler.getETag()), handler); }
private void queueDelete( final EntityInvocationHandler handler, final ClientEntity entity, final PersistenceChanges changeset) { final URI deleteURI = entity.getEditLink() == null ? handler.getEntityURI() : entity.getEditLink(); changeset.addChange(buildDeleteRequest(deleteURI, handler.getETag()), handler); }
@Override public <E extends ClientEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest( final UpdateType type, final E entity) { if (entity.getEditLink() == null) { throw new IllegalArgumentException("No edit link found"); } final ODataEntityUpdateRequest<E> req; if (client.getConfiguration().isUseXHTTPMethod()) { req = new ODataEntityUpdateRequestImpl<E>(client, HttpMethod.POST, entity.getEditLink(), entity); req.setXHTTPMethod(type.getMethod().name()); } else { req = new ODataEntityUpdateRequestImpl<E>(client, type.getMethod(), entity.getEditLink(), entity); } return req; }
@Override public <E extends ClientEntity> ODataEntityUpdateRequest<E> getEntityUpdateRequest( final UpdateType type, final E entity) { if (entity.getEditLink() == null) { throw new IllegalArgumentException("No edit link found"); } final ODataEntityUpdateRequest<E> req; if (client.getConfiguration().isUseXHTTPMethod()) { req = new ODataEntityUpdateRequestImpl<E>(client, HttpMethod.POST, entity.getEditLink(), entity); req.setXHTTPMethod(type.getMethod().name()); } else { req = new ODataEntityUpdateRequestImpl<E>(client, type.getMethod(), entity.getEditLink(), entity); } return req; }
public EntityUUID updateUUID(final URI entitySetURI, final Class<?> type, final Object key) { this.uuid = new EntityUUID(entitySetURI, type, key); if (this.uri == null) { final URIBuilder uriBuilder = getEntity().getEditLink() == null ? CoreUtils.buildEditLink(getClient(), entitySetURI.toASCIIString(), key) : getClient().newURIBuilder(getEntity().getEditLink().toASCIIString()); this.uri = uriBuilder; this.baseURI = this.uri == null ? null : this.uri.build(); } return this.uuid; }
public EntityUUID updateUUID(final URI entitySetURI, final Class<?> type, final Object key) { this.uuid = new EntityUUID(entitySetURI, type, key); if (this.uri == null) { final URIBuilder uriBuilder = getEntity().getEditLink() == null ? CoreUtils.buildEditLink(getClient(), entitySetURI.toASCIIString(), key) : getClient().newURIBuilder(getEntity().getEditLink().toASCIIString()); this.uri = uriBuilder; this.baseURI = this.uri == null ? null : this.uri.build(); } return this.uuid; }
public static URI getMediaEditLink(final String name, final ClientEntity entity) { final ClientLink mediaEditLink = entity.getMediaEditLink(name); return mediaEditLink == null ? URIUtils.getURI(entity.getEditLink(), name) : mediaEditLink.getLink(); }
public static URI getMediaEditLink(final String name, final ClientEntity entity) { final ClientLink mediaEditLink = entity.getMediaEditLink(name); return mediaEditLink == null ? URIUtils.getURI(entity.getEditLink(), name) : mediaEditLink.getLink(); }
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); }
final URI editLink = target.getEntity().getEditLink(); ? URI.create("$" + startingPos) : URIUtils.getURI( service.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString()); queueUpdate(handler, targetURI, entity, changeset); posNumber++; : URIUtils.getURI( service.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString() + "/$value");
final URI editLink = target.getEntity().getEditLink(); ? URI.create("$" + startingPos) : URIUtils.getURI( service.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString()); queueUpdate(handler, targetURI, entity, changeset); posNumber++; : URIUtils.getURI( service.getClient().getServiceRoot(), handler.getEntity().getEditLink().toASCIIString() + "/$value");
sourceURI = URIUtils.getURI( service.getClient().getServiceRoot(), delayedUpdate.getSource().getEntity().getEditLink().toASCIIString()); } else { int sourcePos = items.get(delayedUpdate.getSource()); if (status == AttachedEntityStatus.CHANGED) { targetURI = URIUtils.getURI( service.getClient().getServiceRoot(), target.getEntity().getEditLink().toASCIIString()); } else { int targetPos = items.get(target); URI sourceURI = URIUtils.getURI( service.getClient().getServiceRoot(), delayedUpdate.getSource().getEntity().getEditLink().toASCIIString() + "/" + delayedUpdate.getSourceName() + "/$ref");
sourceURI = URIUtils.getURI( service.getClient().getServiceRoot(), delayedUpdate.getSource().getEntity().getEditLink().toASCIIString()); } else { int sourcePos = items.get(delayedUpdate.getSource()); if (status == AttachedEntityStatus.CHANGED) { targetURI = URIUtils.getURI( service.getClient().getServiceRoot(), target.getEntity().getEditLink().toASCIIString()); } else { int targetPos = items.get(target); URI sourceURI = URIUtils.getURI( service.getClient().getServiceRoot(), delayedUpdate.getSource().getEntity().getEditLink().toASCIIString() + "/" + delayedUpdate.getSourceName() + "/$ref");
final URI odataEditLink = odataEntity.getEditLink(); if (odataEditLink != null) { final Link editLink = new Link();
final URI odataEditLink = odataEntity.getEditLink(); if (odataEditLink != null) { final Link editLink = new Link();