1 /*
  2  * Copyright © [2008-2009] Novell, Inc.  All Rights Reserved.
  3  * 
  4  * USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE DEVELOPER LICENSE AGREEMENT
  5  * OR OTHER AGREEMENT THROUGH WHICH NOVELL, INC. MAKES THE WORK AVAILABLE.  THIS WORK 
  6  * MAY NOT BE ADAPTED WITHOUT NOVELL'S PRIOR WRITTEN CONSENT.
  7  * 
  8  * NOVELL PROVIDES THE WORK "AS IS," WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, 
  9  * INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR 
 10  * A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  NOVELL, THE AUTHORS OF THE WORK, AND THE 
 11  * OWNERS OF COPYRIGHT IN THE WORK ARE NOT LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER 
 12  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, 
 13  * OR IN CONNECTION WITH THE WORK OR THE USE OR OTHER DEALINGS IN THE WORK.
 14  */
 15 
 16 /**
 17  * @fileoverview
 18  * This file defines the EventSource class, which represents the Event Sources in ESM
 19  * @name EventSource Class
 20  */
 21 
 22 /**
 23  * This class represents the Event Sources in ESM.
 24  * Event Source represent the original sources of event data. This class provides methods 
 25  * to control them in ESM.
 26  * @author   Novell Engineering
 27  * @version  6.1
 28  * @constructor
 29  * @param {String} uuid  UUID of the event source in ESM
 30  */
 31 function EventSource(uuid) {
 32 	
 33 	if (typeof uuid != "undefined" && typeof ESM != "undefined") {
 34 		this.UUID = uuid;
 35 		this.eventSourceObject = ESM.sourceForId(this.UUID);
 36 	}
 37 	
 38 	/**
 39 	 * Starts this EventSource in ESM.
 40 	 */
 41 	this.start = function(){
 42 		if (typeof this.eventSourceObject != "undefined") {
 43 			this.eventSourceObject.start();
 44 		}
 45 	};
 46 			
 47 	/**
 48 	 * Stops this EventSource in ESM.
 49 	 */
 50 	this.stop = function(){
 51 		if (typeof this.eventSourceObject != "undefined") {
 52 			this.eventSourceObject.stop();
 53 		}
 54 	};
 55 }
 56 
 57