Package org.fcrepo.server.errors

Examples of org.fcrepo.server.errors.ResourceIndexException


    // Helper methods for creating RDF components

    protected RDFName getStateResource(String state)
            throws ResourceIndexException {
        if (state == null) {
            throw new ResourceIndexException("State cannot be null");
        } else if (state.equals("A")) {
            return MODEL.ACTIVE;
        } else if (state.equals("D")) {
            return MODEL.DELETED;
        } else if (state.equals("I")) {
            return MODEL.INACTIVE;
        } else {
            throw new ResourceIndexException("Unrecognized state: " + state);
        }
    }
View Full Code Here


                                                new SimpleURIReference(
                                                        new URI(TEST_PREDICATE)),
                                                        new SimpleLiteral("true")));
        }
        catch (ServerException e){
            throw new ResourceIndexException(e.getLocalizedMessage(),e);
        }
        catch (URISyntaxException e){
            throw new ResourceIndexException(e.getLocalizedMessage(),e);
        }
        return set;
    }
View Full Code Here

            return objURI;
        } catch (ResourceIndexException e) {
            throw e;
        } catch (Exception e) {
            throw new ResourceIndexException("Error generating triples", e);
        }
    }
View Full Code Here

                    new URI(PID.toURI(reader.GetObjectPID())));

            /* Now add the SDef operation-specific triples */
            addMethodDefTriples(objURI, reader, set);
        } catch (Exception e) {
            throw new ResourceIndexException("Could not generate triples", e);
        }
        return set;
    }
View Full Code Here

                add(objURI, MODEL.DEFINES_METHOD, element.methodName, set);
            }
        } catch (ResourceIndexException e) {
            throw e;
        } catch (Exception e) {
            throw new ResourceIndexException("Error adding method def "
                    + "triples", e);
        }
    }
View Full Code Here

                logger.warn("ModuleConfiguration bean unavailable; getting Module bean");
                levelValue = riModule.getParameter("level");
            }
            else {
                logger.error("Cannot load ResourceIndex module definition from Spring config or Fedora config");
                throw new ResourceIndexException("Cannot locate ResourceIndex module definition in Spring config or Fedora config");
            }
        }
        else {
            levelValue = m_riConfig.getParameter("level",Parameter.class).getValue();
        }
        int riLevel = Integer.parseInt(levelValue);

        Map<String, String> aliasMap = new HashMap<String, String>();
        Iterator<Parameter> it = m_riConfig.getParameters(Parameter.class).iterator();
        Parameter p;
        while (it.hasNext()) {
            p = it.next();
            String pName = p.getName();
            String[] parts = pName.split(":");
            if (parts.length == 2 && parts[0].equals("alias")) {
                aliasMap.put(parts[1], p.getValue(p.getIsFilePath()));
            }
        }


        System.out.println("Initializing triplestore interface...");
        try {
            if (m_conn instanceof MulgaraConnector){
                String path = m_conn.getConfiguration().get("path");
                dropIndex(path);
            }

            m_ri = new ResourceIndexImpl(m_conn, m_generator, riLevel, false);
            m_ri.setAliasMap(aliasMap);
        } catch (Exception e) {
            logger.error("Failed to initialize new Resource Index",e);
            e.printStackTrace(System.err);
            throw new ResourceIndexException("Failed to initialize new Resource Index",
                                             e);
        }

    }
View Full Code Here

        if (path != null) {
            config.put("path", datastore.getParameter("path", true));
        }
        String className = config.get("connectorClassName");
        if (className == null) {
            throw new ResourceIndexException("Required datastore parameter "
                    + "is missing: connectorClassName");
        }
        getServer().getStatusFile().append(ServerState.STARTING,
                                           "Initializing Triplestore");
        return TriplestoreConnector.init(className, config);
View Full Code Here

                    objectTriples.addAll(m_generators.get(modelRelobject)
                            .getTriplesForObject(reader));
                }
            }
        } catch (ServerException e) {
            throw new ResourceIndexException("Could not read object's content model",
                                             e);
        }

        return objectTriples;
    }
View Full Code Here

        try {
            TripleIterator it = _writer.findTriples(null, null, null, 0);
            it.setAliasMap(_writer.getAliasMap());
            it.toStream(out, format);
        } catch (TrippiException e) {
            throw new ResourceIndexException("Unable to export RI", e);
        }
    }
View Full Code Here

                _writer.delete(getTripleIterator(set), _syncUpdates);
            } else {
                _writer.add(getTripleIterator(set), _syncUpdates);
            }
        } catch (Exception e) {
            throw new ResourceIndexException("Error updating triples", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.errors.ResourceIndexException

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.