/** * Default constructor uses LegacyPluginServiceImpl */ public LimitedCountDispatcher() { this((BitstreamDispatcher) CoreServiceFactory.getInstance().getPluginService() .getSinglePlugin(BitstreamDispatcher.class)); }
/** * Initialize an IP authenticator, reading in the configuration. Note this * will never fail if the configuration is bad -- a warning will be logged. */ public IPAuthentication() { ipMatchers = new ArrayList<IPMatcher>(); ipNegativeMatchers = new ArrayList<IPMatcher>(); ipMatcherGroupIDs = new HashMap<>(); ipMatcherGroupNames = new HashMap<>(); groupService = EPersonServiceFactory.getInstance().getGroupService(); clientInfoService = CoreServiceFactory.getInstance().getClientInfoService(); List<String> propNames = DSpaceServicesFactory.getInstance().getConfigurationService() .getPropertyKeys("authentication-ip"); for (String propName : propNames) { String[] nameParts = propName.split("\\."); if (nameParts.length == 2) { addMatchers(nameParts[1], DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty(propName)); } else { log.warn("Malformed configuration property name: " + propName); } } }
protected void prepareXwalk() { if (null != this.xwalk) { return; } this.xwalk = (ParameterizedDisseminationCrosswalk) CoreServiceFactory .getInstance().getPluginService() .getNamedPlugin(DisseminationCrosswalk.class, this.CROSSWALK_NAME); if (this.xwalk == null) { throw new RuntimeException("Can't find crosswalk '" + CROSSWALK_NAME + "'!"); } }
public List<AuthenticationMethod> getAuthenticationMethodStack() { return Arrays.asList((AuthenticationMethod[]) CoreServiceFactory.getInstance().getPluginService() .getPluginSequence(AuthenticationMethod.class)); }
protected void prepareXwalk() { if (null != this.xwalk) { return; } this.xwalk = (ParameterizedDisseminationCrosswalk) CoreServiceFactory.getInstance().getPluginService() .getNamedPlugin( DisseminationCrosswalk.class, this.CROSSWALK_NAME); if (this.xwalk == null) { throw new RuntimeException("Can't find crosswalk '" + CROSSWALK_NAME + "'!"); } }
/** * Retrieve the named delegate */ private static OrderFormatDelegate getDelegate(String name) { if (name != null && name.length() > 0) { // Check the cached array of names to see if the delegate has been configured for (int idx = 0; idx < delegates.length; idx++) { if (delegates[idx].equals(name)) { return (OrderFormatDelegate) CoreServiceFactory.getInstance().getPluginService() .getNamedPlugin(OrderFormatDelegate.class, name); } } } return null; } }
public static SwordEntryIngester getEntryInstance(Context context, Deposit deposit, DSpaceObject dso) throws DSpaceSwordException, SwordError { SwordEntryIngester ingester = (SwordEntryIngester) CoreServiceFactory.getInstance().getPluginService() .getSinglePlugin(SwordEntryIngester.class); if (ingester == null) { throw new SwordError(UriRegistry.ERROR_CONTENT, "No ingester configured for handling SWORD entry documents"); } return ingester; } }
public static SwordEntryDisseminator getEntryInstance() throws DSpaceSwordException, SwordError { SwordEntryDisseminator disseminator = (SwordEntryDisseminator) CoreServiceFactory.getInstance() .getPluginService() .getSinglePlugin(SwordEntryDisseminator.class); if (disseminator == null) { throw new SwordError(DSpaceUriRegistry.REPOSITORY_ERROR, "No disseminator configured for handling sword entry documents"); } return disseminator; } }
/** * Get an instance of WorkflowManager * @return WorkflowManager * @throws DSpaceSwordException * @throws SwordError */ public static WorkflowManager getInstance() throws DSpaceSwordException, SwordError { WorkflowManager manager = (WorkflowManager) CoreServiceFactory.getInstance().getPluginService() .getSinglePlugin(WorkflowManager.class); if (manager == null) { throw new SwordError(DSpaceUriRegistry.REPOSITORY_ERROR, "No workflow manager configured"); } return manager; } }
@Override public void formatTo(Formatter formatter, int flags, int width, int precision) { LicenseArgumentFormatter laf = (LicenseArgumentFormatter) CoreServiceFactory.getInstance().getPluginService() .getNamedPlugin( LicenseArgumentFormatter.class, type); if (laf != null) { laf.formatTo(formatter, flags, width, object, type); } else { formatter.format(object.toString()); } } }
protected Object getCrosswalk(String type, Class clazz) { /** * Allow DSpace Config to map the metadata type to a * different crosswalk name either per-packager or for METS * in general. First, look for config key like: * mets.<packagerName>.ingest.crosswalk.MDNAME = XWALKNAME * then try * mets.default.ingest.crosswalk.MDNAME = XWALKNAME */ String xwalkName = ConfigurationManager.getProperty( CONFIG_METS_PREFIX + configName + ".ingest.crosswalk." + type); if (xwalkName == null) { xwalkName = ConfigurationManager.getProperty( CONFIG_METS_PREFIX + "default.ingest.crosswalk." + type); if (xwalkName == null) { xwalkName = type; } } return CoreServiceFactory.getInstance().getPluginService().getNamedPlugin(clazz, xwalkName); }
private String makeDerivedFilename(String bundleName, String origName) { PluginService pluginService = CoreServiceFactory.getInstance().getPluginService(); // get the MediaFilter that would create this bundle: String mfNames[] = pluginService.getAllPluginNames(MediaFilter.class); for (int i = 0; i < mfNames.length; ++i) { MediaFilter mf = (MediaFilter) pluginService.getNamedPlugin(MediaFilter.class, mfNames[i]); if (bundleName.equals(mf.getBundleName())) { return mf.getFilteredName(origName); } } return null; }
public static SwordStatementDisseminator getStatementInstance( Map<Float, List<String>> accept) throws DSpaceSwordException, SwordError { SwordStatementDisseminator disseminator = null; // first try to load disseminators based on content type if (accept != null) { for (Float q : accept.keySet()) { for (String format : accept.get(q)) { format = format.replace(";", "_"); // clean up the string for the plugin manager format = format.replace("=", "_"); // clean up the string for the plugin manager disseminator = (SwordStatementDisseminator) CoreServiceFactory.getInstance().getPluginService() .getNamedPlugin( SwordStatementDisseminator.class, format); if (disseminator != null) { break; } } } } if (disseminator == null) { throw new SwordError(UriRegistry.ERROR_CONTENT, 406, "No plugin can disseminate the requested formats"); } return disseminator; }
public static LinkedHashMap<String, Check> checks() { LinkedHashMap<String, Check> checks = new LinkedHashMap<>(); String check_names[] = DSpaceServicesFactory.getInstance().getConfigurationService() .getArrayProperty("healthcheck.checks"); PluginService pluginService = CoreServiceFactory.getInstance().getPluginService(); for (String check_name : check_names) { Check check = (Check) pluginService.getNamedPlugin( Check.class, check_name); if (null != check) { checks.put(check_name, check); } else { log.warn(String.format( "Could not find implementation for [%s]", check_name)); } } return checks; }
SwordContentIngester ingester = null; PluginService pluginService = CoreServiceFactory.getInstance().getPluginService();
/** * Places a curation request for the object identified by id on a * managed queue named by the queueId. * * @param c A DSpace context * @param id an object Id * @param queueId name of a queue. If queue does not exist, it will * be created automatically. * @throws IOException if IO error */ public void queue(Context c, String id, String queueId) throws IOException { if (taskQ == null) { taskQ = (TaskQueue) CoreServiceFactory.getInstance().getPluginService().getSinglePlugin(TaskQueue.class); } if (taskQ != null) { taskQ.enqueue(queueId, new TaskQueueEntry(c.getCurrentUser().getName(), System.currentTimeMillis(), perfList, id)); } else { log.error("curate - no TaskQueue implemented"); } }
public static List<ItemFilter> getItemFilters(String filters, boolean saveItems) { LinkedHashMap<String, ItemFilterTest> availableTests = new LinkedHashMap<String, ItemFilterTest>(); for (ItemFilterList plugobj : (ItemFilterList[]) CoreServiceFactory.getInstance() .getPluginService().getPluginSequence(ItemFilterList.class)) { for (ItemFilterTest defFilter : plugobj.getFilters()) { availableTests.put(defFilter.getName(), defFilter);
format = format.replace("=", "_"); // clean up the string for the plugin manager disseminator = (SwordContentDisseminator) CoreServiceFactory.getInstance().getPluginService() .getNamedPlugin( SwordContentDisseminator.class, acceptPackaging = acceptPackaging.replace("=", "_"); // clean up the string for the plugin manager disseminator = (SwordContentDisseminator) CoreServiceFactory.getInstance().getPluginService() .getNamedPlugin( SwordContentDisseminator.class,
DSpaceObject dso) throws DSpaceSWORDException, SWORDErrorException { PluginService pluginService = CoreServiceFactory.getInstance().getPluginService();
pluginService = CoreServiceFactory.getInstance().getPluginService();