001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Florent Guillaume
011 */
012
013package org.nuxeo.ecm.core.storage.sql.management;
014
015import org.nuxeo.ecm.core.blob.binary.BinaryManagerStatus;
016
017/**
018 * @author Florent Guillaume
019 */
020public interface SQLRepositoryStatusMBean {
021
022    /**
023     * Lists the opened sessions.
024     */
025    String listActiveSessions();
026
027    /**
028     * Lists the remote opened sessions
029     */
030    String listRemoteSessions();
031
032    /**
033     * Return the opened sessions count
034     */
035    int getActiveSessionsCount();
036
037    /**
038     * Clears the caches.
039     */
040    String clearCaches();
041
042    /**
043     * Evaluate caches size
044     *
045     * @since 5.7.2
046     */
047    long getCachesSize();
048
049    /**
050     * GC the unused binaries.
051     *
052     * @param delete if {@code false} don't actually delete the GCed binaries (but still return statistics about them),
053     *            if {@code true} delete them
054     * @return a status about the number of GCed binaries
055     */
056    BinaryManagerStatus gcBinaries(boolean delete);
057
058    /**
059     * Is a GC of the binaries in progress?
060     * <p>
061     * It's only useful to call this from a separate thread from the one that called {@link #gcBinaries}.
062     *
063     * @return {@code true} if a GC of the binaries is in progress
064     */
065    boolean isBinariesGCInProgress();
066
067}