public void load(final ResourceKey resourceKeyParam) throws ResourceException { // only called once during find final DSpace model; final String id; if (resourceKeyParam == null) { model = (DSpace) mH.getSingleModel(null, QUERY_INSTANCES, null); id = model.getId(); logger.debug("dspace Singleton found with id: " + id); } else if (getResourceHome().getKeyTypeName().equals(resourceKeyParam.getName())) { id = (String) resourceKeyParam.getValue(); model = loadModelById(id); } else throw new InvalidResourceKeyException("Invalid resourceKey name"); initialize(new DSpaceResourceProperties(), DSpaceConstants.RESOURCE_PROPERTY_SET, id); loadFromModel(model); }
@NotNull public DSpace loadModelById(@NotNull String id) throws ResourceException { return (DSpace) mH.loadModelById(null, id); }