com.sap.ip.me.api.pios.connection
Class Connection

java.lang.Object
  extended bycom.sap.ip.me.api.pios.connection.Connection
Direct Known Subclasses:
PrinterConnection, RfidConnection, ScannerConnection

public abstract class Connection
extends java.lang.Object

This is the base class for all Connection implementations. All peripheral implementations must inherit from this class.

Since:
MI 2.5
Author:
Abaco
See Also:
Connector

Field Summary
protected  java.lang.String attributesFileName
          The name of the driver attributes/property file.
protected  java.lang.String cfgFile
          The name of the configuration file.
protected  boolean opened
          Tells whether or not the connection is open.
protected  ConnectionParameters parameters
          The connection parameters used to open the connection.
 
Constructor Summary
protected Connection()
          Creates a new Connection object.
 
Method Summary
 void close()
          Closes this connection and releases any system resources associated with it.
 ConnectionParameters getParameters()
          Retrieves the connection parameters used to open the connection.
 boolean isOpen()
          Returns whether the connection is open or not.
protected  void open(ConnectionParameters parameters, java.lang.String cfgFile)
          Opens this connection creating any system resource needed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

opened

protected boolean opened
Tells whether or not the connection is open.


parameters

protected ConnectionParameters parameters
The connection parameters used to open the connection.


cfgFile

protected java.lang.String cfgFile
The name of the configuration file.


attributesFileName

protected java.lang.String attributesFileName
The name of the driver attributes/property file. The name is typically the name of the driver.

See Also:
DriverInfo.getName()
Constructor Detail

Connection

protected Connection()
              throws PIOSException
Creates a new Connection object.

Throws:
PIOSException - thrown if an error occurs while creating the connection.
Method Detail

open

protected void open(ConnectionParameters parameters,
                    java.lang.String cfgFile)
             throws PIOSException
Opens this connection creating any system resource needed.

Parameters:
parameters - the ConnectionParameters object with the parameters values to open the connection
cfgFile - the configuration file name
Throws:
PIOSException - thrown if an error occurs while opening the peripheral connection. Also if the specified parameters are null or are not supported by the driver.

close

public void close()
           throws PIOSException
Closes this connection and releases any system resources associated with it.

Throws:
PIOSException - thrown if the method is unable to close the connection.

isOpen

public boolean isOpen()
Returns whether the connection is open or not.

Returns:
true if the connection is open; false otherwise.

getParameters

public final ConnectionParameters getParameters()
Retrieves the connection parameters used to open the connection.

Returns:
The Connection Parameters object used to open the connection.
See Also:
ConnectionParameters


Copyright © 2005 SAP AG. All Rights Reserved.