Class CNSService.UserObject
- All Implemented Interfaces:
CNSUser
,ServiceUserObject
- Enclosing class:
- CNSService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
deregisterChannelName
(String name, NameAccessLevel accessLevel, ChannelNameKey channelKey) This deregisters a registered or leased Channel name from the Naming Service implementation.leaseChannelName
(String name, NameAccessLevel accessLevel, ChannelNameKey channelKey) Leases the channel name within the specified name space from the Naming Service Implemenation.register
(NetChannelLocation ownerLocation, String name, NameAccessLevel accessLevel, ChannelNameKey key) This method allows a channel's location to be registered against a name in the Naming Service implementation.This method allows a channel (or any instance of a class implementing
) to be registered with a Naming Service Implementation.Networked
register
(Networked owner, String name, ChannelNameKey key) This method allows a channel (or any instance of a class implementing
) that has previously been registered with the to be reregistered with a Naming Service implementation.Networked
register
(Networked owner, String name, NameAccessLevel accessLevel) This method allows a channel (or any instance of a class implementing
) to be registered with a Naming Service Implementation.Networked
register
(Networked owner, String name, NameAccessLevel accessLevel, ChannelNameKey key) This method allows a channel (or any instance of a class implementing
) that has previously been registered to be reregistered with the Naming Service implementation.Networked
This method resolves a channel name into aNetChannelLocation
object.resolve
(String name, NameAccessLevel accessLevel) This method resolves a channel name into aNetChannelLocation
object.
-
Constructor Details
-
UserObject
private UserObject()
-
-
Method Details
-
resolve
Description copied from interface:CNSUser
This method resolves a channel name into a
NetChannelLocation
object. The name should be assumed to be in the global name space (seeNameAccessLevel.GLOBAL_ACCESS_LEVEL
). -
resolve
Description copied from interface:CNSUser
This method resolves a channel name into a
NetChannelLocation
object. The name must exist in the specified name space.The name space is specified by passing in a
object. A name space includes itself and any name space higher up in the hierarchy. The global name space is the highest level of name space.NameAccessLevel
-
register
Description copied from interface:CNSUser
This method allows a channel (or any instance of a class implementing
) to be registered with a Naming Service Implementation. The name will be registered in the global name space.Networked
-
register
Description copied from interface:CNSUser
This method allows a channel (or any instance of a class implementing
) to be registered with a Naming Service Implementation.Networked
The name will be registered in the specified name space. This is specified by passing in a
object.NameAccessLevel
- Specified by:
register
in interfaceCNSUser
- Parameters:
owner
- theNetworked
object whose location should be registered.name
- the name against which to register the channel.accessLevel
- the name space in which to register the channel name.- Returns:
- the
ChannelNameKey
needed for managing the name registration ornull
if registration failed. - See Also:
-
register
Description copied from interface:CNSUser
This method allows a channel (or any instance of a class implementing
) that has previously been registered with the to be reregistered with a Naming Service implementation. The name should have been leased (seeNetworked
CNSUser.leaseChannelName(String, NameAccessLevel, ChannelNameKey)
null
.The name will be registered in the in the global name space.
-
register
public ChannelNameKey register(Networked owner, String name, NameAccessLevel accessLevel, ChannelNameKey key) Description copied from interface:CNSUser
This method allows a channel (or any instance of a class implementing
) that has previously been registered to be reregistered with the Naming Service implementation. The name should have been leased (seeNetworked
CNSUser.leaseChannelName(String, NameAccessLevel, ChannelNameKey)
null
.The name will be registered in the specified name space. This is specified by passing in a
object.NameAccessLevel
- Specified by:
register
in interfaceCNSUser
- Parameters:
owner
- theNetworked
object whose location should be registered.name
- the name against which to register the channel.accessLevel
- the name space in which to register the channel name.key
- theChannelNameKey
returned when the name was leased.- Returns:
- the
ChannelNameKey
needed for managing the name registration ornull
if registration failed. - See Also:
-
register
public ChannelNameKey register(NetChannelLocation ownerLocation, String name, NameAccessLevel accessLevel, ChannelNameKey key) Description copied from interface:CNSUser
This method allows a channel's location to be registered against a name in the Naming Service implementation. It differs from the other register methods in that it takes a
NetChannelLocation
object instead of aNetworked
object. This can be obtained from aNetworked
object by invoking itsgetChannelLocation()
method (see
).Networked.getChannelLocation()
The name will be registered in the specified name space. This is specified by passing in a
This method also allows a leased channel name to be registered against an actual location (see
object.NameAccessLevel
CNSUser.register(Networked, String, NameAccessLevel, ChannelNameKey)
- Specified by:
register
in interfaceCNSUser
- Parameters:
ownerLocation
- the location of a channel to be registered against the name.name
- the name against which to register the channel.accessLevel
- the name space in which to register the channel name.key
- theChannelNameKey
returned when the name was leased.- Returns:
- the
ChannelNameKey
needed for managing the name registration ornull
if registration failed. - See Also:
-
leaseChannelName
public ChannelNameKey leaseChannelName(String name, NameAccessLevel accessLevel, ChannelNameKey channelKey) throws ChannelNameException, NameAccessLevelException Description copied from interface:CNSUser
Leases the channel name within the specified name space from the Naming Service Implemenation. Once a name has been leased, a channel cannot be registered with that name without supplying the key returned by the call to this method.
Depending on the implementation, leases may expire, however, they may be renew by recalling this mehtod. Leases can be given up by deregistering the name. Leases should remain even after the obtaining Node has shut down. This allows a channel to move its registered location to another channel on a different Node. There should be no danger of another party managing to obtain the name as transfering a registered name into a lease should be an atomic action.
- Specified by:
leaseChannelName
in interfaceCNSUser
- Parameters:
name
- the name to lease.accessLevel
- the name space in which to lease the name.channelKey
- the key to use if the name is currently registered or leased.- Returns:
- a new
ChannelNameKey
needed for managing the lease ornull
if leasing failed. - Throws:
ChannelNameException
- if the channel name is invalid.NameAccessLevelException
- if the specifed name space is invalid.
-
deregisterChannelName
public boolean deregisterChannelName(String name, NameAccessLevel accessLevel, ChannelNameKey channelKey) Description copied from interface:CNSUser
This deregisters a registered or leased Channel name from the Naming Service implementation. A boolean is returned to indicate whether deregistration was successful.
- Specified by:
deregisterChannelName
in interfaceCNSUser
- Parameters:
name
- the name of the channel as a String.channelKey
- the ChannelNameKey to use to deregister the Channel name.- Returns:
- a boolean indicating success.
-