예제 #1
0
 public Object invoke(final Object proxy, final Method method, final Object[] args)
     throws Throwable {
   if (method.equals(CLOSE_METHOD)) {
     close();
     return null;
   } else if (method.equals(SHUTDOWN_METHOD)) {
     shutdown();
     return null;
   } else if (method.equals(IS_OPEN_METHOD)) {
     return Boolean.valueOf(isOpen());
   } else if (method.equals(IS_STALE_METHOD)) {
     return Boolean.valueOf(isStale());
   } else {
     final HttpClientConnection conn = getConnection();
     if (conn == null) {
       throw new ConnectionShutdownException();
     }
     try {
       return method.invoke(conn, args);
     } catch (final InvocationTargetException ex) {
       final Throwable cause = ex.getCause();
       if (cause != null) {
         throw cause;
       } else {
         throw ex;
       }
     }
   }
 }
예제 #2
0
  @Override
  public int compareTo(LineageCommand other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetCommandType()).compareTo(other.isSetCommandType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCommandType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commandType, other.commandType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetCheckpointFiles()).compareTo(other.isSetCheckpointFiles());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCheckpointFiles()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.checkpointFiles, other.checkpointFiles);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
  public ExportOptions(List<String> optinonsLine) throws Exception {
    assert optinonsLine != null || optinonsLine.isEmpty();

    APIUrl = new URL(optinonsLine.get(0));
    userName = optinonsLine.get(1);
    password = optinonsLine.get(2);
    surveyId = Integer.valueOf(optinonsLine.get(3));
    pageNumber = Integer.valueOf(optinonsLine.get(4));
    resultsPerPage = Integer.valueOf(optinonsLine.get(5));
    filterField = optinonsLine.get(6);
    filterValue = optinonsLine.get(7);
    if (filterValue.equals("Yesterday")) {
      DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
      Calendar cal = Calendar.getInstance();
      cal.add(Calendar.DATE, -1);
      filterValue = df.format(cal.getTime());
    }
    sortField = optinonsLine.get(8);
    sortAscending = Boolean.valueOf(optinonsLine.get(9));
    period = Integer.valueOf(optinonsLine.get(10));
    dtStart = parseStringToXMLGregorianCalendar(optinonsLine.get(11), DATE_FORMAT_PATTERN);
    dtEnd = parseStringToXMLGregorianCalendar(optinonsLine.get(12), DATE_FORMAT_PATTERN);
    detailedResponseInfo = Boolean.valueOf(optinonsLine.get(13));
    detailedUserInfo = Boolean.valueOf(optinonsLine.get(14));
    includeOpenEndedResults = Boolean.valueOf(optinonsLine.get(15));
    includeAliases = Boolean.valueOf(optinonsLine.get(16));
    includeHiddenItems = Boolean.valueOf(optinonsLine.get(17));
    includeIncompleteResponses = Boolean.valueOf(optinonsLine.get(18));
    stripHTMLTagsFromAnswers = Boolean.valueOf(optinonsLine.get(19));
    stripHTMLTagsFromQuestions = Boolean.valueOf(optinonsLine.get(20));
    mergeAnswersForSelectMany = Boolean.valueOf(optinonsLine.get(21));
    csvFileName = optinonsLine.get(22);
  }
예제 #4
0
  public static JBossWebMetaData createWebMetaData(
      ReplicationGranularity granularity,
      ReplicationTrigger trigger,
      int maxSessions,
      boolean passivation,
      int maxIdle,
      int minIdle,
      boolean batchMode,
      int maxUnreplicated) {
    JBossWebMetaData webMetaData = new JBossWebMetaData();
    webMetaData.setDistributable(new EmptyMetaData());
    webMetaData.setMaxActiveSessions(new Integer(maxSessions));
    PassivationConfig pcfg = new PassivationConfig();
    pcfg.setUseSessionPassivation(Boolean.valueOf(passivation));
    pcfg.setPassivationMaxIdleTime(new Integer(maxIdle));
    pcfg.setPassivationMinIdleTime(new Integer(minIdle));
    webMetaData.setPassivationConfig(pcfg);
    ReplicationConfig repCfg = new ReplicationConfig();
    repCfg.setReplicationGranularity(granularity);
    repCfg.setReplicationTrigger(trigger);
    repCfg.setReplicationFieldBatchMode(Boolean.valueOf(batchMode));
    repCfg.setMaxUnreplicatedInterval(Integer.valueOf(maxUnreplicated));
    repCfg.setSnapshotMode(SnapshotMode.INSTANT);
    webMetaData.setReplicationConfig(repCfg);

    return webMetaData;
  }
예제 #5
0
  public int compareTo(MoodleUrl2 other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    MoodleUrl2 typedOther = (MoodleUrl2) other;

    lastComparison = Boolean.valueOf(isSetName()).compareTo(typedOther.isSetName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, typedOther.name);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUrl()).compareTo(typedOther.isSetUrl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUrl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.url, typedOther.url);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
  public int compareTo(ThriftJobQueueInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    ThriftJobQueueInfo typedOther = (ThriftJobQueueInfo) other;

    lastComparison = Boolean.valueOf(isSetQueueName()).compareTo(typedOther.isSetQueueName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetQueueName()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.queueName, typedOther.queueName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetSchedulingInfo()).compareTo(typedOther.isSetSchedulingInfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSchedulingInfo()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.schedulingInfo, typedOther.schedulingInfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #7
0
  public int compareTo(SelectQuery other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    SelectQuery typedOther = (SelectQuery) other;

    lastComparison = Boolean.valueOf(isSetOperations()).compareTo(typedOther.isSetOperations());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetOperations()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.operations, typedOther.operations);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPage()).compareTo(typedOther.isSetPage());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPage()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.page, typedOther.page);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #8
0
 /** Quits the application. */
 private void quit() {
   String usr = user.getText().trim();
   String server = serverText.getText();
   if (usr == null) usr = "";
   if (server == null) server = "";
   firePropertyChange(QUIT_PROPERTY, Boolean.valueOf(false), Boolean.valueOf(true));
 }
예제 #9
0
  /** Attempts to log in. */
  private void login() {
    firePropertyChange(TO_FRONT_PROPERTY, Boolean.valueOf(false), Boolean.valueOf(true));
    requestFocusOnField();
    StringBuffer buf = new StringBuffer();
    buf.append(pass.getPassword());
    String usr = user.getText(), psw = buf.toString();
    String s = serverText.getText();
    if (CommonsLangUtils.isBlank(usr)
        || CommonsLangUtils.isBlank(s)
        || s.trim().equals(DEFAULT_SERVER)) {
      requestFocusOnField();
      return;
    }
    if (usr != null) usr = usr.trim();
    if (s != null) s = s.trim();
    setControlsEnabled(false);
    LoginCredentials lc;
    if (groupsBox == null) {
      lc = new LoginCredentials(usr, psw, s, speedIndex, selectedPort, encrypted);
    } else {
      long id = -1L;
      if (hasGroupOption() && groupsBox.isVisible())
        // id = getGroupId(groupsBox.getText());
        id = getGroupId(groupNames.get(groupsBox.getSelectedIndex()));

      lc = new LoginCredentials(usr, psw, s, speedIndex, selectedPort, id, encrypted);
    }
    setUserName(usr);
    setEncrypted();
    setControlsEnabled(false);
    loginAttempt = true;
    login.setEnabled(false);
    firePropertyChange(LOGIN_PROPERTY, null, lc);
  }
  @Test
  @OperateOnDeployment(DEPLOYMENT_1)
  public void testSerialized(@ArquillianResource(SimpleServlet.class) URL baseURL)
      throws IOException, URISyntaxException {

    // returns the URL of the deployment (http://127.0.0.1:8180/distributable)
    URI uri = SimpleServlet.createURI(baseURL);

    try (CloseableHttpClient client = TestHttpClientUtils.promiscuousCookieHttpClient()) {
      HttpResponse response = client.execute(new HttpGet(uri));
      try {
        Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode());
        Assert.assertEquals(1, Integer.parseInt(response.getFirstHeader("value").getValue()));
        Assert.assertFalse(Boolean.valueOf(response.getFirstHeader("serialized").getValue()));
      } finally {
        HttpClientUtils.closeQuietly(response);
      }

      response = client.execute(new HttpGet(uri));
      try {
        Assert.assertEquals(HttpServletResponse.SC_OK, response.getStatusLine().getStatusCode());
        Assert.assertEquals(2, Integer.parseInt(response.getFirstHeader("value").getValue()));
        // This won't be true unless we have somewhere to which to replicate
        Assert.assertTrue(Boolean.valueOf(response.getFirstHeader("serialized").getValue()));
      } finally {
        HttpClientUtils.closeQuietly(response);
      }
    }
  }
예제 #11
0
 /**
  * Initialize the filter descriptor from the specified configuration element.
  *
  * @param descriptor The new descriptor to be initialized.
  * @param configuration The configuration element to initialize the filter.
  * @throws CoreException Thrown during parsing.
  */
 void initFilter(FilterDescriptor descriptor, IConfigurationElement configuration)
     throws CoreException {
   String attribute = configuration.getAttribute("name"); // $NON-NLS-1$
   Assert.isNotNull(attribute);
   descriptor.setName(attribute);
   attribute = configuration.getAttribute("description"); // $NON-NLS-1$
   if (attribute != null) {
     descriptor.setDescription(attribute);
   }
   attribute = configuration.getAttribute("image"); // $NON-NLS-1$
   if (attribute != null) {
     String symbolicName = configuration.getContributor().getName();
     URL resource = Platform.getBundle(symbolicName).getResource(attribute);
     Image image = ImageDescriptor.createFromURL(resource).createImage();
     descriptor.setImage(image);
   }
   attribute = configuration.getAttribute("enabled"); // $NON-NLS-1$
   if (attribute != null) {
     descriptor.setEnabled(Boolean.valueOf(attribute).booleanValue());
   }
   attribute = configuration.getAttribute("class"); // $NON-NLS-1$
   Assert.isNotNull(attribute);
   ViewerFilter filter =
       (ViewerFilter) configuration.createExecutableExtension("class"); // $NON-NLS-1$
   Assert.isNotNull(filter);
   descriptor.setFilter(filter);
   attribute = configuration.getAttribute("visibleInUI"); // $NON-NLS-1$
   if (attribute != null) {
     descriptor.setVisible(Boolean.valueOf(attribute).booleanValue());
   }
 }
예제 #12
0
  public int compareTo(HiveObjectRef other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    HiveObjectRef typedOther = (HiveObjectRef) other;

    lastComparison = Boolean.valueOf(isSetObjectType()).compareTo(typedOther.isSetObjectType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetObjectType()) {
      lastComparison = TBaseHelper.compareTo(this.objectType, typedOther.objectType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDbName()).compareTo(typedOther.isSetDbName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDbName()) {
      lastComparison = TBaseHelper.compareTo(this.dbName, typedOther.dbName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetObjectName()).compareTo(typedOther.isSetObjectName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetObjectName()) {
      lastComparison = TBaseHelper.compareTo(this.objectName, typedOther.objectName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPartValues()).compareTo(typedOther.isSetPartValues());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartValues()) {
      lastComparison = TBaseHelper.compareTo(this.partValues, typedOther.partValues);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(typedOther.isSetColumnName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetColumnName()) {
      lastComparison = TBaseHelper.compareTo(this.columnName, typedOther.columnName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #13
0
  @Override
  public int compareTo(QueryResult other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetDocumentType()).compareTo(other.isSetDocumentType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDocumentType()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.documentType, other.documentType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #14
0
  @Override
  public FontEntity buildFont(Node node) {
    String name = getAttribute(node, ATTR_NAME);
    String size = getAttribute(node, ATTR_SIZE);
    String bold = getAttribute(node, ATTR_BOLD);
    String italic = getAttribute(node, ATTR_ITALIC);

    FontEntity font = new FontEntity();

    if (name != null) {
      font.setName(name);
    }

    if (size != null) {
      font.setSize(Integer.valueOf(size));
    }

    if (bold != null) {
      font.setBold(Boolean.valueOf(bold));
    }

    if (italic != null) {
      font.setItalic(Boolean.valueOf(italic));
    }

    return font;
  }
예제 #15
0
 public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) {
   playerSnooper.addStatToSnooper("singleplayer", Boolean.valueOf(this.isSinglePlayer()));
   playerSnooper.addStatToSnooper("server_brand", this.getServerModName());
   playerSnooper.addStatToSnooper(
       "gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported");
   playerSnooper.addStatToSnooper("dedicated", Boolean.valueOf(this.isDedicatedServer()));
 }
예제 #16
0
  public boolean onBlockActivated(
      World worldIn,
      BlockPos pos,
      IBlockState state,
      EntityPlayer playerIn,
      EnumHand hand,
      @Nullable ItemStack heldItem,
      EnumFacing side,
      float hitX,
      float hitY,
      float hitZ) {
    if (((Boolean) state.getValue(OPEN)).booleanValue()) {
      state = state.withProperty(OPEN, Boolean.valueOf(false));
      worldIn.setBlockState(pos, state, 10);
    } else {
      EnumFacing enumfacing = EnumFacing.fromAngle((double) playerIn.rotationYaw);

      if (state.getValue(FACING) == enumfacing.getOpposite()) {
        state = state.withProperty(FACING, enumfacing);
      }

      state = state.withProperty(OPEN, Boolean.valueOf(true));
      worldIn.setBlockState(pos, state, 10);
    }

    worldIn.playEvent(
        playerIn, ((Boolean) state.getValue(OPEN)).booleanValue() ? 1008 : 1014, pos, 0);
    return true;
  }
  @Override
  public void passivateObject(PooledObject<PoolableConnection> p) throws Exception {

    validateLifetime(p);

    PoolableConnection conn = p.getObject();
    Boolean connAutoCommit = null;
    if (rollbackOnReturn) {
      connAutoCommit = Boolean.valueOf(conn.getAutoCommit());
      if (!connAutoCommit.booleanValue() && !conn.isReadOnly()) {
        conn.rollback();
      }
    }

    conn.clearWarnings();

    // DBCP-97 / DBCP-399 / DBCP-351 Idle connections in the pool should
    // have autoCommit enabled
    if (enableAutoCommitOnReturn) {
      if (connAutoCommit == null) {
        connAutoCommit = Boolean.valueOf(conn.getAutoCommit());
      }
      if (!connAutoCommit.booleanValue()) {
        conn.setAutoCommit(true);
      }
    }

    conn.passivate();
  }
예제 #18
0
  /**
   * Called when a neighboring block was changed and marks that this state should perform any checks
   * during a neighbor change. Cases may include when redstone power is updated, cactus blocks
   * popping off due to a neighboring solid block, etc.
   */
  public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {
    if (!worldIn.isRemote) {
      boolean flag = worldIn.isBlockPowered(pos);

      if (flag || blockIn.getDefaultState().canProvidePower()) {
        if (flag
            && !((Boolean) state.getValue(OPEN)).booleanValue()
            && !((Boolean) state.getValue(POWERED)).booleanValue()) {
          worldIn.setBlockState(
              pos,
              state
                  .withProperty(OPEN, Boolean.valueOf(true))
                  .withProperty(POWERED, Boolean.valueOf(true)),
              2);
          worldIn.playEvent((EntityPlayer) null, 1008, pos, 0);
        } else if (!flag
            && ((Boolean) state.getValue(OPEN)).booleanValue()
            && ((Boolean) state.getValue(POWERED)).booleanValue()) {
          worldIn.setBlockState(
              pos,
              state
                  .withProperty(OPEN, Boolean.valueOf(false))
                  .withProperty(POWERED, Boolean.valueOf(false)),
              2);
          worldIn.playEvent((EntityPlayer) null, 1014, pos, 0);
        } else if (flag != ((Boolean) state.getValue(POWERED)).booleanValue()) {
          worldIn.setBlockState(pos, state.withProperty(POWERED, Boolean.valueOf(flag)), 2);
        }
      }
    }
  }
예제 #19
0
 @Override
 public Iterable<? extends AbstractFile> getFiles() {
   ArrayList<AbstractFile> _xblockexpression = null;
   {
     final ArrayList<AbstractFile> files = CollectionLiterals.<AbstractFile>newArrayList();
     Iterable<? extends AbstractFile> _files = super.getFiles();
     Iterables.<AbstractFile>addAll(files, _files);
     TestProjectDescriptor _testProject = this.getTestProject();
     boolean _isInlined = _testProject.isInlined();
     if (_isInlined) {
       TestProjectDescriptor _testProject_1 = this.getTestProject();
       Iterable<? extends AbstractFile> _files_1 = _testProject_1.getFiles();
       final Function1<AbstractFile, Boolean> _function =
           (AbstractFile fileFromTestProject) -> {
             final Function1<AbstractFile, Boolean> _function_1 =
                 (AbstractFile it) -> {
                   String _relativePath = it.getRelativePath();
                   String _relativePath_1 = fileFromTestProject.getRelativePath();
                   return Boolean.valueOf(Objects.equal(_relativePath, _relativePath_1));
                 };
             boolean _exists = IterableExtensions.<AbstractFile>exists(files, _function_1);
             return Boolean.valueOf((!_exists));
           };
       Iterable<? extends AbstractFile> _filter = IterableExtensions.filter(_files_1, _function);
       Iterables.<AbstractFile>addAll(files, _filter);
     }
     _xblockexpression = files;
   }
   return _xblockexpression;
 }
예제 #20
0
  protected SelectItem createSelectItem(
      FacesContext context, UISelectItems uiSelectItems, Object object) {
    String var = (String) uiSelectItems.getAttributes().get("var");

    if (var != null) {
      context.getExternalContext().getRequestMap().put(var, object);

      Object itemLabelAsObject = uiSelectItems.getAttributes().get("itemLabel");
      Object itemValue = uiSelectItems.getAttributes().get("itemValue");
      String description = (String) uiSelectItems.getAttributes().get("itemDescription");
      Object itemDisabled = uiSelectItems.getAttributes().get("itemDisabled");
      Object itemEscaped = uiSelectItems.getAttributes().get("itemLabelEscaped");
      Object noSelection = uiSelectItems.getAttributes().get("noSelectionOption");

      if (itemValue == null) {
        itemValue = object;
      }

      String itemLabel =
          itemLabelAsObject == null ? String.valueOf(object) : String.valueOf(itemLabelAsObject);
      boolean disabled = itemDisabled == null ? false : Boolean.valueOf(itemDisabled.toString());
      boolean escaped = itemEscaped == null ? false : Boolean.valueOf(itemEscaped.toString());
      boolean noSelectionOption =
          noSelection == null ? false : Boolean.valueOf(noSelection.toString());

      return new SelectItem(
          itemValue, itemLabel, description, disabled, escaped, noSelectionOption);
    } else {
      return new SelectItem(object, String.valueOf(object));
    }
  }
예제 #21
0
  @Override
  public void setXMLAttributes(final XmlPullParser xmlParser, final UIManager manager) {
    super.setXMLAttributes(xmlParser, manager);

    final String align = xmlParser.getAttributeValue(null, ATT_ALIGN);
    if (align != null) {
      setAlignment(UIConfig.getAlignment(align));
    }

    final String repeating = xmlParser.getAttributeValue(null, ATT_REPEATING);
    if (repeating != null) {
      setRepeating(Boolean.valueOf(repeating));
    }

    final String boundsCheck = xmlParser.getAttributeValue(null, ATT_BOUNDS_CHECK_ENABLED);
    if (boundsCheck != null) {
      setBoundsCheckEnabled(Boolean.valueOf(boundsCheck));
    }

    final String autoSleepChildren = xmlParser.getAttributeValue(null, ATT_AUTO_SLEEP_CHILDREN);
    if (autoSleepChildren != null) {
      setAutoSleepChildren(Boolean.valueOf(autoSleepChildren));
    }

    final String minCellSize = xmlParser.getAttributeValue(null, ATT_MIN_CELL_SIZE);
    if (minCellSize != null) {
      setMinCellSize(Float.valueOf(minCellSize) * manager.getConfig().screen_scale);
    }
  }
예제 #22
0
  /**
   * Rerun bundle job
   *
   * @param request servlet request
   * @param response servlet response
   * @param conf configration object
   * @throws XServletException
   */
  private void rerunBundleJob(
      HttpServletRequest request, HttpServletResponse response, Configuration conf)
      throws XServletException {
    JSONObject json = new JSONObject();
    BundleEngine bundleEngine =
        Services.get()
            .get(BundleEngineService.class)
            .getBundleEngine(getUser(request), getAuthToken(request));
    String jobId = getResourceName(request);

    String coordScope = request.getParameter(RestConstants.JOB_BUNDLE_RERUN_COORD_SCOPE_PARAM);
    String dateScope = request.getParameter(RestConstants.JOB_BUNDLE_RERUN_DATE_SCOPE_PARAM);
    String refresh = request.getParameter(RestConstants.JOB_COORD_RERUN_REFRESH_PARAM);
    String noCleanup = request.getParameter(RestConstants.JOB_COORD_RERUN_NOCLEANUP_PARAM);

    XLog.getLog(getClass())
        .info(
            "Rerun Bundle for jobId="
                + jobId
                + ", coordScope="
                + coordScope
                + ", dateScope="
                + dateScope
                + ", refresh="
                + refresh
                + ", noCleanup="
                + noCleanup);

    try {
      bundleEngine.reRun(
          jobId, coordScope, dateScope, Boolean.valueOf(refresh), Boolean.valueOf(noCleanup));
    } catch (BaseEngineException ex) {
      throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
    }
  }
 /** INTERNAL: Return if the expression is for a direct mapped attribute. */
 public boolean isAttribute() {
   if (isAttributeExpression == null) {
     if (getSession() == null) {
       // We can't tell, so say no.
       return false;
     }
     QueryKey queryKey = getQueryKeyOrNull();
     if (queryKey != null) {
       isAttributeExpression = Boolean.valueOf(queryKey.isDirectQueryKey());
     } else {
       DatabaseMapping mapping = getMapping();
       if (mapping != null) {
         if (mapping.isVariableOneToOneMapping()) {
           throw QueryException.cannotQueryAcrossAVariableOneToOneMapping(
               mapping, mapping.getDescriptor());
         } else {
           isAttributeExpression = Boolean.valueOf(mapping.isDirectToFieldMapping());
         }
       } else {
         isAttributeExpression = Boolean.FALSE;
       }
     }
   }
   return isAttributeExpression.booleanValue();
 }
예제 #24
0
  public boolean shouldSign(File input, List<Properties> containers) {
    Properties inf = null;

    // 1: Are we excluded from signing by our parents?
    // innermost jar is first on the list, it overrides outer jars
    for (Iterator<Properties> iterator = containers.iterator(); iterator.hasNext(); ) {
      inf = iterator.next();
      if (inf.containsKey(Utils.MARK_EXCLUDE_CHILDREN_SIGN)) {
        if (Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_CHILDREN_SIGN)).booleanValue()) {
          if (verbose)
            System.out.println(
                input.getName() + "is excluded from signing by its containers."); // $NON-NLS-1$
          return false;
        }
        break;
      }
    }

    // 2: Is this jar itself marked as exclude?
    inf = Utils.getEclipseInf(input, verbose);
    if (inf != null
        && inf.containsKey(Utils.MARK_EXCLUDE_SIGN)
        && Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_SIGN)).booleanValue()) {
      if (verbose)
        System.out.println(
            "Excluding " + input.getName() + " from signing."); // $NON-NLS-1$ //$NON-NLS-2$
      return false;
    }
    return true;
  }
예제 #25
0
  @Override
  public int compareTo(PrivilegeGrantInfo other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetPrivilege()).compareTo(other.isSetPrivilege());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPrivilege()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privilege, other.privilege);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreateTime()).compareTo(other.isSetCreateTime());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateTime()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createTime, other.createTime);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGrantor()).compareTo(other.isSetGrantor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGrantor()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grantor, other.grantor);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGrantorType()).compareTo(other.isSetGrantorType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGrantorType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grantorType, other.grantorType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGrantOption()).compareTo(other.isSetGrantOption());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGrantOption()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.grantOption, other.grantOption);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #26
0
  /**
   * Sets the new design time value for this <tt>BeanContext</tt>.
   *
   * @param dTime the new designTime value
   */
  public synchronized void setDesignTime(boolean dTime) {
    if (designTime != dTime) {
      designTime = dTime;

      firePropertyChange("designMode", Boolean.valueOf(!dTime), Boolean.valueOf(dTime));
    }
  }
예제 #27
0
 private BlockBody createBlockBody19(
     Object scriptObject, ThreadContext context, int index, String descriptor)
     throws NumberFormatException {
   String[] firstSplit = descriptor.split(",");
   String[] secondSplit;
   if (firstSplit[2].length() == 0) {
     secondSplit = new String[0];
   } else {
     secondSplit = firstSplit[2].split(";");
     // FIXME: Big fat hack here, because scope names are expected to be interned strings by the
     // parser
     for (int i = 0; i < secondSplit.length; i++) {
       secondSplit[i] = secondSplit[i].intern();
     }
   }
   BlockBody body =
       RuntimeHelpers.createCompiledBlockBody19(
           context,
           scriptObject,
           firstSplit[0],
           Integer.parseInt(firstSplit[1]),
           secondSplit,
           Boolean.valueOf(firstSplit[3]),
           Integer.parseInt(firstSplit[4]),
           Boolean.valueOf(firstSplit[5]));
   return blockBodies[index] = body;
 }
예제 #28
0
 private void markAsFragment(final Multimap<TerminalRule, AbstractRule> calledFrom) {
   Set<TerminalRule> _keySet = calledFrom.keySet();
   final Function1<TerminalRule, Boolean> _function =
       (TerminalRule it) -> {
         boolean _isFragment = it.isFragment();
         return Boolean.valueOf((!_isFragment));
       };
   Iterable<TerminalRule> _filter = IterableExtensions.<TerminalRule>filter(_keySet, _function);
   final Function1<TerminalRule, Boolean> _function_1 =
       (TerminalRule it) -> {
         Collection<AbstractRule> _get = calledFrom.get(it);
         return Boolean.valueOf(this.allAreTerminalRules(_get));
       };
   Iterable<TerminalRule> _filter_1 =
       IterableExtensions.<TerminalRule>filter(_filter, _function_1);
   final Function1<TerminalRule, Boolean> _function_2 =
       (TerminalRule it) -> {
         EObject _eContainer = it.eContainer();
         EList<AbstractRule> _hiddenTokens = ((Grammar) _eContainer).getHiddenTokens();
         boolean _contains = _hiddenTokens.contains(it);
         return Boolean.valueOf((!_contains));
       };
   Iterable<TerminalRule> _filter_2 =
       IterableExtensions.<TerminalRule>filter(_filter_1, _function_2);
   final Consumer<TerminalRule> _function_3 =
       (TerminalRule it) -> {
         it.setFragment(true);
       };
   _filter_2.forEach(_function_3);
 }
예제 #29
0
  @Override
  public int compareTo(NimbusSummary other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_host()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_port()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_uptime_secs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_isLeader()).compareTo(other.is_set_isLeader());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_isLeader()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isLeader, other.isLeader);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_version()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #30
0
  @Override
  public int compareTo(TCell other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetValue()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTimestamp()).compareTo(other.isSetTimestamp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTimestamp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.timestamp, other.timestamp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }