001package jmri.jmrit.logixng;
002
003import java.util.List;
004import java.util.Map;
005import javax.annotation.Nonnull;
006
007/**
008 * Manager for DigitalBooleanActionBean
009 * 
010 * @author Dave Duchamp       Copyright (C) 2007
011 * @author Daniel Bergqvist   Copyright (C) 2018
012 */
013public interface DigitalBooleanActionManager extends BaseManager<MaleDigitalBooleanActionSocket> {
014
015    /**
016     * Remember a NamedBean Object created outside the manager.
017     * This method creates a MaleDigitalBooleanAction 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    MaleDigitalBooleanActionSocket registerAction(@Nonnull DigitalBooleanActionBean action)
024            throws IllegalArgumentException;
025    
026    /**
027     * Create a new system name for an DigitalBooleanActionBean.
028     * @return a new system name
029     */
030    String getAutoSystemName();
031
032    FemaleDigitalBooleanActionSocket createFemaleSocket(
033            Base parent, FemaleSocketListener listener, String socketName);
034
035    /**
036     * Get a set of classes that implements the DigitalBooleanActionBean 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 DigitalBooleanActionBean.
044     *
045     * @param action the action to add
046     * @throws IllegalArgumentException if the action has an invalid system name
047     */
048//    void addAction(DigitalBooleanActionBean 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//    DigitalBooleanActionBean getAction(String name);
059
060//    DigitalBooleanActionBean getByUserName(String s);
061
062//    DigitalBooleanActionBean getBySystemName(String s);
063
064    /**
065     * {@inheritDoc}
066     * 
067     * The sub system prefix for the DigitalActionManager is
068     * {@link #getSystemNamePrefix() } and "DA";
069     */
070    @Override
071    default String getSubSystemNamePrefix() {
072        return getSystemNamePrefix() + "DB";
073    }
074
075    /**
076     * Delete DigitalBooleanAction by removing it from the manager. The DigitalBooleanActionBean must first be
077     * deactivated so it stops processing.
078     *
079     * @param x the DigitalBooleanAction to delete
080     */
081    void deleteDigitalBooleanAction(MaleDigitalBooleanActionSocket x);
082    
083}