use of won.protocol.exception.UriAlreadyInUseException in project webofneeds by researchstudio-sat.
the class UriAlreadyUsedCheckingWonMessageProcessor method checkAtomURI.
private void checkAtomURI(final WonMessage message) {
if (message.getMessageType() == WonMessageType.CREATE_ATOM) {
URI atomURI = WonRdfUtils.AtomUtils.getAtomURI(message.getCompleteDataset());
Optional<Atom> atom = atomService.getAtom(atomURI);
if (!atom.isPresent()) {
return;
} else {
throw new UriAlreadyInUseException(message.getSenderAtomURI().toString());
}
}
return;
}
Aggregations