Examples of RecoverResult


Examples of org.apache.qpid.transport.RecoverResult

     */
    public Xid[] recover(int flag) throws XAException
    {
        // the flag is ignored
        Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
        RecoverResult res = null;
        try
        {
            res = future.get();
        }
        catch (SessionException e)
        {
            // we need to restore the qpid session that has been closed
            _xaSession.createSession();
            convertExecutionErrorToXAErr( e.getException().getErrorCode());
        }
        Xid[] result =  new Xid[res.getInDoubt() != null ? res.getInDoubt().size() : 0];
        if(result.length != 0)
        {
            int i = 0;
            for (Object obj : res.getInDoubt())
            {
                org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
                result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
                i++;
            }
View Full Code Here

Examples of org.apache.qpid.transport.RecoverResult

     */
    public Xid[] recover(int flag) throws XAException
    {
        // the flag is ignored
        Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
        RecoverResult res = null;
        try
        {
            res = future.get();
        }
        catch (SessionException e)
        {
            // we need to restore the qpid session that has been closed
            _xaSession.createSession();
            convertExecutionErrorToXAErr( e.getException().getErrorCode());
        }
        Xid[] result =  new Xid[res.getInDoubt() != null ? res.getInDoubt().size() : 0];
        if(result.length != 0)
        {
            int i = 0;
            for (Object obj : res.getInDoubt())
            {
                org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
                result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
                i++;
            }
View Full Code Here

Examples of org.apache.qpid.transport.RecoverResult

     */
    public Xid[] recover(int flag) throws XAException
    {
        // the flag is ignored
        Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
        RecoverResult res = null;
        try
        {
            res = future.get();
        }
        catch (SessionException e)
        {
            // we need to restore the qpid session that has been closed
            _xaSession.createSession();
            convertExecutionErrorToXAErr( e.getException().getErrorCode());
        }
        Xid[] result = new Xid[res.getInDoubt().size()];
        int i = 0;
        for (Object obj : res.getInDoubt())
        {
            org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
            result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
            i++;
        }
View Full Code Here

Examples of org.apache.qpid.transport.RecoverResult

     */
    public Xid[] recover(int flag) throws XAException
    {
        // the flag is ignored
        Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
        RecoverResult res = null;
        try
        {
            res = future.get();
        }
        catch (SessionException e)
        {
            // we need to restore the qpid session that has been closed
            _xaSession.createSession();
            convertExecutionErrorToXAErr( e.getException().getErrorCode());
        }
        Xid[] result =  new Xid[res.getInDoubt() != null ? res.getInDoubt().size() : 0];
        if(result.length != 0)
        {
            int i = 0;
            for (Object obj : res.getInDoubt())
            {
                org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
                result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
                i++;
            }
View Full Code Here

Examples of org.apache.qpid.transport.RecoverResult

     */
    public Xid[] recover(int flag) throws XAException
    {
        // the flag is ignored
        Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
        RecoverResult res = null;
        try
        {
            res = future.get();
        }
        catch (SessionException e)
        {
            // we need to restore the qpid session that has been closed
            _xaSession.createSession();
            convertExecutionErrorToXAErr( e.getException().getErrorCode());
        }
        Xid[] result =  new Xid[res.getInDoubt() != null ? res.getInDoubt().size() : 0];
        if(result.length != 0)
        {
            int i = 0;
            for (Object obj : res.getInDoubt())
            {
                org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
                result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
                i++;
            }
View Full Code Here

Examples of org.wso2.xkms2.RecoverResult

            OMElement element = getAsOMElement(request);
            OMElement result = sendReceive(element, serverURL);
            result = buildElement(result);

            RecoverResult recoverResult = getRecoverResult(result);

            ResultMinor resultMinor = recoverResult.getResultMinor();
            if (resultMinor != null && ResultMinor.NO_MATCH.equals(resultMinor)) {
                return null;
            }

            org.wso2.xkms2.PrivateKey xkmsPrivateKey = recoverResult
                    .getPrivateKey();
            xkmsPrivateKey.setKey(XKMSKeyUtil.getPrivateKey(passPhrase,
                                                            "DESede"));
            KeyPair keyPair = xkmsPrivateKey.getRSAKeyPair();
            return keyPair.getPrivate();
View Full Code Here

Examples of org.wso2.xkms2.RecoverResult

        keyBinding.setId(getRamdomId());
        return keyBinding;
    }
   
    public static RecoverResult createRecoverResult() {
        RecoverResult recoverResult = new RecoverResult();
        recoverResult.setId(getRamdomId());
        return recoverResult;
    }
View Full Code Here

Examples of org.wso2.xkms2.RecoverResult

            if (aliases == null || aliases.length < 1) {
                throw new XKMSException(XKMSException.NO_MATCH, "keyNotFound");
            }

            RecoverResult recoverResult = XKMSUtil.createRecoverResult();
            buildResultType(request, recoverResult, aliases[0], keystore);
            return recoverResult;

        } catch (XKMSException ex) {
            RecoverResult recoverResult = XKMSUtil.createRecoverResult();
            buildFault(request, recoverResult, ex);
            return recoverResult;
        }

    }
View Full Code Here

Examples of org.wso2.xkms2.RecoverResult

    private RecoverResultBuilder() {
    }

    public XKMSElement buildElement(OMElement element) throws XKMSException {
        RecoverResult recoverResult = new RecoverResult();
        super.buildElement(element, recoverResult);

        OMElement keyBindingElem;
        for (Iterator iterator = element
                .getChildrenWithName(XKMS2Constants.ELE_KEY_BINDING); iterator
                .hasNext();) {
            keyBindingElem = (OMElement) iterator.next();
            recoverResult.addKeyBinding((KeyBinding) KeyBindingBuilder.INSTANCE
                    .buildElement(keyBindingElem));
        }

        OMElement privateKeyElem = element
                .getFirstChildWithName(XKMS2Constants.Q_ELEM_PRIVATE_KEY);

        if (privateKeyElem != null) {
            PrivateKey privateKey = (PrivateKey) PrivateKeyBuilder.INSTANCE.buildElement(privateKeyElem);
            recoverResult.setPrivateKey(privateKey);
        }

        return recoverResult;
    }
View Full Code Here

Examples of org.wso2.xkms2.RecoverResult

        super("RecoverResultBuilderTest");
    }

    public void testBuild() throws XKMSException, XMLSignatureException {
        OMElement recoverResultElem = getResourceAsElement("T4_RecoverResult-http.xml");
        RecoverResult recoverResult = (RecoverResult) RecoverResultBuilder.INSTANCE
                .buildElement(recoverResultElem);
        assertNotNull(recoverResult);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.