Package org.fcrepo.migration.idmappers
Class OpaqueIDMapper
- java.lang.Object
-
- org.fcrepo.migration.idmappers.OpaqueIDMapper
-
- All Implemented Interfaces:
MigrationIDMapper
public class OpaqueIDMapper extends Object implements MigrationIDMapper
An IDMapper implementation that maps identifiers by simply creating new objects in the Fedora 4 instance and thus delegating to whatever pid minter is configured for the repository. Unlike other ID mappers, just getting an ID through mapObjectPath creates an object in the repository! Meanwhile, it maintains a persistent copy of the mapping in a Lucene Index on the filesystem.- Author:
- Mike Durbin
-
-
Constructor Summary
Constructors Constructor Description OpaqueIDMapper(File cachedIDIndexDir, Fedora4Client f4Client)A constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBaseURL()StringmapDatastreamPath(String pid, String dsid)Takes a Fedora 3 PID and DSID and returns the path that datastream would have in Fedora 4.StringmapObjectPath(String pid)Takes a Fedora 3 pid and returns the path that object would have in Fedora 4.
-
-
-
Constructor Detail
-
OpaqueIDMapper
public OpaqueIDMapper(File cachedIDIndexDir, Fedora4Client f4Client) throws IOException
A constructor.- Parameters:
cachedIDIndexDir- the directory (or null) where the index of generated pids should be maintainedf4Client- a Fedora 4 client to mediate interactions with the repository- Throws:
IOException- IO exception creating temp and index files/directories
-
-
Method Detail
-
mapObjectPath
public String mapObjectPath(String pid)
Description copied from interface:MigrationIDMapperTakes a Fedora 3 pid and returns the path that object would have in Fedora 4.- Specified by:
mapObjectPathin interfaceMigrationIDMapper- Parameters:
pid- a PID for a Fedora 3 object.- Returns:
- a path suitable for use in Fedora 4.
-
mapDatastreamPath
public String mapDatastreamPath(String pid, String dsid)
Description copied from interface:MigrationIDMapperTakes a Fedora 3 PID and DSID and returns the path that datastream would have in Fedora 4.- Specified by:
mapDatastreamPathin interfaceMigrationIDMapper- Parameters:
pid- a PID for the Fedora 3 objectdsid- the DS id for the Fedora 3 datastream- Returns:
- a path suitable for use in Fedora 4.
-
getBaseURL
public String getBaseURL()
- Specified by:
getBaseURLin interfaceMigrationIDMapper- Returns:
- the fedora 4 base URL. Paths returned by
MigrationIDMapper.mapDatastreamPath(java.lang.String, java.lang.String)andMigrationIDMapper.mapObjectPath(java.lang.String)appended to this value will be resolvable URLs in the fedora 4 repository.
-
-