@Override public Identify handle(OAICompiledRequest params) throws OAIException, HandlerException { Identify identify = new Identify(); RepositoryConfiguration configuration = getRepository().getConfiguration(); identify.withBaseURL(configuration.getBaseUrl()); identify.withRepositoryName(configuration.getRepositoryName());
public IdentifyHandler(Context context, Repository repository) { super(context, repository); // Static validation RepositoryConfiguration configuration = getRepository().getConfiguration(); if (configuration == null) throw new InternalOAIException("No repository configuration provided"); if (configuration.getMaxListSets() <= 0) throw new InternalOAIException("The repository configuration must return maxListSets greater then 0"); if (configuration.getMaxListIdentifiers() <= 0) throw new InternalOAIException("The repository configuration must return maxListIdentifiers greater then 0"); if (configuration.getMaxListRecords() <= 0) throw new InternalOAIException("The repository configuration must return maxListRecords greater then 0"); if (configuration.getAdminEmails() == null || configuration.getAdminEmails().isEmpty()) throw new InternalOAIException("The repository configuration must return at least one admin email"); try { if (configuration.getBaseUrl() == null) throw new InternalOAIException("The repository configuration must return a valid base url (absolute)"); new URL(configuration.getBaseUrl()); } catch (MalformedURLException e) { throw new InternalOAIException("The repository configuration must return a valid base url (absolute)", e); } if (configuration.getDeleteMethod() == null) throw new InternalOAIException("The repository configuration must return a valid delete method"); if (configuration.getEarliestDate() == null) throw new InternalOAIException("The repository configuration must return a valid earliest date. That's the date of the first inserted item"); if (configuration.getRepositoryName() == null) throw new InternalOAIException("The repository configuration must return a valid repository name"); }