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 020 package javax.mail; 021 022 /** 023 * @version $Rev: 467553 $ $Date: 2006-10-25 00:01:51 -0400 (Wed, 25 Oct 2006) $ 024 */ 025 public class Provider { 026 /** 027 * A enumeration inner class that defines Provider types. 028 */ 029 public static class Type { 030 /** 031 * A message store provider such as POP3 or IMAP4. 032 */ 033 public static final Type STORE = new Type(); 034 035 /** 036 * A message transport provider such as SMTP. 037 */ 038 public static final Type TRANSPORT = new Type(); 039 040 private Type() { 041 } 042 } 043 044 private final String className; 045 private final String protocol; 046 private final Type type; 047 private final String vendor; 048 private final String version; 049 050 public Provider(Type type, String protocol, String className, String vendor, String version) { 051 this.protocol = protocol; 052 this.className = className; 053 this.type = type; 054 this.vendor = vendor; 055 this.version = version; 056 } 057 058 public String getClassName() { 059 return className; 060 } 061 062 public String getProtocol() { 063 return protocol; 064 } 065 066 public Type getType() { 067 return type; 068 } 069 070 public String getVendor() { 071 return vendor; 072 } 073 074 public String getVersion() { 075 return version; 076 } 077 078 public String toString() { 079 return "protocol=" 080 + protocol 081 + "; type=" 082 + type 083 + "; class=" 084 + className 085 + (vendor == null ? "" : "; vendor=" + vendor) 086 + (version == null ? "" : ";version=" + version); 087 } 088 }