Package net.sf.chellow.physical

Examples of net.sf.chellow.physical.Configuration


import net.sf.chellow.physical.User;

public class ImplicitUserSource {
  static public User getUser(Invocation inv) throws HttpException {
    User user = null;
    Configuration configuration = Configuration.getConfiguration();
    String emailAddressString = configuration.getProperty("ip*-*-*-*");

    if (emailAddressString == null) {
      emailAddressString = configuration.getProperty("ip"
          + inv.getRequest().getRemoteAddr().replace(".", "-"));
    }
    if (emailAddressString != null) {
      user = User.findUserByEmail(new EmailAddress(emailAddressString
          .trim()));
View Full Code Here


  public RateScript() {
  }

  public RateScript(Contract contract, Long id, HhStartDate startDate,
      HhStartDate finishDate, String script) throws HttpException {
    Configuration configuration = Configuration.getConfiguration();

    if (id == null) {
      if (contract.isCore()) {
        id = configuration.nextCoreRateScriptId();
      } else {
        id = configuration.nextUserRateScriptId();
      }
    } else {
      if (contract.isCore()) {
        if (id > configuration.getCoreRateScriptId()) {
          configuration.setCoreRateScriptId(id);
        }
      } else {
        if (id > configuration.getUserRateScriptId()) {
          configuration.setUserRateScriptId(id);
        }
      }
    }
    setId(id);
    setContract(contract);
View Full Code Here

  }

  public Contract(Long id, Boolean isCore, String name,
      HhStartDate startDate, HhStartDate finishDate, String chargeScript)
      throws HttpException {
    Configuration configuration = Configuration.getConfiguration();

    if (id == null) {
      if (isCore) {
        id = configuration.nextCoreContractId();
      } else {
        id = configuration.nextUserContractId();
      }
    } else {
      isCore = id % 2 == 1;
      if (isCore) {
        if (id > configuration.getCoreContractId()) {
          configuration.setCoreContractId(id);
        }
      } else {
        if (id > configuration.getUserContractId()) {
          configuration.setUserContractId(id);
        }
      }
    }
    setId(id);
    internalUpdate(name, chargeScript);
View Full Code Here

  public Report() {
  }

  public Report(Long id, boolean isCore, String name, String script,
      String template) throws HttpException {
    Configuration configuration = Configuration.getConfiguration();

    if (id == null) {
      if (isCore) {
        id = configuration.nextCoreReportId();
      } else {
        id = configuration.nextUserReportId();
      }
    } else {
      if (isCore) {
        if (id > configuration.getCoreReportId()) {
          configuration.setCoreReportId(id);
        }
      } else {
        if (id > configuration.getUserReportId()) {
          configuration.setUserReportId(id);
        }
      }
    }
    boolean isOdd = id % 2 == 1;
    if (isOdd != isCore) {
View Full Code Here

TOP

Related Classes of net.sf.chellow.physical.Configuration

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.