Search in sources :

Example 1 with SignStringParameters

use of org.ovirt.engine.core.common.queries.SignStringParameters in project ovirt-engine by oVirt.

the class GetSignedWebsocketProxyTicketQuery method executeQueryCommandChecked.

private void executeQueryCommandChecked() throws IOException {
    final GraphicsInfo graphicsInfo = getGraphicsInfo();
    final Map<String, Object> ticketModel = createTicket(graphicsInfo);
    final String jsonTicket = new ObjectMapper().writeValueAsString(ticketModel);
    final String encodedTicket = URLEncoder.encode(jsonTicket, StandardCharsets.UTF_8.name());
    final String signedTicket = Backend.getInstance().runInternalQuery(QueryType.SignString, new SignStringParameters(encodedTicket)).getReturnValue();
    setReturnValue(signedTicket);
}
Also used : GraphicsInfo(org.ovirt.engine.core.common.businessentities.GraphicsInfo) SignStringParameters(org.ovirt.engine.core.common.queries.SignStringParameters) ObjectMapper(org.codehaus.jackson.map.ObjectMapper)

Example 2 with SignStringParameters

use of org.ovirt.engine.core.common.queries.SignStringParameters in project ovirt-engine by oVirt.

the class WebClientConsoleInvoker method invokeClient.

public void invokeClient() {
    Frontend.getInstance().runQuery(QueryType.SignString, new SignStringParameters(createConnectionString(host, port, useSsl)), new AsyncQuery<>((AsyncCallback<QueryReturnValue>) returnValue -> {
        String signedTicket = returnValue.getReturnValue();
        invokeClientNative(signedTicket);
    }));
}
Also used : AsyncCallback(org.ovirt.engine.ui.frontend.AsyncCallback) SignStringParameters(org.ovirt.engine.core.common.queries.SignStringParameters)

Aggregations

SignStringParameters (org.ovirt.engine.core.common.queries.SignStringParameters)2 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)1 GraphicsInfo (org.ovirt.engine.core.common.businessentities.GraphicsInfo)1 AsyncCallback (org.ovirt.engine.ui.frontend.AsyncCallback)1