class ResourceLookupContextStrategy implements
        ContextManagementStrategy<ClientResourceLookup, ClientResourceLookup>,
        ContextQueryExecutor<Object, ClientResourceLookup>, GenericTypeMetadataBuilder<ClientResourceLookup>,
        ContextParametrizedMetadataBuilder<ClientResourceLookup, Object> {

    protected ClientResource getFullClientResource(ClientResourceLookup resourceLookup){
        ClientResource clientResource = null;
        if(resourceLookup != null){
            if (resourceLookup.getUri() == null) {
                throw new MandatoryParameterNotFoundException("uri");
            }
            if(profileAttributesResolver.containsAttribute(resourceLookup.getUri())){
                throw new IllegalParameterValueException("uri", resourceLookup.getUri());
            }
            Resource repositoryResource = null;
            try {
                String uri = resourceLookup.getUri();
                // Check if URI is valid before fetching it
                if (uri.isEmpty() || !uri.startsWith(Folder.SEPARATOR)) {
                    throw new ReferencedResourceNotFoundException(resourceLookup.getUri(), "uri");
                }
                repositoryResource = repository
                        .getResource(ExecutionContextImpl.getRuntimeExecutionContext(), resourceLookup.getUri());
            } catch (AccessDeniedException e) {
                throw new ReferencedResourceAccessDeniedException(resourceLookup.getUri(), "uri");
            }
            if(repositoryResource != null) {
                String clientType = resourceLookup.getResourceType();
                ToClientConverter<? super Resource, ? extends ClientResource, ToClientConversionOptions> toClientConverter;
                if (clientType != null) {
                    toClientConverter = resourceConverterProvider.getToClientConverter(repositoryResource.getResourceType(), clientType);
                } else {
                    toClientConverter = resourceConverterProvider.getToClientConverter(repositoryResource.getResourceType());
                    clientType = toClientConverter.getClientResourceType();
                }
                if (contextsManager.getContextDescriptionClass(clientType) == null) {
                    // this client type isn't supported. Let's fail here
                    throw new ResourceTypeNotSupportedException(clientType);
                }

                clientResource = toClientConverter
                        .toClient(repositoryResource, getToClientConversionOptionsForFullResource());
            } else {
                throw new ReferencedResourceNotFoundException(resourceLookup.getUri(), "uri");
            }
        }
        return clientResource;
    }

}