001/* 002 * Copyright 2010 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.web.alias; 017 018import java.util.Date; 019 020import org.ametys.plugins.repository.AmetysRepositoryException; 021 022/** 023 * This interface represents a alias 024 * 025 */ 026public interface Alias 027{ 028 /** Type of a target. */ 029 public enum TargetType 030 { 031 /** Site map page. */ 032 PAGE, 033 /** Module URL. */ 034 URL 035 } 036 037 /** 038 * Get the origin URL 039 * @return the origin URL 040 * @throws AmetysRepositoryException if an error occurs. 041 */ 042 public String getUrl() throws AmetysRepositoryException; 043 044 /** 045 * Set the origin URL 046 * @param url the origin URL 047 * @throws AmetysRepositoryException if an error occurs. 048 */ 049 public void setUrl(String url) throws AmetysRepositoryException; 050 051 /** 052 * Get the target URL 053 * @return the target URL 054 * @throws AmetysRepositoryException if an error occurs. 055 */ 056 public String getTarget () throws AmetysRepositoryException; 057 058 /** 059 * Set the target URL 060 * @param url the target URL 061 * @throws AmetysRepositoryException if an error occurs. 062 */ 063 public void setTarget(String url) throws AmetysRepositoryException; 064 065 /** 066 * Get the expiration date 067 * @return the expiration date 068 * @throws AmetysRepositoryException if an error occurs. 069 */ 070 public Date getExpirationDate () throws AmetysRepositoryException; 071 072 073 /** 074 * Set the expiration date 075 * @param date the expiration date 076 * @throws AmetysRepositoryException if an error occurs. 077 */ 078 public void setExpirationDate (Date date) throws AmetysRepositoryException; 079 080 /** 081 * Remove the expiration date 082 * @throws AmetysRepositoryException if an error occurs. 083 */ 084 public void removeExpirationDate () throws AmetysRepositoryException; 085 086 /** 087 * Retrieves the target type. 088 * @return the type. 089 * @throws AmetysRepositoryException if an error occurs. 090 * @see TargetType 091 */ 092 public TargetType getType() throws AmetysRepositoryException; 093 094 /** 095 * Set the type.<br> 096 * @param type the type. 097 * @throws AmetysRepositoryException if an error occurs. 098 * @see TargetType 099 */ 100 public void setType(TargetType type) throws AmetysRepositoryException; 101 102 /** 103 * Get the creation date 104 * @return the creation date 105 * @throws AmetysRepositoryException if an error occurs. 106 */ 107 public Date getCreationDate () throws AmetysRepositoryException; 108 109 /** 110 * Set the creation date 111 * @param date the date to set 112 * @throws AmetysRepositoryException if an error occurs. 113 */ 114 public void setCreationDate (Date date) throws AmetysRepositoryException; 115}