info.informatica.ui
Class ViewSecurityMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<String,Set<Role>>
              extended by info.informatica.ui.ViewSecurityMap
All Implemented Interfaces:
info.informatica.doc.xml.XMLPrintable, ViewSecurity, Serializable, Cloneable, Map<String,Set<Role>>

public class ViewSecurityMap
extends LinkedHashMap<String,Set<Role>>
implements ViewSecurity, info.informatica.doc.xml.XMLPrintable

A simple Map-based ViewSecurity implementation.

Maps supported operations to sets of allowed roles. If a Set is empty, all roles are allowed.

Version:
2.00
Author:
amengual at informatica dot info
See Also:
Serialized Form

Constructor Summary
ViewSecurityMap(String name)
           
 
Method Summary
 void addOperationPermission(String opname, String role)
          Allow a role to perform an operation.
 Set<Role> getAllowedRoles(String opname)
          Gets the set of roles allowed to perform the given operation through the form.
 String getName()
          Gets the name of the data view to which this security settings apply.
 String getXMLNamespaceURI()
          Gets the XML Namespace URI of this document.
 void printXML(PrintWriter pw)
          Prints the XML representation of this object, without including the XML declaration.
 void printXML(PrintWriter pw, int indentbase, int indentdelta)
          Prints the XML representation of this object, without including the XML declaration.
 void resetPermissions(String opname)
          Reset all permissions to perform an operation.
 String toString()
           
 String toXML()
          Gives a representation of this object as an XML document.
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

ViewSecurityMap

public ViewSecurityMap(String name)
Method Detail

getName

public String getName()
Description copied from interface: ViewSecurity
Gets the name of the data view to which this security settings apply.

Specified by:
getName in interface ViewSecurity
Returns:
the name of the view.

addOperationPermission

public void addOperationPermission(String opname,
                                   String role)
Description copied from interface: ViewSecurity
Allow a role to perform an operation.

Specified by:
addOperationPermission in interface ViewSecurity
Parameters:
opname - name of the operation.
role - the role allowed to perform the operation through this view.

resetPermissions

public void resetPermissions(String opname)
Description copied from interface: ViewSecurity
Reset all permissions to perform an operation.

Specified by:
resetPermissions in interface ViewSecurity
Parameters:
opname - name of the operation.

getAllowedRoles

public Set<Role> getAllowedRoles(String opname)
Gets the set of roles allowed to perform the given operation through the form.

Specified by:
getAllowedRoles in interface ViewSecurity
Returns:
the set of roles allowed to perform the operation through the form, and empty Set if all roles are allowed, or null if no roles are allowed.

toString

public String toString()
Overrides:
toString in class AbstractMap<String,Set<Role>>

getXMLNamespaceURI

public String getXMLNamespaceURI()
Gets the XML Namespace URI of this document.

Specified by:
getXMLNamespaceURI in interface info.informatica.doc.xml.XMLPrintable
Returns:
the XML Namespace URI, or null if unavailable or not known.

printXML

public void printXML(PrintWriter pw,
                     int indentbase,
                     int indentdelta)
Prints the XML representation of this object, without including the XML declaration.

Specified by:
printXML in interface info.informatica.doc.xml.XMLPrintable
Parameters:
pw - the PrintWriter to write to.
indentbase - the number of spaces to start indenting.
indentdelta - the number of white spaces to add to indenting when printing a nested element.

printXML

public void printXML(PrintWriter pw)
Prints the XML representation of this object, without including the XML declaration. Uses default values for indenting.

Specified by:
printXML in interface info.informatica.doc.xml.XMLPrintable
Parameters:
pw - the PrintWriter to write to.

toXML

public String toXML()
Gives a representation of this object as an XML document.

Specified by:
toXML in interface info.informatica.doc.xml.XMLPrintable
Returns:
an XML representation of this object.