/*
 * Copyright 2017 the original author or authors.
 *
 * 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.springframework.cloud.skipper.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;

/**
 * Repository for the packages.
 *
 * @author Mark Pollack
 */
@Entity
public class Repository extends AbstractEntity {

	/**
	 * A short name, e.g. 'stable' to associate with this repository, must be unique.
	 */
	@NotNull
	@Column(unique = true)
	private String name;

	/**
	 * The root url that points to the location of an index.yaml file and other files
	 * supporting the index e.g. myapp-1.0.0.zip, icons-64x64.zip
	 */
	@NotNull
	private String url;

	/**
	 * The url that points to the source package files that was used to create the index and
	 * packages.
	 */
	private String sourceUrl;

	/**
	 * Is this a local or remote repository. Uploads are only allowed to a local repository
	 */
	private boolean local;

	/**
	 * A short description of the repository.
	 */
	private String description;

	/**
	 * An integer used to determine which repository is preferred over others when searching
	 * for a package.
	 */
	private int order;

	// TODO security/checksum fields of referenced index file.

	public Repository() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getSourceUrl() {
		return sourceUrl;
	}

	public void setSourceUrl(String sourceUrl) {
		this.sourceUrl = sourceUrl;
	}

	public boolean isLocal() {
		return local;
	}

	public void setLocal(boolean local) {
		this.local = local;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getOrder() {
		return order;
	}

	public void setOrder(int order) {
		this.order = order;
	}

	@Override
	public String toString() {
		return "Repository{" +
				"name='" + name + '\'' +
				", url='" + url + '\'' +
				", local=" + local +
				'}';
	}
}

@@ -1485,17 +1485,17 @@
 private 
-b
+B
 oolean l
@@ -1498,16 +1498,24 @@
 an local
+ = false
 ;%0A%0A%09/**%0A
@@ -1720,21 +1720,29 @@
 private 
-int o
+Integer repoO
 rder;%0A%0A%09
@@ -2443,15 +2443,23 @@
 lic 
-int get
+Integer getRepo
 Orde
@@ -2473,17 +2473,21 @@
 %09return 
-o
+repoO
 rder;%0A%09%7D
@@ -2508,19 +2508,31 @@
  set
+Repo
 Order(
-int o
+Integer repoO
 rder
@@ -2546,17 +2546,25 @@
 his.
-o
+repoO
 rder = 
-o
+repoO
 rder

Fix JAP mapping