Codota Logo
CallContext.current
Code IndexAdd Codota to your IDE (free)

How to use
current
method
in
org.apache.cloudstack.context.CallContext

Best Java code snippets using org.apache.cloudstack.context.CallContext.current (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: apache/cloudstack

public long getAutoscaleUserId() {
  if (autoscaleUserId != null) {
    return autoscaleUserId;
  } else {
    return CallContext.current().getCallingUserId();
  }
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Account account = CallContext.current().getCallingAccount();
  if (account != null) {
    return account.getId();
  }
  return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
origin: apache/cloudstack

  @Override
  public long getEntityOwnerId() {
    return CallContext.current().getCallingAccount().getId();
  }
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Account account = CallContext.current().getCallingAccount();
  if (account != null) {
    return account.getId();
  }
  return Account.ACCOUNT_ID_SYSTEM;
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Account caller = CallContext.current().getCallingAccount();
  return caller.getAccountId();
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Account account = CallContext.current().getCallingAccount();
  if (account != null) {
    return account.getId();
  }
  return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked
}
origin: apache/cloudstack

public String getAccountName() {
  if (accountName == null) {
    return CallContext.current().getCallingAccount().getAccountName();
  }
  return accountName;
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Long accountId = _accountService.finalyzeAccountId(accountName, domainId, projectId, true);
  if (accountId == null) {
    return CallContext.current().getCallingAccount().getId();
  }
  return accountId;
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Long accountId = _accountService.finalyzeAccountId(accountName, domainId, null, true);
  if (accountId == null) {
    return CallContext.current().getCallingAccount().getId();
  }
  return accountId;
}
origin: apache/cloudstack

@Override
public long getEntityOwnerId() {
  Long accountId = _accountService.finalyzeAccountId(accountName, domainId, projectId, true);
  if (accountId == null) {
    return CallContext.current().getCallingAccount().getId();
  }
  return accountId;
}
origin: apache/cloudstack

@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException {
  final DataCenter dataCenter = _resourceService.getZone(getZoneId());
  if (dataCenter == null) {
    throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find zone by ID: " + getZoneId());
  }
  final boolean result = haConfigManager.enableHA(dataCenter);
  CallContext.current().setEventDetails("Zone Id:" + dataCenter.getId() + " HA enabled: true");
  CallContext.current().putContextParameter(DataCenter.class, dataCenter.getUuid());
  setupResponse(result);
}
origin: apache/cloudstack

@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
  CallContext.current().setEventDetails("Network ACL Id: " + id);
  boolean result = _vpcService.deleteVpcPrivateGateway(id);
  if (result) {
    SuccessResponse response = new SuccessResponse(getCommandName());
    setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete private gateway");
  }
}
origin: apache/cloudstack

@Override
public void execute() throws ResourceUnavailableException {
  CallContext.current().setEventDetails("Rule Id: " + id);
  boolean result = _firewallService.revokeEgressFirewallRule(id, true);
  if (result) {
    SuccessResponse response = new SuccessResponse(getCommandName());
    setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete egress firewall rule");
  }
}
origin: apache/cloudstack

@Override
public void execute() {
  CallContext.current().setEventDetails(getEventDescription());
  NetworkACLItem aclItem = _networkACLService.moveNetworkAclRuleToNewPosition(this);
  NetworkACLItemResponse aclResponse = _responseGenerator.createNetworkACLItemResponse(aclItem);
  setResponseObject(aclResponse);
  aclResponse.setResponseName(getCommandName());
}
origin: apache/cloudstack

@Override
public void execute() {
  CallContext.current().setEventDetails("Dedicated guest vlan range Id: " + id);
  boolean result = _networkService.releaseDedicatedGuestVlanRange(getId());
  if (result) {
    SuccessResponse response = new SuccessResponse(getCommandName());
    this.setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to release dedicated guest vlan range");
  }
}
origin: apache/cloudstack

@Override
public void execute() {
  CallContext.current().setEventDetails("Load balancer ID: " + getId());
  boolean result = _appLbService.deleteApplicationLoadBalancer(getId());
  if (result) {
    SuccessResponse response = new SuccessResponse(getCommandName());
    this.setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete load balancer");
  }
}
origin: apache/cloudstack

@Override
public void execute() {
  CallContext.current().setEventDetails("AutoScale Vm Group Id: " + getId());
  AutoScaleVmGroup result = _autoScaleService.updateAutoScaleVmGroup(this);
  if (result != null) {
    AutoScaleVmGroupResponse response = _responseGenerator.createAutoScaleVmGroupResponse(result);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update autoscale VmGroup");
  }
}
origin: apache/cloudstack

@Override
public void execute() {
  CallContext.current().setEventDetails("Guest OS Id: " + getEntityId());
  GuestOS guestOs = _mgr.getAddedGuestOs(getEntityId());
  if (guestOs != null) {
    GuestOSResponse response = _responseGenerator.createGuestOSResponse(guestOs);
    response.setResponseName(getCommandName());
    setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add new guest OS type");
  }
}
origin: apache/cloudstack

@Override
public void execute() throws ResourceUnavailableException {
  CallContext.current().setEventDetails("Rule ID: " + id);
  FirewallRule rule = _firewallService.updateIngressFirewallRule(id, this.getCustomId(), getDisplay());
  FirewallResponse fwResponse = new FirewallResponse();
  if (rule != null) {
    fwResponse = _responseGenerator.createFirewallResponse(rule);
    setResponseObject(fwResponse);
  }
  fwResponse.setResponseName(getCommandName());
}
origin: apache/cloudstack

@Override
public void execute() throws ResourceAllocationException {
  CallContext.current().setEventDetails("Project id: " + getId());
  Project project = _projectService.updateProject(getId(), getDisplayText(), getAccountName());
  if (project != null) {
    ProjectResponse response = _responseGenerator.createProjectResponse(project);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update a project");
  }
}
org.apache.cloudstack.contextCallContextcurrent

Popular methods of CallContext

  • getCallingAccount
  • getCallingUserId
  • setEventDetails
  • getCallingAccountId
  • getCallingUser
  • putContextParameter
  • register
  • unregister
  • getContextId
  • getContextParameters
  • getCallingUserUuid
  • getContextParameter
  • getCallingUserUuid,
  • getContextParameter,
  • getEventDetails,
  • init,
  • setEventDisplayEnabled,
  • unregisterAll,
  • <init>,
  • getEventDescription,
  • getEventType

Popular in Java

  • Making http requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • getSystemService (Context)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now