|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.acm.AttributeEditor
public abstract class AttributeEditor
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
).
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.
KernelApplication
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.
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 |
---|
public AttributeEditor()
Method Detail |
---|
public abstract java.util.Vector buildValues(java.awt.Frame pC, java.util.Map env, java.util.Vector a, Registry r) throws ACCreationException
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.
pC
- the java.awt.Component, to which the GUI must be modalenv
- the configuration environment, containing variables onlya
- the vector of attribute values; contains a single value, if it is
a signle-valued attribute; can be empty or nullr
- the Register
object where to find any other editors
or utilities
ACCreationException
public ASN1Type run(java.awt.Frame pC, java.util.Map env, ASN1Type a, Registry r) throws ACCreationException
run
in interface PrivilegeEditor
pC
- the java.awt.Component, to which the GUI must be modalenv
- the configuration environment, containing variables onlya
- the vector of attribute values; contains a single value, if it is
a signle-valued attribute; can be empty or nullr
- the Register
object where to find any other editors
or utilities
issrg.ac.Attribute
with new values;
edited, added and removed; automatically puts the OID, obtained
using getOID()
method.
- Throws:
ACCreationException
public abstract AttributeValue parseAttribute(AttributeValue attributeValue) throws iaik.asn1.CodingException
issrg.ac.AttributeValue
into the real object, representing it.
attributeValue
- the value to parse
iaik.asn1.CodingException
public void registerMe(Registry registry)
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).
registerMe
in interface Utility
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |