Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • master
  • release_1_5_4
  • release_1_5_5
  • release_1_5_6
  • release_1_5_7
  • release_1_5_8
  • release_1_6_0
  • release_1_6_1
  • release_1_6_2
  • release_1_6_3
  • snapArchivingApi-1.6.4
  • snapArchivingApi-1.6.5
  • snapArchivingApi-1.6.6
  • snapArchivingApi-1.7.0
  • snapArchivingApi-1.7.1
  • snapArchivingApi-1.7.2
  • snapArchivingApi-1.7.3
  • snapArchivingApi-1.7.4
  • snapArchivingApi-1.7.5
  • snapArchivingApi-1.7.6
  • snapArchivingApi-1.7.7
  • snapArchivingApi-1.7.8
  • snapArchivingApi-1.8.0
  • snapArchivingApi-1.8.1
  • snapArchivingApi-1.8.2
  • snapArchivingApi-1.8.3
  • snapArchivingApi-1.8.4
  • trunk
28 results

Target

Select target project
  • software-control-system/tango-controls-archiving/snaparchivingapi
1 result
Select Git revision
  • master
  • release_1_5_4
  • release_1_5_5
  • release_1_5_6
  • release_1_5_7
  • release_1_5_8
  • release_1_6_0
  • release_1_6_1
  • release_1_6_2
  • release_1_6_3
  • snapArchivingApi-1.6.4
  • snapArchivingApi-1.6.5
  • snapArchivingApi-1.6.6
  • snapArchivingApi-1.7.0
  • snapArchivingApi-1.7.1
  • snapArchivingApi-1.7.2
  • snapArchivingApi-1.7.3
  • snapArchivingApi-1.7.4
  • snapArchivingApi-1.7.5
  • snapArchivingApi-1.7.6
  • snapArchivingApi-1.7.7
  • snapArchivingApi-1.7.8
  • snapArchivingApi-1.8.0
  • snapArchivingApi-1.8.1
  • snapArchivingApi-1.8.2
  • snapArchivingApi-1.8.3
  • snapArchivingApi-1.8.4
  • trunk
28 results
Show changes
Showing
with 984 additions and 1533 deletions
/* Synchrotron Soleil
*
* File : ScStr2Val.java
*
* Project : javaapi
*
* Description :
*
* Author : CLAISSE
*
* Original : 7 mars 07
*
* Revision: Author:
* Date: State:
*
* Log: ScStr2Val.java,v
*
*/
/*
* Created on 7 mars 07
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package fr.soleil.archiving.snap.api.persistence.spring.dto;
import fr.soleil.actiongroup.collectiveaction.onattributes.plugin.persistance.AnyAttribute;
import fr.soleil.archiving.snap.api.persistence.context.SnapshotPersistenceContext;
/**
* 2 string values.
*
* @author CLAISSE
*/
public class ScStr2Val extends Val {
private String readValue;
private String writeValue;
......@@ -43,8 +24,8 @@ public class ScStr2Val extends Val {
readValue = null;
writeValue = null;
} else {
this.readValue = val[0];
this.writeValue = val[1];
readValue = val.length < 1 ? null : val[0];
writeValue = val.length < 2 ? null : val[1];
}
}
......@@ -52,7 +33,7 @@ public class ScStr2Val extends Val {
* @return the readValue
*/
public String getReadValue() {
return this.readValue;
return readValue;
}
/**
......@@ -67,7 +48,7 @@ public class ScStr2Val extends Val {
* @return the writeValue
*/
public String getWriteValue() {
return this.writeValue;
return writeValue;
}
/**
......
//+======================================================================
// $Source: /cvsroot/tango-cs/tango/api/java/fr/soleil/TangoSnapshoting/SnapshotingTools/Tools/Condition.java,v $
//
// Project: Tango Archiving Service
//
// Description: Java source code for the class Condition.
// (Garda Laure) - 1 juil. 2005
//
// $Author: chinkumo $
//
// $Revision: 1.3 $
//
// $Log: Condition.java,v $
// Revision 1.3 2005/11/29 17:11:17 chinkumo
// no message
//
// Revision 1.2.2.1 2005/11/15 13:34:38 chinkumo
// no message
//
// Revision 1.2 2005/08/19 14:48:37 chinkumo
// no message
//
// Revision 1.1.4.3 2005/08/02 07:18:41 chinkumo
// Comments added.
//
// Revision 1.1.4.2 2005/08/01 13:51:48 chinkumo
// Classes added for the support of the new graphical application (Bensikin).
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
// 91192 GIF-sur-YVETTE CEDEX
//
//-======================================================================
package fr.soleil.archiving.snap.api.tools;
import fr.esrf.Tango.ErrSeverity;
/**
* Description : A Condition object describes a search criterion for a request
* into the database. A Condition contains : a name of a table's field an
* operator a value.
*
* @author GARDA
*/
public class Condition {
private String column; // Name of the table's field.
private String operator; // Operator of the condition.
private String value; // Value of the condition.
/**
* This constructor takes three parameters as inputs.
*
* @param _column
* @param _operator
* @param _value
*/
public Condition(String _column, String _operator, String _value) {
this.column = _column;
this.operator = _operator;
this.value = _value;
}
/**
* Returns the name of the table's field.
*
* @return Name of the table's field
*/
public String getColumn() {
return column;
}
/**
* Sets the name of the table's field.
*
* @param column
* Name of the table's field
*/
public void setColumn(String column) {
this.column = column;
}
/**
* Returns the operator of the condition.
*
* @return Operator of the condition
*/
public String getOperator() {
return operator;
}
/**
* Sets the operator of the condition.
*
* @param operator
* Operator of the condition
*/
public void setOperator(String operator) {
this.operator = operator;
}
/**
* Returns the value of the condition.
*
* @return Value of the condition
*/
public String getValue() {
return value;
}
/**
* Sets the value of the condition.
*
* @param value
* Value of the condition
*/
public void setValue(String value) {
this.value = value;
}
/**
* Returns the predicat of the SQL request for this condition.
*
* @return Predicat of the SQL request for this condition
* @throws SnapshotingException
*/
public String getPredicat() throws SnapshotingException {
String predicat = "";
// Casts the Condition's operator and value in a SQL predicat.
if (getOperator().equals(SnapConst.OP_EQUALS)) {
predicat = " = '" + getValue() + "'";
} else if (getOperator().equals(SnapConst.OP_LOWER_THAN_STRICT)) {
predicat = " < '" + getValue() + "'";
} else if (getOperator().equals(SnapConst.OP_LOWER_THAN)) {
predicat = " <= '" + getValue() + "'";
} else if (getOperator().equals(SnapConst.OP_GREATER_THAN_STRICT)) {
predicat = " > '" + getValue() + "'";
} else if (getOperator().equals(SnapConst.OP_GREATER_THAN)) {
predicat = " >= '" + getValue() + "'";
} else if (getOperator().equals(SnapConst.OP_CONTAINS)) {
predicat = " LIKE '%" + getValue() + "%'";
} else if (getOperator().equals(SnapConst.OP_STARTS_WITH)) {
predicat = " LIKE '" + getValue() + "%'";
} else if (getOperator().equals(SnapConst.OP_ENDS_WITH)) {
predicat = " LIKE '%" + getValue() + "'";
} else {
String message = "";
message = SnapConst.ERROR_SQL_OPERATOR;
String reason = SnapConst.ERROR_SQL_OPERATOR;
String desc = "Failed while executing DataBaseApi.getPredicat() method...";
throw new SnapshotingException(message, reason, ErrSeverity.WARN,
desc, this.getClass().getName());
}
return predicat;
}
/**
* Returns the predicat of the SQL request for this condition in the case of
* an integer value.
*
* @return Predicat of the SQL request for this condition in the case of an
* integer value
* @throws SnapshotingException
*/
public String getPredicatInt() throws SnapshotingException {
String predicat = "";
// Casts the Condition's operator and value in a SQL predicat.
if (getOperator().equals(SnapConst.OP_EQUALS)) {
predicat = " = ?";
} else if (getOperator().equals(SnapConst.OP_LOWER_THAN_STRICT)) {
predicat = " < ?";
} else if (getOperator().equals(SnapConst.OP_LOWER_THAN)) {
predicat = " <= ?";
} else if (getOperator().equals(SnapConst.OP_GREATER_THAN_STRICT)) {
predicat = " > ?";
} else if (getOperator().equals(SnapConst.OP_GREATER_THAN)) {
predicat = " >= ?";
}
/*
* else if(getOperator().equals(ISnapManager.OP_CONTAINS)) { predicat =
* " LIKE '%" + getValue() + "%'"; } else
* if(getOperator().equals(ISnapManager.OP_STARTS_WITH)) { predicat =
* " LIKE '" + getValue() + "%'"; } else
* if(getOperator().equals(ISnapManager.OP_ENDS_WITH)) { predicat =
* " LIKE '%" + getValue() + "'"; }
*/
else {
String message = "";
message = SnapConst.ERROR_SQL_OPERATOR;
String reason = SnapConst.ERROR_SQL_OPERATOR;
String desc = "Failed while executing DataBaseApi.getPredicatInt() method...";
throw new SnapshotingException(message, reason, ErrSeverity.WARN,
desc, this.getClass().getName());
}
return predicat;
}
/**
* Returns the predicat of the SQL request for this condition in the case of
* the full name of an attribute.
*
* @return Predicat of the SQL request for this condition in the case of the
* full name of an attribute
* @throws SnapshotingException
*/
public String getPredicatFullName() throws SnapshotingException {
String predicat = "";
// Casts the Condition's operator and value in a SQL predicat.
if (getValue().equals("*")) {
predicat = "";
} else if (getValue().startsWith("*") && getValue().endsWith("*")) {
predicat = " LIKE '%"
+ getValue().substring(1, getValue().length() - 1) + "%'";
} else if (getValue().endsWith("*")) {
predicat = " LIKE '"
+ getValue().substring(0, getValue().length() - 1) + "%'";
} else if (getValue().startsWith("*")) {
predicat = " LIKE '%" + getValue().substring(1) + "'";
} else if (!getValue().equals("")) {
predicat = " = '" + getValue() + "'";
} else {
String message = "";
message = SnapConst.ERROR_SQL_OPERATOR;
String reason = SnapConst.ERROR_SQL_OPERATOR;
String desc = "Failed while executing DataBaseApi.getPredicatFullName() method...";
throw new SnapshotingException(message, reason, ErrSeverity.WARN,
desc, this.getClass().getName());
}
return predicat;
}
/**
* Returns a String which represente the object Condition.
*
* @return String which represente the object Condition
*/
public String toString() {
String condition_str = "";
condition_str = getColumn() + " " + getOperator() + " " + getValue()
+ "\r\n";
return condition_str;
}
}
//+======================================================================
// $Source: /cvsroot/tango-cs/tango/api/java/fr/soleil/TangoSnapshoting/SnapshotingTools/Tools/Criterions.java,v $
//
// Project: Tango Archiving Service
//
// Description: Java source code for the class Criterions.
// (Garda Laure) - 1 juil. 2005
//
// $Author: ounsy $
//
// $Revision: 1.8 $
//
// $Log: Criterions.java,v $
// Revision 1.8 2006/05/30 13:00:40 ounsy
// small bug correction
//
// Revision 1.7 2006/05/16 13:04:19 ounsy
// added a getConditionsHT() method
//
// Revision 1.6 2006/05/04 14:34:12 ounsy
// minor changes
//
// Revision 1.5 2006/03/14 12:36:47 ounsy
// removed useless logs
//
// Revision 1.4 2006/02/17 09:32:35 chinkumo
// Since the structure and the name of some SNAPSHOT database's table changed, this was reported here.
//
// Revision 1.3 2005/11/29 17:11:17 chinkumo
// no message
//
// Revision 1.2.2.1 2005/11/15 13:34:38 chinkumo
// no message
//
// Revision 1.2 2005/08/19 14:48:37 chinkumo
// no message
//
// Revision 1.1.4.3 2005/08/02 07:18:41 chinkumo
// Comments added.
//
// Revision 1.1.4.2 2005/08/01 13:51:49 chinkumo
// Classes added for the support of the new graphical application (Bensikin).
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
// 91192 GIF-sur-YVETTE CEDEX
//
//-======================================================================
package fr.soleil.archiving.snap.api.tools;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import fr.esrf.Tango.ErrSeverity;
/**
* Description : A Criterion object describes a set of search criteria for a
* request into the database A Criterion contains : a set of Condition objects.
*
* @author GARDA
*/
public class Criterions {
private Map<String, List<Condition>> conditionsHT; // set of Condition
// objects
/**
* Default constructor.
*/
public Criterions() {
conditionsHT = new ConcurrentHashMap<String, List<Condition>>();
}
/**
* This constructor takes one parameter as inputs.
*
* @param conditions
* a set of Conditions
*/
public Criterions(Condition[] conditions) {
conditionsHT = new ConcurrentHashMap<String, List<Condition>>();
// Sets the Conditions into the Criterion.
if (conditions != null) {
int nbOfConditions = conditions.length;
for (int i = 0; i < nbOfConditions; i++) {
List<Condition> currentColumnConditionsList;
String columnName = conditions[i].getColumn();
// The Conditions are referenced by their table's field
// (columnName).
if (conditionsHT.containsKey(columnName)) {
currentColumnConditionsList = conditionsHT.get(columnName);
} else {
currentColumnConditionsList = new ArrayList<Condition>();
conditionsHT.put(columnName, currentColumnConditionsList);
}
currentColumnConditionsList.add(conditions[i]);
}
}
}
/**
* Adds a Condition into the Criterion.
*
* @param condition
* A Condition
*/
public void addCondition(Condition condition) {
if (condition != null) {
String columnName = condition.getColumn();
List<Condition> currentColumnConditionsList;
if (!conditionsHT.containsKey(columnName)) {
currentColumnConditionsList = new ArrayList<Condition>();
conditionsHT.put(columnName, currentColumnConditionsList);
} else {
currentColumnConditionsList = conditionsHT.get(columnName);
}
currentColumnConditionsList.add(condition);
}
}
/**
* Returns array of all Condition objects (of this Criterion) for the given
* table's field
*
* @param columnName
* @return array of all Condition objects for the given table's field
*/
public Condition[] getConditions(String columnName) {
Condition[] ret = null;
if ((columnName != null) && (conditionsHT != null)) {
List<Condition> columnConditionsList = conditionsHT.get(columnName);
if (columnConditionsList != null) {
ret = columnConditionsList.toArray(new Condition[columnConditionsList.size()]);
}
}
return ret;
}
/**
* Returns the SQL clause describes by the Criterion in the case of a field
* of the ContextTable.
*
* @return SQL clause describes by the Criterion in the case of a field of
* the ContextTable
* @throws SnapshotingException
*/
public String getContextClause() throws SnapshotingException {
String clause = "";
String table = SnapConst.CONTEXT;
String[] field = SnapConst.TAB_CONTEXT;
int count = 0;
// Cas de l'ID_context.
Condition[] conditions = getConditions(field[0]);
if (conditions != null) {
// Une seule condition sur l'id_context.
if (conditions.length == 1) {
// Mise en forme du predicat de la requete SQL.
String predicat = conditions[0].getPredicatInt();
// Mise en forme de la requete SQL.
if (count == 0) {
clause = clause + " WHERE " + table + "." + field[0] + predicat;
count++;
} else {
clause = clause + " AND " + table + "." + field[0] + predicat;
}
} else {
String message = "";
message = SnapConst.ERROR_SQL_OPERATOR;
String reason = SnapConst.ERROR_SQL_OPERATOR;
String desc = "Failed while executing Criterions.getSnapshotClause() method...";
throw new SnapshotingException(message, reason, ErrSeverity.WARN, desc, this.getClass().getName());
}
}
// Pour les autres champs.
for (int i = 1; i < field.length; i++) // Parcours de tous les champs de
// la table des contextes, sauf
// l'ID_context.
{
conditions = getConditions(field[i]);
if (conditions != null) {
for (int j = 0; j < conditions.length; j++) {
// Mise en forme du predicat de la requete SQL.
String predicat = conditions[j].getPredicat();
// Mise en forme de la requete SQL.
if (count == 0) {
clause = clause + " WHERE " + table + "." + field[i] + predicat;
count++;
} else {
clause = clause + " AND " + table + "." + field[i] + predicat;
}
}
}
}
return clause;
}
/**
* Returns the SQL clause describes by the Criterion in the case of a field
* of the SnapshotTable.
*
* @return SQL clause describes by the Criterion in the case of a field of
* the SnashotTable
* @throws SnapshotingException
*/
public String getSnapshotClause() throws SnapshotingException {
String clause = "";
String table = SnapConst.SNAPSHOT;
String[] field = SnapConst.TAB_SNAP;
int count = 0;
// Cas de l'id_snap.
Condition[] conditions = getConditions(field[0]);
if (conditions != null) {
if (conditions.length == 1) {
// Mise en forme du predicat de la requete SQL.
String predicat = conditions[0].getPredicatInt();
// Mise en forme de la requete SQL.
if (count == 0) {
clause = clause + " WHERE " + table + "." + field[0] + predicat;
count++;
} else {
clause = clause + " AND " + table + "." + field[0] + predicat;
}
} else {
String message = "";
message = SnapConst.ERROR_SQL_OPERATOR;
String reason = SnapConst.ERROR_SQL_OPERATOR;
String desc = "Failed while executing Criterions.getSnapshotClause() method...";
throw new SnapshotingException(message, reason, ErrSeverity.WARN, desc, this.getClass().getName());
}
}
// Cas de l'ID_context.
conditions = getConditions(field[1]);
if (conditions != null) {
// Une seule condition sur l'id_context.
if (conditions.length == 1) {
// Mise en forme du predicat de la requete SQL.
String predicat = conditions[0].getPredicatInt();
// Mise en forme de la requete SQL.
if (count == 0) {
clause = clause + " WHERE " + table + "." + field[1] + predicat;
count++;
} else {
clause = clause + " AND " + table + "." + field[1] + predicat;
}
} else {
String message = "";
message = SnapConst.ERROR_SQL_OPERATOR;
String reason = SnapConst.ERROR_SQL_OPERATOR;
String desc = "Failed while executing Criterions.getSnapshotClause() method...";
throw new SnapshotingException(message, reason, ErrSeverity.WARN, desc, this.getClass().getName());
}
}
for (int i = 2; i < field.length; i++) // Parcours de tous les champs de
// la table des contextes.
{
conditions = getConditions(field[i]);
if (conditions != null) {
for (int j = 0; j < conditions.length; j++) {
// Mise en forme du predicat de la requete SQL.
String predicat = conditions[j].getPredicat();
// Mise en forme de la requete SQL.
if (count == 0) {
clause = clause + " WHERE " + table + "." + field[i] + predicat;
count++;
} else {
clause = clause + " AND " + table + "." + field[i] + predicat;
}
}
}
}
return clause;
}
/**
* Returns the id of a context of the SnapTable.
*
* @return id of a context of the SnapTable
* @throws SnapshotingException
*/
public int getIdContextSnapTable() throws SnapshotingException {
int id_context = -1; // value if no condition on this id.
Condition[] id_condition = getConditions(SnapConst.TAB_SNAP[1]);
if (id_condition != null) {
id_context = Integer.parseInt(id_condition[0].getValue());
}
return id_context;
}
/**
* Returns the id of a context.
*
* @return the id of a context
* @throws SnapshotingException
*/
public int getIdContextContextTable() throws SnapshotingException {
int id_context = -1; // value if no condition on this id.
Condition[] id_condition = getConditions(SnapConst.ID_CONTEXT);
if (id_condition != null) {
id_context = Integer.parseInt(id_condition[0].getValue());
}
return id_context;
}
/**
* Returns the id of a snapshot.
*
* @return the id of a snapshot
* @throws SnapshotingException
*/
public int getIdSnap() throws SnapshotingException {
int id_snap = -1; // value if no condition on this id.
Condition[] id_condition = getConditions(SnapConst.ID_SNAP);
if (id_condition != null) {
id_snap = Integer.parseInt(id_condition[0].getValue());
}
return id_snap;
}
/**
* Returns the SQL clause describes by the Criterion in the case of a field
* of the AttribteTable.
*
* @return SQL clause describes by the Criterion in the case of a field of
* the AttributeTable
* @throws SnapshotingException
*/
public String getAttributeClause() throws SnapshotingException {
String clause = "";
String table = SnapConst.AST;
String[] field = SnapConst.TAB_DEF;
int count = 0;
for (int i = 4; i < 8; i++) // Parcours des champs de la table des
// definitions.
{
Condition[] conditions = getConditions(field[i]);
if (conditions != null) {
for (int j = 0; j < conditions.length; j++) {
// Mise en forme du predicat de la requete SQL.
String predicat = conditions[j].getPredicatFullName();
// Mise en forme de la requete SQL.
if (!predicat.equals("")) {
if (count == 0) {
clause = clause + " WHERE " + table + "." + field[i] + predicat;
count++;
} else {
clause = clause + " AND " + table + "." + field[i] + predicat;
}
}
}
}
}
return clause;
}
/**
* Returns a String which represente the object Criterion.
*
* @return String which represente the object Criterion
*/
@Override
public String toString() {
String criterions_str = "";
if (conditionsHT.isEmpty()) {
criterions_str = null;
} else {
for (List<Condition> columnConditionsList : conditionsHT.values()) {
for (Condition nextCondition : columnConditionsList) {
criterions_str = criterions_str + nextCondition.toString();
}
}
}
return criterions_str;
}
public Map<String, List<Condition>> getConditionsHT() {
return this.conditionsHT;
}
}
//+======================================================================
// $Source: /cvsroot/tango-cs/tango/api/java/fr/soleil/TangoSnapshoting/SnapshotingTools/Tools/SnapAttribute.java,v $
//
// Project: Tango Archiving Service
//
// Description: Java source code for the class SnapAttribute.
// (Chinkumo Jean) - Mar 24, 2004
//
// $Author: ounsy $
//
// $Revision: 1.3 $
//
// $Log: SnapAttribute.java,v $
// Revision 1.3 2006/02/15 09:06:05 ounsy
// minor changes
//
// Revision 1.2 2005/11/29 17:11:17 chinkumo
// no message
//
// Revision 1.1.16.1 2005/11/15 13:34:38 chinkumo
// no message
//
// Revision 1.1 2005/01/26 15:35:37 chinkumo
// Ultimate synchronization before real sharing.
//
// Revision 1.1 2004/12/06 17:39:56 chinkumo
// First commit (new API architecture).
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
// 91192 GIF-sur-YVETTE CEDEX
//
//-======================================================================
package fr.soleil.archiving.snap.api.tools;
import java.sql.Timestamp;
import fr.soleil.lib.project.ObjectUtils;
/**
* A snapshot attribute.
*
* @author ounsy
*/
public class SnapAttribute {
private String attributeCompleteName = "";
private String attributeCompleteName = ObjectUtils.EMPTY_STRING;
protected int dataFormat;
protected int dataType;
protected int writable;
......
......@@ -33,16 +33,21 @@
package fr.soleil.archiving.snap.api.tools;
import fr.soleil.archiving.common.api.tools.AttributeLight;
import fr.soleil.lib.project.ObjectUtils;
/**
* SnapAttributeMedium
*
* @author chinkumo
*/
public class SnapAttributeMedium extends AttributeLight {
private int id_snap = -1; // Identifier for this snapshot
private java.sql.Timestamp snap_date = null; // Timestamp asociated to this
// snapshot
public SnapAttributeMedium(String attribute_complete_name, int data_type,
int data_format, int writable, int id_context, int id_snap,
java.sql.Timestamp snap_date) {
public SnapAttributeMedium(String attribute_complete_name, int data_type, int data_format, int writable,
int id_context, int id_snap, java.sql.Timestamp snap_date) {
setAttributeCompleteName(attribute_complete_name);
setDataType(data_type);
setDataFormat(data_format);
......@@ -52,10 +57,9 @@ public class SnapAttributeMedium extends AttributeLight {
this.snap_date = snap_date;
}
public SnapAttributeMedium(AttributeLight snapAttributeLight,
int id_context, int id_snap, java.sql.Timestamp snap_date) {
setAttributeCompleteName(snapAttributeLight
.getAttributeCompleteName());
public SnapAttributeMedium(AttributeLight snapAttributeLight, int id_context, int id_snap,
java.sql.Timestamp snap_date) {
setAttributeCompleteName(snapAttributeLight.getAttributeCompleteName());
setAttributeId(snapAttributeLight.getAttributeId());
setDataType(snapAttributeLight.getDataType());
setDataFormat(snapAttributeLight.getDataFormat());
......@@ -81,6 +85,7 @@ public class SnapAttributeMedium extends AttributeLight {
this.snap_date = snap_date;
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
......@@ -99,8 +104,7 @@ public class SnapAttributeMedium extends AttributeLight {
return false;
if (getWritable() != snapAttributeMedium.getWritable())
return false;
if (!getAttributeCompleteName().equals(
snapAttributeMedium.getAttributeCompleteName()))
if (!getAttributeCompleteName().equals(snapAttributeMedium.getAttributeCompleteName()))
return false;
if (!snap_date.equals(snapAttributeMedium.snap_date))
return false;
......@@ -108,6 +112,7 @@ public class SnapAttributeMedium extends AttributeLight {
return true;
}
@Override
public int hashCode() {
int result;
result = getAttributeCompleteName().hashCode();
......@@ -117,15 +122,13 @@ public class SnapAttributeMedium extends AttributeLight {
return result;
}
@Override
public String toString() {
String snapString = new String("");
snapString = "Attribut : " + getAttributeCompleteName() + "\r\n"
+ "\t" + "Attribute Id : \t" + getAttributeId() + "\r\n"
+ "\t" + "data_type : \t" + getDataType() + "\r\n" + "\t"
+ "data_format : \t" + getDataFormat() + "\r\n" + "\t"
+ "writable : \t" + getWritable() + "\r\n" + "\t"
+ "Snapshot Id : \t" + id_snap + "\r\n" + "\t"
+ "SnapShot time : \t" + snap_date.toString() + "\r\n";
String snapString = ObjectUtils.EMPTY_STRING;
snapString = "Attribut : " + getAttributeCompleteName() + "\r\n" + "\t" + "Attribute Id : \t" + getAttributeId()
+ "\r\n" + "\t" + "data_type : \t" + getDataType() + "\r\n" + "\t" + "data_format : \t"
+ getDataFormat() + "\r\n" + "\t" + "writable : \t" + getWritable() + "\r\n" + "\t" + "Snapshot Id : \t"
+ id_snap + "\r\n" + "\t" + "SnapShot time : \t" + snap_date.toString() + "\r\n";
return snapString;
}
......
//+======================================================================
// $Source: /cvsroot/tango-cs/tango/api/java/fr/soleil/TangoSnapshoting/SnapshotingTools/Tools/SnapShotLight.java,v $
//
// Project: Tango Archiving Service
//
// Description: Java source code for the class SnapShotLight.
// (Chinkumo Jean) - Nov 11, 2004
//
// $Author: chinkumo $
//
// $Revision: 1.2 $
//
// $Log: SnapShotLight.java,v $
// Revision 1.2 2005/11/29 17:11:17 chinkumo
// no message
//
// Revision 1.1.16.1 2005/11/15 13:34:38 chinkumo
// no message
//
// Revision 1.1 2005/01/26 15:35:37 chinkumo
// Ultimate synchronization before real sharing.
//
// Revision 1.1 2004/12/06 17:39:56 chinkumo
// First commit (new API architecture).
//
//
// copyleft : Synchrotron SOLEIL
// L'Orme des Merisiers
// Saint-Aubin - BP 48
// 91192 GIF-sur-YVETTE CEDEX
//
//-======================================================================
package fr.soleil.archiving.snap.api.tools;
import fr.soleil.lib.project.ObjectUtils;
/**
* SnapshotLight
*
* @author chinkumo
*/
public class SnapshotLight {
private int id_snap = -1; // Identifier for this snapshot
private java.sql.Timestamp snap_date = null; // Timestamp asociated to this
// snapshot
private String comment = "";
private String comment = ObjectUtils.EMPTY_STRING;
public SnapshotLight() {
}
public SnapshotLight(int id_snap, java.sql.Timestamp snap_date,
String comment) {
public SnapshotLight(int id_snap, java.sql.Timestamp snap_date, String comment) {
this.id_snap = id_snap;
this.snap_date = snap_date;
this.comment = comment;
......@@ -87,9 +61,10 @@ public class SnapshotLight {
return snapShot;
}
@Override
public String toString() {
String snapL = "Identifier : " + id_snap + "\r\n" + "Record time : "
+ snap_date + "\r\n" + "Comment : " + comment;
String snapL = "Identifier : " + id_snap + "\r\n" + "Record time : " + snap_date + "\r\n" + "Comment : "
+ comment;
return snapL;
}
}