Package fr.dyade.aaa.jndi2.impl
Class ServerImpl
- java.lang.Object
-
- fr.dyade.aaa.jndi2.impl.ServerImpl
-
public class ServerImpl extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private ContextManagercontextManagerA context manager for the factory operations (new, delete).static StringLOOSE_COUPLINGstatic booleanlooseCouplingprivate ObjectrootOwnerIdIdentifier of the server that owns the root naming context.private ObjectserverIdIdentifier of this server.private UpdateListenerupdateListenerOptional update listener.
-
Constructor Summary
Constructors Constructor Description ServerImpl(Transaction transaction, Object serverId, Object rootOwnerId)Constructs aServerImpl
-
Method Summary
-
-
-
Field Detail
-
LOOSE_COUPLING
public static final String LOOSE_COUPLING
- See Also:
- Constant Field Values
-
looseCoupling
public static final boolean looseCoupling
-
serverId
private Object serverId
Identifier of this server.
-
rootOwnerId
private Object rootOwnerId
Identifier of the server that owns the root naming context.
-
updateListener
private UpdateListener updateListener
Optional update listener. May benull.
-
contextManager
private ContextManager contextManager
A context manager for the factory operations (new, delete). It also handles a cache and the persistency.
-
-
Constructor Detail
-
ServerImpl
public ServerImpl(Transaction transaction, Object serverId, Object rootOwnerId)
Constructs aServerImpl- Parameters:
transaction- Transactional context that provides atomicity for the write operations performed during a request.serverId- Identifier of this server.rootOwnerId- Identifier of the server that owns the root naming context.
-
-
Method Detail
-
setUpdateListener
public void setUpdateListener(UpdateListener updateListener)
-
bind
public void bind(CompositeName path, Object obj) throws NamingException
Binds an object to the specified path.- Parameters:
path- the path of the objectobj- the object to bind- Throws:
NameAlreadyBoundException- if the name of the subcontext is already bound.NameNotFoundException- if some of the intermediate names in the path don't exist.NotOwnerException- if the owner of the parent context is checked and is not the local naming server.NamingException
-
bind
public void bind(NamingContext nc, String lastName, Object obj, Object ownerId) throws NamingException
- Throws:
NamingException
-
rebind
public void rebind(CompositeName path, Object obj) throws NamingException
Rebinds an object to the specified path.- Parameters:
path- the path of the objectobj- the object to rebind- Throws:
NameNotFoundException- if some of the intermediate names in the path don't exist.NotOwnerException- if the owner of the parent context is checked and is not the local naming server.NamingException- if the specified path is bound to a naming context.
-
rebind
public void rebind(NamingContext nc, String lastName, Object obj, Object ownerId) throws NamingException
- Throws:
NamingException
-
lookup
public Record lookup(CompositeName path) throws NamingException
Looks up the specified path.- Parameters:
path- the path to look up- Returns:
nullif the bound object is a context.- Throws:
NameNotFoundException- if some of the names (intermediate and final) in the path don't exist.NotOwnerException- if the owner of the parent context is checked and is not the local naming server.NameNotFoundException- an error occurs.NamingException
-
unbind
public void unbind(CompositeName path) throws NamingException
Unbinds the specified path. This operation is idempotent: does nothing if the final name of the path is not found.- Parameters:
path- the path to unbind- Throws:
NameNotFoundException- if some of the intermediate names in the path don't exist.NotOwnerException- if the owner of the parent context is checked and is not the local naming server.NamingException- if the specified path is bound to a naming context.
-
unbind
public boolean unbind(NamingContext nc, String lastName, Object ownerId) throws NamingException
- Throws:
NamingException
-
list
public NameClassPair[] list(CompositeName path) throws NamingException
- Throws:
NamingException
-
listBindings
public Binding[] listBindings(CompositeName path) throws NamingException
- Throws:
NamingException
-
createSubcontext
public void createSubcontext(CompositeName path) throws NamingException
- Throws:
NamingException
-
createSubcontext
public void createSubcontext(CompositeName path, Object subcontextOwnerId) throws NamingException
Create a subcontext.- Parameters:
path- the path of the subcontextsubcontextOwnerId- identifier of the owner of the subcontext (nullif the owner is the local naming server).- Throws:
NameAlreadyBoundException- if the name of the subcontext is already bound.NameNotFoundException- if some of the intermediate names in the path don't exist.NotOwnerException- if the owner of the parent context is checked and is not the local naming server.NamingException
-
createSubcontext
public NamingContextId createSubcontext(NamingContext parentNc, String lastName, CompositeName path, NamingContextId ncid, Object subcontextOwnerId, Object ownerId) throws NamingException
- Throws:
NamingException
-
destroySubcontext
public void destroySubcontext(CompositeName path) throws NamingException
Destroy a subcontext. This operation is idempotent: does nothing if the final name of the path is not found.- Parameters:
path- the path of the subcontext- Throws:
NameAlreadyBoundException- if the name of the subcontext is already bound.NameNotFoundException- if some of the intermediate names in the path don't exist.NotOwnerException- if the owner of the parent context is checked and is not the local naming server.NotContextException- if the specified path isn't bound to a context.NamingException
-
destroySubcontext
public boolean destroySubcontext(NamingContext parentNc, String lastName, CompositeName path, Object ownerId) throws NamingException
- Throws:
NamingException
-
copyNamingContexts
public NamingContextInfo[] copyNamingContexts(Object serverId) throws NamingException
Returns copies of the naming contexts owned by the server which identifier is specified.- Parameters:
serverId- the identifier of the server that owns the naming contexts to get.- Returns:
- the context informations.
- Throws:
NamingException- an exception occurs.
-
getNamingContext
public NamingContext getNamingContext(NamingContextId ncid) throws NamingException
- Throws:
NamingException
-
getNamingContext
public NamingContext getNamingContext(CompositeName name) throws NamingException
- Throws:
NamingException
-
storeNamingContext
public void storeNamingContext(NamingContext nc) throws NamingException
- Throws:
NamingException
-
addNamingContext
public void addNamingContext(NamingContextInfo ncInfo) throws NamingException
- Throws:
NamingException
-
newNamingContext
public NamingContext newNamingContext(Object ownerId, NamingContextId ncid, CompositeName name) throws NamingException
- Throws:
NamingException
-
changeOwner
public void changeOwner(CompositeName name, Object newOwnerId) throws NamingException
- Throws:
NamingException
-
resetNamingContext
public void resetNamingContext(NamingContext context) throws NamingException
- Throws:
NamingException
-
-