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);
}
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();
}
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);
}
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);
}
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;
}
Aggregations