</listAttribute>\r
<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"/>\r
<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;-configuration&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;-dependencies&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;-modules&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;-product&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;RemoteSystemsTempFiles&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.commons.log4j2&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.jobengine.executors&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.jobengine.osgi.commons&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.jobengine.osgi.db&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.jobengine.osgi.server&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.jobengine.osgi.services&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;project name=&quot;user.tsm.client&quot; referencedProjects=&quot;false&quot;/&gt;&#13;&#10;" typeId="org.eclipse.cdt.debug.core.containerType.project"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/>\r
-<booleanAttribute key="org.eclipse.jdt.launching.ALLOW_TERMINATE" value="true"/>\r
+<booleanAttribute key="org.eclipse.jdt.launching.ALLOW_TERMINATE" value="false"/>\r
<mapAttribute key="org.eclipse.jdt.launching.CONNECT_MAP">\r
-<mapEntry key="hostname" value="10.10.1.26"/>\r
+<mapEntry key="hostname" value="10.10.1.28"/>\r
<mapEntry key="port" value="8888"/>\r
</mapAttribute>\r
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="user.jobengine.osgi.server"/>\r
--- /dev/null
+SErvername MEDIACUBE\r
+*traceflags api\r
+*tracefile /opt/mediacube/tsm.trace
\ No newline at end of file
<Configuration status="ERROR" monitorInterval="10" packages="user.commons.log4j2.appender">\r
<Properties>\r
<Property name="fileName">log/mediacube.log</Property>\r
- <Property name="filePattern">log/$${date:yyyy-MM}/chronos-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
- <Property name="fileName.err">log/chronos-err.log</Property>\r
- <Property name="filePattern.err">log/$${date:yyyy-MM}/chronos-err-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
+ <Property name="filePattern">log/$${date:yyyy-MM}/mediacube-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
+ <Property name="fileName.err">log/mediacube-err.log</Property>\r
+ <Property name="filePattern.err">log/$${date:yyyy-MM}/mediacube-err-%d{MM-dd-yyyy}-%i.log.gz</Property>\r
</Properties>\r
<Appenders>\r
<Console name="Console" target="SYSTEM_OUT">\r
+ <Filters>\r
+ <MarkerFilter marker="teszt1" onMatch="DENY" onMismatch="NEUTRAL" />\r
+ <MarkerFilter marker="teszt2" onMatch="DENY" onMismatch="NEUTRAL" />\r
+ <MarkerFilter marker="teszt3" onMatch="DENY" onMismatch="NEUTRAL" />\r
+ <MarkerFilter marker="teszt4" onMatch="DENY" onMismatch="NEUTRAL" />\r
+ </Filters>\r
<PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %msg (%F:%L) %n" />\r
</Console>\r
<Console name="MarkeredConsole" target="SYSTEM_ERR">\r
- <MarkerFilter marker="INFO-MARKER" onMatch="ACCEPT" onMismatch="DENY" />\r
- <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %msg (%F:%L) %n" />\r
+ <Filters>\r
+ <MarkerFilter marker="teszt1" onMatch="ACCEPT" onMismatch="NEUTRAL" />\r
+ <MarkerFilter marker="teszt2" onMatch="ACCEPT" onMismatch="NEUTRAL" />\r
+ <MarkerFilter marker="teszt3" onMatch="ACCEPT" onMismatch="NEUTRAL" />\r
+ <MarkerFilter marker="teszt4" onMatch="ACCEPT" onMismatch="DENY" />\r
+ </Filters>\r
+ <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %logger{1}.%M - %marker - %msg (%F:%L) %n" />\r
</Console>\r
<HTMLMailAppender name="MarkeredMail" subject="MARKERED-INFO" to="vasary@elgekko.net" from="mediacubeserver@gmail.com" smtpHost="smtp.gmail.com"\r
smtpPort="465" smtpProtocol="smtps" smtpUsername="mediacubeserver@gmail.com" smtpPassword="salabakter" ignoreExceptions="false" bufferSize="1">\r
<Root level="INFO">\r
<AppenderRef ref="Console" />\r
<AppenderRef ref="MarkeredConsole" />\r
- <AppenderRef ref="MarkeredMail" />\r
+<!-- <AppenderRef ref="RollingFile" /> -->\r
+<!-- <AppenderRef ref="MarkeredMail" /> -->\r
</Root>\r
<Logger name="org.zkoss" level="ERROR" additivity="false" />\r
<Logger name="org.quartz" level="ERROR" additivity="false" />\r
"executeimmediate": true,\r
"cronexpression": "0 0 0/1 1/1 * ? *",\r
"parameters": [ \r
- {"name": "inputFolder", "value": "/mnt/ISILON/ARCHIVE", "type": "java.lang.String"} \r
+ {"name": "inputFolder", "value": "/mnt/ISILON/ARCHIVE", "type": "java.lang.String"},\r
+ {"name": "globalInputFolder", "value": "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE", "type": "java.lang.String"}\r
]\r
},\r
{\r
--- /dev/null
+export DSMI_CONFIG=/opt/mediacube/configuration/dsm.opt
+export DSMI_DIR=/opt/tivoli/tsm/client/api/bin64
+export DSMI_LOG=/opt/mediacube/log
+export DSM_DIR=/opt/tivoli/tsm/client/api/bin64
+# export LANG=hu_HU.ISO8859-2
+export LD_LIBRARY_PATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64
+export LIBPATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64
+export SHLIB_PATH=/opt/tivoli/tsm/client/ba/bin:/opt/tivoli/tsm/client/api/bin64
+export TZ=NFT-1DFT,M3.5.0,M10.5.0
+export PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64/bin:$PATH
+./mediacube
\ No newline at end of file
+Install\r
+---------------\r
+yum install nginx\r
+yum install samba\r
+\r
+\r
Services global\r
---------------\r
\r
Serving\r
\\10.10.1.26\mclowres\\r
\r
-Windows mapping\r
+Mapping\r
net use m: \\10.10.1.26\mclowres /user:mclowres Broadca5T /persistent:no\r
+ mount -t cifs -o username=mediacube,password=Broadca5T //10.10.1.100/BRAAVOS /mnt/ISILON\r
\r
\r
\r
<includes>\r
<include>log4j2.xml</include>\r
<include>scheduledjobs.json</include>\r
+ <include>dsm.opt</include>\r
</includes>\r
</resource>\r
</resources>\r
<includes>\r
<include>log4j2.xml</include>\r
<include>scheduledjobs.json</include>\r
+ <include>dsm.opt</include>\r
</includes>\r
</resource>\r
</resources>\r
</resources>\r
</configuration>\r
</execution>\r
+ <execution>\r
+ <id>copy-resources-6</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/win32/win32/x86_64</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../-configuration</directory>\r
+ <includes>\r
+ <include>start-mediacube.sh</include>\r
+ </includes>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ <execution>\r
+ <id>copy-resources-6-lnx</id>\r
+ <phase>install</phase>\r
+ <goals>\r
+ <goal>copy-resources</goal>\r
+ </goals>\r
+ <configuration>\r
+ <outputDirectory>${project.build.directory}/products/MediaCube/linux/gtk/x86_64</outputDirectory>\r
+ <resources>\r
+ <resource>\r
+ <directory>${basedir}/../-configuration</directory>\r
+ <includes>\r
+ <include>start-mediacube.sh</include>\r
+ </includes>\r
+ </resource>\r
+ </resources>\r
+ </configuration>\r
+ </execution>\r
+ \r
</executions>\r
</plugin>\r
<plugin>\r
<argument>"cd ${remote.location}"</argument>\r
<argument>"synchronize remote"</argument>\r
<argument>"call chmod +x mediacube"</argument>\r
+ <argument>"call chmod +x start-mediacube.sh"</argument>\r
<argument>"exit"</argument>\r
</arguments>\r
</configuration>\r
<declarations>\r
<parameters>\r
<parameter name="archiveItem" type="user.jobengine.server.steps.ArchiveItem" />\r
+ <parameter name="globalInputFolder" type="java.lang.String"/>\r
</parameters>\r
<variables>\r
<variable name="mediaCubeMedia" type="user.jobengine.db.Media" />\r
<commands>\r
<calljobstep id="id3" type="user.jobengine.server.steps.SelenioLowresTranscodeStep" weight="1">\r
<inputs>\r
+ <input>\r
+ <parameter name="globalInputFolder" />\r
+ </input>\r
+ <input>\r
+ <parameter name="archiveItem" />\r
+ </input>\r
<input>\r
<variable name="mediaCubeMedia" />\r
</input>\r
<jobtemplate name="Kézi archiválás">\r
<declarations>\r
<parameters>\r
-<!-- mount -t cifs -o username=mediacube,password=Broadca5T //10.10.1.100/BRAAVOS /mnt/ISILON -->\r
<parameter name="inputFolder" type="java.lang.String"/>\r
+ <parameter name="globalInputFolder" type="java.lang.String"/>\r
</parameters>\r
<variables>\r
<variable name="archiveList" type="java.util.ArrayList"/>\r
\r
<calljobstep id="step2" type="user.jobengine.server.steps.ArchiveItemSubmitStep" weight="1">\r
<inputs>\r
+ <input>\r
+ <parameter name="globalInputFolder" />\r
+ </input>\r
<input>\r
<variable name="archiveList" />\r
</input>\r
* @author robi\r
*/\r
public class ArchiveItemSubmitStep extends JobStep {\r
+ private static final String GLOBAL_INPUT_FOLDER = "globalInputFolder";\r
private static final Logger logger = LogManager.getLogger();\r
private static final String JOBTEMPLATE = "archive-item.xml";\r
private static final String ARCHIVE_ITEM = "archiveItem";\r
\r
@StepEntry\r
- public Object[] execute(ArrayList<ArchiveItem> archiveList, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
+ public Object[] execute(String globalInputFolder, ArrayList<ArchiveItem> archiveList, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
try {\r
for (ArchiveItem archiveItem : archiveList) {\r
String title = "Archiválás: " + archiveItem.getMediaFile().toFile().getName();\r
try {\r
- jobEngine.submit(JOBTEMPLATE, title, ListUtils.asMap(ARCHIVE_ITEM, archiveItem));\r
+ IJobRuntime submit = jobEngine.submit(JOBTEMPLATE, title,\r
+ ListUtils.asMap(ARCHIVE_ITEM, archiveItem, GLOBAL_INPUT_FOLDER, globalInputFolder));\r
} catch (Exception e) {\r
if (archiveItem != null)\r
removeCatchedFile(archiveItem.getCatchedFile());\r
import java.nio.file.Files;\r
import java.nio.file.Path;\r
import java.nio.file.Paths;\r
-import java.nio.file.StandardOpenOption;\r
import java.util.ArrayList;\r
import java.util.List;\r
\r
\r
private void createCatchedFile(Path catchedFilePath) {\r
try {\r
- Files.write(catchedFilePath, CATCHED.getBytes(UTF8), StandardOpenOption.CREATE);\r
+ Files.createFile(catchedFilePath);\r
+ //Files.write(catchedFilePath, CATCHED.getBytes(UTF8), StandardOpenOption.CREATE);\r
} catch (Exception e) {\r
logger.catching(e);\r
}\r
\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
+import org.apache.logging.log4j.MarkerManager;\r
\r
import com.ibm.nosql.json.JSONUtil;\r
import com.ibm.nosql.json.api.BasicDBObject;\r
@StepEntry\r
public Object[] execute(long itemID, IJobEngine jobEngine, IJobRuntime jobRuntime) {\r
try {\r
- logger.info(IJobStep.INFO_MARKER, "Starting Fake step, parameter: {}", itemID);\r
+ // IItemManager manager = jobEngine.getItemManager();\r
+ // StoreUri sourceUri = manager.createStoreUri(RemoteStoreProtocol.SMB, "\\\\10.10.1.100\\BRAAVOS\\ARCHIVE");\r
+ // sourceUri.setUserName("mediacube");\r
+ // sourceUri.setPassword("Broadca5T");\r
+ // List<RemoteFile> remoteFiles = sourceUri.getRemoteFiles();\r
+ // for (RemoteFile remoteFile : remoteFiles)\r
+ // logger.info(remoteFile.getName());\r
+\r
String json = "{ houseID: '111222' }";\r
BasicDBObject o = (BasicDBObject) JSONUtil.jsonToDbObject(json);\r
for (int i = 0; i < count; i++) {\r
jobRuntime.incrementProgress((i + 1) * count);\r
// logger.info("Progress {}", jobRuntime.getProgress());\r
}\r
+ logger.warn(MarkerManager.getMarker("teszt2"), "Starting Fake step, parameter: {}", itemID);\r
} catch (Exception e) {\r
logger.error(e.getMessage());\r
}\r
\r
import java.io.File;\r
import java.net.URL;\r
+import java.nio.file.Path;\r
+import java.nio.file.Paths;\r
import java.util.Arrays;\r
import java.util.List;\r
\r
private IItemManager manager;\r
private Store store;\r
private FileType fileType;\r
- private String outputPath;\r
\r
public SelenioLowresTranscodeStep() {\r
try {\r
}\r
}\r
\r
- private TranscodeRequest buildTranscodeRequest(String projectFilePath, String sourceFilePath) throws java.lang.Exception {\r
+ private TranscodeRequest buildTranscodeRequest(String projectFilePath, String sourceFilePath, String outputPath) throws java.lang.Exception {\r
Clip clip = new Clip();\r
MediaFile mediaFile = new MediaFile();\r
mediaFile.setFile(sourceFilePath);\r
}\r
\r
@StepEntry\r
- public Object[] execute(ArchiveItem archiveItem, Media mediaCubeMedia, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
+ public Object[] execute(String globalInputFolder, ArchiveItem archiveItem, Media mediaCubeMedia, IJobEngine jobEngine, IJobRuntime jobRuntime)\r
+ throws Exception {\r
+ if (StringUtils.isBlank(globalInputFolder))\r
+ throw new NullPointerException("System is not configured properly, 'globalInputFolder' parameter missing.");\r
manager = jobEngine.getItemManager();\r
+\r
store = manager.getSystemStore(true);\r
if (store == null)\r
throw new NullPointerException("System is not configured properly, low-res system store definition missing.");\r
\r
- StoreUri sourceStoreUri = store.getSourceStoreUri(RemoteStoreProtocol.SMB);\r
- if (sourceStoreUri == null)\r
- throw new NullPointerException("System is not configured properly, low-res system store SMB store URI definition missing.");\r
- outputPath = sourceStoreUri.getRootPath();\r
-\r
fileType = manager.getFileType(LOWRES_FILETYPE);\r
if (fileType == null)\r
throw new NullPointerException("System is not configured properly, low-res file type definition missing.");\r
\r
- String sourceFile = archiveItem.getMediaFile().toString();\r
- TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, sourceFile);\r
+ StoreUri sourceStoreUri = store.getSourceStoreUri(RemoteStoreProtocol.SMB);\r
+ if (sourceStoreUri == null)\r
+ throw new NullPointerException("System is not configured properly, low-res system store SMB store URI definition missing.");\r
+\r
+ Path inputPath = Paths.get(globalInputFolder, archiveItem.getMediaFile().toFile().getName());\r
+ String sourceFilePath = inputPath.toString();\r
+ String outputPath = sourceStoreUri.getRootPath();\r
+ TranscodeRequest transcodeRequest = buildTranscodeRequest(projectFilePath, sourceFilePath, outputPath);\r
TranscodeTask transcodeTask = transcoder.submitTranscodeTask(transcodeRequest);\r
\r
if (transcodeTask == null)\r
- throw new NullPointerException("Unable to submit transcode task, server response is empty for transcode input: " + sourceFile);\r
+ throw new NullPointerException("Unable to submit transcode task, server response is empty for transcode input: " + sourceFilePath);\r
\r
- transcodeTask = monitor(jobRuntime, sourceFile, transcodeTask);\r
+ transcodeTask = monitor(jobRuntime, sourceFilePath, transcodeTask);\r
\r
jobRuntime.incrementProgress(100);\r
\r
--- /dev/null
+package user.commons;\r
+\r
+public interface IRemoteFileListCallback {\r
+ boolean onRemoteFile(RemoteFile remoteFile);\r
+}\r
this.statusListenerList = new EventListenerList();
}
- public RemoteFile copy(IDirectoryLister inputLister, IDirectoryLister outputLister, RemoteFile source,
- String targetName) throws Exception {
+ public RemoteFile copy(IDirectoryLister inputLister, IDirectoryLister outputLister, RemoteFile source, String targetName) throws Exception {
RemoteFile result = null;
long uploadedBytes = 0;
int byteCount = 0;
return currentPath;
}
- public String getFilter() {
- return filter;
+ public DeliveryMethod getDelivery() {
+ return delivery;
}
// public String getFullPath() {
// return result.replace("\\", "/");
// }
+ public String getFilter() {
+ return filter;
+ }
+
public String getPassword() {
return password;
}
return portNumber;
}
+ public RemoteStoreProtocol getProtocol() {
+ return protocol;
+ }
+
+ public RemoteFile getRemoteFile(String fileName) {
+ RemoteFile result = null;
+ try {
+ IDirectoryLister inputLister = RemoteFileHandler.createLister(this);
+ if (inputLister == null)
+ throw new Exception("InputLister is null.");
+ result = inputLister.get(fileName);
+ } catch (Exception e) {
+ logger.error(e);
+ }
+ return result;
+ }
+
public List<RemoteFile> getRemoteFiles() throws Exception {
List<RemoteFile> result = null;
IDirectoryLister lister = RemoteFileHandler.createLister(this);
return result;
}
+ public void getRemoteFiles(IRemoteFileListCallback callback) throws Exception {
+ List<RemoteFile> result = null;
+ IDirectoryLister lister = RemoteFileHandler.createLister(this);
+ if (lister != null)
+ lister.list(callback);
+ }
+
public String getRootPath() {
return rootPath;
}
this.currentPath = currentPath;
}
+ public void setDelivery(DeliveryMethod delivery) {
+ this.delivery = delivery;
+ }
+
public void setFilter(String filter) {
this.filter = filter;
}
this.portNumber = portNumber;
}
+ public void setProtocol(RemoteStoreProtocol protocol) {
+ this.protocol = protocol;
+ }
+
public void setRootPath(String rootPath) {
this.rootPath = rootPath;
}
this.userName = userName;
}
- public RemoteFile getRemoteFile(String fileName) {
- RemoteFile result = null;
+ @Override
+ public String toString() {
+ String result = null;
try {
- IDirectoryLister inputLister = RemoteFileHandler.createLister(this);
- if (inputLister == null)
- throw new Exception("InputLister is null.");
- result = inputLister.get(fileName);
+ result = toString(false);
} catch (Exception e) {
- logger.error(e);
+ e.printStackTrace();
}
return result;
}
+ public String toString(boolean skipProtocol) throws Exception {
+ String result = skipProtocol ? uri : protocol.getValue() + uri;
+ result = DirectoryUtils.combine(result, rootPath);
+ result = DirectoryUtils.combine(result, currentPath);
+ return result;
+ }
+
public RemoteFile transferFrom(StoreUri targetStoreUri, RemoteFile remoteFile, String targetName) throws Exception {
IDirectoryLister inputLister = RemoteFileHandler.createLister(this);
if (inputLister == null)
return copy(inputLister, outputLister, remoteFile, targetName);
}
-
- @Override
- public String toString() {
- String result = null;
- try {
- result = toString(false);
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-
- public String toString(boolean skipProtocol) throws Exception {
- String result = skipProtocol ? uri : protocol.getValue() + uri;
- result = DirectoryUtils.combine(result, rootPath);
- result = DirectoryUtils.combine(result, currentPath);
- return result;
- }
-
- public RemoteStoreProtocol getProtocol() {
- return protocol;
- }
-
- public void setProtocol(RemoteStoreProtocol protocol) {
- this.protocol = protocol;
- }
-
- public DeliveryMethod getDelivery() {
- return delivery;
- }
-
- public void setDelivery(DeliveryMethod delivery) {
- this.delivery = delivery;
- }
}
\ No newline at end of file
import java.util.ArrayList;\r
import java.util.List;\r
\r
+import org.apache.commons.lang.NotImplementedException;\r
import org.apache.commons.lang.StringUtils;\r
import org.apache.commons.net.ftp.FTP;\r
import org.apache.commons.net.ftp.FTPClient;\r
import org.apache.commons.net.ftp.FTPFile;\r
\r
+import user.commons.IRemoteFileListCallback;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
\r
this.storeUri = storeUri;\r
}\r
\r
+ @Override\r
public boolean checkAvailability(RemoteFile remoteFile) throws Exception {\r
boolean result = false;\r
InputStream input = null;\r
return result;\r
}\r
\r
+ @Override\r
public void cleanUp() throws Exception {\r
if (ftpClient != null) {\r
if (ftpClient.isConnected()) {\r
return result;\r
}\r
\r
+ @Override\r
public InputStream getInputStream(RemoteFile remoteFile) throws Exception {\r
InputStream input = null;\r
connect();\r
return input;\r
}\r
\r
+ @Override\r
public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception {\r
OutputStream output = null;\r
connect();\r
return result;\r
}\r
\r
+ @Override\r
+ public void list(IRemoteFileListCallback callback) throws Exception {\r
+ throw new NotImplementedException();\r
+ }\r
+\r
private RemoteFile toRemoteFile(FTPFile file) {\r
RemoteFile result = new RemoteFile();\r
result.setName(file.getName());\r
import java.io.OutputStream;\r
import java.util.List;\r
\r
+import user.commons.IRemoteFileListCallback;\r
import user.commons.RemoteFile;\r
\r
public interface IDirectoryLister {\r
\r
- List<RemoteFile> list() throws Exception;\r
- InputStream getInputStream(RemoteFile remoteFile) throws Exception;\r
- OutputStream getOutputStream(RemoteFile remoteFile) throws Exception;\r
boolean checkAvailability(RemoteFile remoteFile) throws Exception;\r
+\r
void cleanUp() throws Exception;\r
+\r
RemoteFile get(String fileName) throws Exception;\r
- \r
+\r
+ InputStream getInputStream(RemoteFile remoteFile) throws Exception;\r
+\r
+ OutputStream getOutputStream(RemoteFile remoteFile) throws Exception;\r
+\r
+ List<RemoteFile> list() throws Exception;\r
+\r
+ void list(IRemoteFileListCallback callback) throws Exception;\r
+\r
}\r
import java.util.Comparator;\r
import java.util.List;\r
\r
+import org.apache.commons.lang.NotImplementedException;\r
+\r
+import user.commons.IRemoteFileListCallback;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
\r
return toRemoteFile(file);\r
}\r
\r
+ @Override\r
public InputStream getInputStream(RemoteFile remoteFile) throws Exception {\r
String path = storeUri.toString(true);\r
File file = new File(path + remoteFile.getName());\r
return new FileInputStream(file);\r
}\r
\r
+ @Override\r
public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception {\r
String path = storeUri.toString(true);\r
File file = new File(path + remoteFile.getName());\r
List<RemoteFile> result = new ArrayList<RemoteFile>();\r
String path = storeUri.toString(true);\r
File dir = new File(path);\r
- File[] dirs = dir.listFiles(new DirectoryFileFilter(storeUri\r
- .getFilter(), true));\r
- File[] files = dir.listFiles(new DirectoryFileFilter(storeUri\r
- .getFilter(), false));\r
+ File[] dirs = dir.listFiles(new DirectoryFileFilter(storeUri.getFilter(), true));\r
+ File[] files = dir.listFiles(new DirectoryFileFilter(storeUri.getFilter(), false));\r
\r
Arrays.sort(dirs, new Comparator<File>() {\r
+ @Override\r
public int compare(File f1, File f2) {\r
return f1.getName().compareToIgnoreCase(f2.getName());\r
}\r
});\r
\r
Arrays.sort(files, new Comparator<File>() {\r
+ @Override\r
public int compare(File f1, File f2) {\r
return f1.getName().compareToIgnoreCase(f2.getName());\r
}\r
return result;\r
}\r
\r
+ @Override\r
+ public void list(IRemoteFileListCallback callback) throws Exception {\r
+ throw new NotImplementedException();\r
+ }\r
+\r
private RemoteFile toRemoteFile(File file) {\r
RemoteFile result = new RemoteFile();\r
result.setName(file.getName());\r
\r
import jcifs.smb.NtlmPasswordAuthentication;\r
import jcifs.smb.SmbFile;\r
+import user.commons.IRemoteFileListCallback;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
\r
@Override\r
public boolean checkAvailability(RemoteFile remoteFile) throws Exception {\r
boolean result = false;\r
- NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,\r
- storeUri.getUserName(), storeUri.getPassword());\r
+ NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword());\r
long size = remoteFile.getSize();\r
String path = storeUri.toString(true) + remoteFile.getName();\r
SmbFile smbFile = new SmbFile(path, auth);\r
@Override\r
public RemoteFile get(String fileName) throws Exception {\r
RemoteFile result = null;\r
- NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,\r
- storeUri.getUserName(), storeUri.getPassword());\r
+ NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword());\r
String path = storeUri.toString(true) + fileName;\r
SmbFile smbFile = new SmbFile(path, auth);\r
if (smbFile != null)\r
return result;\r
}\r
\r
+ @Override\r
public InputStream getInputStream(RemoteFile remoteFile) throws Exception {\r
- NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,\r
- storeUri.getUserName(), storeUri.getPassword());\r
+ NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword());\r
String path = storeUri.toString(true) + remoteFile.getName();\r
SmbFile smbFile = new SmbFile(path, auth);\r
return smbFile.getInputStream();\r
}\r
\r
+ @Override\r
public OutputStream getOutputStream(RemoteFile remoteFile) throws Exception {\r
- NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,\r
- storeUri.getUserName(), storeUri.getPassword());\r
+ NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword());\r
String path = storeUri.toString(true) + remoteFile.getName();\r
SmbFile smbFile = new SmbFile(path, auth);\r
return smbFile.getOutputStream();\r
@Override\r
public List<RemoteFile> list() throws Exception {\r
List<RemoteFile> result = new ArrayList<RemoteFile>();\r
- NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null,\r
- storeUri.getUserName(), storeUri.getPassword());\r
- String path = storeUri.toString(true);\r
+ NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword());\r
+ String path = "smb:" + storeUri.toString(true).replace("\\", "/");\r
SmbFile smbFile = new SmbFile(path, auth);\r
SmbFile[] list = smbFile.listFiles();\r
for (SmbFile smb : list) {\r
return result;\r
}\r
\r
+ @Override\r
+ public void list(IRemoteFileListCallback callback) throws Exception {\r
+ NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(null, storeUri.getUserName(), storeUri.getPassword());\r
+ String path = "smb:" + storeUri.toString(true).replace("\\", "/");\r
+ SmbFile smbFile = new SmbFile(path, auth);\r
+ SmbFile[] list = smbFile.listFiles();\r
+ for (SmbFile smb : list) {\r
+ RemoteFile file = toRemoteFile(smb);\r
+ if (callback != null) {\r
+ if (!callback.onRemoteFile(file))\r
+ break;\r
+ }\r
+ }\r
+ }\r
+\r
private RemoteFile toRemoteFile(SmbFile file) throws Exception {\r
RemoteFile result = new RemoteFile();\r
result.setName(file.getName());\r
import java.io.OutputStream;\r
import java.util.List;\r
\r
+import org.apache.commons.lang.NotImplementedException;\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
\r
+import user.commons.IRemoteFileListCallback;\r
import user.commons.RemoteFile;\r
import user.commons.StoreUri;\r
import user.tsm.client.TSMBackupFileObject;\r
\r
public class TSMLister implements IDirectoryLister {\r
\r
- private TSMBufferedClient client;\r
private static final String FSNAME = File.separator + "JOBENGINE";\r
private static final String HLNAME = File.separator + "JOBENGINE";\r
private static final Logger logger = LogManager.getLogger();\r
+ private TSMBufferedClient client;\r
\r
public TSMLister(StoreUri storeUri) throws Exception {\r
client = new TSMBufferedClient();\r
}\r
\r
@Override\r
- public List<RemoteFile> list() throws Exception {\r
- return null;\r
+ public boolean checkAvailability(RemoteFile remoteFile) throws Exception {\r
+ // TODO Auto-generated method stub\r
+ return false;\r
+ }\r
+\r
+ @Override\r
+ public void cleanUp() throws Exception {\r
+ client.disconnect();\r
+ }\r
+\r
+ @Override\r
+ public RemoteFile get(String fileName) throws Exception {\r
+ RemoteFile result = null;\r
+ TSMBackupFileObject backupFileObject = client.getActiveBackupFileObject(FSNAME, HLNAME, File.separator + fileName);\r
+ logger.info("TSMLister get");\r
+ if (backupFileObject != null) {\r
+ result = toRemoteFile(backupFileObject);\r
+ logger.info("TSMLister backupFileObject-et elk�rte a k�vetkez� n�vvel: " + backupFileObject.getLowLevelName());\r
+ } else\r
+ cleanUp();\r
+ return result;\r
}\r
\r
@Override\r
}\r
\r
@Override\r
- public boolean checkAvailability(RemoteFile remoteFile) throws Exception {\r
- // TODO Auto-generated method stub\r
- return false;\r
- }\r
-\r
- @Override\r
- public void cleanUp() throws Exception {\r
- client.disconnect();\r
+ public List<RemoteFile> list() throws Exception {\r
+ return null;\r
}\r
\r
@Override\r
- public RemoteFile get(String fileName) throws Exception {\r
- RemoteFile result = null;\r
- TSMBackupFileObject backupFileObject = client.getActiveBackupFileObject(FSNAME, HLNAME,\r
- File.separator + fileName);\r
- logger.info("TSMLister get");\r
- if (backupFileObject != null) {\r
- result = toRemoteFile(backupFileObject);\r
- logger.info(\r
- "TSMLister backupFileObject-et elk�rte a k�vetkez� n�vvel: " + backupFileObject.getLowLevelName());\r
- } else\r
- cleanUp();\r
- return result;\r
+ public void list(IRemoteFileListCallback callback) throws Exception {\r
+ throw new NotImplementedException();\r
}\r
\r
private RemoteFile toRemoteFile(TSMBackupFileObject file) {\r
import user.commons.IEntityBase;\r
\r
class MemoryCache {\r
+ private static final Logger logger = LogManager.getLogger();\r
boolean enabled;\r
Map<Class<? extends IEntityBase>, Map<Object, SoftReference<? extends IEntityBase>>> cacheMap = new ConcurrentHashMap<Class<? extends IEntityBase>, Map<Object, SoftReference<? extends IEntityBase>>>();\r
Object lock = new Object();\r
private IItemManager manager;\r
- private static final Logger logger = LogManager.getLogger();\r
\r
- public void setItemManager(IItemManager manager) {\r
- this.manager = manager;\r
- enableCache();\r
+ void clearAllCached() {\r
+ manager.traceIn();\r
+ for (Class<? extends IEntityBase> baseClass : cacheMap.keySet())\r
+ clearCached(baseClass);\r
+ manager.traceOut();\r
}\r
\r
void clearCached(Class<? extends IEntityBase> baseClass) {\r
manager.traceOut();\r
}\r
\r
- void clearAllCached() {\r
- manager.traceIn();\r
- for (Class<? extends IEntityBase> baseClass : cacheMap.keySet())\r
- clearCached(baseClass);\r
- manager.traceOut();\r
- }\r
-\r
public void disableCache() {\r
enabled = false;\r
clearAllCached();\r
public void enableCache() {\r
enabled = true;\r
logger.info("Cache is enabled");\r
+ // logger.info(MarkerManager.getMarker("teszt1"), "Starting1");\r
+ // logger.warn(MarkerManager.getMarker("teszt2"), "Starting2");\r
+ // logger.warn(MarkerManager.getMarker("teszt3"), "Starting3");\r
+ // logger.error(MarkerManager.getMarker("teszt4"), "Starting4");\r
}\r
\r
- Map<Object, SoftReference<? extends IEntityBase>> getCache(Class<? extends IEntityBase> baseClass) {\r
- Map<Object, SoftReference<? extends IEntityBase>> cache = null;\r
- if (enabled) {\r
- if (cacheMap.containsKey(baseClass)) {\r
- cache = cacheMap.get(baseClass);\r
- } else {\r
- cache = new ConcurrentHashMap<Object, SoftReference<? extends IEntityBase>>();\r
- cacheMap.put(baseClass, cache);\r
- }\r
- }\r
- return cache;\r
- }\r
-\r
- boolean setAllCached(Class<? extends IEntityBase> baseClass, List<IEntityBase> entities) {\r
+ void garbageCached(Class<? extends IEntityBase> baseClass, Object key) {\r
manager.traceIn();\r
- boolean result = true;\r
- if (entities != null) {\r
- logger.debug(String.format("Setting all %s, count %d", baseClass, entities.size()));\r
- for (IEntityBase entity : entities) {\r
- result = storeCached(entity.getId(), entity);\r
- if (!result)\r
- break;\r
+ Map<Object, SoftReference<? extends IEntityBase>> cache = getCache(baseClass);\r
+ if (cache != null) {\r
+ try {\r
+ if (cache.containsKey(key)) {\r
+ SoftReference<? extends IEntityBase> r = cache.get(key);\r
+ if (r != null)\r
+ r.clear();\r
+ }\r
+\r
+ } catch (Exception ex) {\r
+ logger.error(ex.getMessage());\r
}\r
}\r
manager.traceOut();\r
- return result;\r
}\r
\r
public List<IEntityBase> getAllCached(Class<? extends IEntityBase> baseClass) {\r
return result;\r
}\r
\r
- public boolean storeCached(Object key, IEntityBase entity) {\r
- manager.traceIn();\r
- if (entity == null)\r
- manager.throwError(new Exception("Can not store null value into cache"));\r
- Map<Object, SoftReference<? extends IEntityBase>> cache = getCache(entity.getClass());\r
- boolean result = false;\r
- if (cache != null) {\r
- try {\r
- cache.put(key, new SoftReference<IEntityBase>(entity));\r
- logger.debug("Store " + entity.getClass() + ", key: " + key);\r
- result = true;\r
- } catch (Exception ex) {\r
- logger.error(ex.getMessage());\r
+ Map<Object, SoftReference<? extends IEntityBase>> getCache(Class<? extends IEntityBase> baseClass) {\r
+ Map<Object, SoftReference<? extends IEntityBase>> cache = null;\r
+ if (enabled) {\r
+ if (cacheMap.containsKey(baseClass)) {\r
+ cache = cacheMap.get(baseClass);\r
+ } else {\r
+ cache = new ConcurrentHashMap<Object, SoftReference<? extends IEntityBase>>();\r
+ cacheMap.put(baseClass, cache);\r
}\r
}\r
- manager.traceOut();\r
- return result;\r
+ return cache;\r
}\r
\r
public void removeCached(Class<? extends IEntityBase> baseClass, Object key) {\r
return result;\r
}\r
\r
- void garbageCached(Class<? extends IEntityBase> baseClass, Object key) {\r
+ boolean setAllCached(Class<? extends IEntityBase> baseClass, List<IEntityBase> entities) {\r
manager.traceIn();\r
- Map<Object, SoftReference<? extends IEntityBase>> cache = getCache(baseClass);\r
+ boolean result = true;\r
+ if (entities != null) {\r
+ logger.debug(String.format("Setting all %s, count %d", baseClass, entities.size()));\r
+ for (IEntityBase entity : entities) {\r
+ result = storeCached(entity.getId(), entity);\r
+ if (!result)\r
+ break;\r
+ }\r
+ }\r
+ manager.traceOut();\r
+ return result;\r
+ }\r
+\r
+ public void setItemManager(IItemManager manager) {\r
+ this.manager = manager;\r
+ enableCache();\r
+ }\r
+\r
+ public boolean storeCached(Object key, IEntityBase entity) {\r
+ manager.traceIn();\r
+ if (entity == null)\r
+ manager.throwError(new Exception("Can not store null value into cache"));\r
+ Map<Object, SoftReference<? extends IEntityBase>> cache = getCache(entity.getClass());\r
+ boolean result = false;\r
if (cache != null) {\r
try {\r
- if (cache.containsKey(key)) {\r
- SoftReference<? extends IEntityBase> r = cache.get(key);\r
- if (r != null)\r
- r.clear();\r
- }\r
-\r
+ cache.put(key, new SoftReference<IEntityBase>(entity));\r
+ logger.debug("Store " + entity.getClass() + ", key: " + key);\r
+ result = true;\r
} catch (Exception ex) {\r
logger.error(ex.getMessage());\r
}\r
}\r
manager.traceOut();\r
+ return result;\r
}\r
}\r
<div height="100%" width="100%">\r
<groupbox vflex="min" closable="false">\r
<caption sclass="boldfont" label="Kereső kifejezés:" />\r
- <!-- label sclass="boldfont" value="Itemek keres�se:" width="180px" / -->\r
+ <!-- label sclass="boldfont" value="Itemek keresése:" width="180px" / -->\r
<textbox style="border:none" instant="true" value="@bind(svm.searchValue)" width="300px" tooltiptext="Keresőérték"/>\r
<button sclass="buttonboldfont" label="${labels.button_search}" onClick="@command('doSearch')" autodisable="self" />\r
</groupbox>\r
selectedItem="@bind(svm.selectedItem)" style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" sclass="listbox-normal-style" >\r
<listhead>\r
<listheader label="Id" width="70px" sort="auto(id)" align="left"/>\r
- <listheader label="Title" width="120px" sort="auto(status)" align="left"/>\r
- <listheader label="Description" width="120px" sort="auto(tipus)" align="left"/>\r
+ <listheader label="Cím" width="120px" sort="auto(status)" align="left"/>\r
+ <listheader label="Leírás" width="120px" sort="auto(tipus)" align="left"/>\r
</listhead>\r
\r
<template name="model">\r
selectedItem="@bind(svm.selectedMedia)" style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" sclass="listbox-normal-style" >\r
<listhead>\r
<listheader label="Id" width="70px" sort="auto(id)" align="left"/>\r
- <listheader label="Title" width="120px" sort="auto(status)" align="left"/>\r
- <listheader label="Description" width="120px" sort="auto(tipus)" align="left"/>\r
+ <listheader label="Cím" width="120px" sort="auto(status)" align="left"/>\r
+ <listheader label="Leírás" width="120px" sort="auto(tipus)" align="left"/>\r
</listhead>\r
\r
<template name="model">\r
package user.jobengine.server.steps;\r
\r
-import org.apache.logging.log4j.Marker;\r
-import org.apache.logging.log4j.MarkerManager;\r
-\r
import user.jobengine.server.IJobEngine;\r
import user.jobengine.server.IJobRuntime;\r
\r
public interface IJobStep {\r
- static final Marker INFO_MARKER = MarkerManager.getMarker("INFO-MARKER");\r
- static final Marker ERROR_MARKER = MarkerManager.getMarker("ERROR-MARKER");\r
\r
boolean canContinue();\r
\r