All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.digitalcollections.cudami.lobid.client.LobidEventsClient Maven / Gradle / Ivy

There is a newer version: 8.0.3
Show newest version
package de.digitalcollections.cudami.lobid.client;

import com.fasterxml.jackson.databind.ObjectMapper;
import de.digitalcollections.cudami.lobid.client.mapper.Lobid2DCModelMapper;
import de.digitalcollections.lobid.model.LobidEvent;
import de.digitalcollections.model.exception.TechnicalException;
import de.digitalcollections.model.identifiable.entity.Event;
import java.net.http.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LobidEventsClient extends LobidBaseClient {

  private static final Logger LOGGER = LoggerFactory.getLogger(LobidEventsClient.class);

  LobidEventsClient(HttpClient http, String serverUrl, ObjectMapper mapper) {
    super(http, serverUrl, LobidEvent.class, mapper);
  }

  public Event getByGndId(String gndId) throws TechnicalException {
    LobidEvent lobidEvent = doGetRequestForObject(String.format("/gnd/%s.json", gndId));
    Event event = Lobid2DCModelMapper.mapToEvent(lobidEvent, null);
    return event;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy