繁体   English   中英

使用我们可以在as400中完成的所有操作(如view,change..etc)在Java中获取用户的SpooleFileList

[英]Getting SpooleFileList of a user in java with all the operations which we can do in as400(like view,change..etc)

我想要以以下格式输出,执行WRKSPLF时以as400格式输出

As400屏幕截图

我正在使用以下代码从as400中检索信息

         try
            {
                AS400 as400System = new AS400();
                String strSpooledFileName;

                SpooledFileList splfList = new SpooledFileList(as400System);

                splfList.openAsynchronously();

                splfList.waitForListToComplete();

                Enumeration enume= splfList.getObjects();
                ArrayList<SpoolVO> list = new ArrayList<SpoolVO>();

                while( enume.hasMoreElements() )
                {
                    SpoolVO splVO = new SpoolVO();
                    SpooledFile splf = (SpooledFile)enume.nextElement();
                    if (splf != null)
                    {
                        // output this spooled file's name
                        splVO.setFileName(splf.getStringAttribute(SpooledFile.ATTR_SPOOLFILE));
                        splVO.setUserName(splf.getStringAttribute(SpooledFile.ATTR_JOBUSER));
                        splVO.setUserData(splf.getStringAttribute(SpooledFile.ATTR_USERDATA));
                        splVO.setDevice(splf.getStringAttribute(SpooledFile.ATTR_OUTPUT_QUEUE));
                        splVO.setTotalPages(splf.getIntegerAttribute(SpooledFile.ATTR_PAGES));
                        splVO.setCurrentPage(splf.getIntegerAttribute(SpooledFile.ATTR_CURPAGE));
                        splVO.setCopy(splf.getIntegerAttribute(SpooledFile.ATTR_COPIES));

                        list.add(splVO);
                    }
                }
          splfList.close();

现在,通过使用上面的代码,我可以获取除Options(Opt)之外的所有字段。 我想要Java中的“选项”字段,这使我能够执行屏幕快照中指定的所有操作,例如发送,更改,保持等。

使用Java可以做到这一点吗?

提前致谢。

猜测您正在使用JT400 ,则可以使用SpooledFileListSpooledFile来获取所需的详细信息。 编辑您的问题以解释您要检索的特定详细信息。 发布您尝试的代码。

编辑:

“选项”字段不是假脱机文件的属性; 您无法从任何地方检索它。 它是显示面板上的字段,允许用户请求要由WRKSPLF命令执行的操作。 您将需要在Java程序中提供该功能。 例如,如果您的最终用户键入3,则将发出HLDSPLF命令。 如果她输入6,则将发出RLSSPLF命令。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM