xmlBlaster 2.2.0 API

org.xmlBlaster.authentication.plugins.htpasswd
Class SecurityQos

java.lang.Object
  extended by org.xmlBlaster.util.SaxHandlerBase
      extended by org.xmlBlaster.authentication.plugins.htpasswd.SecurityQos
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, I_SecurityQos

public final class SecurityQos
extends SaxHandlerBase
implements I_SecurityQos

Parse the security informations loginName and password from the login qos xml string:

  <securityService type="htpasswd" version="1.0">
     <user>tim</user>
     <passwd>tim</passwd>
  </securityService>
 

Author:
Cyrille Giquello 16/11/01 09:06

Field Summary
private  java.lang.String clientIp
           
private  boolean inPasswd
           
private  boolean inSecurityService
           
private  boolean inUser
           
private  java.lang.String passwd
           
private  java.lang.String type
           
private  boolean useBase64Marker
          Passwords containing & or < will fail (Marcel 2012-05-14) Javascript -> Tomcat -> XmlScriptParser & is OK -> ConnectQosSaxFactory ok -> SecurityQosParserPlugin fails as
private  java.lang.String user
           
private  java.lang.String version
           
 
Fields inherited from class org.xmlBlaster.util.SaxHandlerBase
character, glob, locator, xmlLiteral, xmlSource
 
Constructor Summary
SecurityQos(Global glob, ClientPlugin clientPlugin)
           
SecurityQos(Global glob, java.lang.String xmlQos_literal)
           
SecurityQos(java.lang.String loginName, java.lang.String password)
           
 
Method Summary
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
          End element, event from SAX parser.
 java.lang.String getClientIp()
          Access the remote IP of the socket - the clients IP.
 java.lang.String getCredential()
          Access the credential (e.g.
 java.lang.String getPluginType()
           
 java.lang.String getPluginVersion()
           
 java.lang.String getUserId()
          Get the userId, which is used for the login;
static void main(java.lang.String[] args)
          For testing: java org.xmlBlaster.authentication.plugins.htpasswd.SecurityQos
 void parse(java.lang.String xmlQos_literal)
          Parse the given xml string which contains the userId and credentials.
 void setClientIp(java.lang.String ip)
           
 void setCredential(java.lang.String cred)
          Set the credential (password etc.).
 void setUserId(java.lang.String userId)
          Set the userId for the login.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, org.xml.sax.Attributes attrs)
          Start element, event from SAX parser.
 java.lang.String toXml()
           
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class org.xmlBlaster.util.SaxHandlerBase
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, error, fatalError, getUseLexicalHandler, ignorableWhitespace, init, init, init, notationDecl, processingInstruction, setDocumentLocator, setUseLexicalHandler, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping, toString, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

inSecurityService

private transient boolean inSecurityService

inUser

private transient boolean inUser

inPasswd

private transient boolean inPasswd

type

private java.lang.String type

version

private java.lang.String version

user

private java.lang.String user

passwd

private java.lang.String passwd

clientIp

private java.lang.String clientIp

useBase64Marker

private boolean useBase64Marker
Passwords containing & or < will fail (Marcel 2012-05-14) Javascript -> Tomcat -> XmlScriptParser & is OK -> ConnectQosSaxFactory ok -> SecurityQosParserPlugin fails as
Constructor Detail

SecurityQos

public SecurityQos(Global glob,
                   ClientPlugin clientPlugin)

SecurityQos

public SecurityQos(Global glob,
                   java.lang.String xmlQos_literal)
            throws XmlBlasterException
Throws:
XmlBlasterException

SecurityQos

public SecurityQos(java.lang.String loginName,
                   java.lang.String password)
Method Detail

parse

public void parse(java.lang.String xmlQos_literal)
           throws XmlBlasterException
Description copied from interface: I_SecurityQos
Parse the given xml string which contains the userId and credentials. Should be able to parse with or without surrounding <security> tag

Specified by:
parse in interface I_SecurityQos
Throws:
XmlBlasterException

getPluginVersion

public java.lang.String getPluginVersion()

getPluginType

public java.lang.String getPluginType()

setClientIp

public void setClientIp(java.lang.String ip)
Specified by:
setClientIp in interface I_SecurityQos

getClientIp

public java.lang.String getClientIp()
Description copied from interface: I_SecurityQos
Access the remote IP of the socket - the clients IP.

Currently only passed by the SOCKET protocol plugin, other plugins return null

Specified by:
getClientIp in interface I_SecurityQos
Returns:
null if not known or something like "192.168.1.2"

setUserId

public void setUserId(java.lang.String userId)
Description copied from interface: I_SecurityQos
Set the userId for the login.

Specified by:
setUserId in interface I_SecurityQos

getUserId

public java.lang.String getUserId()
Description copied from interface: I_SecurityQos
Get the userId, which is used for the login;

Specified by:
getUserId in interface I_SecurityQos

setCredential

public void setCredential(java.lang.String cred)
Description copied from interface: I_SecurityQos
Set the credential (password etc.).

Specified by:
setCredential in interface I_SecurityQos
Parameters:
cred - The password

getCredential

public java.lang.String getCredential()
Description copied from interface: I_SecurityQos
Access the credential (e.g. password)

Specified by:
getCredential in interface I_SecurityQos
Returns:
null (no password is delivered)

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name,
                         org.xml.sax.Attributes attrs)
Start element, event from SAX parser.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class SaxHandlerBase
Parameters:
name - Tag name
attrs - the attributes of the tag

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String name)
End element, event from SAX parser.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class SaxHandlerBase
Parameters:
name - Tag name

toXml

public final java.lang.String toXml()
Overrides:
toXml in class SaxHandlerBase
Returns:
returns the literal xml string

toXml

public final java.lang.String toXml(java.lang.String extraOffset)
Dump state of this object into a XML ASCII string.

Specified by:
toXml in interface I_SecurityQos
Parameters:
extraOffset - indenting of tags for nice output
Returns:
The xml representation

main

public static void main(java.lang.String[] args)
For testing: java org.xmlBlaster.authentication.plugins.htpasswd.SecurityQos


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.