use of com.bakdata.conquery.models.messages.namespaces.specific.UpdateSecondaryId in project conquery by bakdata.
the class AdminDatasetProcessor method addSecondaryId.
/**
* Add SecondaryId if it doesn't already exist.
*/
public synchronized void addSecondaryId(Namespace namespace, SecondaryIdDescription secondaryId) {
final Dataset dataset = namespace.getDataset();
secondaryId.setDataset(dataset);
if (namespace.getStorage().getSecondaryId(secondaryId.getId()) != null) {
throw new WebApplicationException("SecondaryId already exists", Response.Status.CONFLICT);
}
log.info("Received new SecondaryId[{}]", secondaryId.getId());
namespace.getStorage().addSecondaryId(secondaryId);
namespace.sendToAll(new UpdateSecondaryId(secondaryId));
}
Aggregations