xmlBlaster 2.2.0 API

org.xmlBlaster.engine
Class XmlBlasterImpl

java.lang.Object
  extended by org.xmlBlaster.engine.XmlBlasterImpl
All Implemented Interfaces:
I_XmlBlaster

public class XmlBlasterImpl
extends java.lang.Object
implements I_XmlBlaster

This is the native implementation of the xmlBlaster interface.

All protocol drivers access xmlBlaster through these methods.
All security checks are done here, and then the call is delegated to RequestBroker for processing.
Most access methods are provided with varying arguments for your convenience.

Author:
xmlBlaster@marcelruff.info
See Also:
RequestBroker, I_XmlBlaster

Field Summary
private  Authenticate authenticate
           
private  AvailabilityChecker availabilityChecker
           
private  byte[] EMPTY_BYTEARR
           
private  ServerScope glob
           
private static java.util.logging.Logger log
           
private  java.lang.String ME
           
private  RequestBroker requestBroker
           
 
Constructor Summary
XmlBlasterImpl(Authenticate authenticate)
          One instance of this represents one xmlBlaster server.
 
Method Summary
 java.lang.String[] erase(AddressServer addressServer, java.lang.String sessionId, java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Delete messages.
 MsgUnitRaw[] get(AddressServer addressServer, java.lang.String sessionId, java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Synchronous access a message.
 Destination getDestination(MsgUnit msgUnit)
           
private  MsgUnit importAndAuthorize(SessionInfo sessionInfo, AddressServer addressServer, MsgUnitRaw msgUnitRaw, MethodName action)
          Check message via security plugin.
private  java.lang.String interceptExeptionByAuthorizer(java.lang.Throwable e, SessionInfo sessionInfo, AddressServer addressServer, MsgUnit msgUnit, MethodName action)
           
 java.lang.String ping(AddressServer addressServer, java.lang.String qos)
          ping xmlBlaster if everything is OK and if xmlBlaster is willing to accept requests.
private  java.lang.String publish(AddressServer addressServer, SessionInfo sessionInfo, MsgUnitRaw msgUnitRaw, MethodName methodName)
           
 java.lang.String publish(AddressServer addressServer, java.lang.String sessionId, MsgUnitRaw msgUnitRaw)
          Publish a message.
 java.lang.String[] publishArr(AddressServer addressServer, java.lang.String sessionId, MsgUnitRaw[] msgUnitArr)
          Publish messages.
 void publishOneway(AddressServer addressServer, java.lang.String sessionId, MsgUnitRaw[] msgUnitArr)
          Publish messages.
 void shutdown()
           
 java.lang.String subscribe(AddressServer addressServer, java.lang.String sessionId, java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Subscribe to messages.
 java.lang.String toXml()
          Dump state of RequestBroker into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset)
          Dump state of RequestBroker into a XML ASCII string.
 java.lang.String[] unSubscribe(AddressServer addressServer, java.lang.String sessionId, java.lang.String xmlKey_literal, java.lang.String qos_literal)
          Unsubscribe from messages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private final java.lang.String ME

requestBroker

private final RequestBroker requestBroker

authenticate

private final Authenticate authenticate

availabilityChecker

private final AvailabilityChecker availabilityChecker

glob

private final ServerScope glob

log

private static java.util.logging.Logger log

EMPTY_BYTEARR

private final byte[] EMPTY_BYTEARR
Constructor Detail

XmlBlasterImpl

public XmlBlasterImpl(Authenticate authenticate)
               throws XmlBlasterException
One instance of this represents one xmlBlaster server.

Parameters:
authenticate - The authentication service
Throws:
XmlBlasterException
Method Detail

subscribe

public final java.lang.String subscribe(AddressServer addressServer,
                                        java.lang.String sessionId,
                                        java.lang.String xmlKey_literal,
                                        java.lang.String qos_literal)
                                 throws XmlBlasterException
Subscribe to messages.

Specified by:
subscribe in interface I_XmlBlaster
xmlKey_literal - Depending on the security plugin this key is encrypted
qos_literal - Depending on the security plugin this qos is encrypted
Throws:
XmlBlasterException
See Also:
RequestBroker

unSubscribe

public final java.lang.String[] unSubscribe(AddressServer addressServer,
                                            java.lang.String sessionId,
                                            java.lang.String xmlKey_literal,
                                            java.lang.String qos_literal)
                                     throws XmlBlasterException
Unsubscribe from messages.

Specified by:
unSubscribe in interface I_XmlBlaster
xmlKey_literal - Depending on the security plugin this key is encrypted
Throws:
XmlBlasterException
See Also:
RequestBroker

publish

public final java.lang.String publish(AddressServer addressServer,
                                      java.lang.String sessionId,
                                      MsgUnitRaw msgUnitRaw)
                               throws XmlBlasterException
Publish a message.

Specified by:
publish in interface I_XmlBlaster
msgUnitRaw - The MsgUnitRaw contains the literal ASCII strings of xmlKey and publishQos and the binary content. Depending on the security plugin the msgUnit is encrypted
Throws:
XmlBlasterException
See Also:
RequestBroker

publish

private final java.lang.String publish(AddressServer addressServer,
                                       SessionInfo sessionInfo,
                                       MsgUnitRaw msgUnitRaw,
                                       MethodName methodName)
                                throws XmlBlasterException
Throws:
XmlBlasterException

publishArr

public final java.lang.String[] publishArr(AddressServer addressServer,
                                           java.lang.String sessionId,
                                           MsgUnitRaw[] msgUnitArr)
                                    throws XmlBlasterException
Publish messages.

Specified by:
publishArr in interface I_XmlBlaster
Throws:
XmlBlasterException
See Also:
RequestBroker

publishOneway

public final void publishOneway(AddressServer addressServer,
                                java.lang.String sessionId,
                                MsgUnitRaw[] msgUnitArr)
Publish messages.

Specified by:
publishOneway in interface I_XmlBlaster
See Also:
RequestBroker

erase

public final java.lang.String[] erase(AddressServer addressServer,
                                      java.lang.String sessionId,
                                      java.lang.String xmlKey_literal,
                                      java.lang.String qos_literal)
                               throws XmlBlasterException
Delete messages.

Specified by:
erase in interface I_XmlBlaster
Throws:
XmlBlasterException
See Also:
RequestBroker

get

public final MsgUnitRaw[] get(AddressServer addressServer,
                              java.lang.String sessionId,
                              java.lang.String xmlKey_literal,
                              java.lang.String qos_literal)
                       throws XmlBlasterException
Synchronous access a message.

Specified by:
get in interface I_XmlBlaster
Throws:
XmlBlasterException
See Also:
RequestBroker

toXml

public final java.lang.String toXml()
                             throws XmlBlasterException
Dump state of RequestBroker into a XML ASCII string.

Specified by:
toXml in interface I_XmlBlaster
Returns:
internal state of the RequestBroker as a XML ASCII string
Throws:
XmlBlasterException

toXml

public final java.lang.String toXml(java.lang.String extraOffset)
                             throws XmlBlasterException
Dump state of RequestBroker into a XML ASCII string.

Specified by:
toXml in interface I_XmlBlaster
Parameters:
extraOffset - indenting of tags for nice output
Returns:
internal state of the RequestBroker as a XML ASCII string
Throws:
XmlBlasterException

interceptExeptionByAuthorizer

private java.lang.String interceptExeptionByAuthorizer(java.lang.Throwable e,
                                                       SessionInfo sessionInfo,
                                                       AddressServer addressServer,
                                                       MsgUnit msgUnit,
                                                       MethodName action)
Parameters:
sessionInfo -
addressServer -
msgUnit -
action -
Returns:
if null, not intercepted

getDestination

public Destination getDestination(MsgUnit msgUnit)

importAndAuthorize

private MsgUnit importAndAuthorize(SessionInfo sessionInfo,
                                   AddressServer addressServer,
                                   MsgUnitRaw msgUnitRaw,
                                   MethodName action)
                            throws XmlBlasterException
Check message via security plugin.

Parameters:
sessionInfo - The sessionInfo (we are already authenticated)
addressServer - The server side protocol plugin information (like IP and port)
MsgUnit - The message, probably encrypted
String - actionKey (eg. PUBLISH, GET, ...)
Returns:
The message decrypted (readable) of type MsgUnit (ready parsed)
Throws:
XmlBlasterException - Thrown if seal/signature checks fail, the identity in unknown or the message format has errors.
Throws "NotAuthorized" if client may not do the action with this message

ping

public final java.lang.String ping(AddressServer addressServer,
                                   java.lang.String qos)
                            throws XmlBlasterException
ping xmlBlaster if everything is OK and if xmlBlaster is willing to accept requests.

Specified by:
ping in interface I_XmlBlaster
qos - Currently an empty string ""
Returns:
"" if we are ready, otherwise the current run level string
Throws:
XmlBlasterException
See Also:
AvailabilityChecker.getStatus(String)

shutdown

public final void shutdown()

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.