001 /*
002 * Copyright 2005 Niclas Hedhman
003 * Copyright 2005-2006 Stephen McConnell
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
013 * implied.
014 *
015 * See the License for the specific language governing permissions and
016 * limitations under the License.
017 */
018
019 package net.dpml.transit;
020
021 import java.io.IOException;
022 import java.net.URI;
023
024 /**
025 * The LinkManager is responsible for storing the mapping between a Link
026 * instance and a URI.
027 * @author <a href="http://www.dpml.net">Digital Product Management Laboratory</a>
028 * @version 2.0.2
029 */
030 public interface LinkManager
031 {
032 /**
033 * Sets the URI for the provided link URI.
034 * The LinkManager is required to persist this information between
035 * JVM restarts and should be persisted on a scope larger than a
036 * single JVM, typically a host or a local area network. LinkManagers
037 * are encouraged to establish other virtual scopes independent of
038 * network topologies.
039 *
040 * @param link the uri of the link
041 * @param target the uri of the target that the link redirects to
042 * @exception IOException if an IO error occurs
043 */
044 void setTargetURI( URI link, URI target ) throws IOException;
045
046 /**
047 * Returns the URI that the supplied link URI is referencing.
048 *
049 * @param link the link uri
050 * @return the target uri
051 * @exception IOException if an IO error occurs
052 */
053 URI getTargetURI( URI link ) throws IOException;
054
055 }