001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.camel; 018 019import java.net.URI; 020 021/** 022 * Holds an {@link Endpoint} configuration as a pojo that can be manipulated and validated. 023 * Camel endpoint configuration is strongly related to URIs. 024 */ 025@Deprecated 026public interface EndpointConfiguration { 027 028 String URI_SCHEME = "scheme"; 029 String URI_SCHEME_SPECIFIC_PART = "schemeSpecificPart"; 030 String URI_AUTHORITY = "authority"; 031 String URI_USER_INFO = "userInfo"; 032 String URI_HOST = "host"; 033 String URI_PORT = "port"; 034 String URI_PATH = "path"; 035 String URI_QUERY = "query"; 036 String URI_FRAGMENT = "fragment"; 037 038 /** 039 * {@link org.apache.camel.spi.DataFormat} operations. 040 */ 041 enum UriFormat { 042 Canonical, Provider, Consumer, Complete 043 } 044 045 /** 046 * Returns the URI configuration of an {@link Endpoint}. 047 * 048 * @return the configuration URI. 049 */ 050 URI getURI(); 051 052 /** 053 * Gets the value of a particular parameter. 054 * 055 * @param name the parameter name 056 * @return the configuration URI. 057 * @throws RuntimeCamelException is thrown if error getting the parameter 058 */ 059 <T> T getParameter(String name) throws RuntimeCamelException; 060 061 /** 062 * Sets the value of a particular parameter. 063 * 064 * @param name the parameter name 065 * @param value the parameter value 066 * @throws RuntimeCamelException is thrown if error setting the parameter 067 */ 068 <T> void setParameter(String name, T value) throws RuntimeCamelException; 069 070 /** 071 * Returns the formatted configuration string of an {@link Endpoint}. 072 * 073 * @param format the format 074 * @return the configuration URI in String format. 075 */ 076 String toUriString(UriFormat format); 077}