KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > publication > Proxy


1 /*
2  * Copyright 1999-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  */

17 package org.apache.lenya.cms.publication;
18
19 /**
20  * <p>
21  * An object of this class represents a proxy configuration.
22  * </p>
23  * <p>
24  * Configuration example:
25  * </p>
26  * <pre>
27  * &lt;proxy area="live" ssl="true" url="https://www.host.com/ssl/default"/&gt;
28  * &lt;proxy area="live" ssl="false" url="http://www.host.com/default"/&gt;
29  * &lt;proxy area="authoring" ssl="true" url="https://www.host.com/lenya/default/authoring"/&gt;
30  * &lt;proxy area="authoring" ssl="false" url="http://www.host.com/lenya/default/authoring"/&gt;
31  * </pre>
32  *
33  * @version $Id: Proxy.java 109784 2004-12-04 06:43:22Z antonio $
34  */

35 public class Proxy {
36
37     private String JavaDoc url;
38
39     /**
40      * Returns the absolute URL of a particular document.
41      *
42      * @param document The document.
43      * @return A string.
44      */

45     public String JavaDoc getURL(Document document) {
46         return getUrl() + document.getDocumentURL();
47     }
48
49     /**
50      * Returns the proxy URL.
51      * @return A string.
52      */

53     public String JavaDoc getUrl() {
54         return this.url;
55     }
56
57     /**
58      * Sets the proxy URL.
59      * @param url The url to set.
60      */

61     public void setUrl(String JavaDoc url) {
62         this.url = url;
63     }
64
65     /**
66      * (non-Javadoc)
67      * @see java.lang.Object#toString()
68      */

69     public String JavaDoc toString() {
70         return "Proxy URL=[" + getUrl() + "]";
71     }
72 }
Popular Tags