Package org.apache.wsdm.interop.wcm.impl

Examples of org.apache.wsdm.interop.wcm.impl.WsImpl


      RelationshipTypeImpl relationshipSample = (RelationshipTypeImpl) relationArry[0];
     
      for (int i = 0; i < relationArry.length; i++) {
        RelationshipTypeImpl relationship = (RelationshipTypeImpl) relationArry[i];
        IWs ws1=new WsImpl(relationship,notificationListenerUrl,messagesJPanel1);
        model.add(ws1);
      }
     
      // Capture the name of the defaultActive WS
      for (Iterator siWter = model.iterator(); siWter.hasNext();) {
View Full Code Here


   * @param optStatus
   */
  private void updateStatusOfWs(EndpointReferenceType epr, String optStatus) {
    String epr1=epr.getAddress().getStringValue();
    for (Iterator iter = model.iterator(); iter.hasNext();) {
      WsImpl ws = (WsImpl) iter.next();
      if(!(ws instanceof IWc)){
        EndpointReference eprTest = ws.getEpr();
       
        if(epr.getAddress().getStringValue().endsWith("anonymous")){
          if(eprTest.getAddress().endsWith("WeatherStationSOAP")){
            Color color=colorFromStatus(optStatus);
            statusJPanel.setColor(ws.getName(),color);
          }         
        }
        else {
          if(eprTest.getAddress().equals(epr.getAddress().getStringValue())){
            Color color=colorFromStatus(optStatus);
            statusJPanel.setColor(ws.getName(),color);
          }
        }
        repairIfNeeded(ws.getName(),optStatus);
      }
    }
  }
View Full Code Here

   * @see org.apache.interop.wcmgr.CommandListener#recalibrate(java.lang.String)
   */
  public void recalibrate(String stationName) {
    System.out.println("I will recalibrate "+stationName);
          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");
View Full Code Here

    mp = new StatusJPanel();
    frame.getContentPane().add(mp);
    frame.pack();
    frame.show();

    IWs ws1=new WsImpl(0,"Ws1",null);
    IWs ws2=new WsImpl(0,"Ws2",ws1);
    IWs ws3=new WsImpl(0,"Ws3",ws2);
    //ws1.setBackup(ws3);
    IWc wc=new WcImpl(0,"Wc",ws1);
    mp.setModel(new IWs[]{wc,ws1,ws2,ws3});   

   
View Full Code Here

   *
   */
  protected void resolveWsProblem() {
    Object[] allStations = statusJPanel.getRoots();
    double lowestPrice=1000f;
    WsImpl wsChoice=null;
    System.out.println("Deciding How to resolve a WS problem");
    for (int index = 0; index < allStations.length; index++) {
      Object object = allStations[index];
      if(object instanceof WsGraphCell){
        WsGraphCell wsCell=(WsGraphCell)object;
        String name=wsCell.toString();
        WsImpl ws=(WsImpl)findInModel(name);
        String status=ws.queryStatus();
        String strPrice=ws.queryPrice();
        float fprice=Float.parseFloat(strPrice);
        String strEpr=ws.getEpr().toString();
        System.out.println("Station:"+name+" status:"+status+" price:"+strPrice);
        if(status.equals("Available")){
          if(fprice<lowestPrice){
            lowestPrice=fprice;
            wsChoice=ws;
View Full Code Here

  public static IWc createWC(int status, String name, IWs active){
    return new WcImpl(status,  name,  active);
  }
 
  public static IWs createWS(int status, String name, IWs backup){
    return new WsImpl(status, name, backup);
 
View Full Code Here

TOP

Related Classes of org.apache.wsdm.interop.wcm.impl.WsImpl

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.