org.knime.core.node.workflow
Class Credentials

java.lang.Object
  extended by java.util.Observable
      extended by org.knime.core.node.workflow.Credentials
All Implemented Interfaces:
ICredentials

public final class Credentials
extends Observable
implements ICredentials

The credentials implementation. Fields are mutable (in comparison to the interface).

Author:
Bernd Wiswedel, KNIME.com, Zurich, Switzerland

Constructor Summary
Credentials(String name)
          Create new credentials for a given name.
Credentials(String name, String login, String password)
          Create new credentials for a given name, initializing defaults.
 
Method Summary
(package private)  void addClient(NodeContainer nc)
          Add a client to the set of interested clients.
 Credentials clone()
          
 boolean equals(Object obj)
           
 String getLogin()
          The login name as passed to the DB connection or other password-secured systems.
 String getName()
          The (workflow-global) unique identifier of this credentials object.
 String getPassword()
          The password as passed to the DB connection or other password-secured systems.
 int hashCode()
          
(package private) static Credentials load(NodeSettingsRO settings)
          Load credentials from argument.
(package private)  void removeClient(NodeContainer nc)
          Remove the client from the history list (if registered).
(package private)  void save(NodeSettingsWO settings)
          Saves name and login info to argument.
(package private)  void setLogin(String login)
           
(package private)  void setPassword(String password)
           
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Credentials

Credentials(String name)
Create new credentials for a given name. The name must be unique in the context of a workflow's credentials store.

Parameters:
name - Name of credentials (identifier)

Credentials

public Credentials(String name,
                   String login,
                   String password)
Create new credentials for a given name, initializing defaults. The name must be unique in the context of a workflow's credentials store.

Parameters:
name - Name of credentials (identifier)
login - The login name.
password - the password.
Method Detail

getLogin

public String getLogin()
The login name as passed to the DB connection or other password-secured systems.

Specified by:
getLogin in interface ICredentials
Returns:
the login name.

setLogin

void setLogin(String login)
Parameters:
login - the login to set

getPassword

public String getPassword()
The password as passed to the DB connection or other password-secured systems.

Specified by:
getPassword in interface ICredentials
Returns:
the login name.

setPassword

void setPassword(String password)
Parameters:
password - the password to set

getName

public String getName()
The (workflow-global) unique identifier of this credentials object.

Specified by:
getName in interface ICredentials
Returns:
The identifier.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Returns:
true, if this and the given Credentials object's name and login matches, otherwise false

hashCode

public int hashCode()

Overrides:
hashCode in class Object

clone

public Credentials clone()

Overrides:
clone in class Object

removeClient

void removeClient(NodeContainer nc)
Remove the client from the history list (if registered).

Parameters:
nc - The client to remove.

addClient

void addClient(NodeContainer nc)
Add a client to the set of interested clients.

Parameters:
nc - The client.

save

void save(NodeSettingsWO settings)
Saves name and login info to argument.

Parameters:
settings - To save to.

load

static Credentials load(NodeSettingsRO settings)
                 throws InvalidSettingsException
Load credentials from argument.

Parameters:
settings - To load from.
Returns:
a new credentials object
Throws:
InvalidSettingsException - If that fails for any reason.


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.