Package com.exasol.dbbuilder
Class ConnectionDefinition
- java.lang.Object
-
- com.exasol.dbbuilder.AbstractDatabaseObject
-
- com.exasol.dbbuilder.ConnectionDefinition
-
- All Implemented Interfaces:
DatabaseObject
public class ConnectionDefinition extends AbstractDatabaseObject
Definition of a connection to another database or service.Other terms that are used for this are "named connection" or "connection object". A connection definition is a named database object that contains a reference to the remote database or service and optionally credentials.
-
-
Field Summary
-
Fields inherited from class com.exasol.dbbuilder.AbstractDatabaseObject
name, writer
-
-
Constructor Summary
Constructors Constructor Description ConnectionDefinition(DatabaseObjectWriter writer, String name, String target)Create a connection without credentials.ConnectionDefinition(DatabaseObjectWriter writer, String name, String target, String userName, String password)Create a connection with credentials.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DatabaseObjectgetParent()Get the parent object.StringgetPassword()Get the password of the user who connects to the remote database or service.StringgetTarget()Get the target the connection definition points to.StringgetType()Get the type of the database object.StringgetUserName()Get the name of the user who connects to the remote database or service.booleanhasParent()Check if this object has a parent object that sets the scope within the databasebooleanhasPassword()Check whether the connection definition contains a password.booleanhasUserName()Check whether the connection definition contains a user name.-
Methods inherited from class com.exasol.dbbuilder.AbstractDatabaseObject
getFullyQualifiedName, getName
-
-
-
-
Constructor Detail
-
ConnectionDefinition
public ConnectionDefinition(DatabaseObjectWriter writer, String name, String target)
Create a connection without credentials.- Parameters:
writer- database object writername- name of the connectiontarget- target the connection points to
-
ConnectionDefinition
public ConnectionDefinition(DatabaseObjectWriter writer, String name, String target, String userName, String password)
Create a connection with credentials.- Parameters:
writer- database object writername- name of the connectiontarget- target the connection points touserName- user as which to connectpassword- password or password-like credential
-
-
Method Detail
-
getType
public String getType()
Description copied from interface:DatabaseObjectGet the type of the database object.- Returns:
- type of the database object
-
getTarget
public String getTarget()
Get the target the connection definition points to.- Returns:
- target of the connection
-
getUserName
public String getUserName()
Get the name of the user who connects to the remote database or service.- Returns:
- user name
-
getPassword
public String getPassword()
Get the password of the user who connects to the remote database or service.- Returns:
- password or password-like credential
-
hasParent
public boolean hasParent()
Description copied from interface:DatabaseObjectCheck if this object has a parent object that sets the scope within the database- Returns:
trueif the object has a parent
-
getParent
public DatabaseObject getParent()
Description copied from interface:DatabaseObjectGet the parent object.- Returns:
- parent object
-
hasUserName
public boolean hasUserName()
Check whether the connection definition contains a user name.- Returns:
trueif the connection definition contains a user name
-
hasPassword
public boolean hasPassword()
Check whether the connection definition contains a password.- Returns:
trueif the connection definition contains a password
-
-