com.ontotext.ordi.wsmo4rdf.remote.server
Class Registry<EntityType>

java.lang.Object
  extended by com.ontotext.ordi.wsmo4rdf.remote.server.Registry<EntityType>

public class Registry<EntityType>
extends Object


Field Summary
protected static int maxEntities
          how many entities a register can handle
 
Constructor Summary
Registry(int maxEntities)
           
 
Method Summary
 void clear()
          Unregisters all WsmoConnections.
 EntityType getById(int entityId)
          Return an entity ID as per register index
static boolean isValid(int id)
          Verifies if an identifier is in the legal range according to this register limits.
 int register(EntityType registryEntity)
          Finds a unique ID for an entity and puts it in registry index
 EntityType unregister(int id)
          Removes entity from this register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxEntities

protected static int maxEntities
how many entities a register can handle

Constructor Detail

Registry

public Registry(int maxEntities)
Method Detail

isValid

public static boolean isValid(int id)
Verifies if an identifier is in the legal range according to this register limits.

Parameters:
id - identifier to be verified
Returns:
true if valid, false otherwise

register

public int register(EntityType registryEntity)
             throws RegistryFullException
Finds a unique ID for an entity and puts it in registry index

Parameters:
registryEntity - EntityType instance to be registered
Returns:
integer ID of the registered object
Throws:
RegistryFullException - if there is no available space for connections

unregister

public EntityType unregister(int id)
Removes entity from this register

Parameters:
id - Integer ID of the RegistryEntity to be removed
Returns:
EntityType reference if entity exists or null otherwise

clear

public void clear()
Unregisters all WsmoConnections. If a connection cannot be closed, this method continues with the next connection.


getById

public EntityType getById(int entityId)
Return an entity ID as per register index

Parameters:
entityId - Integer ID of looked up entity
Returns:
EntityType instance if entity is in this register or null otherwise


Copyright © 2008. All Rights Reserved.