org.cip4.elk.impl.subscriptions
Class SubscriptionImpl

java.lang.Object
  extended by org.cip4.elk.impl.subscriptions.SubscriptionImpl
All Implemented Interfaces:
org.cip4.elk.jmf.Subscription

public class SubscriptionImpl
extends java.lang.Object
implements org.cip4.elk.jmf.Subscription

Implements an internal representation of a subscription. The class is used to store information about a subscription. A Subscription element consists of:

NOTE: The Query/@ID is the same as the getId()which is also the same as the channelID.

Version:
$Id$
Author:
Ola Stering, olst6875@student.uu.se

Field Summary
 
Fields inherited from interface org.cip4.elk.jmf.Subscription
EVENT_TYPE, TIME_TYPE
 
Constructor Summary
SubscriptionImpl(java.lang.String deviceID, org.cip4.jdflib.jmf.JDFQuery q, java.lang.String url)
          Creates a Subscription element.
 
Method Summary
 void cancelTimer()
          Cancel this Subscription's Timer.
 java.lang.String getId()
           
 java.lang.String getMessageType()
           
 org.cip4.jdflib.jmf.JDFQuery getQuery()
           
 int getRepeatStep()
           
 java.lang.String getType()
           
 java.lang.String getUrl()
           
 boolean isRepeatStepSubscription()
           
 void setRepeatStep(int repeatStep)
          Sets the RepeatStep attribute of this Subscription.
 void setTimer(java.util.Timer t)
          Sets a Timer for this Subscription.
 void setType(java.lang.String type)
          Sets the type of the subscription.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubscriptionImpl

public SubscriptionImpl(java.lang.String deviceID,
                        org.cip4.jdflib.jmf.JDFQuery q,
                        java.lang.String url)
Creates a Subscription element.

Parameters:
deviceID - The if of the Device that this Query was sent.
q - A Query containing a Subscription element.
url - The url to which the Signals should be sent.
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMessageType

public java.lang.String getMessageType()
Specified by:
getMessageType in interface org.cip4.elk.jmf.Subscription

getType

public java.lang.String getType()
Specified by:
getType in interface org.cip4.elk.jmf.Subscription

setType

public void setType(java.lang.String type)
Sets the type of the subscription.

Parameters:
type - the type. use Subscription.EVENT_TYPEand Subscription.TIME_TYPEto set this value.
Throws:
java.lang.IllegalArgumentException - if type is not Subscription.EVENT_TYPEor Subscription.TIME_TYPE.
See Also:
getType()

getQuery

public org.cip4.jdflib.jmf.JDFQuery getQuery()
Specified by:
getQuery in interface org.cip4.elk.jmf.Subscription

setTimer

public void setTimer(java.util.Timer t)
Sets a Timer for this Subscription.

Parameters:
t - the Timer to be set.

cancelTimer

public void cancelTimer()
Cancel this Subscription's Timer.


getId

public java.lang.String getId()
Specified by:
getId in interface org.cip4.elk.jmf.Subscription

getUrl

public java.lang.String getUrl()
Specified by:
getUrl in interface org.cip4.elk.jmf.Subscription

setRepeatStep

public void setRepeatStep(int repeatStep)
Sets the RepeatStep attribute of this Subscription.

Parameters:
repeatStep -

isRepeatStepSubscription

public boolean isRepeatStepSubscription()
Specified by:
isRepeatStepSubscription in interface org.cip4.elk.jmf.Subscription

getRepeatStep

public int getRepeatStep()
Specified by:
getRepeatStep in interface org.cip4.elk.jmf.Subscription


Copyright © 2004-2009 CIP4. All Rights Reserved.