Search in sources :

Example 1 with JoinRequest

use of com.hazelcast.internal.cluster.impl.JoinRequest in project hazelcast by hazelcast.

the class JoinRequestOperation method readInternal.

@Override
protected void readInternal(ObjectDataInput in) throws IOException {
    request = new JoinRequest();
    request.readData(in);
}
Also used : JoinRequest(com.hazelcast.internal.cluster.impl.JoinRequest)

Example 2 with JoinRequest

use of com.hazelcast.internal.cluster.impl.JoinRequest in project hazelcast by hazelcast.

the class Node method createJoinRequest.

public JoinRequest createJoinRequest(boolean withCredentials) {
    final Credentials credentials = (withCredentials && securityContext != null) ? securityContext.getCredentialsFactory().newCredentials() : null;
    final Set<String> excludedMemberUuids = nodeExtension.getInternalHotRestartService().getExcludedMemberUuids();
    return new JoinRequest(Packet.VERSION, buildInfo.getBuildNumber(), version, address, localMember.getUuid(), localMember.isLiteMember(), createConfigCheck(), credentials, localMember.getAttributes(), excludedMemberUuids);
}
Also used : JoinRequest(com.hazelcast.internal.cluster.impl.JoinRequest) Credentials(com.hazelcast.security.Credentials)

Example 3 with JoinRequest

use of com.hazelcast.internal.cluster.impl.JoinRequest in project hazelcast by hazelcast.

the class DefaultNodeExtensionTest method test_joinRequestFails_whenOtherMinorVersion.

@Test
public void test_joinRequestFails_whenOtherMinorVersion() throws UnknownHostException {
    MemberVersion otherPatchVersion = MemberVersion.of(node.getVersion().getMajor(), node.getVersion().getMinor() + 1, node.getVersion().getPatch());
    JoinRequest joinRequest = new JoinRequest(Packet.VERSION, BUILD_INFO.getBuildNumber(), otherPatchVersion, new Address("127.0.0.1", 9999), UuidUtil.newUnsecureUuidString(), false, null, null, null, null);
    expected.expect(VersionMismatchException.class);
    nodeExtension.validateJoinRequest(joinRequest);
}
Also used : Address(com.hazelcast.nio.Address) JoinRequest(com.hazelcast.internal.cluster.impl.JoinRequest) MemberVersion(com.hazelcast.version.MemberVersion) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 4 with JoinRequest

use of com.hazelcast.internal.cluster.impl.JoinRequest in project hazelcast by hazelcast.

the class DefaultNodeExtensionTest method test_joinRequestAllowed_whenOtherPatchVersion.

@Test
public void test_joinRequestAllowed_whenOtherPatchVersion() throws UnknownHostException {
    MemberVersion otherPatchVersion = MemberVersion.of(node.getVersion().getMajor(), node.getVersion().getMinor(), node.getVersion().getPatch() + 1);
    JoinRequest joinRequest = new JoinRequest(Packet.VERSION, BUILD_INFO.getBuildNumber(), otherPatchVersion, new Address("127.0.0.1", 9999), UuidUtil.newUnsecureUuidString(), false, null, null, null, null);
    nodeExtension.validateJoinRequest(joinRequest);
}
Also used : Address(com.hazelcast.nio.Address) JoinRequest(com.hazelcast.internal.cluster.impl.JoinRequest) MemberVersion(com.hazelcast.version.MemberVersion) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Example 5 with JoinRequest

use of com.hazelcast.internal.cluster.impl.JoinRequest in project hazelcast by hazelcast.

the class DefaultNodeExtensionTest method test_joinRequestAllowed_whenSameVersion.

@Test
public void test_joinRequestAllowed_whenSameVersion() throws UnknownHostException {
    JoinRequest joinRequest = new JoinRequest(Packet.VERSION, BUILD_INFO.getBuildNumber(), node.getVersion(), new Address("127.0.0.1", 9999), UuidUtil.newUnsecureUuidString(), false, null, null, null, null);
    nodeExtension.validateJoinRequest(joinRequest);
}
Also used : Address(com.hazelcast.nio.Address) JoinRequest(com.hazelcast.internal.cluster.impl.JoinRequest) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

JoinRequest (com.hazelcast.internal.cluster.impl.JoinRequest)6 Address (com.hazelcast.nio.Address)4 ParallelTest (com.hazelcast.test.annotation.ParallelTest)4 QuickTest (com.hazelcast.test.annotation.QuickTest)4 Test (org.junit.Test)4 MemberVersion (com.hazelcast.version.MemberVersion)3 Credentials (com.hazelcast.security.Credentials)1