org.psepr.jClient
Class EventExtension

java.lang.Object
  extended by org.psepr.jClient.EventExtension
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension, org.jivesoftware.smack.provider.PacketExtensionProvider

public class EventExtension
extends java.lang.Object
implements org.jivesoftware.smack.packet.PacketExtension, org.jivesoftware.smack.provider.PacketExtensionProvider

Class to handle the interface between the Smack packet extensions and the PsEPR events. This makes this class a little muddled since it acts as both the container for the data (PacketExtension/EventExtension) and the processor of the Event part of the packets as they come in. Thus there is a constructor that passes an PsEPREvent which creates the container view and a constructor that takes a lease collection. Don't be confused by this class' two faces.

Author:
Robert.Adams@intel.com

Constructor Summary
EventExtension()
           
EventExtension(LeaseCollection lc)
          Create an instance when used as a PacketExtensionProvider
EventExtension(PsEPREvent ev)
           
 
Method Summary
 java.lang.String getElementName()
          Return the element name.
 PsEPREvent getEvent()
           
 LeaseCollection getLeaseCollection()
           
 java.lang.String getNamespace()
          Return the namespace.
 org.jivesoftware.smack.packet.PacketExtension parseExtension(org.xmlpull.v1.XmlPullParser parser)
           
 void setEvent(PsEPREvent ev)
           
 void setLeaseCollection(LeaseCollection lc)
           
 java.lang.String toXML()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventExtension

public EventExtension()

EventExtension

public EventExtension(LeaseCollection lc)
Create an instance when used as a PacketExtensionProvider

Parameters:
lc -

EventExtension

public EventExtension(PsEPREvent ev)
Method Detail

getElementName

public java.lang.String getElementName()
Return the element name. This always is processing an 'event'.

Specified by:
getElementName in interface org.jivesoftware.smack.packet.PacketExtension
See Also:
PacketExtension.getElementName()

getNamespace

public java.lang.String getNamespace()
Return the namespace. This alwasys is processing an 'event'.

Specified by:
getNamespace in interface org.jivesoftware.smack.packet.PacketExtension
See Also:
PacketExtension.getNamespace()

getEvent

public PsEPREvent getEvent()

setEvent

public void setEvent(PsEPREvent ev)

getLeaseCollection

public LeaseCollection getLeaseCollection()

setLeaseCollection

public void setLeaseCollection(LeaseCollection lc)

toXML

public java.lang.String toXML()
Specified by:
toXML in interface org.jivesoftware.smack.packet.PacketExtension

parseExtension

public org.jivesoftware.smack.packet.PacketExtension parseExtension(org.xmlpull.v1.XmlPullParser parser)
                                                             throws java.lang.Exception
Specified by:
parseExtension in interface org.jivesoftware.smack.provider.PacketExtensionProvider
Throws:
java.lang.Exception
See Also:
PacketExtensionProvider.parseExtension(org.xmlpull.v1.XmlPullParser)