Package org.apache.juddi.datatype.request

Examples of org.apache.juddi.datatype.request.FindQualifiers


    FindTModel request = (FindTModel)regObject;
    String generic = request.getGeneric();
    String name = request.getNameString();
    CategoryBag categoryBag = request.getCategoryBag();
    IdentifierBag identifierBag = request.getIdentifierBag();
    FindQualifiers qualifiers = request.getFindQualifiers();
    int maxRows = request.getMaxRows();

    // make sure we need to continue with this request. If
    // no arguments were passed in then we'll simply return
    // an empty TModelList (aka "a zero match result set").
    if (((name == null)          || (name.length() == 0))    &&
        ((identifierBag == null) || (identifierBag.size() == 0)) &&
        ((categoryBag == null)   || (categoryBag.size() == 0)))
    {
      TModelList list = new TModelList();
      list.setGeneric(generic);
      list.setTModelInfos(new TModelInfos());
      list.setOperator(Config.getOperator());
      list.setTruncated(false);
      return list;
    }

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

    try
    {
      dataStore.beginTrans();

      // validate the 'name' parameters as much as possible up-front before
      // calling into the data layer for relational validation.
      if (name != null)
      {
        // names can not exceed the maximum character length specified by the
        // UDDI specification (v2.0 specifies a max character length of 255). This
        // value is configurable in jUDDI.
        int maxNameLength = Config.getMaxNameLengthAllowed();
        if (name.length() > maxNameLength)
          throw new NameTooLongException(name+" (max_name="+maxNameLength+")");
      }

      // validate the 'qualifiers' parameter as much as possible up-front before
      // calling into the data layer for relational validation.
      if (qualifiers != null)
      {
        Vector qVector = qualifiers.getFindQualifierVector();
        if ((qVector!=null) && (qVector.size() > 0))
        {
          for (int i=0; i<qVector.size(); i++)
          {
            FindQualifier qualifier = (FindQualifier)qVector.elementAt(i);
View Full Code Here


    this.maker = maker;
  }

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

    // Attributes
    // {none}

    // Text Node Value
    // {none}

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,FindQualifierHandler.TAG_NAME);
    for (int i=0; i<nodeList.size(); i++)
    {
      handler = maker.lookup(FindQualifierHandler.TAG_NAME);
      obj.addFindQualifier((FindQualifier)handler.unmarshal((Element)nodeList.elementAt(i)));
    }

    return obj;
  }
View Full Code Here

    return obj;
  }

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

    Vector qVector = qualifiers.getFindQualifierVector();
    if ((qVector!=null) && (qVector.size() > 0))
    {
      handler = maker.lookup(FindQualifierHandler.TAG_NAME);
      for (int i=0; i < qVector.size(); i++)
        handler.marshal((FindQualifier)qVector.elementAt(i),element);
View Full Code Here

    AbstractHandler handler = maker.lookup(FindQualifiersHandler.TAG_NAME);

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

    FindQualifiers qualifiers = new FindQualifiers();
    qualifiers.addFindQualifier(new FindQualifier(FindQualifier.SORT_BY_DATE_ASC));
    qualifiers.addFindQualifier(new FindQualifier(FindQualifier.AND_ALL_KEYS));

    System.out.println();

    RegistryObject regObject = qualifiers;
    handler.marshal(regObject,parent);
View Full Code Here

    throws RegistryException
  {
    FindPublisher request = (FindPublisher)regObject;
    String generic = request.getGeneric();
    String name = request.getNameString();
    FindQualifiers qualifiers = request.getFindQualifiers();
    int maxRows = request.getMaxRows();

    // make sure we need to continue with this request. If
    // no arguments were passed in then we'll simply return
    // an empty PublisherList (aka "a zero match result set").
    if ((name == null) || (name.length() == 0))
    {
      PublisherList list = new PublisherList();
      list.setGeneric(generic);
      list.setPublisherInfos(new PublisherInfos());
      list.setOperator(Config.getOperator());
      list.setTruncated(false);
      return list;
    }

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

    try
    {
      dataStore.beginTrans();

      // validate the 'name' parameters as much as possible up-front before
      // calling into the data layer for relational validation.
      if (name != null)
      {
        // names can not exceed the maximum character length specified by the
        // UDDI specification (v2.0 specifies a max character length of 255). This
        // value is configurable in jUDDI.
        int maxNameLength = Config.getMaxNameLengthAllowed();
        if (name.length() > maxNameLength)
          throw new NameTooLongException("Name: '"+name+"' (max="+maxNameLength+")");
      }

      // validate the 'qualifiers' parameter as much as possible up-front before
      // calling into the data layer for relational validation.
      if (qualifiers != null)
      {
        Vector qVector = qualifiers.getFindQualifierVector();
        if ((qVector!=null) && (qVector.size() > 0))
        {
          for (int i=0; i<qVector.size(); i++)
          {
            FindQualifier qualifier = (FindQualifier)qVector.elementAt(i);
View Full Code Here

    int maxRows = request.getMaxRows();
    if (maxRows > 0)
      element.setAttribute("maxRows",String.valueOf(maxRows));

    FindQualifiers qualifiers = request.getFindQualifiers();
    if ((qualifiers != null) && (qualifiers.size() > 0))
    {
      handler = maker.lookup(FindQualifiersHandler.TAG_NAME);
      handler.marshal(qualifiers,element);
    }
View Full Code Here

    int maxRows = request.getMaxRows();
    if (maxRows > 0)
      element.setAttribute("maxRows",String.valueOf(maxRows));

    FindQualifiers qualifiers = request.getFindQualifiers();
    if ((qualifiers != null) && (qualifiers.size() > 0))
    {
      handler = maker.lookup(FindQualifiersHandler.TAG_NAME);
      handler.marshal(qualifiers,element);
    }
View Full Code Here

        {
          for (int i=0; i<results.size(); i++)
            System.out.println(i+": "+(String)results.elementAt(i));
        }

        FindQualifiers fqs = new FindQualifiers();
        fqs.sortByNameAsc = true;

        Vector resutls2 = select(name,null,fqs,connection);
        if (results != null)
        {
View Full Code Here

    handler = ( FindQualifiersHandler)maker.lookup( FindQualifiersHandler.TAG_NAME);
  }

  private RegistryObject getRegistryObject()
  {
    FindQualifiers object = new FindQualifiers();
    object.addFindQualifier(new FindQualifier(FindQualifier.SORT_BY_DATE_ASC));
    object.addFindQualifier(new FindQualifier(FindQualifier.AND_ALL_KEYS));

    return object;

  }
View Full Code Here

    int maxRows = request.getMaxRows();
    if (maxRows > 0)
      element.setAttribute("maxRows",String.valueOf(maxRows));

    FindQualifiers qualifiers = request.getFindQualifiers();
    if ((qualifiers != null) && (qualifiers.size() > 0))
    {
      handler = maker.lookup(FindQualifiersHandler.TAG_NAME);
      handler.marshal(qualifiers,element);
    }
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.request.FindQualifiers

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.