Package es.ipsa.atril.sec.authentication

Examples of es.ipsa.atril.sec.authentication.AtrilSession.disconnect()


    if (null==sBusinessName) throw new NullPointerException("Business Name cannot be null");
    AtrilSession oSes = DAO.getAdminSession("forBusinessName");
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    String sSanitizedBusinessName = sanitizeBusinessName(sBusinessName);
    if (sSanitizedBusinessName.length()==0) {
      oSes.disconnect();
      oSes.close();
      throw new IllegalArgumentException("Business Name cannot be empty");
    }
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query("business_name:\"" + sSanitizedBusinessName + "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + sTypeName);
    if (oLst.isEmpty()) {
View Full Code Here


      oSes.close();
      throw new IllegalArgumentException("Business Name cannot be empty");
    }
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query("business_name:\"" + sSanitizedBusinessName + "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + sTypeName);
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException(sBusinessName+" not found");
    } else {
      String sId = oLst.get(0).id();
      oSes.disconnect();
View Full Code Here

      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException(sBusinessName+" not found");
    } else {
      String sId = oLst.get(0).id();
      oSes.disconnect();
      oSes.close();
      return sId;
    }
  }
View Full Code Here

  protected static String forTaxId(String sTaxId, String sTypeNamethrows ElementNotFoundException, NullPointerException, IllegalArgumentException {
    if (null==sTaxId) throw new NullPointerException("Tax Id cannot be null");
    AtrilSession oSes = DAO.getAdminSession("forTaxId");
    DocumentIndexer oIdx = oSes.getDocumentIndexer();
    if (sTaxId.length()==0) {
      oSes.disconnect();
      oSes.close();
      throw new IllegalArgumentException("Tax Id cannot be empty");
    }
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query("tax_id:\"" + sTaxId + "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + sTypeName);
    if (oLst.isEmpty()) {
View Full Code Here

      oSes.close();
      throw new IllegalArgumentException("Tax Id cannot be empty");
    }
    SortableList<Document> oLst = (SortableList<Document>) oIdx.query("tax_id:\"" + sTaxId + "\" AND " + DocumentIndexer.AdditionalDocumentFields.DOCUMENT_TYPE_NAME.value() + ":" + sTypeName);
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException(sTaxId+" not found");
    } else {
      String sId = oLst.get(0).id();
      oSes.disconnect();
View Full Code Here

    if (sEmailAddr==null) throw new NullPointerException("Email address may not be null");
    AtrilSession oSes = DAO.getAdminSession("User.forEmail");   
    Dms oDms = oSes.getDms();
    SortableList<Document> oLst = oDms.query("User$email='"+sEmailAddr.toLowerCase().trim()+"'");
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException("No user found with email "+sEmailAddr.toLowerCase().trim());
    } else {
      String sUsrId = oLst.get(0).id();     
      oSes.disconnect();
View Full Code Here

      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException("No user found with email "+sEmailAddr.toLowerCase().trim());
    } else {
      String sUsrId = oLst.get(0).id();     
      oSes.disconnect();
      oSes.close();
      return sUsrId;     
    }
  }
View Full Code Here

        case INVOICES:
          addDocumentsToInvoices(oSes);
          break;
      }
      oSes.commit();
      oSes.disconnect();
      oSes.close();
      oSes = null;
    } catch (Exception xcpt) {
      Log.out.error("DepositToZespedBridge.run() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
View Full Code Here

    if (sUuid==null) throw new NullPointerException("UUID may not be null");
    AtrilSession oSes = DAO.getAdminSession("User.forUuid");   
    Dms oDms = oSes.getDms();
    SortableList<Document> oLst = oDms.query("User$user_uuid='"+sUuid+"'");
    if (oLst.isEmpty()) {
      oSes.disconnect();
      oSes.close();
      throw new ElementNotFoundException("No user found with UUID "+sUuid);
    } else {
      String sUsrId = oLst.get(0).id();     
      oSes.disconnect();
View Full Code Here

      oSes = null;
    } catch (Exception xcpt) {
      Log.out.error("DepositToZespedBridge.run() "+xcpt.getClass().getName()+" "+xcpt.getMessage(), xcpt);
    } finally {
      if (oSes!=null) {
        if (oSes.isConnected()) oSes.disconnect();
        if (oSes.isOpen()) oSes.close();
      }
    }
    Log.out.debug("End AttachDeposit.run()");   
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.