Codota Logo
BLException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
org.jpos.ee.BLException
constructor

Best Java code snippets using org.jpos.ee.BLException.<init> (Showing top 20 results out of 315)

  • Common ways to obtain BLException
private void myMethod () {
BLException b =
  • Codota IconString str;new BLException(str)
  • Codota IconException exception;new BLException(exception.getMessage())
  • Smart code suggestions by Codota
}
origin: jpos/jPOS-EE

protected void assertTrue (boolean condition, String message) 
  throws BLException 
{
  if (!condition)
    throw new BLException (message);
}
protected void assertFalse (boolean condition, String message) 
origin: jpos/jPOS-EE

protected void assertFalse (boolean condition, String message) 
  throws BLException 
{
  if (condition)
    throw new BLException (message);
}
protected void assertTrue 
origin: jpos/jPOS-EE

protected void assertNull (Object obj, String message)
  throws BLException
{
  if (obj != null)
    throw new BLException (message);
}
protected void assertNull (Object obj, String message, String detail)
origin: jpos/jPOS-EE

protected void assertNotNull (Object obj, String error) throws BLException {
  if (obj == null)
    throw new BLException (error);
}
protected void assertTrue (boolean condition, String error)
origin: jpos/jPOS-EE

protected void assertNotNull (Object obj, String message)
  throws BLException
{
  if (obj == null)
    throw new BLException (message);
}
protected void assertNotNull (Object obj, String message, String detail)
origin: jpos/jPOS-EE

protected void assertFalse
  (boolean condition, String message, String detail) 
  throws BLException 
{
  if (condition)
    throw new BLException (message, detail);
}
protected void assertNotNull (Object obj, String message)
origin: jpos/jPOS-EE

protected void assertTrue (boolean condition, String error)
    throws BLException
{
  if (!condition)
    throw new BLException (error);
}
origin: jpos/jPOS-EE

protected void assertNotNull (Object obj, String message, String detail)
  throws BLException
{
  if (obj == null)
    throw new BLException (message, detail);
}
protected void assertNotNull (Object obj, int resultCode)
origin: jpos/jPOS-EE

protected void assertNull (Object obj, String message, String detail)
  throws BLException
{
  if (obj != null)
    throw new BLException (message, detail);
}
protected void checkPoint (Context ctx) {
origin: jpos/jPOS-EE

protected void assertTrue 
  (boolean condition, String message, String detail) 
  throws BLException 
{
  if (!condition)
    throw new BLException (message, detail);
}
protected void assertFalse
origin: jpos/jPOS-EE

protected void assertNotNull (Object obj, int resultCode)
  throws BLException
{
  if (obj == null)
    throw new BLException (Integer.toString (resultCode));
}
protected void assertNotNull (Object obj, int resultCode, String detail)
origin: jpos/jPOS-EE

protected void assertNotNull (Object obj, int resultCode, String detail)
  throws BLException
{
  if (obj == null)
    throw new BLException (Integer.toString (resultCode), detail);
}
protected void assertNotNull (Map map, String[] props, String message)
origin: jpos/jPOS-EE

public void validate () throws BLException {
  if (transaction.getEntries().size() == 0) {
    setComponentError(new UserError("Transaction has no entries"));
    throw new BLException("Transaction has no entries");
  }
}
origin: jpos/jPOS-EE

private void checkMandatoryJson (Context ctx) throws BLException {
  for (Map.Entry<String,JsonSchema> entry : mandatoryJson.entrySet()) {
    String value = ctx.getString(entry.getKey());
    ProcessingReport report;
    if (value != null) {
      try {
        JsonSchema schema = entry.getValue();
        JsonNode node = JsonLoader.fromString(value);
        report = schema.validate(node);
      } catch(Exception ex) {
        throw new BLException(ex.getMessage());
      }
      assertTrue(report.isSuccess(), report.toString());
    }
  }
}
origin: jpos/jPOS-EE

  private void checkOptionalJson (Context ctx) throws BLException {
    for (Map.Entry<String,JsonSchema> entry : optionalJson.entrySet()) {
      String value = ctx.getString(entry.getKey());
      ProcessingReport report;
      if (value != null) {
        try {
          JsonSchema schema = entry.getValue();
          JsonNode node = JsonLoader.fromString(value);
          report = schema.validate(node);
        } catch(Exception ex) {
          throw new BLException(ex.getMessage());
        }
        assertTrue(report.isSuccess(), report.toString());
      }
    }

  }
}
origin: jpos/jPOS-EE

@Override
public boolean updateEntity (Binder binder) throws BLException {
  try {
    return (boolean) DB.execWithTransaction( (db) -> {
      Role oldRole = (Role) ((Role) getOriginalEntity()).clone();
      binder.writeBean(getOriginalEntity());
      Role r = (Role) getOriginalEntity();
      db.session().merge(r);
      return addRevisionUpdated(db, getEntityName(),
          String.valueOf(r.getId()),
          oldRole,
          r,
          new String[]{"name", "permissions"});
    });
  } catch (Exception e) {
    throw new BLException(e.getMessage());
  }
}
origin: jpos/jPOS-EE

@Override
public boolean saveEntity (Binder binder) throws BLException {
  SysConfig entity = (SysConfig) getOriginalEntity();
  if (binder.writeBeanIfValid(getOriginalEntity())) {
    String id = entity.getId();
    id = prefix != null ? prefix + id : id;
    if (getSysConfig(id) == null) {
      final String finalId = id;
      try {
        return (boolean) DB.execWithTransaction((db) -> {
          SysConfigManager mgr = new SysConfigManager(db, prefix);
          mgr.put(entity.getId(), entity.getValue());
          addRevisionCreated(db, "SYSCONFIG", finalId);
          return true;
        });
      } catch (Exception e) {
        QI.getQI().getLog().error(e);
        return false;
      }
    } else {
      throw new BLException("SysConfig " + id + " already exists.");
    }
  } else {
    throw new BLException("Invalid SysConfig");
  }
}
origin: jpos/jPOS-EE

@Override
public Result<Account> convertToModel(String value, ValueContext valueContext) {
  if (value != null && !value.isEmpty()) {
    try {
      Account acct = (Account) DB.exec(db -> {
        GLSession session = new GLSession(db);
        Account res = session.getAccount("jcard",value);
        if (res == null && createNew) {
          if (createFinal)
            res = new FinalAccount();
          else
            res = new CompositeAccount();
          res.setCode(value);
        } else if (res == null) {
          throw new BLException("Invalid Account Code");
        }
        return res;
      });
      return Result.ok(acct);
    } catch (Exception e) {
      return Result.error(e.getMessage());
    }
  }
  if (required)
    return Result.error(QI.getQI().getMessage("errorMessage.req", QI.getQI().getMessage("account")));
  else
    return Result.ok(null);
}
origin: jpos/jPOS-EE

protected boolean saveEntity (Binder binder, EntryGrid entryGrid) throws BLException {
  try {
    return (boolean) DB.execWithTransaction(db -> {
      if (binder.writeBeanIfValid(getOriginalEntity())) {
        GLTransaction txn = (GLTransaction) getOriginalEntity();
        List<GLEntry> entries = entryGrid.getValue().getEntries();
        //Reset ids to 0
        for (GLEntry e : entries)
          e.setId(0);
        txn.setEntries(entries);
        txn.setTimestamp(new Date());
        GLSession glSession = new GLSession(db);
        glSession.post(txn.getJournal(), txn);
        addRevisionCreated(db, getEntityName(), getItemId(getOriginalEntity()));
        return true;
      }
      return false;
    });
  } catch (Exception e) {
    throw new BLException(e.getMessage());
  }
}
origin: jpos/jPOS-EE

public boolean saveUser (Binder binder, String clearPass) throws BLException {
  User u = (User) getOriginalEntity();
  if (binder.writeBeanIfValid(getOriginalEntity())) {
    try {
      return (boolean) DB.execWithTransaction((db) -> {
        db.save(u);
        if (clearPass != null && !clearPass.isEmpty()) {
          UserManager mgr = new UserManager(db);
          try {
            mgr.setPassword(u, clearPass);
          } catch (BLException e) {
            return false;
          }
          addRevisionCreated(db, getEntityName(), u.getId().toString());
          u.setForcePasswordChange(true);
          db.session().update(u);
          return true;
        }
        return false;
      });
    } catch (Exception e) {
      getApp().getLog().error(e);
      return false;
    }
  } else {
   throw new BLException("Invalid user");
  }
}
org.jpos.eeBLException<init>

Popular methods of BLException

  • getMessage
  • getDetail
  • getDetailedMessage
  • printStackTrace

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Path (java.nio.file)
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • BoxLayout (javax.swing)
  • JPanel (javax.swing)
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