All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jivesoftware.util.cache.ExternalizableUtilStrategy Maven / Gradle / Ivy

Go to download

Tinder is a Java based XMPP library, providing an implementation for XMPP stanzas and components. Tinders origins lie in code that's shared between Jive Software's Openfire and Whack implementations. The implementation that's provided in Tinder hasn't been written again from scratch. Instead, code has been moved from the original projects into Tinder, preserving al of the existing features and functionality. Most of the code that's now in Tinder is based on the org.xmpp package implementation that previously existed in Openfire and Whack. This is the code that defines classes such as Packet, JID, IQ, Component and their extensions. Additionally, some multi-purpose code (such as the DataForm and Result Set Management implementations have been moved to Tinder as well.

There is a newer version: 1.3.0
Show newest version
/**
 * $RCSfile$
 * $Revision: $
 * $Date: $
 *
 * Copyright (C) 2005-2008 Jive Software. All rights reserved.
 *
 * This software is published under the terms of the GNU Public License (GPL),
 * a copy of which is included in this distribution, or a commercial license
 * agreement with Jive.
 */
package org.jivesoftware.util.cache;

import java.io.*;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * Interface that allows to provide different ways for implementing serialization of objects.
 * The open source version of the server will just provide a dummy implementation that does
 * nothing. The enterprise version will use Coherence as its underlying mechanism.
 *
 * @author Gaston Dombiak
 */
public interface ExternalizableUtilStrategy {

    /**
     * Writes a Map of String key and value pairs. This method handles the
     * case when the Map is null.
     *
     * @param out       the output stream.
     * @param stringMap the Map of String key/value pairs.
     * @throws java.io.IOException if an error occurs.
     */
    void writeStringMap(DataOutput out, Map stringMap) throws IOException;

    /**
     * Reads a Map of String key and value pairs. This method will return
     * null if the Map written to the stream was null.
     *
     * @param in the input stream.
     * @return a Map of String key/value pairs.
     * @throws IOException if an error occurs.
     */
    Map readStringMap(DataInput in) throws IOException;

    /**
     * Writes a Map of Long key and Integer value pairs. This method handles
     * the case when the Map is null.
     *
     * @param out the output stream.
     * @param map the Map of Long key/Integer value pairs.
     * @throws IOException if an error occurs.
     */
    void writeLongIntMap(DataOutput out, Map map) throws IOException;

    /**
     * Reads a Map of Long key and Integer value pairs. This method will return
     * null if the Map written to the stream was null.
     *
     * @param in the input stream.
     * @return a Map of Long key/Integer value pairs.
     * @throws IOException if an error occurs.
     */
    Map readLongIntMap(DataInput in) throws IOException;

    /**
     * Writes a List of Strings. This method handles the case when the List is
     * null.
     *
     * @param out        the output stream.
     * @param stringList the List of Strings.
     * @throws IOException if an error occurs.
     */
    void writeStringList(DataOutput out, List stringList) throws IOException;

    /**
     * Reads a List of Strings. This method will return null if the List
     * written to the stream was null.
     *
     * @param in the input stream.
     * @return a List of Strings.
     * @throws IOException if an error occurs.
     */
    List readStringList(DataInput in) throws IOException;

    /**
     * Writes an array of long values. This method handles the case when the
     * array is null.
     *
     * @param out   the output stream.
     * @param array the array of long values.
     * @throws IOException if an error occurs.
     */
    void writeLongArray(DataOutput out, long[] array) throws IOException;

    /**
     * Reads an array of long values. This method will return null if
     * the array written to the stream was null.
     *
     * @param in the input stream.
     * @return an array of long values.
     * @throws IOException if an error occurs.
     */
    long[] readLongArray(DataInput in) throws IOException;

    void writeLong(DataOutput out, long value) throws IOException;

    long readLong(DataInput in) throws IOException;

    void writeBoolean(DataOutput out, boolean value) throws IOException;

    boolean readBoolean(DataInput in) throws IOException;

    void writeByteArray(DataOutput out, byte[] value) throws IOException;

    byte[] readByteArray(DataInput in) throws IOException;

    void writeSerializable(DataOutput out, Serializable value) throws IOException;

    Serializable readSerializable(DataInput in) throws IOException;

    void writeSafeUTF(DataOutput out, String value) throws IOException;

    String readSafeUTF(DataInput in) throws IOException;

    void writeExternalizableCollection(DataOutput out, Collection value) throws IOException;

    int readExternalizableCollection(DataInput in, Collection value, ClassLoader loader)
            throws IOException;

    void writeExternalizableMap(DataOutput out, Map map) throws IOException;

    int readExternalizableMap(DataInput in, Map map, ClassLoader loader) throws IOException;

    void writeStringsMap(DataOutput out, Map> map)  throws IOException;

    int readStringsMap(DataInput in, Map> map) throws IOException;

    void writeStrings(DataOutput out, Collection collection) throws IOException;

    int readStrings(DataInput in, Collection collection) throws IOException;

    void writeInt(DataOutput out, int value) throws IOException;

    int readInt(DataInput in) throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy