Skip to content
Snippets Groups Projects
Verified Commit 4e32b1c8 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

deleted obsolete classes

parent 8f5ba400
No related branches found
No related tags found
No related merge requests found
...@@ -59,7 +59,6 @@ import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveProp ...@@ -59,7 +59,6 @@ import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveProp
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveQueryTemplateDefinition; import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveQueryTemplateDefinition;
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveRole; import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveRole;
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveSparseEntity; import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveSparseEntity;
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveTransactionHistory;
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveUser; import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveUser;
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveVersionHistory; import org.caosdb.server.database.backend.implementation.MySQL.MySQLRetrieveVersionHistory;
import org.caosdb.server.database.backend.implementation.MySQL.MySQLRuleLoader; import org.caosdb.server.database.backend.implementation.MySQL.MySQLRuleLoader;
...@@ -116,7 +115,6 @@ import org.caosdb.server.database.backend.interfaces.RetrievePropertiesImpl; ...@@ -116,7 +115,6 @@ import org.caosdb.server.database.backend.interfaces.RetrievePropertiesImpl;
import org.caosdb.server.database.backend.interfaces.RetrieveQueryTemplateDefinitionImpl; import org.caosdb.server.database.backend.interfaces.RetrieveQueryTemplateDefinitionImpl;
import org.caosdb.server.database.backend.interfaces.RetrieveRoleImpl; import org.caosdb.server.database.backend.interfaces.RetrieveRoleImpl;
import org.caosdb.server.database.backend.interfaces.RetrieveSparseEntityImpl; import org.caosdb.server.database.backend.interfaces.RetrieveSparseEntityImpl;
import org.caosdb.server.database.backend.interfaces.RetrieveTransactionHistoryImpl;
import org.caosdb.server.database.backend.interfaces.RetrieveUserImpl; import org.caosdb.server.database.backend.interfaces.RetrieveUserImpl;
import org.caosdb.server.database.backend.interfaces.RetrieveVersionHistoryImpl; import org.caosdb.server.database.backend.interfaces.RetrieveVersionHistoryImpl;
import org.caosdb.server.database.backend.interfaces.RuleLoaderImpl; import org.caosdb.server.database.backend.interfaces.RuleLoaderImpl;
...@@ -177,7 +175,6 @@ public abstract class BackendTransaction implements Undoable { ...@@ -177,7 +175,6 @@ public abstract class BackendTransaction implements Undoable {
setImpl(RetrieveAllImpl.class, MySQLRetrieveAll.class); setImpl(RetrieveAllImpl.class, MySQLRetrieveAll.class);
setImpl(RegisterSubDomainImpl.class, MySQLRegisterSubDomain.class); setImpl(RegisterSubDomainImpl.class, MySQLRegisterSubDomain.class);
setImpl(RetrieveDatatypesImpl.class, MySQLRetrieveDatatypes.class); setImpl(RetrieveDatatypesImpl.class, MySQLRetrieveDatatypes.class);
setImpl(RetrieveTransactionHistoryImpl.class, MySQLRetrieveTransactionHistory.class);
setImpl(RetrieveUserImpl.class, MySQLRetrieveUser.class); setImpl(RetrieveUserImpl.class, MySQLRetrieveUser.class);
setImpl(RetrieveParentsImpl.class, MySQLRetrieveParents.class); setImpl(RetrieveParentsImpl.class, MySQLRetrieveParents.class);
setImpl(GetFileRecordByPathImpl.class, MySQLGetFileRecordByPath.class); setImpl(GetFileRecordByPathImpl.class, MySQLGetFileRecordByPath.class);
......
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
package org.caosdb.server.database.backend.implementation.MySQL;
import static org.caosdb.server.database.DatabaseUtils.bytes2UTF8;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import org.caosdb.server.database.access.Access;
import org.caosdb.server.database.backend.interfaces.RetrieveTransactionHistoryImpl;
import org.caosdb.server.database.exceptions.TransactionException;
import org.caosdb.server.database.proto.ProtoTransactionLogMessage;
public class MySQLRetrieveTransactionHistory extends MySQLTransaction
implements RetrieveTransactionHistoryImpl {
public MySQLRetrieveTransactionHistory(final Access access) {
super(access);
}
public static final String STMT_RETRIEVE_HISTORY =
"SELECT transaction, realm, username, seconds, nanos FROM transaction_log WHERE entity_id=? ";
@Override
public ArrayList<ProtoTransactionLogMessage> execute(final Integer id)
throws TransactionException {
try {
final PreparedStatement stmt = prepareStatement(STMT_RETRIEVE_HISTORY);
final ArrayList<ProtoTransactionLogMessage> ret = new ArrayList<ProtoTransactionLogMessage>();
stmt.setInt(1, id);
final ResultSet rs = stmt.executeQuery();
try {
while (rs.next()) {
final String transaction = bytes2UTF8(rs.getBytes("transaction"));
final String realm = bytes2UTF8(rs.getBytes("realm"));
final String username = bytes2UTF8(rs.getBytes("username"));
final Integer seconds = rs.getInt("seconds");
final Integer nanos = rs.getInt("nanos");
ret.add(new ProtoTransactionLogMessage(transaction, realm, username, seconds, nanos));
}
return ret;
} finally {
rs.close();
}
} catch (final SQLException e) {
throw new TransactionException(e);
} catch (final ConnectionException e) {
throw new TransactionException(e);
}
}
}
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
package org.caosdb.server.database.backend.interfaces;
import java.util.ArrayList;
import org.caosdb.server.database.exceptions.TransactionException;
import org.caosdb.server.database.proto.ProtoTransactionLogMessage;
public interface RetrieveTransactionHistoryImpl extends BackendTransactionImpl {
public ArrayList<ProtoTransactionLogMessage> execute(Integer id) throws TransactionException;
}
/* /*
* ** header v3.0 This file is a part of the CaosDB Project. * ** header v3.0
* This file is a part of the CaosDB Project.
* *
* Copyright (C) 2020 IndiScale GmbH <info@indiscale.com> * Copyright (C) 2020 IndiScale GmbH <info@indiscale.com>
* Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com> * Copyright (C) 2020 Timm Fitschen <t.fitschen@indiscale.com>
* *
* This program is free software: you can redistribute it and/or modify it under the terms of the * This program is free software: you can redistribute it and/or modify
* GNU Affero General Public License as published by the Free Software Foundation, either version 3 * it under the terms of the GNU Affero General Public License as
* of the License, or (at your option) any later version. * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * This program is distributed in the hope that it will be useful,
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * but WITHOUT ANY WARRANTY; without even the implied warranty of
* Affero General Public License for more details. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License along with this program. * You should have received a copy of the GNU Affero General Public License
* If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
* *
* ** end header * ** end header
*/ */
......
/*
* ** header v3.0
* This file is a part of the CaosDB Project.
*
* Copyright (C) 2018 Research Group Biomedical Physics,
* Max-Planck-Institute for Dynamics and Self-Organization Göttingen
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* ** end header
*/
package org.caosdb.server.database.proto;
import java.io.Serializable;
public class ProtoTransactionLogMessage implements Serializable {
public ProtoTransactionLogMessage(
final String transaction,
final String realm,
final String username,
final long seconds,
final int nanos) {
this.transaction = transaction;
this.realm = realm;
this.username = username;
this.seconds = seconds;
this.nanos = nanos;
}
public ProtoTransactionLogMessage() {}
private static final long serialVersionUID = -5856887517281480754L;
public String transaction = null;
public String realm;
public String username = null;
public Long seconds = null;
public Integer nanos = null;
}
...@@ -33,9 +33,8 @@ import org.caosdb.server.utils.EntityStatus; ...@@ -33,9 +33,8 @@ import org.caosdb.server.utils.EntityStatus;
import org.caosdb.server.utils.ServerMessages; import org.caosdb.server.utils.ServerMessages;
/** /**
* Retrieves the complete version history of each entity and appends it to the * Retrieves the complete version history of each entity and appends it to the entity.
* entity. *
*
* @author Timm Fitschen (t.fitschen@indiscale.com) * @author Timm Fitschen (t.fitschen@indiscale.com)
*/ */
@JobAnnotation(time = JobExecutionTime.POST_TRANSACTION, flag = "H") @JobAnnotation(time = JobExecutionTime.POST_TRANSACTION, flag = "H")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment