<commit_before>package org.yamcs.commanding;

import java.util.Date;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;

import org.yamcs.YProcessor;
import org.yamcs.security.Privilege;
import org.yamcs.parameter.SystemParametersCollector;
import org.yamcs.protobuf.Commanding.QueueState;
import org.yamcs.protobuf.Pvalue.ParameterValue;
import org.yamcs.protobuf.Yamcs.NamedObjectId;
import org.yamcs.protobuf.Pvalue;

public class CommandQueue {
    String name;
    private ConcurrentLinkedQueue<PreparedCommand> commands=new ConcurrentLinkedQueue<PreparedCommand>();
    QueueState defaultState=QueueState.BLOCKED;
    QueueState state=QueueState.BLOCKED;
    YProcessor processor;

    int nbSentCommands = 0;
    int nbRejectedCommands = 0;
    int stateExpirationTimeS = 0;


    int stateExpirationRemainingS = 0;
    Runnable stateExpirationJob = null;
    
    List<String> roles;
    List<String> significances;
    NamedObjectId sp_queueState_id;
    NamedObjectId sp_numSentCommands_id;
    NamedObjectId sp_numRejectedCommands_id;
    NamedObjectId sp_numCommands_id;

    CommandQueue(YProcessor channel, String name) {
        this.processor=channel;
        this.name=name;
        if(!Privilege.getInstance().isEnabled()) state=QueueState.ENABLED;
    }

    void setupSysParameters() {
        SystemParametersCollector sysParamCollector = SystemParametersCollector.getInstance(processor.getInstance());
        sp_queueState_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/state").build();
        sp_numCommands_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/numCommands").build();
        sp_numSentCommands_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/numSentCommands").build();
        sp_numRejectedCommands_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/"+name+"/numRejectedCommands").build();
    }

    public ConcurrentLinkedQueue<PreparedCommand> getCommands() {
        return commands;
    }

    public String getName() {<commit_msg>fixed the sysparam name<commit_after>package org.yamcs.commanding;

import java.util.Date;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;

import org.yamcs.YProcessor;
import org.yamcs.security.Privilege;
import org.yamcs.parameter.SystemParametersCollector;
import org.yamcs.protobuf.Commanding.QueueState;
import org.yamcs.protobuf.Pvalue.ParameterValue;
import org.yamcs.protobuf.Yamcs.NamedObjectId;
import org.yamcs.protobuf.Pvalue;

public class CommandQueue {
    String name;
    private ConcurrentLinkedQueue<PreparedCommand> commands=new ConcurrentLinkedQueue<PreparedCommand>();
    QueueState defaultState=QueueState.BLOCKED;
    QueueState state=QueueState.BLOCKED;
    YProcessor processor;

    int nbSentCommands = 0;
    int nbRejectedCommands = 0;
    int stateExpirationTimeS = 0;


    int stateExpirationRemainingS = 0;
    Runnable stateExpirationJob = null;
    
    List<String> roles;
    List<String> significances;
    NamedObjectId sp_queueState_id;
    NamedObjectId sp_numSentCommands_id;
    NamedObjectId sp_numRejectedCommands_id;
    NamedObjectId sp_numCommands_id;

    CommandQueue(YProcessor channel, String name) {
        this.processor=channel;
        this.name=name;
        if(!Privilege.getInstance().isEnabled()) state=QueueState.ENABLED;
    }

    void setupSysParameters() {
        SystemParametersCollector sysParamCollector = SystemParametersCollector.getInstance(processor.getInstance());
        sp_queueState_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/state").build();
        sp_numCommands_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/numCommands").build();
        sp_numSentCommands_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/numSentCommands").build();
        sp_numRejectedCommands_id = NamedObjectId.newBuilder().setName(sysParamCollector.getNamespace()+"/cmdQueue/"+name+"/numRejectedCommands").build();
    }

    public ConcurrentLinkedQueue<PreparedCommand> getCommands() {
        return commands;
    }

    public String getName() {
{'fraction_non_alphanumeric': 0.10316556593031201, 'fraction_numerical': 0.0018219084491004327, 'mean_word_length': 5.041265474552957, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '2014184', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1313, 'n_words': 193}