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

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

Best Java code snippets using org.apache.cloudstack.context.CallContext.setEventDisplayEnabled (Showing top 3 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

/**
 * display flag is used to control the display of the resource only to the end user. It doesnt affect Root Admin.
 * @return display flag
 */
public boolean isDisplay(){
  CallContext context = CallContext.current();
  Map<Object, Object> contextMap = context.getContextParameters();
  boolean isDisplay = true;
  // Iterate over all the first class entities in context and check their display property.
  for(Map.Entry<Object, Object> entry : contextMap.entrySet()){
    try{
      Object key = entry.getKey();
      Class clz = Class.forName((String)key);
      if(Displayable.class.isAssignableFrom(clz)){
        final Object objVO = getEntityVO(clz, entry.getValue());
        isDisplay = ((Displayable) objVO).isDisplay();
      }
      // If the flag is false break immediately
      if(!isDisplay)
        break;
    } catch (Exception e){
      s_logger.trace("Caught exception while checking first class entities for display property, continuing on", e);
    }
  }
  context.setEventDisplayEnabled(isDisplay);
  return isDisplay;
}
origin: apache/cloudstack

@Override
public void handle(final DispatchTask task) {
  final BaseCmd cmd = task.getCmd();
  if (cmd instanceof BaseAsyncCreateCmd) {
    try {
      CallContext.current().setEventDisplayEnabled(cmd.isDisplay());
      ((BaseAsyncCreateCmd)cmd).create();
    } catch (final ResourceAllocationException e) {
      throw new ServerApiException(ApiErrorCode.RESOURCE_ALLOCATION_ERROR,
          e.getMessage(), e);
    }
  } else {
    throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR,
        ATTEMP_TO_CREATE_NON_CREATION_CMD);
  }
}
origin: apache/cloudstack

ctx.setEventDisplayEnabled(cmd.isDisplay());
if(params.get(ApiConstants.PROJECT_ID) != null) {
  Project project = _entityMgr.findByUuidIncludingRemoved(Project.class, params.get(ApiConstants.PROJECT_ID));
org.apache.cloudstack.contextCallContextsetEventDisplayEnabled

Popular methods of CallContext

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

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • 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