Package net.sf.jz3950

Examples of net.sf.jz3950.Association


    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        this.association = new Association();
    }
View Full Code Here


    @Override
    protected void setUp() throws Exception
    {
        super.setUp();
        this.association = new Association();
    }
View Full Code Here

        PresentResponse_type presentResponse = (PresentResponse_type) pdu.o;
        Records_type recordsType = presentResponse.records;

        if (recordsType == null)
        {
            throw new ProtocolException("Records attribute of present-response PDU is null");
        }

        if (recordsType.which != Records_type.responserecords_CID)
        {
            // TODO: care about diagnostic records
            throw new ProtocolException("Present-response PDU does not contain response records (maybe diagnostic info)");
        }

        this.records = new ArrayList<Record>(this.numOfRecords);

        for (NamePlusRecord_type namePlusRecordType : (List<NamePlusRecord_type>) recordsType.o)
        {
            for (RecordDecoder decoder : this.association.getRecordDecoders())
            {
                if (decoder.decodes(namePlusRecordType))
                {
                    try
                    {
                        this.records.add(decoder.decode(namePlusRecordType));

                        break;
                    }
                    catch (RecordFormatException e)
                    {
                        throw new ProtocolException("Record format error while parsing present-response PDU", e);
                    }
                }
            }
        }
    }
View Full Code Here

            return toPDU(PDU_type.searchrequest_CID, searchRequest);
        }
        catch (InvalidQueryException e)
        {
            throw new ProtocolException("Invalid query: " + this.query, e);
        }
    }
View Full Code Here

                {
                    errorMessage.append(" [condition: " + diagnostics.condition + "; diagnostic: \"" + diagnostics.addinfo.o.toString() + "\"]");
                }
            }

            throw new ProtocolException(errorMessage.toString());
        }

        if (searchResponse.numberOfRecordsReturned.intValue() > 0)
        {
            // TODO: consume those
            throw new ProtocolException("Search request returned records, although none were requested");
        }

        this.numOfResults = searchResponse.resultCount.intValue();
        this.nextResult = searchResponse.nextResultSetPosition.intValue() + 1;
    }
View Full Code Here

            this.referenceId = ((initResponse.referenceId == null) ? null : new String(initResponse.referenceId));
        }
        else
        {
            throw new ProtocolException("INIT was unsuccessful; disconnecting");
        }
    }
View Full Code Here

    {
        InitializeResponse_type initResponse = (InitializeResponse_type) pdu.o;

        if (initResponse.result)
        {
            this.targetInformation = new TargetInformation();
            this.targetInformation.setImplementationId(initResponse.implementationId);
            this.targetInformation.setImplementationName(initResponse.implementationName);
            this.targetInformation.setImplementationVersion(initResponse.implementationVersion);

            if (initResponse.options.isSet(14))
View Full Code Here

        connect(host, port, SimpleAuthenticationMethod.NONE);
    }

    public void connect(String host, int port, String user, String password) throws IOException, ProtocolException
    {
        AuthenticationMethod auth = new SimpleAuthenticationMethod(AuthenticationMethod.AUTH_TYPE_ID_PASS, user, null, password);
        connect(host, port, auth);
    }
View Full Code Here

        connect(host, port, SimpleAuthenticationMethod.NONE);
    }

    public void connect(String host, int port, String user, String password) throws IOException, ProtocolException
    {
        AuthenticationMethod auth = new SimpleAuthenticationMethod(AuthenticationMethod.AUTH_TYPE_ID_PASS, user, null, password);
        connect(host, port, auth);
    }
View Full Code Here

         * Connecting to remote host
         */
        logger.debug("Connecting to " + getTarget());
        this.connection = new Socket(this.host, this.port);
        this.connection.setSoTimeout(this.serverTimeout * 1000);
        this.inputThread = new ProtocolInputThread("<--" + getTarget(), this.connection.getInputStream());
        this.outputThread = new ProtocolOutputThread("-->" + getTarget(), this.connection.getOutputStream());

        /*
         * INIT-Handshake
         */
 
View Full Code Here

TOP

Related Classes of net.sf.jz3950.Association

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.