org.bidib.wizard.api.model.connection.SwitchingConnection Maven / Gradle / Ivy
Show all versions of bidibwizard-api Show documentation
package org.bidib.wizard.api.model.connection;
import java.util.List;
import java.util.Map;
import org.bidib.jbidibc.messages.LcConfig;
import org.bidib.jbidibc.messages.enums.FeatureEnum;
import org.bidib.jbidibc.messages.enums.LcMacroState;
import org.bidib.jbidibc.messages.enums.LcOutputType;
import org.bidib.jbidibc.messages.exception.InvalidConfigurationException;
import org.bidib.jbidibc.messages.port.PortConfigValue;
import org.bidib.wizard.api.model.Accessory;
import org.bidib.wizard.api.model.Macro;
import org.bidib.wizard.api.model.NodeInterface;
import org.bidib.wizard.api.model.SwitchingNodeInterface;
import org.bidib.wizard.model.ports.GenericPort;
import org.bidib.wizard.model.ports.Port;
public interface SwitchingConnection {
/**
* Get the ports of the node.
*
* @param node
* the node
* @return the collection of ports
*/
> List
getPorts(final NodeInterface node, Class> portClass, FeatureEnum feature);
/**
* Query the port config of the node.
*
* @param node
* the node
* @param ports
* the ports to query
*/
void queryPortConfig(final NodeInterface node, List ports);
/**
* Query the port config of the node.
*
* @param node
* the node
* @param ports
* the ports to query
* @param lcOutputType
* the output type
*/
> void queryPortConfig(NodeInterface node, List
ports, LcOutputType lcOutputType);
/**
* Query all port config values of the node.
*
* @param node
* the node
* @param outputType
* the port type
* @param rangeFrom
* start number of port that is transmitted (included range)
* @param rangeTo
* end number of port that is not transmitted (excluded range)
*/
void queryAllPortConfig(final NodeInterface node, LcOutputType outputType, Integer rangeFrom, Integer rangeTo);
/**
* Query all port states. This is available from protocol version 0.7.
*
* @param node
* the node
* @param portTypeMask
* the port type mask like in CONFIGX
* @param rangeFrom
* range from
* @param rangeTo
* range to
*/
void queryAllPortStatus(final NodeInterface node, int portTypeMask, int rangeFrom, int rangeTo);
/**
* Query the port status of the specified port.
*
* @param node
* the node
* @param lcOutputType
* the port type
* @param portIds
* the port ids
*/
void queryPortStatus(final SwitchingNodeInterface node, LcOutputType lcOutputType, List portIds);
/**
* Set the port config.
*
* @param node
* the node
* @param lcOutputType
* the port type
* @param port
* the port
* @param values
* the values
*/
void setConfigX(
final NodeInterface node, LcOutputType lcOutputType, int port, final Map> values);
/**
* Set the port config.
*
* @param node
* the node
* @param portId
* the port id
* @param lcConfig
* the lcConfig
*/
void setConfig(final NodeInterface node, int portId, final LcConfig lcConfig);
/**
* Set the port status.
*
* @param node
* the node
* @param portId
* the port id
* @param value
* the value
*/
void setStatus(final NodeInterface node, int portId, LcOutputType lcOutputType, Integer value);
/**
* Get the content of the accessory.
*
* @param node
* the node
* @param accessory
* the accessory
* @param accessoryMacroMapped
* the number of aspects that can be applied to the accessory
*/
void getAccessoryContent(final NodeInterface node, Accessory accessory, int accessoryMacroMapped);
/**
* Store accessory on the node.
*
* @param node
* the node
* @param accessory
* the accessory
*/
void saveAccessory(final NodeInterface node, Accessory accessory);
/**
* Set the accessory to the aspect.
*
* @param node
* the node
* @param accessory
* the accessory
* @param aspect
* the aspect
*/
void setAccessoryAspect(final NodeInterface node, Accessory accessory, Integer aspect);
/**
* Query the state of the accessory.
*
* @param node
* the node
* @param accessories
* the accessories
*/
void queryAccessoryState(final NodeInterface node, List accessories);
/**
* Transfer the macro to the node and store in permanent memory.
*
* @param node
* the node
* @param macro
* the macro
*/
LcMacroState saveMacro(final NodeInterface node, final Macro macro);
/**
* Load the macro with the specified macro id from the node.
*
* @param node
* the node
* @param macro
* the macro
*/
LcMacroState reloadMacro(final NodeInterface node, final Macro macro);
/**
* Transfer the macro to the node but don't store in permanent memory.
*
* @param node
* the node
* @param macro
* the macro
*/
Macro transferMacro(final NodeInterface node, final Macro macro);
/**
* Get the content (the macro points) of the macro.
*
* @param node
* the node
* @param macro
* the current macro instance
* @return the provided macro instance with the content retrieved from the device
* @throws InvalidConfigurationException
* if the conversion of the received data into the LcMacro failed
*/
Macro getMacroContent(final NodeInterface node, final Macro macro);
/**
* Start the macro.
*
* @param node
* the node
* @param macro
* the macro
* @param transferBeforeStart
* transfer the macro before start
* @return the macro state
*/
LcMacroState startMacro(final NodeInterface node, Macro macro, boolean transferBeforeStart);
/**
* Stop the macro.
*
* @param node
* the node
* @param macro
* the macro
* @return the new macro state
*/
LcMacroState stopMacro(final NodeInterface node, Macro macro);
}