From 287f662f8972f567feb279decdeea8e969078854 Mon Sep 17 00:00:00 2001 From: Sweidan Omar Date: Mon, 6 Dec 2021 10:27:59 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C32428 --- .../user/commons/nexio/NexioDataMiner.java | 8 ++--- .../remotestore/SambaDirectoryLister.java | 27 ++++++++------- .../user/commons/remotestore/TSMLister.java | 33 ++++++++----------- .../jobengine/search/LuceneMediaFinder.java | 11 +++---- 4 files changed, 39 insertions(+), 40 deletions(-) diff --git a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java index 2e175ae9..1ce8b91a 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/nexio/NexioDataMiner.java @@ -173,7 +173,6 @@ public class NexioDataMiner implements Runnable, INexioChangeListener { @Override public void refreshClients() throws Exception { - // TODO Auto-generated method stub } @@ -223,7 +222,8 @@ public class NexioDataMiner implements Runnable, INexioChangeListener { if (bundle != null) { BundleContext bundleContext = bundle.getBundleContext(); if (bundleContext != null) { - ServiceReference reference = bundleContext.getServiceReference(INexioChangeListener.class); + ServiceReference reference = bundleContext + .getServiceReference(INexioChangeListener.class); if (reference != null) { INexioChangeListener service = bundleContext.getService(reference); setNexioChangeListener(service); @@ -301,10 +301,10 @@ public class NexioDataMiner implements Runnable, INexioChangeListener { Timestamp record = rs.getTimestamp(RECORDTIMESTAMP); clip.put(RECORDDATE, record); - //NEXIO GW modified date nem jo a regi klippeknel + // NEXIO GW modified date nem jo a regi klippeknel Timestamp modified = rs.getTimestamp(MODIFIEDTIMESTAMP); - //neha elrontja, es ez is null + // neha elrontja, es ez is null if (modified != null && modified.before(record)) clip.put(MODIFIEDTIMESTAMP, record); else diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java index 649fe778..881c96d0 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/SambaDirectoryLister.java @@ -23,7 +23,8 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public boolean checkAvailability(RemoteFile remoteFile) throws Exception { boolean result = false; - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); long size = remoteFile.getSize(); String path = storeUri.toString(true) + remoteFile.getName(); SmbFile smbFile = new SmbFile(path, auth); @@ -50,20 +51,19 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public void ensureOutputDirectory() { - // TODO Auto-generated method stub } @Override public boolean exists(String fileName) throws Exception { - // TODO Auto-generated method stub return false; } @Override public RemoteFile get(String fileName) throws Exception { RemoteFile result = null; - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = storeUri.toString(true) + fileName; SmbFile smbFile = new SmbFile(path, auth); if (smbFile != null) @@ -73,13 +73,13 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public RemoteFile getFileWithContent(String name) throws Exception { - // TODO Auto-generated method stub return null; } @Override public InputStream getInputStream(RemoteFile remoteFile) throws Exception { - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = storeUri.toString(true) + remoteFile.getName(); SmbFile smbFile = new SmbFile(path, auth); return smbFile.getInputStream(); @@ -87,7 +87,8 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception { - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = storeUri.toString(true) + remoteFile.getName(); SmbFile smbFile = new SmbFile(path, auth); return smbFile.getOutputStream(); @@ -96,7 +97,8 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public List list() throws Exception { List result = new ArrayList(); - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = "smb:" + storeUri.toString(true).replace("\\", "/"); SmbFile smbFile = new SmbFile(path, auth); SmbFile[] list = smbFile.listFiles(); @@ -109,7 +111,8 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public void list(IRemoteFileListCallback callback) throws Exception { - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = "smb:" + storeUri.toString(true).replace("\\", "/"); SmbFile smbFile = new SmbFile(path, auth); SmbFile[] list = smbFile.listFiles(); @@ -125,7 +128,8 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public List list(String wildCard) throws Exception { List result = new ArrayList(); - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = "smb:" + storeUri.toString(true).replace("\\", "/"); SmbFile smbFile = new SmbFile(path, auth); SmbFile[] list = smbFile.listFiles(wildCard); @@ -138,7 +142,8 @@ public class SambaDirectoryLister implements IDirectoryLister { @Override public void list(String wildCard, IRemoteFileListCallback callback) throws Exception { - NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword()); + NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), + storeUri.getPassword()); String path = "smb:" + storeUri.toString(true).replace("\\", "/"); SmbFile smbFile = new SmbFile(path, auth); SmbFile[] list = smbFile.listFiles(wildCard); diff --git a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java index 364592e6..f11ad5c5 100644 --- a/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java +++ b/server/user.jobengine.osgi.commons/src/user/commons/remotestore/TSMLister.java @@ -33,7 +33,6 @@ public class TSMLister implements IDirectoryLister { @Override public boolean checkAvailability(RemoteFile remoteFile) throws Exception { - // TODO Auto-generated method stub return false; } @@ -49,7 +48,7 @@ public class TSMLister implements IDirectoryLister { if (client != null) return; client = new TSMBufferedClient(NODENAME); - //client.connect(storeUri.getUserName(), storeUri.getPassword(), "\\"); + // client.connect(storeUri.getUserName(), storeUri.getPassword(), "\\"); client.connect(storeUri.getUserName(), storeUri.getPassword()); logger.info("TSMBufferedClient connected, parameters: {} {}/{} {}, separator: {}", NODENAME, FSNAME, ALTERNATE_FSNAME, HLNAME, File.separator); @@ -57,19 +56,16 @@ public class TSMLister implements IDirectoryLister { @Override public void delete(RemoteFile remoteFile) { - // TODO Auto-generated method stub } @Override public void ensureOutputDirectory() throws Exception { - // TODO Auto-generated method stub } @Override public boolean exists(String fileName) throws Exception { - // TODO Auto-generated method stub return false; } @@ -83,23 +79,25 @@ public class TSMLister implements IDirectoryLister { TSMBackupFileObject backupFileObject = client.getActiveBackupFileObject(FSNAME, HLNAME, DELIMITER + currentFileName); - //probaljuk meg a masik tarbol + // probaljuk meg a masik tarbol if (backupFileObject == null) { logger.info("Getting {}, {}, {}", ALTERNATE_FSNAME, HLNAME, DELIMITER + currentFileName); backupFileObject = client.getActiveBackupFileObject(ALTERNATE_FSNAME, HLNAME, DELIMITER + currentFileName); } - //probaljuk meg kiterjesztes nelkul is - // if (backupFileObject == null && currentFileName.contains(".")) { - // currentFileName = fileName.substring(0, fileName.lastIndexOf(".")); - // logger.info("Getting {}, {}, {}", FSNAME, HLNAME, currentFileName); - // backupFileObject = client.getActiveBackupFileObject(FSNAME, HLNAME, LLNAMEQUALIFIER + currentFileName); + // probaljuk meg kiterjesztes nelkul is + // if (backupFileObject == null && currentFileName.contains(".")) { + // currentFileName = fileName.substring(0, fileName.lastIndexOf(".")); + // logger.info("Getting {}, {}, {}", FSNAME, HLNAME, currentFileName); + // backupFileObject = client.getActiveBackupFileObject(FSNAME, HLNAME, + // LLNAMEQUALIFIER + currentFileName); // - // if (backupFileObject == null) { - // logger.info("Getting {}, {}, {}", ALTERNATE_FSNAME, HLNAME, currentFileName); - // backupFileObject = client.getActiveBackupFileObject(ALTERNATE_FSNAME, HLNAME, LLNAMEQUALIFIER + currentFileName); - // } - // } + // if (backupFileObject == null) { + // logger.info("Getting {}, {}, {}", ALTERNATE_FSNAME, HLNAME, currentFileName); + // backupFileObject = client.getActiveBackupFileObject(ALTERNATE_FSNAME, HLNAME, + // LLNAMEQUALIFIER + currentFileName); + // } + // } if (backupFileObject != null) { result = toRemoteFile(backupFileObject); @@ -113,7 +111,6 @@ public class TSMLister implements IDirectoryLister { @Override public RemoteFile getFileWithContent(String name) throws Exception { - // TODO Auto-generated method stub return null; } @@ -154,13 +151,11 @@ public class TSMLister implements IDirectoryLister { @Override public List list(String wildCard) throws Exception { - // TODO Auto-generated method stub return null; } @Override public void list(String wildCard, IRemoteFileListCallback callback) throws Exception { - // TODO Auto-generated method stub } diff --git a/server/user.jobengine.osgi.db/src/user/jobengine/search/LuceneMediaFinder.java b/server/user.jobengine.osgi.db/src/user/jobengine/search/LuceneMediaFinder.java index 9c8966c6..b597878d 100644 --- a/server/user.jobengine.osgi.db/src/user/jobengine/search/LuceneMediaFinder.java +++ b/server/user.jobengine.osgi.db/src/user/jobengine/search/LuceneMediaFinder.java @@ -14,8 +14,7 @@ public class LuceneMediaFinder implements IMediaFinder { @Override public SearchResult search(SearchOptions options) { SearchResult ret = new SearchResult(); - // TODO Auto-generated method stub - // ResteasyClient client = new ResteasyClientBuilder().build(); + // ResteasyClient client = new ResteasyClientBuilder().build(); // if (criteria == "" || criteria == null) // apiPath = apiPath + "*:*/"; // else @@ -24,8 +23,8 @@ public class LuceneMediaFinder implements IMediaFinder { // apiPath = apiPath + fromResult + "/" + (toResult - fromResult) + "/" // + (orderAscending == true ? "1" : "0") + "/1"; - // webTarget = client.target(apiAddress); - // WebTarget target = webTarget.path(apiPath); + // webTarget = client.target(apiAddress); + // WebTarget target = webTarget.path(apiPath); // Response response = target.request().get(IndexerDescription.class); // Response response = target.get(new // GenericType>() { @@ -36,8 +35,8 @@ public class LuceneMediaFinder implements IMediaFinder { // List archivedMedia = (List) response; // ret = (SearchResult) response; - // ret = target.request().get(new GenericType>() { - // }); + // ret = target.request().get(new GenericType>() { + // }); return ret; } -- 2.54.0