\r
import java.text.SimpleDateFormat;\r
import java.util.Calendar;\r
-import java.util.Date;\r
import java.util.List;\r
\r
import org.apache.commons.lang.StringUtils;\r
\r
public class DeleteNEXIOMaterialsStep extends JobStep {\r
private static final Logger logger = LogManager.getLogger(DeleteNEXIOMaterialsStep.class);\r
- private static final String NEXIOCLIPS = "nexioclips";\r
+ //"nexioclips"\r
+ private static final String NEXIOCLIPS = SystemConfiguration.getInstance().value("services.nexio.collection-name");\r
private static final String KILLDATE = "killdate";\r
+ private static final String RECORDDATE = "recorddate";\r
private static final String LONGNAMEID = "longnameid";\r
private static final String EXTAGENCY = "extagency";\r
private static String NEXIO_HOST = SystemConfiguration.getInstance().value("services.nexio.host");\r
remoteFile = sourceUri.getRemoteFile(name);\r
if (remoteFile == null) {\r
logger.warn(jobRuntime.getSessionMarker(), "A '{}' fájl már nem található meg a NEXIO szerveren", name);\r
+ logger.warn(getMarker(), "A '{}' fájl már nem található meg a NEXIO szerveren", name);\r
return;\r
}\r
sourceUri.delete(remoteFile);\r
logger.info(jobRuntime.getSessionMarker(), "A '{}' fájl törlése sikeres volt.", name);\r
+ logger.info(getMarker(), "A '{}' fájl törlése sikeres volt.", name);\r
} catch (Exception e) {\r
- logger.error(jobRuntime.getSessionMarker(), "A '{}' fájl nem törölhető. A rendszer hibaüzenete: {}", name, e.getMessage());\r
+ logger.error(jobRuntime.getSessionMarker(), "A '{}' fájl nem törölhető. A rendszer hibaüzenete: {}", name,\r
+ e.getMessage());\r
+ logger.error(getMarker(), "A '{}' fájl nem törölhető. A rendszer hibaüzenete: {}", name, e.getMessage());\r
}\r
}\r
\r
@StepEntry\r
- public Object[] execute(int port, String userName, String password, String filterAgencies, int gracePeriodDays, boolean notificationOnly,\r
- IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ public Object[] execute(int port, String userName, String password, String filterAgencies, int gracePeriodDays,\r
+ boolean notificationOnly, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
this.jobRuntime = jobRuntime;\r
- logger.info("TESZT");\r
+ logger.info(getMarker(), "TESZT");\r
if (StringUtils.isBlank(NEXIO_HOST)) {\r
logger.error(jobRuntime.getSessionMarker(), "A 'nexio.host' rendszer paraméter nem található.");\r
- throw new NullPointerException("System is not configured properly, 'nexio.host' startup parameter missing.");\r
+ throw new NullPointerException(\r
+ "System is not configured properly, 'nexio.host' startup parameter missing.");\r
}\r
\r
if (StringUtils.isBlank(filterAgencies)) {\r
sourceUri.setPassword(password);\r
\r
List<BasicDBObject> clips = ListUtils.cast(cursor.toArray());\r
- SimpleDateFormat df = new SimpleDateFormat("yyyy.MM.dd");\r
-\r
+ SimpleDateFormat dffull = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss");\r
+ logger.info(getMarker(), "{} fájl vizsgálata elindul a {} lista alapján", clips.size(), NEXIOCLIPS);\r
int i = 0;\r
for (BasicDBObject clip : clips) {\r
String name = String.valueOf(clip.get(LONGNAMEID));\r
- Date killdate = clip.getDate(KILLDATE);\r
- if (notificationOnly)\r
- logger.info(jobRuntime.getSessionMarker(), "Az {} fájl törölhető. Lejárt: {} ", name, df.format(killdate));\r
- else\r
+ //logger.info(getMarker(), name);\r
+ String agency = String.valueOf(clip.get(EXTAGENCY));\r
+\r
+ logger.info(getMarker(), "Az {} fájl törölhető. Rögzítve: {}, Lejárt: {}, Agency: {} ", name,\r
+ dffull.format(clip.getDate(RECORDDATE)), dffull.format(clip.getDate(KILLDATE)), agency);\r
+\r
+ if (!notificationOnly)\r
delete(name);\r
+\r
i++;\r
int progress = i * 100 / clips.size();\r
setProgress(progress);\r