Package org.apache.juddi.datatype.assertion

Examples of org.apache.juddi.datatype.assertion.PublisherAssertion


        "select from PUBLISHER_ASSERTION table:\n\n\t" + selectSQL + "\n");

      resultSet = statement.executeQuery();
      while (resultSet.next())
      {
        PublisherAssertion assertion = new PublisherAssertion();
        assertion.setFromKey(resultSet.getString(1));//("FROM_KEY"));
        assertion.setToKey(resultSet.getString(2));//("TO_KEY"));

        // construct and set the KeyedReference instance
        KeyedReference keyedRef = new KeyedReference();
        keyedRef.setKeyName(resultSet.getString(4));//("KEY_NAME"));
        keyedRef.setKeyValue(resultSet.getString(5));//("KEY_VALUE"));
        keyedRef.setTModelKey(resultSet.getString(3));//("TMODEL_KEY"));
        assertion.setKeyedReference(keyedRef);

        // add the assertionStatusItem
        assertionList.addElement(assertion);
      }
View Full Code Here


  public static PublisherAssertion select(
    PublisherAssertion assertionIn,
    Connection connection)
    throws java.sql.SQLException
  {
    PublisherAssertion assertionOut = null;
    PreparedStatement statement = null;
    ResultSet resultSet = null;

    try
    {
      KeyedReference keyedRefIn = assertionIn.getKeyedReference();

      statement = connection.prepareStatement(selectSQL);
      statement.setString(1, assertionIn.getFromKey());
      statement.setString(2, assertionIn.getToKey());
      statement.setString(3, keyedRefIn.getTModelKey());
      statement.setString(4, keyedRefIn.getKeyName());
      statement.setString(5, keyedRefIn.getKeyValue());

      log.debug(
        "select from PUBLISHER_ASSERTION table:\n\n\t"
          + selectSQL
          + "\n\t FROM_KEY="
          + assertionIn.getFromKey()
          + "\n\t TO_KEY="
          + assertionIn.getToKey()
          + "\n\t TMODEL_KEY="
          + keyedRefIn.getTModelKey()
          + "\n\t KEY_NAME="
          + keyedRefIn.getKeyName()
          + "\n\t KEY_VALUE="
          + keyedRefIn.getKeyValue()
          + "\n");

      resultSet = statement.executeQuery();
      if (resultSet.next())
      {
        KeyedReference keyedRefOut = new KeyedReference();
        keyedRefOut.setKeyName(resultSet.getString(4)); //("KEY_NAME"));
        keyedRefOut.setKeyValue(resultSet.getString(5)); //("KEY_VALUE"));
        keyedRefOut.setTModelKey(resultSet.getString(3)); //("TMODEL_KEY"));

        assertionOut = new PublisherAssertion();
        assertionOut.setFromKey(resultSet.getString(1)); //("FROM_KEY"));
        assertionOut.setToKey(resultSet.getString(2)); //("TO_KEY"));
        assertionOut.setKeyedReference(keyedRefOut);
      }

      return assertionOut;
    }
    catch (java.sql.SQLException sqlex)
View Full Code Here

    Element child = null;

    AuthInfo authInfo = new AuthInfo();
    authInfo.setValue("6f157513-844e-4a95-a856-d257e6ba9726");

    PublisherAssertion assertion = new PublisherAssertion();
    assertion.setFromKey("3379ec11-a509-4668-9fee-19b134d0d09b");
    assertion.setToKey("3379ec11-a509-4668-9fee-19b134d0d09b");
    assertion.setKeyName("paKeyName");
    assertion.setKeyValue("paKeyValue");
    assertion.setTModelKey("uuid:3379ec11-a509-4668-9fee-19b134d0d09b");

    SetPublisherAssertions service = new SetPublisherAssertions();
    service.setAuthInfo(authInfo);
    service.addPublisherAssertion(assertion);
    service.addPublisherAssertion(assertion);
View Full Code Here

    this.maker = maker;
  }

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

    // Child Elements
    nodeList = XMLUtils.getChildElementsByTagName(element,"fromKey");
    if (nodeList.size() > 0)
    {
      String fromKey = XMLUtils.getText((Element)nodeList.elementAt(0));
      obj.setFromKey(fromKey);
    }

    nodeList = XMLUtils.getChildElementsByTagName(element,"toKey");
    if (nodeList.size() > 0)
    {
      String toKey = XMLUtils.getText((Element)nodeList.elementAt(0));
      obj.setToKey(toKey);
    }

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

    return obj;
  }
View Full Code Here

    return obj;
  }

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

    String fromKey = assertion.getFromKey();
    if (fromKey != null)
    {
      Element fkElement = parent.getOwnerDocument().createElement("fromKey");
      fkElement.appendChild(parent.getOwnerDocument().createTextNode(fromKey));
      element.appendChild(fkElement);
    }

    String toKey = assertion.getToKey();
    if (toKey != null)
    {
      Element tkElement = parent.getOwnerDocument().createElement("toKey");
      tkElement.appendChild(parent.getOwnerDocument().createTextNode(toKey));
      element.appendChild(tkElement);
    }

    KeyedReference keyedRef = assertion.getKeyedReference();
    if (keyedRef != null)
    {
      handler = maker.lookup(KeyedReferenceHandler.TAG_NAME);
      handler.marshal(keyedRef,element);
    }
View Full Code Here

    HandlerMaker maker = HandlerMaker.getInstance();
    AbstractHandler handler = maker.lookup(PublisherAssertionHandler.TAG_NAME);
    Element parent = XMLUtils.newRootElement();
    Element child = null;

    PublisherAssertion assertion = new PublisherAssertion();
    assertion.setFromKey("b2f072e7-6013-4385-93b4-9c1c2ece1c8f");
    assertion.setToKey("115be72d-0c04-4b5f-a729-79a522629c19");
    assertion.setKeyedReference(new KeyedReference("uuid:8ff45356-acde-4a4c-86bf-f953611d20c6","catBagKeyName2","catBagKeyValue2"));

    System.out.println();

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

      // validate request parameters & execute
      for (int i=0; i<assertionVector.size(); i++)
      {
        // transform each PublisherAssertion data into a form we can work with easily
        PublisherAssertion assertion = (PublisherAssertion)assertionVector.elementAt(i);

        // make sure we've got a 'fromKey'
        String fromKey = assertion.getFromKey();
        if ((fromKey == null) || (fromKey.length() == 0))
          throw new InvalidKeyPassedException("fromKey="+fromKey);

        // make sure we've got a 'toKey'
        String toKey = assertion.getToKey();
        if ((toKey == null) || (toKey.length() == 0))
          throw new InvalidKeyPassedException("toKey="+toKey);

        // make sure we've got a 'KeyedRefernce'
        KeyedReference keyedRef = assertion.getKeyedReference();
        if (keyedRef == null)
          throw new InvalidKeyPassedException("keyedRef="+keyedRef);

        // make sure the 'KeyedRefernce' contains a 'TModelKey'
        String tModelKey = keyedRef.getTModelKey();
View Full Code Here

      // create a new PublisherAssertion
      String fromKey = b1.getBusinessKey();
      String toKey = b2.getBusinessKey();
      KeyedReference keyedReference = new KeyedReference ("Partner Company","peer-peer");
      keyedReference.setTModelKey(TModel.RELATIONSHIPS_TMODEL_KEY);
      PublisherAssertion assertion = new PublisherAssertion(fromKey,toKey,keyedReference);

      // create a PublisherAssertion Vector
      Vector assertionVector = new Vector();
      assertionVector.addElement(assertion);
View Full Code Here

    Element child = null;

    AuthInfo authInfo = new AuthInfo();
    authInfo.setValue("6f157513-844e-4a95-a856-d257e6ba9726");

    PublisherAssertion assertion = new PublisherAssertion();
    assertion.setFromKey("3379ec11-a509-4668-9fee-19b134d0d09b");
    assertion.setToKey("3379ec11-a509-4668-9fee-19b134d0d09b");
    assertion.setKeyName("paKeyName");
    assertion.setKeyValue("paKeyValue");
    assertion.setTModelKey("uuid:3379ec11-a509-4668-9fee-19b134d0d09b");

    AddPublisherAssertions service = new AddPublisherAssertions();
    service.setAuthInfo(authInfo);
    service.addPublisherAssertion(assertion);
    service.addPublisherAssertion(assertion);
View Full Code Here

      // create a new PublisherAssertion
      String fromKey = b1.getBusinessKey();
      String toKey = b2.getBusinessKey();
      KeyedReference keyedReference = new KeyedReference ("Partner Company","peer-peer");
      keyedReference.setTModelKey(TModel.RELATIONSHIPS_TMODEL_KEY);
      PublisherAssertion assertion = new PublisherAssertion(fromKey,toKey,keyedReference);

      // create a PublisherAssertion Vector
      Vector assertionVector = new Vector();
      assertionVector.addElement(assertion);
View Full Code Here

TOP

Related Classes of org.apache.juddi.datatype.assertion.PublisherAssertion

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.