Package org.fcrepo.server.journal

Examples of org.fcrepo.server.journal.JournalException


                    super.writeJournalEntry(journalEntry, xmlWriter);
                    xmlWriter.flush();
                    currentJournal.closeIfAppropriate();
                }
            } catch (XMLStreamException e) {
                throw new JournalException(e);
            }
        }
    }
View Full Code Here


    static String getRequiredParameter(Map<String, String> parameters,
                                       String parameterName)
            throws JournalException {
        String value = parameters.get(parameterName);
        if (value == null) {
            throw new JournalException("'" + parameterName + "' is required.");
        }
        return value;
    }
View Full Code Here

            intervalString = DEFAULT_FOLLOW_POLLING_INTERVAL;
        }
        Pattern p = Pattern.compile("([0-9]+)([HM]?)");
        Matcher m = p.matcher(intervalString);
        if (!m.matches()) {
            throw new JournalException("Parameter '"
                    + PARAMETER_FOLLOW_POLLING_INTERVAL
                    + "' must be an positive integer number of seconds, "
                    + "optionally followed by 'H'(hours), or 'M'(minutes)");
        }
        long interval = Long.parseLong(m.group(1)) * 1000;
 
View Full Code Here

        // the map name must match the expected name
        String value =
                getRequiredAttributeValue(event.asStartElement(),
                                          QNAME_ATTR_NAME);
        if (!mapName.equals(value)) {
            throw new JournalException("Expecting a '" + mapName
                    + "' multi-map, but found a '" + value
                    + "' multi-map instead");
        }

        // populate the map
View Full Code Here

            throws JournalException {
        try {
            map.set(key, values);
        } catch (Exception e) {
            // totally bogus Exception here.
            throw new JournalException(e);
        }
    }
View Full Code Here

        checkDirectoriesAreDifferent();
    }

    private void checkDirectoriesAreDifferent() throws JournalException {
        if (archiveDirectory.equals(journalDirectory)) {
            throw new JournalException("Archive directory and Journal directory are identical: '"
                    + archiveDirectory.getPath() + "'");
        }
    }
View Full Code Here

                // A new file needs to be advanced before using.
                advanceIntoFile(currentFile.getReader());
            }
        } catch (XMLStreamException e) {
            throw new JournalException(e);
        }
    }
View Full Code Here

     */
    private void advanceIntoFile(XMLEventReader reader)
            throws XMLStreamException, JournalException {
        XMLEvent event = reader.nextEvent();
        if (!event.isStartDocument()) {
            throw new JournalException("Expecting XML document header, but event was '"
                    + event + "'");
        }

        event = reader.nextTag();
        if (!isStartTagEvent(event, QNAME_TAG_JOURNAL)) {
            throw new JournalException("Expecting FedoraJournal start tag, but event was '"
                    + event + "'");
        }

        String hash =
                getOptionalAttributeValue(event.asStartElement(),
View Full Code Here

    protected String getRequiredAttributeValue(StartElement start,
                                               QName attributeName)
            throws JournalException {
        Attribute mapNameAttribute = start.getAttributeByName(attributeName);
        if (mapNameAttribute == null) {
            throw new JournalException("Start tag '" + start
                    + "' must contain a '" + attributeName + "' attribute.");
        }
        return mapNameAttribute.getValue();
    }
View Full Code Here

    /**
     * Complain when we were expecting a start tag, and didn't find it.
     */
    protected JournalException getNotStartTagException(QName tagName,
                                                       XMLEvent event) {
        return new JournalException("Expecting '" + tagName
                + "' start tag, but event was '" + event + "'");

    }
View Full Code Here

TOP

Related Classes of org.fcrepo.server.journal.JournalException

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.