1/*2 * Copyright 2000-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 at7 * 8 * http://www.apache.org/licenses/LICENSE-2.09 * 10 * Unless required by applicable law or agreed to in writing, software11 * 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 and14 * limitations under the License.15 */1617packageorg.apache.jetspeed.services.urlmanager;
1819/***20 * <p>This is a simple URL information record which can be used21 * to track URL resources status in a persistent way.</p>22 *23 * <p>The url String used to initialize it MUST be interned,24 * to ensure that if two such urls are "equal()", they will be25 * also "==" </p>26 *27 *28 * @author <a href="mailto:raphael@apache.org">Raphaël Luta</a>29 * @version $Id: URLInfo.java,v 1.5 2004/02/23 03:30:47 jford Exp $30 */31publicclassURLInfo implements java.io.Serializable {
3233private String url;
34privateint status;
35private String message;
3637/***38 * Creates a new minimum URLInfo record39 *40 * @param url a non-null url described by this class41 */42URLInfo( String url ) {
43this( url, URLManagerService.STATUS_UNKNOWN, null );
44 }
4546/***47 * Creates a new URLInfo record48 *49 * @param url a non-null url described by this class50 * @param status the status of this url51 */52URLInfo( String url, int status ) {
53this( url, status, null );
54 }
5556/***57 * Creates a new URLInfo record58 *59 * @param url a non-null url described by this class60 * @param status the status of this url61 * @param message a message suitable for display describing62 * the status of the url63 */64URLInfo( String url, int status, String message ) {
65this.url = url.intern();
66this.status = status;
67this.message = message;
68 }
6970/***71 * Get the url.72 *73 * @return the url string described by this object74 */75public String getURL() {
76returnthis.url;
77 }
7879/***80 * Get the status81 *82 * @return the status for this url83 */84publicint getStatus() {
85return status;
86 }
8788/***89 * Set the status90 *91 * @param status the status for this url92 */93publicvoid setStatus( int status ) {
94this.status = status;
95 }
9697/***98 * Get the message99 *100 * @return the message for this url101 */102public String getMessage() {
103return message;
104 }
105106/***107 * Set the message108 *109 * @param message the message for this url110 */111publicvoid setMessage( String message ) {
112this.message = message;
113 }
114115 }