001/* 002 * Copyright 2015-2024 Ping Identity Corporation 003 * 004 * This program is free software; you can redistribute it and/or modify 005 * it under the terms of the GNU General Public License (GPLv2 only) 006 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only) 007 * as published by the Free Software Foundation. 008 * 009 * This program is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 012 * GNU General Public License for more details. 013 * 014 * You should have received a copy of the GNU General Public License 015 * along with this program; if not, see <http://www.gnu.org/licenses>. 016 */ 017 018package com.unboundid.scim2.server.annotations; 019 020import com.unboundid.scim2.common.annotations.NotNull; 021 022import java.lang.annotation.ElementType; 023import java.lang.annotation.Retention; 024import java.lang.annotation.RetentionPolicy; 025import java.lang.annotation.Target; 026 027/** 028 * Annotation for SCIM resource classes. 029 */ 030@Target(value = ElementType.TYPE) 031@Retention(value = RetentionPolicy.RUNTIME) 032public @interface ResourceType 033{ 034 /** 035 * The description for the object. 036 * 037 * @return The object's description. 038 */ 039 @NotNull 040 String description(); 041 042 /** 043 * The name for the object. This is a human readable 044 * name. 045 * 046 * @return The object's human-readable name. 047 */ 048 @NotNull 049 String name(); 050 051 /** 052 * The primary/base resource class. 053 * 054 * @return The primary/base resource class. 055 */ 056 @NotNull 057 Class<?> schema(); 058 059 /** 060 * The required schema extension resource classes. 061 * 062 * @return The required schema extension resource classes. 063 */ 064 @NotNull 065 Class<?>[] requiredSchemaExtensions() default {}; 066 067 /** 068 * The optional schema extension resource classes. 069 * 070 * @return The optional schema extension resource classes. 071 */ 072 @NotNull 073 Class<?>[] optionalSchemaExtensions() default {}; 074 075 /** 076 * Whether this resource type and its associated schemas should be 077 * discoverable using the SCIM 2 standard /resourceTypes and /schemas 078 * endpoints. 079 * 080 * @return A flag indicating the discoverability of this resource type and 081 * its associated schemas. 082 */ 083 boolean discoverable() default true; 084}