Package com.ibm.as400.access

Examples of com.ibm.as400.access.IFSFileInputStream


    @Override
    public void start() throws Exception {
        if (queue == null) {
            AS400 system = endpoint.getSystem();
            if (endpoint.isKeyed()) {
                queue = new KeyedDataQueue(system, endpoint.getObjectPath());
            } else {
                queue = new DataQueue(system, endpoint.getObjectPath());
            }
        }
        if (!queue.getSystem().isConnected(AS400.DATAQUEUE)) {
View Full Code Here


    }

    private Exchange receive(KeyedDataQueue queue, long timeout) throws Exception {
        String key = endpoint.getSearchKey();
        String searchType = endpoint.getSearchType().name();
        KeyedDataQueueEntry entry;
        if (timeout >= 0) {
            int seconds = (int) timeout / 1000;
            log.trace("Reading from data queue: {} with {} seconds timeout", queue.getName(), seconds);
            entry = queue.read(key, seconds, searchType);
        } else {
            log.trace("Reading from data queue: {} with no timeout", queue.getName());
            entry = queue.read(key, -1, searchType);
        }

        Exchange exchange = new DefaultExchange(endpoint.getCamelContext());
        if (entry != null) {
            exchange.getIn().setHeader(Jt400DataQueueEndpoint.SENDER_INFORMATION, entry.getSenderInformation());
            if (endpoint.getFormat() == Format.binary) {
                exchange.getIn().setBody(entry.getData());
                exchange.getIn().setHeader(Jt400DataQueueEndpoint.KEY, entry.getKey());
            } else {
                exchange.getIn().setBody(entry.getString());
                exchange.getIn().setHeader(Jt400DataQueueEndpoint.KEY, entry.getKeyString());
            }

            return exchange;
        }
        return null;
View Full Code Here

          + CharConverter.byteArrayToString(mAS400, mParameters[0]
              .getInputData());

    // Constructs a program call object for specified server, program name,
    // and parameter list.
    ProgramCall programCall = new ProgramCall(mAS400, mProgramName,
        mParameters);

    try
    {
      Trace.info("Program " + mProgramName + " called");
      // Run the program.
      if (!programCall.run())
      {
        // Show the messages
        AS400Message[] msgList = programCall.getMessageList();
        StringBuffer buf = new StringBuffer();
        for (int i = 1; i < msgList.length; i++)
        {
          buf.append(msgList[i].getText());
        } // for (int i = 1; i < msgList.length; i++)
View Full Code Here

        AS400 iSeries = getISeriesEndpoint().getiSeries();

        String commandStr = getISeriesEndpoint().getProgramToExecute();
        ProgramParameter[] parameterList = getParameterList(exchange);

        ProgramCall pgmCall = new ProgramCall(iSeries);
        pgmCall.setProgram(commandStr);
        pgmCall.setParameterList(parameterList);

        if (LOG.isDebugEnabled()) {
            LOG.trace("Starting to call PGM '{}' in host '{}' authentication with the user '{}'",
                    new Object[]{commandStr, iSeries.getSystemName(), iSeries.getUserId()});
        }

        boolean result = pgmCall.run();

        if (LOG.isTraceEnabled()) {
            LOG.trace("Executed PGM '{}' in host '{}'. Success? {}", new Object[]{commandStr, iSeries.getSystemName(), result});
        }
View Full Code Here

        AS400 iSeries = getISeriesEndpoint().getiSeries();

        String commandStr = getISeriesEndpoint().getProgramToExecute();
        ProgramParameter[] parameterList = getParameterList(exchange);

        ProgramCall pgmCall = new ProgramCall(iSeries);
        pgmCall.setProgram(commandStr);
        pgmCall.setParameterList(parameterList);

        if (LOG.isDebugEnabled()) {
            LOG.trace("Starting to call PGM '" + commandStr + "' in host '" + iSeries.getSystemName()
                    + "' authentication with the user '" + iSeries.getUserId() + "'");
        }

        boolean result = pgmCall.run();

        if (LOG.isTraceEnabled()) {
            LOG.trace("Executed PGM '" + commandStr + "' in host '" + iSeries.getSystemName() + "'. Success? " + result);
        }
View Full Code Here

    public void process(Exchange exchange) throws Exception {

        String commandStr = getISeriesEndpoint().getProgramToExecute();
        ProgramParameter[] parameterList = getParameterList(exchange);

        ProgramCall pgmCall = new ProgramCall(iSeries);
        pgmCall.setProgram(commandStr);
        pgmCall.setParameterList(parameterList);

        if (LOG.isDebugEnabled()) {
            LOG.trace("Starting to call PGM '{}' in host '{}' authentication with the user '{}'",
                    new Object[]{commandStr, iSeries.getSystemName(), iSeries.getUserId()});
        }

        boolean result = pgmCall.run();

        if (LOG.isTraceEnabled()) {
            LOG.trace("Executed PGM '{}' in host '{}'. Success? {}", new Object[]{commandStr, iSeries.getSystemName(), result});
        }
View Full Code Here

        AS400 iSeries = getISeriesEndpoint().getiSeries();

        String commandStr = getISeriesEndpoint().getProgramToExecute();
        ProgramParameter[] parameterList = getParameterList(exchange);

        ProgramCall pgmCall = new ProgramCall(iSeries);
        pgmCall.setProgram(commandStr);
        pgmCall.setParameterList(parameterList);

        if (LOG.isDebugEnabled()) {
            LOG.trace("Starting to call PGM '{}' in host '{}' authentication with the user '{}'",
                    new Object[]{commandStr, iSeries.getSystemName(), iSeries.getUserId()});
        }

        boolean result = pgmCall.run();

        if (LOG.isTraceEnabled()) {
            LOG.trace("Executed PGM '{}' in host '{}'. Success? {}", new Object[]{commandStr, iSeries.getSystemName(), result});
        }
View Full Code Here

          mInputParams.length());
      mInputParams.append(XStringSupport.getNumberString(callNumber - 1,
          mCountLength));
    }

    parameters[0] = new ProgramParameter(mConverter
        .stringToByteArray(mInputParams.toString()));

    /*
     * Filling the output parameters
     */
    if (callNumber == 1)
    {
      NodeList output = doc.getElementsByTagName(TAG_OUTPUT);
      if (output.getLength() != 1)
      {
        throw new XException(Constants.LOCATION_EXTERN,
            Constants.LAYER_TECHNICAL,
            Constants.PACKAGE_TECHNICAL_AS400, "47");
      }
      mOutputFields = getFields(output.item(0).getChildNodes());
    }
    if ((CALLTYPE_MULTI.equals(callType)) && callNumber == 1)
    {
      Configuration config = Configuration.getInstance();
      mCountLength = config.getValueAsInt("AS400Program", function,
          "CounterLength");
      parameters[1] = new ProgramParameter(mCountLength);
    }
    else
    {
      if (callNumber < 3)
      {
        Field field = null;
        for (Iterator it = mOutputFields.iterator(); it.hasNext();)
        {
          field = (Field) it.next();
          mOutputLength = mOutputLength + field.length;
        }
      }
      parameters[1] = new ProgramParameter(mOutputLength);
    }
    return parameters;
  }
View Full Code Here

            if (output) {
                outputLength = getISeriesEndpoint().getOutputFieldLength(i);
            }

            if (input && output) {
                parameterList[i] = new ProgramParameter(inputData, outputLength);
            }
            if (input) {
                parameterList[i] = new ProgramParameter(inputData);
            }
            if (output) {
                parameterList[i] = new ProgramParameter(outputLength);
            }
        }

        return parameterList;
    }
View Full Code Here

            if (output) {
                outputLength = getISeriesEndpoint().getOutputFieldLength(i);
            }

            if (input && output) {
                parameterList[i] = new ProgramParameter(inputData, outputLength);
            }
            if (input) {
                parameterList[i] = new ProgramParameter(inputData);
            }
            if (output) {
                parameterList[i] = new ProgramParameter(outputLength);
            }
        }

        return parameterList;
    }
View Full Code Here

TOP

Related Classes of com.ibm.as400.access.IFSFileInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.