KickJava   Java API By Example, From Geeks To Geeks.

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


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.BindingKey;
19 import org.apache.juddi.datatype.RegistryObject;
20
21 /**
22  * The HostingRedirector in the bindingTemplate is used to indicate that the
23  * bindingTemplate entry is a pointer to a different bindingTemplate entry.
24  * The value in this is seen when a business or entity wants to expose a
25  * service description (ie advertise a service that fulfills a specific
26  * purpose) that is actually a service that is described in a separate
27  * bindingTemplate record. This might occur when a service is remotely hosted
28  * or when many service descriptions could benefit from a single service
29  * description.
30  *
31  * @author Steve Viens (sviens@apache.org)
32  */

33 public class HostingRedirector implements RegistryObject
34 {
35   // BindingKey to a different BindingTemplate
36
String JavaDoc bindingKey;
37
38   /**
39    * Constructs a new initialized HostingRedirector.
40    */

41   public HostingRedirector()
42   {
43   }
44
45   /**
46    * Constructs a new HostingRedirector with a given String.
47    *
48    * @param key The binding key.
49    */

50   public HostingRedirector(String JavaDoc key)
51   {
52     setBindingKey(key);
53   }
54
55   /**
56    * Sets the key of this HostingRedirector to the given key.
57    *
58    * @param key The new key of this HostingRedirector.
59    */

60   public void setBindingKey(BindingKey key)
61   {
62     if ((key != null) && (key.getValue() != null))
63       setBindingKey(key.getValue());
64   }
65
66   /**
67    * Sets the key of this HostingRedirector to the given key.
68    *
69    * @param key The new key of this HostingRedirector.
70    */

71   public void setBindingKey(String JavaDoc key)
72   {
73     this.bindingKey = key;
74   }
75
76   /**
77    * Returns the key of this HostingRedirector.
78    *
79    * @return The key of this HostingRedirector.
80    */

81   public String JavaDoc getBindingKey()
82   {
83     return this.bindingKey;
84   }
85 }
Popular Tags