001package jmri.jmrit.logixng;
002
003import java.util.List;
004import java.util.Map;
005import javax.annotation.Nonnull;
006
007/**
008 * Manager for DigitalActionBean
009 * 
010 * @author Dave Duchamp       Copyright (C) 2007
011 * @author Daniel Bergqvist   Copyright (C) 2018
012 */
013public interface DigitalActionManager extends BaseManager<MaleDigitalActionSocket> {
014
015    /**
016     * Remember a NamedBean Object created outside the manager.
017     * This method creates a MaleDigitalActionSocket 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    MaleDigitalActionSocket registerAction(@Nonnull DigitalActionBean action)
024            throws IllegalArgumentException;
025    
026    /**
027     * Create a new system name for an DigitalActionBean.
028     * @return a new system name
029     */
030    String getAutoSystemName();
031
032    FemaleDigitalActionSocket createFemaleSocket(
033            Base parent, FemaleSocketListener listener, String socketName);
034
035    /**
036     * Get a set of classes that implements the DigitalActionBean interface.
037     * 
038     * @return a set of entries with category and class
039     */
040    Map<Category, List<Class<? extends Base>>> getActionClasses();
041
042    /**
043     * {@inheritDoc}
044     * 
045     * The sub system prefix for the DigitalActionManager is
046     * {@link #getSystemNamePrefix() } and "DA";
047     */
048    @Override
049    default String getSubSystemNamePrefix() {
050        return getSystemNamePrefix() + "DA";
051    }
052
053    /**
054     * Delete DigitalActionBean by removing it from the manager. The DigitalActionBean must first be
055     * deactivated so it stops processing.
056     *
057     * @param x the DigitalActionBean to delete
058     */
059    void deleteDigitalAction(MaleDigitalActionSocket x);
060    
061}