Exemplo n.º 1
0
 public Endpoint getResourceEndpoint(ResourceId resourceId) throws EndpointNotFoundException {
   checkNotNull(resourceId, "Resource identifier cannot be null");
   Endpoint endpoint = endpointRepository.endpointOfResource(resourceId);
   if (endpoint == null) {
     throw new EndpointNotFoundException(resourceId);
   }
   return endpoint;
 }
Exemplo n.º 2
0
 public Endpoint modifyResourceEndpoint(Resource resource, EntityTag entityTag, Date lastModified)
     throws EndpointNotFoundException {
   checkNotNull(resource, "ResourceSnapshot cannot be null");
   checkNotNull(entityTag, "Entity tag cannot be null");
   checkNotNull(lastModified, "Last modified cannot be null");
   Endpoint endpoint = endpointRepository.endpointOfResource(resource.id());
   if (endpoint == null) {
     throw new EndpointNotFoundException(resource.id());
   }
   endpoint.modify(entityTag, lastModified);
   return endpoint;
 }