|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sap.ip.me.api.pios.connection.Connector
This class is the entry point to all peripheral connections. This class will be the factory providing instances of all peripherals supported by the PIOS layer. Uses connection parameters to find and open a particular connection to a desired peripheral service. The connection parameters define what service is requested and the initial configuration options.
The normal use of the Connector class to open a connection to a printer is as follows:
Connector conn = Connector.getInstance();
DriverInfo[] driverInfo = conn.listDrivers(ConnectionType.PRINTER);
PrinterParameters params = new PrinterParameters(driverInfo[0]);
PrinterConnection pt = (PrinterConnection) conn.open(params);
//Add the printer code here
pt.close();
Connection
,
ConnectionParameters
Field Summary | |
static java.lang.String |
CONNECTOR_IMPL_KEY
Constant for the name of the key used to specify an alternate connector implementation. |
Constructor Summary | |
protected |
Connector()
Constructs a new Connector object. |
Method Summary | |
abstract void |
clearDefaultDriver(ConnectionType connectionType)
Clear the default driver for an specific connection type. |
abstract boolean |
deleteTraceFiles()
Delete all trace log files. |
protected abstract ConfigurationManager |
getConfigurationManager(java.lang.String metaDataFile,
java.lang.String configFile)
This method is used internally to obtain the configuration manager implementation instance. |
abstract DriverInfo |
getDefaultDriver(ConnectionType connectionType)
Returns the default driver for an specific connection type. |
static Connector |
getInstance()
Returns the connector implementation. |
abstract DriverInfo[] |
listDrivers(ConnectionType connectionType)
Returns the installed PIOS drivers for the specified connection type. |
abstract Connection |
open(ConnectionParameters parameters)
Opens a connection to a peripheral based on the parameters. |
abstract void |
setDefaultDriver(DriverInfo driverInfo)
Sets the default driver for an specific connection type. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONNECTOR_IMPL_KEY
Constructor Detail |
protected Connector()
Method Detail |
public static Connector getInstance() throws PIOSException
PIOSException
- thrown if unable to find a Connector implementationpublic abstract Connection open(ConnectionParameters parameters) throws LibraryNotLoadedException, UnsupportedException, PIOSException
parameters
- the peripheral connection parameters to use when opening the connection
PIOSException
- thrown if an error occurs while creating
or opening the peripheral connection
LibraryNotLoadedException
- thrown if an error occurs while
loading native resources for this connection.
UnsupportedException
- thrown if an error occurs while opening
the peripheral connection and functionality request thru the
ConnectionParameters object is not supported by the driver.ConnectionType
,
DriverInfo
,
PIOSException
public abstract DriverInfo[] listDrivers(ConnectionType connectionType) throws PIOSException, LibraryNotLoadedException
connectionType
- the requested connection type of driver
PIOSException
- thrown if an error occurs while listing the
drivers
LibraryNotLoadedException
- thrown if an error occurs while
loading the native layerDriverInfo
public abstract DriverInfo getDefaultDriver(ConnectionType connectionType) throws PIOSException, LibraryNotLoadedException
connectionType
- the connection type for the default driver to find
PIOSException
- thrown if an error occurs while obtaining the
default driver
LibraryNotLoadedException
- thrown if an error occurs while
loading the native layerpublic abstract void setDefaultDriver(DriverInfo driverInfo) throws PIOSException, LibraryNotLoadedException
driverInfo
- the new default driver
PIOSException
- thrown if an error occurs while setting the
default driver
LibraryNotLoadedException
- thrown if an error occurs while
loading the native layerpublic abstract void clearDefaultDriver(ConnectionType connectionType) throws PIOSException
connectionType
- the connection type for the default driver
to be clear.
PIOSException
- thrown if an error occurs while setting the
default driverprotected abstract ConfigurationManager getConfigurationManager(java.lang.String metaDataFile, java.lang.String configFile) throws ConfigurationException
metaDataFile
- the metadata file nameconfigFile
- the configuration file name
ConfigurationException
- thrown if an error occurs while
opening any of the specified filesConfigurationManager
public abstract boolean deleteTraceFiles()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |