issrg.acm
Class AttributeEditor

java.lang.Object
  extended by issrg.acm.AttributeEditor
All Implemented Interfaces:
PrivilegeEditor, Utility
Direct Known Subclasses:
PMIXMLPolicyEditor

public abstract class AttributeEditor
extends java.lang.Object
implements PrivilegeEditor

This is a class for AttributeEditor. Its purpose is twofold. Firstly, it provides GUI for interactive input, if such is needed. Secondly, it provides a method to actually build an object out of BER-encoded attribute. The first point is apparent. Now let us explain the second.

When an Attribute Certificate interpreter wants to know what is inside, it may well want to deal with a parsed AC, an internal representation of it; not the BER or DER encoding. When a new attribute type is added, a new parser is needed; so as to understand how to construct anything out of it. But the architecture of AttributeEditor class allows to extend the parser, not rewrite it. All you need to do, is to write a generic parser that is able to load new classes using Java Class Loader (for example, like it is done in the KernelApplication). Now it needs only to read in the OID of the attribute, and look through the Registry to acquire the appropriate AttributeEditor, which will do the parsing.

The interpreter, being constructed properly, can also be extensible in a similar way. Thus when one needs to extend functionality of the existing software, all he would have to do is to get the AttributeEditor class, and the classes to extend the interpreter, and update configuration information.

The other way to do the same (automatically recognize how to build an AttributeValue out of a BER) is to register the implementation class of an issrg.ac.AttributeValue for appropriate OIDs.

We are suggesting a similar approach for SigningUtility and SavingUtility; so the user will be able to use the class that will save Attribute Certificates onto the disk, or into an LDAP Directory, or whatever the implementation would appear to be. This project's distributable software being implemented in stages, we see such approach the maximally beneficial of the rest.

Version:
1.0
Author:
Sassa
See Also:
AttributeValue

Constructor Summary
AttributeEditor()
           
 
Method Summary
abstract  java.util.Vector buildValues(java.awt.Frame pC, java.util.Map env, java.util.Vector a, Registry r)
          This is the method to build Attribute Values out of the given Vector of issrg.ac.AttributeValue.
abstract  AttributeValue parseAttribute(AttributeValue attributeValue)
          This is the method to parse an issrg.ac.AttributeValue into the real object, representing it.
 void registerMe(Registry registry)
          This method defines where to register the AttributeEditor.
 ASN1Type run(java.awt.Frame pC, java.util.Map env, ASN1Type a, Registry r)
          This method is called by the KernelApplication to actually run GUI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface issrg.acm.PrivilegeEditor
getName, getOID
 

Constructor Detail

AttributeEditor

public AttributeEditor()
Method Detail

buildValues

public abstract java.util.Vector buildValues(java.awt.Frame pC,
                                             java.util.Map env,
                                             java.util.Vector a,
                                             Registry r)
                                      throws ACCreationException
This is the method to build Attribute Values out of the given Vector of issrg.ac.AttributeValue. This method can provide GUI for user to edit the values or add new ones. The implementations of AttributeEditor must define this function in such a way so as to handle only values of attribute types known to it. Should any troubles with parsing arise, it must throw an ACCreationException. This method must be capable of handling empty sets of values and null pointers to sets; the latter meaning that it must create a new attribute value set. The implementations are not obliged to handle multivalued attributes, if they mandate it to be single-valued. Their behaviour in such occasions is up to the implementor.

Parameters:
pC - the java.awt.Component, to which the GUI must be modal
env - the configuration environment, containing variables only
a - the vector of attribute values; contains a single value, if it is a signle-valued attribute; can be empty or null
r - the Register object where to find any other editors or utilities
Returns:
the Vector of new values; edited, added and removed
Throws:
ACCreationException

run

public ASN1Type run(java.awt.Frame pC,
                    java.util.Map env,
                    ASN1Type a,
                    Registry r)
             throws ACCreationException
This method is called by the KernelApplication to actually run GUI. You should not want to redefine it.

Specified by:
run in interface PrivilegeEditor
Parameters:
pC - the java.awt.Component, to which the GUI must be modal
env - the configuration environment, containing variables only
a - the vector of attribute values; contains a single value, if it is a signle-valued attribute; can be empty or null
r - the Register object where to find any other editors or utilities
Returns:
the issrg.ac.Attribute with new values; edited, added and removed; automatically puts the OID, obtained using getOID() method.
Throws:
ACCreationException

parseAttribute

public abstract AttributeValue parseAttribute(AttributeValue attributeValue)
                                       throws iaik.asn1.CodingException
This is the method to parse an issrg.ac.AttributeValue into the real object, representing it.

Parameters:
attributeValue - the value to parse
Returns:
the parsed Attribute Value; now it can be safely type-casted, or acquired what Java type it is
Throws:
iaik.asn1.CodingException

registerMe

public void registerMe(Registry registry)
This method defines where to register the AttributeEditor. Usually you would not wish to redefine it. By default it just gets the OID of the attribute it can create (getOID() ), and registers this instance in the ATTRIBUTE_EDITORS_COLLECTION. You may only wish to redefine it if you are going to register your utility somewhere else, or do additional checks (e.g. display a message if a utility with such name already registered).

Specified by:
registerMe in interface Utility