Package org.apache.juddi.error

Examples of org.apache.juddi.error.ErrorMessage


      return;
   
    // If category bag does exist, it must have at least one element
    List<KeyedReference> elems = categories.getKeyedReference();
    if (elems == null || elems.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.categorybag.NoInput"));
   
    for (KeyedReference elem : elems) {
      validateKeyedReference(elem);
    }
    List<KeyedReferenceGroup> krgs = categories.getKeyedReferenceGroup();
View Full Code Here


      return;
   
    // If category bag does exist, it must have at least one element
    List<org.uddi.api_v3.KeyedReference> keyedRefList = identifiers.getKeyedReference();
    if (keyedRefList == null || keyedRefList.size() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.identifierbag.NoInput"));
   
    for (org.uddi.api_v3.KeyedReference keyedRef : keyedRefList) {
      validateKeyedReference(keyedRef);
    }
  }
View Full Code Here

 
  public void validateKeyedReferenceGroup (KeyedReferenceGroup krg) throws DispositionReportFaultMessage {
    // Keyed reference groups must contain a tModelKey
    if (krg instanceof org.uddi.api_v3.KeyedReferenceGroup) {
      if (krg.getTModelKey() == null || krg.getTModelKey().length() == 0)
        throw new ValueNotAllowedException(new ErrorMessage("errors.keyedreference.NoTModelKey"));
    }
  }
View Full Code Here

    try {
      Cryptor cryptor = (Cryptor) CryptorFactory.getCryptor();
      return cryptor.encrypt(str);
    } catch (InvalidKeyException e) {
      logger.error("Invalid Key Exception in crypting the password", e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.InvalidKey", e.getMessage()));
    } catch (NoSuchPaddingException e) {
      logger.error("Padding Exception in crypting the password", e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.Padding", e.getMessage()));
    } catch (NoSuchAlgorithmException e) {
      logger.error("Algorithm Exception in crypting the password", e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.Algorithm", e.getMessage()));
    } catch (InvalidAlgorithmParameterException e) {
      logger.error("Algorithm parameter Exception in crypting the password",
          e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.AlgorithmParam", e.getMessage()));
    } catch (IllegalBlockSizeException e) {
      logger.error("Block size Exception in crypting the password", e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.BlockSize", e.getMessage()));
    } catch (BadPaddingException e) {
      logger.error("Bad Padding Exception in crypting the password", e);
      throw new FatalErrorException(new ErrorMessage(
          "errors.auth.cryptor.BadPadding", e.getMessage()));
    }
  }
View Full Code Here

   */
  private void preProcess(String userID, String credential)
  throws AuthenticationException {
    // a userID must be specified.
    if (userID == null) {
      throw new UnknownUserException(new ErrorMessage(
          "errors.auth.InvalidUserId", userID));
    }
    // credential (password) must be specified.
    if (credential == null) {
      throw new UnknownUserException(new ErrorMessage(
      "errors.auth.InvalidCredentials"));
    }
  }
View Full Code Here

  throws AuthenticationException {
    if (userTable.containsKey(userID)) {
      User user = (User) userTable.get(userID);
      if ((user.getPassword() == null)
          || (!encryptedCredential.equals(user.getPassword()))) {
        throw new UnknownUserException(new ErrorMessage(
            "errors.auth.InvalidCredentials", userID));
      }
    } else {
      throw new UnknownUserException(new ErrorMessage(
          "errors.auth.InvalidUserId", userID));
    }
    return userID;
  }
View Full Code Here

     
      DatatypeFactory df = DatatypeFactory.newInstance();
      result = df.newXMLGregorianCalendar(gc);
    }
    catch(DatatypeConfigurationException ce) {
      throw new FatalErrorException(new ErrorMessage("errors.Unspecified"));
    }
   
    return result;
  }
View Full Code Here

     
      DatatypeFactory df = DatatypeFactory.newInstance();
      result = df.newDuration(duration);
    }
    catch(DatatypeConfigurationException ce) {
      throw new FatalErrorException(new ErrorMessage("errors.Unspecified"));
    }

    return result;
  }
View Full Code Here

    UddiEntityPublisher uddiPublisher = null;
    try {
      tx.begin();
 
      if (alreadyInstalled(em))
        new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
     
      TModel rootTModelKeyGen = (TModel)buildInstallEntity(FILE_ROOT_TMODELKEYGEN, "org.uddi.api_v3", config);
      org.uddi.api_v3.BusinessEntity rootBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildInstallEntity(FILE_ROOT_BUSINESSENTITY, "org.uddi.api_v3",config);
     
      String rootPartition = getRootPartition(rootTModelKeyGen);
View Full Code Here

 
  protected static String getRootPartition(TModel rootTModelKeyGen) throws JAXBException, IOException, DispositionReportFaultMessage {
    String result = rootTModelKeyGen.getTModelKey().substring(0, rootTModelKeyGen.getTModelKey().lastIndexOf(KeyGenerator.PARTITION_SEPARATOR));
   
    if (result == null || result.length() == 0)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
   
    // Must validate the root partition.  The first component should be a domain key and the any following
    // tokens should be a valid KSS.
    result = result.trim();
    if (result.endsWith(KeyGenerator.PARTITION_SEPARATOR) || result.startsWith(KeyGenerator.PARTITION_SEPARATOR))
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
   
    StringTokenizer tokenizer = new StringTokenizer(result.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
    for(int count = 0; tokenizer.hasMoreTokens(); count++) {
      String nextToken = tokenizer.nextToken();

      if (count == 0) {
        if(!ValidateUDDIKey.isValidDomainKey(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
      }
      else {
        if (!ValidateUDDIKey.isValidKSS(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", result));
      }
    }

    return result;
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.error.ErrorMessage

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.