Package org.jgroups

Examples of org.jgroups.PhysicalAddress




    public void sendGetMembersRequest(String cluster_name, Promise promise, boolean return_views_only) throws Exception{
        List<PingData> existing_mbrs=readAll(cluster_name);
        PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
        PingData data=new PingData(local_addr, null, false, UUID.get(local_addr), physical_addrs);

        // If we don't find any files, return immediately
        if(existing_mbrs.isEmpty()) {
View Full Code Here


        fixed_members_seperator = value;
    }

    public boolean authenticate(AuthToken token, Message msg) {
        if ((token != null) && (token instanceof FixedMembershipToken) && (this.memberList != null)) {
            PhysicalAddress src = (PhysicalAddress) auth.down(new Event(Event.GET_PHYSICAL_ADDRESS,
                            msg.getSrc()));
            if (src == null) {
                if (log.isErrorEnabled())
                    log.error("didn't find physical address for " + msg.getSrc());
                return false;
            }

            String sourceAddressWithPort = src.toString();
            String sourceAddressWithoutPort = sourceAddressWithPort.substring(0,
                            sourceAddressWithPort.indexOf(":"));

            if (log.isDebugEnabled()) {
                log.debug("AUTHToken received from " + sourceAddressWithPort);
View Full Code Here



    public void sendGetMembersRequest(String cluster_name, Promise promise, boolean return_views_only) throws Exception{
        List<PingData> existing_mbrs=readAll(cluster_name);
        PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
        PingData data=new PingData(local_addr, null, false, UUID.get(local_addr), physical_addrs);

        // If we don't find any files, return immediately
        if(existing_mbrs.isEmpty()) {
View Full Code Here

        if(evt.getType() == Event.VIEW_CHANGE) {
            suspected_mbrs.clear();

            Set<Address> physical_mbrs=new HashSet<Address>();
            for(Address addr: members) {
                PhysicalAddress physical_addr=getPhysicalAddressFromCache(addr);
                if(physical_addr != null)
                    physical_mbrs.add(physical_addr);
            }
            retainAll(physical_mbrs); // remove all connections from the ConnectionTable which are not members
        }
View Full Code Here

                 local = local_addr;                
             } else {
                 ProtocolAdapter adapter = ProtocolAdapter.thread_local.get();
                 local = adapter.local_addr;
             }
             PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
             List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
             String logical_name=org.jgroups.util.UUID.get(local);
             tunnel_policy.connect(stubs, group, local, logical_name, physical_addrs);
            break;
View Full Code Here

                      if (log.isDebugEnabled()) {
                          log.debug("Reconnecting to router at " + stub.getGossipRouterAddress());
                      }

                      if(!isSingleton()){
                          PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
                          List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
                          stub.connect(channel_name, local_addr, UUID.get(local_addr), physical_addrs);
                          if (log.isDebugEnabled()) {
                              log.debug("Reconnected to router at " + stub.getGossipRouterAddress());
                          }
                      }
                      else {
                          for(Protocol p: up_prots.values()) {
                              if(p instanceof ProtocolAdapter) {
                                  Address local=((ProtocolAdapter)p).local_addr;
                                  String cluster_name=((ProtocolAdapter)p).cluster_name;
                                  PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
                                  List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
                                  stub.connect(cluster_name, local, UUID.get(local), physical_addrs);
                                  if (log.isDebugEnabled()) {
                                      log.debug("Reconnected to router at " + stub.getGossipRouterAddress());
                                  }
View Full Code Here

    }


    protected void connect(String group, Address logical_addr) {
        String logical_name=org.jgroups.util.UUID.get(logical_addr);
        PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        List<PhysicalAddress> physical_addrs=physical_addr != null? new ArrayList<PhysicalAddress>() : null;
        if(physical_addr != null)
            physical_addrs.add(physical_addr);

        int num_faulty_conns=0;
View Full Code Here

    public abstract void retainAll(Collection<Address> members);

    /** ConnectionMap.Receiver interface */
    public void receive(Address sender, byte[] data, int offset, int length) {
        if(skip_suspected_members && !suspected_mbrs.isEmpty() && sender instanceof PhysicalAddress) {
            PhysicalAddress physical_addr=(PhysicalAddress)sender;
            if(suspected_mbrs.remove(physical_addr)) {
                if(log.isTraceEnabled())
                    log.trace("removed " + sender + " from suspected_mbrs as we received traffic from it");
            }
        }
View Full Code Here

        if(evt.getType() == Event.VIEW_CHANGE) {
            suspected_mbrs.clear();

            Set<Address> physical_mbrs=new HashSet<Address>();
            for(Address addr: members) {
                PhysicalAddress physical_addr=getPhysicalAddressFromCache(addr);
                if(physical_addr != null)
                    physical_mbrs.add(physical_addr);
            }
            retainAll(physical_mbrs); // remove all connections from the ConnectionTable which are not members
        }
        else if(evt.getType() == Event.UNSUSPECT) {
            Address suspected_mbr=(Address)evt.getArg();
            PhysicalAddress physical_addr=logical_addr_cache.get(suspected_mbr);
            if(physical_addr != null)
                suspected_mbrs.remove(physical_addr);
        }
        return ret;
    }
View Full Code Here

                 local = local_addr;                
             } else {
                 ProtocolAdapter adapter = ProtocolAdapter.thread_local.get();
                 local = adapter.local_addr;
             }
             PhysicalAddress physical_addr=(PhysicalAddress)down(new Event(Event.GET_PHYSICAL_ADDRESS, local));
             List<PhysicalAddress> physical_addrs=Arrays.asList(physical_addr);
             String logical_name=org.jgroups.util.UUID.get(local);
             tunnel_policy.connect(stubs, group, local, logical_name, physical_addrs);
            break;
View Full Code Here

TOP

Related Classes of org.jgroups.PhysicalAddress

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.