001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 * 019 */ 020package org.apache.directory.api.ldap.model.schema.registries; 021 022 023import java.util.Set; 024 025import org.apache.directory.api.ldap.model.schema.SchemaObjectWrapper; 026 027 028/** 029 * Base schema interface. 030 * 031 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 032 */ 033public interface Schema 034{ 035 /** 036 * Checks whether or not this schema is enabled or disabled. 037 * 038 * @return true if this schema is disabled, false otherwise 039 */ 040 boolean isDisabled(); 041 042 043 /** 044 * Disable the schema 045 */ 046 void disable(); 047 048 049 /** 050 * Checks whether or not this schema is enabled or disabled. 051 * 052 * @return true if this schema is enabled, false otherwise 053 */ 054 boolean isEnabled(); 055 056 057 /** 058 * Enable the schema 059 */ 060 void enable(); 061 062 063 /** 064 * Gets the name of the owner of the schema objects within this 065 * Schema. 066 * 067 * @return the identifier for the owner of this set's objects 068 */ 069 String getOwner(); 070 071 072 /** 073 * Gets the name of the logical schema the objects of this Schema 074 * belong to: e.g. krb5-kdc may be the logical LDAP schema name. 075 * 076 * @return the name of the logical schema 077 */ 078 String getSchemaName(); 079 080 081 /** 082 * Gets the names of other schemas that the objects within this 083 * Schema depends upon. 084 * 085 * @return the String names of schema dependencies 086 */ 087 String[] getDependencies(); 088 089 090 /** 091 * Add a set of dependencies this schema uses. 092 * 093 * @param dependencies The dependencies to add 094 */ 095 void addDependencies( String... dependencies ); 096 097 098 /** 099 * Gets the set of SchemaObject elements declared in this schema 100 * 101 * @return The Set of associated SchemaObjects 102 */ 103 Set<SchemaObjectWrapper> getContent(); 104 105 106 /** 107 * Gets the SchemaLoader this Schema has to be loaded with 108 * 109 * @return The SchemaLoader in use 110 */ 111 SchemaLoader getSchemaLoader(); 112}