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