Search in sources :

Example 1 with RevokeResultType

use of org.apache.cxf.xkms.model.xkms.RevokeResultType in project cxf by apache.

the class XKMSService method revoke.

@Override
public RevokeResultType revoke(RevokeRequestType request) {
    RevokeResultType response = XKMSResponseFactory.createResponse(request, new RevokeResultType());
    try {
        assertXKRSSAllowed();
        validateRequest(request);
        for (Register handler : keyRegisterHandlers) {
            if (handler.canProcess(request)) {
                return handler.revoke(request, response);
            }
        }
        throw new UnsupportedOperationException("Service was unable to handle your request");
    } catch (Exception e) {
        return handleException("revoke", e, response);
    }
}
Also used : Register(org.apache.cxf.xkms.handlers.Register) RevokeResultType(org.apache.cxf.xkms.model.xkms.RevokeResultType)

Example 2 with RevokeResultType

use of org.apache.cxf.xkms.model.xkms.RevokeResultType in project cxf by apache.

the class CheckXKRSS method createXKMSService.

XKMSService createXKMSService(boolean enableXKRSS) {
    XKMSService xkmsService = new XKMSService();
    List<Register> keyRegisterHandlers = new ArrayList<>();
    keyRegisterHandlers.add(new Register() {

        @Override
        public RevokeResultType revoke(RevokeRequestType request, RevokeResultType response) {
            return response;
        }

        @Override
        public ReissueResultType reissue(ReissueRequestType request, ReissueResultType response) {
            return response;
        }

        @Override
        public RegisterResultType register(RegisterRequestType request, RegisterResultType response) {
            return response;
        }

        @Override
        public boolean canProcess(RequestAbstractType request) {
            return true;
        }

        @Override
        public RecoverResultType recover(RecoverRequestType request, RecoverResultType response) {
            return response;
        }
    });
    xkmsService.setKeyRegisterHandlers(keyRegisterHandlers);
    xkmsService.setEnableXKRSS(enableXKRSS);
    return xkmsService;
}
Also used : RegisterResultType(org.apache.cxf.xkms.model.xkms.RegisterResultType) ReissueResultType(org.apache.cxf.xkms.model.xkms.ReissueResultType) RegisterRequestType(org.apache.cxf.xkms.model.xkms.RegisterRequestType) ArrayList(java.util.ArrayList) RecoverRequestType(org.apache.cxf.xkms.model.xkms.RecoverRequestType) RevokeRequestType(org.apache.cxf.xkms.model.xkms.RevokeRequestType) RecoverResultType(org.apache.cxf.xkms.model.xkms.RecoverResultType) Register(org.apache.cxf.xkms.handlers.Register) RevokeResultType(org.apache.cxf.xkms.model.xkms.RevokeResultType) ReissueRequestType(org.apache.cxf.xkms.model.xkms.ReissueRequestType) RequestAbstractType(org.apache.cxf.xkms.model.xkms.RequestAbstractType)

Aggregations

Register (org.apache.cxf.xkms.handlers.Register)2 RevokeResultType (org.apache.cxf.xkms.model.xkms.RevokeResultType)2 ArrayList (java.util.ArrayList)1 RecoverRequestType (org.apache.cxf.xkms.model.xkms.RecoverRequestType)1 RecoverResultType (org.apache.cxf.xkms.model.xkms.RecoverResultType)1 RegisterRequestType (org.apache.cxf.xkms.model.xkms.RegisterRequestType)1 RegisterResultType (org.apache.cxf.xkms.model.xkms.RegisterResultType)1 ReissueRequestType (org.apache.cxf.xkms.model.xkms.ReissueRequestType)1 ReissueResultType (org.apache.cxf.xkms.model.xkms.ReissueResultType)1 RequestAbstractType (org.apache.cxf.xkms.model.xkms.RequestAbstractType)1 RevokeRequestType (org.apache.cxf.xkms.model.xkms.RevokeRequestType)1