1 /* 2 * Copyright 2006 Schlichtherle IT Services 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package de.schlichtherle.crypto.io.raes; 18 19 /** 20 * These {@link RaesParameters} delegate to some other instance of a sibling 21 * interface or itself in order to locate the parameters required to read 22 * or write a certain RAES type. 23 * This may be implemented by clients to build RAES parameters of a certain 24 * type on demand rather than providing them upfront. 25 * <p> 26 * There are two usages of this interface: 27 * <ol> 28 * <li>{@link RaesReadOnlyFile#getInstance} uses it to locate RAES parameters 29 * which match the RAES type found in the file unless the provided 30 * parameters already match the required type. 31 * <li>{@link RaesOutputStream#getInstance} uses it to allow the client 32 * explict control about the type of RAES file created. 33 * </ol> 34 * 35 * @author Christian Schlichtherle 36 * @version @version@ 37 * @since TrueZIP 6.0 38 */ 39 public interface RaesParametersAgent extends RaesParameters { 40 41 /** 42 * Requests an {@link RaesParameters} instance of the given 43 * <code>type</code>. 44 * It is permissible to return an instance of any other implementation 45 * of the <code>RaesParameters</code> interface. 46 * If the returned object is an instance of an implementation of this 47 * interface, it will be used to continue the search for RAES parameters 48 * recursively. 49 * Otherwise the search will be aborted. 50 * 51 * @param type The {@link RaesParameters} interface class which's 52 * implementation is searched. 53 * 54 * @return An instance of <code>RaesParameters</code> or <code>null</code> 55 * if no RAES parameters are available. 56 */ 57 RaesParameters getParameters(Class type); 58 } 59