Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit

ie.ncl.sms.lm
Class MemoryCache

java.lang.Object
  extended by ie.ncl.sms.lm.MemoryCache
All Implemented Interfaces:
Cache

public class MemoryCache
extends java.lang.Object
implements Cache

This class is used to store fragments of a long message. If all fragments are not received within the expiry time then the message fragments are discarded.


Field Summary
static int DEFAULT_EXPIRY
          Default Expiry is 600000 micro seconds or 10 minutes.
 
Constructor Summary
MemoryCache()
           
MemoryCache(int expiry)
           
 
Method Summary
 boolean addReceivedFragment(Message message, int reference, int fragments, int sequence)
          Add a message fragment to the cache.
 Message[] getReassembledMessage()
          This returns the next available complete message fragment set in the cache.
 void purge()
          This purges the cache of any unwanted messages.
 int size()
          This returns the number of message fragments in the cache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EXPIRY

public static final int DEFAULT_EXPIRY
Default Expiry is 600000 micro seconds or 10 minutes.

See Also:
Constant Field Values
Constructor Detail

MemoryCache

public MemoryCache()

MemoryCache

public MemoryCache(int expiry)
Method Detail

addReceivedFragment

public boolean addReceivedFragment(Message message,
                                   int reference,
                                   int fragments,
                                   int sequence)
Add a message fragment to the cache. This returns true if the added fragment results in a complete message being present in the cache.

Specified by:
addReceivedFragment in interface Cache

getReassembledMessage

public Message[] getReassembledMessage()
This returns the next available complete message fragment set in the cache. Null is returned if nothing is available.

Specified by:
getReassembledMessage in interface Cache

purge

public void purge()
This purges the cache of any unwanted messages.

Specified by:
purge in interface Cache

size

public int size()
This returns the number of message fragments in the cache.

Specified by:
size in interface Cache

Experts in SMS and MMS Technology. NCLs Provato is an SMS/MMS Gateway supporting  WAP Push, EMS, MMS, SMS, Nokia Smart Messaging, SMPP, CIMD, UCP, MM7, M20, TC35 NCL Technologies Ltd
Provato - SMS MMS Gateway
Mobile Messaging in J2EE & .NET

SwiftNote - Java SMS Toolkit