Skip to content

Commit

Permalink
ftp: Removed uses of FTPTransactionLog class
Browse files Browse the repository at this point in the history
Motivation:
Historical FTPTransactionLog class not needed anymore.

Modification:
Removed uses of FTPTransactionLog class and deleted method
createTransactionLog()

Result:
FTP TransactionLog class no longer used in AbstractFtpDoorV1

Fixes: #gh-issue
Ticket: #rt-number
Acked-by:
Target: master
Require-book: yes
Require-notes: yes
  • Loading branch information
HWittlich committed Feb 28, 2018
1 parent eb3159a commit b477cf4
Showing 1 changed file with 1 addition and 29 deletions.
Expand Up @@ -137,7 +137,6 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import diskCacheV111.doors.FTPTransactionLog;
import diskCacheV111.doors.LineBasedInterpreter;
import diskCacheV111.services.space.Space;
import diskCacheV111.util.CacheException;
Expand Down Expand Up @@ -936,7 +935,6 @@ protected class FtpTransfer extends AsynchronousRedirectedTransfer<GFtpTransferS
private long _offset;
private long _size;

protected FTPTransactionLog _tLog;

/**
* Socket adapter used for the transfer.
Expand Down Expand Up @@ -1124,24 +1122,7 @@ protected synchronized ProtocolInfo getProtocolInfoForPool()
}

public void createTransactionLog()
{
String tlogRoot = _settings.getTlogRoot();
if (tlogRoot != null) {
LOGGER.info("Door will log ftp transactions to {}", tlogRoot);
_tLog = new FTPTransactionLog(tlogRoot);

if (_subject != null) {
try {
String user = AbstractFtpDoorV1.this.getUserName() + "(" +
Subjects.getUid(_subject) + "." +
Subjects.getPrimaryGid(_subject) + ")";
_tLog.begin(user, _tlogName, isWrite() ? "write" : "read",
_path.toString(), _remoteSocketAddress.getAddress());
} catch (NoSuchElementException | IllegalArgumentException e) {
LOGGER.error("Could not start tLog: {}", e.getMessage());
}
}
}
{ LOGGER.info("FTPTransactionLog: Function createTransactionLog no longer used.");
}

public void abort(int replyCode, String msg)
Expand Down Expand Up @@ -1250,11 +1231,6 @@ protected void onFinish() throws FTPCommandException
if (_perfMarkerTask != null) {
_perfMarkerTask.stop((GFtpProtocolInfo) getProtocolInfo());
}
if (_tLog != null) {
_tLog.middle(getFileAttributes().getSize());
_tLog.success();
_tLog = null;
}
}

notifyBilling(0, "");
Expand Down Expand Up @@ -1325,10 +1301,6 @@ protected synchronized void onFailure(Throwable t)

String msg = String.valueOf(replyCode) + " " + replyMsg;
notifyBilling(replyCode, replyMsg);
if (_tLog != null) {
_tLog.error(msg);
_tLog = null;
}
LOGGER.error("Transfer error: {}", msg);
if (!(t instanceof FTPCommandException)) {
LOGGER.debug(t.toString(), t);
Expand Down

0 comments on commit b477cf4

Please sign in to comment.