001package jmri.jmrix.internal;
002
003import javax.annotation.Nonnull;
004import jmri.Reporter;
005
006/**
007 * Implementation of the InternalReporterManager interface.
008 *
009 * @author Bob Jacobsen Copyright (C) 2010
010 * @since 2.9.4
011 */
012public class InternalReporterManager extends jmri.managers.AbstractReporterManager {
013
014    public InternalReporterManager(InternalSystemConnectionMemo memo) {
015        super(memo);
016    }
017
018    /**
019     * {@inheritDoc}
020     *
021     * @return an internal Reporter of class TrackReporter object with the given name
022     */
023    @Nonnull
024    @Override
025    protected Reporter createNewReporter(@Nonnull String systemName, String userName) throws IllegalArgumentException {
026        return new TrackReporter(systemName, userName);
027    }
028
029    @Override
030    public boolean allowMultipleAdditions(@Nonnull String systemName) {
031        return true;
032    }
033
034    /**
035     * No validation for Internal Reporters.
036     * {@inheritDoc}
037     */
038    @Override
039    public String createSystemName(@Nonnull String curAddress, @Nonnull String prefix) throws jmri.JmriException {
040        return prefix + typeLetter() + curAddress;
041    }
042
043}