Example usage for java.util UUID equals

List of usage examples for java.util UUID equals

Introduction

In this page you can find the example usage for java.util UUID equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Compares this object to the specified object.

Usage

From source file:net.sourceforge.msscodefactory.cfinternet.v2_1.CFInternet.CFInternetSecSessionHPKey.java

public boolean equals(Object obj) {
    if (obj == null) {
        return (false);
    } else if (obj instanceof CFInternetSecSessionHPKey) {
        CFInternetSecSessionHPKey rhs = (CFInternetSecSessionHPKey) obj;
        {/*from  w w  w . jav  a 2  s.  c  o m*/
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFInternetHPKey) {
        CFInternetHPKey rhs = (CFInternetHPKey) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        return (true);
    } else if (obj instanceof CFInternetSecSessionPKey) {
        CFInternetSecSessionPKey rhs = (CFInternetSecSessionPKey) obj;
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFInternetSecSessionHBuff) {
        CFInternetSecSessionHBuff rhs = (CFInternetSecSessionHBuff) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFInternetSecSessionBuff) {
        CFInternetSecSessionBuff rhs = (CFInternetSecSessionBuff) obj;
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else {
        return (false);
    }
}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurity.CFSecuritySecUserHPKey.java

public boolean equals(Object obj) {
    if (obj == null) {
        return (false);
    } else if (obj instanceof CFSecuritySecUserHPKey) {
        CFSecuritySecUserHPKey rhs = (CFSecuritySecUserHPKey) obj;
        {/* w w  w.j a v a  2 s . c o m*/
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecUserId().equals(rhs.getRequiredSecUserId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFSecurityHPKey) {
        CFSecurityHPKey rhs = (CFSecurityHPKey) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        return (true);
    } else if (obj instanceof CFSecuritySecUserPKey) {
        CFSecuritySecUserPKey rhs = (CFSecuritySecUserPKey) obj;
        if (!getRequiredSecUserId().equals(rhs.getRequiredSecUserId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFSecuritySecUserHBuff) {
        CFSecuritySecUserHBuff rhs = (CFSecuritySecUserHBuff) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecUserId().equals(rhs.getRequiredSecUserId())) {
            return (false);
        }
        if (!getRequiredSecUserId().equals(rhs.getRequiredSecUserId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFSecuritySecUserBuff) {
        CFSecuritySecUserBuff rhs = (CFSecuritySecUserBuff) obj;
        if (!getRequiredSecUserId().equals(rhs.getRequiredSecUserId())) {
            return (false);
        }
        return (true);
    } else {
        return (false);
    }
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrm.CFCrmSecSessionHPKey.java

public boolean equals(Object obj) {
    if (obj == null) {
        return (false);
    } else if (obj instanceof CFCrmSecSessionHPKey) {
        CFCrmSecSessionHPKey rhs = (CFCrmSecSessionHPKey) obj;
        {//from   ww  w  . j a v  a  2s .c o  m
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFCrmHPKey) {
        CFCrmHPKey rhs = (CFCrmHPKey) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        return (true);
    } else if (obj instanceof CFCrmSecSessionPKey) {
        CFCrmSecSessionPKey rhs = (CFCrmSecSessionPKey) obj;
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFCrmSecSessionHBuff) {
        CFCrmSecSessionHBuff rhs = (CFCrmSecSessionHBuff) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFCrmSecSessionBuff) {
        CFCrmSecSessionBuff rhs = (CFCrmSecSessionBuff) obj;
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else {
        return (false);
    }
}

From source file:net.sourceforge.msscodefactory.cfsecurity.v2_0.CFSecurity.CFSecuritySecSessionHPKey.java

public boolean equals(Object obj) {
    if (obj == null) {
        return (false);
    } else if (obj instanceof CFSecuritySecSessionHPKey) {
        CFSecuritySecSessionHPKey rhs = (CFSecuritySecSessionHPKey) obj;
        {//from www. j ava 2 s.co  m
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFSecurityHPKey) {
        CFSecurityHPKey rhs = (CFSecurityHPKey) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        return (true);
    } else if (obj instanceof CFSecuritySecSessionPKey) {
        CFSecuritySecSessionPKey rhs = (CFSecuritySecSessionPKey) obj;
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFSecuritySecSessionHBuff) {
        CFSecuritySecSessionHBuff rhs = (CFSecuritySecSessionHBuff) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFSecuritySecSessionBuff) {
        CFSecuritySecSessionBuff rhs = (CFSecuritySecSessionBuff) obj;
        if (!getRequiredSecSessionId().equals(rhs.getRequiredSecSessionId())) {
            return (false);
        }
        return (true);
    } else {
        return (false);
    }
}

From source file:org.gridgain.grid.kernal.managers.deployment.GridDeploymentClassLoader.java

/**
 * Sends resource request to all remote nodes associated with this class loader.
 *
 * @param name Resource name./*  w w w.  j  a va2 s  . com*/
 * @return InputStream for resource or {@code null} if resource could not be found.
 */
@Nullable
private InputStream sendResourceRequest(String name) {
    assert !Thread.holdsLock(mux);

    long endTime = computeEndTime(p2pTimeout);

    Collection<UUID> nodeListCp;
    Map<UUID, GridUuid> nodeLdrMapCp;

    synchronized (mux) {
        // Skip requests for the previously missed classes.
        if (missedRsrcs != null && missedRsrcs.contains(name))
            return null;

        // If single-node mode, then node cannot change and we simply reuse list and map.
        // Otherwise, make copies that can be used outside synchronization.
        nodeListCp = singleNode ? nodeList : new LinkedList<>(nodeList);
        nodeLdrMapCp = singleNode ? nodeLdrMap : new HashMap<>(nodeLdrMap);
    }

    for (UUID nodeId : nodeListCp) {
        if (nodeId.equals(ctx.discovery().localNode().id()))
            // Skip local node as it is already used as parent class loader.
            continue;

        GridUuid ldrId = nodeLdrMapCp.get(nodeId);

        GridNode node = ctx.discovery().node(nodeId);

        if (node == null) {
            if (log.isDebugEnabled())
                log.debug("Found inactive node in class loader (will skip): " + nodeId);

            continue;
        }

        try {
            // Request is sent with timeout that is why we can use synchronization here.
            GridDeploymentResponse res = comm.sendResourceRequest(name, ldrId, node, endTime);

            if (res == null) {
                U.warn(log, "Failed to get resource from node (is node alive?) [nodeId=" + node.id()
                        + ", clsLdrId=" + ldrId + ", resName=" + name + ", parentClsLdr=" + getParent() + ']');
            } else if (!res.success()) {
                synchronized (mux) {
                    // Cache unsuccessfully loaded resource.
                    if (missedRsrcs != null)
                        missedRsrcs.add(name);
                }

                // Some frameworks like Spring often ask for the resources
                // just in case - none will happen if there are no such
                // resources. So we print out INFO level message.
                if (!quiet) {
                    if (log.isInfoEnabled())
                        log.info("Failed to get resource from node [nodeId=" + node.id() + ", clsLdrId=" + ldrId
                                + ", resName=" + name + ", parentClsLdr=" + getParent() + ", msg="
                                + res.errorMessage() + ']');
                } else if (log.isDebugEnabled())
                    log.debug("Failed to get resource from node [nodeId=" + node.id() + ", clsLdrId=" + ldrId
                            + ", resName=" + name + ", parentClsLdr=" + getParent() + ", msg="
                            + res.errorMessage() + ']');

                // Do not ask other nodes in case of shared mode all of them should have the resource.
                return null;
            } else {
                return new ByteArrayInputStream(res.byteSource().internalArray(), 0, res.byteSource().size());
            }
        } catch (GridException e) {
            // This thread should be interrupted again in communication if it
            // got interrupted. So we assume that thread can be interrupted
            // by processing cancellation request.
            if (Thread.currentThread().isInterrupted()) {
                if (!quiet)
                    U.error(log, "Failed to get resource probably due to task/job cancellation: " + name, e);
                else if (log.isDebugEnabled())
                    log.debug("Failed to get resource probably due to task/job cancellation: " + name);
            } else {
                if (!quiet)
                    U.warn(log,
                            "Failed to get resource from node (is node alive?) [nodeId=" + node.id()
                                    + ", clsLdrId=" + ldrId + ", resName=" + name + ", parentClsLdr="
                                    + getParent() + ", err=" + e + ']');
                else if (log.isDebugEnabled())
                    log.debug("Failed to get resource from node (is node alive?) [nodeId=" + node.id()
                            + ", clsLdrId=" + ldrId + ", resName=" + name + ", parentClsLdr=" + getParent()
                            + ", err=" + e + ']');
            }
        }
    }

    return null;
}

From source file:org.apache.ignite.internal.managers.deployment.GridDeploymentClassLoader.java

/**
 * Adds new node and remote class loader id to this class loader.
 * Class loader will ask all associated nodes for the class/resource
 * until find it./*from w  w  w .j  a v  a  2 s  .c  o  m*/
 *
 * @param nodeId Participating node ID.
 * @param ldrId Participating class loader id.
 */
void register(UUID nodeId, IgniteUuid ldrId) {
    assert nodeId != null;
    assert ldrId != null;
    assert nodeId.equals(ldrId.globalId());
    assert !singleNode;

    synchronized (mux) {
        if (missedRsrcs != null)
            missedRsrcs.clear();

        /*
         * We need to put passed in node into the
         * first position in the list.
         */

        // 1. Remove passed in node if any.
        nodeList.remove(nodeId);

        // 2. Add passed in node to the first position.
        nodeList.addFirst(nodeId);

        // 3. Put to map.
        nodeLdrMap.put(nodeId, ldrId);
    }
}

From source file:org.apache.ignite.internal.managers.deployment.GridDeploymentClassLoader.java

/**
 * Sends resource request to all remote nodes associated with this class loader.
 *
 * @param name Resource name.//from  w w w . java 2  s.  co m
 * @return InputStream for resource or {@code null} if resource could not be found.
 */
@Nullable
private InputStream sendResourceRequest(String name) {
    assert !Thread.holdsLock(mux);

    long endTime = computeEndTime(p2pTimeout);

    Collection<UUID> nodeListCp;
    Map<UUID, IgniteUuid> nodeLdrMapCp;

    synchronized (mux) {
        // Skip requests for the previously missed classes.
        if (missedRsrcs != null && missedRsrcs.contains(name))
            return null;

        // If single-node mode, then node cannot change and we simply reuse list and map.
        // Otherwise, make copies that can be used outside synchronization.
        nodeListCp = singleNode ? nodeList : new LinkedList<>(nodeList);
        nodeLdrMapCp = singleNode ? nodeLdrMap : new HashMap<>(nodeLdrMap);
    }

    for (UUID nodeId : nodeListCp) {
        if (nodeId.equals(ctx.discovery().localNode().id()))
            // Skip local node as it is already used as parent class loader.
            continue;

        IgniteUuid ldrId = nodeLdrMapCp.get(nodeId);

        ClusterNode node = ctx.discovery().node(nodeId);

        if (node == null) {
            if (log.isDebugEnabled())
                log.debug("Found inactive node in class loader (will skip): " + nodeId);

            continue;
        }

        try {
            // Request is sent with timeout that is why we can use synchronization here.
            GridDeploymentResponse res = comm.sendResourceRequest(name, ldrId, node, endTime);

            if (res == null) {
                U.warn(log, "Failed to get resource from node (is node alive?) [nodeId=" + node.id()
                        + ", clsLdrId=" + ldrId + ", resName=" + name + ", parentClsLdr=" + getParent() + ']');
            } else if (!res.success()) {
                synchronized (mux) {
                    // Cache unsuccessfully loaded resource.
                    if (missedRsrcs != null)
                        missedRsrcs.add(name);
                }

                // Some frameworks like Spring often ask for the resources
                // just in case - none will happen if there are no such
                // resources. So we print out INFO level message.
                if (!quiet) {
                    if (log.isInfoEnabled())
                        log.info("Failed to get resource from node [nodeId=" + node.id() + ", clsLdrId=" + ldrId
                                + ", resName=" + name + ", parentClsLdr=" + getParent() + ", msg="
                                + res.errorMessage() + ']');
                } else if (log.isDebugEnabled())
                    log.debug("Failed to get resource from node [nodeId=" + node.id() + ", clsLdrId=" + ldrId
                            + ", resName=" + name + ", parentClsLdr=" + getParent() + ", msg="
                            + res.errorMessage() + ']');

                // Do not ask other nodes in case of shared mode all of them should have the resource.
                return null;
            } else {
                return new ByteArrayInputStream(res.byteSource().internalArray(), 0, res.byteSource().size());
            }
        } catch (IgniteCheckedException e) {
            // This thread should be interrupted again in communication if it
            // got interrupted. So we assume that thread can be interrupted
            // by processing cancellation request.
            if (Thread.currentThread().isInterrupted()) {
                if (!quiet)
                    U.error(log, "Failed to get resource probably due to task/job cancellation: " + name, e);
                else if (log.isDebugEnabled())
                    log.debug("Failed to get resource probably due to task/job cancellation: " + name);
            } else {
                if (!quiet)
                    U.warn(log,
                            "Failed to get resource from node (is node alive?) [nodeId=" + node.id()
                                    + ", clsLdrId=" + ldrId + ", resName=" + name + ", parentClsLdr="
                                    + getParent() + ", err=" + e + ']');
                else if (log.isDebugEnabled())
                    log.debug("Failed to get resource from node (is node alive?) [nodeId=" + node.id()
                            + ", clsLdrId=" + ldrId + ", resName=" + name + ", parentClsLdr=" + getParent()
                            + ", err=" + e + ']');
            }
        }
    }

    return null;
}

From source file:org.gridgain.grid.kernal.managers.deployment.GridDeploymentClassLoader.java

/**
 * Sends class-loading request to all nodes associated with this class loader.
 *
 * @param name Class name./*from  www.j  a  va  2s. c o  m*/
 * @param path Class path.
 * @return Class byte source.
 * @throws ClassNotFoundException If class was not found.
 */
private GridByteArrayList sendClassRequest(String name, String path) throws ClassNotFoundException {
    assert !Thread.holdsLock(mux);

    long endTime = computeEndTime(p2pTimeout);

    Collection<UUID> nodeListCp;
    Map<UUID, GridUuid> nodeLdrMapCp;

    synchronized (mux) {
        // Skip requests for the previously missed classes.
        if (missedRsrcs != null && missedRsrcs.contains(path))
            throw new ClassNotFoundException("Failed to peer load class [class=" + name + ", nodeClsLdrIds="
                    + nodeLdrMap + ", parentClsLoader=" + getParent() + ']');

        // If single-node mode, then node cannot change and we simply reuse list and map.
        // Otherwise, make copies that can be used outside synchronization.
        nodeListCp = singleNode ? nodeList : new LinkedList<>(nodeList);
        nodeLdrMapCp = singleNode ? nodeLdrMap : new HashMap<>(nodeLdrMap);
    }

    GridException err = null;

    for (UUID nodeId : nodeListCp) {
        if (nodeId.equals(ctx.discovery().localNode().id()))
            // Skip local node as it is already used as parent class loader.
            continue;

        GridUuid ldrId = nodeLdrMapCp.get(nodeId);

        GridNode node = ctx.discovery().node(nodeId);

        if (node == null) {
            if (log.isDebugEnabled())
                log.debug("Found inactive node in class loader (will skip): " + nodeId);

            continue;
        }

        try {
            GridDeploymentResponse res = comm.sendResourceRequest(path, ldrId, node, endTime);

            if (res == null) {
                String msg = "Failed to send class-loading request to node (is node alive?) [node=" + node.id()
                        + ", clsName=" + name + ", clsPath=" + path + ", clsLdrId=" + ldrId + ", parentClsLdr="
                        + getParent() + ']';

                if (!quiet)
                    U.warn(log, msg);
                else if (log.isDebugEnabled())
                    log.debug(msg);

                err = new GridException(msg);

                continue;
            }

            if (res.success())
                return res.byteSource();

            // In case of shared resources/classes all nodes should have it.
            if (log.isDebugEnabled())
                log.debug("Failed to find class on remote node [class=" + name + ", nodeId=" + node.id()
                        + ", clsLdrId=" + ldrId + ", reason=" + res.errorMessage() + ']');

            synchronized (mux) {
                if (missedRsrcs != null)
                    missedRsrcs.add(path);
            }

            throw new ClassNotFoundException(
                    "Failed to peer load class [class=" + name + ", nodeClsLdrs=" + nodeLdrMapCp
                            + ", parentClsLoader=" + getParent() + ", reason=" + res.errorMessage() + ']');
        } catch (GridException e) {
            // This thread should be interrupted again in communication if it
            // got interrupted. So we assume that thread can be interrupted
            // by processing cancellation request.
            if (Thread.currentThread().isInterrupted()) {
                if (!quiet)
                    U.error(log, "Failed to find class probably due to task/job cancellation: " + name, e);
                else if (log.isDebugEnabled())
                    log.debug("Failed to find class probably due to task/job cancellation [name=" + name
                            + ", err=" + e + ']');
            } else {
                if (!quiet)
                    U.warn(log,
                            "Failed to send class-loading request to node (is node alive?) [node=" + node.id()
                                    + ", clsName=" + name + ", clsPath=" + path + ", clsLdrId=" + ldrId
                                    + ", parentClsLdr=" + getParent() + ", err=" + e + ']');
                else if (log.isDebugEnabled())
                    log.debug("Failed to send class-loading request to node (is node alive?) [node=" + node.id()
                            + ", clsName=" + name + ", clsPath=" + path + ", clsLdrId=" + ldrId
                            + ", parentClsLdr=" + getParent() + ", err=" + e + ']');

                err = e;
            }
        }
    }

    throw new ClassNotFoundException("Failed to peer load class [class=" + name + ", nodeClsLdrs="
            + nodeLdrMapCp + ", parentClsLoader=" + getParent() + ']', err);
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccAccountConfigHPKey.java

public boolean equals(Object obj) {
    if (obj == null) {
        return (false);
    } else if (obj instanceof CFAccAccountConfigHPKey) {
        CFAccAccountConfigHPKey rhs = (CFAccAccountConfigHPKey) obj;
        {/*from  w ww  .j a v a2  s  . co  m*/
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        return (true);
    } else if (obj instanceof CFAccAccountConfigPKey) {
        CFAccAccountConfigPKey rhs = (CFAccAccountConfigPKey) obj;
        if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFAccAccountConfigHBuff) {
        CFAccAccountConfigHBuff rhs = (CFAccAccountConfigHBuff) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
            return (false);
        }
        if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFAccAccountConfigBuff) {
        CFAccAccountConfigBuff rhs = (CFAccAccountConfigBuff) obj;
        if (getRequiredTenantId() != rhs.getRequiredTenantId()) {
            return (false);
        }
        return (true);
    } else {
        return (false);
    }
}

From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.CFAccClusterHPKey.java

public boolean equals(Object obj) {
    if (obj == null) {
        return (false);
    } else if (obj instanceof CFAccClusterHPKey) {
        CFAccClusterHPKey rhs = (CFAccClusterHPKey) obj;
        {// ww w.j a  v a2 s  .  c o m
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (getRequiredId() != rhs.getRequiredId()) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFAccHPKey) {
        CFAccHPKey rhs = (CFAccHPKey) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        return (true);
    } else if (obj instanceof CFAccClusterPKey) {
        CFAccClusterPKey rhs = (CFAccClusterPKey) obj;
        if (getRequiredId() != rhs.getRequiredId()) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFAccClusterHBuff) {
        CFAccClusterHBuff rhs = (CFAccClusterHBuff) obj;
        {
            long lhsClusterId = getAuditClusterId();
            long rhsClusterId = rhs.getAuditClusterId();
            if (lhsClusterId != rhsClusterId) {
                return (false);
            }
        }
        {
            Calendar lhsAuditStamp = getAuditStamp();
            Calendar rhsAuditStamp = rhs.getAuditStamp();
            if (lhsAuditStamp != null) {
                if (rhsAuditStamp != null) {
                    if (!lhsAuditStamp.equals(rhsAuditStamp)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        {
            short lhsActionId = getAuditActionId();
            short rhsActionId = rhs.getAuditActionId();
            if (lhsActionId != rhsActionId) {
                return (false);
            }
        }
        {
            int lhsRevision = getRequiredRevision();
            int rhsRevision = rhs.getRequiredRevision();
            if (lhsRevision != rhsRevision) {
                return (false);
            }
        }
        {
            UUID lhsAuditSessionId = getAuditSessionId();
            UUID rhsAuditSessionId = rhs.getAuditSessionId();
            if (lhsAuditSessionId != null) {
                if (rhsAuditSessionId != null) {
                    if (!lhsAuditSessionId.equals(rhsAuditSessionId)) {
                        return (false);
                    }
                } else {
                    return (false);
                }
            } else {
                return (false);
            }
        }
        if (getRequiredId() != rhs.getRequiredId()) {
            return (false);
        }
        if (getRequiredId() != rhs.getRequiredId()) {
            return (false);
        }
        return (true);
    } else if (obj instanceof CFAccClusterBuff) {
        CFAccClusterBuff rhs = (CFAccClusterBuff) obj;
        if (getRequiredId() != rhs.getRequiredId()) {
            return (false);
        }
        return (true);
    } else {
        return (false);
    }
}