org.objectweb.speedo.naming.lib
Class UserIdCompositeNamingManager

java.lang.Object
  extended by org.objectweb.speedo.naming.lib.NamingManagerHelper
      extended by org.objectweb.speedo.naming.lib.UserIdCompositeNamingManager
All Implemented Interfaces:
NamingManager

public class UserIdCompositeNamingManager
extends NamingManagerHelper
implements NamingManager

Author:
S.Chassande-Barrioz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.objectweb.speedo.naming.api.NamingManager
NamingManager.NamingField
 
Field Summary
 
Fields inherited from class org.objectweb.speedo.naming.lib.NamingManagerHelper
BINDER_IDX, cache, HINTS_SEP, ID_CAT_IDX, logger, mapper, PCLASS_IDX, pmf, PNC_IDX, POLYMORPHIC_PNC
 
Fields inherited from interface org.objectweb.speedo.naming.api.NamingManager
PNH_NULL_VALUE, PNH_PFIELD, PNH_REF_STATE, SEP
 
Constructor Summary
UserIdCompositeNamingManager()
           
 
Method Summary
 boolean canManage(SpeedoClass sc)
          Indicates if the naming manager is able to manage the identifier of a persistent class.
 boolean canProvidePBinder(java.lang.Object hints, java.lang.ClassLoader classLoader)
          indicates if the naming manager is able to build a PBinder instance for this hints parameter specified
 boolean canProvidePNamingContext(java.lang.Object hints, java.lang.ClassLoader classLoader)
          indicates if the naming manager is able to build a PNC instance for this hints parameter specified
 org.objectweb.jorm.naming.api.PName decode(org.objectweb.jorm.naming.api.PNameCoder pnc, java.lang.Object oid, java.lang.Class clazz, JormFactory jf)
          Decodes an object identifier into a PName.
 void defineClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.Class jc, SpeedoClass sc, org.objectweb.jorm.metainfo.api.ClassMapping cm, MIBuilderHelper mibh, JormMIMappingBuilder mb, java.util.Collection createdMOs)
          Fill the name def of a class identifier
 void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.ClassRef cr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.ClassMapping cm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the class reference from a class
 void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.ClassRef cr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.GenClassMapping gcm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the class reference from a generic class
 void defineGenClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.GenClassRef gcr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.GenClassMapping gcm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the gen class identifier
 void defineGenClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd, org.objectweb.jorm.metainfo.api.GenClassRef gcr, SpeedoField sf, SpeedoClass currentClass, org.objectweb.jorm.metainfo.api.ClassMapping cm, MIBuilderHelper mibh, JormMIMappingBuilder mb)
          Fill the name def of the generic class reference from a class
 java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
          Encode a PName into an object
 java.lang.String getGCPNameHints(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
          compute a string value which permit to help the building of the genclass PName (export)
 void getJormNamingConfig(org.objectweb.jorm.metainfo.api.NameDef nd, SpeedoClass targetClass, org.objectweb.jorm.metainfo.api.MetaObject sourceMO, java.lang.String key, java.util.Properties result)
          Build a property value compsed such as this pattern userid,binder_class_name,pnc_class_name,class_name
protected  java.lang.String getName()
           
 java.lang.String getPNameHints(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
          compute a string value which permit to help the building of the class PName (export)
 java.lang.Object[] getPNameHints2(SpeedoClass sc, org.objectweb.jorm.metainfo.api.NameDef nd)
           
 boolean needInheritanceDiscriminator(SpeedoClass sc)
           
 
Methods inherited from class org.objectweb.speedo.naming.lib.NamingManagerHelper
getBinderClassNameFromHints, getDefaultColumn, getNamingfields, getPBinder, getPNamingContext, getPNCClassNameFromHints, getTokens, setCache, setLogger, setPMapper, setPmf, supportPNamingcontext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.speedo.naming.api.NamingManager
getDefaultColumn, getNamingfields, getPBinder, getPNamingContext, setCache, setLogger, setPMapper, setPmf, supportPNamingcontext
 

Constructor Detail

UserIdCompositeNamingManager

public UserIdCompositeNamingManager()
Method Detail

getName

protected java.lang.String getName()
Specified by:
getName in class NamingManagerHelper

canManage

public boolean canManage(SpeedoClass sc)
Description copied from interface: NamingManager
Indicates if the naming manager is able to manage the identifier of a persistent class.

Specified by:
canManage in interface NamingManager
Parameters:
sc - The speedo meta object representing the persistent class

encode

public java.lang.Object encode(org.objectweb.jorm.naming.api.PName pn)
                        throws org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Encode a PName into an object

Specified by:
encode in interface NamingManager
Parameters:
pn - is the pname to encode
Throws:
org.objectweb.jorm.api.PException

decode

public org.objectweb.jorm.naming.api.PName decode(org.objectweb.jorm.naming.api.PNameCoder pnc,
                                                  java.lang.Object oid,
                                                  java.lang.Class clazz,
                                                  JormFactory jf)
                                           throws org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Decodes an object identifier into a PName.

Specified by:
decode in interface NamingManager
Parameters:
pnc - is the PNameCoder instance to use for the decoding the object identifier. The pnc parameter can be null. In this case the oid must
oid - is the object identifier
clazz - is the java.lang.Class of the persistent class identified by the oid
jf - is the JormFactory instance. It permits to
Returns:
the object identifier decode as PName
Throws:
org.objectweb.jorm.api.PException

canProvidePBinder

public boolean canProvidePBinder(java.lang.Object hints,
                                 java.lang.ClassLoader classLoader)
Description copied from interface: NamingManager
indicates if the naming manager is able to build a PBinder instance for this hints parameter specified

Specified by:
canProvidePBinder in interface NamingManager
Overrides:
canProvidePBinder in class NamingManagerHelper
Parameters:
hints - is the helper of the PBinder building
classLoader - is the classloader to use for instanciate the PBinder

canProvidePNamingContext

public boolean canProvidePNamingContext(java.lang.Object hints,
                                        java.lang.ClassLoader classLoader)
Description copied from interface: NamingManager
indicates if the naming manager is able to build a PNC instance for this hints parameter specified

Specified by:
canProvidePNamingContext in interface NamingManager
Overrides:
canProvidePNamingContext in class NamingManagerHelper
Parameters:
hints - is the helper of the PNC building
classLoader - is the classloader to use for instanciate the PNC

defineClassIdentifierNameDef

public void defineClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                         org.objectweb.jorm.metainfo.api.Class jc,
                                         SpeedoClass sc,
                                         org.objectweb.jorm.metainfo.api.ClassMapping cm,
                                         MIBuilderHelper mibh,
                                         JormMIMappingBuilder mb,
                                         java.util.Collection createdMOs)
                                  throws SpeedoException,
                                         org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Fill the name def of a class identifier

Specified by:
defineClassIdentifierNameDef in interface NamingManager
Parameters:
nd - is the name def to fill
jc - is the jorm meta object representing the class.
sc - is the speedo meta object representing the class.
cm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
createdMOs - is a result paramter. This collection must be fill with the created Jorm Meta objects representing a class or a composite name. Here only the new composite names have to be added.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

needInheritanceDiscriminator

public boolean needInheritanceDiscriminator(SpeedoClass sc)
                                     throws SpeedoException
Specified by:
needInheritanceDiscriminator in interface NamingManager
Overrides:
needInheritanceDiscriminator in class NamingManagerHelper
Throws:
SpeedoException

defineClassReferenceNameDef

public void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                        org.objectweb.jorm.metainfo.api.ClassRef cr,
                                        SpeedoField sf,
                                        SpeedoClass currentClass,
                                        org.objectweb.jorm.metainfo.api.ClassMapping cm,
                                        MIBuilderHelper mibh,
                                        JormMIMappingBuilder mb)
                                 throws SpeedoException,
                                        org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Fill the name def of the class reference from a class

Specified by:
defineClassReferenceNameDef in interface NamingManager
Parameters:
nd - is the name def to fill
cr - is the speedo meta object representing the class.
sf - is the speedo meta object representing the persistent reference to a class.
currentClass - is the class mapping the field
cm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineClassReferenceNameDef

public void defineClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                        org.objectweb.jorm.metainfo.api.ClassRef cr,
                                        SpeedoField sf,
                                        SpeedoClass currentClass,
                                        org.objectweb.jorm.metainfo.api.GenClassMapping gcm,
                                        MIBuilderHelper mibh,
                                        JormMIMappingBuilder mb)
                                 throws SpeedoException,
                                        org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Fill the name def of the class reference from a generic class

Specified by:
defineClassReferenceNameDef in interface NamingManager
Parameters:
nd - is the name def to fill
cr - is the speedo meta object representing the class.
sf - is the speedo meta object representing the persistent reference to a class.
currentClass - is the class mapping the field
gcm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineGenClassIdentifierNameDef

public void defineGenClassIdentifierNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                            org.objectweb.jorm.metainfo.api.GenClassRef gcr,
                                            SpeedoField sf,
                                            SpeedoClass currentClass,
                                            org.objectweb.jorm.metainfo.api.GenClassMapping gcm,
                                            MIBuilderHelper mibh,
                                            JormMIMappingBuilder mb)
                                     throws SpeedoException,
                                            org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Fill the name def of the gen class identifier

Specified by:
defineGenClassIdentifierNameDef in interface NamingManager
Parameters:
nd - is the name def to fill
gcr - is the JORM meta object representing the generic class reference.
sf - is the speedo meta object representing the persistent reference to a generic class.
currentClass - is the class mapping the field
gcm - if the mapping structure hosting the mapping of the generic class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

defineGenClassReferenceNameDef

public void defineGenClassReferenceNameDef(org.objectweb.jorm.metainfo.api.NameDef nd,
                                           org.objectweb.jorm.metainfo.api.GenClassRef gcr,
                                           SpeedoField sf,
                                           SpeedoClass currentClass,
                                           org.objectweb.jorm.metainfo.api.ClassMapping cm,
                                           MIBuilderHelper mibh,
                                           JormMIMappingBuilder mb)
                                    throws SpeedoException,
                                           org.objectweb.jorm.api.PException
Description copied from interface: NamingManager
Fill the name def of the generic class reference from a class

Specified by:
defineGenClassReferenceNameDef in interface NamingManager
Parameters:
nd - is the name def to fill
gcr - is the speedo meta object representing the generic class.
sf - is the speedo meta object representing the persistent reference to a generic class.
currentClass - is the class mapping the field
cm - if the mapping structure hosting the mapping of the class.
mibh - is a helper for the management of the JORM meta info
mb - is the mapping builder permitting the creation of the mapping objects.
Throws:
SpeedoException - if the speedo meta information is not completly defined.
org.objectweb.jorm.api.PException

getPNameHints

public java.lang.String getPNameHints(SpeedoClass sc,
                                      org.objectweb.jorm.metainfo.api.NameDef nd)
Description copied from interface: NamingManager
compute a string value which permit to help the building of the class PName (export)

Specified by:
getPNameHints in interface NamingManager
Parameters:
sc - is the Speedo class which the hints must be specified
nd - is the name def of the class

getPNameHints2

public java.lang.Object[] getPNameHints2(SpeedoClass sc,
                                         org.objectweb.jorm.metainfo.api.NameDef nd)
Specified by:
getPNameHints2 in interface NamingManager

getGCPNameHints

public java.lang.String getGCPNameHints(SpeedoClass sc,
                                        org.objectweb.jorm.metainfo.api.NameDef nd)
Description copied from interface: NamingManager
compute a string value which permit to help the building of the genclass PName (export)

Specified by:
getGCPNameHints in interface NamingManager
Parameters:
sc - is the Speedo class which the hints must be specified
nd - is the name def of the gen class

getJormNamingConfig

public void getJormNamingConfig(org.objectweb.jorm.metainfo.api.NameDef nd,
                                SpeedoClass targetClass,
                                org.objectweb.jorm.metainfo.api.MetaObject sourceMO,
                                java.lang.String key,
                                java.util.Properties result)
                         throws SpeedoException
Build a property value compsed such as this pattern userid,binder_class_name,pnc_class_name,class_name

Specified by:
getJormNamingConfig in interface NamingManager
Parameters:
nd -
targetClass -
sourceMO -
key -
result -
Throws:
SpeedoException