clean code
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/content-management/storage-manager-trigger@94901 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4e6de3a90d
commit
3febcf534f
|
@ -1,15 +0,0 @@
|
|||
log4j.rootLogger=INFO, A1, stdout
|
||||
log4j.appender.A1=org.apache.log4j.RollingFileAppender
|
||||
log4j.appender.A1.File=mongoTrigger.log
|
||||
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
|
||||
# ***** Max file size is set to 100KB
|
||||
log4j.appender.A1.MaxFileSize=10MB
|
||||
# ***** Keep one backup file
|
||||
log4j.appender.A1.MaxBackupIndex=1
|
||||
|
||||
#CONSOLE
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Threshold=INFO
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=[%t] %-5p %c %d{dd MMM yyyy ;HH:mm:ss.SSS} - %m%n
|
|
@ -4,9 +4,6 @@ package org.gcube.contentmanager.storageserver.data;
|
|||
import java.net.UnknownHostException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.management.RuntimeErrorException;
|
||||
|
||||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.Bytes;
|
||||
import com.mongodb.DB;
|
||||
|
@ -14,10 +11,8 @@ import com.mongodb.DBCollection;
|
|||
import com.mongodb.DBCursor;
|
||||
import com.mongodb.DBObject;
|
||||
import com.mongodb.Mongo;
|
||||
//import com.mongodb.MongoClient;
|
||||
import com.mongodb.ServerAddress;
|
||||
import org.bson.types.BSONTimestamp;
|
||||
import org.gcube.contentmanager.storageserver.parse.JsonParser;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
|
|
@ -120,42 +120,10 @@ public class JsonParser extends Thread{
|
|||
String creationTime, String id, long length,
|
||||
String scope, String operation, String callerIP, String lastAccess, String lastUser) {
|
||||
report.start(lastUser, scope, creationTime);
|
||||
// report.timeUpdate();
|
||||
report.ultimate(owner, operation, length+"", filename, id, callerIP, lastAccess);
|
||||
report.send();
|
||||
}
|
||||
|
||||
// private String mappingOperationField(String op, String id, String onDeleting, String lastRead) throws ParseException {
|
||||
// logger.info("delete field: "+onDeleting);
|
||||
// if(op.equals("u")){
|
||||
// if((onDeleting != null) && (onDeleting.equals("true"))){
|
||||
// logger.info("found delete field");
|
||||
// return "DELETE";
|
||||
// }else if(lastRead !=null){
|
||||
// SimpleDateFormat sdf = new SimpleDateFormat("dd MM yyyy 'at' hh:mm:ss z");
|
||||
// Date dateLastRead = sdf.parse(lastRead);
|
||||
// Calendar now=Calendar.getInstance();
|
||||
// logger.info("now: "+sdf.format(now.getTime()));
|
||||
// now.add(Calendar.MINUTE, MINUTE_DECREMENT);
|
||||
// logger.info("now decreased -5 min: "+sdf.format(now.getTime()));
|
||||
// logger.info("lastRead is "+sdf.format(dateLastRead)+" now,5 min decreased is"+sdf.format(now.getTime()));
|
||||
// if(now.getTime().compareTo(dateLastRead) < 0){
|
||||
// logger.info("It is a read");
|
||||
// return "READ";
|
||||
// }else{
|
||||
// logger.info("It isn't a read");
|
||||
// return "UPDATE";
|
||||
// }
|
||||
//
|
||||
// }else
|
||||
// return "UPDATE";
|
||||
// }else if(op.equals("i")){
|
||||
// return "INSERT";
|
||||
// }else if(op.equals("d")){
|
||||
// return "DELETE";
|
||||
// }
|
||||
// return op;
|
||||
// }
|
||||
|
||||
private String retrieveScopeFromRemoteFilePath(String filename) {
|
||||
String[] split=filename.split("/");
|
||||
|
|
Loading…
Reference in New Issue