Package net.sf.chellow.monad

Examples of net.sf.chellow.monad.UserException


      Long participantId = inv.getLong("participant-id");
      String name = inv.getString("name");
      String chargeScript = inv.getString("charge-script");
      String properties = inv.getString("properties");
      if (!inv.isValid()) {
        throw new UserException(document());
      }
      chargeScript = chargeScript.replace("\r", "").replace("\t", "    ");
      properties = properties.replace("\r", "").replace("\t", "    ");
      try {
        update(Participant.getParticipant(participantId), name,
View Full Code Here


          .setTimestamp("finishDate", getFinishDate().getDate());
    }
    List<Mpan> mpansOutside = query.setEntity("contract", this)
        .setTimestamp("startDate", getStartDate().getDate()).list();
    if (!mpansOutside.isEmpty()) {
      throw new UserException(
          document(),
          mpansOutside.size() > 1 ? "The supply generations with MPAN cores "
              + mpansOutside.get(0).getCore()
              + " and "
              + mpansOutside.get(mpansOutside.size() - 1)
View Full Code Here

    }
    super.setAddress(emailAddress);
    try {
      validate();
    } catch (AddressException e) {
      throw new UserException(
          "The email address '" + label
              + "' is not correctly formed. " + e.getMessage() + ".");
    }
    this.label = label;
  }
View Full Code Here

    BigDecimal gross = inv.getBigDecimal("gross");
    Long billTypeId = inv.getLong("bill-type-id");
    String breakdown = inv.getString("breakdown");

    if (!inv.isValid()) {
      throw new UserException(document());
    }
    Calendar cal = MonadDate.getCalendar();
    cal.setTime(finishDate);
    cal.set(Calendar.HOUR_OF_DAY, 23);
    cal.set(Calendar.MINUTE, 30);
View Full Code Here

public class Llfc extends PersistentEntity {
  static public Llfc getLlfc(Long id) throws HttpException {
    Llfc llfc = (Llfc) Hiber.session().get(Llfc.class, id);
    if (llfc == null) {
      throw new UserException("There is no LLFC with that id.");
    }
    return llfc;
  }
View Full Code Here

public class GeneratorType extends PersistentEntity {
  static public GeneratorType getGeneratorType(Long id) throws HttpException {
    GeneratorType type = (GeneratorType) Hiber.session().get(GeneratorType.class, id);
    if (type == null) {
      throw new UserException("There is no generator type with that id.");
    }
    return type;
  }
View Full Code Here

      } else if (roleName.equals("supplier")) {
        contract = SupplierContract.getSupplierContract(contractName);
      } else if (roleName.equals("mop")) {
        contract = MopContract.getMopContract(contractName);
      } else {
        throw new UserException(
            "The role name must be one of hhdc, supplier or mop.");
      }
      String batchReference = GeneralImport.addField(csvElement,
          "Batch Reference", values, 2);
View Full Code Here

  }

  public static Bill getBill(Long id) throws HttpException {
    Bill bill = (Bill) Hiber.session().get(Bill.class, id);
    if (bill == null) {
      throw new UserException("There isn't a bill with that id.");
    }
    return bill;
  }
View Full Code Here

    if (issueDate == null) {
      throw new InternalException("The issue date may not be null.");
    }
    setIssueDate(issueDate);
    if (startDate.getDate().after(finishDate.getDate())) {
      throw new UserException("The bill start date " + startDate
          + " can't be after the finish date " + finishDate + ".");
    }
    setStartDate(startDate);
    setFinishDate(finishDate);
    if (kwh == null) {
View Full Code Here

      BigDecimal gross = inv.getBigDecimal("gross");
      Long typeId = inv.getLong("type-id");
      String breakdown = inv.getString("breakdown");

      if (!inv.isValid()) {
        throw new UserException(document());
      }
      try {
        update(account, reference, issueDate,
            new HhStartDate(startDate),
            new HhStartDate(finishDate), kwh, net, vat, gross,
View Full Code Here

TOP

Related Classes of net.sf.chellow.monad.UserException

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.