public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (obj == null)
            {
                return(false);
            }
            if (GetType() != obj.GetType())
            {
                return(false);
            }

            DetectionPoint other = (DetectionPoint)obj;

            /*return new EqualsBuilder().
             *              Append(id, other.getId()).
             *              Append(threshold, other.getThreshold()).
             *              Append(responses, other.getResponses()).
             *              isEquals();*/
            if (id.Equals(other.getId()) &&
                threshold.Equals(other.getThreshold()) &&
                responses.Equals(other.getResponses()))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
 private void InitClass(User user, DetectionPoint detectionPoint, string timestamp, string detectionSystemId)
 {
     setUser(user);
     setDetectionPoint(detectionPoint);
     setTimestamp(timestamp);
     setDetectionSystemId(detectionSystemId);
 }
Example #3
0
 public Event setDetectionPoint(DetectionPoint detectionPoint)
 {
     this.detectionPoint = detectionPoint;
     return(this);
 }
Example #4
0
 public Event(User user, DetectionPoint detectionPoint, string detectionSystemId)
 {
     InitClass(user, detectionPoint, DateUtils.getCurrentTimestampAsString(), detectionSystemId);
 }
Example #5
0
 public Event(User user, DetectionPoint detectionPoint, string timestamp, string detectionSystemId)
 {
     InitClass(user, detectionPoint, timestamp, detectionSystemId);
 }
 public SearchCriteria setDetectionPoint(DetectionPoint detectionPoint) {
     this.detectionPoint = detectionPoint;
     return this;
 }
	/// <exception cref="XMLStreamException"></exception>
	private DetectionPoint readDetectionPoint(XmlReader xmlReader) {
		DetectionPoint detectionPoint = new DetectionPoint();
		bool finished = false;
		
		while(!finished && xmlReader.MoveToNextAttribute()) {
			//int Event = xmlReader.next();
			string name = XmlUtils.getElementQualifiedName(xmlReader, namespaces);
			
			switch(xmlReader.NodeType) {
				case XmlNodeType.Element:
					if("config:id".Equals(name)) {
						detectionPoint.setId(xmlReader.ReadString().Trim());
					} else if("config:threshold".Equals(name)) {
						detectionPoint.setThreshold(readThreshold(xmlReader));
					} else if("config:response".Equals(name)) {
						detectionPoint.getResponses().Add(readResponse(xmlReader));
					} else {
						/** unexpected start element **/
					}
					break;
				case XmlNodeType.EndElement:
					if("config:detection-point".Equals(name)) {
						finished = true;
					} else {
						/** unexpected end element **/
					}
					break;
				default:
					/** unused xml element - nothing to do **/
					break;
			}
		}
		
		return detectionPoint;
	}
Example #8
0
 private void InitClass(User user, DetectionPoint detectionPoint, string timestamp, string detectionSystemId) {
     setUser(user);
     setDetectionPoint(detectionPoint);
     setTimestamp(timestamp);
     setDetectionSystemId(detectionSystemId);
 }
Example #9
0
	public Event setDetectionPoint(DetectionPoint detectionPoint) {
		this.detectionPoint = detectionPoint;
		return this;
	}
Example #10
0
	public Event (User user, DetectionPoint detectionPoint, string timestamp, string detectionSystemId) {
        InitClass(user, detectionPoint, timestamp, detectionSystemId);
	}
Example #11
0
	public Event (User user, DetectionPoint detectionPoint, string detectionSystemId) {
		InitClass(user, detectionPoint, DateUtils.getCurrentTimestampAsString(), detectionSystemId);
	}
	/**
	 * Locate detection point configuration from server-side config file. 
	 * 
	 * @param search detection point that has been added to the system
	 * @return DetectionPoint populated with configuration information from server-side config
	 */
	public DetectionPoint findDetectionPoint(DetectionPoint search) {
		DetectionPoint detectionPoint = null;

        //detectionPoint = detectionPointCache.get(search.getId());
        detectionPoint = detectionPointCache[search.getId()];

		if (detectionPoint == null) {
			foreach (DetectionPoint configuredDetectionPoint in getDetectionPoints()) {
				if (configuredDetectionPoint.getId().Equals(search.getId())) {
					detectionPoint = configuredDetectionPoint;
					
					//cache
					detectionPointCache.Add(detectionPoint.getId(), detectionPoint);
					
					break;
				}
			}
		}
		
		return detectionPoint;
	}
Example #13
0
 public Attack setDetectionPoint(DetectionPoint detectionPoint)
 {
     this.detectionPoint = detectionPoint;
     return(this);
 }
Example #14
0
	public Attack setDetectionPoint(DetectionPoint detectionPoint) {
		this.detectionPoint = detectionPoint;
		return this;
	}