@Override public String getGroupName() { final GroupConfig groupConfig = client.getClientConfig().getGroupConfig(); if (groupConfig == null) { throw new RuntimeException("GroupConfig cannot be null client is participate in XA Transaction"); } return groupConfig.getName(); }
public SchemaRepositoryImpl(HazelcastInstance hzInstance) { this.hzClient = hzInstance; HazelcastClientProxy proxy = (HazelcastClientProxy) hzClient; schemaName = proxy.getClientConfig().getGroupConfig().getName(); clientMgr = new ClientManagementImpl(); clientId = UUID.randomUUID().toString(); clientMgr.connect(clientId, proxy); logger.debug("<init>; connected to HZ server as: {}; {}", clientId, proxy); initializeServices(null); // TODO: serializers!? repo.set(this); }
private AuthenticationStatus authenticate(UsernamePasswordCredentials credentials) { GroupConfig groupConfig = nodeEngine.getConfig().getGroupConfig(); String nodeGroupName = groupConfig.getName(); boolean usernameMatch = nodeGroupName.equals(credentials.getUsername()); return usernameMatch ? AuthenticationStatus.AUTHENTICATED : AuthenticationStatus.CREDENTIALS_FAILED; }
private boolean checkCredentials(HttpPostCommand command) throws UnsupportedEncodingException { byte[] data = command.getData(); final String[] strList = bytesToString(data).split("&"); if (strList.length < 2) { return false; } final String groupName = URLDecoder.decode(strList[0], "UTF-8"); final String groupPass = URLDecoder.decode(strList[1], "UTF-8"); final GroupConfig groupConfig = textCommandService.getNode().getConfig().getGroupConfig(); return groupConfig.getName().equals(groupName) && groupConfig.getPassword().equals(groupPass); }
public XAResourceImpl(NodeEngine nodeEngine, XAService service) { super(nodeEngine, service); GroupConfig groupConfig = nodeEngine.getConfig().getGroupConfig(); groupName = groupConfig.getName(); logger = nodeEngine.getLogger(getClass()); }
public XAResourceImpl(NodeEngine nodeEngine, XAService service) { super(nodeEngine, service); GroupConfig groupConfig = nodeEngine.getConfig().getGroupConfig(); groupName = groupConfig.getName(); logger = nodeEngine.getLogger(getClass()); }
private AuthenticationStatus authenticate(UsernamePasswordCredentials credentials) { GroupConfig groupConfig = nodeEngine.getConfig().getGroupConfig(); String nodeGroupName = groupConfig.getName(); boolean usernameMatch = nodeGroupName.equals(credentials.getUsername()); return usernameMatch ? AUTHENTICATED : CREDENTIALS_FAILED; }
@Override public void run() { GroupConfig groupConfig = getNodeEngine().getConfig().getGroupConfig(); if (!groupName.equals(groupConfig.getName())) { response = Boolean.FALSE; } else if (!groupPassword.equals(groupConfig.getPassword())) { response = Boolean.FALSE; } }
@Override public void run() { GroupConfig groupConfig = getNodeEngine().getConfig().getGroupConfig(); if (!groupName.equals(groupConfig.getName())) { response = Boolean.FALSE; } else if (!groupPassword.equals(groupConfig.getPassword())) { response = Boolean.FALSE; } }
@ManagedAnnotation("groupName") @ManagedDescription("Group Name") public String getGroupName() { return config.getGroupConfig().getName(); }
private void initializeFromProperties(Properties props) { clientMgr = new ClientManagementImpl(); clientId = UUID.randomUUID().toString(); logger.debug("initializeFromProperties; initializing with props: {}", props); hzClient = clientMgr.connect(clientId, props); HazelcastClientProxy proxy = (HazelcastClientProxy) hzClient; schemaName = proxy.getClientConfig().getGroupConfig().getName(); initializeServices(props); initializeSerializers(props); }
@ManagedAnnotation("groupName") @ManagedDescription("Group Name") public String getGroupName() { return config.getGroupConfig().getName(); }
private URL newGetTaskUrl() throws IOException { GroupConfig groupConfig = instance.getConfig().getGroupConfig(); Address localAddress = instance.node.getClusterService().getLocalMember().getAddress(); String urlString = cleanupUrl(managementCenterUrl) + "getTask.do?member=" + localAddress.getHost() + ":" + localAddress.getPort() + "&cluster=" + encode(groupConfig.getName(), "UTF-8"); return new URL(urlString); }
private URL newGetTaskUrl() throws IOException { GroupConfig groupConfig = instance.getConfig().getGroupConfig(); Address localAddress = instance.node.getClusterService().getLocalMember().getAddress(); String urlString = cleanupUrl(managementCenterUrl) + "getTask.do?member=" + localAddress.getHost() + ":" + localAddress.getPort() + "&cluster=" + encode(groupConfig.getName(), "UTF-8"); return new URL(urlString); }
private static void group(XmlGenerator gen, GroupConfig group) { gen.open("group") .node("name", group.getName()) .node("password", group.getPassword()) .close(); }
private static void group(XmlGenerator gen, GroupConfig group) { gen.open("group") .node("name", group.getName()) .node("password", group.getPassword()) .close(); }
@Override public void run() { JetService service = getService(); HazelcastInstance instance = service.getJetInstance().getHazelcastInstance(); Cluster cluster = instance.getCluster(); String name = instance.getConfig().getGroupConfig().getName(); response = new ClusterMetadata(name, cluster); }
private String getConnectKey(HazelcastClientProxy hzProxy) { ClientConfig config = hzProxy.getClientConfig(); return config.getGroupConfig().getName() + key_separator + config.getNetworkConfig().getAddresses().toString() + key_separator + config.getCredentials().getPrincipal() + key_separator + config.getNetworkConfig().isSmartRouting() + key_separator + config.getNetworkConfig().getSocketOptions().getBufferSize(); }