org.apache.juddi.auth
Class XMLDocAuthenticator

java.lang.Object
  extended by org.apache.juddi.auth.XMLDocAuthenticator
All Implemented Interfaces:
Authenticator, org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler
Direct Known Subclasses:
CryptedXMLDocAuthenticator

public class XMLDocAuthenticator
extends java.lang.Object
implements org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler, Authenticator

This is a simple implementation of jUDDI's Authenticator interface. The credential store is simply an unencrypted xml document called 'juddi.users' that can be found in jUDDI's config directory. Below is an example of what you might find in this document. Example juddi.users document: =============================

Author:
Steve Viens (sviens@apache.org)

Constructor Summary
XMLDocAuthenticator()
           
 
Method Summary
 java.lang.String authenticate(java.lang.String userID, java.lang.String credential)
           
 void characters(char[] chars, int int1, int int2)
          handle characters event
 void endDocument()
          handle endDocument event
 void endElement(java.lang.String name, java.lang.String string2, java.lang.String string3)
          handle endElement event
 void endPrefixMapping(java.lang.String string)
          handle endPrefixMapping event
 void error(org.xml.sax.SAXParseException spex)
          handle error event
 void fatalError(org.xml.sax.SAXParseException spex)
          handle fatalError event
 void ignorableWhitespace(char[] chars, int int1, int int2)
          handle ignorableWhitespace event
 void init()
          Perform auth initialization tasks
static void main(java.lang.String[] args)
           
 void processingInstruction(java.lang.String string1, java.lang.String string2)
          handle processingInstruction event
 void setDocumentLocator(org.xml.sax.Locator locator)
          handle setDocumentLocator event
 void skippedEntity(java.lang.String string)
          handle skippedEntity event
 void startDocument()
          handle startDocument event
 void startElement(java.lang.String uri, java.lang.String name, java.lang.String qName, org.xml.sax.Attributes attributes)
          handle startElement event
 void startPrefixMapping(java.lang.String string1, java.lang.String string2)
          handle startPrefixMapping event
 java.lang.String toString()
           
 void warning(org.xml.sax.SAXParseException spex)
          handle warning event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XMLDocAuthenticator

public XMLDocAuthenticator()
Method Detail

init

public void init()
Perform auth initialization tasks


authenticate

public java.lang.String authenticate(java.lang.String userID,
                                     java.lang.String credential)
                              throws RegistryException
Specified by:
authenticate in interface Authenticator
Returns:
The publisherID for this user
Throws:
RegistryException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
handle setDocumentLocator event

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
handle startDocument event

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
handle endDocument event

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String name,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
handle startElement event

Specified by:
startElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String name,
                       java.lang.String string2,
                       java.lang.String string3)
                throws org.xml.sax.SAXException
handle endElement event

Specified by:
endElement in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

characters

public void characters(char[] chars,
                       int int1,
                       int int2)
                throws org.xml.sax.SAXException
handle characters event

Specified by:
characters in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

ignorableWhitespace

public void ignorableWhitespace(char[] chars,
                                int int1,
                                int int2)
                         throws org.xml.sax.SAXException
handle ignorableWhitespace event

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

processingInstruction

public void processingInstruction(java.lang.String string1,
                                  java.lang.String string2)
                           throws org.xml.sax.SAXException
handle processingInstruction event

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

startPrefixMapping

public void startPrefixMapping(java.lang.String string1,
                               java.lang.String string2)
                        throws org.xml.sax.SAXException
handle startPrefixMapping event

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

endPrefixMapping

public void endPrefixMapping(java.lang.String string)
                      throws org.xml.sax.SAXException
handle endPrefixMapping event

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

skippedEntity

public void skippedEntity(java.lang.String string)
                   throws org.xml.sax.SAXException
handle skippedEntity event

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException

warning

public void warning(org.xml.sax.SAXParseException spex)
             throws org.xml.sax.SAXException
handle warning event

Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException spex)
           throws org.xml.sax.SAXException
handle error event

Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException spex)
                throws org.xml.sax.SAXException
handle fatalError event

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2004-2007. All Rights Reserved.