Package org.apache.juddi.datatype.tmodel

Examples of org.apache.juddi.datatype.tmodel.TModel


    if (tModelVector == null)
      return null;
   
    for (int i=0; i<tModelVector.size(); i++)
    {
      TModel tModel = (TModel)tModelVector.elementAt(i);
     
      CategoryBag catBag = tModel.getCategoryBag();
      if (catBag != null)
      {
        Vector refs = catBag.getKeyedReferenceVector();
        if ((refs != null) && (refs.size() > 0))
          validate(refs);
      }
     
      IdentifierBag idBag = tModel.getIdentifierBag();
      if (idBag != null)
      {
        Vector refs = idBag.getKeyedReferenceVector();
        if ((refs != null) && (refs.size() > 0))
          validate(refs);
View Full Code Here


    IdentifierBag idBag = new IdentifierBag();
    idBag.addKeyedReference(new KeyedReference("idBagKeyName","idBagkeyValue"));
    idBag.addKeyedReference(new KeyedReference("uuid:f78a135a-4769-4e79-8604-54d440314bc0","idBagKeyName2","idBagkeyValue2"));

    TModel tModel = new TModel();
    tModel.setTModelKey("uuid:269855db-62eb-4862-8e5a-1b06f2753038");
    tModel.setOperator("jUDDI");
    tModel.setAuthorizedName("Steve Viens");
    tModel.setName("jUDDI TModel");
    tModel.addDescription(new Description("tModel whatever"));
    tModel.addDescription(new Description("tModel whatever too","fr"));
    tModel.setCategoryBag(catBag);
    tModel.setIdentifierBag(idBag);
    tModel.setOverviewDoc(overDoc);

    SaveTModel request = new SaveTModel();
    request.setAuthInfo(authInfo);
    request.addTModel(tModel);
    request.addTModel(tModel);
View Full Code Here

    IdentifierBag idBag = new IdentifierBag();
    idBag.addKeyedReference(new KeyedReference("idBagKeyName","idBagkeyValue"));
    idBag.addKeyedReference(new KeyedReference("uuid:f78a135a-4769-4e79-8604-54d440314bc0","idBagKeyName2","idBagkeyValue2"));

    TModel tModel = new TModel();
    tModel.setTModelKey("uuid:269855db-62eb-4862-8e5a-1b06f2753038");
    tModel.setOperator("jUDDI");
    tModel.setAuthorizedName("Steve Viens");
    tModel.setName("jUDDI TModel");
    tModel.addDescription(new Description("tModel whatever"));
    tModel.addDescription(new Description("tModel whatever too","fr"));
    tModel.setCategoryBag(catBag);
    tModel.setIdentifierBag(idBag);
    tModel.setOverviewDoc(overDoc);

    TModelDetail detail = new TModelDetail();
    detail.setGeneric("2.0");
    detail.setOperator("jUDDI.org");
    detail.setTruncated(true);
View Full Code Here

   *
   */
  public TModel fetchTModel(String tModelKey)
    throws org.apache.juddi.error.RegistryException
  {
    TModel tModel = null;

    try
    {
      if ((tModelKey != null) && (connection != null))
      {
        tModel = TModelTable.select(tModelKey,connection);
        if (tModel != null)
        {
          tModel.setDescriptionVector(TModelDescTable.select(tModelKey,connection));

          // fetch the TModel CategoryBag
          Vector catVector = TModelCategoryTable.select(tModelKey,connection);
          if (catVector != null)
          {
            CategoryBag catBag = new CategoryBag();
            catBag.setKeyedReferenceVector(catVector);
            tModel.setCategoryBag(catBag);
          }

          // fetch the TModel IdentifierBag
          Vector idVector = TModelIdentifierTable.select(tModelKey,connection);
          if (idVector != null)
          {
            IdentifierBag idBag = new IdentifierBag();
            idBag.setKeyedReferenceVector(idVector);
            tModel.setIdentifierBag(idBag);
          }

          // fetch the TModel OverviewDoc & OverviewDoc Descrptions
          OverviewDoc overDoc = tModel.getOverviewDoc();
          if (overDoc != null)
          {
            overDoc.setDescriptionVector(TModelDocDescTable.select(tModelKey,connection));
            tModel.setOverviewDoc(overDoc);
          }
        }
      }
    }
    catch(java.sql.SQLException sqlex)
View Full Code Here

    if ((tModelKey != null) && (connection != null))
    {
      try
      {
        TModel tModel = TModelTable.select(tModelKey,connection);
        info = new TModelInfo();
        info.setTModelKey(tModelKey);
        info.setNameValue(tModel.getName());
      }
      catch(java.sql.SQLException sqlex)
      {
        throw new RegistryException(sqlex);
      }
View Full Code Here

        OverviewDoc overviewDoc = new OverviewDoc();
        overviewDoc.setOverviewURL(
          "http://www.steveviens.com/overviewdoc.html");

        String tModelKey = uuidgen.uuidgen();
        TModel tModel = new TModel();
        tModel.setTModelKey(tModelKey);
        tModel.setAuthorizedName("sviens");
        tModel.setOperator("WebServiceRegistry.com");
        tModel.setName("Tuscany Web Service Company");
        tModel.setOverviewDoc(overviewDoc);

        Vector keyRefs = new Vector();
        keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "blah, blah, blah"));
        keyRefs.add(
          new KeyedReference(uuidgen.uuidgen(), "Yadda, Yadda, Yadda"));
        keyRefs.add(
          new KeyedReference(uuidgen.uuidgen(), "WhoobWhoobWhoobWhoob"));
        keyRefs.add(new KeyedReference(uuidgen.uuidgen(), "Haachachachacha"));

        String authorizedUserID = "sviens";

        // begin a new transaction
        txn.begin(connection);

        // insert a new TModel
        TModelTable.insert(tModel, authorizedUserID, connection);

        // insert a Collection of new Identifier KeyedReference objects
        TModelIdentifierTable.insert(tModelKey, keyRefs, connection);

        // insert another new TModel
        tModel.setTModelKey(uuidgen.uuidgen());
        TModelTable.insert(tModel, authorizedUserID, connection);

        // insert another Collection of new Identifier KeyedReference objects
        TModelIdentifierTable.insert(
          tModel.getTModelKey(),
          keyRefs,
          connection);

        // select a Collection of Identifier KeyedReference objects
        keyRefs = TModelIdentifierTable.select(tModelKey, connection);
View Full Code Here

  private RegistryObject getRegistryObject()
  {
    BusinessEntity business = new BusinessEntity();
    BusinessService service = new BusinessService();
    TModel tModel = new TModel();

    ValidateValues object = new ValidateValues();
    object.addBusinessEntity(business);
    object.addBusinessService(service);
    object.addTModel(tModel);
View Full Code Here

    Element parent = XMLUtils.newRootElement();
    Element child = null;

    BusinessEntity business = new BusinessEntity();
    BusinessService service = new BusinessService();
    TModel tModel = new TModel();

    ValidateValues request = new ValidateValues();
    request.addBusinessEntity(business);
    request.addBusinessService(service);
    request.addTModel(tModel);
View Full Code Here

    this.maker = maker;
  }

  public RegistryObject unmarshal(Element element)
  {
    TModel obj = new TModel();
    Vector nodeList = null;
    AbstractHandler handler = null;

    // Attributes
    obj.setTModelKey(element.getAttribute("tModelKey"));
    obj.setOperator(element.getAttribute("operator"));
    obj.setAuthorizedName(element.getAttribute("authorizedName"));

    // Text Node Value
    // [none]

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,NameHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      obj.setName((Name)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,DescriptionHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      obj.addDescription((Description)handler.unmarshal((Element)nodeList.elementAt(i)));
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,OverviewDocHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(OverviewDocHandler.TAG_NAME);
      obj.setOverviewDoc((OverviewDoc)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,IdentifierBagHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(IdentifierBagHandler.TAG_NAME);
      obj.setIdentifierBag((IdentifierBag)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,CategoryBagHandler.TAG_NAME);
    if (nodeList.size() > 0)
    {
      handler = maker.lookup(CategoryBagHandler.TAG_NAME);
      obj.setCategoryBag((CategoryBag)handler.unmarshal((Element)nodeList.elementAt(0)));
    }

    return obj;
  }
View Full Code Here

    return obj;
  }

  public void marshal(RegistryObject object,Element parent)
  {
    TModel tModel = (TModel)object;
    Element element = parent.getOwnerDocument().createElement(TAG_NAME);
    AbstractHandler handler = null;

    String tModelKey = tModel.getTModelKey();
    if (tModelKey != null)
      element.setAttribute("tModelKey",tModelKey);

    String authName = tModel.getAuthorizedName();
    if (authName != null)
      element.setAttribute("authorizedName",authName);

    String operator = tModel.getOperator();
    if (operator != null)
      element.setAttribute("operator",operator);

    String name = tModel.getName();
    if (name != null)
    {
      handler = maker.lookup(NameHandler.TAG_NAME);
      handler.marshal(new Name(name),element);
    }

    Vector descrVector = tModel.getDescriptionVector();
    if ((descrVector!=null) && (descrVector.size() > 0))
    {
      handler = maker.lookup(DescriptionHandler.TAG_NAME);
      for (int i=0; i < descrVector.size(); i++)
        handler.marshal((Description)descrVector.elementAt(i),element);
    }

    OverviewDoc overDoc = tModel.getOverviewDoc();
    if (overDoc != null)
    {
      handler = maker.lookup(OverviewDocHandler.TAG_NAME);
      handler.marshal(overDoc,element);
    }

    IdentifierBag identifierBag = tModel.getIdentifierBag();
    if (identifierBag != null)
    {
      handler = maker.lookup(IdentifierBagHandler.TAG_NAME);
      handler.marshal(identifierBag,element);
    }

    CategoryBag categoryBag = tModel.getCategoryBag();
    if (categoryBag != null)
    {
      handler = maker.lookup(CategoryBagHandler.TAG_NAME);
      handler.marshal(categoryBag,element);
    }
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.tmodel.TModel

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.