com.hazelcast.instance
Class MemberImpl

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

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


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 equals(Object obj)
           
 Address getAddress()
           
 Map<String,Object> getAttributes()
          Returns configured attributes for this member.
This method might not be available on all native clients.
 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.
 InetAddress getInetAddress()
           
 InetSocketAddress getInetSocketAddress()
          Returns the InetSocketAddress of this member.
 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()
           
 Long getLongAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 int getPort()
           
 Short getShortAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 InetSocketAddress getSocketAddress()
          Returns the socket address of this member.
 String getStringAttribute(String key)
          Returns the value of the specified key for this member or null if value is undefined.
 String getUuid()
          Returns the UUID of this member.
 int hashCode()
           
 boolean localMember()
          Returns true if this member is the local member.
 void readData(ObjectDataInput in)
          Reads fields from the input stream
 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.
 String toString()
           
 void updateAttribute(MemberAttributeOperationType operationType, String key, Object value)
           
 void writeData(ObjectDataOutput out)
          Writes object fields to output stream
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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

getAddress

public Address getAddress()

getPort

public int getPort()

getInetAddress

public InetAddress getInetAddress()

getInetSocketAddress

public InetSocketAddress getInetSocketAddress()
Description copied from interface: Member
Returns the InetSocketAddress of this member.

Specified by:
getInetSocketAddress in interface Member
Returns:
InetSocketAddress of this member

getSocketAddress

public InetSocketAddress getSocketAddress()
Description copied from interface: Member
Returns the socket address of this member.

Specified by:
getSocketAddress in interface Endpoint
Specified by:
getSocketAddress in interface Member
Returns:
the socket address of this member

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()

getUuid

public String getUuid()
Description copied from interface: Member
Returns the UUID of this member.

Specified by:
getUuid in interface Endpoint
Specified by:
getUuid in interface Member
Returns:
the UUID of this member.

getAttributes

public Map<String,Object> getAttributes()
Description copied from interface: Member
Returns configured attributes for this member.
This method might not be available on all native clients.

Specified by:
getAttributes in interface Member
Returns:
configured attributes for this member.

updateAttribute

public void updateAttribute(MemberAttributeOperationType operationType,
                            String key,
                            Object value)

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

readData

public void readData(ObjectDataInput in)
              throws IOException
Description copied from interface: DataSerializable
Reads fields from the input stream

Specified by:
readData in interface DataSerializable
Parameters:
in - input
Throws:
IOException

writeData

public void writeData(ObjectDataOutput out)
               throws IOException
Description copied from interface: DataSerializable
Writes object fields to output stream

Specified by:
writeData in interface DataSerializable
Parameters:
out - output
Throws:
IOException

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

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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