<commit_before>
/*
 * Tigase Jabber/XMPP Server
 * Copyright (C) 2004-2012 "<NAME>" <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. Look for COPYING file in the top folder.
 * If not, see http://www.gnu.org/licenses/.
 *
 */
package tigase.db;

//~--- non-JDK imports --------------------------------------------------------
import tigase.xml.Element;

import tigase.xmpp.JID;

//~--- JDK imports ------------------------------------------------------------

import java.util.Date;
import java.util.Map;
import java.util.Queue;

//~--- interfaces -------------------------------------------------------------
/**
 * Interface for storing and restoring offline Elements.
 *
 * Created: May 11, 2010 6:56:14 PM
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public interface MsgRepositoryIfc extends Repository {

	/**
	 * Loads head of the payloads queue which holds items that would be expired after
	 * stated time with an option to delete them from repository after being
	 * retrieved.
	 *
	 * @param time   time in milliseconds representing time after which given
	 *               message would be considered as expired
	 * @param delete boolean parameter controlling whether messages should be
	 *               removed from repository after they retrieved.
	 *
	 * @return head of the payloads queue which holds items that would be expired after
	 * stated time with an option to delete them from repository after being
	 * retrieved.
	 */
	Element getMessageExpired( long time, boolean delete );

	//~--- methods --------------------------------------------------------------
	/**
	 * Loads all payloads for the given user's {@link JID} from repository.
	 *
	 * @param to     {@link JID} denotes address of the receiver for which payload
	 *               stored in the repository should be retrieved.
	 * @param delete boolean parameter controlling whether messages should be
	 *               removed from repository after they retrieved.<commit_msg>Improved JavaDoc for getMessageExpired() method explaining that this is blocking method.<commit_after>
/*
 * Tigase Jabber/XMPP Server
 * Copyright (C) 2004-2012 "<NAME>" <<EMAIL>>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. Look for COPYING file in the top folder.
 * If not, see http://www.gnu.org/licenses/.
 *
 */
package tigase.db;

//~--- non-JDK imports --------------------------------------------------------
import tigase.xml.Element;

import tigase.xmpp.JID;

//~--- JDK imports ------------------------------------------------------------

import java.util.Date;
import java.util.Map;
import java.util.Queue;

//~--- interfaces -------------------------------------------------------------
/**
 * Interface for storing and restoring offline Elements.
 *
 * Created: May 11, 2010 6:56:14 PM
 *
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 */
public interface MsgRepositoryIfc extends Repository {

	/**
	 * Loads head of the payloads queue which holds items that would be expired after
	 * stated time with an option to delete them from repository after being
	 * retrieved.
	 * This is blocking method, which means if there is not data to return, implementation
	 * should block the call until data is available.
	 *
	 * @param time   time in milliseconds representing time after which given
	 *               message would be considered as expired
	 * @param delete boolean parameter controlling whether messages should be
	 *               removed from repository after they retrieved.
	 *
	 * @return head of the payloads queue which holds items that would be expired after
	 * stated time with an option to delete them from repository after being
	 * retrieved.
	 */
	Element getMessageExpired( long time, boolean delete );

	//~--- methods --------------------------------------------------------------
	/**
	 * Loads all payloads for the given user's {@link JID} from repository.
	 *
	 * @param to     {@link JID} denotes address of the receiver for which payload
	 *               stored in the repository should be retrieved.
	 * @param delete boolean parameter controlling whether messages should be
	 *               removed from repository after they retrieved.
{'fraction_non_alphanumeric': 0.15964777947932618, 'fraction_numerical': 0.007656967840735069, 'mean_word_length': 2.2758620689655173, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1451337', 'n_tokens_mistral': 1296, 'n_tokens_neox': 1188, 'n_words': 603}