001package jmri;
002
003/**
004 * Interface for obtaining Logixs
005 * <p>
006 * This doesn't have a "new" method, since Logixs are separately implemented,
007 * instead of being system-specific.
008 * <hr>
009 * This file is part of JMRI.
010 * <p>
011 * JMRI is free software; you can redistribute it and/or modify it under the
012 * terms of version 2 of the GNU General Public License as published by the Free
013 * Software Foundation. See the "COPYING" file for a copy of this license.
014 * <p>
015 * JMRI is distributed in the hope that it will be useful, but WITHOUT ANY
016 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
017 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
018 *
019 * @author Dave Duchamp Copyright (C) 2007
020 */
021public interface LogixManager extends Manager<Logix> {
022
023    /**
024     * Create a new Logix if the Logix does not exist.
025     *
026     * @param systemName the system name
027     * @param userName   the user name
028     * @return a new Logix or null if unable to create: An error, or the Logix already exists
029     */
030    Logix createNewLogix(String systemName, String userName);
031
032    /**
033     * For use with User GUI, to allow the auto generation of systemNames, where
034     * the user can optionally supply a username.
035     *
036     * @param userName the user name
037     * @return a new Logix or null if unable to create
038     */
039    Logix createNewLogix(String userName);
040
041    /**
042     * Locate via user name, then system name if needed. Does not create a new
043     * one if nothing found
044     *
045     * @param name User name or system name to match
046     * @return null if no match found
047     */
048    Logix getLogix(String name);
049
050    @Override
051    Logix getByUserName(String s);
052
053    @Override
054    Logix getBySystemName(String s);
055
056    /**
057     * Activate all Logixs that are not currently active This method is called
058     * after a configuration file is loaded.
059     */
060    void activateAllLogixs();
061
062    /**
063     * Delete Logix by removing it from the manager. The Logix must first be
064     * deactivated so it stops processing.
065     *
066     * @param x the Logix to delete
067     */
068    void deleteLogix(Logix x);
069
070    /**
071     * Support for loading Logixs in a disabled state to debug loops
072     * 
073     * @param s true if Logix should be loadable while disabled
074     */
075    void setLoadDisabled(boolean s);
076
077}