Package org.jivesoftware.util.cache
Class DummyExternalizableUtil
- java.lang.Object
-
- org.jivesoftware.util.cache.DummyExternalizableUtil
-
- All Implemented Interfaces:
ExternalizableUtilStrategy
public class DummyExternalizableUtil extends Object implements ExternalizableUtilStrategy
Dummy implementation that does nothing. The open source version of the server uses this strategy.- Author:
- Gaston Dombiak
-
-
Constructor Summary
Constructors Constructor Description DummyExternalizableUtil()
-
Method Summary
-
-
-
Method Detail
-
writeStringMap
public void writeStringMap(DataOutput out, Map<String,String> stringMap) throws IOException
Writes a Map of String key and value pairs. This method handles the case when the Map isnull
.- Specified by:
writeStringMap
in interfaceExternalizableUtilStrategy
- Parameters:
out
- the output stream.stringMap
- the Map of String key/value pairs.- Throws:
IOException
- if an error occurs.
-
readStringMap
public Map<String,String> readStringMap(DataInput in) throws IOException
Reads a Map of String key and value pairs. This method will returnnull
if the Map written to the stream wasnull
.- Specified by:
readStringMap
in interfaceExternalizableUtilStrategy
- Parameters:
in
- the input stream.- Returns:
- a Map of String key/value pairs.
- Throws:
IOException
- if an error occurs.
-
writeLongIntMap
public void writeLongIntMap(DataOutput out, Map<Long,Integer> map) throws IOException
Writes a Map of Long key and Integer value pairs. This method handles the case when the Map isnull
.- Specified by:
writeLongIntMap
in interfaceExternalizableUtilStrategy
- Parameters:
out
- the output stream.map
- the Map of Long key/Integer value pairs.- Throws:
IOException
- if an error occurs.
-
readLongIntMap
public Map<Long,Integer> readLongIntMap(DataInput in) throws IOException
Reads a Map of Long key and Integer value pairs. This method will returnnull
if the Map written to the stream wasnull
.- Specified by:
readLongIntMap
in interfaceExternalizableUtilStrategy
- Parameters:
in
- the input stream.- Returns:
- a Map of Long key/Integer value pairs.
- Throws:
IOException
- if an error occurs.
-
writeStringList
public void writeStringList(DataOutput out, List<String> stringList) throws IOException
Writes a List of Strings. This method handles the case when the List isnull
.- Specified by:
writeStringList
in interfaceExternalizableUtilStrategy
- Parameters:
out
- the output stream.stringList
- the List of Strings.- Throws:
IOException
- if an error occurs.
-
readStringList
public List<String> readStringList(DataInput in) throws IOException
Reads a List of Strings. This method will returnnull
if the List written to the stream wasnull
.- Specified by:
readStringList
in interfaceExternalizableUtilStrategy
- Parameters:
in
- the input stream.- Returns:
- a List of Strings.
- Throws:
IOException
- if an error occurs.
-
writeLongArray
public void writeLongArray(DataOutput out, long[] array) throws IOException
Writes an array of long values. This method handles the case when the array isnull
.- Specified by:
writeLongArray
in interfaceExternalizableUtilStrategy
- Parameters:
out
- the output stream.array
- the array of long values.- Throws:
IOException
- if an error occurs.
-
readLongArray
public long[] readLongArray(DataInput in) throws IOException
Reads an array of long values. This method will returnnull
if the array written to the stream wasnull
.- Specified by:
readLongArray
in interfaceExternalizableUtilStrategy
- Parameters:
in
- the input stream.- Returns:
- an array of long values.
- Throws:
IOException
- if an error occurs.
-
writeLong
public void writeLong(DataOutput out, long value)
- Specified by:
writeLong
in interfaceExternalizableUtilStrategy
-
readLong
public long readLong(DataInput in)
- Specified by:
readLong
in interfaceExternalizableUtilStrategy
-
writeBoolean
public void writeBoolean(DataOutput out, boolean value)
- Specified by:
writeBoolean
in interfaceExternalizableUtilStrategy
-
readBoolean
public boolean readBoolean(DataInput in)
- Specified by:
readBoolean
in interfaceExternalizableUtilStrategy
-
writeByteArray
public void writeByteArray(DataOutput out, byte[] value) throws IOException
- Specified by:
writeByteArray
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readByteArray
public byte[] readByteArray(DataInput in) throws IOException
- Specified by:
readByteArray
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeSerializable
public void writeSerializable(DataOutput out, Serializable value) throws IOException
- Specified by:
writeSerializable
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readSerializable
public Serializable readSerializable(DataInput in) throws IOException
- Specified by:
readSerializable
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeSafeUTF
public void writeSafeUTF(DataOutput out, String value)
- Specified by:
writeSafeUTF
in interfaceExternalizableUtilStrategy
-
readSafeUTF
public String readSafeUTF(DataInput in)
- Specified by:
readSafeUTF
in interfaceExternalizableUtilStrategy
-
writeExternalizableCollection
public void writeExternalizableCollection(DataOutput out, Collection<? extends Externalizable> value) throws IOException
- Specified by:
writeExternalizableCollection
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readExternalizableCollection
public int readExternalizableCollection(DataInput in, Collection<? extends Externalizable> value, ClassLoader loader) throws IOException
- Specified by:
readExternalizableCollection
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeSerializableCollection
public void writeSerializableCollection(DataOutput out, Collection<? extends Serializable> value) throws IOException
- Specified by:
writeSerializableCollection
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readSerializableCollection
public int readSerializableCollection(DataInput in, Collection<? extends Serializable> value, ClassLoader loader) throws IOException
- Specified by:
readSerializableCollection
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeExternalizableMap
public void writeExternalizableMap(DataOutput out, Map<String,? extends Externalizable> map) throws IOException
- Specified by:
writeExternalizableMap
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readExternalizableMap
public int readExternalizableMap(DataInput in, Map<String,? extends Externalizable> map, ClassLoader loader) throws IOException
- Specified by:
readExternalizableMap
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeSerializableMap
public void writeSerializableMap(DataOutput out, Map<? extends Serializable,? extends Serializable> map) throws IOException
- Specified by:
writeSerializableMap
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readSerializableMap
public int readSerializableMap(DataInput in, Map<? extends Serializable,? extends Serializable> map, ClassLoader loader) throws IOException
- Specified by:
readSerializableMap
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeStringsMap
public void writeStringsMap(DataOutput out, Map<String,Set<String>> map) throws IOException
- Specified by:
writeStringsMap
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readStringsMap
public int readStringsMap(DataInput in, Map<String,Set<String>> map) throws IOException
- Specified by:
readStringsMap
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeStrings
public void writeStrings(DataOutput out, Collection<String> collection) throws IOException
- Specified by:
writeStrings
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
readStrings
public int readStrings(DataInput in, Collection<String> collection) throws IOException
- Specified by:
readStrings
in interfaceExternalizableUtilStrategy
- Throws:
IOException
-
writeInt
public void writeInt(DataOutput out, int value)
- Specified by:
writeInt
in interfaceExternalizableUtilStrategy
-
readInt
public int readInt(DataInput in)
- Specified by:
readInt
in interfaceExternalizableUtilStrategy
-
-