org.objectweb.jorm.naming.api

Interface PName

All Superinterfaces:
Cloneable, Serializable

public interface PName
extends Cloneable, 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.
Object
encodeAbstract()
The encodeAbstract method produces an encoded representation of this PName.
BigDecimal
encodeBigDecimal()
The encodeBigDecimal method produces an encoded representation of this PName within its naming context.
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.
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.
Byte
encodeObyte()
The encodeObyte method produces an encoded representation of this PName within its naming context.
Character
encodeOchar()
The encodeOchar method produces an encoded representation of this PName within its naming context.
Integer
encodeOint()
The encodeOint method produces an encoded representation of this PName within its naming context.
Long
encodeOlong()
The encodeOlong method produces an encoded representation of this PName within its naming context.
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.
String
encodeString()
The encodeString method produces an encoded representation of this PName within its naming context.
PName
export(Object conn, PNamingContext pnc)
It associates a PName to an information item within a naming context.
PName
export(Object conn, PNamingContext pnc, 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(Object conn)
It retrieves the information item associated to the given PName (if any exists).
void
unexport(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(Object conn, 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 Details

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.


encodeAbstract

public Object encodeAbstract()
            throws PExceptionNaming,
                   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.


encodeBigDecimal

public 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.


encodeBigInteger

public 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.


encodeByte

public byte encodeByte()
            throws PExceptionNaming,
                   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.


encodeChar

public char encodeChar()
            throws PExceptionNaming,
                   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.


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.


encodeDate

public 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.


encodeInt

public int encodeInt()
            throws PExceptionNaming,
                   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.


encodeLong

public long encodeLong()
            throws PExceptionNaming,
                   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.


encodeObyte

public Byte encodeObyte()
            throws PExceptionNaming,
                   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.


encodeOchar

public Character encodeOchar()
            throws PExceptionNaming,
                   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.


encodeOint

public Integer encodeOint()
            throws PExceptionNaming,
                   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.


encodeOlong

public Long encodeOlong()
            throws PExceptionNaming,
                   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.


encodeOshort

public Short encodeOshort()
            throws PExceptionNaming,
                   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.


encodeShort

public short encodeShort()
            throws PExceptionNaming,
                   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.


encodeString

public 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.


export

public PName export(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.


export

public PName export(Object conn,
                    PNamingContext pnc,
                    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.


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(Object conn)
            throws 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.


unexport

public void unexport(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.


unexport

public void unexport(Object conn,
                     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.