THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
PlantUML |
---|
@startuml interface MembershipBuilder { + static newMembershipBuilder() ---- + set...() } interface Membership { Core class of a running membership system. + getMembershipView(): MembershipView } interface Messenger { + send(Message) } interface MembershipView { + getMembers(): List<MemberID>List<MemberIdentifier> } interface MemberIDMemberIdentifier { A single member of the system } interface MembershipListener { } interface MessageHandler { } interface Authenticator { } interface MembershipStatistics { } interface Config { } interface MembershipView { } MembershipBuilder --> Membership : creates MembershipBuilder *-- Authenticator MembershipBuilder *-- MembershipStatistics MembershipBuilder *-- MessageHandler MembershipBuilder *-- Config MembershipBuilder *-- MembershipListener Membership *-- Messenger Membership *-- MembershipView MembershipView *-- MemberIDMemberIdentifier @enduml |
Code Block | ||
---|---|---|
| ||
/** * Creates the membership system, given the provided configuration */ interface MembershipBuilder { static MembershipBuilder newMembershipBuilder() MembershipBuilder setConfig(Config) MembershipBuilder setAuthenticator(Authenticator) MembershipBuilder setMembershipListener(MembershipListener) MembershipBuilder setMessageHandler(MessageHandler) MembershipBuilder setMembershipStatistics(MembershipStatistics) MembershipBuilder setMemberFactorysetMemberIDFactory(MemberIDFactoryMemberIdentifierFactory) create() : Membership } /** * Core class of a running membership system. */ interface Membership { getMembershipView(): MembershipView getMessenger(): Messenger getLocalMember(): MemberIDMemberIdentifier contactedBy(MemberIDMemberIdentifier) isShunned(MemberIDMemberIdentifier) close() isClosed() } /** * API for sending messages to other members, using memberships messaging system * Membership currently allows geode-core to send messages over it's UDP messaging system. * This interface provides that functionality. */ interface Messenger { send(Message) /** Get an object the represents what messages have been sent to to the given * memberIDMemberIdentifier. This is used in waitForMessengerState to wait for these messages * to arrive on the remote side */ getMessengerState(MemberIDMemberIdentifer): MessengerState waitForMessengerState(MessengerState) } /** * A Message that will be sent to the returned recipients. */ interface Message { Set<MemberID>Set<MemberIdentifier> getRecipients() } /** * An object which represents the state of the sending side of a communication * channel at a point in time. This object can be passed to the waitForMessengerState * method on the receiving side to ensure all messages have been received on * the receiving side */ interface MessengerState extends DataSerializableFixedID { }/** * Interface used to create a MemberIDMemberIdentifier from a set of properties * This API is provided solely to allow geode-core to add additional * properties to the MemberIDMemberIdentifier that are not relevant to membership * For example DurableClientAttributes. Membership will provide * A default MemberIDMemberIdentifier which just has the membership relevant attributes */ interface MemberIDFactoryMemberIdentifierFactory { MemberIDMemberIdentifier create(host, port, uuid, ...memberData) } /** * A single member of the system. In practice, this will * be implemented by InternalDistributedMember */ interface MemberIDMemberIdentifier { } /** * Provides the current members of the system */ interface MembershipView { List<MemberID>List<MemberIdentifier> getMembers() } /** * Receives notifications about changes to membership */ interface MembershipListener { memberJoined(MemberIDMemberIdentifier) memberDeparted(MemberIDMemberIdentifier) memberCrashed(MemberIDMemberIdentifier) forceDisconnected(String reason) } /** * Receives all messages sent from other members */ interface MessageHandler { processMessage(Message) } /** * Interface used by membership to authenticate other members */ interface Authenticator { /** * Authenticate peer member * * @return null if authentication succeed (including no authenticator case), otherwise, return * failure message */ String authenticate(MemberIDMemberIdentifier member, Properties credentials); /** * Get credential object for the given GemFire distributed member. */ Properties getCredentials(MemberIDMemberIdentifier member); } /** * Interface to notify statistics systems about membership changes */ interface MembershipStatistics { memberJoined() memberDeparted() ... } /** * Primitive configuration options for membership * - timeouts, etc. */ interface Config { getJoinTimeout() ... } |
...