001package jmri.jmrix.internal;
002
003import org.slf4j.Logger;
004import org.slf4j.LoggerFactory;
005
006
007/**
008 * Provides a dummy Adapter to allow the system connection memo and multiple
009 * Internal managers to be handled.
010 *
011 * @author Bob Jacobsen Copyright (C) 2001, 2002
012 */
013public class InternalAdapter extends jmri.jmrix.AbstractSerialPortController {
014
015    // private control members
016    private boolean opened = false;
017
018    public InternalAdapter() {
019        super(new InternalSystemConnectionMemo(false));  // building a complete system, with dummy ConsistManager et al
020        opened = true;
021        this.manufacturerName = InternalConnectionTypeList.NONE;
022    }
023
024    @Override
025    public void dispose() {
026        super.dispose();
027    }
028
029    @Override
030    public String openPort(String portName, String appName) {
031        return "true";
032    }
033
034    @Override
035    public void configure() {
036        this.getSystemConnectionMemo().configureManagers();
037
038    }
039
040    @Override
041    public boolean status() {
042        return opened;
043    }
044
045    /**
046     * {@inheritDoc}
047     */
048    @Override
049    public String[] validBaudRates() {
050        log.debug("validBaudRates should not have been invoked");
051        return new String[]{};
052    }
053
054    /**
055     * {@inheritDoc}
056     */
057    @Override
058    public int[] validBaudNumbers() {
059        return new int[]{};
060    }
061
062    @Override
063    public String getCurrentBaudRate() {
064        return "";
065    }
066
067    @Override
068    public java.io.DataInputStream getInputStream() {
069        return null;
070    }
071
072    @Override
073    public java.io.DataOutputStream getOutputStream() {
074        return null;
075    }
076
077    @Override
078    public InternalSystemConnectionMemo getSystemConnectionMemo() {
079        return (InternalSystemConnectionMemo) super.getSystemConnectionMemo();
080    }
081
082    @Override
083    public void recover() {
084
085    }
086
087    private final static Logger log = LoggerFactory
088            .getLogger(InternalAdapter.class);
089
090}