KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > juddi > datatype > binding > AccessPoint


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
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 package org.apache.juddi.datatype.binding;
17
18 import org.apache.juddi.datatype.RegistryObject;
19
20 /**
21  * Is an attribute-qualified pointer to a service entry point. Many types of
22  * entry point are accommodated. A single urlType attribute is used to indicate
23  * the type of entry point so searches for specific types can be performed.
24  * Types might be "http", "smtp", "ftp", etc. In addition there is the actual
25  * string value for the entry point. Example accessPoints therefore may be:
26  * mailto:purch@fabrikam.com
27  * http://www.sviens.com/purchasing
28  * ftp://ftp.sviens.com/public, etc.
29  *
30  * If the AccessPoint has a custom addressformat, the "other" urlType has to
31  * be used. When this value is used, one or more of the tModel signatures
32  * found in the tModelInstanceInfo collection must imply that a particual
33  * format or transport type is required.
34  *
35  * @author Steve Viens (sviens@apache.org)
36  */

37 public class AccessPoint implements RegistryObject
38 {
39   /**
40    * Constant which designates that the AccessPoint url is formatted as an
41    * electronic mail address reference.
42    */

43   public static final String JavaDoc MAILTO = "mailto";
44
45   /**
46    * Constant which designates that the AccessPoint url is formatted as an
47    * HTTP compatible Uniform Resource Locator (URL).
48    */

49   public static final String JavaDoc HTTP = "http";
50
51   /**
52    * Constant which designates that the AccessPoint url is formatted as a
53    * secure HTTP compatible URL.
54    */

55   public static final String JavaDoc HTTPS = "https";
56
57   /**
58    * Constant which designates that the AccessPoint url is formatted as a
59    * writable FTP directory address.
60    */

61   public static final String JavaDoc FTP = "ftp";
62
63   /**
64    * Constant which designates that the AccessPoint url is formatted as a
65    * telephone number that will contact a facsimile machine.
66    */

67   public static final String JavaDoc FAX = "fax";
68
69   /**
70    * Constant which designates that the AccessPoint url is formatted as a
71    * telephone number that will connect to a human or suitable voice or
72    * tone response based system.
73    */

74   public static final String JavaDoc PHONE = "phone";
75
76   /**
77    * Constant which designates that the AccessPoint is formatted as some other
78    * address format. When this value is used, one or more of the tModel
79    * signatures found in the tModelInstanceInfo collection must imply that a
80    * particual format or transport type is required.
81    */

82   public static final String JavaDoc OTHER = "other";
83
84   String JavaDoc urlType;
85   String JavaDoc urlValue;
86
87   /**
88    * Constructs a new initialized AccessPoint
89    */

90   public AccessPoint()
91   {
92   }
93
94   /**
95    * Constructs a new AccessPoint for a given urlType and a given urlValue.
96    *
97    * @param urlType The urlType of the AccessPoint.
98    * @param urlValue The value of the AccessPoint url.
99    */

100   public AccessPoint(String JavaDoc urlType,String JavaDoc urlValue)
101   {
102     this.urlType = urlType;
103     this.urlValue = urlValue;
104   }
105
106   /**
107    * Set the urlType of this AccessPoint to the given urlType. The urlType
108    * cannot be null.
109    *
110    * @param urlType The new type of the AccessPoint.
111    */

112   public void setURLType(String JavaDoc urlType)
113   {
114     this.urlType = urlType;
115   }
116
117   /**
118    * Set the url value of this AccessPoint to the given value. The value cannot
119    * be null.
120    *
121    * @param url The new value of this AccessPoint.
122    */

123   public void setURL(String JavaDoc url)
124   {
125     this.urlValue = url;
126   }
127
128   /**
129    * Returns the value of this AccessPoint.
130    *
131    * @return The value of this AccessPoint.
132    */

133   public String JavaDoc getURL()
134   {
135     return this.urlValue;
136   }
137
138   /**
139    * Returns the type of this AccessPoint.
140    *
141    * @return The type of this AccessPoint.
142    */

143   public String JavaDoc getURLType()
144   {
145     return this.urlType;
146   }
147 }
Popular Tags