/*
 * Copyright 2019 EPAM Systems
 *
 * 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 com.epam.ta.reportportal.ws.model;

/**
 * Contains constants for defining validation constraints.
 *
 * @author Aliaksei_Makayed
 */
//TODO review and move to API service
public class ValidationConstraints {

	private ValidationConstraints() {

	}

	/* 1 always exists as predefined type */
	public static final int MAX_ISSUE_SUBTYPES = 15;

	public static final int MIN_COLLECTION_SIZE = 1;
	public static final int MAX_NUMBER_OF_FILTER_ENTITIES = 20;
	public static final int MIN_WIDGET_LIMIT = 1;
	public static final int MAX_WIDGET_LIMIT = 150;
	public static final int MIN_FILTER_LIMIT = 1;
	public static final int MAX_FILTER_LIMIT = 150;
	public static final int MIN_LAUNCH_NAME_LENGTH = 1;
	public static final int MIN_TEST_ITEM_NAME_LENGTH = 1;
	public static final int MAX_TEST_ITEM_NAME_LENGTH = 1024;
	public static final int MAX_TEST_ITEM_LOCATION_LENGTH = 256;
	public static final int MIN_ITEM_ATTRIBUTE_VALUE_LENGTH = 1;
	public static final int MIN_NAME_LENGTH = 3;
	public static final int MAX_NAME_LENGTH = 256;
	public static final int MIN_DESCRIPTION_LENGTH = 0;
	public static final int MAX_DESCRIPTION_LENGTH = 65536;
	public static final int MAX_PARAMETERS_LENGTH = 256;
	public static final int MAX_LAUNCH_DESCRIPTION_LENGTH = 1024;

	public static final int MAX_WIDGET_NAME_LENGTH = 128;
	public static final int MAX_DASHBOARD_NAME_LENGTH = 128;
	public static final int MAX_USER_FILTER_NAME_LENGTH = 128;
	public static final int MAX_ATTRIBUTE_LENGTH = 128;

	public static final int MIN_PAGE_NUMBER = 1;
	public static final int MAX_PAGE_NUMBER = 1024;
	public static final int MAX_HISTORY_DEPTH_BOUND = 31;
	public static final int MIN_HISTORY_DEPTH_BOUND = 0;
	public static final int MAX_HISTORY_SIZE_BOUND = 31;

	public static final int MIN_LOGIN_LENGTH = 1;
	public static final int MAX_LOGIN_LENGTH = 128;

	public static final int MIN_PASSWORD_LENGTH = 4;
	public static final int MAX_PASSWORD_LENGTH = 256;

	public static final int TICKET_MIN_LOG_SIZE = 0;
	public static final int TICKET_MAX_LOG_SIZE = 50;

	public static final int MAX_CUSTOMER_LENGTH = 64;

	public static final int MIN_USER_NAME_LENGTH = 3;
	public static final int MAX_USER_NAME_LENGTH = 256;

	public static final int MAX_PHOTO_SIZE = 1024 * 1024;
	public static final int MAX_PHOTO_HEIGHT = 500;
	public static final int MAX_PHOTO_WIDTH = 300;

	public static final int MIN_DOMAIN_SIZE = 1;
	public static final int MAX_DOMAIN_SIZE = 255;

	public static final int MIN_SUBTYPE_SHORT_NAME = 1;
	public static final int MAX_SUBTYPE_SHORT_NAME = 4;

	public static final int MIN_SUBTYPE_LONG_NAME = 3;
	public static final int MAX_SUBTYPE_LONG_NAME = 55;

	public static final int MIN_ANALYSIS_PATTERN_NAME_LENGTH = 3;
	public static final int MAX_ANALYSIS_PATTERN_NAME_LENGTH = 128;

	public static final int MAX_DESCRIPTION = 256;
	public static final int MIN_DESCRIPTION = 1;

	public static final int MIN_DOC_FREQ = 1;
	public static final int MAX_DOC_FREQ = 10;
	public static final int MIN_TERM_FREQ = 1;
	public static final int MAX_TERM_FREQ = 10;
	public static final int MIN_SHOULD_MATCH = 50;
	public static final int MAX_SHOULD_MATCH = 100;
	public static final int MIN_NUMBER_OF_LOG_LINES = -1;
	public static final int MAX_NUMBER_OF_LOG_LINES = 5;

	public static final String HEX_COLOR_REGEXP = "#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$";
	public static final String PROJECT_NAME_REGEXP = "[a-zA-Z0-9-_]+";

}
@@ -213,21 +213,16 @@
 at%0A *%0A *
-     
  http://
@@ -581,19 +581,16 @@
 icense.%0A
- *%0A
  */%0A%0Apac
@@ -3312,33 +3312,33 @@
 N_NAME_LENGTH = 
-3
+1
 ;%0A%09public static
@@ -3375,35 +3375,34 @@
 N_NAME_LENGTH = 
-128
+55
 ;%0A%0A%09public stati

Change pattern short name length validations