Package org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0

Examples of org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUserPassword


    // Verify that all message objects required are in AppConfig.
    // Get a configured NetId object out of AppConfig.
    try {
      NetId netId = (NetId)getAppConfig().getObject("NetId");

      EnterpriseUser entUser = (EnterpriseUser)getAppConfig()
        .getObject("EnterpriseUser");
      EnterpriseUserPassword entUserPassword =
        (EnterpriseUserPassword)getAppConfig()
        .getObject("EnterpriseUserPassword");
    }
View Full Code Here


    // Verify that all message objects required are in AppConfig.
    // Get a configured NetId object out of AppConfig.
    try {
      NetId netId = (NetId)getAppConfig().getObject("NetId");

      EnterpriseUser entUser = (EnterpriseUser)getAppConfig()
        .getObject("EnterpriseUser");
      EnterpriseUserPassword entUserPassword =
        (EnterpriseUserPassword)getAppConfig()
        .getObject("EnterpriseUserPassword");
    }
View Full Code Here

    objclass.add("inetOrgPerson");
    objclass.add("eduPerson");
    attrs.put(objclass);

    // Set the value for givenName.
    EnterpriseUser entUser = entUserPassword.getEnterpriseUser();
    String firstName = null;
    if (entUser.getLightweightPerson().getName() != null)
      firstName = entUser.getLightweightPerson().getName().getFirstName();
    if (firstName == null) firstName = "NoFirstName";
    if (firstName != null) {
      Attribute givenName = new BasicAttribute("givenName");
      givenName.add(firstName);
      attrs.put(givenName);
    }
   
    // Set the value for sn.
    String lastName = null;
    if (entUser.getLightweightPerson().getName() != null)
      lastName = entUser.getLightweightPerson().getName().getLastName();
    if (lastName == null) lastName = "NoLastName";
    if (lastName != null) {
      Attribute sn = new BasicAttribute("sn");
      sn.add(lastName);
      attrs.put(sn);
    }
   
    // Set the values for cn.
    String commonName = null;
    if (firstName != null && lastName != null) {
      commonName = firstName + " " + lastName;
    }
    if (firstName == null && lastName != null) {
      commonName = lastName;
    }
    if (firstName != null && lastName == null) {
      commonName = firstName;
    }
    if (firstName == null && lastName == null) {
      commonName = null;
    }
    if (commonName != null) {
      Attribute cn = new BasicAttribute("cn");
      cn.add(commonName);
      attrs.put(cn);
    }

    // Set the value for uid.
    String principal = getEnterpriseId(entUser).getPrincipal();
    if (principal != null) {
      Attribute uid = new BasicAttribute("uid");
      uid.add(principal);
      attrs.put(uid);
    }

    // Set the value for employeeNumber.
    String instId = entUser.getLightweightPerson().getInstitutionalId();
    if (instId != null) {
      Attribute employeeNumber = new BasicAttribute("employeeNumber");
      employeeNumber.add(instId);
      attrs.put(employeeNumber);
    }
View Full Code Here

   * @throws EnterpriseObjectUpdateException
   */
  private EnterpriseUserPassword updateEnterpriseUserPassword(String instID, String principal, String domain, String newPassword)
    throws EnterpriseConfigurationObjectException, EnterpriseFieldException,
         EnterpriseObjectCreateException, EnterpriseObjectQueryException, EnterpriseObjectUpdateException {
      EnterpriseUser eu = (EnterpriseUser)appConfig.getObject(ENTERPRISE_USER);
      logger.info("["+portletName+"] Got " + ENTERPRISE_USER + " from AppConfig, performing Query...");

      LightweightPerson lPerson = eu.newLightweightPerson();
    logger.info("["+portletName+"] Got LightweightPerson...");
    lPerson.setInstitutionalId(instID);
    logger.info("["+portletName+"] Set instid on lightweight person...");

    NetId netId = eu.newNetId();
    logger.info("["+portletName+"] Got NetId...");
    netId.setPrincipal(principal);
    netId.setDomain(domain);
     
      eu.setLightweightPerson(lPerson);
      eu.addNetId(netId);
     
      EnterpriseUserPassword eup=(EnterpriseUserPassword)appConfig.getObject(ENTERPRISE_USER_PASSWORD);
      eup.setEnterpriseUser(eu);
      Password p = eup.newPassword();
      p.setValue(newPassword);
View Full Code Here

   * @throws EnterpriseObjectQueryException
   * @throws EnterpriseObjectUpdateException
   */
  private EnterpriseUserPassword lookupEnterpriseUserPassword(String principal, String domain) throws EnterpriseFieldException, EnterpriseConfigurationObjectException, EnterpriseObjectQueryException
    {
      EnterpriseUser eu = (EnterpriseUser)appConfig.getObject(ENTERPRISE_USER);
      System.out.println("["+this.getClass().getSimpleName()+"] Got " + ENTERPRISE_USER
          + " from AppConfig, performing Query...");
      NetId netId=eu.newNetId();
      netId.setPrincipal(principal);
      netId.setDomain(domain);
      List euQueryList=eu.query(netId,p2p);
      if (euQueryList.size()==0) {
        System.out.println("["+this.getClass().getSimpleName()+"] No EnterpriseUser for "+principal+"@"+domain+".");
        return null;
      }
      eu=(EnterpriseUser)euQueryList.get(0);
View Full Code Here

      throw new UportalFormHandlerException("Exception obtaining user account information", e);
    }
    */

    try {
      EnterpriseUser eu =
        (EnterpriseUser)getAppConfig().getObject(queryObjectName);
      eu.getEnterpriseFields().setIgnoreValidation(true);
      LogService.log(LogService.INFO, "got EnterpriseUser...");

      LightweightPerson lPerson = eu.newLightweightPerson();
      lPerson.getEnterpriseFields().setIgnoreValidation(true);

      NetId netId = eu.newNetId();
      netId.setPrincipal(principal);
      netId.setDomain(domain);
      eu.addNetId(netId);

      if (instId != null && instId.length() > 0) {
        lPerson.setInstitutionalId(instId);
        Name name = lPerson.newName();
        name.setFirstName(firstName);
        name.setLastName(lastName);
        lPerson.setName(name);
        LogService.log(LogService.INFO, "set LightweightPerson on EnterpriseUser...");
        eu.setLightweightPerson(lPerson);

        JmsEnterpriseObject jeo = (JmsEnterpriseObject)getAppConfig().getObject(messageObjectName);
        LogService.log(LogService.INFO, "got " + messageObjectName + " from AppConfig, performing Query...");

        // todo - use producer pool
View Full Code Here

    // Verify that all message objects required are in AppConfig.
    // Get a configured NetId object out of AppConfig.
    try {
      NetId netId = (NetId)getAppConfig().getObject("NetId");

      EnterpriseUser entUser = (EnterpriseUser)getAppConfig()
        .getObject("EnterpriseUser");
      EnterpriseUserPassword entUserPassword =
        (EnterpriseUserPassword)getAppConfig()
        .getObject("EnterpriseUserPassword");
    }
View Full Code Here

    // Verify that all message objects required are in AppConfig.
    // Get a configured NetId object out of AppConfig.
    try {
      NetId netId = (NetId)getAppConfig().getObject(NET_ID);
      EnterpriseUser entUser = (EnterpriseUser)getAppConfig().getObject(ENTERPRISE_USER);
      BasicPerson person = (BasicPerson)getAppConfig().getObject(BASIC_PERSON);
    }
    catch (EnterpriseConfigurationObjectException eoce) {
      // An error occurred retrieving a required object from AppConfig. Log it
      // and throw an exception.
View Full Code Here

          "This method handles creation of new users in the enterprise directory, but a configuration flag " +
          "preventing creation of mising users was set.", "[" + getServiceName() + "handleCreate]");
      return;
    }

    EnterpriseUser newEntUser = null;
    try {
      newEntUser = (EnterpriseUser)getAppConfig().getObject(ENTERPRISE_USER);
    }
    catch (EnterpriseConfigurationObjectException ecoe) {
      // An error occurred getting an object from AppConfig. Log it and
      // publish a sync error message.
      publishError ("application", "OpenEAI-3001", "An error occurred getting an object from " +
          "AppConfig. the exception is: " + ecoe.getMessage(), "[" + getServiceName() + ".execute] ", ecoe);
      return;
    }
    // Create the input document from the JMS message passed in.
    Document inDoc = null;
    try {
      inDoc = initializeInput(messageNumber, aMessage);
    }
    catch (JMSException jmse) {
      // An error occurred creating the input document from the JMS message
      // passed in. Log it and publish a sync error.
      publishError ("system", "OpenEAI-2101", "An error occurred creating the input document from the JMS message passed in. The exception is: " +
          jmse.getMessage(), "[" + getServiceName() + ".handleCreate]", jmse);
      return;
    }
    // Get the new state of the BasicPerson and build a BasicPerson object.
    Element elemNewEnterpriseUser = inDoc.getRootElement().getChild("DataArea").getChild("NewData").getChild(ENTERPRISE_USER);

    try {
      newEntUser.buildObjectFromInput(elemNewEnterpriseUser);
    }
    catch (EnterpriseLayoutException ele) {
      // An error occurred building the BasicPerson object from thw
      // BasicPerson element contained in the NewData element of
      // the message. Log it and publish a sync error message.
      publishError ("system", "DirectoryServiceGateway-1002", "An error occurred building the EnterpriseUser object from the EnterpriseUser " +
           "element contained in the NewData element of the message. The exception is: " +
          ele.getMessage(), "[" + getServiceName() + ".handleCreate] ", ele);
      return;
    }
    NetId netID = newEntUser.getNetId(0);
    String principal = netID.getPrincipal();
   
    // If the user entry does not exist in the directory, create it
    if (!personExists (uidAttr, principal)) {
      if (getCreateMissingUsers())
View Full Code Here

   * @throws EnterpriseObjectUpdateException
   */
  private EnterpriseUserPassword updateEnterpriseUserPassword(String instID, String principal, String domain, String newPassword)
    throws EnterpriseConfigurationObjectException, EnterpriseFieldException,
         EnterpriseObjectCreateException, EnterpriseObjectQueryException, EnterpriseObjectUpdateException {
      EnterpriseUser eu = (EnterpriseUser)appConfig.getObject(ENTERPRISE_USER);
      logger.info("["+portletName+"] Got " + ENTERPRISE_USER + " from AppConfig, performing Query...");

      NetId netId = eu.newNetId();
    logger.info("["+portletName+"] Got NetId...");
    netId.setPrincipal(principal);
    netId.setDomain(domain);

      LightweightPerson lPerson = eu.newLightweightPerson();
    logger.info("["+portletName+"] Got LightweightPerson...");
    lPerson.setInstitutionalId(instID);
    logger.info("["+portletName+"] Set instid on lightweight person...");
     
      eu.setLightweightPerson(lPerson);
      eu.addNetId(netId);
     
      List euQueryList = eu.query(netId,p2p);
     
      if (euQueryList.size()==0) {
        //create the enterprise user
        eu.create(p2p);
      logger.info("["+portletName+"] Created EnterpriseUser for "
          +principal+"@"+domain+"("+instID+")");
      } else {
        eu = (EnterpriseUser) euQueryList.get(0);
        logger.info("["+portletName+"] Found EnterpriseUser: " + eu);
View Full Code Here

TOP

Related Classes of org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseUserPassword

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.