Examples of OperationContextImpl


Examples of org.rhq.core.pc.operation.OperationContextImpl

            }
            return;
        }

        OperationManager operationManager = PluginContainer.getInstance().getOperationManager();
        OperationContext operationContext = new OperationContextImpl(resourceId, operationManager);
        OperationServices operationServices = operationContext.getOperationServices();
        opId++;

        Configuration config = null;
        if (tokens.length > 2)
            config = createConfigurationFromString(tokens[2]);
View Full Code Here

Examples of org.rhq.core.pc.operation.OperationContextImpl

        SystemInfo systemInfo = SystemInfoFactory.createSystemInfo();
        File temporaryDirectory = temp;
        File dataDirectory = temp;
        String pluginContainerName = "rhq";
        EventContext eventContext = new EventContextImpl(resource, eventManager);
        OperationContext operationContext = new OperationContextImpl(0);
        ContentContext contentContext = new ContentContextImpl(0);
        PluginContainerDeployment pluginContainerDeployment = null;
        AvailabilityContext availContext = new AvailabilityContextImpl(resource, pluginContainer.getInventoryManager());
        InventoryContext inventoryContext = new InventoryContextImpl(resource, pluginContainer.getInventoryManager());
        ResourceContext context = new ResourceContext(resource, parentResourceComponent, parentResourceContext,
View Full Code Here

Examples of org.rhq.core.pc.operation.OperationContextImpl

    public void shutdownStorageNode() throws Exception {
        OperationManager operationManager = PluginContainer.getInstance().getOperationManager();
        OperationServicesAdapter operationsService = new OperationServicesAdapter(operationManager);

        long timeout = 1000 * 60;
        OperationContextImpl operationContext = new OperationContextImpl(storageNode.getId(), operationManager);
        OperationServicesResult result = operationsService.invokeOperation(operationContext, "shutdown",
            new Configuration(), timeout);

        assertEquals(result.getResultCode(), OperationServicesResultCode.SUCCESS, "The shutdown operation failed");

View Full Code Here

Examples of org.rhq.core.pc.operation.OperationContextImpl

    public void restartStorageNode() {
        OperationManager operationManager = PluginContainer.getInstance().getOperationManager();
        OperationServicesAdapter operationsService = new OperationServicesAdapter(operationManager);

        long timeout = 1000 * 60;
        OperationContextImpl operationContext = new OperationContextImpl(storageNode.getId(), operationManager);
        OperationServicesResult result = operationsService.invokeOperation(operationContext, "start",
            new Configuration(), timeout);

        assertEquals(result.getResultCode(), OperationServicesResultCode.SUCCESS, "The start operation failed.");

View Full Code Here

Examples of org.rhq.core.pc.operation.OperationContextImpl

        }
        OperationManager operationManager = PluginContainer.getInstance().getOperationManager();
        OperationServicesAdapter operationsService = new OperationServicesAdapter(operationManager);

        long timeout = 1000 * 60;
        OperationContextImpl operationContext = new OperationContextImpl(storageNode.getId(), operationManager);
        return operationsService.invokeOperation(operationContext, "takeSnapshot", params, timeout);
    }
View Full Code Here

Examples of org.rhq.core.pc.operation.OperationContextImpl

            OperationManager operationManager = PluginContainer.getInstance().getOperationManager();
            OperationServicesAdapter operationsService = new OperationServicesAdapter(operationManager);

            long timeout = 1000 * 60;
            OperationContextImpl operationContext = new OperationContextImpl(newStorageNode.getId(), operationManager);
            OperationServicesResult result = operationsService.invokeOperation(operationContext, "prepareForBootstrap",
                params, timeout);

            log.info("Waiting for node to boostrap...");
            // When a node goes through bootstrap, StorageService sleeps for RING_DELAY ms
View Full Code Here

Examples of org.waveprotocol.box.server.robots.OperationContextImpl

    WaveletProvider waveletProvider = mock(WaveletProvider.class);
    EventDataConverter converter = mock(EventDataConverter.class);
    ConversationUtil conversationUtil = mock(ConversationUtil.class);

    OperationContextImpl context =
        new OperationContextImpl(waveletProvider, converter, conversationUtil);

    operationService.execute(request, context, BOB);

    JsonRpcResponse response = context.getResponse(request.getId());
    assertFalse("Expected non error response", response.isError());
    assertTrue("Empty Response must be set", response.getData().isEmpty());
  }
View Full Code Here

Examples of org.waveprotocol.box.server.robots.OperationContextImpl

  public void testFetchWave() throws Exception {
    String message = "A message";
    OperationRequest operation =
        operationRequest(OperationType.ROBOT_FETCH_WAVE,
            Parameter.of(ParamsProperty.MESSAGE, message));
    OperationContextImpl context = helper.getContext();
    WaveletProvider waveletProvider = helper.getWaveletProvider();
    when(waveletProvider.checkAccessPermission(WAVELET_NAME, ALEX)).thenReturn(true);

    service.execute(operation, context, ALEX);

    ObservableConversation conversation =
        context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
    assertNotNull("expected a response", response);
    assertFalse("expected a success response", response.isError());
    assertEquals("Expected the response to carry the message", message,
        response.getData().get(ParamsProperty.MESSAGE));
    assertNotNull("Expected the response to carry a wavelet",
View Full Code Here

Examples of org.waveprotocol.box.server.robots.OperationContextImpl

  public void testFetchWaveWithMissingParamThrowsInvalidRequestException() throws Exception {
    // No wave id or wavelet id set.
    OperationRequest operation = new OperationRequest(OperationType.ROBOT_FETCH_WAVE.method(),
        OPERATION_ID);
    OperationContextImpl context = helper.getContext();

    try {
      service.execute(operation, context, ALEX);
      fail("Expected InvalidRequestException because params were not set");
    } catch (InvalidRequestException e) {
View Full Code Here

Examples of org.waveprotocol.box.server.robots.OperationContextImpl

    blipData = new BlipData(s(WAVE_ID), s(WAVELET_ID), TEMP_BLIP_ID, NEW_BLIP_CONTENT);
    blipData.setBlipId(TEMP_BLIP_ID);
  }

  public void testContinueThread() throws Exception {
    OperationContextImpl context = helper.getContext();
    ObservableConversation conversation =
        context.openConversation(WAVE_ID, WAVELET_ID, ALEX).getRoot();

    // Append a random blip to check that we actually append to the end of this
    // thread.
    conversation.getRootThread().appendBlip();

    // Append to continue the thread of the root blip
    String rootBlipId = ConversationUtil.getRootBlipId(conversation);
    OperationRequest operation = operationRequest(OperationType.BLIP_CONTINUE_THREAD,
        rootBlipId, Parameter.of(ParamsProperty.BLIP_DATA, blipData));

    service.execute(operation, context, ALEX);

    JsonRpcResponse response = context.getResponse(OPERATION_ID);
    assertFalse(response.isError());

    ConversationBlip newBlip = checkAndGetNewBlip(context, conversation, response);

    Iterator<? extends ObservableConversationBlip> it =
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.