public class ODSCache extends AbstractImplementation implements ExecutableIF
arguments, ctx, descriptor, NEW_LINE
Constructor and Description |
---|
ODSCache()
Constructor of the ODS Cache
|
Modifier and Type | Method and Description |
---|---|
void |
clearTargetCache()
Clear the target cache.
|
double |
convertUnitValue(double value,
java.lang.String unit,
java.lang.String newUnit) |
void |
execute()
The execute, nothing to do.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
ApplRel ar,
java.lang.String[] strVals)
Fill the TS_ValueSeq with the target id of the related element.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
ApplRel ar,
TS_Value[] vals)
Fill the TS_ValueSeq with the values from the string values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
ApplAttr aa,
java.lang.String[] strVals)
Fill the TS_ValueSeq with the values from the string values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
ApplAttr aa,
java.lang.String[] strVals,
short[] flags)
Fill the TS_ValueSeq with the values from the string values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
ApplAttr aa,
TS_Value[] values)
Fill the TS_ValueSeq with the values from the values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
ApplRel ar,
TS_Value[] values)
Fill the TS_ValueSeq with the values from the values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
java.lang.String aaName,
DataType dType,
java.lang.String[] strVals)
Fill the TS_ValueSeq with the values from the string values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
java.lang.String aaName,
DataType dType,
java.lang.String[] strVals,
short[] flags)
Fill the TS_ValueSeq with the values from the string values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
java.lang.String aaName,
DataType dType,
TS_Value[] values)
Fill the TS_ValueSeq with the values from the values.
|
void |
fillTS_ValueSeq(TS_ValueSeq val,
java.lang.String elementName,
java.lang.String attrName,
java.lang.String[] names,
java.lang.String[] strVals)
Fill the TS_ValueSeq with the values from the string values.
|
ApplElemAccess |
getApplElemAccess()
Get the appl elem access object from cache.
|
ApplicationElement |
getApplicationElement(java.lang.String elementName) |
ApplicationStructure |
getApplicationStructure()
Get the application structure object from cache.
|
ApplAttr |
getAttributeByBaseName(java.lang.String elementName,
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.
|
java.lang.String |
getAttributeNameByBaseName(java.lang.String elementName,
java.lang.String baName)
Get the name of an application attribute by base attribute name.
|
java.util.HashMap<java.lang.String,ApplAttr> |
getAttributes(java.lang.String elementName)
Get the attributes of the element.
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getBaseAttributes(java.lang.String basetype)
Get the names of all base attributes and base relations and return them in a HashMap
to find base attributes fast.
|
java.lang.String |
getBaseType(java.lang.String elementName)
Get the base type of the element.
|
java.lang.String[] |
getChildElementNames(java.lang.String aeName)
Get the names of the child application elements of an given application element.
|
ApplRel[] |
getChildRelations(java.lang.String aeName)
Get the child relations of an given application element.
|
T_LONGLONG |
getElementId(java.lang.String elementName)
Get the Id of the application element defined by the application element name.
|
T_LONGLONG[] |
getElementIdsByBaseType(java.lang.String beType)
Get the Ids of the application element defined by base 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.
|
java.util.HashMap<java.lang.String,java.lang.Integer> |
getEnumDefMap(java.lang.String identifier)
Get the enumeration definition for the enumeration name.
|
DataType |
getIdDataType()
Get the datatype of the Id.
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getMappingTable(java.lang.String aeName)
Get a mapping table containing the source and target ids of an instance element in string
representation.
|
DataType |
getMeqDatatype(java.lang.String meqId)
Get the datatype of a measurement quantity
|
java.lang.String |
getParentElementName(java.lang.String aeName)
Get the name of the parent application element of an given application element.
|
ApplRel |
getParentRelation(java.lang.String aeName)
Get the parent relation of an given application element.
|
ApplRel |
getRelation(java.lang.String elementName1,
java.lang.String elementName2)
Get the relation of the element specified by the name of the target element.
|
ApplRel |
getRelationByBaseRelName(java.lang.String elementName,
java.lang.String brName)
Get the relation of the element specified by the base relation name.
|
ApplRel |
getRelationByName(java.lang.String elementName,
java.lang.String name)
Get the relation of the element specified by the relation name.
|
java.util.HashMap<java.lang.String,ApplRel> |
getRelations(java.lang.String elementName)
Get the relations of the element.
|
AoSession |
getSession()
Get the ASAM ODS session.
|
java.lang.String |
getSourceId(java.lang.String applElemName,
T_LONGLONG iid)
Get the source identifier for a given target application element with the instance Id.
|
java.lang.String |
getSourceId(T_LONGLONG aid,
T_LONGLONG iid)
Get the source identifier for a given target application element with the instance Id.
|
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.
|
ElemId[] |
getTargetElemIds(java.lang.String applElemName)
Get the element Ids of all instances of an application element from the target.
|
void |
init()
Init the ODS Cache.
|
boolean |
isTopElement(java.lang.String elementName)
Get if the application element is a top level 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[] |
listTargetKeys()
Get the list with the keys from the target element Id map.
|
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 |
putEnumDefMap(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 |
putMeqDatatype(java.lang.String meqId,
java.lang.String dtStr) |
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.
|
void |
removeTargetId(java.lang.String identifier)
Remove the key from the Target element Id cache.
|
void |
terminate()
the terminate, nothing to do.
|
addAttributesToNameValueUnitArray, addAttributeToNameValueUnitArray, addStringValueToNameValueUnitArray, checkDirectoy, checkDirectoy, checkDirectoy, checkFile, checkFile, checkFile, checkIntValue, checkStringValue, compressNvuArray, createMessageFromPropertyFile, createMessageFromPropertyFile, createMessageFromPropertyFile, createTsUnionFromObject, deleteRowWithAttributes, getArguments, getContext, getDescriptor, getListFromProperty, getMandatoryProperty, getMandatoryProperty, getMandatoryPropertyAsInt, getMandatoryPropertyAsList, getMandatoryPropertyWithRuleException, getNvuArrayFromMap, getNvuArrayFromMap, getNvuObjectWithName, getNvuObjectWithName, getNvuObjectWithName, getOdsCacheFromProperty, getOptioanlPropertyAsInt, getOptionalProperty, getOptionalProperty, getOptionalProperty, getOptionalProperty, getOptionalPropertyAsBoolean, getOptionalPropertyAsBoolean, getOptionalPropertyAsBoolean, getOptionalPropertyAsList, makeUpperCaseKeyword, removeAttributeFromNameValueUnitArray, removeAttributeFromNameValueUnitArray, setArguments, setContext, setDescriptor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getContext, getDescriptor, setArguments, setContext, setDescriptor
public void execute() throws ExecutableException
execute
in interface ExecutableIF
ExecutableException
- if execution fails.ExecutableIF.execute()
public void terminate() throws TerminationException
terminate
in interface ExecutableIF
TerminationException
- if termination fails.ExecutableIF.terminate()
public void init() throws InitializationFailedException
init
in interface ImplementationIF
init
in class AbstractImplementation
InitializationFailedException
- -
When one of the required arguments not exist.public DataType getIdDataType()
public java.lang.String getElementName(T_LONGLONG aid)
aid
- -
the application element Id.public java.lang.String getElementName(java.lang.Long aid)
aid
- -
the application element Id as long variablepublic T_LONGLONG[] getElementIdsByBaseType(java.lang.String beType)
beType
- -
the base element name.public java.lang.String getBaseType(java.lang.String elementName)
elementName
- the name of the elementpublic java.lang.String[] getElementNamesByBaseType(java.lang.String beType)
beType
- -
the base element name.public ApplRel[] getChildRelations(java.lang.String aeName)
aeName
- -
the element name.public ApplRel getParentRelation(java.lang.String aeName)
aeName
- -
the element name.public java.lang.String[] getChildElementNames(java.lang.String aeName)
aeName
- -
the element name.public java.lang.String getParentElementName(java.lang.String aeName)
aeName
- -
the element name.public T_LONGLONG getElementId(java.lang.String elementName)
elementName
- -
the application element name.public java.util.HashMap<java.lang.String,ApplAttr> getAttributes(java.lang.String elementName)
elementName
- -
the name of the element.public ApplAttr getAttributeByName(java.lang.String elementName, java.lang.String aaName)
elementName
- the name of the element.aaName
- the name of the attribute.public ApplAttr getAttributeByBaseName(java.lang.String elementName, java.lang.String baName)
elementName
- the name of the element.baName
- the name of the base attribute.public java.lang.String getAttributeNameByBaseName(java.lang.String elementName, java.lang.String baName)
elementName
- Name of application elementbaName
- Base name of application attributepublic ApplRel getRelationByBaseRelName(java.lang.String elementName, java.lang.String brName)
elementName
- -
the name of the element.brName
- the name of the base relationpublic ApplRel getRelationByName(java.lang.String elementName, java.lang.String name)
elementName
- -
the name of the element.name
- the name of the relationpublic ApplRel getRelation(java.lang.String elementName1, java.lang.String elementName2)
elementName
- -
the name of the element.elementName2
- the name of the base relationpublic java.util.HashMap<java.lang.String,ApplRel> getRelations(java.lang.String elementName)
elementName
- -
the name of the element.public ElemId getTargetElemId(java.lang.String identifier)
identifier
- -
the identifierpublic void clearTargetCache()
public ElemId[] getTargetElemIds(java.lang.String applElemName)
applElemName
- the name of the application element.public java.lang.String getSourceId(java.lang.String applElemName, T_LONGLONG iid)
applElemName
- the application elementiid
- the instance Id in the target.public java.lang.String getSourceId(T_LONGLONG aid, T_LONGLONG iid)
aid
- application element Id of the target.iid
- the instance Id in the target.public ElemId getTargetElemId(java.lang.String aeName, java.lang.String id)
aeName
- -
the application element nameid
- -
the instance element Id.public java.util.Hashtable<java.lang.String,java.lang.String> getMappingTable(java.lang.String aeName)
aeName
- - the application element namepublic void putTargetElemId(java.lang.String identifier, ElemId iid)
identifier
- -
the identifieriid
- -
the instance element Id.public void putTargetElemId(java.lang.String aeName, java.lang.String id, ElemId iid)
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)
aeName
- -
the application element nameid
- -
the instance element Id.public boolean isTopElement(java.lang.String elementName)
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)
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)
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)
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)
identifier
- the identifier.public void putEnumDefMap(java.lang.String identifier, java.util.HashMap<java.lang.String,java.lang.Integer> enumDefMap)
identifier
- -
the enumeration nameenumDefMap
- -
the map with the enumeration definition.public java.util.HashMap<java.lang.String,java.lang.Integer> getEnumDefMap(java.lang.String identifier)
identifier
- the enumeration name.public ApplElemAccess getApplElemAccess()
public ApplicationStructure getApplicationStructure()
public AoSession getSession()
public DataType getMeqDatatype(java.lang.String meqId)
meaQtyName
- Name of measurement Quantitypublic java.util.Hashtable<java.lang.String,java.lang.String> getBaseAttributes(java.lang.String basetype) throws RuleException
basetype
- The base element nameRuleException
public void putMeqDatatype(java.lang.String meqId, java.lang.String dtStr) throws RuleException
RuleException
public java.lang.String[] listAttributes(java.lang.String elementName)
elementName
- -
the element namepublic java.lang.String[] listRelation(java.lang.String elementName, boolean onlyNtoM)
elementName
- -
the element nameonlyNtoM
- -
list only the names of the N:M relations.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, java.lang.String attrName, java.lang.String[] names, java.lang.String[] strVals) throws AoException, RuleException
val
- -
the value sequenceelementName
- -
the name of the application element.aa
- -
the application attributestrVals
- -
the string values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented data types.RuleException
public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, ApplAttr aa, java.lang.String[] strVals) throws AoException
val
- -
the value sequenceelementName
- -
the name of the application element.aa
- -
the application attributestrVals
- -
the string values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, ApplAttr aa, java.lang.String[] strVals, short[] flags) throws AoException
val
- -
the value sequenceelementName
- -
the name of the application element.aa
- -
the application attributestrVals
- -
the string values.flags
- -
the flags of the values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, java.lang.String aaName, DataType dType, java.lang.String[] strVals) throws AoException
val
- -
the value sequenceelementName
- -
the name of the application element.aaName
- -
the name of the application attributedType
- -
the dType of the application attributestrVals
- -
the string values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, java.lang.String aaName, DataType dType, java.lang.String[] strVals, short[] flags) throws AoException
val
- -
the value sequenceelementName
- -
the name of the application element.aaName
- -
the name of the application attributedType
- -
the dType of the application attributestrVals
- -
the string values.flags
- -
the flags of the values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, ApplAttr aa, TS_Value[] values) throws AoException
val
- - the value sequenceelementName
- - the name of the application element.aa
- - the application attributevalues
- - the values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, ApplRel ar, TS_Value[] values) throws AoException
val
- - the value sequenceelementName
- - the name of the application element.aa
- - the application attributevalues
- - the values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, java.lang.String elementName, java.lang.String aaName, DataType dType, TS_Value[] values) throws AoException
val
- - the value sequenceelementName
- - the name of the application element.aaName
- - the application attribute namedType
- - the application attribute datatypevalues
- - the values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, ApplRel ar, java.lang.String[] strVals) throws AoException
val
- -
the value sequencear
- -
the application relationstrVals
- -
the string values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public void fillTS_ValueSeq(TS_ValueSeq val, ApplRel ar, TS_Value[] vals) throws AoException
val
- -
the value sequenceaa
- -
the application attributestrVals
- -
the string values.AoException
- any occurring ASAM ODS exception or AO_NOT_IMPLEMENTED for the not implemented datatypes.public double convertUnitValue(double value, java.lang.String unit, java.lang.String newUnit) throws AoException
AoException
public java.lang.String[] listTargetKeys()
public void removeTargetId(java.lang.String identifier)
indentifier
- the identifier.public ApplicationElement getApplicationElement(java.lang.String elementName) throws AoException
AoException