xmlBlaster 2.2.0 API

org.xmlBlaster.util.queue
Class StorageId

java.lang.Object
  extended by org.xmlBlaster.util.queue.StorageId
All Implemented Interfaces:
java.io.Serializable

public class StorageId
extends java.lang.Object
implements java.io.Serializable

Class encapsulating the unique id of a queue or a cache.

Author:
michele@laghi.eu, xmlBlaster@marcelruff.info
See Also:
Serialized Form

Field Summary
private  Global glob
           
private  java.lang.String id
           
private static java.util.logging.Logger log
           
private  ContextNode parentContextNode
           
private  java.lang.String postfix
           
private  java.lang.String postfix1
           
private  java.lang.String postfix2
           
private static long serialVersionUID
           
private  java.lang.String strippedId
           
private  XBStore xbStore
           
 
Constructor Summary
  StorageId(Global glob, java.lang.String id)
          Deprecated. Old xb_entries only
  StorageId(Global glob, java.lang.String relating, java.lang.String postfix)
          Deprecated. Old xb_entries only
  StorageId(Global glob, java.lang.String xbNode, java.lang.String xbType, SessionName sessionName)
           
  StorageId(Global glob, java.lang.String xbNode, java.lang.String xbType, java.lang.String xbPostfix)
           
private StorageId(Global glob, java.lang.String xbNode, java.lang.String xbType, java.lang.String xbPostfix, SessionName sessionName)
          New XBstore approach.
 
Method Summary
 java.lang.String getId()
           
 java.lang.String getOldPostfix()
          Deprecated. Use getXBStore().getPostfix()
 ContextNode getParentContextNode()
           
 java.lang.String getPostfix1()
           
 java.lang.String getPostfix2()
           
 java.lang.String getRelatingType()
          is XBSTORE.XBTYPE
 java.lang.String getStrippedId()
          Deprecated. Old xb_entries
 java.lang.String getStrippedLogId()
           
 XBStore getXBStore()
          returns an XBStore without having filled the id nor the flag1 member variables.
 void setParentContextNode(ContextNode parentContextNode)
           
private  void splitPostfix(java.lang.String post)
           
private  void splitPostfixFurther(java.lang.String xbPostfix)
           
 java.lang.String toString()
          Deprecated.  
static StorageId valueOf(Global glob, java.lang.String strippedStorageId)
          Deprecated. Old xb_entries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

log

private static java.util.logging.Logger log

glob

private Global glob

postfix

private final transient java.lang.String postfix

strippedId

private java.lang.String strippedId

id

private final java.lang.String id

parentContextNode

private ContextNode parentContextNode

xbStore

private transient XBStore xbStore

postfix1

private transient java.lang.String postfix1

postfix2

private transient java.lang.String postfix2
Constructor Detail

StorageId

public StorageId(Global glob,
                 java.lang.String xbNode,
                 java.lang.String xbType,
                 SessionName sessionName)

StorageId

public StorageId(Global glob,
                 java.lang.String xbNode,
                 java.lang.String xbType,
                 java.lang.String xbPostfix)

StorageId

private StorageId(Global glob,
                  java.lang.String xbNode,
                  java.lang.String xbType,
                  java.lang.String xbPostfix,
                  SessionName sessionName)
New XBstore approach.

Parameters:
glob -
xbNode - "heron"
xbType - Constants.RELATING_TOPIC
xbPostfix - "Hello"

StorageId

public StorageId(Global glob,
                 java.lang.String relating,
                 java.lang.String postfix)
Deprecated. Old xb_entries only

Create a unique id, e.g. "history:/node/heron/client/joe/-2"

Parameters:
glob -
relating - e.g. "history" or Constants.RELATING_SUBJECT
postfix - unique string e.g. "/node/heron/client/joe/-2" from sessionName.getAbsoluteName()

StorageId

public StorageId(Global glob,
                 java.lang.String id)
          throws XmlBlasterException
Deprecated. Old xb_entries only

Parse and create a unique id.

A queueId must be of the kind cb:some/id/or/someother where the important requirement here is that it contains a ':' character. The text on the left side of the separator (in this case 'cb') tells which kind of queue it is: for example a callback queue (cb) or a client queue.

Parameters:
id - e.g. "history:/node/heron/client/joe/-2"
Throws:
XmlBlasterException - if no separator ":" was found
Method Detail

splitPostfix

private final void splitPostfix(java.lang.String post)

splitPostfixFurther

private void splitPostfixFurther(java.lang.String xbPostfix)

valueOf

public static StorageId valueOf(Global glob,
                                java.lang.String strippedStorageId)
Deprecated. Old xb_entries

Not functional, we have no guaranteed way to find out the real id from the stripped id.

Parameters:
glob -
strippedStorageId -
Returns:
storageId.getId() is not recovered properly, can be null

getRelatingType

public java.lang.String getRelatingType()
is XBSTORE.XBTYPE

Returns:
e.g. Constants.RELATING_HISTORY = "history"

getOldPostfix

public java.lang.String getOldPostfix()
Deprecated. Use getXBStore().getPostfix()

Is XBSTORE.XBNODE + XBSTORE.XBPOSTFIX

Returns:
e.g. "/node/heron/client/joe/-2"

getId

public java.lang.String getId()
Returns:
e.g. "history:/node/heron/client/joe/-2"

getStrippedId

public java.lang.String getStrippedId()
Deprecated. Old xb_entries

The id usable for file names and is used for the queue and message-store names.

NOTE: This name should never change in future xmlBlaster releases. If it changes the new release would not find old database entries!

Returns:
e.g. "history_nodeheronclientjoe-2"
See Also:
Global.getStrippedString(String)

getStrippedLogId

public java.lang.String getStrippedLogId()

toString

public java.lang.String toString()
Deprecated. 

Overrides:
toString in class java.lang.Object
Returns:
getId()

getXBStore

public XBStore getXBStore()
returns an XBStore without having filled the id nor the flag1 member variables.

Returns:

getPostfix1

public java.lang.String getPostfix1()
Returns:
never null, can be the subjectId, topicOid etc. depending on Constants.RELATING_xxx

getPostfix2

public java.lang.String getPostfix2()
Returns:
never null, typically the publicSessionId or empty string

getParentContextNode

public ContextNode getParentContextNode()

setParentContextNode

public void setParentContextNode(ContextNode parentContextNode)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.