Package com.openmashupos.socket.client

Examples of com.openmashupos.socket.client.MashupURL


  private Request doSend(String requestData, RequestCallback callback)
  throws RequestException
  {
    Log.debug("doSend(" + requestData + ")");
    this.requestData = requestData;
    MashupURL murl = new MashupURL(url);
    this.path = murl.getPath();
    this.port = murl.getPort();
    this.protocol = murl.getProtocol();

     
    // TODO: check for wrong port number -- none-numeric
    int port = Integer.parseInt(this.port);
   
    final Socket socketHTTPServer = new Socket(murl.getHost(),port);
    if(socketHTTPServer == null)
    {
      Log.debug("RequestBuilder.java: Cannot create socket to http server : " + murl.getHost() + ":" +port);
      throw new RequestException("Cannot create socket to http server : " + murl.getHost() + ":" +port);
    }
    final Request request = new Request(socketHTTPServer, timeoutMillis, callback);
    //final
    socketHTTPServer.setSocketCallback( new SocketCallback()
        {
View Full Code Here


    reverseDNSTable.put(entry.relativeDOMAddress, entry);
  }

  private  void loadParameters()
  {
    MashupURL url = new MashupURL();
   
    // currently parameters is of this format  --> DOMLocationOfMashup;"proxy";containerProxyURL
    // eg.  frame[0];proxy;encode(http://example.com/proxy.html)
    String parameters = url.getPayload();

    //Debug.log(10,"Extracted parameters: "+ parameters);
    Log.debug("Extracted parameters: "+ parameters);
    String[] parametersList = parameters.split(";");
    if(parametersList.length > 1)
    {
      myDOMLocation = parametersList[0];
      if(parametersList.length >= 2)
      {
        if( parametersList[1].equals("proxy"))
        {
          if(parametersList.length>=3)
          {
            containerProxyURL = URL.decodeComponent(parametersList[2]);
            MashupURL containerProxy= new MashupURL(containerProxyURL);
            containerDomain = containerProxy.getHost();
            if(containerDomain != null )
            {
              // it seems we have all we need to communicate with container using proxy
              communicationMethod = commMethodProxy;
            }
View Full Code Here

 
   String getMyProxyURL()
  {
    if(myProxyURL == null)
    {
      MashupURL mashupURL = new MashupURL();
      myProxyURL = mashupURL.getDefaultProxyURL();
    }
    return myProxyURL;
  }
View Full Code Here

 
   String getMyDomain()
  {
    if(myDomain == null )
    {
      MashupURL mashupURL = new MashupURL();
      myDomain = mashupURL.getHost();
    }
    return myDomain;
  }
View Full Code Here

  }
 
  public Mashlet(String url)
  {
    //super(url);
    MashupURL mURL = new MashupURL(url);
   
   
    domain = mURL.getHost();
   
    this.proxyURL = mURL.getDefaultProxyURL();
     
    // Register yourself
   
    frameNumber = availbleFrameNumber++;
    //availbleFrameNumber++; // temp
   
    assert(null != OMOS.instance);
    mURL.addPayload(getDOMLocation()+";proxy;"+OMOS.instance.getMyProxyURL());
       
    OMOS.instance.registerMe(this);

    setUrl(mURL.getURL());
    //Log.debug(dump());
     
  }
View Full Code Here

TOP

Related Classes of com.openmashupos.socket.client.MashupURL

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.