Package org.apache.marmotta.ldclient.exception

Examples of org.apache.marmotta.ldclient.exception.DataRetrievalException


            video_id = StringUtils.removeStart(uri, YOUTUBE_GDATA);
        }
        if (StringUtils.isBlank(video_id)) {
            String msg = "Not valid video id found in '" + uri + "'";
            log.error(msg);
            throw new DataRetrievalException(msg);
        } else {
            model.add(new URIImpl(uri), new URIImpl(FOAF_PRIMARY_TOPIC), new URIImpl(YoutubeVideoProvider.YOUTUBE_BASE_URI + video_id), (Resource)null);
            // FIXME: add inverse triple, but maybe at the YoutubeVideoProvider

            ClientResponse clientResponse = new ClientResponse(200, model);
View Full Code Here


                con.close();
            }
        } catch(RepositoryException ex) {
            log.error("error while storing retrieved triples in repository",ex);
        } catch (JsonMappingException e) {
            throw new DataRetrievalException("error while mapping JSON response",e);
        } catch (JsonParseException e) {
            throw new DataRetrievalException("error while parsing JSON response",e);
        } catch (IOException e) {
            throw new DataRetrievalException("error while accessing Facebook Graph API",e);
        }

        return Collections.EMPTY_LIST;
    }
View Full Code Here

            ClientResponse result = new ClientResponse(handler.triples);
            result.setExpires(expiresDate);
            return result;
        } catch (RepositoryException e) {
            log.error("error while initialising Sesame repository; classpath problem?",e);
            throw new DataRetrievalException("error while initialising Sesame repository; classpath problem?",e);
        } catch (ClientProtocolException e) {
            log.error("HTTP client error while trying to retrieve resource {}: {}", resourceUri, e.getMessage());
            throw new DataRetrievalException("I/O error while trying to retrieve resource "+resourceUri,e);
        } catch (IOException e) {
            log.error("I/O error while trying to retrieve resource {}: {}", resourceUri, e.getMessage());
            throw new DataRetrievalException("I/O error while trying to retrieve resource "+resourceUri,e);
        } catch(RuntimeException ex) {
            log.error("Unknown error while trying to retrieve resource {}: {}", resourceUri, ex.getMessage());
            throw new DataRetrievalException("Unknown error while trying to retrieve resource "+resourceUri,ex);
        }

    }
View Full Code Here

                con.commit();
            } catch(RepositoryException ex) {
                con.rollback();
            } catch (RDFParseException e) {
                throw new DataRetrievalException("could not parse resource data for file "+filename);
            } catch (IOException e) {
                throw new DataRetrievalException("could not load resource data for file "+filename);
            } finally {
                con.close();
            }

            ClientResponse response = new ClientResponse(triples);

            return response;
        } catch (RepositoryException e) {
            throw new DataRetrievalException("could not load resource data for file "+filename);
        }

    }
View Full Code Here

                    },
                    triples.getValueFactory());

            return Collections.emptyList();
        } catch (QueryResultParseException e) {
            throw new DataRetrievalException("parse error while trying to parse remote SPARQL results",e);
        } catch (TupleQueryResultHandlerException e) {
            throw new DataRetrievalException("parse error while trying to parse remote SPARQL results",e);
        } catch (IOException e) {
            throw new DataRetrievalException("I/O error while trying to read remote RDF content",e);
        }
    }
View Full Code Here

            video_id = StringUtils.removeStart(uri, YOUTUBE_GDATA);
        }
        if (StringUtils.isBlank(video_id)) {
            String msg = "Not valid video id found in '" + uri + "'";
            log.error(msg);
            throw new DataRetrievalException(msg);
        } else {
            try {
                conn.add(new URIImpl(uri), new URIImpl(FOAF_PRIMARY_TOPIC), new URIImpl(YoutubeVideoProvider.YOUTUBE_BASE_URI + video_id), (Resource)null);
                // FIXME: add inverse triple, but maybe at the YoutubeVideoProvider
                conn.close();
View Full Code Here

            }
            return followUp;

            // throw new DataRetrievalException("Invalid response from Mediawiki-API.");
        } catch (RepositoryException e) {
            throw new DataRetrievalException("repository error while parsing XML response", e);
        } catch (IOException e) {
            throw new DataRetrievalException("I/O error while parsing HTML response", e);
        } catch (JDOMException e) {
            throw new DataRetrievalException("could not parse XML response. It is not in proper XML format", e);
        }
    }
View Full Code Here

    private LdapConnection openLdapConnection(Endpoint endpoint) throws DataRetrievalException {
        java.net.URI u;
    try {
      u = new java.net.URI(endpoint.getEndpointUrl());
    } catch (URISyntaxException e) {
      throw new DataRetrievalException("Invalid enpooint URI", e);
    }
    LdapConnectionConfig config = new LdapConnectionConfig();
    config.setLdapHost(u.getHost());
    config.setLdapPort(u.getPort() > 0 ? u.getPort() : 389);
    if (endpoint.hasProperty("loginDN")) {
      config.setName(endpoint.getProperty("loginDN"));
    }
    if (endpoint.hasProperty("loginPW")) {
      config.setName(endpoint.getProperty("loginPW"));
    }
        LdapNetworkConnection connection = new LdapNetworkConnection(config);
        try {
      connection.bind();
    } catch (Exception e) {
      throw new DataRetrievalException("LDAP connnection could not be bind", e);
    }
        if (connection.isAuthenticated()) {
          return connection;
        } else {
          throw new DataRetrievalException("LDAP connnection could not be stablished");
        }

    }
View Full Code Here

                final ClientResponse resp = new ClientResponse(rep);
                resp.setExpires(new Date());
                return resp;

            } catch (Exception e) {
        throw new DataRetrievalException(e);
      } finally {
                conn.close();
            }
        } catch (RepositoryException e1) {
            log.warn("Could not create SailRep: {}", e1.getMessage());
            throw new DataRetrievalException(e1);
        }
    }
View Full Code Here

        try {
            java.net.URI u;
            u = new java.net.URI(endpoint.getEndpointUrl());
            return u.getPath() != null ? u.getPath().substring(1) : "";
        } catch (URISyntaxException e) {
            throw new DataRetrievalException("Invalid LDAP-Suffix config for endpoint '" + endpoint.getName() + "'!");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.marmotta.ldclient.exception.DataRetrievalException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.