/** * {@inheritDoc} */ @Override public final EntityTag entityTag() { return this.endpoint.entityTag(); }
/** * {@inheritDoc} */ @Override public final Status status() { Status result=Status.PUBLISHED; if(this.endpoint.deleted()!=null) { return Status.GONE; } return result; }
@Override public void propagate(EndpointLifecycleListener listener) { listener.endpointDeleted(endpoint); } }
public Endpoint deleteResourceEndpoint(Resource resource, Date deletionDate) throws EndpointNotFoundException { checkNotNull(resource,RESOURCE_CANNOT_BE_NULL); Endpoint endpoint = this.endpointRepository.endpointOfResource(resource.id()); if(endpoint==null) { throw new EndpointNotFoundException(resource.id()); } endpoint.delete(getModificationDate(endpoint,deletionDate)); this.listenerManager.notify(new EndpointDeletionNotification(endpoint)); return endpoint; }
@Override public void execute(EndpointRepository sut) { Endpoint endpoint = sut.endpointOfPath(ep1.path()); endpoint.delete(deleted); } }
@Override public void execute(EndpointRepository sut) { Endpoint legacyEndpointByPath = sut.endpointOfPath(ep1.path()); debug("Retrieving endpoint by path {%s} : %s",ep1.path(),legacyEndpointByPath); Endpoint endpointByPath = sut.endpointOfPath(path); debug("Retrieving endpoint by path {%s} : %s",path,endpointByPath); Endpoint endpointByResource = sut.endpointOfResource(resource.id()); debug("Retrieving endpoint by resource {%s} : %s",resource.id(),endpointByResource); } }
public Endpoint modifyResourceEndpoint(Resource resource, EntityTag entityTag, Date lastModified) throws EndpointNotFoundException { checkNotNull(resource,RESOURCE_CANNOT_BE_NULL); checkNotNull(entityTag,ENTITY_TAG_CANNOT_BE_NULL); checkNotNull(lastModified,LAST_MODIFIED_CANNOT_BE_NULL); Endpoint endpoint = this.endpointRepository.endpointOfResource(resource.id()); if(endpoint==null) { throw new EndpointNotFoundException(resource.id()); } endpoint. modify( entityTag, getModificationDate(endpoint,lastModified)); return endpoint; }
@Override public void execute(EndpointRepository sut) { Endpoint result = sut.endpointOfResource(ep1.resourceId()); System.out.println(result); } }
@Override public void execute(EndpointRepository sut) { Endpoint result = sut.endpointOfPath(ep1.path()); System.out.println(result); } }
@Override public void execute(EndpointRepository sut) { sut.add(ep1); } }
/** * {@inheritDoc} */ @Override public final String path() { return this.endpoint.path(); }
public Endpoint getResourceEndpoint(ResourceId resourceId) throws EndpointNotFoundException { checkNotNull(resourceId,RESOURCE_IDENTIFIER_CANNOT_BE_NULL); Endpoint endpoint = this.endpointRepository.endpointOfResource(resourceId); if(endpoint==null) { throw new EndpointNotFoundException(resourceId); } return endpoint; }
Endpoint resolveResource(ResourceId id) { return this.endpointRepository.endpointOfResource(id); }
public Endpoint createEndpointForResource(Resource resource, String relativePath, EntityTag entityTag, Date lastModified) throws EndpointCreationException { checkNotNull(resource,RESOURCE_CANNOT_BE_NULL); checkNotNull(entityTag,ENTITY_TAG_CANNOT_BE_NULL); checkNotNull(lastModified,LAST_MODIFIED_CANNOT_BE_NULL); Endpoint newEndpoint = createEndpoint(resource, relativePath, entityTag, lastModified); this.listenerManager.notify(new EndpointCreationNotification(newEndpoint)); return newEndpoint; }
@Override public void propagate(EndpointLifecycleListener listener) { listener.endpointCreated(endpoint); } }
public static ServiceBuilder<EndpointManagementService> serviceBuilder() { return new EndpointManagementServiceBuilder(); }
static PathBuilder create() { return new PathBuilder(); }
@Override public void execute(EndpointRepository sut) { sut.add(ep1); } }
@Override public void execute(EndpointRepository sut) { sut.add(ep2); } }
@Override public void execute(EndpointRepository sut) { sut.add(ep1); } }