All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.tentackle.dbms.rmi.ModificationLogRemoteDelegateImpl Maven / Gradle / Ivy

There is a newer version: 21.16.1.0
Show newest version
/*
 * Tentackle - https://tentackle.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package org.tentackle.dbms.rmi;

import org.tentackle.common.Timestamp;
import org.tentackle.dbms.ModificationLog;
import org.tentackle.dbms.ModificationType;

import java.rmi.RemoteException;
import java.text.ParseException;
import java.util.List;

/**
 * Remote delegate implementation  for {@link ModificationLog}.
 *
 * @author  harald
 */
public class ModificationLogRemoteDelegateImpl
             extends AbstractDbObjectRemoteDelegateImpl
             implements ModificationLogRemoteDelegate {


  public ModificationLogRemoteDelegateImpl(RemoteDbSessionImpl session, Class clazz) {
    super(session, clazz);
  }


  @Override
  public void updateProcessed(Timestamp processed, ModificationLog obj) throws RemoteException {
    try {
      obj.setSession(getSession());
      obj.updateProcessed(processed);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public void updateDiagnostics(Timestamp processed, String comment, ModificationLog obj) throws RemoteException {
    try {
      obj.setSession(getSession());
      obj.updateDiagnostics(processed, comment);
    }
    catch (RuntimeException | ParseException e) {
      throw createException(e);
    }
  }


  // @wurblet inclrmi Include --missingok .$classname/methods

  ////GEN-BEGIN:inclrmi


  @Override
  public ModificationLog selectFirstUnprocessed() throws RemoteException {
    try {
      return newInstance().selectFirstUnprocessed();
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public ModificationLog selectFirstUnprocessedGreater(long id) throws RemoteException {
    try {
      return newInstance().selectFirstUnprocessedGreater(id);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public ModificationLog selectGreaterId(long id) throws RemoteException {
    try {
      return newInstance().selectGreaterId(id);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public ModificationLog selectLastProcessed() throws RemoteException {
    try {
      return newInstance().selectLastProcessed();
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public List selectByObject(int objectClassId, long objectId) throws RemoteException {
    try {
      return dbObject.selectByObject(objectClassId, objectId);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public List selectByUserAndType(long userId, ModificationType modType) throws RemoteException {
    try {
      return dbObject.selectByUserAndType(userId, modType);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public boolean isReferencingUser(long userId) throws RemoteException {
    try {
      return dbObject.isReferencingUser(userId);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public boolean isReferencingObject(int objectClassId, long objectId) throws RemoteException {
    try {
      return dbObject.isReferencingObject(objectClassId, objectId);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public int updateByObjectTypeSerial(Timestamp processed, int objectClassId, long objectId, ModificationType modType, long serial) throws RemoteException {
    try {
      return dbObject.updateByObjectTypeSerial(processed, objectClassId, objectId, modType, serial);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public int deleteByObjectTypeSerial(int objectClassId, long objectId, ModificationType modType, long serial) throws RemoteException {
    try {
      return dbObject.deleteByObjectTypeSerial(objectClassId, objectId, modType, serial);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public List selectByTxId(long txId) throws RemoteException {
    try {
      return dbObject.selectByTxId(txId);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public int updateUnprocessedByTxId(Timestamp processed, long txId) throws RemoteException {
    try {
      return dbObject.updateUnprocessedByTxId(processed, txId);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public int deleteByTxId(long txId) throws RemoteException {
    try {
      return dbObject.deleteByTxId(txId);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public int deleteProcessed(Timestamp processed) throws RemoteException {
    try {
      return dbObject.deleteProcessed(processed);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public List selectUpTo(Timestamp processed) throws RemoteException {
    try {
      return dbObject.selectUpTo(processed);
    }
    catch (RuntimeException e) {
      throw createException(e);
    }
  }

  @Override
  public List selectTxIds(long fromId, long upToId) throws RemoteException {
    try {
      return dbObject.selectTxIds(fromId, upToId);
    }
    catch (Exception e) {
      throw createException(e);
    }
  }

  ////GEN-END:inclrmi

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy