Search in sources :

Example 1 with NotFound

use of alma.xmlstore.IdentifierPackage.NotFound in project ACS by ACS-Community.

the class UIDLibrary method fetchRange.

/**
	 * Fetch an existing range from the archive and deserialise, only certain
	 * operations will be permitted.
	 * This method should only be used in very special cases, 
	 * see <a href="http://almasw.hq.eso.org/almasw/bin/view/Archive/UidLibrary">Archive/UidLibrary wiki page</a>!
	 * @param uri
	 * @param identifier  the identifier archive from which a new <code>Range</code> can be obtained if necessary. Use <br>
	 *        <code>ContainerServices#getTransparentXmlComponent(IdentifierJ.class, identRaw, IdentifierOperations.class);</code> <br>
	 *        to create the required XML binding class aware interface from the plain-Corba <code>Identifier</code> object 
	 *        (<code>identRaw</code>) that is obtained, for example, by <br>
	 *        <code>IdentifierHelper.narrow(getDefaultComponent("IDL:alma/xmlstore/Identifier:1.0"))</code>.
	 * 
	 * @throws AcsJRangeUnavailableEx
	 */
public void fetchRange(URI uri, String user, IdentifierJ identifier) throws AcsJRangeUnavailableEx {
    IdentifierRange idRange = null;
    try {
        logger.finest("UIDLibrary: Fetching range: " + uri.toASCIIString());
        idRange = identifier.getExistingRange(uri.toASCIIString(), user);
    } catch (NotFound e) {
        throw new AcsJRangeUnavailableEx(e);
    }
    Range r = new Range(idRange);
    if (!refRanges.containsKey(uri)) {
        refRanges.put(uri, r);
    } else {
        AcsJRangeUnavailableEx ex = new AcsJRangeUnavailableEx();
        ex.setRange(uri.toASCIIString());
        throw ex;
    }
}
Also used : AcsJRangeUnavailableEx(alma.ArchiveIdentifierError.wrappers.AcsJRangeUnavailableEx) IdentifierRange(alma.archive.range.IdentifierRange) IdentifierRange(alma.archive.range.IdentifierRange) NotFound(alma.xmlstore.IdentifierPackage.NotFound)

Aggregations

AcsJRangeUnavailableEx (alma.ArchiveIdentifierError.wrappers.AcsJRangeUnavailableEx)1 IdentifierRange (alma.archive.range.IdentifierRange)1 NotFound (alma.xmlstore.IdentifierPackage.NotFound)1