Examples of UddiEntityPublisher


Examples of org.apache.juddi.model.UddiEntityPublisher

  protected static void install(Configuration config) throws JAXBException, DispositionReportFaultMessage, IOException, ConfigurationException {
       
    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
   
    UddiEntityPublisher rootPublisher = null;
   
    try {
      tx.begin();
      boolean seedAlways = config.getBoolean("juddi.seed.always", false);
      if (!seedAlways && alreadyInstalled(config))
        new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
     
      String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
      String fileRootTModelKeygen = rootPublisherStr + FILE_TMODELKEYGEN;
      TModel rootTModelKeyGen = (TModel)buildInstallEntity(fileRootTModelKeygen, "org.uddi.api_v3", config);
      String fileRootBusinessEntity = rootPublisherStr + FILE_BUSINESSENTITY;
      org.uddi.api_v3.BusinessEntity rootBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildInstallEntity(fileRootBusinessEntity, "org.uddi.api_v3",config);
     
      String rootPartition = getRootPartition(rootTModelKeyGen);
      String nodeId = getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition);
     
      String fileRootPublisher = rootPublisherStr + FILE_PUBLISHER;
      log.info("Loading the root Publisher from file " + fileRootPublisher);
      rootPublisher = installPublisher(em, fileRootPublisher, config);
     
      installRootPublisherKeyGen(em, rootTModelKeyGen, rootPartition, rootPublisher, nodeId);

      rootBusinessEntity.setBusinessKey(nodeId);
      installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config);
     
      List<String> juddiPublishers = getPublishers(config);
      for (String publisherStr : juddiPublishers) {
        String filePublisher = publisherStr + FILE_PUBLISHER;
        String fileTModelKeygen = publisherStr + FILE_TMODELKEYGEN;
        TModel tModelKeyGen = (TModel)buildInstallEntity(fileTModelKeygen, "org.uddi.api_v3", config);
        String fileBusinessEntity = publisherStr + FILE_BUSINESSENTITY;
        org.uddi.api_v3.BusinessEntity businessEntity = (org.uddi.api_v3.BusinessEntity)buildInstallEntity(fileBusinessEntity, "org.uddi.api_v3",config);
        UddiEntityPublisher publisher = installPublisher(em, filePublisher, config);
        if (publisher==null) {
          throw new ConfigurationException("File " + filePublisher + " not found.");
        } else {
          if (tModelKeyGen!=null) installPublisherKeyGen(em, tModelKeyGen, publisher, nodeId);
          if (businessEntity!=null) installBusinessEntity(false, em, businessEntity, publisher, null, config);
View Full Code Here

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 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

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 ValidatePublish(publisher).validateDeleteBinding(em, body);
     
      List<String> entityKeyList = body.getBindingKey();
      for (String entityKey : entityKeyList) {
View Full Code Here

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 ValidatePublish(publisher).validateDeleteBusiness(em, body);
     
      List<String> entityKeyList = body.getBusinessKey();
      for (String entityKey : entityKeyList) {
View Full Code Here

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 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

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 ValidatePublish(publisher).validateDeleteService(em, body);
     
      List<String> entityKeyList = body.getServiceKey();
      for (String entityKey : entityKeyList) {
View Full Code Here

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 ValidatePublish(publisher).validateDeleteTModel(em, body);
 
      // tModels are only lazily deleted!
      List<String> entityKeyList = body.getTModelKey();
View Full Code Here

Examples of org.apache.juddi.model.UddiEntityPublisher

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
 
      List<org.uddi.api_v3.AssertionStatusItem> result = PublicationHelper.getAssertionStatusItemList(publisher, completionStatus, em);
 
      tx.commit();
      return result;
View Full Code Here

Examples of org.apache.juddi.model.UddiEntityPublisher

    EntityManager em = PersistenceManager.getEntityManager();
    EntityTransaction tx = em.getTransaction();
    try {
      tx.begin();
 
      UddiEntityPublisher publisher = this.getEntityPublisher(em, authInfo);
     
      List<org.uddi.api_v3.PublisherAssertion> result = new ArrayList<org.uddi.api_v3.PublisherAssertion>(0);
 
      List<?> businessKeysFound = null;
      businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
View Full Code Here

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 ValidatePublish(publisher).validateRegisteredInfo(body);

      List<?> businessKeysFound = null;
      businessKeysFound = FindBusinessByPublisherQuery.select(em, null, publisher, businessKeysFound);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.