xmlBlaster 2.2.0 API

org.xmlBlaster.authentication.plugins.demo
Class SecurityQos

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

public class SecurityQos
extends SaxHandlerBase
implements I_SecurityQos

Helper class for Java clients.

This class only generates a login() or init() qos xml string typically of the form:

    <securityService type='gui' version='1.0'>
       <![CDATA[
          <user>KingKong</user>
          <passwd>secret</passwd>
       ]]>
    </securityService>
 


Field Summary
private  java.lang.String passwd
           
private  java.lang.String type
           
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)
           
SecurityQos(Global glob, 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;
 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 extraOffset)
          Serialize the information.
 
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, toXml, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private java.lang.String type

version

private java.lang.String version

user

private java.lang.String user

passwd

private java.lang.String passwd
Constructor Detail

SecurityQos

public SecurityQos(Global glob)

SecurityQos

public SecurityQos(Global glob,
                   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

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

getPluginType

public java.lang.String getPluginType()

getPluginVersion

public java.lang.String getPluginVersion()

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

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

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"

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 java.lang.String toXml(java.lang.String extraOffset)
Description copied from interface: I_SecurityQos
Serialize the information.

Specified by:
toXml in interface I_SecurityQos

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.