001package jmri.jmrit.logixng; 002 003import java.util.List; 004import java.util.Map; 005 006import javax.annotation.Nonnull; 007 008import jmri.Category; 009 010/** 011 * Manager for StringActionBean 012 * 013 * @author Dave Duchamp Copyright (C) 2007 014 * @author Daniel Bergqvist Copyright (C) 2018 015 */ 016public interface StringActionManager extends BaseManager<MaleStringActionSocket> { 017 018 /** 019 * Remember a NamedBean Object created outside the manager. 020 * This method creates a MaleStringActionSocket for the action. 021 * 022 * @param action the bean 023 * @return the male socket for this action 024 * @throws IllegalArgumentException if the action has an invalid system name 025 */ 026 MaleStringActionSocket registerAction(@Nonnull StringActionBean action) 027 throws IllegalArgumentException; 028 029 /** 030 * Create a new system name for an StringActionBean. 031 * @return a new system name 032 */ 033 String getAutoSystemName(); 034 035 FemaleStringActionSocket createFemaleSocket( 036 Base parent, FemaleSocketListener listener, String socketName); 037 038 /** 039 * Get a set of classes that implements the DigitalAction interface. 040 * 041 * @return a set of entries with category and class 042 */ 043 Map<Category, List<Class<? extends Base>>> getActionClasses(); 044 045 /*.* 046 * Add an Action. 047 * 048 * @param action the action to add 049 * @throws IllegalArgumentException if the action has an invalid system name 050 */ 051// void addAction(Action action) 052// throws IllegalArgumentException; 053 054 /*.* 055 * Locate via user name, then system name if needed. Does not create a new 056 * one if nothing found 057 * 058 * @param name User name or system name to match 059 * @return null if no match found 060 */ 061// Action getAction(String name); 062 063// Action getByUserName(String s); 064 065// Action getBySystemName(String s); 066 067 /** 068 * {@inheritDoc} 069 * 070 * The sub system prefix for the StringActionManager is 071 * {@link #getSystemNamePrefix() } and "SA"; 072 */ 073 @Override 074 default String getSubSystemNamePrefix() { 075 return getSystemNamePrefix() + "SA"; 076 } 077 078 /** 079 * Delete StringAction by removing it from the manager. The Action must first be 080 * deactivated so it stops processing. 081 * 082 * @param x the StringAction to delete 083 */ 084 void deleteStringAction(MaleStringActionSocket x); 085 086}