Search in sources :

Example 36 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class RepairingTaskTest method newRepairingTask.

private RepairingTask newRepairingTask(Config config) {
    MetaDataFetcher metaDataFetcher = mock(MetaDataFetcher.class);
    ExecutionService executionService = mock(ExecutionService.class);
    MinimalPartitionService minimalPartitionService = mock(MinimalPartitionService.class);
    String uuid = UuidUtil.newUnsecureUUID().toString();
    ILogger logger = Logger.getLogger(RepairingTask.class);
    HazelcastProperties hazelcastProperties = new HazelcastProperties(config);
    return new RepairingTask(metaDataFetcher, executionService.getGlobalTaskScheduler(), minimalPartitionService, hazelcastProperties, uuid, logger);
}
Also used : HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) ILogger(com.hazelcast.logging.ILogger) ExecutionService(com.hazelcast.spi.ExecutionService)

Example 37 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class AsyncInboundResponseHandlerTest method setup.

@Before
public void setup() {
    ILogger logger = Logger.getLogger(getClass());
    HazelcastThreadGroup threadGroup = new HazelcastThreadGroup("test", logger, getClass().getClassLoader());
    responsePacketHandler = mock(PacketHandler.class);
    asyncHandler = new AsyncInboundResponseHandler(threadGroup, logger, responsePacketHandler, new HazelcastProperties(new Config()));
    asyncHandler.start();
    serializationService = new DefaultSerializationServiceBuilder().build();
}
Also used : DefaultSerializationServiceBuilder(com.hazelcast.internal.serialization.impl.DefaultSerializationServiceBuilder) HazelcastProperties(com.hazelcast.spi.properties.HazelcastProperties) PacketHandler(com.hazelcast.spi.impl.PacketHandler) Config(com.hazelcast.config.Config) ILogger(com.hazelcast.logging.ILogger) HazelcastThreadGroup(com.hazelcast.instance.HazelcastThreadGroup) Before(org.junit.Before)

Example 38 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class OperationThreadTest method createNewOperationThread.

private PartitionOperationThread createNewOperationThread(OperationQueue mockOperationQueue) {
    ILogger mockLogger = mock(ILogger.class);
    OperationRunner[] runners = new OperationRunner[0];
    return new PartitionOperationThread("threadName", 0, mockOperationQueue, mockLogger, threadGroup, nodeExtension, runners);
}
Also used : ILogger(com.hazelcast.logging.ILogger) OperationRunner(com.hazelcast.spi.impl.operationexecutor.OperationRunner)

Example 39 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class AuthenticationBaseMessageTask method prepareAuthenticatedClientMessage.

private ClientMessage prepareAuthenticatedClientMessage() {
    Connection connection = endpoint.getConnection();
    ILogger logger = clientEngine.getLogger(getClass());
    endpoint.authenticated(principal, credentials, isOwnerConnection(), clientVersion, clientMessage.getCorrelationId());
    setConnectionType();
    logger.info("Received auth from " + connection + ", successfully authenticated" + ", principal : " + principal + ", owner connection : " + isOwnerConnection() + ", client version : " + clientVersion);
    if (endpointManager.registerEndpoint(endpoint)) {
        clientEngine.bind(endpoint);
    }
    final Address thisAddress = clientEngine.getThisAddress();
    byte status = AuthenticationStatus.AUTHENTICATED.getId();
    return encodeAuth(status, thisAddress, principal.getUuid(), principal.getOwnerUuid(), serializationService.getVersion(), cleanedUpMembers);
}
Also used : Address(com.hazelcast.nio.Address) Connection(com.hazelcast.nio.Connection) ILogger(com.hazelcast.logging.ILogger)

Example 40 with ILogger

use of com.hazelcast.logging.ILogger in project hazelcast by hazelcast.

the class AuthenticationBaseMessageTask method authenticate.

private AuthenticationStatus authenticate() {
    ILogger logger = clientEngine.getLogger(getClass());
    AuthenticationStatus status;
    if (credentials == null) {
        status = AuthenticationStatus.CREDENTIALS_FAILED;
        logger.severe("Could not retrieve Credentials object!");
    } else if (clientEngine.getSecurityContext() != null) {
        status = authenticate(clientEngine.getSecurityContext());
    } else if (credentials instanceof UsernamePasswordCredentials) {
        UsernamePasswordCredentials usernamePasswordCredentials = (UsernamePasswordCredentials) credentials;
        status = authenticate(usernamePasswordCredentials);
    } else {
        status = AuthenticationStatus.CREDENTIALS_FAILED;
        logger.severe("Hazelcast security is disabled.\nUsernamePasswordCredentials or cluster " + "group-name and group-password should be used for authentication!\n" + "Current credentials type is: " + credentials.getClass().getName());
    }
    return status;
}
Also used : AuthenticationStatus(com.hazelcast.client.impl.protocol.AuthenticationStatus) ILogger(com.hazelcast.logging.ILogger) UsernamePasswordCredentials(com.hazelcast.security.UsernamePasswordCredentials)

Aggregations

ILogger (com.hazelcast.logging.ILogger)76 Address (com.hazelcast.nio.Address)19 NodeEngineImpl (com.hazelcast.spi.impl.NodeEngineImpl)11 Node (com.hazelcast.instance.Node)10 InternalPartitionServiceImpl (com.hazelcast.internal.partition.impl.InternalPartitionServiceImpl)10 NodeEngine (com.hazelcast.spi.NodeEngine)10 ClusterServiceImpl (com.hazelcast.internal.cluster.impl.ClusterServiceImpl)9 ReplicatedMapService (com.hazelcast.replicatedmap.impl.ReplicatedMapService)6 OperationService (com.hazelcast.spi.OperationService)6 IOException (java.io.IOException)4 Before (org.junit.Before)4 JsonObject (com.eclipsesource.json.JsonObject)3 ClientAwsConfig (com.hazelcast.client.config.ClientAwsConfig)3 Connection (com.hazelcast.nio.Connection)3 ReplicatedRecordStore (com.hazelcast.replicatedmap.impl.record.ReplicatedRecordStore)3 Operation (com.hazelcast.spi.Operation)3 HazelcastProperties (com.hazelcast.spi.properties.HazelcastProperties)3 JsonUtil.getString (com.hazelcast.util.JsonUtil.getString)3 ClientNetworkConfig (com.hazelcast.client.config.ClientNetworkConfig)2 ClusterState (com.hazelcast.cluster.ClusterState)2