<commit_before>package blended.jms.utils

import java.util.Date

import akka.actor.ActorRef

sealed trait JmsConnectionState {
  val name : String = getClass().getSimpleName()
  override def toString: String = name
}

case object Connected extends JmsConnectionState { override val name: String = "Connected" }
case object Connecting extends JmsConnectionState { override val name: String = "Connecting"}
case object Closing extends JmsConnectionState { override val name : String = "Closing"}
case object Disconnected extends JmsConnectionState { override val name: String = "Disconnected" }
case class RestartContainer(reason : Throwable) extends JmsConnectionState { override val name : String = "RestartContainer" }

//scalastyle:off magic.number
case class ConnectionState(
  vendor : String,
  provider : String,
  status : JmsConnectionState = Disconnected,
  lastConnect : Option[Date] = None,
  lastDisconnect : Option[Date] = None,
  missedKeepAlives : Int = 0,
  maxEvents : Int = 20,
  events : List[String] = List.empty,
  firstReconnectAttempt : Option[Date] = None,
  lastConnectAttempt : Option[Date] = None,
  controller : Option[ActorRef] = None
) {
  override def toString: String = s"${getClass().getSimpleName()}(vendor=$vendor, provider=$provider, status=$status," +
    s" lastConnect=$lastConnect, lastDisconnect=$lastDisconnect, missedKeepAlives=$missedKeepAlives," +
    s" firstReconnectAttempt=$firstReconnectAttempt, lastConnectAttempt=$lastConnectAttempt)"
}
//scalastyle:on magic.number<commit_msg>Ajusting state names for JMS Connection State<commit_after>package blended.jms.utils

import java.util.Date

import akka.actor.ActorRef

sealed trait JmsConnectionState

case object Connected extends JmsConnectionState { override def toString : String = "Connected" }
case object Connecting extends JmsConnectionState { override def toString : String = "Connecting"}
case object Closing extends JmsConnectionState { override def toString  : String = "Closing"}
case object Disconnected extends JmsConnectionState { override def toString : String = "Disconnected" }
case class RestartContainer(reason : Throwable) extends JmsConnectionState {
  override def toString : String = s"RestartContainer(${reason.getMessage()})"
}

//scalastyle:off magic.number
case class ConnectionState(
  vendor : String,
  provider : String,
  status : JmsConnectionState = Disconnected,
  lastConnect : Option[Date] = None,
  lastDisconnect : Option[Date] = None,
  missedKeepAlives : Int = 0,
  maxEvents : Int = 20,
  events : List[String] = List.empty,
  firstReconnectAttempt : Option[Date] = None,
  lastConnectAttempt : Option[Date] = None,
  controller : Option[ActorRef] = None
) {
  override def toString: String = s"${getClass().getSimpleName()}(vendor=$vendor, provider=$provider, status=$status," +
    s" lastConnect=$lastConnect, lastDisconnect=$lastDisconnect, missedKeepAlives=$missedKeepAlives," +
    s" firstReconnectAttempt=$firstReconnectAttempt, lastConnectAttempt=$lastConnectAttempt)"
}
//scalastyle:on magic.number
{'fraction_non_alphanumeric': 0.09806493932436865, 'fraction_numerical': 0.0019678583142013774, 'mean_word_length': 5.916099773242631, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6442328', 'n_tokens_mistral': 856, 'n_tokens_neox': 848, 'n_words': 238}