Examples of CreateObjectCommand


Examples of org.apache.cloudstack.storage.command.CreateObjectCommand

    @Override
    public void createAsync(DataObject vol,
            AsyncCompletionCallback<CreateCmdResult> callback) {
        EndPoint ep = selector.select(vol);
        CreateObjectCommand createCmd = new CreateObjectCommand(vol.getUri());
       
        CreateVolumeContext<CreateCmdResult> context = new CreateVolumeContext<CreateCmdResult>(callback, vol);
        AsyncCallbackDispatcher<DefaultPrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
        caller.setContext(context)
            .setCallback(caller.getTarget().createAsyncCallback(null, null));
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CreateObjectCommand

        try {
            DecodedDataObject obj = Decoder.decode(uri);
            if (obj.getPath() == null) {
                //create an obj
                EndPoint newEp = selector.select(object);
                CreateObjectCommand createCmd = new CreateObjectCommand(uri);
                CreateObjectAnswer answer = (CreateObjectAnswer)ep.sendMessage(createCmd);
                if (answer.getResult()) {
                    dataObjMgr.update(object, answer.getPath(), answer.getSize());
                } else {
                    s_logger.debug("failed to create object" + answer.getDetails());
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CreateObjectCommand

            if (ep == null) {
                result.setResult("can't find storage client for:" + data.getId() + "," + data.getType());
                callback.complete(result);
                return;
            }
            CreateObjectCommand createCmd = new CreateObjectCommand(data.getUri());
            CreateObjectAnswer answer = (CreateObjectAnswer)ep.sendMessage(createCmd);
            if (answer.getResult()) {
                //update imagestorevo
              
                result = new CreateCmdResult(answer.getPath(), answer.getSize());
View Full Code Here

Examples of org.apache.cloudstack.storage.command.CreateObjectCommand

        if (ep == null) {
            String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
            s_logger.error(errMsg);
            throw new CloudRuntimeException(errMsg);
        }
        CreateObjectCommand createCmd = new CreateObjectCommand(null);

        CreateVolumeContext<CreateCmdResult> context = new CreateVolumeContext<CreateCmdResult>(callback, vol);
        AsyncCallbackDispatcher<SamplePrimaryDataStoreDriverImpl, Answer> caller = AsyncCallbackDispatcher.create(this);
        caller.setContext(context).setCallback(caller.getTarget().createAsyncCallback(null, null));
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand

    private PersistenceCommand command2;
    private PersistenceCommand command3;


    private CreateObjectCommand createCreateCommand(final ObjectAdapter object, final String name) {
        return new CreateObjectCommand() {

            @Override
            public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
            }
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand

    private PersistenceCommand command;
    private PersistenceCommand command2;
    private PersistenceCommand command3;

    private CreateObjectCommand createCreateCommand(final ObjectAdapter object, final String name) {
        return new CreateObjectCommand() {

            @Override
            public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
            }
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand

        }
    }

    @Override
    public CreateObjectCommand createCreateObjectCommand(final ObjectAdapter object) {
        return new CreateObjectCommand() {
            @Override
            public void execute(final PersistenceCommandContext context) {
                final DatabaseConnector connection = ((SqlExecutionContext) context).getConnection();
                LOG.debug("  create object " + object);
                final ObjectMapping mapping = objectMappingLookup.getMapping(object, connection);
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand

    @Ignore // DKH: refactor to use contract tests (see in-memory object store for basis)
    @Test
    public void createCreateObjectCommand_andExecute_persistsNewInstance() throws Exception {
        // given
        final CreateObjectCommand command = objectStore.createCreateObjectCommand(adapter1);
        // when
        command.execute(transaction);
        // then
        assertFalse(objectStore.hasInstances(specification));
    }
View Full Code Here

Examples of org.apache.isis.core.runtime.persistence.objectstore.transaction.CreateObjectCommand

    private PersistenceCommand command;
    private PersistenceCommand command2;
    private PersistenceCommand command3;

    private CreateObjectCommand createCreateCommand(final ObjectAdapter object, final String name) {
        return new CreateObjectCommand() {

            @Override
            public void execute(final PersistenceCommandContext context) throws ObjectPersistenceException {
            }
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.persistence.objectstore.transaction.CreateObjectCommand

        objectStore.createSaveObjectCommand(mockAdapter);
    }

    @Test
    public void ValidatesCreateObjectCommand() throws Exception {
        final CreateObjectCommand command = objectStore.createCreateObjectCommand(adapter);
        command.execute(transaction);
        assertFalse(objectStore.hasInstances(spec));
    }
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.