Package org.apache.jackrabbit.core.journal

Examples of org.apache.jackrabbit.core.journal.Record


        public void updateCancelled(Update update) {
            if (status != STARTED) {
                log.info("not started: update cancel ignored.");
                return;
            }
            Record record = (Record) update.getAttribute(ATTRIBUTE_RECORD);
            if (record != null) {
                record.cancelUpdate();
                update.setAttribute(ATTRIBUTE_RECORD, null);
            }
        }
View Full Code Here


            if (status != STARTED) {
                log.info("not started: lock operation ignored.");
                return null;
            }
            try {
                Record record = journal.getProducer(PRODUCER_ID).append();
                return new LockOperation(ClusterNode.this, workspace, record,
                        nodeId, deep, owner);
            } catch (JournalException e) {
                String msg = "Unable to create log entry: " + e.getMessage();
                log.error(msg);
View Full Code Here

            if (status != STARTED) {
                log.info("not started: unlock operation ignored.");
                return null;
            }
            try {
                Record record = journal.getProducer(PRODUCER_ID).append();
                return new LockOperation(ClusterNode.this, workspace, record,
                        nodeId);
            } catch (JournalException e) {
                String msg = "Unable to create log entry: " + e.getMessage();
                log.error(msg);
View Full Code Here

    public void remapped(String oldPrefix, String newPrefix, String uri) {
        if (status != STARTED) {
            log.info("not started: namespace operation ignored.");
            return;
        }
        Record record = null;
        boolean succeeded = false;

        try {
            record = journal.getProducer(PRODUCER_ID).append();
            record.writeString(null);
            write(record, oldPrefix, newPrefix, uri);
            record.writeChar('\0');
            record.update();
            setRevision(record.getRevision());
            succeeded = true;
        } catch (JournalException e) {
            String msg = "Unable to create log entry: " + e.getMessage();
            log.error(msg);
        } catch (Throwable e) {
            String msg = "Unexpected error while creating log entry.";
            log.error(msg, e);
        } finally {
            if (!succeeded && record != null) {
                record.cancelUpdate();
            }
        }
    }
View Full Code Here

    public void registered(Collection ntDefs) {
        if (status != STARTED) {
            log.info("not started: nodetype operation ignored.");
            return;
        }
        Record record = null;
        boolean succeeded = false;

        try {
            record = journal.getProducer(PRODUCER_ID).append();
            record.writeString(null);
            write(record, ntDefs, true);
            record.writeChar('\0');
            record.update();
            setRevision(record.getRevision());
            succeeded = true;
        } catch (JournalException e) {
            String msg = "Unable to create log entry: " + e.getMessage();
            log.error(msg);
        } catch (Throwable e) {
            String msg = "Unexpected error while creating log entry.";
            log.error(msg, e);
        } finally {
            if (!succeeded && record != null) {
                record.cancelUpdate();
            }
        }
    }
View Full Code Here

    public void reregistered(NodeTypeDef ntDef) {
        if (status != STARTED) {
            log.info("not started: nodetype operation ignored.");
            return;
        }
        Record record = null;
        boolean succeeded = false;

        try {
            record = journal.getProducer(PRODUCER_ID).append();
            record.writeString(null);
            write(record, ntDef);
            record.writeChar('\0');
            record.update();
            setRevision(record.getRevision());
            succeeded = true;
        } catch (JournalException e) {
            String msg = "Unable to create log entry: " + e.getMessage();
            log.error(msg);
        } catch (Throwable e) {
            String msg = "Unexpected error while creating log entry.";
            log.error(msg, e);
        } finally {
            if (!succeeded && record != null) {
                record.cancelUpdate();
            }
        }
    }
View Full Code Here

    public void unregistered(Collection qnames) {
        if (status != STARTED) {
            log.info("not started: nodetype operation ignored.");
            return;
        }
        Record record = null;
        boolean succeeded = false;

        try {
            record = journal.getProducer(PRODUCER_ID).append();
            record.writeString(null);
            write(record, qnames, false);
            record.writeChar('\0');
            record.update();
            setRevision(record.getRevision());
            succeeded = true;
        } catch (JournalException e) {
            String msg = "Unable to create log entry: " + e.getMessage();
            log.error(msg);
        } catch (Throwable e) {
            String msg = "Unexpected error while creating log entry.";
            log.error(msg, e);
        } finally {
            if (!succeeded && record != null) {
                record.cancelUpdate();
            }
        }
    }
View Full Code Here

     * @param successful <code>true</code> if the operation was successful and
     *                   the journal record should be updated;
     *                   <code>false</code> to revoke changes
     */
    public void ended(AbstractClusterOperation operation, boolean successful) {
        Record record = operation.getRecord();
        boolean succeeded = false;

        try {
            if (successful) {
                record = operation.getRecord();
                record.writeString(operation.getWorkspace());
                operation.write();
                record.writeChar('\0');
                record.update();
                setRevision(record.getRevision());
                succeeded = true;
            }
        } catch (JournalException e) {
            String msg = "Unable to create log entry: " + e.getMessage();
            log.error(msg);
        } catch (Throwable e) {
            String msg = "Unexpected error while creating log entry.";
            log.error(msg, e);
        } finally {
            if (!succeeded) {
                record.cancelUpdate();
            }
        }
    }
View Full Code Here

            if (status != STARTED) {
                log.info("not started: update create ignored.");
                return;
            }
            try {
                Record record = journal.getProducer(PRODUCER_ID).append();
                update.setAttribute(ATTRIBUTE_RECORD, record);
            } catch (JournalException e) {
                String msg = "Unable to create log entry.";
                log.error(msg, e);
            } catch (Throwable e) {
View Full Code Here

        public void updatePrepared(Update update) {
            if (status != STARTED) {
                log.info("not started: update prepare ignored.");
                return;
            }
            Record record = (Record) update.getAttribute(ATTRIBUTE_RECORD);
            if (record == null) {
                String msg = "No record created.";
                log.warn(msg);
                return;
            }

            EventStateCollection events = update.getEvents();
            ChangeLog changes = update.getChanges();
            boolean succeeded = false;

            try {
                record.writeString(workspace);
                write(record, changes, events);
                record.writeChar('\0');
                succeeded = true;
            } catch (JournalException e) {
                String msg = "Unable to create log entry: " + e.getMessage();
                log.error(msg);
            } catch (Throwable e) {
                String msg = "Unexpected error while preparing log entry.";
                log.error(msg, e);
            } finally {
                if (!succeeded && record != null) {
                    record.cancelUpdate();
                    update.setAttribute(ATTRIBUTE_RECORD, null);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.journal.Record

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.