ProxyLight/VomsProxyInitDialog

Voms proxy init dialog

This is what you get when you follow this HowTo:

This is how you display a JDialog that allows to create the user a plain proxy and also a voms proxy. You need to implement the interface  ProxyInitListener to be able to make use of it:

VomsProxyInitDialog dialog = new VomsProxyInitDialog();
// setLifetimeDefaults is optional
dialog.setLifetimeDefaults(new Integer[]{1,2,7});
//enableWriteToDisk is optional (default is false)
dialog.enableWriteToDisk(true);
dialog.addProxyListener(proxyListener);
dialog.setVisible(true);

If you are unhappy with the defaults I set in the combobox for the lifetime, you can set it with setLifetimeDefaults. If you want the proxy to be written to disk, you can enable it with enableWriteToDisk. I don't think it's necessary though. Would be probably better if you handle the credential yourself in memory.

Once the dialog finds a valid proxy, it queries all voms servers that are enabled (that have vomses files in $HOME/.glite/vomses — see attachment) for available groups and displays the info in the second combobox. Now, when the user clicks "Join VO" on the other button, the listener is notified via an event.

Without using the "enableWriteToDisk" method proxy doesn't get stored in the default location. That makes sense because you might need several voms proxies to talk to different gridftp servers/submission hosts. Just hold them in memory (don't forget to destroy them when you don't need them anymore) and initialize your proxy connections with them.

Of course, you can store the in the approriate place manually if you need to:

public void proxyCreated(int type, GlobusCredential newProxy) {

    CredentialHelpers.writeToDisk(newProxy, LocalProxy.PROXY_FILE);

}

Attachments