public String getName() { return this.member.getName(); }
public String getName() { return this.member.getName(); }
public String getName() { return this.member.getName(); }
private Map<String, String> prepareUserData(AlertDetails details) { Map<String, String> userData = new HashMap<String, String>(); userData.put(JMXNotificationUserData.ALERT_LEVEL, AlertDetails.getAlertLevelAsString(details.getAlertLevel())); String source = details.getSource(); userData.put(JMXNotificationUserData.THREAD, source); InternalDistributedMember sender = details.getSender(); String nameOrId = memberSource; // TODO Rishi/Abhishek - what if sender is // null? if (sender != null) { nameOrId = sender.getName(); nameOrId = nameOrId != null && !nameOrId.trim().isEmpty() ? nameOrId : sender.getId(); } userData.put(JMXNotificationUserData.MEMBER, nameOrId); return userData; }
/** * Updates this SystemMember instance using the corresponding * InternalDistributedMember * * @param member * InternalDistributedMember instance to update this SystemMember * * @since 6.5 */ private void updateByInternalDistributedMember( InternalDistributedMember member) { if (member != null) { this.internalId = member; this.id = this.internalId.toString(); this.host = this.internalId.getHost(); this.name = this.internalId.getName(); if (this.name == null || DistributionConfig.DEFAULT_NAME.equals(this.name)) { /* * name could be null & referring to description of a fix for 32877 */ this.name = this.id; } } }
/** * Updates this SystemMember instance using the corresponding * InternalDistributedMember * * @param member * InternalDistributedMember instance to update this SystemMember * * @since 6.5 */ private void updateByInternalDistributedMember( InternalDistributedMember member) { if (member != null) { this.internalId = member; this.id = this.internalId.toString(); this.host = this.internalId.getHost(); this.name = this.internalId.getName(); if (this.name == null || DistributionConfig.DEFAULT_NAME.equals(this.name)) { /* * name could be null & referring to description of a fix for 32877 */ this.name = this.id; } } }
public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected) { Notification notification = new Notification( ResourceNotification.CACHE_MEMBER_SUSPECT, MBeanJMXAdapter .getMemberNameOrId(id), SequenceNumber.next(), System .currentTimeMillis(), ResourceNotification.CACHE_MEMBER_SUSPECT_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id) + " By : " + whoSuspected.getName()); systemLevelNotifEmitter.sendNotification(notification); }
public void memberSuspect(InternalDistributedMember id, InternalDistributedMember whoSuspected) { Notification notification = new Notification( JMXNotificationType.CACHE_MEMBER_SUSPECT, MBeanJMXAdapter .getMemberNameOrId(id), SequenceNumber.next(), System .currentTimeMillis(), ManagementConstants.CACHE_MEMBER_SUSPECT_PREFIX + MBeanJMXAdapter.getMemberNameOrId(id) + " By : " + whoSuspected.getName()); systemLevelNotifEmitter.sendNotification(notification); } }
String myName = getName(); if (vmPid > 0 || vmKind != DistributionManager.NORMAL_DM_TYPE || !"".equals(myName)) { sb.append("(");
String myName = getName(); if (vmPid > 0 || vmKind != DistributionManager.NORMAL_DM_TYPE || vmKindStr != null || !"".equals(myName)) {
public void testNonDefaultName() { Properties config = new Properties(); config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); config.setProperty(DistributionConfig.LOCATORS_NAME, ""); config.setProperty(DistributionConfig.NAME_NAME, "nondefault"); InternalDistributedSystem system = getSystem(config); try { assertEquals("nondefault", system.getConfig().getName()); DM dm = system.getDistributionManager(); InternalDistributedMember member = dm.getDistributionManagerId(); assertEquals("nondefault", member.getName()); } finally { system.disconnect(); } }
public PersistentMemberID generatePersistentID(DiskRegionView dr) { File firstDir = getInfoFileDir().getDir(); InternalDistributedSystem ids = getCache().getDistributedSystem(); InternalDistributedMember memberId = ids.getDistributionManager() .getDistributionManagerId(); //NOTE - do NOT use DM.cacheTimeMillis here. See bug #49920 long timestamp = System.currentTimeMillis(); PersistentMemberID id = new PersistentMemberID(getDiskStoreID(), memberId.getIpAddress(), firstDir.getAbsolutePath(), memberId.getName(), timestamp, (short) 0); return id; }
public PersistentMemberID generatePersistentID(DiskRegionView dr) { File firstDir = getInfoFileDir().getDir(); InternalDistributedSystem ids = getCache().getDistributedSystem(); InternalDistributedMember memberId = ids.getDistributionManager() .getDistributionManagerId(); //NOTE - do NOT use DM.cacheTimeMillis here. See bug #49920 long timestamp = System.currentTimeMillis(); PersistentMemberID id = new PersistentMemberID(getDiskStoreID(), memberId.getInetAddress(), firstDir.getAbsolutePath(), memberId.getName(), timestamp, (short) 0); return id; }
/** * Tests default settings. */ public void testDefaults() { Properties config = new Properties(); config.setProperty(DistributionConfig.MCAST_PORT_NAME, "0"); config.setProperty(DistributionConfig.LOCATORS_NAME, ""); config.setProperty(DistributionConfig.ROLES_NAME, ""); config.setProperty(DistributionConfig.GROUPS_NAME, ""); config.setProperty(DistributionConfig.NAME_NAME, ""); InternalDistributedSystem system = getSystem(config); try { assertTrue(system.getConfig().getRoles().equals( DistributionConfig.DEFAULT_ROLES)); assertTrue(system.getConfig().getGroups().equals( DistributionConfig.DEFAULT_ROLES)); assertTrue(system.getConfig().getName().equals( DistributionConfig.DEFAULT_NAME)); DM dm = system.getDistributionManager(); InternalDistributedMember member = dm.getDistributionManagerId(); Set roles = member.getRoles(); assertEquals(0, roles.size()); assertEquals("", member.getName()); assertEquals(Collections.emptyList(), member.getGroups()); } finally { system.disconnect(); } }
/** * Sends the alert with the Object source as member. This notification will * get filtered out for particular alert level * * @param details */ public void handleSystemNotification(AlertDetails details) { if (!isServiceInitialised("handleSystemNotification")) { return; } if (service.isManager()) { String systemSource = "DistributedSystem(" + service.getDistributedSystemMXBean().getDistributedSystemId() + ")"; Notification notification = new Notification(ResourceNotification.SYSTEM_ALERT, systemSource, SequenceNumber .next(), details.getMsgTime().getTime(), details.toString()); InternalDistributedMember sender = details.getSender(); String nameOrId = memberSource; // TODO Rishi/Abhishek - what if sender is // null? if (sender != null) { nameOrId = sender.getName(); nameOrId = nameOrId != null && !nameOrId.trim().isEmpty() ? nameOrId : sender.getId(); } notification.setUserData(nameOrId); service.handleNotification(notification); } }
if (!"".equals(id.getName())) { for (InternalDistributedMember m: (List<InternalDistributedMember>)dm.getViewMembers()) { if (m.equals(id)) { if (id.getName().equals(m.getName())) { if (dm.getMembershipManager().verifyMember(m, "member is using the name of " + id)) { throw new IncompatibleSystemException("Member " + id + " could not join this distributed system because the existing member " + m + " used the same name. Set the \"name\" gemfire property to a unique value.");
this.name = cache.getDistributedSystem().getDistributedMember().getName(); this.id = cache.getDistributedSystem().getDistributedMember().getId();
if (!"".equals(id.getName())) { for (InternalDistributedMember m: (Vector<InternalDistributedMember>)dm.getViewMembers()) { if (m.equals(id)) { if (id.getName().equals(m.getName())) { if (dm.getMembershipManager().verifyMember(m, "member is using the name of " + id)) { throw new IncompatibleSystemException("Member " + id + " could not join this distributed system because the existing member " + m + " used the same name. Set the \"name\" gemfire property to a unique value.");
this.name = cache.getDistributedSystem().getDistributedMember().getName(); this.id = cache.getDistributedSystem().getDistributedMember().getId();