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();
XmlObject key2 = XmlBeanUtils.addChildElement(referencePropertiesType2, qName);
XmlBeanUtils.setValue(key2, InteropConstants.WEATHERSTATION_KEY2);
resourceProperty.add(relationshipDocument);
/*----------------- MOWS OperationalState props -----------------*/
resourceProperty = resourcePropertySet.get(WeatherstationPropertyQNames.CURRENTOPERATIONALSTATE);
CurrentOperationalStateDocument currentOperationalStateDocument = CurrentOperationalStateDocument.Factory.newInstance();
currentOperationalStateDocument.addNewCurrentOperationalState();
resourceProperty.add(currentOperationalStateDocument);
resourceProperty = resourcePropertySet.get(WeatherstationPropertyQNames.LASTOPERATIONALSTATETRANSITION);
LastOperationalStateTransitionDocument lastOperationalStateTransitionDocument = LastOperationalStateTransitionDocument.Factory.newInstance();
StateTransitionType stateTransitionType = lastOperationalStateTransitionDocument.addNewLastOperationalStateTransition();
stateTransitionType.addNewEnteredState();
stateTransitionType.addNewPreviousState();
stateTransitionType.setTime(Calendar.getInstance());
stateTransitionType.setTransitionIdentifier("");
resourceProperty.add(lastOperationalStateTransitionDocument);
/*----------------- MOWS EndpointIdentification props -----------------*/
resourceProperty = resourcePropertySet.get(WeatherstationPropertyQNames.ENDPOINTREFERENCE);
EndpointReferenceDocument endpointReferenceDocument = EndpointReferenceDocument.Factory.newInstance();
EndpointReferenceType endpointReferenceType = endpointReferenceDocument.addNewEndpointReference();//temporary
AttributedURI attributedURI = endpointReferenceType.addNewAddress();
attributedURI.setStringValue(InteropConstants.SERVICES_URL + "/" + InteropConstants.BLACKBERRY_SERVICE_NAME);
resourceProperty.add(endpointReferenceDocument);
resourceProperty.addChangeListener(mowsIdentificationCapability);
resourceProperty = resourcePropertySet.get(WeatherstationPropertyQNames.ENDPOINTDESCRIPTIONS);