issrg.acm.extensions
Class WebDAVSavingUtility

java.lang.Object
  extended by issrg.acm.SavingUtility
      extended by issrg.acm.DefaultSavingUtility
          extended by issrg.acm.extensions.WebDAVSavingUtility
All Implemented Interfaces:
Utility, WebDAV_DIT_Listener, java.awt.event.ActionListener, java.util.EventListener

public class WebDAVSavingUtility
extends DefaultSavingUtility
implements java.awt.event.ActionListener, WebDAV_DIT_Listener

This is the WebDAV saving utility.

This utility saves the given Attribute Certificate to a WebDAV Repository, of which the Host and Port can be dynamically changed in the dialog. The DN to save to is obtained from the AC to save; the DN to load from is obtained from the DIT selection.

SSL client authentication to the WebDAV server is required (HTTPS).

The utility was tested on Apache 2.2.3 mod_dav only.

Version:
11/03/2007
Author:
Sean Antony

Field Summary
static java.lang.String policyPrefix
           
 
Fields inherited from class issrg.acm.DefaultSavingUtility
dialog, dialogMode, LOAD_MODE, modal_result, REVOKE_MODE, SAVE_MODE
 
Constructor Summary
WebDAVSavingUtility(java.lang.String acName)
          Load with an AC Name prespecified for the case of the PE, otherwise will prompt the user for one.
WebDAVSavingUtility(java.lang.String acName, boolean forceWebdav, java.util.Map env)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent actionEvent)
          Handles the event of a user clicking the Connect button.
 void approveSelection()
          This method should check, if the currently selected location is OK with the user (e.g.
 void delete()
          Deletes the currently selected AC in the ACViewer.
 java.awt.Component getContentPane(java.util.Map env, int dialogMode)
          Reads in the environment settings: cfg variables, and sets the DN, Host, Port, and P12 Filename & Password values.
 AttributeCertificate load()
          Loads the currently selected AC in the ACViewer.
 AttributeCertificate revoke()
          This method returns an Attribute Certificate loaded for revocation by the utility, as specified by its controls.
 void save(byte[] ac)
          Saves the AC to the WebDAV repository.
 void valueChanged_WebDAV_DIT(WebDAV_DIT_Event evt)
          Handles the event of a user changing the selection of a node in the DIT, representing a DN.
 
Methods inherited from class issrg.acm.DefaultSavingUtility
attachControlButtons, cancelDialog, load, revoke, save
 
Methods inherited from class issrg.acm.SavingUtility
registerMe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

policyPrefix

public static final java.lang.String policyPrefix
See Also:
Constant Field Values
Constructor Detail

WebDAVSavingUtility

public WebDAVSavingUtility(java.lang.String acName)
Load with an AC Name prespecified for the case of the PE, otherwise will prompt the user for one.


WebDAVSavingUtility

public WebDAVSavingUtility(java.lang.String acName,
                           boolean forceWebdav,
                           java.util.Map env)
Method Detail

approveSelection

public void approveSelection()
Description copied from class: DefaultSavingUtility
This method should check, if the currently selected location is OK with the user (e.g. he doesn't mind overwriting a file, etc)

Override to ask questions or display error messages.

Overrides:
approveSelection in class DefaultSavingUtility

load

public AttributeCertificate load()
                          throws ACCreationException
Loads the currently selected AC in the ACViewer.

Specified by:
load in class DefaultSavingUtility
Returns:
issrg.ac.AttributeCertificate, loaded from the specified location; never null
Throws:
ACCreationException

revoke

public AttributeCertificate revoke()
                            throws ACCreationException
Description copied from class: DefaultSavingUtility
This method returns an Attribute Certificate loaded for revocation by the utility, as specified by its controls.

Specified by:
revoke in class DefaultSavingUtility
Returns:
issrg.ac.AttributeCertificate, loaded from the specified location; never null
Throws:
ACCreationException

save

public void save(byte[] ac)
          throws ACCreationException
Saves the AC to the WebDAV repository.

Specified by:
save in class DefaultSavingUtility
Throws:
ACCreationException

delete

public void delete()
            throws ACCreationException
Deletes the currently selected AC in the ACViewer.

Specified by:
delete in class SavingUtility
Throws:
ACCreationException - if anything went wrong and the AC could not be removed.

getContentPane

public java.awt.Component getContentPane(java.util.Map env,
                                         int dialogMode)
Reads in the environment settings: cfg variables, and sets the DN, Host, Port, and P12 Filename & Password values.

Establishes an SSL connection to Host:Port, authenticating itself with the P12 key & certificate file.

Calls issrg.utils.Util.bewail() if connection throws an error, with the error message returned.

Specified by:
getContentPane in class DefaultSavingUtility
Parameters:
env - - the environment that allows the component to initialise its fields and controls
dialogMode - - set to one of LOAD_MODE, SAVE_MODE or REVOKE_MODE, depending on the required content pane for the dialog
Returns:
java.awt.Component that contains all the necessary controls (without Load/Save/Cancel buttons)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent actionEvent)
Handles the event of a user clicking the Connect button.

Calls the refreshDIT() method.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

valueChanged_WebDAV_DIT

public void valueChanged_WebDAV_DIT(WebDAV_DIT_Event evt)
Handles the event of a user changing the selection of a node in the DIT, representing a DN.

Loads any ACs found under that DN into the ACViewer, with it's unique name.

Specified by:
valueChanged_WebDAV_DIT in interface WebDAV_DIT_Listener