Exemple #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (DatasourceName != null)
         {
             hashCode = hashCode * 59 + DatasourceName.GetHashCode();
         }
         if (DatasourceSvcPropName != null)
         {
             hashCode = hashCode * 59 + DatasourceSvcPropName.GetHashCode();
         }
         if (DriverClassName != null)
         {
             hashCode = hashCode * 59 + DriverClassName.GetHashCode();
         }
         if (Url != null)
         {
             hashCode = hashCode * 59 + Url.GetHashCode();
         }
         if (Username != null)
         {
             hashCode = hashCode * 59 + Username.GetHashCode();
         }
         if (Password != null)
         {
             hashCode = hashCode * 59 + Password.GetHashCode();
         }
         if (DefaultAutoCommit != null)
         {
             hashCode = hashCode * 59 + DefaultAutoCommit.GetHashCode();
         }
         if (DefaultReadOnly != null)
         {
             hashCode = hashCode * 59 + DefaultReadOnly.GetHashCode();
         }
         if (DefaultTransactionIsolation != null)
         {
             hashCode = hashCode * 59 + DefaultTransactionIsolation.GetHashCode();
         }
         if (DefaultCatalog != null)
         {
             hashCode = hashCode * 59 + DefaultCatalog.GetHashCode();
         }
         if (MaxActive != null)
         {
             hashCode = hashCode * 59 + MaxActive.GetHashCode();
         }
         if (MaxIdle != null)
         {
             hashCode = hashCode * 59 + MaxIdle.GetHashCode();
         }
         if (MinIdle != null)
         {
             hashCode = hashCode * 59 + MinIdle.GetHashCode();
         }
         if (InitialSize != null)
         {
             hashCode = hashCode * 59 + InitialSize.GetHashCode();
         }
         if (MaxWait != null)
         {
             hashCode = hashCode * 59 + MaxWait.GetHashCode();
         }
         if (MaxAge != null)
         {
             hashCode = hashCode * 59 + MaxAge.GetHashCode();
         }
         if (TestOnBorrow != null)
         {
             hashCode = hashCode * 59 + TestOnBorrow.GetHashCode();
         }
         if (TestOnReturn != null)
         {
             hashCode = hashCode * 59 + TestOnReturn.GetHashCode();
         }
         if (TestWhileIdle != null)
         {
             hashCode = hashCode * 59 + TestWhileIdle.GetHashCode();
         }
         if (ValidationQuery != null)
         {
             hashCode = hashCode * 59 + ValidationQuery.GetHashCode();
         }
         if (ValidationQueryTimeout != null)
         {
             hashCode = hashCode * 59 + ValidationQueryTimeout.GetHashCode();
         }
         if (TimeBetweenEvictionRunsMillis != null)
         {
             hashCode = hashCode * 59 + TimeBetweenEvictionRunsMillis.GetHashCode();
         }
         if (MinEvictableIdleTimeMillis != null)
         {
             hashCode = hashCode * 59 + MinEvictableIdleTimeMillis.GetHashCode();
         }
         if (ConnectionProperties != null)
         {
             hashCode = hashCode * 59 + ConnectionProperties.GetHashCode();
         }
         if (InitSQL != null)
         {
             hashCode = hashCode * 59 + InitSQL.GetHashCode();
         }
         if (JdbcInterceptors != null)
         {
             hashCode = hashCode * 59 + JdbcInterceptors.GetHashCode();
         }
         if (ValidationInterval != null)
         {
             hashCode = hashCode * 59 + ValidationInterval.GetHashCode();
         }
         if (LogValidationErrors != null)
         {
             hashCode = hashCode * 59 + LogValidationErrors.GetHashCode();
         }
         if (DatasourceSvcProperties != null)
         {
             hashCode = hashCode * 59 + DatasourceSvcProperties.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #2
0
 protected override void OnStart()
 {
     MaxWait = MaxWait.Clamp(1000, 10000);
 }
Exemple #3
0
        /// <summary>
        /// Returns true if OrgApacheSlingDatasourceDataSourceFactoryProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of OrgApacheSlingDatasourceDataSourceFactoryProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrgApacheSlingDatasourceDataSourceFactoryProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     DatasourceName == other.DatasourceName ||
                     DatasourceName != null &&
                     DatasourceName.Equals(other.DatasourceName)
                     ) &&
                 (
                     DatasourceSvcPropName == other.DatasourceSvcPropName ||
                     DatasourceSvcPropName != null &&
                     DatasourceSvcPropName.Equals(other.DatasourceSvcPropName)
                 ) &&
                 (
                     DriverClassName == other.DriverClassName ||
                     DriverClassName != null &&
                     DriverClassName.Equals(other.DriverClassName)
                 ) &&
                 (
                     Url == other.Url ||
                     Url != null &&
                     Url.Equals(other.Url)
                 ) &&
                 (
                     Username == other.Username ||
                     Username != null &&
                     Username.Equals(other.Username)
                 ) &&
                 (
                     Password == other.Password ||
                     Password != null &&
                     Password.Equals(other.Password)
                 ) &&
                 (
                     DefaultAutoCommit == other.DefaultAutoCommit ||
                     DefaultAutoCommit != null &&
                     DefaultAutoCommit.Equals(other.DefaultAutoCommit)
                 ) &&
                 (
                     DefaultReadOnly == other.DefaultReadOnly ||
                     DefaultReadOnly != null &&
                     DefaultReadOnly.Equals(other.DefaultReadOnly)
                 ) &&
                 (
                     DefaultTransactionIsolation == other.DefaultTransactionIsolation ||
                     DefaultTransactionIsolation != null &&
                     DefaultTransactionIsolation.Equals(other.DefaultTransactionIsolation)
                 ) &&
                 (
                     DefaultCatalog == other.DefaultCatalog ||
                     DefaultCatalog != null &&
                     DefaultCatalog.Equals(other.DefaultCatalog)
                 ) &&
                 (
                     MaxActive == other.MaxActive ||
                     MaxActive != null &&
                     MaxActive.Equals(other.MaxActive)
                 ) &&
                 (
                     MaxIdle == other.MaxIdle ||
                     MaxIdle != null &&
                     MaxIdle.Equals(other.MaxIdle)
                 ) &&
                 (
                     MinIdle == other.MinIdle ||
                     MinIdle != null &&
                     MinIdle.Equals(other.MinIdle)
                 ) &&
                 (
                     InitialSize == other.InitialSize ||
                     InitialSize != null &&
                     InitialSize.Equals(other.InitialSize)
                 ) &&
                 (
                     MaxWait == other.MaxWait ||
                     MaxWait != null &&
                     MaxWait.Equals(other.MaxWait)
                 ) &&
                 (
                     MaxAge == other.MaxAge ||
                     MaxAge != null &&
                     MaxAge.Equals(other.MaxAge)
                 ) &&
                 (
                     TestOnBorrow == other.TestOnBorrow ||
                     TestOnBorrow != null &&
                     TestOnBorrow.Equals(other.TestOnBorrow)
                 ) &&
                 (
                     TestOnReturn == other.TestOnReturn ||
                     TestOnReturn != null &&
                     TestOnReturn.Equals(other.TestOnReturn)
                 ) &&
                 (
                     TestWhileIdle == other.TestWhileIdle ||
                     TestWhileIdle != null &&
                     TestWhileIdle.Equals(other.TestWhileIdle)
                 ) &&
                 (
                     ValidationQuery == other.ValidationQuery ||
                     ValidationQuery != null &&
                     ValidationQuery.Equals(other.ValidationQuery)
                 ) &&
                 (
                     ValidationQueryTimeout == other.ValidationQueryTimeout ||
                     ValidationQueryTimeout != null &&
                     ValidationQueryTimeout.Equals(other.ValidationQueryTimeout)
                 ) &&
                 (
                     TimeBetweenEvictionRunsMillis == other.TimeBetweenEvictionRunsMillis ||
                     TimeBetweenEvictionRunsMillis != null &&
                     TimeBetweenEvictionRunsMillis.Equals(other.TimeBetweenEvictionRunsMillis)
                 ) &&
                 (
                     MinEvictableIdleTimeMillis == other.MinEvictableIdleTimeMillis ||
                     MinEvictableIdleTimeMillis != null &&
                     MinEvictableIdleTimeMillis.Equals(other.MinEvictableIdleTimeMillis)
                 ) &&
                 (
                     ConnectionProperties == other.ConnectionProperties ||
                     ConnectionProperties != null &&
                     ConnectionProperties.Equals(other.ConnectionProperties)
                 ) &&
                 (
                     InitSQL == other.InitSQL ||
                     InitSQL != null &&
                     InitSQL.Equals(other.InitSQL)
                 ) &&
                 (
                     JdbcInterceptors == other.JdbcInterceptors ||
                     JdbcInterceptors != null &&
                     JdbcInterceptors.Equals(other.JdbcInterceptors)
                 ) &&
                 (
                     ValidationInterval == other.ValidationInterval ||
                     ValidationInterval != null &&
                     ValidationInterval.Equals(other.ValidationInterval)
                 ) &&
                 (
                     LogValidationErrors == other.LogValidationErrors ||
                     LogValidationErrors != null &&
                     LogValidationErrors.Equals(other.LogValidationErrors)
                 ) &&
                 (
                     DatasourceSvcProperties == other.DatasourceSvcProperties ||
                     DatasourceSvcProperties != null &&
                     DatasourceSvcProperties.Equals(other.DatasourceSvcProperties)
                 ));
        }
Exemple #4
0
        public override XmlElement Export(XmlDocument doc, XmlElement parent)
        {
            XmlElement current = base.Export(doc, parent);

            if (ActiveFrom != null)
            {
                current.SetAttribute("ACTIVE_FROM", ActiveFrom.ToString());
            }
            if (ActiveTill != null)
            {
                current.SetAttribute("ACTIVE_TILL", ActiveTill.ToString());
            }
            if (Confcal != null)
            {
                current.SetAttribute("CONFCAL", Confcal.ToString());
            }
            if (Date != null)
            {
                current.SetAttribute("DATE", Date.ToString());
            }
            if (Days != null)
            {
                current.SetAttribute("DAYS", Days.ToString());
            }
            if (DaysAndOr != null)
            {
                current.SetAttribute("DAYS_AND_OR", DaysAndOr.ToString());
            }
            if (DaysCal != null)
            {
                current.SetAttribute("DAYSCAL", DaysCal.ToString());
            }
            if (Level != null)
            {
                current.SetAttribute("LEVEL", Level.ToString());
            }
            if (MaxWait != null)
            {
                current.SetAttribute("MAXWAIT", MaxWait.ToString());
            }
            if (Retro != null)
            {
                current.SetAttribute("RETRO", Retro.ToString());
            }
            if (Shift != null)
            {
                current.SetAttribute("SHIFT", Shift.ToString());
            }
            if (ShiftNum != null)
            {
                current.SetAttribute("SHIFTNUM", ShiftNum.ToString());
            }
            if (TagsActiveFrom != null)
            {
                current.SetAttribute("TAGS_ACTIVE_FROM", TagsActiveFrom.ToString());
            }
            if (TagsActiveTill != null)
            {
                current.SetAttribute("TAGS_ACTIVE_TILL", TagsActiveTill.ToString());
            }
            if (WeekDays != null)
            {
                current.SetAttribute("WEEKDAYS", WeekDays.ToString());
            }
            if (Weekscal != null)
            {
                current.SetAttribute("WEEKSCAL", Weekscal.ToString());
            }
            if (JAN != null)
            {
                current.SetAttribute("JAN", JAN.ToString());
            }
            if (FEB != null)
            {
                current.SetAttribute("FEB", FEB.ToString());
            }
            if (MAR != null)
            {
                current.SetAttribute("MAR", MAR.ToString());
            }
            if (APR != null)
            {
                current.SetAttribute("APR", APR.ToString());
            }
            if (MAY != null)
            {
                current.SetAttribute("MAY", MAY.ToString());
            }
            if (JUN != null)
            {
                current.SetAttribute("JUN", JUN.ToString());
            }
            if (JUL != null)
            {
                current.SetAttribute("JUL", JUL.ToString());
            }
            if (AUG != null)
            {
                current.SetAttribute("AUG", AUG.ToString());
            }
            if (SEP != null)
            {
                current.SetAttribute("SEP", SEP.ToString());
            }
            if (OCT != null)
            {
                current.SetAttribute("OCT", OCT.ToString());
            }
            if (NOV != null)
            {
                current.SetAttribute("NOV", NOV.ToString());
            }
            if (DEC != null)
            {
                current.SetAttribute("DEC", DEC.ToString());
            }
            return(current);
        }