<commit_before>/*******************************************************************************
 * Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
 *
 * Licensed 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.cloudifysource.cosmo.agent.state;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Preconditions;
import org.cloudifysource.cosmo.TaskConsumerState;

import java.net.URI;
import java.util.List;

/**
 * State of the Agent TaskConsumer.
 * @author <NAME>
 * @since 0.1
 */
public class AgentState extends TaskConsumerState {

    /**
     * Possible values for {@link AgentState#setProgress(String)}.
     */
    public static class Progress {
        public static final String PLANNED = "PLANNED";
        public static final String MACHINE_STARTED = "MACHINE_STARTED";
        public static final String AGENT_STARTED = "AGENT_STARTED";
        public static final String MACHINE_MARKED_FOR_TERMINATION = "MACHINE_MARKED_FOR_TERMINATION";
        public static final String MACHINE_TERMINATED = "MACHINE_TERMINATED";
    }

    private String progress;
    private String ipAddress;
    private List<URI> serviceInstanceIds;
    private int numberOfAgentRestarts;
    private int numberOfMachineRestarts;
    private long lastPingSourceTimestamp;

    /**
     * Use isLifecycle(x or y or z) instead.
     * This is to encourage using the pattern of positive progress checks such as "isLifecycle(y)"
     * instead of negative progress checks such as (!getLifecycle().equals(x))
     */
    @Deprecated
    public String getProgress() {
        return progress;
    }

    /**<commit_msg>Converged AgentState.PLANNED and AgentStage.MACHINE_TERMINATED<commit_after>/*******************************************************************************
 * Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
 *
 * Licensed 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.cloudifysource.cosmo.agent.state;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Preconditions;
import org.cloudifysource.cosmo.TaskConsumerState;

import java.net.URI;
import java.util.List;

/**
 * State of the Agent TaskConsumer.
 * @author <NAME>
 * @since 0.1
 */
public class AgentState extends TaskConsumerState {

    /**
     * Possible values for {@link AgentState#setProgress(String)}.
     */
    public static class Progress {
        //TODO: Remove PLANNED state, remains here for backwards compatibility
        public static final String PLANNED = "machine_terminated";

        public static final String MACHINE_TERMINATED = "machine_terminated";
        public static final String MACHINE_STARTED = "machine_started";
        public static final String AGENT_STARTED = "agent_started";
        public static final String MACHINE_MARKED_FOR_TERMINATION = "MACHINE_MARKED_FOR_TERMINATION";
    }

    private String progress;
    private String ipAddress;
    private List<URI> serviceInstanceIds;
    private int numberOfAgentRestarts;
    private int numberOfMachineRestarts;
    private long lastPingSourceTimestamp;

    /**
     * Use isLifecycle(x or y or z) instead.
     * This is to encourage using the pattern of positive progress checks such as "isLifecycle(y)"
     * instead of negative progress checks such as (!getLifecycle().equals(x))
     */
    @Deprecated
    public String getProgress() {
        return progress;
    }

    /**
{'fraction_non_alphanumeric': 0.13834846519671423, 'fraction_numerical': 0.00432338953739732, 'mean_word_length': 3.9539614561027836, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 2}, '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': '6746821', 'n_tokens_mistral': 1208, 'n_tokens_neox': 1153, 'n_words': 424}