public class IMCAddressResolver
extends java.lang.Object
Constructor and Description |
---|
IMCAddressResolver()
Created a new resolver that loads all the static imc addresses from the
IMC definitions
|
IMCAddressResolver(java.io.InputStream is)
Creates a new resolver loading initial imc addresses from given stream
|
Modifier and Type | Method and Description |
---|---|
void |
addEntry(int imcid,
java.lang.String imcName)
Adds or a updates a resolution entry
|
java.util.Map<java.lang.String,java.lang.Integer> |
getAddresses()
Retrieve the addresses table
|
java.lang.String |
resolve(int imcId)
Tries to name a given imc id
|
int |
resolve(java.lang.String imcName)
Given an IMC name retrives its IMC id
|
java.lang.String |
resolveEntity(int src,
int src_ent)
Resolve the name of an entity Id
|
java.lang.String |
resolveEntity(java.lang.String sourceName,
int src_ent)
Resolve the name of an entity Id
|
void |
setEntityMap(int imcId,
java.util.Map<?,?> namesToIds)
Updates entity name resolution given a map from entity ids to names
|
void |
setEntityName(int imcId,
int entityId,
java.lang.String name)
Adds or updates an entity name resolution
|
public IMCAddressResolver()
public IMCAddressResolver(java.io.InputStream is)
is
- A XML stream with IMC_Addresses.xml formapublic java.lang.String resolve(int imcId)
imcId
- The IMC identifier to look forpublic int resolve(java.lang.String imcName)
imcName
- The IMC name to look forpublic void addEntry(int imcid, java.lang.String imcName)
imcid
- The IMC identifier of the systemimcName
- The IMC name to be used for that IDpublic void setEntityName(int imcId, int entityId, java.lang.String name)
imcId
- The IMC Id of the source systementityId
- The entity Id of the entityname
- The name of this entity id in that systempublic void setEntityMap(int imcId, java.util.Map<?,?> namesToIds)
imcId
- The IMC Id of the source systemidsToNames
- A map from entity names to Ids. The types of the map are
fairly flexible: The entries are converted to String and the
parsed using Integer.parseInt(). The values are just converted
to String.public java.lang.String resolveEntity(int src, int src_ent)
src
- The source system IMC Idsrc_ent
- The entity Idnull
in case the entity was
not found.public java.lang.String resolveEntity(java.lang.String sourceName, int src_ent)
sourceName
- The source system namesrc_ent
- The entity Idnull
in case the entity was
not found.public java.util.Map<java.lang.String,java.lang.Integer> getAddresses()