Package org.apache.juddi.error

Examples of org.apache.juddi.error.InvalidKeyPassedException


        // check that this TModel really exists. If not
        // then throw an InvalidKeyPassedException.
        if ((tModelKey == null) || (tModelKey.length() == 0) ||
            (!dataStore.isValidTModelKey(tModelKey)))
          throw new InvalidKeyPassedException(tModelKey);

        // check to make sure that 'authorizedName' controls this
        // TModel. If not then throw a UserMismatchException.
        if (!dataStore.isTModelPublisher(tModelKey,publisherID))
          throw new UserMismatchException("publisher="+publisherID+" tModelKey="+tModelKey);
View Full Code Here


        String businessKey = (String)businessKeyVector.elementAt(i);

        // If the a BusinessEntity doesn't exist hrow an InvalidKeyPassedException.
        if ((businessKey == null) || (businessKey.length() == 0) ||
            (!dataStore.isValidBusinessKey(businessKey)))
          throw new InvalidKeyPassedException(businessKey);
      }

      Vector businessEntityExtVector = new Vector();

      for (int i=0; i<businessKeyVector.size(); i++)
View Full Code Here

      List<String> bindingKeyList = body.getBindingKey();
      for (String bindingKey : bindingKeyList) {
       
        org.apache.juddi.model.BindingTemplate modelBindingTemplate = em.find(org.apache.juddi.model.BindingTemplate.class, bindingKey);
        if (modelBindingTemplate == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BindingTemplateNotFound", bindingKey));
       
        org.uddi.api_v3.BindingTemplate apiBindingTemplate = new org.uddi.api_v3.BindingTemplate();
       
        MappingModelToApi.mapBindingTemplate(modelBindingTemplate, apiBindingTemplate);
       
View Full Code Here

      List<String> businessKeyList = body.getBusinessKey();
      for (String businessKey : businessKeyList) {
       
        org.apache.juddi.model.BusinessEntity modelBusinessEntity = em.find(org.apache.juddi.model.BusinessEntity.class, businessKey);
        if (modelBusinessEntity == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", businessKey));
       
        org.uddi.api_v3.BusinessEntity apiBusinessEntity = new org.uddi.api_v3.BusinessEntity();
       
        MappingModelToApi.mapBusinessEntity(modelBusinessEntity, apiBusinessEntity);
       
View Full Code Here

      List<String> entityKeyList = body.getEntityKey();
      for (String entityKey : entityKeyList) {
       
        org.apache.juddi.model.UddiEntity modelUddiEntity = em.find(org.apache.juddi.model.UddiEntity.class, entityKey);
        if (modelUddiEntity == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.EntityNotFound", entityKey));
       
        org.uddi.api_v3.OperationalInfo apiOperationalInfo = new org.uddi.api_v3.OperationalInfo();
       
        MappingModelToApi.mapOperationalInfo(modelUddiEntity, apiOperationalInfo);
       
View Full Code Here

      List<String> serviceKeyList = body.getServiceKey();
      for (String serviceKey : serviceKeyList) {
       
        org.apache.juddi.model.BusinessService modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, serviceKey);
        if (modelBusinessService == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", serviceKey));
       
        org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
       
        MappingModelToApi.mapBusinessService(modelBusinessService, apiBusinessService);
       
View Full Code Here

      List<String> tmodelKeyList = body.getTModelKey();
      for (String tmodelKey : tmodelKeyList) {
       
        org.apache.juddi.model.Tmodel modelTModel = em.find(org.apache.juddi.model.Tmodel.class, tmodelKey);
        if (modelTModel == null) {
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.TModelNotFound", tmodelKey));
        }
       
        org.uddi.api_v3.TModel apiTModel = new org.uddi.api_v3.TModel();
       
        MappingModelToApi.mapTModel(modelTModel, apiTModel);
View Full Code Here

      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));

    // No null or empty list
    List<String> entityKeyList = body.getSubscriptionKey();
    if (entityKeyList == null || entityKeyList.size() == 0)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NoKeys"));
   
    HashSet<String> dupCheck = new HashSet<String>();
    for (String entityKey : entityKeyList) {
      boolean inserted = dupCheck.add(entityKey);
      if (!inserted)
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.DuplicateKey", entityKey));
     
      Object obj = em.find(org.apache.juddi.model.Subscription.class, entityKey);
      if (obj == null)
        throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.SubscriptionNotFound", entityKey));
     
      // Make sure publisher owns this entity.
      if (!publisher.getAuthorizedName().equals(((org.apache.juddi.model.Subscription)obj).getAuthorizedName()))
        throw new UserMismatchException(new ErrorMessage("errors.usermismatch.InvalidOwner", entityKey));
     
View Full Code Here

    if (body == null)
      throw new FatalErrorException(new ErrorMessage("errors.NullInput"));
   
    String subscriptionKey = body.getSubscriptionKey();
    if (subscriptionKey == null || subscriptionKey.length() == 0)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NullKey", subscriptionKey));
   
    Object obj = em.find(org.apache.juddi.model.Subscription.class, subscriptionKey);
    if (obj == null)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.SubscriptionNotFound", subscriptionKey));
   
    Date expiresAfter = ((org.apache.juddi.model.Subscription)obj).getExpiresAfter();
    Date now = new Date();
    if (expiresAfter.getTime() < now.getTime())
      throw new InvalidKeyPassedException(new ErrorMessage("errors.getsubscriptionresult.SubscriptionExpired", subscriptionKey));
   
    CoveragePeriod coveragePeriod = body.getCoveragePeriod();
    if (coveragePeriod == null)
      throw new InvalidTimeException(new ErrorMessage("errors.getsubscriptionresult.NullCoveragePeriod"));
   
View Full Code Here

*/
public class ValidateUDDIKey {

  public static void validateUDDIv3Key(String key) throws DispositionReportFaultMessage {
    if (key == null)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.NullKey"));
   
    String keyToTest = key.trim();
    if (keyToTest.endsWith(KeyGenerator.PARTITION_SEPARATOR))
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));

    StringTokenizer tokenizer = new StringTokenizer(key.toLowerCase(), KeyGenerator.PARTITION_SEPARATOR);
    int tokensCount = tokenizer.countTokens();
    if(tokensCount <= 1)
      throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
    for(int count = 0; tokenizer.hasMoreTokens(); count++) {
      String nextToken = tokenizer.nextToken();

      if (count == 0) {
        if (!ValidateUDDIKey.isValidUDDIScheme(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
      }
      else if (count == 1) {
        if(!ValidateUDDIKey.isValidDomainKey(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
      }
      else {
        if (!isValidKSS(nextToken))
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.MalformedKey", key));
      }
    }
  }
View Full Code Here

TOP

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

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.