Skip to content
Snippets Groups Projects
Commit 2e8c4066 authored by gwen-soleil's avatar gwen-soleil
Browse files

add fluent API

parent 1bfc28f6
No related branches found
No related tags found
No related merge requests found
Showing
with 154 additions and 165 deletions
......@@ -61,19 +61,21 @@ public class ArchivingConfig {
return archiver;
}
public void setArchiver(final String archiver) {
public ArchivingConfig setArchiver(final String archiver) {
this.archiver = archiver;
return this;
}
public InsertionModes getModes() {
return modes;
}
public void setModes(final InsertionModes modes) {
public ArchivingConfig setModes(final InsertionModes modes) {
this.modes = modes;
return this;
}
public void setModesAsArray(final String[] modeArray) {
public ArchivingConfig setModesAsArray(final String[] modeArray) {
int index = 0;
modes = new InsertionModes();
logger.debug("setting modes {}", Arrays.toString(modeArray));
......@@ -81,15 +83,14 @@ public class ArchivingConfig {
while (index < modeArray.length && modeArray[index] != null) {
switch (modeArray[index]) {
case MODE_P:
modes.setPeriodic(true);
modes.setPeriodPeriodic(Integer.parseInt(modeArray[index + 1]));
modes.setPeriodic(true).setPeriodPeriodic(Integer.parseInt(modeArray[index + 1]));
index = index + 2;
break;
case MODE_A:
modes.setAbsolute(true);
modes.setPeriodAbsolute(Integer.parseInt(modeArray[index + 1]));
modes.setDecreaseDeltaAbsolute(Double.parseDouble(modeArray[index + 2]));
modes.setIncreaseDeltaAbsolute(Double.parseDouble(modeArray[index + 3]));
modes.setAbsolute(true)
.setPeriodAbsolute(Integer.parseInt(modeArray[index + 1]))
.setDecreaseDeltaAbsolute(Double.parseDouble(modeArray[index + 2]))
.setIncreaseDeltaAbsolute(Double.parseDouble(modeArray[index + 3]));
if (modeArray.length > index + 4) {
modes.setSlowDriftAbsolute(Boolean.parseBoolean(modeArray[index + 4]));
index = index + 5;
......@@ -99,10 +100,9 @@ public class ArchivingConfig {
}
break;
case MODE_R:
modes.setRelative(true);
modes.setPeriodRelative(Integer.parseInt(modeArray[index + 1]));
modes.setDecreasePercentRelative(Double.parseDouble(modeArray[index + 2]));
modes.setIncreasePercentRelative(Double.parseDouble(modeArray[index + 3]));
modes.setRelative(true).setPeriodRelative(Integer.parseInt(modeArray[index + 1])).
setDecreasePercentRelative(Double.parseDouble(modeArray[index + 2])).
setIncreasePercentRelative(Double.parseDouble(modeArray[index + 3]));
if (modeArray.length > index + 4) {
modes.setSlowDriftRelative(Boolean.parseBoolean(modeArray[index + 4]));
index = index + 5;
......@@ -112,15 +112,13 @@ public class ArchivingConfig {
}
break;
case MODE_T:
modes.setThreshold(true);
modes.setPeriodThreshold(Integer.parseInt(modeArray[index + 1]));
modes.setMinThresholdValue(Double.parseDouble(modeArray[index + 2]));
modes.setMaxThresholdValue(Double.parseDouble(modeArray[index + 3]));
modes.setThreshold(true).setPeriodThreshold(Integer.parseInt(modeArray[index + 1])).
setMinThresholdValue(Double.parseDouble(modeArray[index + 2])).
setMaxThresholdValue(Double.parseDouble(modeArray[index + 3]));
index = index + 4;
break;
case MODE_D:
modes.setDifference(true);
modes.setPeriodDifference(Integer.parseInt(modeArray[index + 1]));
modes.setDifference(true).setPeriodDifference(Integer.parseInt(modeArray[index + 1]));
index = index + 2;
break;
case MODE_EVT:
......@@ -132,14 +130,16 @@ public class ArchivingConfig {
break;
}
}
return this;
}
public AttributeConfig getAttributeConfig() {
return attributeConfig;
}
public void setAttributeConfig(final AttributeConfig attributeConfig) {
public ArchivingConfig setAttributeConfig(final AttributeConfig attributeConfig) {
this.attributeConfig = attributeConfig;
return this;
}
public List<String> asStringList() {
......
......@@ -90,16 +90,14 @@ or true/false,12,"tango/tangotest/spjz_2/double_spectrum_ro" ,5,1,0,"archiving/t
int nrOfParameters = 0;
do {
nrOfParameters = Integer.parseInt(config[i]);
logger.debug("converting full information to archiving conf for {}", Arrays.toString(Arrays.copyOfRange(config, i, i + nrOfParameters)));
ArchivingConfig archivingConfig = new ArchivingConfig();
AttributeConfig attributeConfig = new AttributeConfig();
attributeConfig.setCsName(csName);
attributeConfig.setFullName(config[i + 1]);
attributeConfig.setType(Integer.parseInt(config[i + 2]));
attributeConfig.setFormat(Integer.parseInt(config[i + 3]));
attributeConfig.setWriteType(Integer.parseInt(config[i + 4]));
archivingConfig.setAttributeConfig(attributeConfig);
archivingConfig.setArchiver(config[i + 5]);
logger.debug("converting full information to archiving conf for {}",
Arrays.toString(Arrays.copyOfRange(config, i, i + nrOfParameters)));
AttributeConfig attributeConfig = new AttributeConfig().setCsName(csName).
setFullName(config[i + 1]).setType(Integer.parseInt(config[i + 2])).
setFormat(Integer.parseInt(config[i + 3]))
.setWriteType(Integer.parseInt(config[i + 4]));
ArchivingConfig archivingConfig = new ArchivingConfig().
setAttributeConfig(attributeConfig).setArchiver(config[i + 5]);
int modesArraySize = Integer.parseInt(config[i + 7]);
final String[] modeArray = new String[modesArraySize];
System.arraycopy(config, i + 8, modeArray, 0, modesArraySize);
......@@ -118,12 +116,11 @@ or true/false,12,"tango/tangotest/spjz_2/double_spectrum_ro" ,5,1,0,"archiving/t
modeArray[i] = config[i + nrOfAttribute + 2];
}
for (int n = 0; n < nrOfAttribute; n++) {
ArchivingConfig archivingConfig = new ArchivingConfig();
AttributeConfig attributeConfig = new AttributeConfig();
attributeConfig.setFullName(config[n + 2]);
attributeConfig.setCsName(csName);
archivingConfig.setAttributeConfig(attributeConfig);
archivingConfig.setModesAsArray(modeArray);
AttributeConfig attributeConfig = new AttributeConfig()
.setFullName(config[n + 2])
.setCsName(csName);
ArchivingConfig archivingConfig = new ArchivingConfig().setAttributeConfig(attributeConfig)
.setModesAsArray(modeArray);
archivingConfigs.add(archivingConfig);
}
}
......@@ -145,10 +142,11 @@ or true/false,12,"tango/tangotest/spjz_2/double_spectrum_ro" ,5,1,0,"archiving/t
return isGrouped;
}
public void addConfiguration(ArchivingConfig config) {
public ArchivingConfigs addConfiguration(ArchivingConfig config) {
if (config != null) {
archivingConfigs.add(config);
}
return this;
}
public List<ArchivingConfig> getArchivingConfigs() {
......
......@@ -81,16 +81,12 @@ public class TangoArchivingSystemConfigurationServiceTest {
public void start(String attributeName) {
System.out.println("####start " + attributeName);
ArchivingConfigs archivingConfigs = new ArchivingConfigs();
ArchivingConfig config = new ArchivingConfig();
AttributeConfig attributeConfig = new AttributeConfig();
attributeConfig.setFullName(attributeName);
AttributeConfig attributeConfig = new AttributeConfig().setFullName(attributeName);
InsertionModes modes = new InsertionModes();
modes.setPeriodic(true);
modes.setPeriodPeriodic(100);
config.setModes(modes);
config.setAttributeConfig(attributeConfig);
archivingConfigs.addConfiguration(config);
ArchivingConfig config = new ArchivingConfig().setModes(modes).setAttributeConfig(attributeConfig);
ArchivingConfigs archivingConfigs = new ArchivingConfigs().addConfiguration(config);
System.out.println("##################" + attributeConfig);
System.out.println("start");
Map<String, ArchivingConfigs> result = service.startArchiving(archivingConfigs);
......
......@@ -55,120 +55,122 @@ public class AttributeConfig {
return time;
}
public void setTime(final Timestamp time) {
public AttributeConfig setTime(final Timestamp time) {
this.time = time;
return this;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("fullName", fullName)
.append("csName", csName)
.append("domain", domain)
.append("family", family)
.append("member", member)
.append("name", name)
.append("ttl", ttl)
.append("type", type)
.append("writeType", writeType)
.append("format", format)
.append("time", time)
.toString();
return new ToStringBuilder(this).append("fullName", fullName).append("csName", csName).append("domain", domain).append("family", family).append("member", member).append("name", name).append("ttl", ttl).append("type", type).append("writeType", writeType).append("format", format).append("time", time).toString();
}
public int getId() {
return id;
}
public void setId(final int id) {
public AttributeConfig setId(final int id) {
this.id = id;
return this;
}
public String getTableName() {
return tableName;
}
public void setTableName(final String tableName) {
public AttributeConfig setTableName(final String tableName) {
this.tableName = tableName;
return this;
}
public String getFullName() {
return fullName;
}
public void setFullName(String fullName) {
public AttributeConfig setFullName(String fullName) {
this.fullName = fullName;
return this;
}
public String getCsName() {
return csName;
}
public void setCsName(String csName) {
public AttributeConfig setCsName(String csName) {
this.csName = csName;
return this;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
public AttributeConfig setDomain(String domain) {
this.domain = domain;
return this;
}
public String getFamily() {
return family;
}
public void setFamily(String family) {
public AttributeConfig setFamily(String family) {
this.family = family;
return this;
}
public String getMember() {
return member;
}
public void setMember(String member) {
public AttributeConfig setMember(String member) {
this.member = member;
return this;
}
public String getName() {
return name;
}
public void setName(String name) {
public AttributeConfig setName(String name) {
this.name = name;
return this;
}
public int getTtl() {
return ttl;
}
public void setTtl(int ttl) {
public AttributeConfig setTtl(int ttl) {
this.ttl = ttl;
return this;
}
public int getType() {
return type;
}
public void setType(int type) {
public AttributeConfig setType(int type) {
this.type = type;
return this;
}
public int getWriteType() {
return writeType;
}
public void setWriteType(int writeType) {
public AttributeConfig setWriteType(int writeType) {
this.writeType = writeType;
return this;
}
public int getFormat() {
return format;
}
public void setFormat(int format) {
public AttributeConfig setFormat(int format) {
this.format = format;
return this;
}
}
......@@ -66,96 +66,108 @@ public class AttributeParameters {
return attConfId;
}
public void setAttConfId(int attConfId) {
public AttributeParameters setAttConfId(int attConfId) {
this.attConfId = attConfId;
return this;
}
public String getDetails() {
return details;
}
public void setDetails(String details) {
public AttributeParameters setDetails(String details) {
this.details = details;
return this;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
public AttributeParameters setLabel(String label) {
this.label = label;
return this;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
public AttributeParameters setUnit(String unit) {
this.unit = unit;
return this;
}
public String getStandardUnit() {
return standardUnit;
}
public void setStandardUnit(String standardUnit) {
public AttributeParameters setStandardUnit(String standardUnit) {
this.standardUnit = standardUnit;
return this;
}
public String getDisplayUnit() {
return displayUnit;
}
public void setDisplayUnit(String displayUnit) {
public AttributeParameters setDisplayUnit(String displayUnit) {
this.displayUnit = displayUnit;
return this;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
public AttributeParameters setFormat(String format) {
this.format = format;
return this;
}
public String getArchiveRelChange() {
return archiveRelChange;
}
public void setArchiveRelChange(String archiveRelChange) {
public AttributeParameters setArchiveRelChange(String archiveRelChange) {
this.archiveRelChange = archiveRelChange;
return this;
}
public String getArchiveAbsChange() {
return archiveAbsChange;
}
public void setArchiveAbsChange(String archiveAbsChange) {
public AttributeParameters setArchiveAbsChange(String archiveAbsChange) {
this.archiveAbsChange = archiveAbsChange;
return this;
}
public String getArchivePeriod() {
return archivePeriod;
}
public void setArchivePeriod(String archivePeriod) {
public AttributeParameters setArchivePeriod(String archivePeriod) {
this.archivePeriod = archivePeriod;
return this;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
public AttributeParameters setDescription(String description) {
this.description = description;
return this;
}
public Timestamp getRecvTime() {
return recvTime;
}
public void setRecvTime(Timestamp recvTime) {
public AttributeParameters setRecvTime(Timestamp recvTime) {
this.recvTime = recvTime;
return this;
}
@Override
......
......@@ -90,161 +90,176 @@ public class InsertionModes {
return attributeName;
}
public void setAttributeName(final String attributeName) {
public InsertionModes setAttributeName(final String attributeName) {
this.attributeName = attributeName;
return this;
}
public int getAttributeID() {
return attributeID;
}
public void setAttributeID(final int attributeID) {
public InsertionModes setAttributeID(final int attributeID) {
this.attributeID = attributeID;
return this;
}
public boolean isSlowDriftRelative() {
return isSlowDriftRelative;
}
public void setSlowDriftRelative(boolean slowDriftRelative) {
public InsertionModes setSlowDriftRelative(boolean slowDriftRelative) {
isSlowDriftRelative = slowDriftRelative;
return this;
}
public boolean isPeriodic() {
return isPeriodic;
}
public void setPeriodic(boolean periodic) {
public InsertionModes setPeriodic(boolean periodic) {
isPeriodic = periodic;
return this;
}
public int getPeriodPeriodic() {
return periodPeriodic;
}
public void setPeriodPeriodic(int periodPeriodic) {
public InsertionModes setPeriodPeriodic(int periodPeriodic) {
this.periodPeriodic = periodPeriodic;
return this;
}
public boolean isAbsolute() {
return isAbsolute;
}
public void setAbsolute(boolean absolute) {
public InsertionModes setAbsolute(boolean absolute) {
isAbsolute = absolute;
return this;
}
public boolean isSlowDriftAbsolute() {
return isSlowDriftAbsolute;
}
public void setSlowDriftAbsolute(boolean slowDriftAbsolute) {
public InsertionModes setSlowDriftAbsolute(boolean slowDriftAbsolute) {
isSlowDriftAbsolute = slowDriftAbsolute;
return this;
}
public Integer getPeriodAbsolute() {
return periodAbsolute;
}
public void setPeriodAbsolute(Integer periodAbsolute) {
public InsertionModes setPeriodAbsolute(Integer periodAbsolute) {
this.periodAbsolute = periodAbsolute;
return this;
}
public Double getDecreaseDeltaAbsolute() {
return decreaseDeltaAbsolute;
}
public void setDecreaseDeltaAbsolute(Double decreaseDeltaAbsolute) {
public InsertionModes setDecreaseDeltaAbsolute(Double decreaseDeltaAbsolute) {
this.decreaseDeltaAbsolute = decreaseDeltaAbsolute;
return this;
}
public Double getIncreaseDeltaAbsolute() {
return increaseDeltaAbsolute;
}
public void setIncreaseDeltaAbsolute(Double increaseDeltaAbsolute) {
public InsertionModes setIncreaseDeltaAbsolute(Double increaseDeltaAbsolute) {
this.increaseDeltaAbsolute = increaseDeltaAbsolute;
return this;
}
public boolean isRelative() {
return isRelative;
}
public void setRelative(boolean relative) {
public InsertionModes setRelative(boolean relative) {
isRelative = relative;
return this;
}
public Integer getPeriodRelative() {
return periodRelative;
}
public void setPeriodRelative(Integer periodRelative) {
public InsertionModes setPeriodRelative(Integer periodRelative) {
this.periodRelative = periodRelative;
return this;
}
public boolean isThreshold() {
return isThreshold;
}
public void setThreshold(boolean threshold) {
public InsertionModes setThreshold(boolean threshold) {
isThreshold = threshold;
return this;
}
public Integer getPeriodThreshold() {
return periodThreshold;
}
public void setPeriodThreshold(Integer periodThreshold) {
public InsertionModes setPeriodThreshold(Integer periodThreshold) {
this.periodThreshold = periodThreshold;
return this;
}
public Double getMinThresholdValue() {
return minThresholdValue;
}
public void setMinThresholdValue(Double minThresholdValue) {
public InsertionModes setMinThresholdValue(Double minThresholdValue) {
this.minThresholdValue = minThresholdValue;
return this;
}
public Double getMaxThresholdValue() {
return maxThresholdValue;
}
public void setMaxThresholdValue(Double maxThresholdValue) {
public InsertionModes setMaxThresholdValue(Double maxThresholdValue) {
this.maxThresholdValue = maxThresholdValue;
return this;
}
public boolean isDifference() {
return isDifference;
}
public void setDifference(boolean difference) {
public InsertionModes setDifference(boolean difference) {
isDifference = difference;
return this;
}
public Integer getPeriodDifference() {
return periodDifference;
}
public void setPeriodDifference(Integer periodDifference) {
public InsertionModes setPeriodDifference(Integer periodDifference) {
this.periodDifference = periodDifference;
return this;
}
public boolean isEvent() {
return isEvent;
}
public void setEvent(boolean event) {
public InsertionModes setEvent(boolean event) {
isEvent = event;
return this;
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(attributeID).append(isPeriodic).append(periodPeriodic).append(isAbsolute).
append(isSlowDriftAbsolute).append(periodAbsolute).append(decreaseDeltaAbsolute).append(increaseDeltaAbsolute).append(isRelative).
append(periodRelative).append(isSlowDriftRelative).append(decreasePercentRelative).append(increasePercentRelative).
append(isThreshold).append(periodThreshold).append(minThresholdValue).append(maxThresholdValue).append(isDifference).append(periodDifference).
append(isEvent).toHashCode();
return new HashCodeBuilder(17, 37).append(attributeID).append(isPeriodic).append(periodPeriodic).append(isAbsolute).append(isSlowDriftAbsolute).append(periodAbsolute).append(decreaseDeltaAbsolute).append(increaseDeltaAbsolute).append(isRelative).append(periodRelative).append(isSlowDriftRelative).append(decreasePercentRelative).append(increasePercentRelative).append(isThreshold).append(periodThreshold).append(minThresholdValue).append(maxThresholdValue).append(isDifference).append(periodDifference).append(isEvent).toHashCode();
}
@Override
......@@ -255,41 +270,12 @@ public class InsertionModes {
final InsertionModes that = (InsertionModes) o;
return new EqualsBuilder().append(attributeID, that.attributeID).append(isPeriodic, that.isPeriodic).append(periodPeriodic, that.periodPeriodic).
append(isAbsolute, that.isAbsolute).append(isSlowDriftAbsolute, that.isSlowDriftAbsolute).append(isRelative, that.isRelative).
append(isSlowDriftRelative, that.isSlowDriftRelative).append(isThreshold, that.isThreshold).append(isDifference, that.isDifference).
append(isEvent, that.isEvent).append(periodAbsolute, that.periodAbsolute).append(decreaseDeltaAbsolute, that.decreaseDeltaAbsolute).
append(increaseDeltaAbsolute, that.increaseDeltaAbsolute).append(periodRelative, that.periodRelative).
append(decreasePercentRelative, that.decreasePercentRelative).append(increasePercentRelative, that.increasePercentRelative)
.append(periodThreshold, that.periodThreshold).append(minThresholdValue, that.minThresholdValue).append(maxThresholdValue, that.maxThresholdValue)
.append(periodDifference, that.periodDifference).isEquals();
return new EqualsBuilder().append(attributeID, that.attributeID).append(isPeriodic, that.isPeriodic).append(periodPeriodic, that.periodPeriodic).append(isAbsolute, that.isAbsolute).append(isSlowDriftAbsolute, that.isSlowDriftAbsolute).append(isRelative, that.isRelative).append(isSlowDriftRelative, that.isSlowDriftRelative).append(isThreshold, that.isThreshold).append(isDifference, that.isDifference).append(isEvent, that.isEvent).append(periodAbsolute, that.periodAbsolute).append(decreaseDeltaAbsolute, that.decreaseDeltaAbsolute).append(increaseDeltaAbsolute, that.increaseDeltaAbsolute).append(periodRelative, that.periodRelative).append(decreasePercentRelative, that.decreasePercentRelative).append(increasePercentRelative, that.increasePercentRelative).append(periodThreshold, that.periodThreshold).append(minThresholdValue, that.minThresholdValue).append(maxThresholdValue, that.maxThresholdValue).append(periodDifference, that.periodDifference).isEquals();
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("attributeID", attributeID)
.append("attributeName", attributeName)
.append("isPeriodic", isPeriodic)
.append("periodPeriodic", periodPeriodic)
.append("isAbsolute", isAbsolute)
.append("isSlowDriftAbsolute", isSlowDriftAbsolute)
.append("periodAbsolute", periodAbsolute)
.append("decreaseDeltaAbsolute", decreaseDeltaAbsolute)
.append("increaseDeltaAbsolute", increaseDeltaAbsolute)
.append("isRelative", isRelative)
.append("periodRelative", periodRelative)
.append("isSlowDriftRelative", isSlowDriftRelative)
.append("decreasePercentRelative", decreasePercentRelative)
.append("increasePercentRelative", increasePercentRelative)
.append("isThreshold", isThreshold)
.append("periodThreshold", periodThreshold)
.append("minThresholdValue", minThresholdValue)
.append("maxThresholdValue", maxThresholdValue)
.append("isDifference", isDifference)
.append("periodDifference", periodDifference)
.append("isEvent", isEvent)
.toString();
return new ToStringBuilder(this).append("attributeID", attributeID).append("attributeName", attributeName).append("isPeriodic", isPeriodic).append("periodPeriodic", periodPeriodic).append("isAbsolute", isAbsolute).append("isSlowDriftAbsolute", isSlowDriftAbsolute).append("periodAbsolute", periodAbsolute).append("decreaseDeltaAbsolute", decreaseDeltaAbsolute).append("increaseDeltaAbsolute", increaseDeltaAbsolute).append("isRelative", isRelative).append("periodRelative", periodRelative).append("isSlowDriftRelative", isSlowDriftRelative).append("decreasePercentRelative", decreasePercentRelative).append("increasePercentRelative", increasePercentRelative).append("isThreshold", isThreshold).append("periodThreshold", periodThreshold).append("minThresholdValue", minThresholdValue).append("maxThresholdValue", maxThresholdValue).append("isDifference", isDifference).append("periodDifference", periodDifference).append("isEvent", isEvent).toString();
}
public String toSimpleString() {
......@@ -304,12 +290,10 @@ public class InsertionModes {
result = result + " MODE_D + " + periodDifference;
}
if (isAbsolute) {
result = result + " MODE_A + " + periodAbsolute + " + " + decreaseDeltaAbsolute + " + " + increaseDeltaAbsolute + " + "
+ isSlowDriftAbsolute;
result = result + " MODE_A + " + periodAbsolute + " + " + decreaseDeltaAbsolute + " + " + increaseDeltaAbsolute + " + " + isSlowDriftAbsolute;
}
if (isRelative) {
result = result + " MODE_R + " + periodRelative + " + " + decreaseDeltaAbsolute + " + " + increasePercentRelative + " + "
+ isSlowDriftRelative;
result = result + " MODE_R + " + periodRelative + " + " + decreaseDeltaAbsolute + " + " + increasePercentRelative + " + " + isSlowDriftRelative;
}
if (isThreshold) {
result = result + " MODE_T + " + periodThreshold + " + " + minThresholdValue + " + " + maxThresholdValue;
......@@ -322,15 +306,17 @@ public class InsertionModes {
return decreasePercentRelative;
}
public void setDecreasePercentRelative(Double decreasePercentRelative) {
public InsertionModes setDecreasePercentRelative(Double decreasePercentRelative) {
this.decreasePercentRelative = decreasePercentRelative;
return this;
}
public Double getIncreasePercentRelative() {
return increasePercentRelative;
}
public void setIncreasePercentRelative(Double increasePercentRelative) {
public InsertionModes setIncreasePercentRelative(Double increasePercentRelative) {
this.increasePercentRelative = increasePercentRelative;
return this;
}
}
......@@ -65,26 +65,22 @@ public class InsertionModesMapper {
public static InsertionModes getInsertionModes(InsertionModesTable table) {
InsertionModes modes = new InsertionModes();
if (table != null) {
modes.setAttributeName(table.getAttributeName());
modes.setAttributeID(table.getAttributeID());
modes.setPeriodic(table.isPeriodic());
modes.setPeriodPeriodic(table.getPeriodPeriodic());
modes.setAbsolute(table.isAbsolute());
modes.setPeriodAbsolute(table.getPeriodAbsolute());
modes.setDecreaseDeltaAbsolute(table.getDecreaseDeltaAbsolute());
modes.setIncreaseDeltaAbsolute(table.getIncreaseDeltaAbsolute());
modes.setSlowDriftAbsolute(table.isSlowDriftAbsolute());
modes.setRelative(table.isRelative());
modes.setPeriodRelative(table.getPeriodRelative());
modes.setSlowDriftRelative(table.isSlowDriftRelative());
modes.setDecreasePercentRelative(table.getDecreasePercentRelative());
modes.setIncreasePercentRelative(table.getIncreasePercentRelative());
modes.setDifference(table.isDifference());
modes.setPeriodDifference(table.getPeriodDifference());
modes.setAttributeName(table.getAttributeName())
.setAttributeID(table.getAttributeID())
.setPeriodic(table.isPeriodic())
.setPeriodPeriodic(table.getPeriodPeriodic());
modes.setAbsolute(table.isAbsolute())
.setPeriodAbsolute(table.getPeriodAbsolute())
.setDecreaseDeltaAbsolute(table.getDecreaseDeltaAbsolute())
.setIncreaseDeltaAbsolute(table.getIncreaseDeltaAbsolute())
.setSlowDriftAbsolute(table.isSlowDriftAbsolute());
modes.setRelative(table.isRelative())
.setPeriodRelative(table.getPeriodRelative())
.setSlowDriftRelative(table.isSlowDriftRelative())
.setDecreasePercentRelative(table.getDecreasePercentRelative())
.setIncreasePercentRelative(table.getIncreasePercentRelative());
modes.setDifference(table.isDifference())
.setPeriodDifference(table.getPeriodDifference());
modes.setEvent(table.isEvent());
}
return modes;
......
......@@ -45,13 +45,12 @@ import java.sql.Timestamp;
import java.time.Instant;
public class TangoAttributeFetcher implements ITangoAttributeFetcher {
private final TangoAttribute tangoAttribute;
private final AttributeConfig config = new AttributeConfig();
private final AttributeParameters parameters = new AttributeParameters();
public TangoAttributeFetcher(String attributeName) {
try {
tangoAttribute = new TangoAttribute(attributeName);
TangoAttribute tangoAttribute = new TangoAttribute(attributeName);
config.setFullName(tangoAttribute.getName());
config.setFormat(tangoAttribute.getAttributeProxy().get_info().data_format.value());
config.setType(tangoAttribute.getDataType());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment