Search in sources :

Example 31 with Error

use of org.eclipse.bpmn2.Error in project ovirt-engine-sdk-java by oVirt.

the class SsoUtils method buildSsoRevokeUrl.

/**
 * Construct SSO URL to revoke SSO token
 *
 * @param url oVirt engine URL
 * @return URI to be used to revoke token
 */
public static URI buildSsoRevokeUrl(String url) {
    try {
        URI uri = new URI(url);
        URIBuilder uriBuilder = new URIBuilder(String.format("%1$s://%2$s/ovirt-engine/services/sso-logout", uri.getScheme(), uri.getAuthority()));
        return uriBuilder.build();
    } catch (URISyntaxException ex) {
        throw new Error("Failed to build SSO revoke URL", ex);
    }
}
Also used : Error(org.ovirt.engine.sdk4.Error) URISyntaxException(java.net.URISyntaxException) URI(java.net.URI) URIBuilder(org.apache.http.client.utils.URIBuilder)

Example 32 with Error

use of org.eclipse.bpmn2.Error in project openflowplugin by opendaylight.

the class StackedSegment method completeEntry.

private static boolean completeEntry(final OutboundQueueEntry entry, final OfHeader response) {
    if (response instanceof Error) {
        final Error err = (Error) response;
        LOG.debug("Device-reported request XID {} failed {}:{}", response.getXid(), err.getTypeString(), err.getCodeString());
        entry.fail(new DeviceRequestFailedException("Device-side failure", err));
        return true;
    }
    return entry.complete(response);
}
Also used : Error(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error) DeviceRequestFailedException(org.opendaylight.openflowjava.protocol.api.connection.DeviceRequestFailedException)

Example 33 with Error

use of org.eclipse.bpmn2.Error in project openflowplugin by opendaylight.

the class DeviceContextImplTest method testProcessReply.

@Test
public void testProcessReply() {
    final Error mockedError = mock(Error.class);
    deviceContext.processReply(mockedError);
    verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE));
    final OfHeader mockedOfHeader = mock(OfHeader.class);
    deviceContext.processReply(mockedOfHeader);
    verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
}
Also used : OfHeader(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader) Error(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.Error) Test(org.junit.Test)

Aggregations

Error (org.ovirt.engine.sdk4.Error)11 IOException (java.io.IOException)8 Error (org.eclipse.bpmn2.Error)8 AdHocSubProcess (org.eclipse.bpmn2.AdHocSubProcess)7 Escalation (org.eclipse.bpmn2.Escalation)7 Process (org.eclipse.bpmn2.Process)6 RootElement (org.eclipse.bpmn2.RootElement)6 Signal (org.eclipse.bpmn2.Signal)6 SubProcess (org.eclipse.bpmn2.SubProcess)6 URI (java.net.URI)5 ArrayList (java.util.ArrayList)5 Entry (java.util.Map.Entry)5 Error (org.bytedeco.javacpp.FlyCapture2.Error)5 ErrorEventDefinition (org.eclipse.bpmn2.ErrorEventDefinition)5 Iterator (java.util.Iterator)4 Activity (org.eclipse.bpmn2.Activity)4 CallActivity (org.eclipse.bpmn2.CallActivity)4 CompensateEventDefinition (org.eclipse.bpmn2.CompensateEventDefinition)4 ConditionalEventDefinition (org.eclipse.bpmn2.ConditionalEventDefinition)4 Definitions (org.eclipse.bpmn2.Definitions)4