Example usage for javax.xml.registry FindException FindException

List of usage examples for javax.xml.registry FindException FindException

Introduction

In this page you can find the example usage for javax.xml.registry FindException FindException.

Prototype

public FindException(Throwable cause) 

Source Link

Document

Constructs a JAXRException object initialized with the given Throwable object.

Usage

From source file:it.cnr.icar.eric.client.xml.registry.BulkResponseImpl.java

/**
 * Note: BulkResponseImpl is not an infomodel object even though this
 * constructor looks like constructors in the infomodel subpackage.
 * Therefore, the LifeCycleManagerImpl argument is not stored.
 *//*  w  w  w .  ja  va  2 s  . c o  m*/
public BulkResponseImpl(LifeCycleManagerImpl lcm, RegistryResponseType ebResponse,
        @SuppressWarnings("rawtypes") Map responseAttachments) throws JAXRException {
    requestId = it.cnr.icar.eric.common.Utility.getInstance().createId();

    this.ebResponse = ebResponse;
    String ebStatus = ebResponse.getStatus();

    if (ebStatus.equals(BindingUtility.CANONICAL_RESPONSE_STATUS_TYPE_ID_Success)) {
        status = STATUS_SUCCESS;
    } else if (ebStatus.equals(BindingUtility.CANONICAL_RESPONSE_STATUS_TYPE_ID_Unavailable)) {
        status = STATUS_UNAVAILABLE;
    } else {
        status = STATUS_FAILURE;
    }

    if (ebResponse instanceof AdhocQueryResponse) {
        AdhocQueryResponse aqr = (AdhocQueryResponse) ebResponse;
        RegistryObjectListType queryResult = aqr.getRegistryObjectList();
        processQueryResult(queryResult, lcm, responseAttachments);
    }

    RegistryErrorList errList = ebResponse.getRegistryErrorList();

    if (errList != null) {
        List<RegistryError> errs = errList.getRegistryError();
        Iterator<RegistryError> iter = errs.iterator();

        while (iter.hasNext()) {
            Object obj = iter.next();
            RegistryError ebRegistryError = (RegistryError) obj;

            // XXX Need to add additional error info to exception somehow
            addRegistryException(new FindException(ebRegistryError.getValue()));
        }

        // XXX What to do about optional highestSeverity attr???
        //             errList.getHighestSeverity();
    }

    ((RegistryServiceImpl) (lcm.getRegistryService())).setBulkResponse(this);
}