com.informatica.powercenter.sdk.mapfwk.core
Class ConnectionInfo
java.lang.Object
com.informatica.powercenter.sdk.mapfwk.core.ConnectionInfo
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- PowerConnectConInfo
public class ConnectionInfo
- extends java.lang.Object
- implements java.lang.Cloneable
Represents a source/target connection. This class captures
all the information related to a connection, session extenstions
for source or target and session level override connection attributes
This is required to create a source or target. Connection attributes
except the session level overrides are stored in a
ConnectionProperties
object.
Following is a code example for creating flat file source using
flat file connection
// create a connection info object for flat file source
ConnectionInfo ffConn = new ConnectionInfo( SourceTargetTypes.FLATFILE_TYPE );
// gets the connection properties for flat file
ConnectionProperties ffConnProp = ffConn.getConnProps();
// set the connection properties for flat file
ffConnProp.setProperty(ConnectionPropsConstants.FLATFILE_DELIMITERS,";");
ffConnProp.setProperty(ConnectionPropsConstants.DATETIME_FORMAT,"A 21 yyyy/mm/dd hh24:mi:ss");
ffConnProp.setProperty(ConnectionPropsConstants.FLATFILE_QUOTE_CHARACTER,"DOUBLE");
ffConnProp.setProperty(ConnectionPropsConstants.SOURCE_FILENAME,"employee.txt");
// create a flat file source using this connection info
Source src = new Source( "Employee", "Employee", "This is a flat file source Employee", "Employee", ffConn);
// get the connection info from flat file source
ConnectionInfo ffConnReturned = src.getConnInfo();
// get the connection properties from flat file source connection
ConnectionProperties ffConnPropReturned = ffConnReturned.getConnProps();
- See Also:
Source
,
Target
,
ConnectionPropsConstants
,
ConnectionProperties
Constructor Summary |
ConnectionInfo(int type)
Creates a ConnectionInfo object for the given connection type. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionInfo
public ConnectionInfo(int type)
- Creates a ConnectionInfo object for the given connection type.
Connection type should be one of the constants defined in
SourceTargetTypes
- Parameters:
type
- connection type- See Also:
SourceTargetTypes
getConnProps
public ConnectionProperties getConnProps()
- Gets the properties of the connection
- Returns:
- connection properties.
- See Also:
ConnectionProperties
getSessLevelOverrideConnAttributes
public java.util.Properties getSessLevelOverrideConnAttributes()
- Gets the connection attributes, which are overrriden at session level.
Attributes are specified as name, value pair in Properties
- Returns:
- connection attributes overriden at session level
getConnType
public int getConnType()
- Gets the connection type
Connection type should be one of the constants defined in
SourceTargetTypes
- Returns:
- connection type
- See Also:
#setConnType()
setConnType
public void setConnType(int connType)
- Sets the connection type
Connection type should be one of the constants defined in
SourceTargetTypes
- Parameters:
connType
- connection type- See Also:
getConnType()
clone
public java.lang.Object clone()
- Creates a deep clone of this ConnectionInfo object
- Overrides:
clone
in class java.lang.Object
- Returns:
- deep clone of this ConnectionInfo object
isReadOnly
public boolean isReadOnly()
- Gets the value readonly flag
- Returns:
- boolean value the readonly flag
- See Also:
setReadOnly(boolean)
setReadOnly
public void setReadOnly(boolean readOnly)
- Sets the value of readonly flag
- Parameters:
readOnly
- boolean value of readOnly flag- See Also:
isReadOnly()
setConnectionVariable
public void setConnectionVariable(java.lang.String connVariable)
- Sets connection variable for the connection.
Connection variable should be either $Source/$Target, or $DBConnection,
i.e., a value prefixed by $DBConnection
Note that only one of connection variable or connection name can be set at
one point of time. If connection name is already set and this function is called,
then an exception is thrown
- Parameters:
connVariable
- connection variable to be set. It should be either $Source/$Target,
or $DBConnection, i.e., a value prefixed by $DBConnection- See Also:
getConnectionVariable()
,
ConnectionPropsConstants.CONNECTIONNAME
getConnectionVariable
public java.lang.String getConnectionVariable()
- Gets the connection variable.
If no connection variable is set for this connection, then null
is returned
- Returns:
- connection variable. It is not one of $Source or $Target connection
variable, or of the form $DBConnection