org.knime.core.node.workflow
Class CredentialsProvider

java.lang.Object
  extended by org.knime.core.node.workflow.CredentialsProvider

public final class CredentialsProvider
extends Object

Provides available credential variables for a workflow. Credentials are globally defined on workflows, a CredentialsProvider provides read-only access to these credentials.

Objects of this class are available in the NodeModel by the corresponding get method. Concrete implementations of a node will use a dialog component to list all available credentials identifiers (available in listNames()), let the user choose one of these identifiers, and fetch the concrete credentials paramenter using get(String).

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

Constructor Summary
CredentialsProvider(NodeContainer client, CredentialsStore store)
          Creates new provider for a given node container and a store to read from.
 
Method Summary
(package private)  void clearClientHistory()
          Remove history of get invocations associated with this client.
 boolean equals(Object obj)
          
 ICredentials get(String name)
          Read a credentials variable from the store.
(package private)  NodeContainer getClient()
           
(package private)  CredentialsStore getStore()
           
 int hashCode()
          
 Collection<String> listNames()
          List all credentials variables available in the workflow.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CredentialsProvider

CredentialsProvider(NodeContainer client,
                    CredentialsStore store)
Creates new provider for a given node container and a store to read from.

Parameters:
client - The client that fetches password values (used to track, e.g. usage history)
store - The store to get the credentials from.
Method Detail

get

public ICredentials get(String name)
Read a credentials variable from the store.

Parameters:
name - The identifier of the credentials parameter of interest.
Returns:
The credentials for the identifier.
Throws:
IllegalArgumentException - If the name is invalid (no such credentials)

listNames

public Collection<String> listNames()
List all credentials variables available in the workflow. The names returned in the collection are valid identifiers for the get(String) method.

Returns:
the collection of valid credentials identifiers.

getClient

NodeContainer getClient()
Returns:
the client

getStore

CredentialsStore getStore()
Returns:
the store

clearClientHistory

void clearClientHistory()
Remove history of get invocations associated with this client.


toString

public String toString()

Overrides:
toString in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)

Overrides:
equals in class Object


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.