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; 014 015import java.util.Calendar; 016 017/** 018 * @author Florent Guillaume 019 */ 020public interface RepositoryManagement { 021 022 /** 023 * Gets the repository name. 024 */ 025 String getName(); 026 027 /** 028 * Gets the number of active sessions. 029 */ 030 int getActiveSessionsCount(); 031 032 /** 033 * Evaluate number of elements in all caches 034 * 035 * @since 5.7.2 036 */ 037 long getCacheSize(); 038 039 /** 040 * Evaluate number of elements in hier cache 041 * 042 * @since 5.7.2 043 */ 044 long getCachePristineSize(); 045 046 /** 047 * Evaluate number of elements in selection cache 048 * 049 * @since 5.7.2 050 */ 051 long getCacheSelectionSize(); 052 053 /** 054 * Clears all the caches. 055 * 056 * @return an indicative count of objects removed 057 */ 058 int clearCaches(); 059 060 /** 061 * Makes sure that the next transaction will process cluster invalidations. 062 */ 063 void processClusterInvalidationsNext(); 064 065 /** 066 * Marks the binaries in use by passing them to the binary manager(s)'s GC mark() method. 067 */ 068 void markReferencedBinaries(); 069 070 /** 071 * Cleans up (hard-deletes) any documents that have been soft-deleted in the database. 072 * 073 * @param max the maximum number of documents to delete at a time 074 * @param beforeTime the maximum deletion time of the documents to delete 075 * @return the number of documents deleted 076 */ 077 int cleanupDeletedDocuments(int max, Calendar beforeTime); 078 079}