001/* 002 * Copyright 2015-2016 UnboundID Corp. 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 java.lang.annotation.ElementType; 021import java.lang.annotation.Retention; 022import java.lang.annotation.RetentionPolicy; 023import java.lang.annotation.Target; 024 025/** 026 * Annotation for SCIM resource classes. 027 */ 028@Target(value = ElementType.TYPE) 029@Retention(value = RetentionPolicy.RUNTIME) 030public @interface ResourceType 031{ 032 /** 033 * The description for the object. 034 * 035 * @return The object's description. 036 */ 037 String description(); 038 039 /** 040 * The name for the object. This is a human readable 041 * name. 042 * 043 * @return The object's human-readable name. 044 */ 045 String name(); 046 047 /** 048 * The primary/base resource class. 049 * 050 * @return The primary/base resource class. 051 */ 052 Class<?> schema(); 053 054 /** 055 * The required schema extension resource classes. 056 * 057 * @return The required schema extension resource classes. 058 */ 059 Class<?>[] requiredSchemaExtensions() default {}; 060 061 /** 062 * The optional schema extension resource classes. 063 * 064 * @return The optional schema extension resource classes. 065 */ 066 Class<?>[] optionalSchemaExtensions() default {}; 067 068 /** 069 * Whether this resource type and its associated schemas should be 070 * discoverable using the SCIM 2 standard /resourceTypes and /schemas 071 * endpoints. 072 * 073 * @return A flag indicating the discoverability of this resource type and 074 * its associated schemas. 075 */ 076 boolean discoverable() default true; 077}