Package org.jgroups

Examples of org.jgroups.PhysicalAddress


    public boolean authenticate(AuthToken token, Message msg) {
        Address sender=msg.getSrc();


        if(match_ip_address) {
            PhysicalAddress src=sender != null? (PhysicalAddress)auth.down(new Event(Event.GET_PHYSICAL_ADDRESS, sender)) : null;
            String ip_addr=src != null? src.toString() : null;
            if(ip_addr != null) {
                Matcher matcher=pattern.matcher(ip_addr);
                boolean result=matcher.matches();
                if(log.isTraceEnabled())
                    log.trace("matching ip_address: pattern= " + pattern + ", input= " + ip_addr + ", result= " + result);
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 boolean authenticate(AuthToken token, Message msg) {
        Address sender=msg.getSrc();


        if(match_ip_address) {
            PhysicalAddress src=sender != null? (PhysicalAddress)auth.down(new Event(Event.GET_PHYSICAL_ADDRESS, sender)) : null;
            String ip_addr=src != null? src.toString() : null;
            if(ip_addr != null) {
                Matcher matcher=pattern.matcher(ip_addr);
                boolean result=matcher.matches();
                if(log.isTraceEnabled())
                    log.trace("matching ip_address: pattern= " + pattern + ", input= " + ip_addr + ", result= " + result);
View Full Code Here

            final Runnable reconnector = new Runnable() {
                public void run() {
                    try {
                        if (log.isTraceEnabled()) log.trace("Reconnecting " + stub);                       
                        String logical_name = org.jgroups.util.UUID.get(logicalAddress);
                        PhysicalAddress physical_addr = (PhysicalAddress) owner.down(new Event(
                                        Event.GET_PHYSICAL_ADDRESS, logicalAddress));
                        List<PhysicalAddress> physical_addrs = Arrays.asList(physical_addr);
                        stub.connect(channelName, logicalAddress, logical_name, physical_addrs);
                        if (log.isTraceEnabled()) log.trace("Reconnected " + stub);                       
                    } catch (Throwable ex) {
View Full Code Here

             stubManager = new TUNNELStubManager(this,group,local,getReconnectInterval());
             for (InetSocketAddress gr : gossip_router_hosts) {
                 RouterStub stub = stubManager.createAndRegisterStub(gr.getHostName(), gr.getPort(), bind_addr);
                 stub.setTcpNoDelay(tcp_nodelay);          
             
             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);
             List<RouterStub> stubs = stubManager.getStubs();
             tunnel_policy.connect(stubs, group, local, logical_name, physical_addrs);
            break;
View Full Code Here

            return;
        }
        if (log.isTraceEnabled())
            log.trace("consolidated mbrs from GossipRouter(s) are " + initial_mbrs);

        PhysicalAddress physical_addr=(PhysicalAddress)down_prot.down(new Event(Event.GET_PHYSICAL_ADDRESS, local_addr));
        PingData data=new PingData(local_addr, null, false, UUID.get(local_addr), Arrays.asList(physical_addr));

        for (Address mbr_addr : initial_mbrs) {
            Message msg = new Message(mbr_addr);
            msg.setFlag(Message.OOB);
View Full Code Here

    }


    protected void connectAllStubs(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);

     
View Full Code Here

        }    
    }
   
    protected void connect(RouterStub stub, 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);

        try {
View Full Code Here

    protected Object handleDownEvent(Event evt) {
        Object ret=super.handleDownEvent(evt);
        if(evt.getType() == Event.VIEW_CHANGE) {
            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 which are not members
        }
View Full Code Here

        return true;
    }

    public void sendGetMembersRequest(String cluster_name, Promise promise, boolean return_views_only) throws Exception{
        //  Mcast GET_MBRS_REQ message
        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);
        PingHeader hdr=new PingHeader(PingHeader.GET_MBRS_REQ, data, cluster_name);
        hdr.return_view_only=return_views_only;
        Message msg=new Message(null)// mcast msg
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.