com.hazelcast.instance
Class MemberImpl

java.lang.Object
  extended by com.hazelcast.instance.AbstractMember
      extended by com.hazelcast.instance.MemberImpl
All Implemented Interfaces:
Endpoint, HazelcastInstanceAware, Member, DataSerializable, IdentifiedDataSerializable

public final class MemberImpl
extends AbstractMember
implements Member, HazelcastInstanceAware, IdentifiedDataSerializable


Field Summary
 
Fields inherited from class com.hazelcast.instance.AbstractMember
address, attributes, uuid
 
Constructor Summary
MemberImpl()
           
MemberImpl(Address address, boolean localMember)
           
MemberImpl(Address address, boolean localMember, String uuid, HazelcastInstanceImpl instance)
           
MemberImpl(Address address, boolean localMember, String uuid, HazelcastInstanceImpl instance, Map<String,Object> attributes)
           
MemberImpl(MemberImpl member)
           
 
Method Summary
 void didPing()
           
 void didRead()
           
 void didWrite()
           
 Boolean getBooleanAttribute(String key)
          Returns the value of the specified key for this member, or null if the value is undefined.
 Byte getByteAttribute(String key)
          Returns the value of the specified key for this member or null if the value is undefined.
 Double getDoubleAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 int getFactoryId()
          Returns DataSerializableFactory factory id for this class.
 Float getFloatAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 int getId()
          Returns type identifier for this class.
 Integer getIntAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 long getLastPing()
           
 long getLastRead()
           
 long getLastWrite()
           
protected  ILogger getLogger()
           
 Long getLongAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 Short getShortAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 String getStringAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 boolean localMember()
          Returns true if this member is the local member.
 void removeAttribute(String key)
          Removes a key-value pair attribute for this member if given key was previously assigned as an attribute.
If key wasn't assigned to a value this method does nothing.
 void setBooleanAttribute(String key, boolean value)
          Defines a key-value pair boolean attribute for this member that is available to other cluster members.
 void setByteAttribute(String key, byte value)
          Defines a key-value pair byte attribute for this member available to other cluster members.
 void setDoubleAttribute(String key, double value)
          Defines a key-value pair double attribute for this member available to other cluster members.
 void setFloatAttribute(String key, float value)
          Defines a key-value pair float attribute for this member available to other cluster members.
 void setHazelcastInstance(HazelcastInstance hazelcastInstance)
          Gets the HazelcastInstance reference when submitting a Runnable/Callable using Hazelcast ExecutorService.
 void setIntAttribute(String key, int value)
          Defines a key-value pair int attribute for this member available to other cluster members.
 void setLongAttribute(String key, long value)
          Defines a key-value pair long attribute for this member available to other cluster members.
 void setShortAttribute(String key, short value)
          Defines a key-value pair short attribute for this member available to other cluster members.
 void setStringAttribute(String key, String value)
          Defines a key-value pair string attribute for this member available to other cluster members.
 
Methods inherited from class com.hazelcast.instance.AbstractMember
equals, getAddress, getAttribute, getAttributes, getInetAddress, getInetSocketAddress, getPort, getSocketAddress, getUuid, hashCode, readData, toString, updateAttribute, writeData
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.hazelcast.core.Member
getAttributes, getInetSocketAddress, getSocketAddress, getUuid
 
Methods inherited from interface com.hazelcast.nio.serialization.DataSerializable
readData, writeData
 

Constructor Detail

MemberImpl

public MemberImpl()

MemberImpl

public MemberImpl(Address address,
                  boolean localMember)

MemberImpl

public MemberImpl(Address address,
                  boolean localMember,
                  String uuid,
                  HazelcastInstanceImpl instance)

MemberImpl

public MemberImpl(Address address,
                  boolean localMember,
                  String uuid,
                  HazelcastInstanceImpl instance,
                  Map<String,Object> attributes)

MemberImpl

public MemberImpl(MemberImpl member)
Method Detail

getLogger

protected ILogger getLogger()
Specified by:
getLogger in class AbstractMember

setHazelcastInstance

public void setHazelcastInstance(HazelcastInstance hazelcastInstance)
Description copied from interface: HazelcastInstanceAware
Gets the HazelcastInstance reference when submitting a Runnable/Callable using Hazelcast ExecutorService.

Specified by:
setHazelcastInstance in interface HazelcastInstanceAware
Parameters:
hazelcastInstance - the HazelcastInstance reference

localMember

public boolean localMember()
Description copied from interface: Member
Returns true if this member is the local member.

Specified by:
localMember in interface Member
Returns:
true if this member is the local member, false otherwise.

didWrite

public void didWrite()

didRead

public void didRead()

didPing

public void didPing()

getLastPing

public long getLastPing()

getLastRead

public long getLastRead()

getLastWrite

public long getLastWrite()

getStringAttribute

public String getStringAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if value is undefined.

Specified by:
getStringAttribute in interface Member
Parameters:
key - The key to lookup.
Returns:
The value for this member key.

setStringAttribute

public void setStringAttribute(String key,
                               String value)
Description copied from interface: Member
Defines a key-value pair string attribute for this member available to other cluster members.

Specified by:
setStringAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getBooleanAttribute

public Boolean getBooleanAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member, or null if the value is undefined.

Specified by:
getBooleanAttribute in interface Member
Parameters:
key - The key to look up
Returns:
the value for this member key

setBooleanAttribute

public void setBooleanAttribute(String key,
                                boolean value)
Description copied from interface: Member
Defines a key-value pair boolean attribute for this member that is available to other cluster members.

Specified by:
setBooleanAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getByteAttribute

public Byte getByteAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if the value is undefined.

Specified by:
getByteAttribute in interface Member
Parameters:
key - The key to look up.
Returns:
The value for this member key.

setByteAttribute

public void setByteAttribute(String key,
                             byte value)
Description copied from interface: Member
Defines a key-value pair byte attribute for this member available to other cluster members.

Specified by:
setByteAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getShortAttribute

public Short getShortAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if value is undefined.

Specified by:
getShortAttribute in interface Member
Parameters:
key - The key to look up.
Returns:
The value for this member key.

setShortAttribute

public void setShortAttribute(String key,
                              short value)
Description copied from interface: Member
Defines a key-value pair short attribute for this member available to other cluster members.

Specified by:
setShortAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getIntAttribute

public Integer getIntAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if value is undefined.

Specified by:
getIntAttribute in interface Member
Parameters:
key - The key to look up.
Returns:
The value for this members key.

setIntAttribute

public void setIntAttribute(String key,
                            int value)
Description copied from interface: Member
Defines a key-value pair int attribute for this member available to other cluster members.

Specified by:
setIntAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getLongAttribute

public Long getLongAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if value is undefined.

Specified by:
getLongAttribute in interface Member
Parameters:
key - The key to look up.
Returns:
The value for this members key.

setLongAttribute

public void setLongAttribute(String key,
                             long value)
Description copied from interface: Member
Defines a key-value pair long attribute for this member available to other cluster members.

Specified by:
setLongAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getFloatAttribute

public Float getFloatAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if value is undefined.

Specified by:
getFloatAttribute in interface Member
Parameters:
key - The key to look up.
Returns:
The value for this member key.

setFloatAttribute

public void setFloatAttribute(String key,
                              float value)
Description copied from interface: Member
Defines a key-value pair float attribute for this member available to other cluster members.

Specified by:
setFloatAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

getDoubleAttribute

public Double getDoubleAttribute(String key)
Description copied from interface: Member
Returns the value of the specified key for this member or null if value is undefined.

Specified by:
getDoubleAttribute in interface Member
Parameters:
key - The key to look up.
Returns:
The value for this members key.

setDoubleAttribute

public void setDoubleAttribute(String key,
                               double value)
Description copied from interface: Member
Defines a key-value pair double attribute for this member available to other cluster members.

Specified by:
setDoubleAttribute in interface Member
Parameters:
key - The key for this property.
value - The value that corresponds to this attribute and this member.

removeAttribute

public void removeAttribute(String key)
Description copied from interface: Member
Removes a key-value pair attribute for this member if given key was previously assigned as an attribute.
If key wasn't assigned to a value this method does nothing.

Specified by:
removeAttribute in interface Member
Parameters:
key - The key to be deleted from the member attributes

getFactoryId

public int getFactoryId()
Description copied from interface: IdentifiedDataSerializable
Returns DataSerializableFactory factory id for this class.

Specified by:
getFactoryId in interface IdentifiedDataSerializable
Returns:
factory id

getId

public int getId()
Description copied from interface: IdentifiedDataSerializable
Returns type identifier for this class. Id should be unique per DataSerializableFactory.

Specified by:
getId in interface IdentifiedDataSerializable
Returns:
type id


Copyright © 2015 Hazelcast, Inc.. All Rights Reserved.