Example usage for org.apache.http.conn HttpHostConnectException getLocalizedMessage

List of usage examples for org.apache.http.conn HttpHostConnectException getLocalizedMessage

Introduction

In this page you can find the example usage for org.apache.http.conn HttpHostConnectException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:io.mapzone.arena.csw.catalog.ProjectNodeSynchronizer.java

@EventHandler(delay = 1000, scope = Event.Scope.JVM)
protected void projectNodeCommitted(List<ProjectNodeCommittedEvent> evs) throws Exception {
    // the delay causes this to be executed inside an UIJob, so
    // this update runs asynchronously and does no effect main thread
    try (Updater updater = catalog.prepareUpdate(); UnitOfWork uow = ProjectRepository.newUnitOfWork();) {
        for (ProjectNodeCommittedEvent ev : evs) {
            ProjectNode entity = ev.getEntity(uow);

            if (entity instanceof ILayer) {
                Optional<MetadataReference> mdRef = findMetadataRefs(entity);
                if (mdRef.isPresent()) {
                    String identifier = mdRef.get().metadataId.get();
                    updater.updateEntry(identifier, update(entity));
                } else {
                    String identifier = UUID.randomUUID().toString();
                    createMetadataRefs(entity, identifier);
                    updater.newEntry(md -> {
                        md.setIdentifier(identifier);
                        update(entity).accept(md);
                    });/*  w ww.java2 s. c  o  m*/
                }
            }
        }
        updater.commit();
        uow.commit();
    } catch (HttpHostConnectException e) {
        // just a short message for better developing
        log.warn("Unable to connect CSW server: " + e.getLocalizedMessage());
    }
}