TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.key
Class PromptingKeyProvider.Controller<K extends SafeKey<K>>

java.lang.Object
  extended by de.schlichtherle.truezip.key.PromptingKeyProvider.Controller<K>
Direct Known Subclasses:
PromptingKeyProvider.ReadController, PromptingKeyProvider.WriteController
Enclosing class:
PromptingKeyProvider<K extends SafeKey<K>>

@ThreadSafe
@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class)
public static class PromptingKeyProvider.Controller<K extends SafeKey<K>>
extends Object

Proxies access to the key for PromptingKeyProvider.View implementations.


Field Summary
private  PromptingKeyProvider<K> provider
           
private  PromptingKeyProvider.State state
           
 
Constructor Summary
private PromptingKeyProvider.Controller(PromptingKeyProvider<K> provider, PromptingKeyProvider.State state)
           
 
Method Summary
 K getKey()
          Returns the protected resource's key.
 URI getResource()
          Returns the unique resource identifier (resource ID) of the protected resource for which this controller is used.
private  void invalidate()
           
 void setChangeRequested(boolean changeRequested)
          Requests to prompt the user for a new key upon the next call to SafeKeyProvider.getWriteKey(), provided that the key is set by then.
 void setKey(K key)
          Sets the protected resource's key to a clone of the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

provider

private final PromptingKeyProvider<K extends SafeKey<K>> provider

state

@CheckForNull
private PromptingKeyProvider.State state
Constructor Detail

PromptingKeyProvider.Controller

private PromptingKeyProvider.Controller(PromptingKeyProvider<K> provider,
                                        PromptingKeyProvider.State state)
Method Detail

getResource

public URI getResource()
Returns the unique resource identifier (resource ID) of the protected resource for which this controller is used.

Throws:
IllegalStateException - if getting this property is not legal in the current state.

getKey

@CheckForNull
public K getKey()
Returns the protected resource's key.

Returns:
The protected resource's key.
Throws:
IllegalStateException - if getting key is not legal in the current state.

setKey

public void setKey(@CheckForNull
                   K key)
Sets the protected resource's key to a clone of the given key.

Parameters:
key - The key to clone to use for the protected resource.
Throws:
IllegalStateException - if setting key is not legal in the current state.

setChangeRequested

public void setChangeRequested(boolean changeRequested)
Requests to prompt the user for a new key upon the next call to SafeKeyProvider.getWriteKey(), provided that the key is set by then.

Parameters:
changeRequested - whether or not the user shall get prompted for a new key upon the next call to SafeKeyProvider.getWriteKey(), provided that the key is set then.
Throws:
IllegalStateException - if setting this property is not legal in the current state.

invalidate

private void invalidate()

TrueZIP Driver ZIP.RAES (TZP) 7.1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.