001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2008 Sun Microsystems, Inc. 015 */ 016package org.forgerock.opendj.server.config.client; 017 018 019 020import java.util.Collection; 021import org.forgerock.opendj.config.client.ConcurrentModificationException; 022import org.forgerock.opendj.config.client.IllegalManagedObjectNameException; 023import org.forgerock.opendj.config.client.ManagedObjectDecodingException; 024import org.forgerock.opendj.config.client.OperationRejectedException; 025import org.forgerock.opendj.config.DefinitionDecodingException; 026import org.forgerock.opendj.config.ManagedObjectDefinition; 027import org.forgerock.opendj.config.ManagedObjectNotFoundException; 028import org.forgerock.opendj.config.PropertyException; 029import org.forgerock.opendj.ldap.LdapException; 030import org.forgerock.opendj.server.config.meta.AccessLogPublisherCfgDefn.FilteringPolicy; 031import org.forgerock.opendj.server.config.server.AccessLogFilteringCriteriaCfg; 032import org.forgerock.opendj.server.config.server.AccessLogPublisherCfg; 033 034 035 036/** 037 * A client-side interface for reading and modifying Access Log 038 * Publisher settings. 039 * <p> 040 * Access Log Publishers are responsible for distributing access log 041 * messages from the access logger to a destination. 042 */ 043public interface AccessLogPublisherCfgClient extends LogPublisherCfgClient { 044 045 /** 046 * Get the configuration definition associated with this Access Log Publisher. 047 * 048 * @return Returns the configuration definition associated with this Access Log Publisher. 049 */ 050 ManagedObjectDefinition<? extends AccessLogPublisherCfgClient, ? extends AccessLogPublisherCfg> definition(); 051 052 053 054 /** 055 * Gets the "filtering-policy" property. 056 * <p> 057 * Specifies how filtering criteria should be applied to log 058 * records. 059 * 060 * @return Returns the value of the "filtering-policy" property. 061 */ 062 FilteringPolicy getFilteringPolicy(); 063 064 065 066 /** 067 * Sets the "filtering-policy" property. 068 * <p> 069 * Specifies how filtering criteria should be applied to log 070 * records. 071 * 072 * @param value The value of the "filtering-policy" property. 073 * @throws PropertyException 074 * If the new value is invalid. 075 */ 076 void setFilteringPolicy(FilteringPolicy value) throws PropertyException; 077 078 079 080 /** 081 * Gets the "java-class" property. 082 * <p> 083 * The fully-qualified name of the Java class that provides the 084 * Access Log Publisher implementation. 085 * 086 * @return Returns the value of the "java-class" property. 087 */ 088 String getJavaClass(); 089 090 091 092 /** 093 * Sets the "java-class" property. 094 * <p> 095 * The fully-qualified name of the Java class that provides the 096 * Access Log Publisher implementation. 097 * 098 * @param value The value of the "java-class" property. 099 * @throws PropertyException 100 * If the new value is invalid. 101 */ 102 void setJavaClass(String value) throws PropertyException; 103 104 105 106 /** 107 * Gets the "suppress-internal-operations" property. 108 * <p> 109 * Indicates whether internal operations (for example, operations 110 * that are initiated by plugins) should be logged along with the 111 * operations that are requested by users. 112 * 113 * @return Returns the value of the "suppress-internal-operations" property. 114 */ 115 boolean isSuppressInternalOperations(); 116 117 118 119 /** 120 * Sets the "suppress-internal-operations" property. 121 * <p> 122 * Indicates whether internal operations (for example, operations 123 * that are initiated by plugins) should be logged along with the 124 * operations that are requested by users. 125 * 126 * @param value The value of the "suppress-internal-operations" property. 127 * @throws PropertyException 128 * If the new value is invalid. 129 */ 130 void setSuppressInternalOperations(Boolean value) throws PropertyException; 131 132 133 134 /** 135 * Gets the "suppress-synchronization-operations" property. 136 * <p> 137 * Indicates whether access messages that are generated by 138 * synchronization operations should be suppressed. 139 * 140 * @return Returns the value of the "suppress-synchronization-operations" property. 141 */ 142 boolean isSuppressSynchronizationOperations(); 143 144 145 146 /** 147 * Sets the "suppress-synchronization-operations" property. 148 * <p> 149 * Indicates whether access messages that are generated by 150 * synchronization operations should be suppressed. 151 * 152 * @param value The value of the "suppress-synchronization-operations" property. 153 * @throws PropertyException 154 * If the new value is invalid. 155 */ 156 void setSuppressSynchronizationOperations(Boolean value) throws PropertyException; 157 158 159 160 /** 161 * Lists the Access Log Filtering Criteria. 162 * 163 * @return Returns an array containing the names of the Access Log 164 * Filtering Criteria. 165 * @throws ConcurrentModificationException 166 * If this Access Log Publisher has been removed from the 167 * server by another client. 168 * @throws LdapException 169 * If any other error occurs. 170 */ 171 String[] listAccessLogFilteringCriteria() throws ConcurrentModificationException, 172 LdapException; 173 174 175 176 /** 177 * Gets the named Access Log Filtering Criteria. 178 * 179 * @param name 180 * The name of the Access Log Filtering Criteria to 181 * retrieve. 182 * @return Returns the named Access Log Filtering Criteria. 183 * @throws DefinitionDecodingException 184 * If the named Access Log Filtering Criteria was found 185 * but its type could not be determined. 186 * @throws ManagedObjectDecodingException 187 * If the named Access Log Filtering Criteria was found 188 * but one or more of its properties could not be decoded. 189 * @throws ManagedObjectNotFoundException 190 * If the named Access Log Filtering Criteria was not 191 * found on the server. 192 * @throws ConcurrentModificationException 193 * If this Access Log Publisher has been removed from the 194 * server by another client. 195 * @throws LdapException 196 * If any other error occurs. 197 */ 198 AccessLogFilteringCriteriaCfgClient getAccessLogFilteringCriteria(String name) 199 throws DefinitionDecodingException, ManagedObjectDecodingException, 200 ManagedObjectNotFoundException, ConcurrentModificationException, 201 LdapException; 202 203 204 205 /** 206 * Creates a new Access Log Filtering Criteria. The new Access Log 207 * Filtering Criteria will initially not contain any property values 208 * (including mandatory properties). Once the Access Log Filtering 209 * Criteria has been configured it can be added to the server using 210 * the {@link #commit()} method. 211 * 212 * @param <C> 213 * The type of the Access Log Filtering Criteria being 214 * created. 215 * @param d 216 * The definition of the Access Log Filtering Criteria to 217 * be created. 218 * @param name 219 * The name of the new Access Log Filtering Criteria. 220 * @param exceptions 221 * An optional collection in which to place any {@link 222 * PropertyException}s that occurred whilst attempting to 223 * determine the default values of the Access Log Filtering 224 * Criteria. This argument can be <code>null<code>. 225 * @return Returns a new Access Log Filtering Criteria configuration 226 * instance. 227 * @throws IllegalManagedObjectNameException 228 * If the name of the new Access Log Filtering Criteria is 229 * invalid. 230 */ 231 <C extends AccessLogFilteringCriteriaCfgClient> C createAccessLogFilteringCriteria( 232 ManagedObjectDefinition<C, ? extends AccessLogFilteringCriteriaCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException; 233 234 235 236 /** 237 * Removes the named Access Log Filtering Criteria. 238 * 239 * @param name 240 * The name of the Access Log Filtering Criteria to remove. 241 * @throws ManagedObjectNotFoundException 242 * If the Access Log Filtering Criteria does not exist. 243 * @throws OperationRejectedException 244 * If the server refuses to remove the Access Log 245 * Filtering Criteria due to some server-side constraint 246 * which cannot be satisfied (for example, if it is 247 * referenced by another managed object). 248 * @throws ConcurrentModificationException 249 * If this Access Log Publisher has been removed from the 250 * server by another client. 251 * @throws LdapException 252 * If any other error occurs. 253 */ 254 void removeAccessLogFilteringCriteria(String name) 255 throws ManagedObjectNotFoundException, OperationRejectedException, 256 ConcurrentModificationException, LdapException; 257 258}