uk.ac.soton.itinnovation.grid.pbac2.pdp.webadmin
Class PolicyAdmin

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.pbac2.pdp.webadmin.PolicyAdmin

public class PolicyAdmin
extends Object

Code to create a web administration interface for PBAC policies. To use it, create a new PolicyAdmin object in your JSP page and then call processPOST(). Call showAdmin() to display a table showing the current policies and resources.


Constructor Summary
PolicyAdmin(HttpServletRequest request)
          Create a new PolicyAdmin from the parameters in this request.
 
Method Summary
static void downloadStaticPolicy(HttpServletRequest request, HttpServletResponse response)
           
 String processPOST()
          Check whether this request is a POST asking us to update anything.
 void registerResourceTypeLink(String resourceType, String linkStem)
          Register a link which can be used to view resources of the given type.
 void showAdmin(Writer out)
          Write an HTML table listing all policies.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyAdmin

public PolicyAdmin(HttpServletRequest request)
            throws Stop
Create a new PolicyAdmin from the parameters in this request. If the request contains a parameter named 'resourceType', the resources and for that type is shown. Otherwise, only the list of available policies is shown.

Throws:
Stop
Method Detail

registerResourceTypeLink

public void registerResourceTypeLink(String resourceType,
                                     String linkStem)
Register a link which can be used to view resources of the given type.

Parameters:
resourceType - the type of resource which uses this link
linkStem - the start of the href value for links The actual target of the link for each resource in the list will be linkStem + "?resource=..."

processPOST

public String processPOST()
                   throws Stop,
                          GridFailureException,
                          org.apache.commons.fileupload.FileUploadException,
                          CertificateException,
                          IOException
Check whether this request is a POST asking us to update anything. If so, do the updates.

Returns:
a success message, or null if no action was performed
Throws:
Stop
GridFailureException
org.apache.commons.fileupload.FileUploadException
CertificateException
IOException

showAdmin

public void showAdmin(Writer out)
               throws IOException,
                      Stop
Write an HTML table listing all policies.

Parameters:
out - stream to write to
Throws:
IOException
Stop

downloadStaticPolicy

public static void downloadStaticPolicy(HttpServletRequest request,
                                        HttpServletResponse response)
                                 throws Exception
Throws:
Exception


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.