Package org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2

Examples of org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.PostConditionDocument


    */
   public void removeRelationship( org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipDocument requestDoc )
   throws Exception
   {
      // get participants of relationship to be removed
      RelationshipType relationshipRemove = requestDoc.getRemoveRelationship(  ).getRelationship(  );

      // get the relationship property from properties set
      // then walk all relationships and compare them with the relationship which needs to be removed.
      // when the match exist the relationship will be removed from the relationship properties list
      // this will genarate realtionshipremoved notification
      org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet(  );
      org.apache.ws.resource.properties.ResourceProperty    resourceProperty = null;
      resourceProperty = resourcePropertySet.get( ApplicationPropertyQNames.RELATIONSHIP );

      if ( resourceProperty.isEmpty(  ) )
      {
         return;
      }

      for ( int i = 0; i < resourceProperty.size(  ); i++ )
      {
         Object relationObj = resourceProperty.get( i );
         if ( relationObj instanceof RelationshipType )
         {
            RelationshipType relationship = (RelationshipType) relationObj;
            if ( ExampleUtils.CompareRelationships( relationshipRemove, relationship ) )
            {
               resourceProperty.remove( relationObj );

               //continue to walk - you can have more then one this same relationship
View Full Code Here


         getResourcePropertySet(  );
      org.apache.ws.resource.properties.ResourceProperty    resourceProperty = null;
      resourceProperty = resourcePropertySet.get( ApplicationPropertyQNames.RELATIONSHIP );
      org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship =
         org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance(  );
      RelationshipType                                                          relationshipType =
         prop_relationship.addNewRelationship(  );
      relationshipType.setType( requestDoc.getSetRelationship(  ).getType(  ) );

      RelationshipParticipantType[] partTo              =
         requestDoc.getSetRelationship(  ).getRelationshipTo(  ).getParticipantArray(  );
      int                           numOfToParticipants = partTo.length;
      if ( numOfToParticipants > 0 )
      {
         //There is the from participant - will be in the first position in the array,
         // there needs to be at least one participant to, can be more.
         RelationshipParticipantType[] participants = new RelationshipParticipantType[numOfToParticipants + 1];
         participants[0] = requestDoc.getSetRelationship(  ).getRelationshipFrom(  ).getParticipant(  );
         for ( int i = 0; i < numOfToParticipants; i++ )
         {
            participants[i + 1] = partTo[i];
         }

         relationshipType.setParticipantArray( participants );
         resourceProperty.add( prop_relationship );
      }
      else
      {
         throw new Exception( "Missing Relationship Participant" );
View Full Code Here

            org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance(  );
         RelationshipDocument                                                      relationshipDocument =
            RelationshipDocument.Factory.newInstance(  );

         //add new type
         RelationshipType     relationshipType     = relationshipDocument.addNewRelationship(  );
         RelationshipTypeType relationshipTypeType = relationshipType.addNewType(  );
         XmlObject            relationType         =
            XmlObject.Factory.parse( "<" + ExampleConstants.RELATIONSHIP_RELATION.getPrefix(  ) + ":"
                                     + ExampleConstants.RELATIONSHIP_RELATION.getLocalPart(  ) + " xmlns:"
                                     + ExampleConstants.RELATIONSHIP_RELATION.getPrefix(  ) + "=" + "\""
                                     + ExampleConstants.RELATIONSHIP_RELATION.getNamespaceURI(  ) + "\" />" );
View Full Code Here

    */
   public void removeRelationship( org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipDocument requestDoc )
   throws Exception
   {
      // get participants of relationship to be removed
      RelationshipType relationshipRemove = requestDoc.getRemoveRelationship(  ).getRelationship(  );

      // get the relationship property from properties set
      // then walk all relationships and compare them with the relationship which needs to be removed.
      // when the match exist the relationship will be removed from the relationship properties list
      // this will genarate realtionshipremoved notification
      org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet(  );
      org.apache.ws.resource.properties.ResourceProperty    resourceProperty = null;
      resourceProperty = resourcePropertySet.get( ApplicationPropertyQNames.RELATIONSHIP );

      if ( resourceProperty.isEmpty(  ) )
      {
         return;
      }

      for ( int i = 0; i < resourceProperty.size(  ); i++ )
      {
         Object relationObj = resourceProperty.get( i );
         if ( relationObj instanceof RelationshipType )
         {
            RelationshipType relationship = (RelationshipType) relationObj;
            if ( ExampleUtils.CompareRelationships( relationshipRemove, relationship ) )
            {
               resourceProperty.remove( relationObj );

               //continue to walk - you can have more then one this same relationship
View Full Code Here

    // this is to satisfy the init
    resourceProperty = resourcePropertySet.get(IntegrationserverPropertyQNames.RELATIONSHIP);
    org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship = org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance();
    RelationshipDocument relationshipDocument = RelationshipDocument.Factory.newInstance();
        //add new type
        RelationshipType relationshipType = relationshipDocument.addNewRelationship();
        RelationshipTypeType relationshipTypeType = relationshipType.addNewType();
        XmlObject relationType = XmlObject.Factory.parse("<"+ExampleConstants.RELATIONSHIP_RELATION.getPrefix()+":"+ExampleConstants.RELATIONSHIP_RELATION.getLocalPart()+" xmlns:"+ExampleConstants.RELATIONSHIP_RELATION.getPrefix()+"=" + "\"" + ExampleConstants.RELATIONSHIP_RELATION.getNamespaceURI() + "\" />");
        XmlBeanUtils.addChildElement(relationshipTypeType, relationType);
       prop_relationship.setRelationship(relationshipType);
    resourceProperty.add(prop_relationship);
View Full Code Here

    {
      org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet();
    org.apache.ws.resource.properties.ResourceProperty resourceProperty = null;
    resourceProperty = resourcePropertySet.get(IntegrationserverPropertyQNames.RELATIONSHIP);
    org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship = org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance();
    RelationshipType relationshipType = prop_relationship.addNewRelationship();
    relationshipType.setType(requestDoc.getSetRelationship().getType());

    RelationshipParticipantType [] partTo = requestDoc.getSetRelationship().getRelationshipTo().getParticipantArray();
    int numOfToParticipants = partTo.length;
    if(numOfToParticipants > 0)
    {
      //There is the from participant - will be in the first position in the array,
      // there needs to be at least one participant to, can be more.
      RelationshipParticipantType [] participants = new RelationshipParticipantType[numOfToParticipants + 1];
      participants[0] = requestDoc.getSetRelationship().getRelationshipFrom().getParticipant();
      for( int i=0; i<numOfToParticipants; i++)
        participants[i+1 ] = partTo[i];
        relationshipType.setParticipantArray( participants);
      resourceProperty.add(prop_relationship);
    }
    else
      throw new Exception ("Missing Relationship Participant");
View Full Code Here

    }
   
    public void removeRelationship(org.apache.ws.muse.example.resourceadmin.properties.RemoveRelationshipDocument requestDoc )throws Exception
    {
      // get participants of relationship to be removed
      RelationshipType relationshipRemove = requestDoc.getRemoveRelationship().getRelationship();
     
    // get the relationship property from properties set
    // then walk all relationships and compare them with the relationship which needs to be removed.
    // when the match exist the relationship will be removed from the relationship properties list
    // this will genarate realtionshipremoved notification
      org.apache.ws.resource.properties.ResourcePropertySet resourcePropertySet = getResourcePropertySet();
    org.apache.ws.resource.properties.ResourceProperty resourceProperty = null;
    resourceProperty = resourcePropertySet.get(IntegrationserverPropertyQNames.RELATIONSHIP);
   
       
    if (resourceProperty.isEmpty())
      return;
    for ( int i=0; i < resourceProperty.size(); i++)
    {
      Object relationObj = resourceProperty.get(i);
      if ( relationObj instanceof RelationshipType)
      {
        RelationshipType relationship = (RelationshipType)relationObj;
        if( ExampleUtils.CompareRelationships(relationshipRemove, relationship ))
        {
          resourceProperty.remove(relationObj);
          //continue to walk - you can have more then one this same relationship
          //the notification will be sent to wsdm:RelationshipsCapability/RelationshipDeleted topic
View Full Code Here

        assertTrue( "muws-p2-xs:Relationship property does not contain any elements", relationshipPropElems.length >= 1 );
        for ( int i = 0; i < relationshipPropElems.length; i++ )
        {
            XmlObject relationshipPropElem = relationshipPropElems[i];
            assertTrue( relationshipPropElem instanceof RelationshipType );
            RelationshipType relationship = (RelationshipType)relationshipPropElem;
            assertTrue( "muws-p2-xs:Relationship element is not valid", relationship.validate() );
            RelationshipParticipantType[] participantArray = relationship.getParticipantArray();
            for (int j = 0; j < participantArray.length; j++)
            {
                RelationshipParticipantType relationshipParticipantType = participantArray[j];
                EndpointReferenceType[] manageabilityEndpointReferenceArray = relationshipParticipantType.getManageabilityEndpointReferenceArray();
                for (int k = 0; k < manageabilityEndpointReferenceArray.length; k++)
View Full Code Here

            resourceProperty.addChangeListener(relationshipCapability);//add for management events

            RelationshipDocument relationshipDocument = RelationshipDocument.Factory.newInstance();

            //add new type
            RelationshipType relationshipType = null;
            try
            {
                relationshipType = relationshipDocument.addNewRelationship();
                RelationshipTypeType relationshipTypeType = relationshipType.addNewType();
                XmlObject relationType = XmlObject.Factory.parse("<" + RELATIONSHIP_RELATION.getPrefix() + ":" + RELATIONSHIP_RELATION.getLocalPart() + " xmlns:" + RELATIONSHIP_RELATION.getPrefix() + "=" + "\"" + RELATIONSHIP_RELATION.getNamespaceURI() + "\" />");
                XmlBeanUtils.addChildElement(relationshipTypeType, relationType);
            }
            catch (XmlException e)
            {
                e.printStackTrace();
            }

            QName qName = QName.valueOf("{" + WeatherstationPropertyQNames.FCCID.getNamespaceURI() + "}ResourceID");
            //add a participant
            RelationshipParticipantType relationshipParticipantType = relationshipType.addNewParticipant();
            relationshipParticipantType.setResourceId("urn:" + InteropConstants.WEATHERSTATION_KEY1);
            relationshipParticipantType.setRole("urn://parent");//uri
            EndpointReferenceType manageabilityEndpointReferenceType = relationshipParticipantType.addNewManageabilityEndpointReference();
            manageabilityEndpointReferenceType.addNewAddress().setStringValue(InteropConstants.SERVICES_URL + "/" + InteropConstants.WEATHERSTATION_SERVICE_NAME);
            ReferencePropertiesType referencePropertiesType = manageabilityEndpointReferenceType.addNewReferenceProperties();
            XmlObject key1 = XmlBeanUtils.addChildElement(referencePropertiesType, qName);
            XmlBeanUtils.setValue(key1, InteropConstants.WEATHERSTATION_KEY1);

            RelationshipParticipantType relationshipParticipantType2 = relationshipType.addNewParticipant();
            relationshipParticipantType2.setResourceId("urn:" + InteropConstants.WEATHERSTATION_KEY2);//spec optional
            relationshipParticipantType2.setRole("urn://child1");//uri
            EndpointReferenceType manageabilityEndpointReferenceType2 = relationshipParticipantType.addNewManageabilityEndpointReference();
            manageabilityEndpointReferenceType2.addNewAddress().setStringValue(InteropConstants.SERVICES_URL + "/" + InteropConstants.WEATHERSTATION_SERVICE_NAME);
            ReferencePropertiesType referencePropertiesType2 = manageabilityEndpointReferenceType2.addNewReferenceProperties();
View Full Code Here

         getResourcePropertySet(  );
      org.apache.ws.resource.properties.ResourceProperty    resourceProperty = null;
      resourceProperty = resourcePropertySet.get( BusinessprocesstypePropertyQNames.RELATIONSHIP );
      org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument prop_relationship =
         org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.RelationshipDocument.Factory.newInstance(  );
      RelationshipType                                                          relationshipType =
         prop_relationship.addNewRelationship(  );
      relationshipType.setType( requestDoc.getSetRelationship(  ).getType(  ) );

      RelationshipParticipantType[] partTo              =
         requestDoc.getSetRelationship(  ).getRelationshipTo(  ).getParticipantArray(  );
      int                           numOfToParticipants = partTo.length;
      if ( numOfToParticipants > 0 )
      {
         //There is the from participant - will be in the first position in the array,
         // there needs to be at least one participant to, can be more.
         RelationshipParticipantType[] participants = new RelationshipParticipantType[numOfToParticipants + 1];
         participants[0] = requestDoc.getSetRelationship(  ).getRelationshipFrom(  ).getParticipant(  );
         for ( int i = 0; i < numOfToParticipants; i++ )
         {
            participants[i + 1] = partTo[i];
         }

         relationshipType.setParticipantArray( participants );
         resourceProperty.add( prop_relationship );
      }
      else
      {
         throw new Exception( "Missing Relationship Participant" );
View Full Code Here

TOP

Related Classes of org.oasisOpen.docs.wsdm.x2004.x12.muws.wsdmMuwsPart2.PostConditionDocument

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.