org.jivesoftware.util.cache
Interface ExternalizableUtilStrategy

All Known Implementing Classes:
DummyExternalizableUtil

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
 boolean readBoolean(java.io.DataInput in)
           
 byte[] readByteArray(java.io.DataInput in)
           
 int readExternalizableCollection(java.io.DataInput in, java.util.Collection<? extends java.io.Externalizable> value, java.lang.ClassLoader loader)
           
 int readExternalizableMap(java.io.DataInput in, java.util.Map<java.lang.String,? extends java.io.Externalizable> map, java.lang.ClassLoader loader)
           
 int readInt(java.io.DataInput in)
           
 long readLong(java.io.DataInput in)
           
 long[] readLongArray(java.io.DataInput in)
          Reads an array of long values.
 java.util.Map readLongIntMap(java.io.DataInput in)
          Reads a Map of Long key and Integer value pairs.
 java.lang.String readSafeUTF(java.io.DataInput in)
           
 java.io.Serializable readSerializable(java.io.DataInput in)
           
 java.util.List<java.lang.String> readStringList(java.io.DataInput in)
          Reads a List of Strings.
 java.util.Map<java.lang.String,java.lang.String> readStringMap(java.io.DataInput in)
          Reads a Map of String key and value pairs.
 int readStrings(java.io.DataInput in, java.util.Collection<java.lang.String> collection)
           
 int readStringsMap(java.io.DataInput in, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
           
 void writeBoolean(java.io.DataOutput out, boolean value)
           
 void writeByteArray(java.io.DataOutput out, byte[] value)
           
 void writeExternalizableCollection(java.io.DataOutput out, java.util.Collection<? extends java.io.Externalizable> value)
           
 void writeExternalizableMap(java.io.DataOutput out, java.util.Map<java.lang.String,? extends java.io.Externalizable> map)
           
 void writeInt(java.io.DataOutput out, int value)
           
 void writeLong(java.io.DataOutput out, long value)
           
 void writeLongArray(java.io.DataOutput out, long[] array)
          Writes an array of long values.
 void writeLongIntMap(java.io.DataOutput out, java.util.Map<java.lang.Long,java.lang.Integer> map)
          Writes a Map of Long key and Integer value pairs.
 void writeSafeUTF(java.io.DataOutput out, java.lang.String value)
           
 void writeSerializable(java.io.DataOutput out, java.io.Serializable value)
           
 void writeStringList(java.io.DataOutput out, java.util.List stringList)
          Writes a List of Strings.
 void writeStringMap(java.io.DataOutput out, java.util.Map<java.lang.String,java.lang.String> stringMap)
          Writes a Map of String key and value pairs.
 void writeStrings(java.io.DataOutput out, java.util.Collection<java.lang.String> collection)
           
 void writeStringsMap(java.io.DataOutput out, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
           
 

Method Detail

writeStringMap

void writeStringMap(java.io.DataOutput out,
                    java.util.Map<java.lang.String,java.lang.String> stringMap)
                    throws java.io.IOException
Writes a Map of String key and value pairs. This method handles the case when the Map is null.

Parameters:
out - the output stream.
stringMap - the Map of String key/value pairs.
Throws:
java.io.IOException - if an error occurs.

readStringMap

java.util.Map<java.lang.String,java.lang.String> readStringMap(java.io.DataInput in)
                                                               throws java.io.IOException
Reads a Map of String key and value pairs. This method will return null if the Map written to the stream was null.

Parameters:
in - the input stream.
Returns:
a Map of String key/value pairs.
Throws:
java.io.IOException - if an error occurs.

writeLongIntMap

void writeLongIntMap(java.io.DataOutput out,
                     java.util.Map<java.lang.Long,java.lang.Integer> map)
                     throws java.io.IOException
Writes a Map of Long key and Integer value pairs. This method handles the case when the Map is null.

Parameters:
out - the output stream.
map - the Map of Long key/Integer value pairs.
Throws:
java.io.IOException - if an error occurs.

readLongIntMap

java.util.Map readLongIntMap(java.io.DataInput in)
                             throws java.io.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.

Parameters:
in - the input stream.
Returns:
a Map of Long key/Integer value pairs.
Throws:
java.io.IOException - if an error occurs.

writeStringList

void writeStringList(java.io.DataOutput out,
                     java.util.List stringList)
                     throws java.io.IOException
Writes a List of Strings. This method handles the case when the List is null.

Parameters:
out - the output stream.
stringList - the List of Strings.
Throws:
java.io.IOException - if an error occurs.

readStringList

java.util.List<java.lang.String> readStringList(java.io.DataInput in)
                                                throws java.io.IOException
Reads a List of Strings. This method will return null if the List written to the stream was null.

Parameters:
in - the input stream.
Returns:
a List of Strings.
Throws:
java.io.IOException - if an error occurs.

writeLongArray

void writeLongArray(java.io.DataOutput out,
                    long[] array)
                    throws java.io.IOException
Writes an array of long values. This method handles the case when the array is null.

Parameters:
out - the output stream.
array - the array of long values.
Throws:
java.io.IOException - if an error occurs.

readLongArray

long[] readLongArray(java.io.DataInput in)
                     throws java.io.IOException
Reads an array of long values. This method will return null if the array written to the stream was null.

Parameters:
in - the input stream.
Returns:
an array of long values.
Throws:
java.io.IOException - if an error occurs.

writeLong

void writeLong(java.io.DataOutput out,
               long value)
               throws java.io.IOException
Throws:
java.io.IOException

readLong

long readLong(java.io.DataInput in)
              throws java.io.IOException
Throws:
java.io.IOException

writeBoolean

void writeBoolean(java.io.DataOutput out,
                  boolean value)
                  throws java.io.IOException
Throws:
java.io.IOException

readBoolean

boolean readBoolean(java.io.DataInput in)
                    throws java.io.IOException
Throws:
java.io.IOException

writeByteArray

void writeByteArray(java.io.DataOutput out,
                    byte[] value)
                    throws java.io.IOException
Throws:
java.io.IOException

readByteArray

byte[] readByteArray(java.io.DataInput in)
                     throws java.io.IOException
Throws:
java.io.IOException

writeSerializable

void writeSerializable(java.io.DataOutput out,
                       java.io.Serializable value)
                       throws java.io.IOException
Throws:
java.io.IOException

readSerializable

java.io.Serializable readSerializable(java.io.DataInput in)
                                      throws java.io.IOException
Throws:
java.io.IOException

writeSafeUTF

void writeSafeUTF(java.io.DataOutput out,
                  java.lang.String value)
                  throws java.io.IOException
Throws:
java.io.IOException

readSafeUTF

java.lang.String readSafeUTF(java.io.DataInput in)
                             throws java.io.IOException
Throws:
java.io.IOException

writeExternalizableCollection

void writeExternalizableCollection(java.io.DataOutput out,
                                   java.util.Collection<? extends java.io.Externalizable> value)
                                   throws java.io.IOException
Throws:
java.io.IOException

readExternalizableCollection

int readExternalizableCollection(java.io.DataInput in,
                                 java.util.Collection<? extends java.io.Externalizable> value,
                                 java.lang.ClassLoader loader)
                                 throws java.io.IOException
Throws:
java.io.IOException

writeExternalizableMap

void writeExternalizableMap(java.io.DataOutput out,
                            java.util.Map<java.lang.String,? extends java.io.Externalizable> map)
                            throws java.io.IOException
Throws:
java.io.IOException

readExternalizableMap

int readExternalizableMap(java.io.DataInput in,
                          java.util.Map<java.lang.String,? extends java.io.Externalizable> map,
                          java.lang.ClassLoader loader)
                          throws java.io.IOException
Throws:
java.io.IOException

writeStringsMap

void writeStringsMap(java.io.DataOutput out,
                     java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
                     throws java.io.IOException
Throws:
java.io.IOException

readStringsMap

int readStringsMap(java.io.DataInput in,
                   java.util.Map<java.lang.String,java.util.Set<java.lang.String>> map)
                   throws java.io.IOException
Throws:
java.io.IOException

writeStrings

void writeStrings(java.io.DataOutput out,
                  java.util.Collection<java.lang.String> collection)
                  throws java.io.IOException
Throws:
java.io.IOException

readStrings

int readStrings(java.io.DataInput in,
                java.util.Collection<java.lang.String> collection)
                throws java.io.IOException
Throws:
java.io.IOException

writeInt

void writeInt(java.io.DataOutput out,
              int value)
              throws java.io.IOException
Throws:
java.io.IOException

readInt

int readInt(java.io.DataInput in)
            throws java.io.IOException
Throws:
java.io.IOException