org.objectweb.jorm.naming.api
Interface PName

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Subinterfaces:
PolymorphicPName

public interface PName
extends java.lang.Cloneable, java.io.Serializable

The PName interface defines the behaviour of a persistent name as it is managed by its associated naming context. Indeed, such a behaviour is supported partly within the name implementation, and partly within its naming context.

Author:
R. Basset, P. D?chamboux

Method Summary
 boolean codingSupported(int codingtype)
          It tests if a given coding type is supported for this PName.
 byte[] encode()
          The encode method produces an encoded representation of this PName within its naming context.
 java.lang.Object encodeAbstract()
          The encodeAbstract method produces an encoded representation of this PName.
 java.math.BigDecimal encodeBigDecimal()
          The encodeBigDecimal method produces an encoded representation of this PName within its naming context.
 java.math.BigInteger encodeBigInteger()
          The encodeBigInteger method produces an encoded representation of this PName within its naming context.
 byte encodeByte()
          The encodeByte method produces an encoded representation of this PName within its naming context.
 char encodeChar()
          The encodeChar method produces an encoded representation of this PName within its naming context.
 char[] encodeCharArray()
          The encodeCharArray method produces an encoded representation of this PName within its naming context.
 java.util.Date encodeDate()
          The encodeDate method produces an encoded representation of this PName within its naming context.
 int encodeInt()
          The encodeInt method produces an encoded representation of this PName within its naming context.
 long encodeLong()
          The encodeLong method produces an encoded representation of this PName within its naming context.
 java.lang.Byte encodeObyte()
          The encodeObyte method produces an encoded representation of this PName within its naming context.
 java.lang.Character encodeOchar()
          The encodeOchar method produces an encoded representation of this PName within its naming context.
 java.lang.Integer encodeOint()
          The encodeOint method produces an encoded representation of this PName within its naming context.
 java.lang.Long encodeOlong()
          The encodeOlong method produces an encoded representation of this PName within its naming context.
 java.lang.Short encodeOshort()
          The encodeOshort method produces an encoded representation of this PName within its naming context.
 short encodeShort()
          The encodeShort method produces an encoded representation of this PName within its naming context.
 java.lang.String encodeString()
          The encodeString method produces an encoded representation of this PName within its naming context.
 PName export(java.lang.Object conn, PNamingContext pnc)
          It associates a PName to an information item within a naming context.
 PName export(java.lang.Object conn, PNamingContext pnc, java.lang.Object hints)
          It associates a PName to an information item within a naming context.
 PNameManager getPNameManager()
          It retrieves the name manager associated to this PName.
 PType getPType()
          It retrieves the PType associated to this PName if any exists.
 boolean isNull()
          It tells if this name corresponds to "null" representation within a its naming context.
 PName resolve(java.lang.Object conn)
          It retrieves the information item associated to the given PName (if any exists).
 void unexport(java.lang.Object conn)
          It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).
 void unexport(java.lang.Object conn, java.lang.Object hints)
          It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).
 

Method Detail

codingSupported

public boolean codingSupported(int codingtype)
It tests if a given coding type is supported for this PName.

Parameters:
codingtype - One of the coding type defined by PNamingContext.CTxxx constants defined within the PNamingContext interface.
Returns:
It returns true if the coding type is supported for this PName.

encode

public byte[] encode()
              throws PExceptionNaming
The encode method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is an array of bytes.

Returns:
The array of bytes corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeAbstract

public java.lang.Object encodeAbstract()
                                throws PExceptionNaming,
                                       java.lang.UnsupportedOperationException
The encodeAbstract method produces an encoded representation of this PName. The encoding format is the case of this method is a Java object of any complexity. Example of such object is a getter interface giving access of the fields of a composite relational primary key.

Returns:
The Object corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeByte

public byte encodeByte()
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
The encodeByte method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a byte.

Returns:
The byte corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeObyte

public java.lang.Byte encodeObyte()
                           throws PExceptionNaming,
                                  java.lang.UnsupportedOperationException
The encodeObyte method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Byte.

Returns:
The Byte corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeChar

public char encodeChar()
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
The encodeChar method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a char.

Returns:
The char corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOchar

public java.lang.Character encodeOchar()
                                throws PExceptionNaming,
                                       java.lang.UnsupportedOperationException
The encodeOchar method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Character.

Returns:
The Character corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeInt

public int encodeInt()
              throws PExceptionNaming,
                     java.lang.UnsupportedOperationException
The encodeInt method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a int.

Returns:
The int corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOint

public java.lang.Integer encodeOint()
                             throws PExceptionNaming,
                                    java.lang.UnsupportedOperationException
The encodeOint method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Integer.

Returns:
The Integer corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeLong

public long encodeLong()
                throws PExceptionNaming,
                       java.lang.UnsupportedOperationException
The encodeLong method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a long.

Returns:
The long corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOlong

public java.lang.Long encodeOlong()
                           throws PExceptionNaming,
                                  java.lang.UnsupportedOperationException
The encodeOlong method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Long.

Returns:
The Long corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeShort

public short encodeShort()
                  throws PExceptionNaming,
                         java.lang.UnsupportedOperationException
The encodeShort method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a short.

Returns:
The short corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeOshort

public java.lang.Short encodeOshort()
                             throws PExceptionNaming,
                                    java.lang.UnsupportedOperationException
The encodeOshort method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Short.

Returns:
The Short corresponding to the encoded representation.
Throws:
PExceptionNaming
java.lang.UnsupportedOperationException

encodeString

public java.lang.String encodeString()
                              throws PExceptionNaming
The encodeString method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a String.

Returns:
The String corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeCharArray

public char[] encodeCharArray()
                       throws PExceptionNaming
The encodeCharArray method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a char[].

Returns:
The char[] corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeDate

public java.util.Date encodeDate()
                          throws PExceptionNaming
The encodeDate method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a Date.

Returns:
The Date corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeBigInteger

public java.math.BigInteger encodeBigInteger()
                                      throws PExceptionNaming
The encodeBigInteger method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a BigInteger.

Returns:
The BigInteger corresponding to the encoded representation.
Throws:
PExceptionNaming

encodeBigDecimal

public java.math.BigDecimal encodeBigDecimal()
                                      throws PExceptionNaming
The encodeBigDecimal method produces an encoded representation of this PName within its naming context. The encoding format in the case of this method is a BigDecimal.

Returns:
The BigDecimal corresponding to the encoded representation.
Throws:
PExceptionNaming

export

public PName export(java.lang.Object conn,
                    PNamingContext pnc)
             throws PException
It associates a PName to an information item within a naming context.

Parameters:
conn - The connection that can be used to access the data store.
pnc - Thhe naming context which must provide a PName for this PName.
Returns:
The new PName associated to this PName.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store
PException

export

public PName export(java.lang.Object conn,
                    PNamingContext pnc,
                    java.lang.Object hints)
             throws PException
It associates a PName to an information item within a naming context.

Parameters:
conn - The connection that can be used to access the data store.
pnc - Thhe naming context which must provide a PName for this PName.
hints - Any information relevant for name creation.
Returns:
The new PName associated to this PName.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store
PException

getPNameManager

public PNameManager getPNameManager()
It retrieves the name manager associated to this PName.

Returns:
The naming context which provide this pname

getPType

public PType getPType()
It retrieves the PType associated to this PName if any exists. If none is associated, it returns null.

Returns:
The PType associated to this PName.

isNull

public boolean isNull()
It tells if this name corresponds to "null" representation within a its naming context.

Returns:
true if it represents a "null" name.

resolve

public PName resolve(java.lang.Object conn)
              throws java.lang.UnsupportedOperationException,
                     PException
It retrieves the information item associated to the given PName (if any exists).

Parameters:
conn - The connection that can be used to access the data store.
Returns:
The information item associated with the given PName within a naming context.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store
java.lang.UnsupportedOperationException
PException

unexport

public void unexport(java.lang.Object conn)
              throws PException
It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).

Parameters:
conn - The connection that can be used to access the data store.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store
PException

unexport

public void unexport(java.lang.Object conn,
                     java.lang.Object hints)
              throws PException
It removes this PName and all the associated information within a naming context (i.e., the association between the PName and its information item).

Parameters:
conn - The connection that can be used to access the data store.
hints - Any information relevant for name removing.
Throws:
PExceptionNaming - Raised in case of problem within the naming context.
PExceptionIO - Raised in case of problem during the access of the data store
PException