Package org.apache.juddi.model

Examples of org.apache.juddi.model.UddiEntityPublisher


    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
      new ValidateSubscription(publisher).validateDeleteSubscription(em, body);
     
          List<String> subscriptionKeyList = body.getSubscriptionKey();
          for (String subscriptionKey : subscriptionKeyList) {
                  Object obj = em.find(org.apache.juddi.model.Subscription.class, subscriptionKey);
View Full Code Here


    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
                try {
                        tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
     
      List<Subscription> result = new ArrayList<Subscription>(0);
     
      List<org.apache.juddi.model.Subscription> modelSubscriptionList = (List<org.apache.juddi.model.Subscription>)FindSubscriptionByPublisherQuery.select(em, publisher.getAuthorizedName());
      if (modelSubscriptionList != null && modelSubscriptionList.size() > 0) {
        for (org.apache.juddi.model.Subscription modelSubscription : modelSubscriptionList) {
         
          Subscription apiSubscription = new Subscription();
         
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
      new ValidateSubscription(publisher).validateSubscriptions(em, subscription.value);
     
      List<org.uddi.sub_v3.Subscription> apiSubscriptionList = subscription.value;
      for (org.uddi.sub_v3.Subscription apiSubscription : apiSubscriptionList) {
       
        org.apache.juddi.model.Subscription modelSubscription = new org.apache.juddi.model.Subscription();
       
        Object existing = em.find(org.apache.juddi.model.Subscription.class, apiSubscription.getSubscriptionKey());
        if (existing != null) {
          org.apache.juddi.model.Subscription existingEntity = (org.apache.juddi.model.Subscription) existing;
          doRenewal(existingEntity, apiSubscription);
          //carrying over the created and last notified dates if this is a renewal.
          modelSubscription.setCreateDate(existingEntity.getCreateDate());
          modelSubscription.setLastNotified(existingEntity.getLastNotified());
          em.remove(existing);
        } else {
          modelSubscription.setCreateDate(new Date());
        }
                             
        doSubscriptionExpirationDate(apiSubscription);
       
        MappingApiToModel.mapSubscription(apiSubscription, modelSubscription);
       
        modelSubscription.setAuthorizedName(publisher.getAuthorizedName());
       
        // Add the matching keys to the match collection
        List<?> keys = getSubscriptionMatches(apiSubscription.getSubscriptionFilter(), em);
        if (keys != null && keys.size() > 0) {
          for (Object key : keys) {
View Full Code Here

      }

      tx.begin();
 
      String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
      UddiEntityPublisher  rootPublisher = new UddiEntityPublisher(rootPublisherStr);
      rootPublisher.populateKeyGeneratorKeys(em);
      List<String> rootKeyGenList = rootPublisher.getKeyGeneratorKeys();
      if (rootKeyGenList == null || rootKeyGenList.size() == 0)
        throw new ConfigurationException("The 'root' publisher key generator was not found.  Please make sure that the application is properly installed.");
     
      String rootKeyGen = rootKeyGenList.iterator().next();
      //rootKeyGen = rootKeyGen.substring((KeyGenerator.UDDI_SCHEME + KeyGenerator.PARTITION_SEPARATOR).length());
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
     
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidatePublish(publisher).validateAddPublisherAssertions(em, body);
 
      List<org.uddi.api_v3.PublisherAssertion> apiPubAssertionList = body.getPublisherAssertion();
      for (org.uddi.api_v3.PublisherAssertion apiPubAssertion : apiPubAssertionList) {
       
        org.apache.juddi.model.PublisherAssertion modelPubAssertion = new org.apache.juddi.model.PublisherAssertion();
       
        MappingApiToModel.mapPublisherAssertion(apiPubAssertion, modelPubAssertion);
       
        org.apache.juddi.model.PublisherAssertion existingPubAssertion = em.find(modelPubAssertion.getClass(), modelPubAssertion.getId());
        boolean persistNewAssertion = true;
        if (existingPubAssertion != null) {
          if (modelPubAssertion.getTmodelKey().equalsIgnoreCase(existingPubAssertion.getTmodelKey()) &&
            modelPubAssertion.getKeyName().equalsIgnoreCase(existingPubAssertion.getKeyName()) &&
            modelPubAssertion.getKeyValue().equalsIgnoreCase(existingPubAssertion.getKeyValue())) {
            // This pub assertion is already been "asserted".  Simply need to set the "check" value on the existing (and persistent) assertion
            if (publisher.isOwner(existingPubAssertion.getBusinessEntityByFromKey()))
              existingPubAssertion.setFromCheck("true");
            if (publisher.isOwner(existingPubAssertion.getBusinessEntityByToKey()))
              existingPubAssertion.setToCheck("true");
           
            persistNewAssertion = false;
          }
          else {
            // Otherwise, it is a new relationship between these entities.  Remove the old one so the new one can be added.
            // TODO: the model only seems to allow one assertion per two business (primary key is fromKey and toKey). Spec seems to imply as
            // many relationships as desired (the differentiator would be the keyedRef values).
            em.remove(existingPubAssertion);
          }
        }
 
        if (persistNewAssertion) {
          org.apache.juddi.model.BusinessEntity beFrom = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getFromKey());
          org.apache.juddi.model.BusinessEntity beTo = em.find(org.apache.juddi.model.BusinessEntity.class, modelPubAssertion.getId().getToKey());
          modelPubAssertion.setBusinessEntityByFromKey(beFrom);
          modelPubAssertion.setBusinessEntityByToKey(beTo);
 
          modelPubAssertion.setFromCheck("false");
          modelPubAssertion.setToCheck("false");
 
          em.persist(modelPubAssertion);
         
          if (publisher.isOwner(modelPubAssertion.getBusinessEntityByFromKey()))
            modelPubAssertion.setFromCheck("true");
          if (publisher.isOwner(modelPubAssertion.getBusinessEntityByToKey()))
            modelPubAssertion.setToCheck("true");
        }
       
      }
 
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidatePublish(publisher).validateDeleteBinding(em, body);
     
      List<String> entityKeyList = body.getBindingKey();
      for (String entityKey : entityKeyList) {
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
 
      new ValidatePublish(publisher).validateDeleteBusiness(em, body);
     
      List<String> entityKeyList = body.getBusinessKey();
      for (String entityKey : entityKeyList) {
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
 
      new ValidatePublish(publisher).validateDeletePublisherAssertions(em, body);
     
      List<org.uddi.api_v3.PublisherAssertion> entityList = body.getPublisherAssertion();
      for (org.uddi.api_v3.PublisherAssertion entity : entityList) {
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidatePublish(publisher).validateDeleteService(em, body);
     
      List<String> entityKeyList = body.getServiceKey();
      for (String entityKey : entityKeyList) {
View Full Code Here

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
 
      new ValidatePublish(publisher).validateDeleteTModel(em, body);
 
      // tModels are only lazily deleted!
      List<String> entityKeyList = body.getTModelKey();
View Full Code Here

TOP

Related Classes of org.apache.juddi.model.UddiEntityPublisher

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.