package com.libreecm.commonAPI.model;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.libreecm.commonAPI.model.enums.*;

public class RepositoryCapabilities extends LibreECMObject {

    private static final long serialVersionUID = 2L;
    
    private Integer id;
	
	public String getId() {
		return id.toString();
	}
    
    private Boolean allVersionsSearchableSupported;
    private Boolean isPwcSearchable;
    private Boolean isPwcUpdatable;
    private Boolean supportsGetDescendants;
    private Boolean supportsGetFolderTree;
    private CapabilityOrderBy orderByCapability;
    private Boolean supportsMultifiling;
    private Boolean supportsUnfiling;
    private Boolean supportsVersionSpecificFiling;
    private NewTypeSettableAttributes newTypeSettableAttributes;
	private CapabilityRenditions renditionsCapability;
	private CapabilityAcl aclCapability;
	private CapabilityJoin joinCapability;
	private CapabilityChanges changesCapability;
	private CapabilityContentStreamUpdates contentStreamUpdatesCapability;
	private CapabilityQuery queryCapability;
	private CreatablePropertyTypes creatablePropertyTypes;


    public List<CmisExtensionElement> getCmisExtensionElements() {
		return cmisExtensionElements;
	}

	public void setCmisExtensionElements(List<CmisExtensionElement> cmisExtensionElement) {
		this.cmisExtensionElements = cmisExtensionElement;
	}

	public void setNewTypeSettableAttributes(NewTypeSettableAttributes newTypeSettableAttributes) {
		this.newTypeSettableAttributes = newTypeSettableAttributes;
	}

	public void setCreatablePropertyTypes(CreatablePropertyTypes creatablePropertyTypes) {
		this.creatablePropertyTypes = creatablePropertyTypes;
	}

	/**
    * A collection of additional properties supported by this repository
    */
	private Set<PropertyType> propertyTypeSet=new HashSet<PropertyType>();
	 
	/**
	* A collection of additional Cmis extensions elements supported by this repository
	*/
    private List<CmisExtensionElement> cmisExtensionElements;

    /**
     * Constructor.
     */
    public RepositoryCapabilities() {
    	this.aclCapability= CapabilityAcl.NONE;
    	this.id=0;
    }

	public RepositoryCapabilities(Boolean allVersionsSearchable, Boolean isPwcSearchable, Boolean isPwcUpdatable,
			Boolean supportsGetDescendants, Boolean supportsGetFolderTree, CapabilityOrderBy capabilityOrderBy,
			Boolean supportsMultifiling, Boolean supportsUnfiling, Boolean supportsVersionSpecificFiling,
			NewTypeSettableAttributes newTypeSettableAttributes, CapabilityRenditions renditionsCapability,
			CapabilityAcl aclCapability, CapabilityJoin capabilityJoin, CapabilityChanges capabilityChanges,
			CapabilityContentStreamUpdates capabilityContentStreamUpdates, CapabilityQuery capabilityQuery,
			CreatablePropertyTypes creatablePropertyTypes, Set<PropertyType> propertyTypeSet,
			List<CmisExtensionElement> cmisExtensionElement) {
		super();
		this.allVersionsSearchableSupported = allVersionsSearchable;
		this.isPwcSearchable = isPwcSearchable;
		this.isPwcUpdatable = isPwcUpdatable;
		this.supportsGetDescendants = supportsGetDescendants;
		this.supportsGetFolderTree = supportsGetFolderTree;
		this.orderByCapability = capabilityOrderBy;
		this.supportsMultifiling = supportsMultifiling;
		this.supportsUnfiling = supportsUnfiling;
		this.supportsVersionSpecificFiling = supportsVersionSpecificFiling;
		this.newTypeSettableAttributes = newTypeSettableAttributes;
		this.renditionsCapability = renditionsCapability;
		this.aclCapability = aclCapability;
		this.joinCapability = capabilityJoin;
		this.changesCapability = capabilityChanges;
		this.contentStreamUpdatesCapability = capabilityContentStreamUpdates;
		this.queryCapability = capabilityQuery;
		this.creatablePropertyTypes = creatablePropertyTypes;
		this.propertyTypeSet = propertyTypeSet;
		this.cmisExtensionElements = cmisExtensionElement;
		this.id=0;
	}

    public void setAllVersionsSearchableSupported(Boolean allVersionsSearchable) {
        this.allVersionsSearchableSupported = allVersionsSearchable;
    }

    public void setAclCapability(CapabilityAcl aclCapability) {
        this.aclCapability = aclCapability;
    }

    public void setChangesCapability(CapabilityChanges capabilityChanges) {
        this.changesCapability = capabilityChanges;
    }

    public void setContentStreamUpdatesCapability(CapabilityContentStreamUpdates capabilityContentStreamUpdates) {
        this.contentStreamUpdatesCapability = capabilityContentStreamUpdates;
    }

    public void setJoinCapability(CapabilityJoin capabilityJoin) {
        this.joinCapability = capabilityJoin;
    }

    public void setCapabilityQuery(CapabilityQuery capabilityQuery) {
        this.queryCapability = capabilityQuery;
    }

    public void setIsPwcSearchable(Boolean isPwcSearchable) {
        this.isPwcSearchable = isPwcSearchable;
    }

    public void setIsPwcUpdatable(Boolean isPwcUpdatable) {
        this.isPwcUpdatable = isPwcUpdatable;
    }

    public void setSupportsGetDescendants(Boolean supportsGetDescendants) {
        this.supportsGetDescendants = supportsGetDescendants;
    }

    public void setSupportsGetFolderTree(Boolean supportsGetFolderTree) {
        this.supportsGetFolderTree = supportsGetFolderTree;
    }

    public void setOrderByCapability(CapabilityOrderBy capabilityOrderBy) {
        this.orderByCapability = capabilityOrderBy;
    }

    public void setSupportsMultifiling(Boolean supportsMultifilingSupported) {
        this.supportsMultifiling = supportsMultifilingSupported;
    }

    public Set<PropertyType> getPropertyTypeSet() {
    	return propertyTypeSet;
    }


	public void setPropertyTypeSet(Set<PropertyType> propertyTypeSet) {
		this.propertyTypeSet = propertyTypeSet;
	}

	public void setRenditionsCapability(CapabilityRenditions capabilityRenditions) {
		this.renditionsCapability = capabilityRenditions;
	}

	public Boolean getAllVersionsSearchableSupported() {
		return allVersionsSearchableSupported;
	}


	public Boolean getIsPwcSearchable() {
		return isPwcSearchable;
	}


	public Boolean getIsPwcUpdatable() {
		return isPwcUpdatable;
	}


	public Boolean getSupportsGetDescendants() {
		return supportsGetDescendants;
	}


	public Boolean getSupportsGetFolderTree() {
		return supportsGetFolderTree;
	}

	public Boolean getSupportsMultifiling() {
		return supportsMultifiling;
	}


	public Boolean getSupportsUnfiling() {
		return supportsUnfiling;
	}


	public Boolean getSupportsVersionSpecificFiling() {
		return supportsVersionSpecificFiling;
	}

	public CapabilityContentStreamUpdates getContentStreamUpdatesCapability() {
		return contentStreamUpdatesCapability;
	}


	public CapabilityQuery getQueryCapability() {
		return queryCapability;
	}


	public void setId(String id) {
		this.id = Integer.parseInt(id);
	}

    public void setSupportsUnfiling(Boolean supportsUnfilingSupported) {
        this.supportsUnfiling = supportsUnfilingSupported;
    }

    public void setSupportsVersionSpecificFiling(Boolean supportsVersionSpecificFiling) {
        this.supportsVersionSpecificFiling = supportsVersionSpecificFiling;
    }

    public CreatablePropertyTypes getCreatablePropertyTypes() {
        return creatablePropertyTypes;
    }

    public NewTypeSettableAttributes getNewTypeSettableAttributes() {
        if (this.newTypeSettableAttributes==null){
        	this.newTypeSettableAttributes=new NewTypeSettableAttributes();
        }
    	return newTypeSettableAttributes;
    }

	public CapabilityChanges getChangesCapability() {
		return changesCapability;
	}


	public CapabilityOrderBy getOrderByCapability() {
		return orderByCapability;
	}

	public CapabilityJoin getJoinCapability() {
		return joinCapability;
	}
	
	public CapabilityAcl getAclCapability() {
		return aclCapability;
	}

	public CapabilityRenditions getRenditionsCapability() {
		return this.renditionsCapability;
	}

}
