Package org.jgroups.protocols
Class S3_PING
- java.lang.Object
-
- org.jgroups.stack.Protocol
-
- org.jgroups.protocols.Discovery
-
- org.jgroups.protocols.FILE_PING
-
- org.jgroups.protocols.S3_PING
-
- Direct Known Subclasses:
GOOGLE_PING
@Deprecated public class S3_PING extends FILE_PING
Deprecated.Use NATIVE_S3_PING (https://github.com/jgroups-extras/native-s3-ping) instead. S3_PING will be removed in 5.0.Discovery protocol using Amazon's S3 storage. The S3 access code reuses the example shipped by Amazon.- Author:
- Bela Ban
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jgroups.protocols.FILE_PING
FILE_PING.InfoWriter
-
Nested classes/interfaces inherited from class org.jgroups.protocols.Discovery
Discovery.DiscoveryCacheDisseminationTask
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
access_key
Deprecated.protected org.jgroups.protocols.S3_PING.AWSAuthConnection
conn
Deprecated.protected java.lang.String
host
Deprecated.protected int
port
Deprecated.protected java.lang.String
pre_signed_delete_url
Deprecated.protected java.lang.String
pre_signed_put_url
Deprecated.protected java.lang.String
prefix
Deprecated.protected java.lang.String
secret_access_key
Deprecated.protected boolean
skip_bucket_existence_check
Deprecated.protected boolean
use_ssl
Deprecated.-
Fields inherited from class org.jgroups.protocols.FILE_PING
filter, info_writer, info_writer_max_writes_after_view, info_writer_sleep_time, location, reads, regexp, register_shutdown_hook, remove_all_data_on_view_change, remove_old_coords_on_view_change, root_dir, SUFFIX, update_store_on_view_change, write_data_on_find, writes
-
Fields inherited from class org.jgroups.protocols.Discovery
async_discovery, async_discovery_use_separate_thread_per_request, break_on_coord_rsp, cluster_name, current_coord, discovery_req_futures, discovery_rsp_callback, discovery_rsp_expiry_time, is_coord, is_leaving, is_server, local_addr, max_members_in_discovery_request, max_rank_to_reply, num_discovery_requests, num_discovery_runs, ping_responses, return_entire_cache, send_cache_on_join, sends_can_block, stagger_timeout, timer, transport, transport_supports_multicasting, use_disk_cache, use_ip_addrs, view, WHITESPACE
-
Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, log, stack, stats, up_prot
-
-
Constructor Summary
Constructors Constructor Description S3_PING()
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected org.jgroups.protocols.S3_PING.AWSAuthConnection
createConnection()
Deprecated.protected void
createRootDir()
Deprecated.static java.lang.String
generatePreSignedUrl(java.lang.String awsAccessKey, java.lang.String awsSecretAccessKey, java.lang.String method, java.lang.String bucket, java.lang.String key, long expirationDate)
Deprecated.Use this helper method to generate pre-signed S3 urls for use with S3_PING.void
init()
Deprecated.Called after instance has been created (null constructor) and before protocol is started.protected void
readAll(java.util.List<Address> members, java.lang.String clustername, Responses responses)
Deprecated.protected void
readResponse(org.jgroups.protocols.S3_PING.GetResponse rsp, java.util.List<Address> mbrs, Responses responses)
Deprecated.protected void
remove(java.lang.String clustername, Address addr)
Deprecated.protected void
removeAll(java.lang.String clustername)
Deprecated.Removes all files for the given cluster nameprotected static java.lang.String
sanitize(java.lang.String name)
Deprecated.Sanitizes bucket and folder names according to AWS guidelinesprotected boolean
usingPreSignedUrls()
Deprecated.protected void
validateProperties()
Deprecated.protected void
write(java.util.List<PingData> list, java.lang.String clustername)
Deprecated.-
Methods inherited from class org.jgroups.protocols.FILE_PING
addressToFilename, deleteFile, down, findMembers, getLocation, getRemoveAllDataOnViewChange, handleView, isDynamic, isInfoWriterRunning, read, read, resetStats, setLocation, setRemoveAllDataOnViewChange, startInfoWriter, stop, stopInfoWriter, write, writeAll, writeAll, writeInfo
-
Methods inherited from class org.jgroups.protocols.Discovery
addDiscoveryResponseToCaches, addResponse, addResponse, addressAsString, addToCache, breakOnCoordResponse, breakOnCoordResponse, clearRequestFutures, deserialize, discoveryRequestReceived, discoveryRspExpiryTime, disseminateDiscoveryInformation, dumpCache, findInitialMembersAsString, findMembers, getClusterName, getCurrentCoord, getNumberOfDiscoveryRequestsSent, getView, getViewId, handleConnect, handleDisconnect, handleDiscoveryResponse, invokeFindMembers, isCoord, isMergeRunning, marshal, providedUpServices, readPingData, returnEntireCache, returnEntireCache, sendCacheInformation, sendDiscoveryResponse, serializeWithoutView, setClusterName, staggerTimeout, staggerTimeout, start, startCacheDissemination, up, up, useDiskCache, useDiskCache, weedOutCompletedDiscoveryResponses
-
Methods inherited from class org.jgroups.stack.Protocol
accept, afterCreationHook, destroy, down, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, providedDownServices, requiredDownServices, requiredUpServices, resetStatistics, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, up
-
-
-
-
Field Detail
-
host
protected java.lang.String host
Deprecated.
-
port
protected int port
Deprecated.
-
use_ssl
protected boolean use_ssl
Deprecated.
-
access_key
protected java.lang.String access_key
Deprecated.
-
secret_access_key
protected java.lang.String secret_access_key
Deprecated.
-
prefix
protected java.lang.String prefix
Deprecated.
-
pre_signed_put_url
protected java.lang.String pre_signed_put_url
Deprecated.
-
pre_signed_delete_url
protected java.lang.String pre_signed_delete_url
Deprecated.
-
skip_bucket_existence_check
protected boolean skip_bucket_existence_check
Deprecated.
-
conn
protected org.jgroups.protocols.S3_PING.AWSAuthConnection conn
Deprecated.
-
-
Method Detail
-
init
public void init() throws java.lang.Exception
Deprecated.Description copied from class:Protocol
Called after instance has been created (null constructor) and before protocol is started. Properties are already set. Other protocols are not yet connected and events cannot yet be sent.
-
createConnection
protected org.jgroups.protocols.S3_PING.AWSAuthConnection createConnection()
Deprecated.
-
createRootDir
protected void createRootDir()
Deprecated.- Overrides:
createRootDir
in classFILE_PING
-
readAll
protected void readAll(java.util.List<Address> members, java.lang.String clustername, Responses responses)
Deprecated.
-
readResponse
protected void readResponse(org.jgroups.protocols.S3_PING.GetResponse rsp, java.util.List<Address> mbrs, Responses responses)
Deprecated.
-
write
protected void write(java.util.List<PingData> list, java.lang.String clustername)
Deprecated.
-
remove
protected void remove(java.lang.String clustername, Address addr)
Deprecated.
-
removeAll
protected void removeAll(java.lang.String clustername)
Deprecated.Description copied from class:FILE_PING
Removes all files for the given cluster name
-
validateProperties
protected void validateProperties()
Deprecated.
-
usingPreSignedUrls
protected boolean usingPreSignedUrls()
Deprecated.
-
sanitize
protected static java.lang.String sanitize(java.lang.String name)
Deprecated.Sanitizes bucket and folder names according to AWS guidelines
-
generatePreSignedUrl
public static java.lang.String generatePreSignedUrl(java.lang.String awsAccessKey, java.lang.String awsSecretAccessKey, java.lang.String method, java.lang.String bucket, java.lang.String key, long expirationDate)
Deprecated.Use this helper method to generate pre-signed S3 urls for use with S3_PING. You'll need to generate urls for both the put and delete http methods. Example: Your AWS Access Key is "abcd". Your AWS Secret Access Key is "efgh". You want this node to write its information to "/S3_PING/DemoCluster/node1". So, your bucket is "S3_PING" and your key is "DemoCluster/node1". You want this to expire one year from now, or (System.currentTimeMillis / 1000) + (60 * 60 * 24 * 365) Let's assume that this equals 1316286684 Here's how to generate the value for the pre_signed_put_url property: String putUrl = S3_PING.generatePreSignedUrl("abcd", "efgh", "put", "S3_Ping", "DemoCluster/node1", 1316286684); Here's how to generate the value for the pre_signed_delete_url property: String deleteUrl = S3_PING.generatePreSignedUrl("abcd", "efgh", "delete", "S3_Ping", "DemoCluster/node1", 1316286684);- Parameters:
awsAccessKey
- Your AWS Access KeyawsSecretAccessKey
- Your AWS Secret Access Keymethod
- The HTTP method - use "put" or "delete" for use with S3_PINGbucket
- The S3 bucket you want to write tokey
- The key within the bucket to write toexpirationDate
- The date this pre-signed url should expire, in seconds since epoch- Returns:
- The pre-signed url to be used in pre_signed_put_url or pre_signed_delete_url properties
-
-