Package com.openmashupos.socket.client

Examples of com.openmashupos.socket.client.ProxyDNSEntry


    {
      // TODO: Needs to be generalized for other communication methods
      // update DNS table to contain an entry for container
      if(true) // if container communication method is proxy
      {
        DNSEntry dnsEntry = new ProxyDNSEntry(containerDomain,"parent" , containerProxyURL );
        addDNSEntry(dnsEntry);
      }
      else
      {
        // other types
      }
    }
   
    // TODO: assume that communication method of container and app are the same ..
    //if(communicationMethod == commMethodProxy)
//    {
      // for now assume that proxy is in this relative location
      String myProxy = GWT.getHostPageBaseURL() + "mashlet_proxy.cache.html" ;
      //createProxyPool(myProxy)  ;
      // TODO: how to find myDOMLocation ????!!!!!
      DNSEntry myDNSEntry = new ProxyDNSEntry(getMyDomain(),myDOMLocation , myProxy );
      //DNSTable.put(getMyDomain(), dnsEntry);
      addDNSEntry(myDNSEntry);
//    }
   
    StartContainerService();
View Full Code Here


              if(DOMLocation.startsWith("parent."))
              {
                DOMLocation = DOMLocation.substring(7);
              }
               // for now, assume it is ProxyDNSEntry
              ProxyDNSEntry dnsEntry = (ProxyDNSEntry) reverseDNSTable.get(DOMLocation);
             
              if(dnsEntry != null)
              {
                s.send(dnsEntry.relativeDOMAddress +";"+dnsEntry.proxyURL );
              }
View Full Code Here

           
            // request: "domain name" response "DOMAddress;proxyURL"
            public void onDataReceived(String domainname)
            {
              // for now, assume it is ProxyDNSEntry
              ProxyDNSEntry dnsEntry = (ProxyDNSEntry) DNSTable.get(domainname);
             
              if(dnsEntry != null)
              {
                s.send(dnsEntry.relativeDOMAddress +";"+dnsEntry.proxyURL );
              }
View Full Code Here

      if(DOMLocation.equals("parent"))
      {
        proxy = containerProxyURL;
      }
      // else cannot find the porxy url ...
      dnsCallback.onResolved(new ProxyDNSEntry(domainName,DOMLocation,proxy));
    }
    else
    {
    DNSEntry dnsEntry =  (DNSEntry) DNSTable.get(domainName);
    if(dnsEntry!=null)
    {
      dnsCallback.onResolved(dnsEntry);
    }
    else // query the parent DNS server(port 1)
    {
      final Socket socketToParentDNSServer = new Socket(".parent",1);
      socketToParentDNSServer.setSocketCallback( new SocketCallback()
      {
        // data = "DOMLocation;proxy"
        public void onDataReceived(String data)
        {
          String[] elems = data.split(";");
          if(elems.length == 2)
          {
            dnsCallback.onResolved(new ProxyDNSEntry(domainName,"parent."+elems[0],elems[1]));
          }
          else
          {
            dnsCallback.onError("Wrong response format (DOMLOcation;proxy):" + data ) ;
          }
View Full Code Here

        {
          String[] elems = data.split(";");
          if(elems.length == 2)
          {
            Debug.log(10, relativeDOMAddress + " is resolved to " + elems[0] );
            dnsCallback.onResolved(new ProxyDNSEntry(elems[0],relativeDOMAddress,elems[1]));
          }
          else
          {
            dnsCallback.onError("Wrong response format (DOMLOcation;proxy):" + data ) ;
          }
View Full Code Here

  // also it updates the DNS
   void registerMe(Mashlet mashlet)
  {
    childMashlets.put(mashlet.getDomain(), mashlet);
   
    DNSEntry entry = new ProxyDNSEntry(mashlet.getDomain(),mashlet.getDOMLocation(),mashlet.getPorxyURL());
    addDNSEntry(entry);
  }
View Full Code Here

TOP

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

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.