Package org.any_openeai_enterprise.moa.objects.resources.v1_0

Examples of org.any_openeai_enterprise.moa.objects.resources.v1_0.Password



      // get the newdata from the form data
      EnterpriseUserPassword eup = (EnterpriseUserPassword)getAppConfig().getObject(messageObjectName);
      eup.getXmlEnterpriseObject().setBaseline(baselineEup.getXmlEnterpriseObject());
      Password p = eup.newPassword();
      p.setValue(newPassword);
      p.setType(getChannelRuntimeData().getParameter("Password@type"));
      p.setEncryption(getChannelRuntimeData().getParameter("Password@encryption"));
      eup.setPassword(p);
      eup.setEnterpriseUser(baselineEup.getEnterpriseUser());
     

      // todo - use producer pool
View Full Code Here


          // populate one with values from uPortal then, when the password reset
          // is done (update handler) do a create instead of an update.
          LogService.log(LogService.INFO, "[EnterpriseUserPasswordQueryHandler] EnterpriseUserPassword doesn't exist, using uPortal info.");
          EnterpriseUserPassword eup = (EnterpriseUserPassword)getAppConfig().getObject(messageObjectName);
          eup.setEnterpriseUser(eu);
          Password p = eup.newPassword();
          p.setValue("eupqhunknown");
          p.setType("secure credential");
          p.setEncryption("cleartext");
          eup.setPassword(p);

//          eup.create((PointToPointProducer)getAppConfig().getObject(producerName));
//          LogService.log(LogService.INFO, "[EnterpriseUserPasswordQueryHandler] EnterpriseUserPassword was created.");
          xml += eup.getXmlEnterpriseObject().toXmlString();
View Full Code Here

        logger.info("["+portletName+"] Found EnterpriseUser: " + eu);
      }
     
      EnterpriseUserPassword eup=(EnterpriseUserPassword)appConfig.getObject(ENTERPRISE_USER_PASSWORD);
      eup.setEnterpriseUser(eu);
      Password p = eup.newPassword();
      p.setValue(newPassword);
      p.setType("secure credential");
      p.setEncryption("cleartext");
     
      java.util.List returnedEup = eup.query(eu, p2p);
      if (returnedEup.size() == 0) {
        //create the password
        eup.setPassword(p);
View Full Code Here

    // Verify that all message objects required are in AppConfig.
    // Get a configured NetId object out of AppConfig.
    try {
      InstitutionalIdentity instIdent = (InstitutionalIdentity)getAppConfig()
        .getObject("InstitutionalIdentity");
      UnknownPerson uPerson = (UnknownPerson)getAppConfig()
        .getObject("UnknownPerson");  
      Name aName = (Name)getAppConfig().getObject("Name");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a required object from AppConfig. Log it
View Full Code Here

        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured UnknownPerson object out of AppConfig.
    UnknownPerson uPerson = new UnknownPerson();
    try {
      uPerson = (UnknownPerson)getAppConfig().getObject("UnknownPerson");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving an UnknownPerson object from
      // AppConfig. Log it and throw an exception.
      String errMsg = "An error occurred retrieving an UnknownPerson " +
        "object from AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdBySsn] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured Name object out of AppConfig.
    Name name = new Name();
    try {
      name = (Name)getAppConfig().getObject("Name");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a Name object from AppConfig. Log it and
      // throw an exception.
      String errMsg = "An error occurred retrieving a Name object from " +
        "AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdBySsn] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }
   
    // Initialize a query string to retrieve the InstitutionalIdentity.
    String getString1 = "SELECT INST_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, " +
      "SSN, BIRTH_DATE, GENDER FROM T_INST_IDENT WHERE SSN = ? AND " +
      "TERMINATED_DATE IS NULL";
     
    try {
      PreparedStatement getStmt1 = conn.prepareStatement(getString1);
      getStmt1.clearParameters();
      getStmt1.setString(1, ssn);
      ResultSet r1 = getStmt1.executeQuery();
      if (r1.next()) {
        // The InstitutionalIdentity exists. Log a message and build the
        // InstitutionalIdentity object.
        logger.debug("[RdbmsI2sRepository.retrieveInstitutionalIdentityBySsn] "
          + "Found an InstitutionalIdentity in the database for SSN: " + ssn +
          ".");
        // Set the values of the Name object.
        try {
          name.setFirstName(r1.getString(2));
          name.setMiddleName(r1.getString(3));
          name.setLastName(r1.getString(4));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the Name. Log it,
          // close the statement, and throw an exception.
          String errMsg = "An error occurred seeting field values for the " +
            "Name. the exception is: " + efe.getMessage();
          logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdentityBySsn]"
            + " " + errMsg);
          getStmt1.close();
          throw new I2sRepositoryException(errMsg);
        }
        // Set the values of the UnknownPerson object.
        try {
          uPerson.setName(name);
          uPerson.setSocialSecurityNumber(r1.getString(5));
          org.any_openeai_enterprise.moa.objects.resources.v1_0.Date xeoStartDate =
            toXeoDate("BirthDate", r1.getDate(6));
          uPerson.setBirthDate(xeoStartDate);
          uPerson.setGender(r1.getString(7));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the UnknownPerson.
          // Log it, close the statement, and throw an exception.
          String errMsg = "An error occurred seeting field values for the " +
View Full Code Here

        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured UnknownPerson object out of AppConfig.
    UnknownPerson uPerson = new UnknownPerson();
    try {
      uPerson = (UnknownPerson)getAppConfig().getObject("UnknownPerson");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving an UnknownPerson object from
      // AppConfig. Log it and throw an exception.
      String errMsg = "An error occurred retrieving an UnknownPerson " +
        "object from AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdByIndtId] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured Name object out of AppConfig.
    Name name = new Name();
    try {
      name = (Name)getAppConfig().getObject("Name");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a Name object from AppConfig. Log it and
      // throw an exception.
      String errMsg = "An error occurred retrieving a Name object from " +
        "AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdByInstId] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }
   
    // Initialize a query string to retrieve the InstitutionalIdentity.
    String getString1 = "SELECT INST_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, " +
      "SSN, BIRTH_DATE, GENDER FROM T_INST_IDENT WHERE INST_ID = ? AND " +
      "TERMINATED_DATE IS NULL";
     
    try {
      PreparedStatement getStmt1 = conn.prepareStatement(getString1);
      getStmt1.clearParameters();
      getStmt1.setString(1, instId);
      ResultSet r1 = getStmt1.executeQuery();
      if (r1.next()) {
        // The InstitutionalIdentity exists. Log a message and build the
        // InstitutionalIdentity object.
        logger.debug("[RdbmsI2sRepository.retrieveInstitutionalIdentityByInst" +
          "Id] Found an InstitutionalIdentity in the database for " +
          "InstitutionalId: " + instId + ".");
        // Set the values of the Name object.
        try {
          name.setFirstName(r1.getString(2));
          name.setMiddleName(r1.getString(3));
          name.setLastName(r1.getString(4));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the Name. Log it,
          // close the statement, and throw an exception.
          String errMsg = "An error occurred seeting field values for the " +
            "Name. the exception is: " + efe.getMessage();
          logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdentityBy" +
            "InstId] " + errMsg);
          getStmt1.close();
          throw new I2sRepositoryException(errMsg);
        }
        // Set the values of the UnknownPerson object.
        try {
          uPerson.setName(name);
          uPerson.setSocialSecurityNumber(r1.getString(5));
          org.any_openeai_enterprise.moa.objects.resources.v1_0.Date xeoStartDate =
            toXeoDate("BirthDate", r1.getDate(6));
          uPerson.setBirthDate(xeoStartDate);
          uPerson.setGender(r1.getString(7));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the UnknownPerson.
          // Log it, close the statement, and throw an exception.
          String errMsg = "An error occurred seeting field values for the " +
View Full Code Here

        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured UnknownPerson object out of AppConfig.
    UnknownPerson uPerson = new UnknownPerson();
    try {
      uPerson = (UnknownPerson)getAppConfig().getObject("UnknownPerson");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving an UnknownPerson object from
      // AppConfig. Log it and throw an exception.
      String errMsg = "An error occurred retrieving an UnknownPerson " +
        "object from AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdentity] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }

    // Get a configured Name object out of AppConfig.
    Name name = new Name();
    try {
      name = (Name)getAppConfig().getObject("Name");
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a Name object from AppConfig. Log it and
      // throw an exception.
      String errMsg = "An error occurred retrieving a Name object from " +
        "AppConfig. The exception is: " + eoce.getMessage();
      logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdentity] " +
        errMsg);
      throw new I2sRepositoryException(errMsg);
    }
   
    // Initialize a query string to retrieve the InstitutionalIdentity.
    String getString1 = "SELECT INST_ID, FIRST_NAME, MIDDLE_NAME, LAST_NAME, " +
      "SSN, BIRTH_DATE, GENDER FROM T_INST_IDENT WHERE LAST_NAME = ? " +
      "AND BIRTH_DATE = ? AND GENDER = ? AND TERMINATED_DATE IS NULL";

    // If the UnknownPerson in the query has a FirstName, then add it to the
    // where clause and indicate that we must set this parameter of the
    // subsequent prepared statement.
    boolean hasFirstName = false;
    if (queryPerson.getName().getFirstName() != null) {
      getString1 = getString1 + " AND FIRST_NAME = ?";
      hasFirstName = true;
    }

    // If the UnknownPerson in the query has a MiddleName, then add it to the
    // where clause and indicate that we must set this parameter of the
    // subsequent prepared statement.
    boolean hasMiddleName = false;
    if (queryPerson.getName().getMiddleName() != null) {
      getString1 = getString1 + " AND MIDDLE_NAME = ?";
      hasMiddleName = true;
    }
   
    try {
      PreparedStatement getStmt1 = conn.prepareStatement(getString1);
      getStmt1.clearParameters();
      getStmt1.setString(1, queryPerson.getName().getLastName());
      java.sql.Date birthDate = null;
      try { birthDate = toSqlDate(queryPerson.getBirthDate()); }
      catch(InvalidFormatException ife) {
        // An error occurred formatting the birth date. Log it and throw an
        // exception.
        String errMsg = "An error occurred formatting the birth date. The " +
          "excception is: " + ife.getMessage();
        logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdentity] " +
          errMsg);
      }
      getStmt1.setDate(2, birthDate);
      getStmt1.setString(3, queryPerson.getGender());
      if (hasFirstName == true) {
        getStmt1.setString(4, queryPerson.getName().getFirstName());
      }
      if (hasMiddleName == true) {
        getStmt1.setString(5, queryPerson.getName().getMiddleName());
      }
     
      ResultSet r1 = getStmt1.executeQuery();
      if (r1.next()) {
        // The InstitutionalIdentity exists. Log a message and build the
        // InstitutionalIdentity object.
        logger.debug("[RdbmsI2sRepository.retrieveInstitutionalIdentity] " +
          "Found an InstitutionalIdentity in the database for the " +
          "UnknownPerson: " + queryPerson.toString());
        // Set the values of the Name object.
        logger.debug("InstId: " + r1.getString(1));
        logger.debug("FirstName: " + r1.getString(2));
        logger.debug("MiddleName: " + r1.getString(3));
        logger.debug("LastName: " + r1.getString(4));
        logger.debug("SSN: " + r1.getString(5));
        logger.debug("BirthDate (date): " + r1.getDate(6).toString());
        // Note: uncommenting the next line with break this gateway for MySQL.
        // logger.debug("BirthDate (timestamp): " + r1.getTimestamp(6).toString());
        logger.debug("Gender: " + r1.getString(7));
        try {
          name.setFirstName(r1.getString(2));
          name.setMiddleName(r1.getString(3));
          name.setLastName(r1.getString(4));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the Name. Log it,
          // close the statement, and throw an exception.
          String errMsg = "An error occurred setting field values for the " +
            "Name. the exception is: " + efe.getMessage();
          logger.fatal("[RdbmsI2sRepository.retrieveInstitutionalIdentity] " +
            errMsg);
          getStmt1.close();
          throw new I2sRepositoryException(errMsg);
        }
        // Set the values of the UnknownPerson object.
        try {
          uPerson.setName(name);
          uPerson.setSocialSecurityNumber(r1.getString(5));
          org.any_openeai_enterprise.moa.objects.resources.v1_0.Date xeoStartDate =
            toXeoDate("BirthDate", r1.getDate(6));
          uPerson.setBirthDate(xeoStartDate);
          uPerson.setGender(r1.getString(7));
        }
        catch (EnterpriseFieldException efe) {
          // An error occurred setting field values for the UnknownPerson.
          // Log it, close the statement, and throw an exception.
          String errMsg = "An error occurred seeting field values for the " +
View Full Code Here

        return getMessage(msg, replyContents);
      }
    
      else {
        // Get a primed UnknownPerson object from AppConfig.
        UnknownPerson uPerson = new UnknownPerson();
        try {
          uPerson = (UnknownPerson)getAppConfig().
            getObject("UnknownPerson");
        }
        catch (EnterpriseConfigurationObjectException eoce) {
        logger.fatal("[InstitutionalIdentityRequestCommand] Error retrieving " +
          "an UnknownPerson object from AppConfig. The exception is: " +
          eoce.getMessage());
        }
     
        // Try to build the UnknownPerson object from the query element.
        try {
          uPerson.buildObjectFromInput(queryElement);
        }
        catch (EnterpriseLayoutException ele) {
          // There was an error building the UnknownPerson object from the
          // query element.
          String errType = "application";
          String errCode = "InstitutionalIdentityService-1001";
          String errDesc = "Error building the UnknownPerson object from the" +
            "UnknownPerson element in the Query-Request message. The " +
            "exception is: " + ele.getMessage();
          logger.fatal("[InstitutionalIdentityRequestCommand] " + errDesc);
          logger.fatal("Message sent in is: \n" + getMessageBody(inDoc));
          ArrayList errors = new ArrayList();
          errors.add(buildError(errType, errCode, errDesc));
          String replyContents =
            buildReplyDocumentWithErrors(eControlArea, localProvideDoc, errors);
          return getMessage(msg, replyContents);       
        }
     
        // Retrieve the InstitutionalIdentity.
        InstitutionalIdentity instIdent = new InstitutionalIdentity();
        try {
          instIdent = m_i2sRepository.retrieveInstitutionalIdentity(uPerson)
        }
        catch (I2sRepositoryException i2sre) {
          String errType = "system";
          String errCode = "InstitutionalIdentityService-1002";
          String errDesc = "Error accessing the I2sRepository to retrieve the "
            + "InstitutionalIdentity. The exception is: " + i2sre.getMessage();
          logger.fatal("[InstitutionalIdentityRequestCommand] " + errDesc);
          logger.fatal("[InstitutionalIdentityRequestCommand] Message sent " +
            "in is: \n" + getMessageBody(inDoc));
          ArrayList errors = new ArrayList();
          errors.add(buildError(errType, errCode, errDesc));
          String replyContents =
            buildReplyDocumentWithErrors(eControlArea, localProvideDoc, errors);
          return getMessage(msg, replyContents);
        }

        // If an InstitutionalIdentity was found in the repository for the
        // UnknownPerson, the InstitutionalIdentity object will not be null. If
        // no InstitutionalIdentity was found for the UnknownPerson, the
        // InstitutionalIdentity will be null. If the InstitutionalIdentity is
        // not null, serialize it and place it into the DataArea of the
        // Provide-Reply. If it is null, clear the DataArea of the Provide-Reply
        // to return an empty DataArea as prescribed by the OpenEAI Message
        // Protocol.     
        try {
          if (instIdent != null) {  
            localProvideDoc.getRootElement().getChild("DataArea").
              removeContent();
            localProvideDoc.getRootElement().getChild("DataArea").
              addContent((Element)instIdent.buildOutputFromObject());
          }
          else {
            localProvideDoc.getRootElement().getChild("DataArea").
              removeContent();
          }
        }
        catch (EnterpriseLayoutException ele) {
          // An error occurred building the InstitutionalIdentity element from
          // the InstitutionalIdentity object returned from the I2sRepository.
          // Log it an reply with an error.
          String errType = "application";
          String errCode = "InstitutionalIdentityService-1003";
          String errDesc = "An error occurred building the Institutional" +
            "Identity element from the InstitutionalIdentity object returned " +
            "from the I2sRepository.  The exception is: " + ele.getMessage();
          logger.fatal("[InstitutionalIdentityRequestCommand " + errDesc);
          ArrayList errors = new ArrayList();
          errors.add(buildError(errType, errCode, errDesc));
          String replyContents =
          buildReplyDocumentWithErrors(eControlArea, localProvideDoc, errors);
          return getMessage(msg, replyContents);
        }

        // Build the reply message and return it.
        String replyContents =
          buildReplyDocument(eControlArea, localProvideDoc);
        return getMessage(msg, replyContents);
      }
    }

    // Process a Generate-Request message.
    if (msgAction.equalsIgnoreCase("Generate")) { 
      logger.info("[InstitutionalIdentityRequestCommand] Handling an " +
        "org.any-openeai-enterprise.CoreApplication.InstitutionalIdentity." +
        "Generate-Request message.");
      // Get the generate element.
      Element generateElement = inDoc.getRootElement().getChild("DataArea")
        .getChild("UnknownPerson");

      // Verify that the generate element is an UnknownPerson and that it is
      // not null. If it is null, reply with an error.
      if (generateElement == null) {
        String errType = "application";
        String errCode = "OpenEAI-1015";
        String errDesc = "Invalid generate element found in the Generate-" +
          "Request message. This command expects an UnknownPerson.";
        logger.fatal("[InstitutionalIdentityRequestCommand] " + errDesc);
        logger.fatal("[InstitutionalIdentityRequestCommand] Message sent in " +
          "is: \n" + getMessageBody(inDoc));
        ArrayList errors = new ArrayList();
        errors.add(buildError(errType, errCode, errDesc));
        String replyContents =
          buildReplyDocumentWithErrors(eControlArea, localResponseDoc, errors);
        return getMessage(msg, replyContents);
      }

      // Get a primed UnknownPerson object from AppConfig.
      UnknownPerson uPerson = new UnknownPerson();
      try {
        uPerson = (UnknownPerson)getAppConfig().
          getObject("UnknownPerson");
      }
      catch (EnterpriseConfigurationObjectException eoce) {
      logger.fatal("[InstitutionalIdentityRequestCommand] Error retrieving " +
        "an UnknownPerson object from AppConfig. The exception is: " +
        eoce.getMessage());
      }
     
      // Try to build the UnknownPerson object from the generate element.
      try {
        uPerson.buildObjectFromInput(generateElement);
      }
      catch (EnterpriseLayoutException ele) {
        // There was an error building the UnknownPerson object from the
        // generate element.
        String errType = "application";
        String errCode = "InstitutionalIdentityService-1004";
        String errDesc = "Error building the UnknownPerson object from the" +
          "UnknownPerson element in the Generate-Request message. The " +
          "exception is: " + ele.getMessage();
        logger.fatal("[InstitutionalIdentityRequestCommand] " + errDesc);
        logger.fatal("Message sent in is: \n" + getMessageBody(inDoc));
        ArrayList errors = new ArrayList();
        errors.add(buildError(errType, errCode, errDesc));
        String replyContents =
          buildReplyDocumentWithErrors(eControlArea, localResponseDoc, errors);
        return getMessage(msg, replyContents);       
      }

      // Set the TestId.
      uPerson.setTestId(testId);

      // Generate the InstitutionalIdentity and reply.
      InstitutionalIdentity instIdent = new InstitutionalIdentity();
      try {
        instIdent = m_i2sRepository.generateInstitutionalIdentity(uPerson);       
View Full Code Here

TOP

Related Classes of org.any_openeai_enterprise.moa.objects.resources.v1_0.Password

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.