<commit_before>package org.alien4cloud.tosca.model;

import static alien4cloud.dao.model.FetchContext.SUMMARY;

import java.util.Date;
import java.util.List;
import java.util.Set;

import org.elasticsearch.annotation.*;
import org.elasticsearch.annotation.query.FetchContext;
import org.elasticsearch.annotation.query.TermFilter;
import org.elasticsearch.mapping.IndexType;

import alien4cloud.exception.IndexingServiceException;
import alien4cloud.model.common.Tag;
import alien4cloud.security.IManagedSecuredResource;
import alien4cloud.tosca.parser.ParsingContextExecution;
import alien4cloud.utils.version.Version;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(of = { "name", "version" })
@ESObject
public class Csar implements IManagedSecuredResource {
    @TermFilter
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String name;

    @TermFilter
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String version;

    @ObjectField
    @TermFilter(paths = { "majorVersion", "minorVersion", "incrementalVersion", "buildNumber", "qualifier" })
    private Version nestedVersion;

    @TermFilter
    @StringField(indexType = IndexType.not_analyzed)
    private String workspace;

    /** This is the hashcode of all files in the archive. */
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String hash;

    /** This is the hashcode of the definition file only (yaml). */
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String definitionHash;

    /** Eventually the id of the application. */
    private String delegateId;
    /** Type of delegate if the archive is an application archive. */
    private String delegateType;

    /** Path of the yaml file in the archive (relative to the root). */
    private String yamlFilePath;

    private String toscaDefinitionsVersion;

    private String toscaDefaultNamespace;

    private String templateAuthor;

    private String description;

    @TermFilter(paths = { "name", "version" })
    @NestedObject(nestedClass = CSARDependency.class)
    private Set<CSARDependency> dependencies;

    private String license;

    /** Archive metadata. */
    private List<Tag> tags;

    /** Alien 4 Cloud meta-data to know how the archive has been imported. */
    private String importSource;
    /** Date on which the archive has been imported or updated in alien4cloud. */
    private Date importDate;

    /** Default constructor */<commit_msg>ALIEN-1766 [PREMIUM] As a USER I want to be able to move/copy an archive to another workspace<commit_after>package org.alien4cloud.tosca.model;

import static alien4cloud.dao.model.FetchContext.SUMMARY;

import java.util.Date;
import java.util.List;
import java.util.Set;

import org.elasticsearch.annotation.ESObject;
import org.elasticsearch.annotation.Id;
import org.elasticsearch.annotation.NestedObject;
import org.elasticsearch.annotation.ObjectField;
import org.elasticsearch.annotation.StringField;
import org.elasticsearch.annotation.query.FetchContext;
import org.elasticsearch.annotation.query.TermFilter;
import org.elasticsearch.annotation.query.TermsFacet;
import org.elasticsearch.mapping.IndexType;

import alien4cloud.exception.IndexingServiceException;
import alien4cloud.model.common.Tag;
import alien4cloud.security.IManagedSecuredResource;
import alien4cloud.tosca.parser.ParsingContextExecution;
import alien4cloud.utils.version.Version;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
@EqualsAndHashCode(of = { "name", "version" })
@ESObject
public class Csar implements IManagedSecuredResource {
    @TermFilter
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String name;

    @TermFilter
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String version;

    @ObjectField
    @TermFilter(paths = { "majorVersion", "minorVersion", "incrementalVersion", "buildNumber", "qualifier" })
    private Version nestedVersion;

    @TermFilter
    @StringField(indexType = IndexType.not_analyzed)
    @TermsFacet
    private String workspace;

    /** This is the hashcode of all files in the archive. */
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String hash;

    /** This is the hashcode of the definition file only (yaml). */
    @StringField(indexType = IndexType.not_analyzed)
    @FetchContext(contexts = { SUMMARY }, include = { true })
    private String definitionHash;

    /** Eventually the id of the application. */
    private String delegateId;
    /** Type of delegate if the archive is an application archive. */
    private String delegateType;

    /** Path of the yaml file in the archive (relative to the root). */
    private String yamlFilePath;

    private String toscaDefinitionsVersion;

    private String toscaDefaultNamespace;

    @TermsFacet
    @StringField(indexType = IndexType.not_analyzed, includeInAll = false)
    private String templateAuthor;

    private String description;

    @TermFilter(paths = { "name", "version" })
    @NestedObject(nestedClass = CSARDependency.class)
    private Set<CSARDependency> dependencies;

    private String license;

    /** Archive metadata. */
    private List<Tag> tags;

    /** Alien 4 Cloud meta-data to know how the archive has been imported. */
    private String importSource;
    /** Date on which the archive has been imported or updated in alien4cloud. */
    private Date importDate;

    /** Default constructor */
{'fraction_non_alphanumeric': 0.09378134403209629, 'fraction_numerical': 0.0036776997659645604, 'mean_word_length': 4.193576388888889, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5629712', 'n_tokens_mistral': 1694, 'n_tokens_neox': 1638, 'n_words': 466}