xmlBlaster 1.6.2 API

org.xmlBlaster.engine.cluster
Class NodeDomainInfo

java.lang.Object
  extended byorg.xmlBlaster.engine.cluster.NodeDomainInfo
All Implemented Interfaces:
java.lang.Comparable, NodeDomainInfoMBean

public final class NodeDomainInfo
extends java.lang.Object
implements java.lang.Comparable, NodeDomainInfoMBean

Here we have the rules to find out who is the master of a message.

The rules are configurable with such a message:

 <!-- Messages of type "__sys__cluster.node.master[heron]": -->

 <master stratum='0' refid='bilbo' type='DomainToMaster' version='1.0'>
    <![CDATA[
       <key domain='rugby'/>
    ]]>
 </master>
 
Here the plugin 'DomainToMaster' with version '1.0' is chosen, this is mapped with the xmlBlaster.properties entry
 MapMsgToMasterPlugin[DomainToMaster][1.0]=org.xmlBlaster.engine.cluster.simpledomain.DomainToMaster
 
to the real java implementation.


Field Summary
private  boolean acceptDefault
           
private  boolean acceptOtherDefault
           
private  ClusterNode clusterNode
           
private  ContextNode contextNode
           
private  int count
           
private static int counter
           
 boolean DEFAULT_acceptDefault
           
 boolean DEFAULT_acceptOtherDefault
           
static java.lang.String DEFAULT_version
          The version of the plugin
private  boolean dirtyRead
           
protected  AccessFilterQos[] filterArr
           
protected  java.util.ArrayList filterList
           
private  boolean inKey
           
private  int inMaster
          for SAX parsing
private  QueryKeyData[] keyArr
           
protected  java.util.ArrayList keyList
           
private static java.util.logging.Logger log
           
private  java.lang.Object mbeanHandle
          My JMX registration
private  java.lang.String ME
          Unique name for logging
private  java.lang.String refId
           
private  ServerScope serverScope
           
private  int stratum
           
private  AccessFilterQos tmpFilter
           
private  QueryKeyData tmpKey
           
private  java.lang.String type
           
private  java.lang.String version
           
 
Constructor Summary
NodeDomainInfo(ServerScope glob, ClusterNode clusterNode)
          Create a NodeDomainInfo belonging to the given cluster node.
 
Method Summary
 int compareTo(java.lang.Object obj)
          Enforced by interface Comparable, does sorting of NodeDomainInfo instances in a treeSet with stratum
 java.lang.String destroy()
          For JMX only.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.StringBuffer character)
          Handle SAX parsed end element
 boolean getAcceptDefault()
          Are we master for messages with the default domain?
 boolean getAcceptOtherDefault()
          Are we master for messages with default domain from other nodes?
 AccessFilterQos[] getAccessFilterArr()
          Return the cluster master filters or null if none is specified.
 ClusterNode getClusterNode()
          Access my manager
 java.lang.String getConfiguration()
          The XML markup for JMX.
 int getCount()
          Unique number (in this JVM)
 boolean getDirtyRead()
           
 java.lang.String getId()
          Convenience method, delegates to clusterNode.getNodeId().getId().
 QueryKeyData[] getKeyMappings()
          Get the key based rules
 NodeId getNodeId()
          Convenience method, delegates to clusterNode.getNodeId().
 java.lang.String getRefId()
           
 int getStratum()
          The distance of the node to the master.
 java.lang.String getType()
          The plugin type.
 java.lang.String getVersion()
          The plugin version.
 void setAcceptDefault(boolean acceptDefault)
          Are we master for default domains?
 void setAcceptOtherDefault(boolean acceptOtherDefault)
          Are we master for default domains of other nodes?
 java.lang.String setConfiguration(java.lang.String xml)
          Reconfigure node routing via JMX (transient only).
 void setDirtyRead(boolean dirtyRead)
           
 void setKeyMappings(QueryKeyData[] keyArr)
          Set a key based rule
 void setRefId(java.lang.String refId)
           
 void setStratum(int stratum)
          The distance of the node to the master.
 void setType(java.lang.String type)
          The plugin type.
 void setVersion(java.lang.String version)
          The plugin version.
 void shutdown()
           
 boolean startElement(java.lang.String uri, java.lang.String localName, java.lang.String name, java.lang.StringBuffer character, org.xml.sax.Attributes attrs)
          Called for SAX master start tag
 java.lang.String toXml()
          Dump state of this object into a XML ASCII string.
 java.lang.String toXml(java.lang.String extraOffset, boolean forceAllAttributes)
          Dump state of this object into a XML ASCII string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ME

private java.lang.String ME
Unique name for logging


serverScope

private final ServerScope serverScope

log

private static java.util.logging.Logger log

clusterNode

private final ClusterNode clusterNode

counter

private static int counter

count

private final int count

stratum

private int stratum

DEFAULT_acceptDefault

public final boolean DEFAULT_acceptDefault
See Also:
Constant Field Values

acceptDefault

private boolean acceptDefault

DEFAULT_acceptOtherDefault

public final boolean DEFAULT_acceptOtherDefault
See Also:
Constant Field Values

acceptOtherDefault

private boolean acceptOtherDefault

refId

private java.lang.String refId

type

private java.lang.String type

DEFAULT_version

public static final java.lang.String DEFAULT_version
The version of the plugin

See Also:
Constant Field Values

version

private java.lang.String version

dirtyRead

private boolean dirtyRead

inMaster

private int inMaster
for SAX parsing


tmpFilter

private transient AccessFilterQos tmpFilter

filterList

protected java.util.ArrayList filterList

filterArr

protected transient AccessFilterQos[] filterArr

tmpKey

private transient QueryKeyData tmpKey

keyList

protected java.util.ArrayList keyList

keyArr

private QueryKeyData[] keyArr

inKey

private transient boolean inKey

contextNode

private ContextNode contextNode

mbeanHandle

private java.lang.Object mbeanHandle
My JMX registration

Constructor Detail

NodeDomainInfo

public NodeDomainInfo(ServerScope glob,
                      ClusterNode clusterNode)
               throws XmlBlasterException
Create a NodeDomainInfo belonging to the given cluster node.

One instance of this is created for each <master> tag

Method Detail

getCount

public int getCount()
Unique number (in this JVM)


getClusterNode

public ClusterNode getClusterNode()
Access my manager

Returns:
The clusterNode which takes care of me

getNodeId

public NodeId getNodeId()
Convenience method, delegates to clusterNode.getNodeId().

Returns:
My node id object

getId

public java.lang.String getId()
Convenience method, delegates to clusterNode.getNodeId().getId().

Returns:
My node id String

getKeyMappings

public QueryKeyData[] getKeyMappings()
Get the key based rules


setKeyMappings

public void setKeyMappings(QueryKeyData[] keyArr)
Set a key based rule

Parameters:
keyArr - e.g.
            <key domain='rugby'/>

getAccessFilterArr

public final AccessFilterQos[] getAccessFilterArr()
Return the cluster master filters or null if none is specified.


setStratum

public void setStratum(int stratum)
The distance of the node to the master.

Specified by:
setStratum in interface NodeDomainInfoMBean

getStratum

public int getStratum()
The distance of the node to the master.

Specified by:
getStratum in interface NodeDomainInfoMBean
Returns:
0 is the master, 1 is the direct slave, 2 is the slave of the slave ...

setRefId

public void setRefId(java.lang.String refId)

getRefId

public java.lang.String getRefId()

setType

public void setType(java.lang.String type)
The plugin type.


getType

public java.lang.String getType()
The plugin type.

Returns:
Defaults to "DomainToMaster"

setVersion

public void setVersion(java.lang.String version)
The plugin version.


getVersion

public java.lang.String getVersion()
The plugin version.

Returns:
Defaults to "1.0"

setAcceptDefault

public void setAcceptDefault(boolean acceptDefault)
Are we master for default domains?

Specified by:
setAcceptDefault in interface NodeDomainInfoMBean

getAcceptDefault

public boolean getAcceptDefault()
Are we master for messages with the default domain?

Specified by:
getAcceptDefault in interface NodeDomainInfoMBean

setAcceptOtherDefault

public void setAcceptOtherDefault(boolean acceptOtherDefault)
Are we master for default domains of other nodes?

Specified by:
setAcceptOtherDefault in interface NodeDomainInfoMBean

getAcceptOtherDefault

public boolean getAcceptOtherDefault()
Are we master for messages with default domain from other nodes?

Specified by:
getAcceptOtherDefault in interface NodeDomainInfoMBean

getDirtyRead

public boolean getDirtyRead()
Specified by:
getDirtyRead in interface NodeDomainInfoMBean
Returns:
true if cluster slaves cache forwarded publish messages
See Also:
The cluster.dirtyRead requirement

setDirtyRead

public void setDirtyRead(boolean dirtyRead)
Specified by:
setDirtyRead in interface NodeDomainInfoMBean
Parameters:
dirtyRead - true if cluster slaves cache forwarded publish messages
See Also:
The cluster.dirtyRead requirement

startElement

public final boolean startElement(java.lang.String uri,
                                  java.lang.String localName,
                                  java.lang.String name,
                                  java.lang.StringBuffer character,
                                  org.xml.sax.Attributes attrs)
Called for SAX master start tag

Returns:
true if ok, false on error

endElement

public final void endElement(java.lang.String uri,
                             java.lang.String localName,
                             java.lang.String name,
                             java.lang.StringBuffer character)
Handle SAX parsed end element


getConfiguration

public java.lang.String getConfiguration()
The XML markup for JMX.

Specified by:
getConfiguration in interface NodeDomainInfoMBean

setConfiguration

public java.lang.String setConfiguration(java.lang.String xml)
Reconfigure node routing via JMX (transient only). Is not activated and not intensively tested

Specified by:
setConfiguration in interface NodeDomainInfoMBean

destroy

public java.lang.String destroy()
For JMX only.

Specified by:
destroy in interface NodeDomainInfoMBean
Returns:

shutdown

public void shutdown()

toXml

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


toXml

public final java.lang.String toXml(java.lang.String extraOffset,
                                    boolean forceAllAttributes)
Dump state of this object into a XML ASCII string.
Only none default values are dumped for performance reasons

Parameters:
extraOffset - indenting of tags for nice output
Returns:
The xml representation

compareTo

public int compareTo(java.lang.Object obj)
Enforced by interface Comparable, does sorting of NodeDomainInfo instances in a treeSet with stratum

Specified by:
compareTo in interface java.lang.Comparable

xmlBlaster 1.6.2 API

Copyright © 1999-2007 The xmlBlaster.org contributers.