Package com.ibm.as400.access

Examples of com.ibm.as400.access.AS400FileRecordDescription


    }

    @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());
            }
View Full Code Here


    @Override
    public void stop() throws Exception {
        if (queue != null) {
            LOG.info("Releasing connection to {}", endpoint);
            AS400 system = queue.getSystem();
            queue = null;
            endpoint.releaseSystem(system);
        }
    }
View Full Code Here

        throw new UnsupportedOperationException();
    }

    @Override
    public AS400 getConnection(String systemName, String userID, String password) throws ConnectionPoolException {
        return new AS400(systemName, userID, password);
    }
View Full Code Here

        return getConnection(systemName, userID, password, locale);
    }

    @Override
    public AS400 getConnection(String systemName, String userID, String password, Locale locale) throws ConnectionPoolException {
        AS400 connection = getConnection(systemName, userID, password);
        connection.setLocale(locale);
        return connection;
    }
View Full Code Here

    protected Jt400DataQueueEndpoint(String endpointUri, Jt400Component component) throws CamelException {
        super(endpointUri, component);
        try {
            URI uri = new URI(endpointUri);
            String[] credentials = uri.getUserInfo().split(":");
            system = new AS400(uri.getHost(), credentials[0], credentials[1]);
            objectPath = uri.getPath();
        } catch (URISyntaxException e) {
            throw new CamelException("Unable to parse URI for " + endpointUri, e);
        }
    }
View Full Code Here

        return (Jt400PgmEndpoint) super.getEndpoint();
    }

    public void process(Exchange exchange) throws Exception {

        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});
        }

        if (result) {
            handlePGMOutput(exchange, pgmCall, parameterList);
        } else {
View Full Code Here

            if (input) {
                if (param != null) {
                    AS400DataType typeConverter;
                    if (getISeriesEndpoint().getFormat() == Format.binary) {
                        typeConverter = new AS400ByteArray(length);
                    } else {
                        typeConverter = new AS400Text(length, iSeries);
                    }
                    inputData = typeConverter.toBytes(param);
                }
View Full Code Here

            if (output != null) {
                int length = pgmParam.getOutputDataLength();
                AS400DataType typeConverter;
                if (getISeriesEndpoint().getFormat() == Format.binary) {
                    typeConverter = new AS400ByteArray(length);
                } else {
                    typeConverter = new AS400Text(length, iSeries);
                }
                javaValue = typeConverter.toObject(output);
            }
View Full Code Here

        ObjectHelper.notNull(parameters, "parameters", this);
        if (!parameters.containsKey(Jt400Component.CONNECTION_POOL)) {
            throw new RuntimeCamelException(String.format("parameters must specify '%s'", Jt400Component.CONNECTION_POOL));
        }
        String poolId = parameters.get(Jt400Component.CONNECTION_POOL).toString();
        AS400ConnectionPool connectionPool = EndpointHelper.resolveReferenceParameter(camelContext, poolId, AS400ConnectionPool.class, true);
        try {
            this.baseEndpoint = new Jt400Endpoint(endpointUri, connectionPool);
        } catch (URISyntaxException e) {
            throw new RuntimeCamelException("Unable to parse URI for " + endpointUri, e);
        }
View Full Code Here

    private AS400ConnectionPool connectionPool;

    @Override
    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> properties) throws Exception {
        String type = remaining.substring(remaining.lastIndexOf(".") + 1).toUpperCase();
        AS400ConnectionPool connectionPool;
        if (properties.containsKey(CONNECTION_POOL)) {
            LOG.trace("AS400ConnectionPool instance specified in the URI - will look it up.");
           
            // We have chosen to handle the connectionPool option ourselves, so
            // we must remove it from the given parameter list (see
View Full Code Here

TOP

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

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.