Package org.jivesoftware.util.cache
Interface ExternalizableUtilStrategy
- All Known Implementing Classes:
DefaultExternalizableUtil
public interface ExternalizableUtilStrategy
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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
readBoolean
(DataInput in) byte[]
int
readExternalizableCollection
(DataInput in, Collection<? extends Externalizable> value, ClassLoader loader) int
readExternalizableMap
(DataInput in, Map<String, ? extends Externalizable> map, ClassLoader loader) int
long
long[]
Reads an array of long values.Reads a Map of Long key and Integer value pairs.readSafeUTF
(DataInput in) int
readSerializableCollection
(DataInput in, Collection<? extends Serializable> value, ClassLoader loader) int
readSerializableMap
(DataInput in, Map<? extends Serializable, ? extends Serializable> map, ClassLoader loader) Reads a List of Strings.Reads a Map of String key and value pairs.int
readStrings
(DataInput in, Collection<String> collection) int
void
writeBoolean
(DataOutput out, boolean value) void
writeByteArray
(DataOutput out, byte[] value) void
writeExternalizableCollection
(DataOutput out, Collection<? extends Externalizable> value) void
writeExternalizableMap
(DataOutput out, Map<String, ? extends Externalizable> map) void
writeInt
(DataOutput out, int value) void
writeLong
(DataOutput out, long value) void
writeLongArray
(DataOutput out, long[] array) Writes an array of long values.void
writeLongIntMap
(DataOutput out, Map<Long, Integer> map) Writes a Map of Long key and Integer value pairs.void
writeSafeUTF
(DataOutput out, String value) void
writeSerializable
(DataOutput out, Serializable value) void
writeSerializableCollection
(DataOutput out, Collection<? extends Serializable> value) void
writeSerializableMap
(DataOutput out, Map<? extends Serializable, ? extends Serializable> map) void
writeStringList
(DataOutput out, List<String> stringList) Writes a List of Strings.void
writeStringMap
(DataOutput out, Map<String, String> stringMap) Writes a Map of String key and value pairs.void
writeStrings
(DataOutput out, Collection<String> collection) void
writeStringsMap
(DataOutput out, Map<String, Set<String>> map)
-
Method Details
-
writeStringMap
Writes a Map of String key and value pairs. This method handles the case when the Map isnull
.- Parameters:
out
- the output stream.stringMap
- the Map of String key/value pairs.- Throws:
IOException
- if an error occurs.
-
readStringMap
Reads a Map of String key and value pairs. This method will returnnull
if the Map written to the stream wasnull
.- Parameters:
in
- the input stream.- Returns:
- a Map of String key/value pairs.
- Throws:
IOException
- if an error occurs.
-
writeLongIntMap
Writes a Map of Long key and Integer value pairs. This method handles the case when the Map isnull
.- Parameters:
out
- the output stream.map
- the Map of Long key/Integer value pairs.- Throws:
IOException
- if an error occurs.
-
readLongIntMap
Reads a Map of Long key and Integer value pairs. This method will returnnull
if the Map written to the stream wasnull
.- Parameters:
in
- the input stream.- Returns:
- a Map of Long key/Integer value pairs.
- Throws:
IOException
- if an error occurs.
-
writeStringList
Writes a List of Strings. This method handles the case when the List isnull
.- Parameters:
out
- the output stream.stringList
- the List of Strings.- Throws:
IOException
- if an error occurs.
-
readStringList
Reads a List of Strings. This method will returnnull
if the List written to the stream wasnull
.- Parameters:
in
- the input stream.- Returns:
- a List of Strings.
- Throws:
IOException
- if an error occurs.
-
writeLongArray
Writes an array of long values. This method handles the case when the array isnull
.- Parameters:
out
- the output stream.array
- the array of long values.- Throws:
IOException
- if an error occurs.
-
readLongArray
Reads an array of long values. This method will returnnull
if the array written to the stream wasnull
.- Parameters:
in
- the input stream.- Returns:
- an array of long values.
- Throws:
IOException
- if an error occurs.
-
writeLong
- Throws:
IOException
-
readLong
- Throws:
IOException
-
writeBoolean
- Throws:
IOException
-
readBoolean
- Throws:
IOException
-
writeByteArray
- Throws:
IOException
-
readByteArray
- Throws:
IOException
-
writeSerializable
- Throws:
IOException
-
readSerializable
- Throws:
IOException
-
writeSafeUTF
- Throws:
IOException
-
readSafeUTF
- Throws:
IOException
-
writeExternalizableCollection
void writeExternalizableCollection(DataOutput out, Collection<? extends Externalizable> value) throws IOException - Throws:
IOException
-
readExternalizableCollection
int readExternalizableCollection(DataInput in, Collection<? extends Externalizable> value, ClassLoader loader) throws IOException - Throws:
IOException
-
writeSerializableCollection
void writeSerializableCollection(DataOutput out, Collection<? extends Serializable> value) throws IOException - Throws:
IOException
-
readSerializableCollection
int readSerializableCollection(DataInput in, Collection<? extends Serializable> value, ClassLoader loader) throws IOException - Throws:
IOException
-
writeExternalizableMap
void writeExternalizableMap(DataOutput out, Map<String, ? extends Externalizable> map) throws IOException- Throws:
IOException
-
readExternalizableMap
int readExternalizableMap(DataInput in, Map<String, ? extends Externalizable> map, ClassLoader loader) throws IOException- Throws:
IOException
-
writeSerializableMap
void writeSerializableMap(DataOutput out, Map<? extends Serializable, ? extends Serializable> map) throws IOException- Throws:
IOException
-
readSerializableMap
int readSerializableMap(DataInput in, Map<? extends Serializable, ? extends Serializable> map, ClassLoader loader) throws IOException- Throws:
IOException
-
writeStringsMap
- Throws:
IOException
-
readStringsMap
- Throws:
IOException
-
writeStrings
- Throws:
IOException
-
readStrings
- Throws:
IOException
-
writeInt
- Throws:
IOException
-
readInt
- Throws:
IOException
-