Package com.cloud.api.response

Examples of com.cloud.api.response.SuccessResponse


    @Override
    public void execute(){
        UserContext.current().setEventDetails("UserId: "+getId());
        boolean result = _accountService.deleteUser(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete user");
        }
    }
View Full Code Here


    @Override
    public void execute() {
        UserContext.current().setEventDetails("Project id: " + projectId + "; accountName " + accountName + "; accept " + getAccept());
        boolean result = _projectService.updateInvitation(projectId, accountName, token, getAccept());
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to join the project");
        }
    }
View Full Code Here

  /////////////////////////////////////////////////////

    @Override
  public void execute() {
    boolean result = _mgr.deleteSSHKeyPair(this);
    SuccessResponse response = new SuccessResponse(getCommandName());
    response.setSuccess(result);
    this.setResponseObject(response);
  }
View Full Code Here

        }
       
        if (!_ravService.applyVpnUsers(owner.getId(), userName)) {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to apply vpn user removal");
        }
        SuccessResponse response = new SuccessResponse(getCommandName());
        setResponseObject(response);
    }
View Full Code Here

    @Override
    public void execute(){
        UserContext.current().setEventDetails("Domain Id: "+getId());
        boolean result = _domainService.deleteDomain(id, cleanup);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete domain");
        }
    }
View Full Code Here

    @Override
    public void execute(){
        boolean result = _configService.deletePod(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete pod");
        }
    }
View Full Code Here

    public void execute() throws ResourceUnavailableException {
        UserContext.current().setEventDetails("Rule Id: " + id);
        boolean result = _firewallService.revokeFirewallRule(id, true);
       
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete firewall rule");
        }
    }
View Full Code Here

    @Override
    public void execute() throws ResourceUnavailableException{
        try {
            boolean result = _rulesService.enableStaticNat(ipAddressId, virtualMachineId, getNetworkId(), false);
            if (result) {
                SuccessResponse response = new SuccessResponse(getCommandName());
                this.setResponseObject(response);
            } else {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to enable static nat");
            }
        } catch (NetworkRuleConflictException ex) {
View Full Code Here

    @Override
    public void execute() {
        boolean result = _storageService.deletePool(this);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            StoragePool pool = _storageService.getStoragePool(id);
            if (pool != null && pool.getStatus() == StoragePoolStatus.Removed) {
                throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to finish storage pool removal. The storage pool will not be used but cleanup is needed");
View Full Code Here

    @Override
    public void execute(){
        UserContext.current().setEventDetails("Project id: "+ projectId + "; accountName " + accountName);
        boolean result = _projectService.deleteAccountFromProject(projectId, accountName);
        if (result) {
            SuccessResponse response = new SuccessResponse(getCommandName());
            this.setResponseObject(response);
        } else {
            throw new ServerApiException(BaseCmd.INTERNAL_ERROR, "Failed to delete account from the project");
        }
    }
View Full Code Here

TOP

Related Classes of com.cloud.api.response.SuccessResponse

Copyright © 2018 www.massapicom. 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.