<commit_before>/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.ambari.common.rest.entities.agent;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlAdapter;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {})
public class ServerStatus {
  public String serverName;
  public State state;
  
  public ServerStatus() {  
  }
  
  public ServerStatus(String serverName, State state) {
    this.serverName = serverName;
    this.state = state;
  }

  public String getServerName() {
    return serverName;
  }
  
  public void setServerName(String serverName) {
    this.serverName = serverName;
  }
  
  public State getState() {
    return state;
  }
  
  public void setState(State state) {
    this.state = state;
  }
  
  public static enum State {
    START, STARTED, STOP, STOPPED;
    public static class ServerStateAdaptor extends XmlAdapter<String, State> {
      @Override
      public String marshal(State obj) throws Exception {
        return obj.toString();
      }

      @Override
      public State unmarshal(String str) throws Exception {
        for (State j : State.class.getEnumConstants()) {
          if (j.toString().equals(str)) {
            return j;
          }
        }
        throw new Exception("Can't convert " + str + " to "
          + State.class.getName());
      }

    }
  }<commit_msg>AMBARI-12.  Added transition state STARTING, STOPPING. (<NAME>)<commit_after>/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.ambari.common.rest.entities.agent;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlAdapter;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {})
public class ServerStatus {
  public String serverName;
  public State state;
  
  public ServerStatus() {  
  }
  
  public ServerStatus(String serverName, State state) {
    this.serverName = serverName;
    this.state = state;
  }

  public String getServerName() {
    return serverName;
  }
  
  public void setServerName(String serverName) {
    this.serverName = serverName;
  }
  
  public State getState() {
    return state;
  }
  
  public void setState(State state) {
    this.state = state;
  }
  
  public static enum State {
    START, STARTING, STARTED, STOP, STOPPING, STOPPED;
    public static class ServerStateAdaptor extends XmlAdapter<String, State> {
      @Override
      public String marshal(State obj) throws Exception {
        return obj.toString();
      }

      @Override
      public State unmarshal(String str) throws Exception {
        for (State j : State.class.getEnumConstants()) {
          if (j.toString().equals(str)) {
            return j;
          }
        }
        throw new Exception("Can't convert " + str + " to "
          + State.class.getName());
      }

    }
  }
{'fraction_non_alphanumeric': 0.08690122933446376, 'fraction_numerical': 0.00211954217888936, 'mean_word_length': 3.2096342551293486, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 10}, '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': '6038239', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1285, 'n_words': 442}