001 /**
002 *
003 * Copyright 2003-2006 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * 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 */
017
018 package javax.mail;
019
020 /**
021 * @version $Rev: 421852 $ $Date: 2006-07-14 03:02:19 -0700 (Fri, 14 Jul 2006) $
022 */
023 public class Provider {
024 /**
025 * A enumeration inner class that defines Provider types.
026 */
027 public static class Type {
028 /**
029 * A message store provider such as POP3 or IMAP4.
030 */
031 public static final Type STORE = new Type();
032
033 /**
034 * A message transport provider such as SMTP.
035 */
036 public static final Type TRANSPORT = new Type();
037
038 private Type() {
039 }
040 }
041
042 private final String className;
043 private final String protocol;
044 private final Type type;
045 private final String vendor;
046 private final String version;
047
048 public Provider(Type type, String protocol, String className, String vendor, String version) {
049 this.protocol = protocol;
050 this.className = className;
051 this.type = type;
052 this.vendor = vendor;
053 this.version = version;
054 }
055
056 public String getClassName() {
057 return className;
058 }
059
060 public String getProtocol() {
061 return protocol;
062 }
063
064 public Type getType() {
065 return type;
066 }
067
068 public String getVendor() {
069 return vendor;
070 }
071
072 public String getVersion() {
073 return version;
074 }
075
076 public String toString() {
077 return "protocol="
078 + protocol
079 + "; type="
080 + type
081 + "; class="
082 + className
083 + (vendor == null ? "" : "; vendor=" + vendor)
084 + (version == null ? "" : ";version=" + version);
085 }
086 }