Package org.apache.ws.muws.interop.client

Examples of org.apache.ws.muws.interop.client.ResourceStub


  /**
   * @throws FaultException
   *
   */
  private void requestNotificationFromEpr() throws FaultException {
    ResourceStub resource = new ResourceStub( wsEpr );
    resource.addObserver(observer);
    resource.subscribe(listenerURL,STATUS_TOPIC_QNAME);
    resource.deleteObserver(observer);
  }
View Full Code Here


   * @throws FaultException
   *
   */
  private void getNameFromEpr() {
   
    ResourceStub stub = new ResourceStub(wsEpr);
    stub.addObserver(observer);   
    XmlObject[] wsNameArry;
    try {
      wsNameArry = stub.getResourceProperty(weatherStationNameQname);
    } catch (FaultException e) {
      this.name="Unknown";
      return;
    }
   catch (RuntimeException e) {
    this.name="Unknown";
    return;
  } finally {
    stub.deleteObserver(observer);
  }
    XmlStringImpl wsName = (XmlStringImpl)wsNameArry[0];
    this.name=wsName.getStringValue();
    System.out.println();
  }
View Full Code Here

  public void setTemperature(double temp) {
    this.temp=temp;
  }
 
  public String queryStatus(){
    ResourceStub stub = new ResourceStub(wsEpr);
    stub.addObserver(observer);   
    XmlObject[] wsNameArry;
    try {
      wsNameArry = stub.getResourceProperty(STATUS_QNAME);
    } catch (FaultException e) {
      return "Unknown";
    } catch (RuntimeException e) {
      return "Unknown";
    } finally {
      stub.deleteObserver(observer);
    }
    if(wsNameArry.length==0)
      return "Unknown";
    OperationalStatusDocumentImpl.OperationalStatusImpl wsName = (OperationalStatusDocumentImpl.OperationalStatusImpl)wsNameArry[0];
    return wsName.getStringValue();
View Full Code Here

    return wsName.getStringValue();
  }
 

  public String queryPrice(){
    ResourceStub stub = new ResourceStub(wsEpr);
    stub.addObserver(observer);   
    XmlObject[] wsNameArry;
    try {
      wsNameArry = stub.getResourceProperty(PRICE_QNAME);
      XmlObject x=wsNameArry[0];
      String value=x.newCursor().getTextValue();
      if(wsNameArry.length==0)
        return "-1";
      return value;

    } catch (FaultException e) {
      return "-1";
    } catch (RuntimeException e) {
      return "-1";
    } finally {
      stub.deleteObserver(observer);
    }
  }
View Full Code Here

        WeatherStationReferenceDocument weatherDoc = WeatherStationReferenceDocument.Factory.newInstance();
        weatherDoc.setWeatherStationReference((EndpointReferenceType) newEpr);
        XmlBeanUtils.addChildElement(updateType,weatherDoc);
        setResourceProperties.setUpdateArray(new UpdateType[]{updateType});
        ResourceStub stub = new ResourceStub(referenceToWcConfigEpr);
        stub.sendRequest(setResourcePropertiesDocument,"http://foo","X");
  }
View Full Code Here

   */
  protected void setUp() throws Exception {
    super.setUp();
        //m_service = new ServiceStub( new URL( ADM_URL ) );
       
        m_resource = new ResourceStub( getEpr(URL, Rid) );
        m_listener=new PortListen(8000,600000);
  }
View Full Code Here

   */
  public DisplayAppConnection(Observer obs,EndpointReference epr) throws XmlException {
    super();
   
    m_eprConfig = epr;
    m_ResourceConfig = new ResourceStub(m_eprConfig);
    m_ResourceConfig.addObserver(obs);
    m_messageObserver=obs;
  }
View Full Code Here

    EndpointReferenceTypeImpl refreshDoc = (EndpointReferenceTypeImpl)refreshDocArry[0];
   
    if(m_ws!=null){
      m_ws.deleteObserver(m_messageObserver);     
    }
    m_ws = new ResourceStub(new XmlBeansEndpointReference(refreshDoc));
    m_ws.addObserver(m_messageObserver);
   
  }
View Full Code Here

   * @throws IOException
   *
   */
  private void getModelFromRelationship() throws FaultException, XmlException, IOException {
      // Query Relationships and build model
      m_resource = new ResourceStub( locationJPanel.getEpr("weather-station-dir-epr.xml") );
      m_resource.addObserver(messagesJPanel1);
      XmlObject[] relationArry = m_resource.getResourceProperty(RELATIONSHIP_QNAME);
      model = new Vector();
      IWc wc=new WcImpl(0,"Wc",null);
      model.add(wc);
View Full Code Here

          for (Iterator iter = model.iterator(); iter.hasNext();) {
        WsImpl station = (WsImpl) iter.next();
        if(station.getName().equals(stationName)){
              //ServiceStub sstub;
           
                ResourceStub sstub = new ResourceStub(station.getEpr());
            sstub.addObserver(messagesJPanel1);           
                RecalibrateDocument recalibrateDocument = RecalibrateDocument.Factory.newInstance();
                recalibrateDocument.addNewRecalibrate();
                sstub.sendRequest(recalibrateDocument,
                                  "http://recalibrate","M");

           
            sstub.deleteObserver(messagesJPanel1);           

        }
      }
  }
View Full Code Here

TOP

Related Classes of org.apache.ws.muws.interop.client.ResourceStub

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.