001/* 002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * Anahide Tchertchian 018 */ 019package org.nuxeo.targetplatforms.api; 020 021import java.io.Serializable; 022import java.util.Date; 023import java.util.List; 024 025/** 026 * Represents a target info (platform or package). 027 * <p> 028 * This is a lighter version of the target platform or package, useful for listing targets in select inputs for 029 * instance. 030 * 031 * @since 5.7.1 032 */ 033public interface TargetInfo extends Serializable { 034 035 /** 036 * This target unique identifier (usually some kind of concatenation of name and version). 037 */ 038 String getId(); 039 040 /** 041 * The target platform name, for instance "cap". 042 */ 043 String getName(); 044 045 /** 046 * The target platform version, for instance "5.8". 047 */ 048 String getVersion(); 049 050 /** 051 * The target platform reference version used for behaviour checks. 052 * <p> 053 * Defaults to {@link #getVersion()} when not set. 054 */ 055 String getRefVersion(); 056 057 /** 058 * A user-friendly label for this platform, like "Nuxeo Platform 5.8". 059 */ 060 String getLabel(); 061 062 /** 063 * String marker for a dev/deprecated/new status. 064 */ 065 String getStatus(); 066 067 /** 068 * Returns true if the corresponding target platform is enabled. 069 */ 070 boolean isEnabled(); 071 072 /** 073 * Returns true if access to the corresponding target platform is restricted. 074 * <p> 075 * Criteria for which access should be granted or not are left to the caller. 076 */ 077 boolean isRestricted(); 078 079 /** 080 * Returns true if given target is deprecated. 081 */ 082 boolean isDeprecated(); 083 084 /** 085 * Returns true if given target information is available for trials. 086 */ 087 boolean isTrial(); 088 089 /** 090 * Returns true if given target information is marked as default. 091 */ 092 boolean isDefault(); 093 094 /** 095 * Returns true if given target platform is a fast track 096 */ 097 boolean isFastTrack(); 098 099 /** 100 * Returns true if given target information is overridden by directory information. 101 */ 102 boolean isOverridden(); 103 104 /** 105 * Returns this target release date. 106 */ 107 Date getReleaseDate(); 108 109 /** 110 * Returns this target end of availability date. 111 */ 112 Date getEndOfAvailability(); 113 114 /** 115 * Returns this target download link. 116 */ 117 String getDownloadLink(); 118 119 /** 120 * Returns a description for this target. 121 * <p> 122 * Can contain HTML code. 123 */ 124 String getDescription(); 125 126 /** 127 * String markers for feature/behaviour checks on this instance. 128 */ 129 List<String> getTypes(); 130 131 /** 132 * Returns true if given type is in the list of this target types. 133 */ 134 boolean matchesType(String type); 135 136}