Package org.apache.juddi.datastore

Examples of org.apache.juddi.datastore.DataStore


    String completionStatus = request.getCompletionStatus();
    AuthInfo authInfo = request.getAuthInfo();
    AssertionStatusReport report = null;

    // aquire a jUDDI datastore instance
    DataStore dataStore = DataStoreFactory.getDataStore();

    try
    {
      dataStore.beginTrans();

      // validates authentication parameters
      Publisher publisher = getPublisher(authInfo,dataStore);
      String publisherID = publisher.getPublisherID();

      // validate request parameters & execute
      // nothing to validate

      // get the AssertionStatusReport
      report = new AssertionStatusReport();
      report.setGeneric(generic);
      report.setOperator(Config.getOperator());
      report.setAssertionStatusItemVector(dataStore.getAssertionStatusItems(publisherID,completionStatus));

      dataStore.commit();
    }
    catch(RegistryException regex)
    {
      try { dataStore.rollback(); } catch(Exception e) { }
      log.error(regex);
      throw (RegistryException)regex;
    }
    catch(Exception ex)
    {
      try { dataStore.rollback(); } catch(Exception e) { }
      log.error(ex);
      throw new RegistryException(ex);
    }
    finally
    {
      if (dataStore != null)
        dataStore.release();
    }

    // didn't encounter an exception so let's return
    // the pre-constructed successful DispositionReport
    return report;
View Full Code Here


    GetBusinessDetailExt request = (GetBusinessDetailExt)regObject;
    String generic = request.getGeneric();
    Vector businessKeyVector = request.getBusinessKeyVector();

    // aquire a jUDDI datastore instance
    DataStore dataStore = DataStoreFactory.getDataStore();

    try
    {
      dataStore.beginTrans();

      // verify
      for (int i=0; i<businessKeyVector.size(); i++)
      {
        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++)
      {
        String businessKey = (String)businessKeyVector.elementAt(i);
        BusinessEntity business = dataStore.fetchBusiness(businessKey);
        BusinessEntityExt businessExt = new BusinessEntityExt(business);
        businessEntityExtVector.addElement(businessExt);
      }

      dataStore.commit();

      // create a new BusinessDetailExt and stuff the Vector of
      // new BusinessEntityExt instances into it.
      BusinessDetailExt detailExt = new BusinessDetailExt();
      detailExt.setGeneric(generic);
      detailExt.setOperator(Config.getOperator());
      detailExt.setBusinessEntityExtVector(businessEntityExtVector);
      return detailExt;
    }
    catch(InvalidKeyPassedException keyex)
    {
      try { dataStore.rollback(); } catch(Exception e) { }
      log.info(keyex.getMessage());
      throw (RegistryException)keyex;
    }
    catch(RegistryException regex)
    {
      try { dataStore.rollback(); } catch(Exception e) { }
      log.error(regex);
      throw (RegistryException)regex;
    }
    catch(Exception ex)
    {
      try { dataStore.rollback(); } catch(Exception e) { }
      log.error(ex);
      throw new RegistryException(ex);
    }
    finally
    {
      if (dataStore != null)
        dataStore.release();
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.juddi.datastore.DataStore

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.