Class MultiMessagePayload
java.lang.Object
org.javarosa.core.services.transport.payload.MultiMessagePayload
- All Implemented Interfaces:
IDataPayload,Externalizable
public class MultiMessagePayload extends Object implements IDataPayload
- Author:
- Clayton Sims
-
Field Summary
Fields inherited from interface org.javarosa.core.services.transport.payload.IDataPayload
PAYLOAD_TYPE_HEADER, PAYLOAD_TYPE_JPG, PAYLOAD_TYPE_MULTI, PAYLOAD_TYPE_SMS, PAYLOAD_TYPE_TEXT, PAYLOAD_TYPE_XML -
Constructor Summary
Constructors Constructor Description MultiMessagePayload()Note: Only useful for serialization. -
Method Summary
Modifier and Type Method Description <T> Taccept(IDataPayloadVisitor<T> visitor)Visitor pattern accept method.voidaddPayload(IDataPayload payload)Adds a payload that should be sent as part of this payload.longgetLength()StringgetPayloadId()List<IDataPayload>getPayloads()InputStreamgetPayloadStream()Gets the stream for this payload.intgetPayloadType()intgetTransportId()voidreadExternal(DataInputStream in, PrototypeFactory pf)voidwriteExternal(DataOutputStream out)
-
Constructor Details
-
MultiMessagePayload
public MultiMessagePayload()Note: Only useful for serialization.
-
-
Method Details
-
addPayload
Adds a payload that should be sent as part of this payload.- Parameters:
payload- A payload that will be transmitted after all previously added payloads.
-
getPayloads
- Returns:
- A vector object containing each IDataPayload in this payload.
-
getPayloadStream
Description copied from interface:IDataPayloadGets the stream for this payload.- Specified by:
getPayloadStreamin interfaceIDataPayload- Returns:
- A stream for the data in this payload.
- Throws:
IOException
-
readExternal
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionDeserializationException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
accept
Description copied from interface:IDataPayloadVisitor pattern accept method.- Specified by:
acceptin interfaceIDataPayload- Parameters:
visitor- The visitor to visit this payload.
-
getPayloadId
- Specified by:
getPayloadIdin interfaceIDataPayload- Returns:
- A string identifying the contents of the payload
-
getPayloadType
public int getPayloadType()- Specified by:
getPayloadTypein interfaceIDataPayload- Returns:
- The type of the data encapsulated by this payload.
-
getTransportId
public int getTransportId()- Specified by:
getTransportIdin interfaceIDataPayload- Returns:
- A unique Id for the transport manager to use to be able to identify the status of transmissions related to this payload
-
getLength
public long getLength()- Specified by:
getLengthin interfaceIDataPayload
-