public class OdsCache extends java.lang.Object implements OdsCacheIF
Argument Keyword | Datatype | Default | Description |
---|---|---|---|
ReferenceName | String | none | The name of reference where the object must be stored in the context. |
OdsSession | String | none | The reference name of the ods session. |
Modifier and Type | Field and Description |
---|---|
protected ApplElemAccess |
aea |
protected AoSession |
aoSession |
protected java.util.HashMap<java.lang.String,ApplicationElement> |
applElemMap
Map with the identifier and application element.
|
protected ApplicationStructure |
applicationStructure |
protected java.util.HashMap<java.lang.String,java.util.Vector<java.lang.String>> |
baseElementMap |
protected java.util.HashMap<java.lang.String,java.lang.String> |
baseTypeMap
Map with the name of the element and the base type
The base types are always lower case.
|
protected java.util.HashMap<java.lang.Long,java.util.HashMap<java.lang.String,java.lang.Long>> |
catalogIdMap
Map with the application element name and the catalog entries.
|
protected java.util.HashMap<java.lang.Long,java.util.HashMap<java.lang.Long,java.lang.String>> |
catalogMap
Map with the application element name and the catalog entries.
|
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ApplRel>> |
elementApplRelMap |
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ApplAttr>> |
elementMap |
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ApplicationRelation>> |
elementRelationMap |
protected java.util.HashMap<java.lang.String,ElemId> |
elemIdMap
Map with the identifier and element Id from the target instance element.
|
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>> |
enumerationsMap
Map with the enumeration definition of the attribute.
|
protected java.util.HashMap<java.lang.String,EnumerationDefinition> |
enumMap
Map with the identifier and enumeration definition.
|
protected DataType |
idDatatype |
protected java.util.HashMap<java.lang.Long,java.lang.String> |
idNameMap
Map with the application element Id to name map.
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
isTopMap |
protected java.util.HashMap<java.lang.String,java.lang.Long> |
nameIdMap
Map with the application element name to Id map.
|
Constructor and Description |
---|
OdsCache(AoSession aoSession)
Constructor of the ODS Cache
|
Modifier and Type | Method and Description |
---|---|
protected java.util.HashMap<java.lang.Long,java.lang.String> |
createCatalogMap(T_LONGLONG elementId)
Get the name of the instance.
|
protected void |
createEnumMap()
Create the map with the enumerations.
|
AIDName |
getAIDName(java.lang.String element,
java.lang.String attr)
Create a AIDName structure.
|
ApplElemAccess |
getApplElemAccess()
Get the appl elem access object from cache.
|
ApplicationRelation |
getApplicationRelationByBaseRelName(T_LONGLONG aid,
java.lang.String brName)
Get the application relation of the element specified by the base relation name.
|
ApplicationRelation |
getApplicationRelationByRelName(java.lang.String elementName,
java.lang.String arName)
Get the application relation of the element specified by the relation name.
|
ApplicationStructure |
getApplicationStructure()
Get the application structure object from cache.
|
ApplAttr[] |
getAttributeArray(java.lang.String elementName)
Get the attributes of the element.
|
ApplAttr |
getAttributeByBaseName(java.lang.String elementName,
java.lang.String baName)
Get the attribute of the element specified by the base attribute name.
|
ApplAttr |
getAttributeByBaseName(T_LONGLONG aid,
java.lang.String baName)
Get the attribute of the element specified by the base attribute name.
|
ApplAttr |
getAttributeByName(java.lang.String elementName,
java.lang.String aaName)
Get the attribute of the element specified by the attribute name.
|
ApplAttr |
getAttributeByName(T_LONGLONG aid,
java.lang.String aaName)
Get the attribute of the element specified by the attribute name.
|
java.util.HashMap<java.lang.String,ApplAttr> |
getAttributes(java.lang.String elementName)
Get the attributes of the element.
|
java.lang.String |
getBaseType(java.lang.String elementName)
Get the base type of the given element.
|
java.util.HashMap<java.lang.Long,java.lang.String> |
getCatalog(java.lang.Long id)
Get the catalog of an element defined by the application element Id.
|
java.util.HashMap<java.lang.Long,java.lang.String> |
getCatalog(T_LONGLONG id)
Get the catalog of an element defined by the application element Id.
|
T_LONGLONG |
getCatalogItem(java.lang.String name,
java.lang.String key)
Get the id of the instance.
|
java.lang.String |
getCatalogItem(java.lang.String name,
T_LONGLONG id)
Get the name of the instance.
|
T_LONGLONG |
getCatalogItem(T_LONGLONG elementId,
java.lang.String name)
Get the name of the instance.
|
java.lang.String |
getCatalogItem(T_LONGLONG elementId,
T_LONGLONG id)
Get the name of the instance.
|
ApplicationElement |
getElement(java.lang.Long aid)
Get the name of the application element defined by the application element Id.
|
ApplicationElement |
getElement(java.lang.String elementName)
Get the application element belongs to the given name.
|
ApplicationElement |
getElement(T_LONGLONG aid)
Get the name of the application element defined by the application element Id.
|
T_LONGLONG |
getElementId(java.lang.String elementName)
Get the Id of the application element defined by the application element name.
|
java.lang.String |
getElementName(java.lang.Long aid)
Get the name of the application element defined by the application element Id.
|
java.lang.String |
getElementName(T_LONGLONG aid)
Get the name of the application element defined by the application element Id.
|
java.lang.String[] |
getElementNamesByBaseType(java.lang.String beType)
Get the names of the application element defined by base element name .
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
getEnumDef(java.lang.String identifier)
Get the enumeration definition for the identifier.
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
getEnumDef(java.lang.String aeName,
java.lang.String aaName)
Get the enumeration definition for the attribute of the element.
|
EnumerationDefinition |
getEnumerationDefinition(java.lang.String enumName)
Get the enumeration definition specified by the name.
|
DataType |
getIdDataType()
Get the datatype of the Id.
|
InstanceElement |
getInstance(java.lang.String key)
Get the instance belongs to the given instance key.
|
ElemId |
getInstanceId(java.lang.String key)
get the instance ID belongs to the given instance key.
|
ApplRel |
getRelationByBaseRelName(java.lang.String elementName,
java.lang.String brName)
Get the relation of the element specified by the base relation name.
|
ApplRel |
getRelationByBaseRelName(T_LONGLONG aid,
java.lang.String brName)
Get the relation of the element specified by the base relation name.
|
java.util.HashMap<java.lang.String,ApplRel> |
getRelations(java.lang.String elementName)
Get the relations of the element.
|
ApplRel[] |
getRelations(java.lang.String elementName,
java.lang.String relElement)
Get the relations of an element to another element.
|
ApplRel[] |
getRelationsByBaseRelName(java.lang.String elementName,
java.lang.String brName)
Get the relation of the element specified by the base relation name.
|
AoSession |
getSession()
Get the ASAM ODS session.
|
ElemId |
getTargetElemId(java.lang.String identifier)
Get the element Id from the target from the identifier.
|
ElemId |
getTargetElemId(java.lang.String aeName,
java.lang.String id)
Get the element Id from the target from the application element name and instance Id.
|
boolean |
isTopElement(java.lang.String elementName)
Get if the application element is a top level element.
|
void |
keepAlive() |
java.lang.String[] |
listAttributeNames(java.lang.String elementName)
List the names of attributes of the element.
|
java.lang.String[] |
listAttributes(java.lang.String elementName)
List the attributes from the element, in the list are all attributes given except the id, values, flags and
generation_parameters attribute.
|
java.lang.String[] |
listRelation(java.lang.String elementName,
boolean onlyNtoM)
List the relations from the element, not the forwards relations are reported.
|
java.lang.String |
makeIdentifier(java.lang.String aeName,
java.lang.String id)
Make an identifier from the application element name and the instance element Id.
|
void |
putEnumDef(java.lang.String identifier,
java.util.HashMap<java.lang.String,java.lang.Integer> enumDefMap)
Put the enumeration definition for an identifier in the map.
|
void |
putEnumDef(java.lang.String aeName,
java.lang.String aaName,
java.util.HashMap<java.lang.String,java.lang.Integer> enumDefMap)
Put the enumeration definition for an attribute of an element in the map.
|
void |
putTargetElemId(java.lang.String identifier,
ElemId iid)
Put the element Id from the target in the map for the given identifier.
|
void |
putTargetElemId(java.lang.String aeName,
java.lang.String id,
ElemId iid)
Put the element Id from the target in the map for the given application element name and instance Id.
|
protected AoSession aoSession
protected ApplElemAccess aea
protected ApplicationStructure applicationStructure
protected java.util.HashMap<java.lang.String,java.lang.String> isTopMap
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ApplAttr>> elementMap
protected java.util.HashMap<java.lang.String,java.util.Vector<java.lang.String>> baseElementMap
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ApplRel>> elementApplRelMap
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,ApplicationRelation>> elementRelationMap
protected java.util.HashMap<java.lang.Long,java.lang.String> idNameMap
protected java.util.HashMap<java.lang.String,java.lang.Long> nameIdMap
protected DataType idDatatype
protected java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.Integer>> enumerationsMap
protected java.util.HashMap<java.lang.String,ElemId> elemIdMap
protected java.util.HashMap<java.lang.String,ApplicationElement> applElemMap
protected java.util.HashMap<java.lang.Long,java.util.HashMap<java.lang.Long,java.lang.String>> catalogMap
protected java.util.HashMap<java.lang.Long,java.util.HashMap<java.lang.String,java.lang.Long>> catalogIdMap
protected java.util.HashMap<java.lang.String,EnumerationDefinition> enumMap
protected java.util.HashMap<java.lang.String,java.lang.String> baseTypeMap
public OdsCache(AoSession aoSession) throws AoException
AoException
protected void createEnumMap() throws AoException
AoException
- any occurring ASAM ODS exception.public EnumerationDefinition getEnumerationDefinition(java.lang.String enumName)
enumName
- the name of the enumeration definition.public DataType getIdDataType()
getIdDataType
in interface OdsCacheIF
public java.lang.String getElementName(T_LONGLONG aid)
getElementName
in interface OdsCacheIF
aid
- -
the application element Id.public java.lang.String getElementName(java.lang.Long aid)
getElementName
in interface OdsCacheIF
aid
- -
the application element Id as long variablepublic java.lang.String[] getElementNamesByBaseType(java.lang.String beType)
getElementNamesByBaseType
in interface OdsCacheIF
beType
- -
the base element name.public InstanceElement getInstance(java.lang.String key) throws AoException, java.text.ParseException
e.g.:
Project;24 // application element Project and just one long value as id.
Result;0,12 // application element Result and a T_LONGLONG as id.
getInstance
in interface OdsCacheIF
key
- the instance keyAoException
java.text.ParseException
public ElemId getInstanceId(java.lang.String key) throws AoException, java.text.ParseException
getInstanceId
in interface OdsCacheIF
key
- the instance keyAoException
java.text.ParseException
public ApplicationElement getElement(java.lang.String elementName)
getElement
in interface OdsCacheIF
elementName
- the application element name.public java.lang.String getBaseType(java.lang.String elementName)
elementName
- the application element name.public ApplicationElement getElement(T_LONGLONG aid)
getElement
in interface OdsCacheIF
aid
- -
the application element Id.public ApplicationElement getElement(java.lang.Long aid)
getElement
in interface OdsCacheIF
aid
- -
the application element Id as long variablepublic AIDName getAIDName(java.lang.String element, java.lang.String attr)
getAIDName
in interface OdsCacheIF
element
- the application element nameattr
- the attribute name.public T_LONGLONG getElementId(java.lang.String elementName)
getElementId
in interface OdsCacheIF
elementName
- -
the application element name.public java.util.HashMap<java.lang.String,ApplAttr> getAttributes(java.lang.String elementName)
getAttributes
in interface OdsCacheIF
elementName
- -
the name of the element.public ApplAttr[] getAttributeArray(java.lang.String elementName)
elementName
- -
the name of the element.public java.lang.String[] listAttributeNames(java.lang.String elementName)
elementName
- -
the name of the element.public ApplAttr getAttributeByBaseName(java.lang.String elementName, java.lang.String baName)
getAttributeByBaseName
in interface OdsCacheIF
elementName
- the name of the element.baName
- the name of the base attribute.public ApplAttr getAttributeByName(java.lang.String elementName, java.lang.String aaName)
elementName
- the name of the element.baName
- the name of the attribute.public ApplAttr getAttributeByBaseName(T_LONGLONG aid, java.lang.String baName)
getAttributeByBaseName
in interface OdsCacheIF
aid
- the Id of the element.baName
- the name of the base attribute.public ApplAttr getAttributeByName(T_LONGLONG aid, java.lang.String aaName)
aid
- the Id of the element.baName
- the name of the attribute.public ApplRel getRelationByBaseRelName(java.lang.String elementName, java.lang.String brName)
getRelationByBaseRelName
in interface OdsCacheIF
elementName
- -
the name of the element.brName
- the name of the base relationpublic ApplRel[] getRelationsByBaseRelName(java.lang.String elementName, java.lang.String brName)
elementName
- -
the name of the element.brName
- the name of the base relationpublic ApplRel getRelationByBaseRelName(T_LONGLONG aid, java.lang.String brName)
getRelationByBaseRelName
in interface OdsCacheIF
aid
- -
the id of the element.brName
- the name of the base relationpublic ApplicationRelation getApplicationRelationByBaseRelName(T_LONGLONG aid, java.lang.String brName) throws AoException
getApplicationRelationByBaseRelName
in interface OdsCacheIF
aid
- -
the id of the element.brName
- the name of the base relationAoException
- any occurring ASAM ODS Exception.public ApplicationRelation getApplicationRelationByRelName(java.lang.String elementName, java.lang.String arName) throws AoException
getApplicationRelationByRelName
in interface OdsCacheIF
elementName
- -
the name of the element.brName
- the name of the relationAoException
- any occurring ASAM ODS Exception.public java.util.HashMap<java.lang.String,ApplRel> getRelations(java.lang.String elementName)
getRelations
in interface OdsCacheIF
elementName
- -
the name of the element.public ApplRel[] getRelations(java.lang.String elementName, java.lang.String relElement)
getRelations
in interface OdsCacheIF
elementName
- -
the name of the element.relElement
- -
the name of the related element.public ElemId getTargetElemId(java.lang.String identifier)
getTargetElemId
in interface OdsCacheIF
identifier
- -
the identifierpublic ElemId getTargetElemId(java.lang.String aeName, java.lang.String id)
getTargetElemId
in interface OdsCacheIF
aeName
- -
the application element nameid
- -
the instance element Id.public void putTargetElemId(java.lang.String identifier, ElemId iid)
putTargetElemId
in interface OdsCacheIF
identifier
- -
the identifieriid
- -
the instance element Id.public void putTargetElemId(java.lang.String aeName, java.lang.String id, ElemId iid)
putTargetElemId
in interface OdsCacheIF
aeName
- -
the application element nameid
- -
the instance element Id.iid
- -
the instance element Id.public java.lang.String makeIdentifier(java.lang.String aeName, java.lang.String id)
makeIdentifier
in interface OdsCacheIF
aeName
- -
the application element nameid
- -
the instance element Id.public boolean isTopElement(java.lang.String elementName)
isTopElement
in interface OdsCacheIF
ElementName
- the name of the elementpublic void putEnumDef(java.lang.String aeName, java.lang.String aaName, java.util.HashMap<java.lang.String,java.lang.Integer> enumDefMap)
putEnumDef
in interface OdsCacheIF
aeName
- -
the application element nameaaName
- -
the application attribute nameenumDefMap
- -
the map with the enumeration definition.public void putEnumDef(java.lang.String identifier, java.util.HashMap<java.lang.String,java.lang.Integer> enumDefMap)
putEnumDef
in interface OdsCacheIF
identifier
- -
the application element nameenumDefMap
- -
the map with the enumeration definition.public java.util.HashMap<java.lang.String,java.lang.Integer> getEnumDef(java.lang.String aeName, java.lang.String aaName)
getEnumDef
in interface OdsCacheIF
aeName
- -
the name of the application element.aaName
- -
the name of the application attributepublic java.util.HashMap<java.lang.String,java.lang.Integer> getEnumDef(java.lang.String identifier)
getEnumDef
in interface OdsCacheIF
identifier
- the identifier.public ApplElemAccess getApplElemAccess()
getApplElemAccess
in interface OdsCacheIF
public ApplicationStructure getApplicationStructure() throws AoException
getApplicationStructure
in interface OdsCacheIF
AoException
public AoSession getSession()
getSession
in interface OdsCacheIF
public java.lang.String[] listAttributes(java.lang.String elementName)
listAttributes
in interface OdsCacheIF
elementName
- -
the element namepublic java.lang.String[] listRelation(java.lang.String elementName, boolean onlyNtoM)
listRelation
in interface OdsCacheIF
elementName
- -
the element nameonlyNtoM
- -
list only the names of the N:M relations.public java.util.HashMap<java.lang.Long,java.lang.String> getCatalog(T_LONGLONG id)
getCatalog
in interface OdsCacheIF
id
- the Id of the application element.public java.util.HashMap<java.lang.Long,java.lang.String> getCatalog(java.lang.Long id)
getCatalog
in interface OdsCacheIF
id
- the Id of the application element.public java.lang.String getCatalogItem(java.lang.String name, T_LONGLONG id)
getCatalogItem
in interface OdsCacheIF
name
- the Name of the application element.id
- the Id of the instance.public T_LONGLONG getCatalogItem(java.lang.String name, java.lang.String key)
getCatalogItem
in interface OdsCacheIF
name
- the Name of the application element.key
- the name of the instance.public java.lang.String getCatalogItem(T_LONGLONG elementId, T_LONGLONG id)
getCatalogItem
in interface OdsCacheIF
elementId
- the id of the application element.id
- the Id of the instance.public T_LONGLONG getCatalogItem(T_LONGLONG elementId, java.lang.String name)
getCatalogItem
in interface OdsCacheIF
elementId
- the id of the application element.name
- the name of the catalog instance.protected java.util.HashMap<java.lang.Long,java.lang.String> createCatalogMap(T_LONGLONG elementId)
elementId
- the id of the application element.id
- the Id of the instance.public void keepAlive()