repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/SystemObserver.java
SystemObserver.getAppVersion
static String getAppVersion(Context context) { String appVersion = ""; if (context != null) { try { final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); appVersion = packageInfo.versionName; } cat...
java
static String getAppVersion(Context context) { String appVersion = ""; if (context != null) { try { final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); appVersion = packageInfo.versionName; } cat...
[ "static", "String", "getAppVersion", "(", "Context", "context", ")", "{", "String", "appVersion", "=", "\"\"", ";", "if", "(", "context", "!=", "null", ")", "{", "try", "{", "final", "PackageInfo", "packageInfo", "=", "context", ".", "getPackageManager", "("...
Get the App Version Name of the current application that the SDK is integrated with. @param context Context. @return {@link String} value containing the full package name. BLANK in case of error
[ "Get", "the", "App", "Version", "Name", "of", "the", "current", "application", "that", "the", "SDK", "is", "integrated", "with", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/SystemObserver.java#L87-L98
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/SystemObserver.java
SystemObserver.getFirstInstallTime
static long getFirstInstallTime(Context context) { long firstTime = 0L; if (context != null) { try { final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); firstTime = packageInfo.firstInstallTime; ...
java
static long getFirstInstallTime(Context context) { long firstTime = 0L; if (context != null) { try { final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); firstTime = packageInfo.firstInstallTime; ...
[ "static", "long", "getFirstInstallTime", "(", "Context", "context", ")", "{", "long", "firstTime", "=", "0L", ";", "if", "(", "context", "!=", "null", ")", "{", "try", "{", "final", "PackageInfo", "packageInfo", "=", "context", ".", "getPackageManager", "(",...
Get the time at which the app was first installed, in milliseconds. @param context Context. @return the time at which the app was first installed.
[ "Get", "the", "time", "at", "which", "the", "app", "was", "first", "installed", "in", "milliseconds", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/SystemObserver.java#L105-L117
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/SystemObserver.java
SystemObserver.isPackageInstalled
static boolean isPackageInstalled(Context context) { boolean isInstalled = false; if (context != null) { try { final PackageManager packageManager = context.getPackageManager(); Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getP...
java
static boolean isPackageInstalled(Context context) { boolean isInstalled = false; if (context != null) { try { final PackageManager packageManager = context.getPackageManager(); Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getP...
[ "static", "boolean", "isPackageInstalled", "(", "Context", "context", ")", "{", "boolean", "isInstalled", "=", "false", ";", "if", "(", "context", "!=", "null", ")", "{", "try", "{", "final", "PackageManager", "packageManager", "=", "context", ".", "getPackage...
Determine if the package is installed. @param context Context @return true if the package is installed.
[ "Determine", "if", "the", "package", "is", "installed", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/SystemObserver.java#L124-L142
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/SystemObserver.java
SystemObserver.getLastUpdateTime
static long getLastUpdateTime(Context context) { long lastTime = 0L; if (context != null) { try { final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); lastTime = packageInfo.lastUpdateTime; } catc...
java
static long getLastUpdateTime(Context context) { long lastTime = 0L; if (context != null) { try { final PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); lastTime = packageInfo.lastUpdateTime; } catc...
[ "static", "long", "getLastUpdateTime", "(", "Context", "context", ")", "{", "long", "lastTime", "=", "0L", ";", "if", "(", "context", "!=", "null", ")", "{", "try", "{", "final", "PackageInfo", "packageInfo", "=", "context", ".", "getPackageManager", "(", ...
Get the time at which the app was last updated, in milliseconds. @param context Context. @return the time at which the app was last updated.
[ "Get", "the", "time", "at", "which", "the", "app", "was", "last", "updated", "in", "milliseconds", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/SystemObserver.java#L149-L161
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/SystemObserver.java
SystemObserver.prefetchGAdsParams
boolean prefetchGAdsParams(Context context, GAdsParamsFetchEvents callback) { boolean isPrefetchStarted = false; if (TextUtils.isEmpty(GAIDString_)) { isPrefetchStarted = true; new GAdsPrefetchTask(context, callback).executeTask(); } return isPrefetchStarted; ...
java
boolean prefetchGAdsParams(Context context, GAdsParamsFetchEvents callback) { boolean isPrefetchStarted = false; if (TextUtils.isEmpty(GAIDString_)) { isPrefetchStarted = true; new GAdsPrefetchTask(context, callback).executeTask(); } return isPrefetchStarted; ...
[ "boolean", "prefetchGAdsParams", "(", "Context", "context", ",", "GAdsParamsFetchEvents", "callback", ")", "{", "boolean", "isPrefetchStarted", "=", "false", ";", "if", "(", "TextUtils", ".", "isEmpty", "(", "GAIDString_", ")", ")", "{", "isPrefetchStarted", "=", ...
Method to prefetch the GAID and LAT values. @param context Context. @param callback {@link GAdsParamsFetchEvents} instance to notify process completion @return {@link Boolean} with true if GAID fetch process started.
[ "Method", "to", "prefetch", "the", "GAID", "and", "LAT", "values", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/SystemObserver.java#L307-L314
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/SystemObserver.java
SystemObserver.getLocalIPAddress
static String getLocalIPAddress() { String ipAddress = ""; try { List<NetworkInterface> netInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface netInterface : netInterfaces) { List<InetAddress> addresses = Collections.list(...
java
static String getLocalIPAddress() { String ipAddress = ""; try { List<NetworkInterface> netInterfaces = Collections.list(NetworkInterface.getNetworkInterfaces()); for (NetworkInterface netInterface : netInterfaces) { List<InetAddress> addresses = Collections.list(...
[ "static", "String", "getLocalIPAddress", "(", ")", "{", "String", "ipAddress", "=", "\"\"", ";", "try", "{", "List", "<", "NetworkInterface", ">", "netInterfaces", "=", "Collections", ".", "list", "(", "NetworkInterface", ".", "getNetworkInterfaces", "(", ")", ...
Get IP address from first non local net Interface
[ "Get", "IP", "address", "from", "first", "non", "local", "net", "Interface" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/SystemObserver.java#L429-L450
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ShareLinkManager.java
ShareLinkManager.shareLink
public Dialog shareLink(Branch.ShareLinkBuilder builder) { builder_ = builder; context_ = builder.getActivity(); callback_ = builder.getCallback(); channelPropertiesCallback_ = builder.getChannelPropertiesCallback(); shareLinkIntent_ = new Intent(Intent.ACTION_SEND); shar...
java
public Dialog shareLink(Branch.ShareLinkBuilder builder) { builder_ = builder; context_ = builder.getActivity(); callback_ = builder.getCallback(); channelPropertiesCallback_ = builder.getChannelPropertiesCallback(); shareLinkIntent_ = new Intent(Intent.ACTION_SEND); shar...
[ "public", "Dialog", "shareLink", "(", "Branch", ".", "ShareLinkBuilder", "builder", ")", "{", "builder_", "=", "builder", ";", "context_", "=", "builder", ".", "getActivity", "(", ")", ";", "callback_", "=", "builder", ".", "getCallback", "(", ")", ";", "c...
Creates an application selector and shares a link on user selecting the application. @param builder A {@link io.branch.referral.Branch.ShareLinkBuilder} instance to build share link. @return Instance of the {@link Dialog} holding the share view. Null if sharing dialog is not created due to any error.
[ "Creates", "an", "application", "selector", "and", "shares", "a", "link", "on", "user", "selecting", "the", "application", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ShareLinkManager.java#L69-L91
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ShareLinkManager.java
ShareLinkManager.cancelShareLinkDialog
public void cancelShareLinkDialog(boolean animateClose) { if (shareDlg_ != null && shareDlg_.isShowing()) { if (animateClose) { // Cancel the dialog with animation shareDlg_.cancel(); } else { // Dismiss the dialog immediately ...
java
public void cancelShareLinkDialog(boolean animateClose) { if (shareDlg_ != null && shareDlg_.isShowing()) { if (animateClose) { // Cancel the dialog with animation shareDlg_.cancel(); } else { // Dismiss the dialog immediately ...
[ "public", "void", "cancelShareLinkDialog", "(", "boolean", "animateClose", ")", "{", "if", "(", "shareDlg_", "!=", "null", "&&", "shareDlg_", ".", "isShowing", "(", ")", ")", "{", "if", "(", "animateClose", ")", "{", "// Cancel the dialog with animation", "share...
Dismiss the share dialog if showing. Should be called on activity stopping. @param animateClose A {@link Boolean} to specify whether to close the dialog with an animation. A value of true will close the dialog with an animation. Setting this value to false will close the Dialog immediately.
[ "Dismiss", "the", "share", "dialog", "if", "showing", ".", "Should", "be", "called", "on", "activity", "stopping", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ShareLinkManager.java#L100-L110
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ShareLinkManager.java
ShareLinkManager.invokeSharingClient
private void invokeSharingClient(final ResolveInfo selectedResolveInfo) { isShareInProgress_ = true; final String channelName = selectedResolveInfo.loadLabel(context_.getPackageManager()).toString(); BranchShortLinkBuilder shortLinkBuilder = builder_.getShortLinkBuilder(); short...
java
private void invokeSharingClient(final ResolveInfo selectedResolveInfo) { isShareInProgress_ = true; final String channelName = selectedResolveInfo.loadLabel(context_.getPackageManager()).toString(); BranchShortLinkBuilder shortLinkBuilder = builder_.getShortLinkBuilder(); short...
[ "private", "void", "invokeSharingClient", "(", "final", "ResolveInfo", "selectedResolveInfo", ")", "{", "isShareInProgress_", "=", "true", ";", "final", "String", "channelName", "=", "selectedResolveInfo", ".", "loadLabel", "(", "context_", ".", "getPackageManager", "...
Invokes a sharing client with a link created by the given json objects. @param selectedResolveInfo The {@link ResolveInfo} corresponding to the selected sharing client.
[ "Invokes", "a", "sharing", "client", "with", "a", "link", "created", "by", "the", "given", "json", "objects", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ShareLinkManager.java#L274-L306
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ShareLinkManager.java
ShareLinkManager.addLinkToClipBoard
@SuppressWarnings("deprecation") @SuppressLint("NewApi") private void addLinkToClipBoard(String url, String label) { int sdk = android.os.Build.VERSION.SDK_INT; if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) { android.text.ClipboardManager clipboard = (android.text.ClipboardMana...
java
@SuppressWarnings("deprecation") @SuppressLint("NewApi") private void addLinkToClipBoard(String url, String label) { int sdk = android.os.Build.VERSION.SDK_INT; if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) { android.text.ClipboardManager clipboard = (android.text.ClipboardMana...
[ "@", "SuppressWarnings", "(", "\"deprecation\"", ")", "@", "SuppressLint", "(", "\"NewApi\"", ")", "private", "void", "addLinkToClipBoard", "(", "String", "url", ",", "String", "label", ")", "{", "int", "sdk", "=", "android", ".", "os", ".", "Build", ".", ...
Adds a given link to the clip board. @param url A {@link String} to add to the clip board @param label A {@link String} label for the adding link
[ "Adds", "a", "given", "link", "to", "the", "clip", "board", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ShareLinkManager.java#L345-L358
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ServerRequestQueue.java
ServerRequestQueue.setInstallOrOpenCallback
void setInstallOrOpenCallback(Branch.BranchReferralInitListener callback) { synchronized (reqQueueLockObject) { for (ServerRequest req : queue) { if (req != null) { if (req instanceof ServerRequestRegisterInstall) { ((ServerRequestRegisterI...
java
void setInstallOrOpenCallback(Branch.BranchReferralInitListener callback) { synchronized (reqQueueLockObject) { for (ServerRequest req : queue) { if (req != null) { if (req instanceof ServerRequestRegisterInstall) { ((ServerRequestRegisterI...
[ "void", "setInstallOrOpenCallback", "(", "Branch", ".", "BranchReferralInitListener", "callback", ")", "{", "synchronized", "(", "reqQueueLockObject", ")", "{", "for", "(", "ServerRequest", "req", ":", "queue", ")", "{", "if", "(", "req", "!=", "null", ")", "{...
Sets the given callback to the existing open or install request in the queue @param callback A{@link Branch.BranchReferralInitListener} callback instance.
[ "Sets", "the", "given", "callback", "to", "the", "existing", "open", "or", "install", "request", "in", "the", "queue" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerRequestQueue.java#L353-L365
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ServerRequestQueue.java
ServerRequestQueue.setStrongMatchWaitLock
void setStrongMatchWaitLock() { synchronized (reqQueueLockObject) { for (ServerRequest req : queue) { if (req != null) { if (req instanceof ServerRequestInitSession) { req.addProcessWaitLock(ServerRequest.PROCESS_WAIT_LOCK.STRONG_MATCH_PEND...
java
void setStrongMatchWaitLock() { synchronized (reqQueueLockObject) { for (ServerRequest req : queue) { if (req != null) { if (req instanceof ServerRequestInitSession) { req.addProcessWaitLock(ServerRequest.PROCESS_WAIT_LOCK.STRONG_MATCH_PEND...
[ "void", "setStrongMatchWaitLock", "(", ")", "{", "synchronized", "(", "reqQueueLockObject", ")", "{", "for", "(", "ServerRequest", "req", ":", "queue", ")", "{", "if", "(", "req", "!=", "null", ")", "{", "if", "(", "req", "instanceof", "ServerRequestInitSess...
Sets the strong match wait for any init session request in the queue
[ "Sets", "the", "strong", "match", "wait", "for", "any", "init", "session", "request", "in", "the", "queue" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerRequestQueue.java#L383-L393
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ServerResponse.java
ServerResponse.getFailReason
public String getFailReason() { String causeMsg = ""; try { JSONObject postObj = getObject(); if (postObj != null && postObj.has("error") && postObj.getJSONObject("error").has("message")) { causeMsg = postObj.getJSONObject("...
java
public String getFailReason() { String causeMsg = ""; try { JSONObject postObj = getObject(); if (postObj != null && postObj.has("error") && postObj.getJSONObject("error").has("message")) { causeMsg = postObj.getJSONObject("...
[ "public", "String", "getFailReason", "(", ")", "{", "String", "causeMsg", "=", "\"\"", ";", "try", "{", "JSONObject", "postObj", "=", "getObject", "(", ")", ";", "if", "(", "postObj", "!=", "null", "&&", "postObj", ".", "has", "(", "\"error\"", ")", "&...
Get the reason for failure if there any @return A {@link String } value with failure reason
[ "Get", "the", "reason", "for", "failure", "if", "there", "any" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerResponse.java#L115-L130
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/BranchUtil.java
BranchUtil.addSource
static JSONObject addSource(JSONObject params) { if (params == null) { params = new JSONObject(); } try { params.put("source", "android"); } catch (JSONException e) { e.printStackTrace(); } return params; }
java
static JSONObject addSource(JSONObject params) { if (params == null) { params = new JSONObject(); } try { params.put("source", "android"); } catch (JSONException e) { e.printStackTrace(); } return params; }
[ "static", "JSONObject", "addSource", "(", "JSONObject", "params", ")", "{", "if", "(", "params", "==", "null", ")", "{", "params", "=", "new", "JSONObject", "(", ")", ";", "}", "try", "{", "params", ".", "put", "(", "\"source\"", ",", "\"android\"", ")...
Convert the given JSONObject to string and adds source value as @param params JSONObject to convert to string @return A {@link String} value representing the JSONObject
[ "Convert", "the", "given", "JSONObject", "to", "string", "and", "adds", "source", "value", "as" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/BranchUtil.java#L148-L158
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/BranchLinkData.java
BranchLinkData.getLinkDataJsonObject
public JSONObject getLinkDataJsonObject() { JSONObject linkDataJson = new JSONObject(); try { if (!TextUtils.isEmpty(channel)) { linkDataJson.put("~" + Defines.LinkParam.Channel.getKey(), channel); } if (!TextUtils.isEmpty(alias)) { lin...
java
public JSONObject getLinkDataJsonObject() { JSONObject linkDataJson = new JSONObject(); try { if (!TextUtils.isEmpty(channel)) { linkDataJson.put("~" + Defines.LinkParam.Channel.getKey(), channel); } if (!TextUtils.isEmpty(alias)) { lin...
[ "public", "JSONObject", "getLinkDataJsonObject", "(", ")", "{", "JSONObject", "linkDataJson", "=", "new", "JSONObject", "(", ")", ";", "try", "{", "if", "(", "!", "TextUtils", ".", "isEmpty", "(", "channel", ")", ")", "{", "linkDataJson", ".", "put", "(", ...
Creates the Json object with link params and link properties. @return {@link JSONObject} with link params and link properties
[ "Creates", "the", "Json", "object", "with", "link", "params", "and", "link", "properties", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/BranchLinkData.java#L437-L463
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setAdType
public BranchEvent setAdType(AdType adType) { return addStandardProperty(Defines.Jsonkey.AdType.getKey(), adType.getName()); }
java
public BranchEvent setAdType(AdType adType) { return addStandardProperty(Defines.Jsonkey.AdType.getKey(), adType.getName()); }
[ "public", "BranchEvent", "setAdType", "(", "AdType", "adType", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "AdType", ".", "getKey", "(", ")", ",", "adType", ".", "getName", "(", ")", ")", ";", "}" ]
Set the Ad Type associated with the event. @param adType {@link AdType} Ad Type value @return this object for chaining builder methods
[ "Set", "the", "Ad", "Type", "associated", "with", "the", "event", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L70-L72
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setTransactionID
public BranchEvent setTransactionID(String transactionID) { return addStandardProperty(Defines.Jsonkey.TransactionID.getKey(), transactionID); }
java
public BranchEvent setTransactionID(String transactionID) { return addStandardProperty(Defines.Jsonkey.TransactionID.getKey(), transactionID); }
[ "public", "BranchEvent", "setTransactionID", "(", "String", "transactionID", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "TransactionID", ".", "getKey", "(", ")", ",", "transactionID", ")", ";", "}" ]
Set the transaction id associated with this event if there in any @param transactionID {@link String transactionID}
[ "Set", "the", "transaction", "id", "associated", "with", "this", "event", "if", "there", "in", "any" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L79-L81
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setCurrency
public BranchEvent setCurrency(CurrencyType currency) { return addStandardProperty(Defines.Jsonkey.Currency.getKey(), currency.toString()); }
java
public BranchEvent setCurrency(CurrencyType currency) { return addStandardProperty(Defines.Jsonkey.Currency.getKey(), currency.toString()); }
[ "public", "BranchEvent", "setCurrency", "(", "CurrencyType", "currency", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "Currency", ".", "getKey", "(", ")", ",", "currency", ".", "toString", "(", ")", ")", ";", "}" ]
Set the currency related with this transaction event @param currency iso4217Code for currency. Defined in {@link CurrencyType} @return This object for chaining builder methods
[ "Set", "the", "currency", "related", "with", "this", "transaction", "event" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L89-L91
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setCoupon
public BranchEvent setCoupon(String coupon) { return addStandardProperty(Defines.Jsonkey.Coupon.getKey(), coupon); }
java
public BranchEvent setCoupon(String coupon) { return addStandardProperty(Defines.Jsonkey.Coupon.getKey(), coupon); }
[ "public", "BranchEvent", "setCoupon", "(", "String", "coupon", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "Coupon", ".", "getKey", "(", ")", ",", "coupon", ")", ";", "}" ]
Set any coupons associated with this transaction event @param coupon {@link String } with any coupon value @return This object for chaining builder methods
[ "Set", "any", "coupons", "associated", "with", "this", "transaction", "event" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L129-L131
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setAffiliation
public BranchEvent setAffiliation(String affiliation) { return addStandardProperty(Defines.Jsonkey.Affiliation.getKey(), affiliation); }
java
public BranchEvent setAffiliation(String affiliation) { return addStandardProperty(Defines.Jsonkey.Affiliation.getKey(), affiliation); }
[ "public", "BranchEvent", "setAffiliation", "(", "String", "affiliation", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "Affiliation", ".", "getKey", "(", ")", ",", "affiliation", ")", ";", "}" ]
Set any affiliation for this transaction event @param affiliation {@link String } any affiliation value @return This object for chaining builder methods
[ "Set", "any", "affiliation", "for", "this", "transaction", "event" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L139-L141
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setDescription
public BranchEvent setDescription(String description) { return addStandardProperty(Defines.Jsonkey.Description.getKey(), description); }
java
public BranchEvent setDescription(String description) { return addStandardProperty(Defines.Jsonkey.Description.getKey(), description); }
[ "public", "BranchEvent", "setDescription", "(", "String", "description", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "Description", ".", "getKey", "(", ")", ",", "description", ")", ";", "}" ]
Set description for this transaction event @param description {@link String } transaction description @return This object for chaining builder methods
[ "Set", "description", "for", "this", "transaction", "event" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L149-L151
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.setSearchQuery
public BranchEvent setSearchQuery(String searchQuery) { return addStandardProperty(Defines.Jsonkey.SearchQuery.getKey(), searchQuery); }
java
public BranchEvent setSearchQuery(String searchQuery) { return addStandardProperty(Defines.Jsonkey.SearchQuery.getKey(), searchQuery); }
[ "public", "BranchEvent", "setSearchQuery", "(", "String", "searchQuery", ")", "{", "return", "addStandardProperty", "(", "Defines", ".", "Jsonkey", ".", "SearchQuery", ".", "getKey", "(", ")", ",", "searchQuery", ")", ";", "}" ]
Set any search query associated with the event @param searchQuery {@link String} Search Query value @return This object for chaining builder methods
[ "Set", "any", "search", "query", "associated", "with", "the", "event" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L159-L161
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.addCustomDataProperty
public BranchEvent addCustomDataProperty(String propertyName, String propertyValue) { try { this.customProperties.put(propertyName, propertyValue); } catch (JSONException e) { e.printStackTrace(); } return this; }
java
public BranchEvent addCustomDataProperty(String propertyName, String propertyValue) { try { this.customProperties.put(propertyName, propertyValue); } catch (JSONException e) { e.printStackTrace(); } return this; }
[ "public", "BranchEvent", "addCustomDataProperty", "(", "String", "propertyName", ",", "String", "propertyValue", ")", "{", "try", "{", "this", ".", "customProperties", ".", "put", "(", "propertyName", ",", "propertyValue", ")", ";", "}", "catch", "(", "JSONExcep...
Adds a custom data property associated with this Branch Event @param propertyName {@link String} Name of the custom property @param propertyValue {@link String} Value of the custom property @return This object for chaining builder methods
[ "Adds", "a", "custom", "data", "property", "associated", "with", "this", "Branch", "Event" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L183-L190
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/util/BranchEvent.java
BranchEvent.logEvent
public boolean logEvent(Context context) { boolean isReqQueued = false; String reqPath = isStandardEvent ? Defines.RequestPath.TrackStandardEvent.getPath() : Defines.RequestPath.TrackCustomEvent.getPath(); if (Branch.getInstance() != null) { Branch.getInstance().handleNewRequest(new ...
java
public boolean logEvent(Context context) { boolean isReqQueued = false; String reqPath = isStandardEvent ? Defines.RequestPath.TrackStandardEvent.getPath() : Defines.RequestPath.TrackCustomEvent.getPath(); if (Branch.getInstance() != null) { Branch.getInstance().handleNewRequest(new ...
[ "public", "boolean", "logEvent", "(", "Context", "context", ")", "{", "boolean", "isReqQueued", "=", "false", ";", "String", "reqPath", "=", "isStandardEvent", "?", "Defines", ".", "RequestPath", ".", "TrackStandardEvent", ".", "getPath", "(", ")", ":", "Defin...
Logs this BranchEvent to Branch for tracking and analytics @param context Current context @return {@code true} if the event is logged to Branch
[ "Logs", "this", "BranchEvent", "to", "Branch", "for", "tracking", "and", "analytics" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/util/BranchEvent.java#L227-L235
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/PrefHelper.java
PrefHelper.setBranchKey
public boolean setBranchKey(String key) { Branch_Key = key; String currentBranchKey = getString(KEY_BRANCH_KEY); if (key == null || currentBranchKey == null || !currentBranchKey.equals(key)) { clearPrefOnBranchKeyChange(); setString(KEY_BRANCH_KEY, key); retur...
java
public boolean setBranchKey(String key) { Branch_Key = key; String currentBranchKey = getString(KEY_BRANCH_KEY); if (key == null || currentBranchKey == null || !currentBranchKey.equals(key)) { clearPrefOnBranchKeyChange(); setString(KEY_BRANCH_KEY, key); retur...
[ "public", "boolean", "setBranchKey", "(", "String", "key", ")", "{", "Branch_Key", "=", "key", ";", "String", "currentBranchKey", "=", "getString", "(", "KEY_BRANCH_KEY", ")", ";", "if", "(", "key", "==", "null", "||", "currentBranchKey", "==", "null", "||",...
Set the given Branch Key to preference. Clears the preference data if the key is a new key. @param key A {@link String} representing Branch Key. @return A {@link Boolean} which is true if the key set is a new key. On Setting a new key need to clear all preference items.
[ "Set", "the", "given", "Branch", "Key", "to", "preference", ".", "Clears", "the", "preference", "data", "if", "the", "key", "is", "a", "new", "key", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L285-L294
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/PrefHelper.java
PrefHelper.getBuckets
private ArrayList<String> getBuckets() { String bucketList = getString(KEY_BUCKETS); if (bucketList.equals(NO_STRING_VALUE)) { return new ArrayList<>(); } else { return deserializeString(bucketList); } }
java
private ArrayList<String> getBuckets() { String bucketList = getString(KEY_BUCKETS); if (bucketList.equals(NO_STRING_VALUE)) { return new ArrayList<>(); } else { return deserializeString(bucketList); } }
[ "private", "ArrayList", "<", "String", ">", "getBuckets", "(", ")", "{", "String", "bucketList", "=", "getString", "(", "KEY_BUCKETS", ")", ";", "if", "(", "bucketList", ".", "equals", "(", "NO_STRING_VALUE", ")", ")", "{", "return", "new", "ArrayList", "<...
REWARD TRACKING CALLS
[ "REWARD", "TRACKING", "CALLS" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L730-L737
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/PrefHelper.java
PrefHelper.getActions
private ArrayList<String> getActions() { String actionList = getString(KEY_ACTIONS); if (actionList.equals(NO_STRING_VALUE)) { return new ArrayList<>(); } else { return deserializeString(actionList); } }
java
private ArrayList<String> getActions() { String actionList = getString(KEY_ACTIONS); if (actionList.equals(NO_STRING_VALUE)) { return new ArrayList<>(); } else { return deserializeString(actionList); } }
[ "private", "ArrayList", "<", "String", ">", "getActions", "(", ")", "{", "String", "actionList", "=", "getString", "(", "KEY_ACTIONS", ")", ";", "if", "(", "actionList", ".", "equals", "(", "NO_STRING_VALUE", ")", ")", "{", "return", "new", "ArrayList", "<...
EVENT REFERRAL INSTALL CALLS
[ "EVENT", "REFERRAL", "INSTALL", "CALLS" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L808-L815
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/PrefHelper.java
PrefHelper.serializeArrayList
private String serializeArrayList(ArrayList<String> strings) { String retString = ""; for (String value : strings) { retString = retString + value + ","; } retString = retString.substring(0, retString.length() - 1); return retString; }
java
private String serializeArrayList(ArrayList<String> strings) { String retString = ""; for (String value : strings) { retString = retString + value + ","; } retString = retString.substring(0, retString.length() - 1); return retString; }
[ "private", "String", "serializeArrayList", "(", "ArrayList", "<", "String", ">", "strings", ")", "{", "String", "retString", "=", "\"\"", ";", "for", "(", "String", "value", ":", "strings", ")", "{", "retString", "=", "retString", "+", "value", "+", "\",\"...
ALL GENERIC CALLS
[ "ALL", "GENERIC", "CALLS" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/PrefHelper.java#L884-L891
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ServerRequestCreateUrl.java
ServerRequestCreateUrl.onUrlAvailable
public void onUrlAvailable(String url) { if (callback_ != null) { callback_.onLinkCreate(url, null); } updateShareEventToFabric(url); }
java
public void onUrlAvailable(String url) { if (callback_ != null) { callback_.onLinkCreate(url, null); } updateShareEventToFabric(url); }
[ "public", "void", "onUrlAvailable", "(", "String", "url", ")", "{", "if", "(", "callback_", "!=", "null", ")", "{", "callback_", ".", "onLinkCreate", "(", "url", ",", "null", ")", ";", "}", "updateShareEventToFabric", "(", "url", ")", ";", "}" ]
Calls the callback with the URL. This should be called on finding an existing url up on trying to create a URL asynchronously @param url existing url with for the given data
[ "Calls", "the", "callback", "with", "the", "URL", ".", "This", "should", "be", "called", "on", "finding", "an", "existing", "url", "up", "on", "trying", "to", "create", "a", "URL", "asynchronously" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerRequestCreateUrl.java#L140-L145
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/indexing/BranchUniversalObject.java
BranchUniversalObject.convertToJson
public JSONObject convertToJson() { JSONObject buoJsonModel = new JSONObject(); try { // Add all keys in plane format initially. All known keys will be replaced with corresponding data type in the following section JSONObject metadataJsonObject = metadata_.convertToJson(); ...
java
public JSONObject convertToJson() { JSONObject buoJsonModel = new JSONObject(); try { // Add all keys in plane format initially. All known keys will be replaced with corresponding data type in the following section JSONObject metadataJsonObject = metadata_.convertToJson(); ...
[ "public", "JSONObject", "convertToJson", "(", ")", "{", "JSONObject", "buoJsonModel", "=", "new", "JSONObject", "(", ")", ";", "try", "{", "// Add all keys in plane format initially. All known keys will be replaced with corresponding data type in the following section", "JSONObjec...
Convert the BUO to corresponding Json representation @return A {@link JSONObject} which represent this BUO
[ "Convert", "the", "BUO", "to", "corresponding", "Json", "representation" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/indexing/BranchUniversalObject.java#L847-L889
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/Branch.java
Branch.shutDown
static void shutDown() { ServerRequestQueue.shutDown(); PrefHelper.shutDown(); BranchUtil.shutDown(); DeviceInfo.shutDown(); // BranchStrongMatchHelper.shutDown(); // BranchViewHandler.shutDown(); // DeepLinkRoutingValidator.shutDown(); // InstallListener...
java
static void shutDown() { ServerRequestQueue.shutDown(); PrefHelper.shutDown(); BranchUtil.shutDown(); DeviceInfo.shutDown(); // BranchStrongMatchHelper.shutDown(); // BranchViewHandler.shutDown(); // DeepLinkRoutingValidator.shutDown(); // InstallListener...
[ "static", "void", "shutDown", "(", ")", "{", "ServerRequestQueue", ".", "shutDown", "(", ")", ";", "PrefHelper", ".", "shutDown", "(", ")", ";", "BranchUtil", ".", "shutDown", "(", ")", ";", "DeviceInfo", ".", "shutDown", "(", ")", ";", "// BranchStrongMat...
For Unit Testing, we need to reset the Branch state
[ "For", "Unit", "Testing", "we", "need", "to", "reset", "the", "Branch", "state" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L802-L835
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/Branch.java
Branch.getSessionReferredLink
String getSessionReferredLink() { String link = prefHelper_.getExternalIntentUri(); return (link.equals(PrefHelper.NO_STRING_VALUE) ? null : link); }
java
String getSessionReferredLink() { String link = prefHelper_.getExternalIntentUri(); return (link.equals(PrefHelper.NO_STRING_VALUE) ? null : link); }
[ "String", "getSessionReferredLink", "(", ")", "{", "String", "link", "=", "prefHelper_", ".", "getExternalIntentUri", "(", ")", ";", "return", "(", "link", ".", "equals", "(", "PrefHelper", ".", "NO_STRING_VALUE", ")", "?", "null", ":", "link", ")", ";", "...
Package Private. @return the link which opened this application session if opened by a link click.
[ "Package", "Private", "." ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L1667-L1670
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/Branch.java
Branch.appendDebugParams
private JSONObject appendDebugParams(JSONObject originalParams) { try { if (originalParams != null && deeplinkDebugParams_ != null) { if (deeplinkDebugParams_.length() > 0) { PrefHelper.Debug("You're currently in deep link debug mode. Please comment out 'setDeepLi...
java
private JSONObject appendDebugParams(JSONObject originalParams) { try { if (originalParams != null && deeplinkDebugParams_ != null) { if (deeplinkDebugParams_.length() > 0) { PrefHelper.Debug("You're currently in deep link debug mode. Please comment out 'setDeepLi...
[ "private", "JSONObject", "appendDebugParams", "(", "JSONObject", "originalParams", ")", "{", "try", "{", "if", "(", "originalParams", "!=", "null", "&&", "deeplinkDebugParams_", "!=", "null", ")", "{", "if", "(", "deeplinkDebugParams_", ".", "length", "(", ")", ...
Append the deep link debug params to the original params @param originalParams A {@link JSONObject} original referrer parameters @return A new {@link JSONObject} with debug params appended.
[ "Append", "the", "deep", "link", "debug", "params", "to", "the", "original", "params" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L2163-L2178
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/Branch.java
Branch.registerAppInit
private void registerAppInit(BranchReferralInitListener callback, ServerRequest.PROCESS_WAIT_LOCK lock) { ServerRequest request = getInstallOrOpenRequest(callback); request.addProcessWaitLock(lock); if (isGAParamsFetchInProgress_) { request.ad...
java
private void registerAppInit(BranchReferralInitListener callback, ServerRequest.PROCESS_WAIT_LOCK lock) { ServerRequest request = getInstallOrOpenRequest(callback); request.addProcessWaitLock(lock); if (isGAParamsFetchInProgress_) { request.ad...
[ "private", "void", "registerAppInit", "(", "BranchReferralInitListener", "callback", ",", "ServerRequest", ".", "PROCESS_WAIT_LOCK", "lock", ")", "{", "ServerRequest", "request", "=", "getInstallOrOpenRequest", "(", "callback", ")", ";", "request", ".", "addProcessWaitL...
Registers app init with params filtered from the intent. This will wait on the wait locks to complete any pending operations
[ "Registers", "app", "init", "with", "params", "filtered", "from", "the", "intent", ".", "This", "will", "wait", "on", "the", "wait", "locks", "to", "complete", "any", "pending", "operations" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/Branch.java#L2466-L2484
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ServerRequest.java
ServerRequest.addGetParam
protected void addGetParam(String paramKey, String paramValue) { try { params_.put(paramKey, paramValue); } catch (JSONException ignore) { } }
java
protected void addGetParam(String paramKey, String paramValue) { try { params_.put(paramKey, paramValue); } catch (JSONException ignore) { } }
[ "protected", "void", "addGetParam", "(", "String", "paramKey", ",", "String", "paramValue", ")", "{", "try", "{", "params_", ".", "put", "(", "paramKey", ",", "paramValue", ")", ";", "}", "catch", "(", "JSONException", "ignore", ")", "{", "}", "}" ]
Adds a param and its value to the get request @param paramKey A {@link String} value for the get param key @param paramValue A {@link String} value for the get param value
[ "Adds", "a", "param", "and", "its", "value", "to", "the", "get", "request" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerRequest.java#L266-L271
train
BranchMetrics/android-branch-deep-linking
Branch-SDK/src/io/branch/referral/ServerRequest.java
ServerRequest.updateGAdsParams
private void updateGAdsParams() { BRANCH_API_VERSION version = getBranchRemoteAPIVersion(); int LATVal = DeviceInfo.getInstance().getSystemObserver().getLATVal(); String gaid = DeviceInfo.getInstance().getSystemObserver().getGAID(); if (!TextUtils.isEmpty(gaid)) { try { ...
java
private void updateGAdsParams() { BRANCH_API_VERSION version = getBranchRemoteAPIVersion(); int LATVal = DeviceInfo.getInstance().getSystemObserver().getLATVal(); String gaid = DeviceInfo.getInstance().getSystemObserver().getGAID(); if (!TextUtils.isEmpty(gaid)) { try { ...
[ "private", "void", "updateGAdsParams", "(", ")", "{", "BRANCH_API_VERSION", "version", "=", "getBranchRemoteAPIVersion", "(", ")", ";", "int", "LATVal", "=", "DeviceInfo", ".", "getInstance", "(", ")", ".", "getSystemObserver", "(", ")", ".", "getLATVal", "(", ...
Updates the google ads parameters. This should be called only from a background thread since it involves GADS method invocation using reflection
[ "Updates", "the", "google", "ads", "parameters", ".", "This", "should", "be", "called", "only", "from", "a", "background", "thread", "since", "it", "involves", "GADS", "method", "invocation", "using", "reflection" ]
e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848
https://github.com/BranchMetrics/android-branch-deep-linking/blob/e3bee2ccfcbf6d4bf1a5815b5b86666e4ff8f848/Branch-SDK/src/io/branch/referral/ServerRequest.java#L369-L405
train
elastic/elasticsearch-river-twitter
src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java
TwitterRiver.getUsersListMembers
private long[] getUsersListMembers(String[] tUserlists) { logger.debug("Fetching user id of given lists"); List<Long> listUserIdToFollow = new ArrayList<Long>(); Configuration cb = buildTwitterConfiguration(); Twitter twitterImpl = new TwitterFactory(cb).getInstance(); //For eac...
java
private long[] getUsersListMembers(String[] tUserlists) { logger.debug("Fetching user id of given lists"); List<Long> listUserIdToFollow = new ArrayList<Long>(); Configuration cb = buildTwitterConfiguration(); Twitter twitterImpl = new TwitterFactory(cb).getInstance(); //For eac...
[ "private", "long", "[", "]", "getUsersListMembers", "(", "String", "[", "]", "tUserlists", ")", "{", "logger", ".", "debug", "(", "\"Fetching user id of given lists\"", ")", ";", "List", "<", "Long", ">", "listUserIdToFollow", "=", "new", "ArrayList", "<", "Lo...
Get users id of each list to stream them. @param tUserlists List of user list. Should be a public list. @return
[ "Get", "users", "id", "of", "each", "list", "to", "stream", "them", "." ]
877ba075aae0100cf05f39d86d0dad6475996489
https://github.com/elastic/elasticsearch-river-twitter/blob/877ba075aae0100cf05f39d86d0dad6475996489/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java#L354-L389
train
elastic/elasticsearch-river-twitter
src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java
TwitterRiver.buildTwitterConfiguration
private Configuration buildTwitterConfiguration() { logger.debug("creating twitter configuration"); ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setOAuthConsumerKey(oauthConsumerKey) .setOAuthConsumerSecret(oauthConsumerSecret) .setOAuthAccessToken(oa...
java
private Configuration buildTwitterConfiguration() { logger.debug("creating twitter configuration"); ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setOAuthConsumerKey(oauthConsumerKey) .setOAuthConsumerSecret(oauthConsumerSecret) .setOAuthAccessToken(oa...
[ "private", "Configuration", "buildTwitterConfiguration", "(", ")", "{", "logger", ".", "debug", "(", "\"creating twitter configuration\"", ")", ";", "ConfigurationBuilder", "cb", "=", "new", "ConfigurationBuilder", "(", ")", ";", "cb", ".", "setOAuthConsumerKey", "(",...
Build configuration object with credentials and proxy settings @return
[ "Build", "configuration", "object", "with", "credentials", "and", "proxy", "settings" ]
877ba075aae0100cf05f39d86d0dad6475996489
https://github.com/elastic/elasticsearch-river-twitter/blob/877ba075aae0100cf05f39d86d0dad6475996489/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java#L395-L411
train
elastic/elasticsearch-river-twitter
src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java
TwitterRiver.startTwitterStream
private void startTwitterStream() { logger.info("starting {} twitter stream", streamType); if (stream == null) { logger.debug("creating twitter stream"); stream = new TwitterStreamFactory(buildTwitterConfiguration()).getInstance(); if (streamType.equals("user")) { ...
java
private void startTwitterStream() { logger.info("starting {} twitter stream", streamType); if (stream == null) { logger.debug("creating twitter stream"); stream = new TwitterStreamFactory(buildTwitterConfiguration()).getInstance(); if (streamType.equals("user")) { ...
[ "private", "void", "startTwitterStream", "(", ")", "{", "logger", ".", "info", "(", "\"starting {} twitter stream\"", ",", "streamType", ")", ";", "if", "(", "stream", "==", "null", ")", "{", "logger", ".", "debug", "(", "\"creating twitter stream\"", ")", ";"...
Start twitter stream
[ "Start", "twitter", "stream" ]
877ba075aae0100cf05f39d86d0dad6475996489
https://github.com/elastic/elasticsearch-river-twitter/blob/877ba075aae0100cf05f39d86d0dad6475996489/src/main/java/org/elasticsearch/river/twitter/TwitterRiver.java#L416-L444
train
Netflix/Nicobar
nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java
CassandraArchiveRepository.insertArchive
@Override public void insertArchive(JarScriptArchive jarScriptArchive) throws IOException { Objects.requireNonNull(jarScriptArchive, "jarScriptArchive"); ScriptModuleSpec moduleSpec = jarScriptArchive.getModuleSpec(); ModuleId moduleId = moduleSpec.getModuleId(); Path jarFilePath; ...
java
@Override public void insertArchive(JarScriptArchive jarScriptArchive) throws IOException { Objects.requireNonNull(jarScriptArchive, "jarScriptArchive"); ScriptModuleSpec moduleSpec = jarScriptArchive.getModuleSpec(); ModuleId moduleId = moduleSpec.getModuleId(); Path jarFilePath; ...
[ "@", "Override", "public", "void", "insertArchive", "(", "JarScriptArchive", "jarScriptArchive", ")", "throws", "IOException", "{", "Objects", ".", "requireNonNull", "(", "jarScriptArchive", ",", "\"jarScriptArchive\"", ")", ";", "ScriptModuleSpec", "moduleSpec", "=", ...
insert a Jar into the script archive
[ "insert", "a", "Jar", "into", "the", "script", "archive" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java#L158-L188
train
Netflix/Nicobar
nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java
CassandraArchiveRepository.deleteArchive
@Override public void deleteArchive(ModuleId moduleId) throws IOException { Objects.requireNonNull(moduleId, "moduleId"); cassandra.deleteRow(moduleId.toString()); }
java
@Override public void deleteArchive(ModuleId moduleId) throws IOException { Objects.requireNonNull(moduleId, "moduleId"); cassandra.deleteRow(moduleId.toString()); }
[ "@", "Override", "public", "void", "deleteArchive", "(", "ModuleId", "moduleId", ")", "throws", "IOException", "{", "Objects", ".", "requireNonNull", "(", "moduleId", ",", "\"moduleId\"", ")", ";", "cassandra", ".", "deleteRow", "(", "moduleId", ".", "toString",...
Delete an archive by ID @param moduleId module id to delete @throws IOException
[ "Delete", "an", "archive", "by", "ID" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java#L265-L269
train
Netflix/Nicobar
nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java
CassandraArchiveRepository.getRows
protected Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception { int shardCount = config.getShardCount(); List<Future<Rows<String, String>>> futures = new ArrayList<Future<Rows<String, String>>>(); for (int i = 0; i < shardCount; i++) { futures.add(cassandra.se...
java
protected Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception { int shardCount = config.getShardCount(); List<Future<Rows<String, String>>> futures = new ArrayList<Future<Rows<String, String>>>(); for (int i = 0; i < shardCount; i++) { futures.add(cassandra.se...
[ "protected", "Iterable", "<", "Row", "<", "String", ",", "String", ">", ">", "getRows", "(", "EnumSet", "<", "?", ">", "columns", ")", "throws", "Exception", "{", "int", "shardCount", "=", "config", ".", "getShardCount", "(", ")", ";", "List", "<", "Fu...
Get all of the rows in in the table. Attempts to reduce the load on cassandra by splitting up the query into smaller sub-queries @param columns which columns to select @return result rows
[ "Get", "all", "of", "the", "rows", "in", "in", "the", "table", ".", "Attempts", "to", "reduce", "the", "load", "on", "cassandra", "by", "splitting", "up", "the", "query", "into", "smaller", "sub", "-", "queries" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-cassandra/src/main/java/com/netflix/nicobar/cassandra/CassandraArchiveRepository.java#L276-L291
train
Netflix/Nicobar
nicobar-groovy2/src/main/java/com/netflix/nicobar/groovy2/utils/Groovy2PluginUtils.java
Groovy2PluginUtils.getCompilerSpec
public static ScriptCompilerPluginSpec getCompilerSpec() { Path groovyRuntimePath = ClassPathUtils.findRootPathForResource("META-INF/groovy-release-info.properties", Groovy2PluginUtils.class.getClassLoader()); if (groovyRuntimePath == null) { throw new IllegalStateException("...
java
public static ScriptCompilerPluginSpec getCompilerSpec() { Path groovyRuntimePath = ClassPathUtils.findRootPathForResource("META-INF/groovy-release-info.properties", Groovy2PluginUtils.class.getClassLoader()); if (groovyRuntimePath == null) { throw new IllegalStateException("...
[ "public", "static", "ScriptCompilerPluginSpec", "getCompilerSpec", "(", ")", "{", "Path", "groovyRuntimePath", "=", "ClassPathUtils", ".", "findRootPathForResource", "(", "\"META-INF/groovy-release-info.properties\"", ",", "Groovy2PluginUtils", ".", "class", ".", "getClassLoa...
Helper method to orchestrate commonly required setup of nicobar-groovy2, and return a groovy2 compiler spec. @return a {@link ScriptCompilerPluginSpec} that is instantiated for the Groovy2 language, and is specified to depend on both the underyling groovy runtime, as well as nicobar-groov2.
[ "Helper", "method", "to", "orchestrate", "commonly", "required", "setup", "of", "nicobar", "-", "groovy2", "and", "return", "a", "groovy2", "compiler", "spec", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-groovy2/src/main/java/com/netflix/nicobar/groovy2/utils/Groovy2PluginUtils.java#L36-L58
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/persistence/JarArchiveRepository.java
JarArchiveRepository.getModuleJarPath
protected Path getModuleJarPath(ModuleId moduleId) { Path moduleJarPath = rootDir.resolve(moduleId + ".jar"); return moduleJarPath; }
java
protected Path getModuleJarPath(ModuleId moduleId) { Path moduleJarPath = rootDir.resolve(moduleId + ".jar"); return moduleJarPath; }
[ "protected", "Path", "getModuleJarPath", "(", "ModuleId", "moduleId", ")", "{", "Path", "moduleJarPath", "=", "rootDir", ".", "resolve", "(", "moduleId", "+", "\".jar\"", ")", ";", "return", "moduleJarPath", ";", "}" ]
Translated a module id to an absolute path of the module jar
[ "Translated", "a", "module", "id", "to", "an", "absolute", "path", "of", "the", "module", "jar" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/persistence/JarArchiveRepository.java#L221-L224
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.createModuleSpec
protected ModuleSpec createModuleSpec(ScriptArchive archive, ModuleIdentifier moduleId, Map<ModuleId, ModuleIdentifier> moduleIdMap, Path moduleCompilationRoot) throws ModuleLoadException { ScriptModuleSpec archiveSpec = archive.getModuleSpec(); // create the jboss mo...
java
protected ModuleSpec createModuleSpec(ScriptArchive archive, ModuleIdentifier moduleId, Map<ModuleId, ModuleIdentifier> moduleIdMap, Path moduleCompilationRoot) throws ModuleLoadException { ScriptModuleSpec archiveSpec = archive.getModuleSpec(); // create the jboss mo...
[ "protected", "ModuleSpec", "createModuleSpec", "(", "ScriptArchive", "archive", ",", "ModuleIdentifier", "moduleId", ",", "Map", "<", "ModuleId", ",", "ModuleIdentifier", ">", "moduleIdMap", ",", "Path", "moduleCompilationRoot", ")", "throws", "ModuleLoadException", "{"...
Create a JBoss module spec for an about to be created script module. @param archive the script archive being converted to a module. @param moduleId the JBoss module identifier. @param moduleIdMap a map of loaded script module IDs to jboss module identifiers @param moduleCompilationRoot a path to a directory that will h...
[ "Create", "a", "JBoss", "module", "spec", "for", "an", "about", "to", "be", "created", "script", "module", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L334-L359
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.compileModule
protected void compileModule(Module module, Path moduleCompilationRoot) throws ScriptCompilationException, IOException { // compile the script archive for the module, and inject the resultant classes into // the ModuleClassLoader ModuleClassLoader moduleClassLoader = module.getClassLoader(); ...
java
protected void compileModule(Module module, Path moduleCompilationRoot) throws ScriptCompilationException, IOException { // compile the script archive for the module, and inject the resultant classes into // the ModuleClassLoader ModuleClassLoader moduleClassLoader = module.getClassLoader(); ...
[ "protected", "void", "compileModule", "(", "Module", "module", ",", "Path", "moduleCompilationRoot", ")", "throws", "ScriptCompilationException", ",", "IOException", "{", "// compile the script archive for the module, and inject the resultant classes into", "// the ModuleClassLoader"...
Compiles and links the scripts within the module by locating the correct compiler and delegating the compilation. the classes will be loaded into the module's classloader upon completion. @param module module to be compiled @param moduleCompilationRoot the directory to store compiled classes in.
[ "Compiles", "and", "links", "the", "scripts", "within", "the", "module", "by", "locating", "the", "correct", "compiler", "and", "delegating", "the", "compilation", ".", "the", "classes", "will", "be", "loaded", "into", "the", "module", "s", "classloader", "upo...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L368-L385
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.addCompilerPlugin
public synchronized void addCompilerPlugin(ScriptCompilerPluginSpec pluginSpec) throws ModuleLoadException { Objects.requireNonNull(pluginSpec, "pluginSpec"); ModuleIdentifier pluginModuleId = JBossModuleUtils.getPluginModuleId(pluginSpec); ModuleSpec.Builder moduleSpecBuilder = ModuleSpec.buil...
java
public synchronized void addCompilerPlugin(ScriptCompilerPluginSpec pluginSpec) throws ModuleLoadException { Objects.requireNonNull(pluginSpec, "pluginSpec"); ModuleIdentifier pluginModuleId = JBossModuleUtils.getPluginModuleId(pluginSpec); ModuleSpec.Builder moduleSpecBuilder = ModuleSpec.buil...
[ "public", "synchronized", "void", "addCompilerPlugin", "(", "ScriptCompilerPluginSpec", "pluginSpec", ")", "throws", "ModuleLoadException", "{", "Objects", ".", "requireNonNull", "(", "pluginSpec", ",", "\"pluginSpec\"", ")", ";", "ModuleIdentifier", "pluginModuleId", "="...
Add a language plugin to this module @param pluginSpec @throws ModuleLoadException
[ "Add", "a", "language", "plugin", "to", "this", "module" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L392-L423
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.removeScriptModule
public synchronized void removeScriptModule(ModuleId scriptModuleId) { jbossModuleLoader.unloadAllModuleRevision(scriptModuleId.toString()); ScriptModule oldScriptModule = loadedScriptModules.remove(scriptModuleId); if (oldScriptModule != null) { notifyModuleUpdate(null, oldScriptMod...
java
public synchronized void removeScriptModule(ModuleId scriptModuleId) { jbossModuleLoader.unloadAllModuleRevision(scriptModuleId.toString()); ScriptModule oldScriptModule = loadedScriptModules.remove(scriptModuleId); if (oldScriptModule != null) { notifyModuleUpdate(null, oldScriptMod...
[ "public", "synchronized", "void", "removeScriptModule", "(", "ModuleId", "scriptModuleId", ")", "{", "jbossModuleLoader", ".", "unloadAllModuleRevision", "(", "scriptModuleId", ".", "toString", "(", ")", ")", ";", "ScriptModule", "oldScriptModule", "=", "loadedScriptMod...
Remove a module from being served by this instance. Note that any instances of the module cached outside of this module loader will remain un-effected and will continue to operate.
[ "Remove", "a", "module", "from", "being", "served", "by", "this", "instance", ".", "Note", "that", "any", "instances", "of", "the", "module", "cached", "outside", "of", "this", "module", "loader", "will", "remain", "un", "-", "effected", "and", "will", "co...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L430-L436
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.addListeners
public void addListeners(Set<ScriptModuleListener> listeners) { Objects.requireNonNull(listeners); this.listeners.addAll(listeners); }
java
public void addListeners(Set<ScriptModuleListener> listeners) { Objects.requireNonNull(listeners); this.listeners.addAll(listeners); }
[ "public", "void", "addListeners", "(", "Set", "<", "ScriptModuleListener", ">", "listeners", ")", "{", "Objects", ".", "requireNonNull", "(", "listeners", ")", ";", "this", ".", "listeners", ".", "addAll", "(", "listeners", ")", ";", "}" ]
Add listeners to this module loader. Listeners will only be notified of events that occurred after they were added. @param listeners listeners to add
[ "Add", "listeners", "to", "this", "module", "loader", ".", "Listeners", "will", "only", "be", "notified", "of", "events", "that", "occurred", "after", "they", "were", "added", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L466-L469
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java
ScriptModuleLoader.findCompilers
protected List<ScriptArchiveCompiler> findCompilers(ScriptArchive archive) { List<ScriptArchiveCompiler> candidateCompilers = new ArrayList<ScriptArchiveCompiler>(); for (ScriptArchiveCompiler compiler : compilers) { if (compiler.shouldCompile(archive)) { candidateCompilers.a...
java
protected List<ScriptArchiveCompiler> findCompilers(ScriptArchive archive) { List<ScriptArchiveCompiler> candidateCompilers = new ArrayList<ScriptArchiveCompiler>(); for (ScriptArchiveCompiler compiler : compilers) { if (compiler.shouldCompile(archive)) { candidateCompilers.a...
[ "protected", "List", "<", "ScriptArchiveCompiler", ">", "findCompilers", "(", "ScriptArchive", "archive", ")", "{", "List", "<", "ScriptArchiveCompiler", ">", "candidateCompilers", "=", "new", "ArrayList", "<", "ScriptArchiveCompiler", ">", "(", ")", ";", "for", "...
Select a set of compilers to compile this archive.
[ "Select", "a", "set", "of", "compilers", "to", "compile", "this", "archive", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleLoader.java#L474-L482
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java
ScriptModuleUtils.createModulePath
public static Path createModulePath(ModuleIdentifier moduleIdentifier){ return Paths.get(moduleIdentifier.getName() + "-" + moduleIdentifier.getSlot()); }
java
public static Path createModulePath(ModuleIdentifier moduleIdentifier){ return Paths.get(moduleIdentifier.getName() + "-" + moduleIdentifier.getSlot()); }
[ "public", "static", "Path", "createModulePath", "(", "ModuleIdentifier", "moduleIdentifier", ")", "{", "return", "Paths", ".", "get", "(", "moduleIdentifier", ".", "getName", "(", ")", "+", "\"-\"", "+", "moduleIdentifier", ".", "getSlot", "(", ")", ")", ";", ...
Create module path from module moduleIdentifier. @param moduleIdentifier module identifier to create path for @return path to module for given moduleIdentifier
[ "Create", "module", "path", "from", "module", "moduleIdentifier", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java#L57-L59
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java
ScriptModuleUtils.findAssignableClasses
public static Set<Class<?>> findAssignableClasses(ScriptModule module, Class<?> targetClass) { Set<Class<?>> result = new LinkedHashSet<Class<?>>(); for (Class<?> candidateClass : module.getLoadedClasses()) { if (targetClass.isAssignableFrom(candidateClass)) { result.add(cand...
java
public static Set<Class<?>> findAssignableClasses(ScriptModule module, Class<?> targetClass) { Set<Class<?>> result = new LinkedHashSet<Class<?>>(); for (Class<?> candidateClass : module.getLoadedClasses()) { if (targetClass.isAssignableFrom(candidateClass)) { result.add(cand...
[ "public", "static", "Set", "<", "Class", "<", "?", ">", ">", "findAssignableClasses", "(", "ScriptModule", "module", ",", "Class", "<", "?", ">", "targetClass", ")", "{", "Set", "<", "Class", "<", "?", ">", ">", "result", "=", "new", "LinkedHashSet", "...
Find all of the classes in the module that are subclasses or equal to the target class @param module module to search @param targetClass target type to search for @return first instance that matches the given type
[ "Find", "all", "of", "the", "classes", "in", "the", "module", "that", "are", "subclasses", "or", "equal", "to", "the", "target", "class" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java#L67-L75
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java
ScriptModuleUtils.findAssignableClass
@Nullable public static Class<?> findAssignableClass(ScriptModule module, Class<?> targetClass) { for (Class<?> candidateClass : module.getLoadedClasses()) { if (targetClass.isAssignableFrom(candidateClass)) { return candidateClass; } } return null; ...
java
@Nullable public static Class<?> findAssignableClass(ScriptModule module, Class<?> targetClass) { for (Class<?> candidateClass : module.getLoadedClasses()) { if (targetClass.isAssignableFrom(candidateClass)) { return candidateClass; } } return null; ...
[ "@", "Nullable", "public", "static", "Class", "<", "?", ">", "findAssignableClass", "(", "ScriptModule", "module", ",", "Class", "<", "?", ">", "targetClass", ")", "{", "for", "(", "Class", "<", "?", ">", "candidateClass", ":", "module", ".", "getLoadedCla...
Find the first class in the module that is a subclasses or equal to the target class @param module module to search @param targetClass target type to search for @return first instance that matches the given type
[ "Find", "the", "first", "class", "in", "the", "module", "that", "is", "a", "subclasses", "or", "equal", "to", "the", "target", "class" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java#L83-L91
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java
ScriptModuleUtils.findClass
@Nullable public static Class<?> findClass(ScriptModule module, String className) { Set<Class<?>> classes = module.getLoadedClasses(); Class<?> targetClass = null; for (Class<?> clazz : classes) { if (clazz.getName().equals(className)) { targetClass = clazz; ...
java
@Nullable public static Class<?> findClass(ScriptModule module, String className) { Set<Class<?>> classes = module.getLoadedClasses(); Class<?> targetClass = null; for (Class<?> clazz : classes) { if (clazz.getName().equals(className)) { targetClass = clazz; ...
[ "@", "Nullable", "public", "static", "Class", "<", "?", ">", "findClass", "(", "ScriptModule", "module", ",", "String", "className", ")", "{", "Set", "<", "Class", "<", "?", ">", ">", "classes", "=", "module", ".", "getLoadedClasses", "(", ")", ";", "C...
Find a class in the module that matches the given className @param module the script module to search @param className the class name in dotted form. @return the found class, or null.
[ "Find", "a", "class", "in", "the", "module", "that", "matches", "the", "given", "className" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/ScriptModuleUtils.java#L100-L112
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java
HystrixScriptModuleExecutor.executeModules
public List<V> executeModules(List<String> moduleIds, ScriptModuleExecutable<V> executable, ScriptModuleLoader moduleLoader) { Objects.requireNonNull(moduleIds, "moduleIds"); Objects.requireNonNull(executable, "executable"); Objects.requireNonNull(moduleLoader, "moduleLoader"); List<Scr...
java
public List<V> executeModules(List<String> moduleIds, ScriptModuleExecutable<V> executable, ScriptModuleLoader moduleLoader) { Objects.requireNonNull(moduleIds, "moduleIds"); Objects.requireNonNull(executable, "executable"); Objects.requireNonNull(moduleLoader, "moduleLoader"); List<Scr...
[ "public", "List", "<", "V", ">", "executeModules", "(", "List", "<", "String", ">", "moduleIds", ",", "ScriptModuleExecutable", "<", "V", ">", "executable", ",", "ScriptModuleLoader", "moduleLoader", ")", "{", "Objects", ".", "requireNonNull", "(", "moduleIds", ...
Execute a collection of ScriptModules identified by moduleId. @param moduleIds moduleIds for modules to execute @param executable execution logic to be performed for each module. @param moduleLoader loader which manages the modules. @return list of the outputs from the executable.
[ "Execute", "a", "collection", "of", "ScriptModules", "identified", "by", "moduleId", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java#L82-L95
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java
HystrixScriptModuleExecutor.executeModules
public List<V> executeModules(List<ScriptModule> modules, ScriptModuleExecutable<V> executable) { Objects.requireNonNull(modules, "modules"); Objects.requireNonNull(executable, "executable"); List<Future<V>> futureResults = new ArrayList<Future<V>>(modules.size()); for (ScriptModule mod...
java
public List<V> executeModules(List<ScriptModule> modules, ScriptModuleExecutable<V> executable) { Objects.requireNonNull(modules, "modules"); Objects.requireNonNull(executable, "executable"); List<Future<V>> futureResults = new ArrayList<Future<V>>(modules.size()); for (ScriptModule mod...
[ "public", "List", "<", "V", ">", "executeModules", "(", "List", "<", "ScriptModule", ">", "modules", ",", "ScriptModuleExecutable", "<", "V", ">", "executable", ")", "{", "Objects", ".", "requireNonNull", "(", "modules", ",", "\"modules\"", ")", ";", "Object...
Execute a collection of modules. @param modules modules to execute. @param executable execution logic to be performed for each module. @return list of the outputs from the executable.
[ "Execute", "a", "collection", "of", "modules", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java#L104-L133
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java
HystrixScriptModuleExecutor.getModuleStatistics
@Nullable public ExecutionStatistics getModuleStatistics(ModuleId moduleId) { ExecutionStatistics moduleStats = statistics.get(moduleId); return moduleStats; }
java
@Nullable public ExecutionStatistics getModuleStatistics(ModuleId moduleId) { ExecutionStatistics moduleStats = statistics.get(moduleId); return moduleStats; }
[ "@", "Nullable", "public", "ExecutionStatistics", "getModuleStatistics", "(", "ModuleId", "moduleId", ")", "{", "ExecutionStatistics", "moduleStats", "=", "statistics", ".", "get", "(", "moduleId", ")", ";", "return", "moduleStats", ";", "}" ]
Get the statistics for the given moduleId
[ "Get", "the", "statistics", "for", "the", "given", "moduleId" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java#L138-L142
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java
HystrixScriptModuleExecutor.getOrCreateModuleStatistics
protected ExecutionStatistics getOrCreateModuleStatistics(ModuleId moduleId) { ExecutionStatistics moduleStats = statistics.get(moduleId); if (moduleStats == null) { moduleStats = new ExecutionStatistics(); ExecutionStatistics existing = statistics.put(moduleId, moduleStats); ...
java
protected ExecutionStatistics getOrCreateModuleStatistics(ModuleId moduleId) { ExecutionStatistics moduleStats = statistics.get(moduleId); if (moduleStats == null) { moduleStats = new ExecutionStatistics(); ExecutionStatistics existing = statistics.put(moduleId, moduleStats); ...
[ "protected", "ExecutionStatistics", "getOrCreateModuleStatistics", "(", "ModuleId", "moduleId", ")", "{", "ExecutionStatistics", "moduleStats", "=", "statistics", ".", "get", "(", "moduleId", ")", ";", "if", "(", "moduleStats", "==", "null", ")", "{", "moduleStats",...
Helper method to get or create a ExecutionStatistics instance @param moduleId @return new or existing module statistics
[ "Helper", "method", "to", "get", "or", "create", "a", "ExecutionStatistics", "instance" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/execution/HystrixScriptModuleExecutor.java#L149-L159
train
Netflix/Nicobar
nicobar-manager/src/main/java/com/netflix/nicobar/manager/explorer/resources/ArchiveRepositoriesResource.java
ArchiveRepositoriesResource.getRepositorySummaries
@GET @Path("/repositorysummaries") public List<RepositorySummary> getRepositorySummaries() { List<RepositorySummary> result = new ArrayList<RepositorySummary>(repositories.size()); for (String repositoryId : repositories.keySet()) { RepositorySummary repositorySummary = getScriptRepo...
java
@GET @Path("/repositorysummaries") public List<RepositorySummary> getRepositorySummaries() { List<RepositorySummary> result = new ArrayList<RepositorySummary>(repositories.size()); for (String repositoryId : repositories.keySet()) { RepositorySummary repositorySummary = getScriptRepo...
[ "@", "GET", "@", "Path", "(", "\"/repositorysummaries\"", ")", "public", "List", "<", "RepositorySummary", ">", "getRepositorySummaries", "(", ")", "{", "List", "<", "RepositorySummary", ">", "result", "=", "new", "ArrayList", "<", "RepositorySummary", ">", "(",...
Get a list of all of the repository summaries
[ "Get", "a", "list", "of", "all", "of", "the", "repository", "summaries" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-manager/src/main/java/com/netflix/nicobar/manager/explorer/resources/ArchiveRepositoriesResource.java#L75-L84
train
Netflix/Nicobar
nicobar-manager/src/main/java/com/netflix/nicobar/manager/explorer/resources/ArchiveRepositoriesResource.java
ArchiveRepositoriesResource.getArchiveSummaries
@GET @Path("/archivesummaries") public Map<String, List<ArchiveSummary>> getArchiveSummaries(@QueryParam("repositoryIds") Set<String> repositoryIds) { if (CollectionUtils.isEmpty(repositoryIds)) { repositoryIds = repositories.keySet(); } Map<String, List<ArchiveSummary>> resu...
java
@GET @Path("/archivesummaries") public Map<String, List<ArchiveSummary>> getArchiveSummaries(@QueryParam("repositoryIds") Set<String> repositoryIds) { if (CollectionUtils.isEmpty(repositoryIds)) { repositoryIds = repositories.keySet(); } Map<String, List<ArchiveSummary>> resu...
[ "@", "GET", "@", "Path", "(", "\"/archivesummaries\"", ")", "public", "Map", "<", "String", ",", "List", "<", "ArchiveSummary", ">", ">", "getArchiveSummaries", "(", "@", "QueryParam", "(", "\"repositoryIds\"", ")", "Set", "<", "String", ">", "repositoryIds", ...
Get a map of summaries from different repositories. @param repositoryIds ids for repositories to query. if empty, then all repositories will be queried. @return map of repository id to list of summaries in the respective repository
[ "Get", "a", "map", "of", "summaries", "from", "different", "repositories", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-manager/src/main/java/com/netflix/nicobar/manager/explorer/resources/ArchiveRepositoriesResource.java#L91-L103
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.swapVertices
public static <V> void swapVertices(DirectedGraph<V, DefaultEdge> graph, Map<V, Set<V>> alternates) { Objects.requireNonNull(graph,"graph"); Objects.requireNonNull(alternates, "alternates"); // add all of the new vertices to prep for linking addAllVertices(graph, alternates.keySet()); ...
java
public static <V> void swapVertices(DirectedGraph<V, DefaultEdge> graph, Map<V, Set<V>> alternates) { Objects.requireNonNull(graph,"graph"); Objects.requireNonNull(alternates, "alternates"); // add all of the new vertices to prep for linking addAllVertices(graph, alternates.keySet()); ...
[ "public", "static", "<", "V", ">", "void", "swapVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ",", "Map", "<", "V", ",", "Set", "<", "V", ">", ">", "alternates", ")", "{", "Objects", ".", "requireNonNull", "(", "graph", ...
replace the vertices in the graph with an alternate set of vertices. @param graph graph to be mutated @param alternates alternate vertices to insert into the graph. map of vertices to their direct dependents.
[ "replace", "the", "vertices", "in", "the", "graph", "with", "an", "alternate", "set", "of", "vertices", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L43-L71
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.addAllVertices
public static <V> void addAllVertices(DirectedGraph<V, DefaultEdge> graph, Set<V> vertices) { // add all of the new vertices to prep for linking for (V vertex : vertices) { graph.addVertex(vertex); } }
java
public static <V> void addAllVertices(DirectedGraph<V, DefaultEdge> graph, Set<V> vertices) { // add all of the new vertices to prep for linking for (V vertex : vertices) { graph.addVertex(vertex); } }
[ "public", "static", "<", "V", ">", "void", "addAllVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ",", "Set", "<", "V", ">", "vertices", ")", "{", "// add all of the new vertices to prep for linking", "for", "(", "V", "vertex", ":"...
Add all of the vertices to the graph without any edges. If the the graph already contains any one of the vertices, that vertex is not added. @param graph graph to be mutated @param vertices vertices to add
[ "Add", "all", "of", "the", "vertices", "to", "the", "graph", "without", "any", "edges", ".", "If", "the", "the", "graph", "already", "contains", "any", "one", "of", "the", "vertices", "that", "vertex", "is", "not", "added", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L79-L84
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.getIncomingVertices
public static <V> Set<V> getIncomingVertices(DirectedGraph<V, DefaultEdge> graph, V target) { Set<DefaultEdge> edges = graph.incomingEdgesOf(target); Set<V> sources = new LinkedHashSet<V>(); for (DefaultEdge edge : edges) { sources.add(graph.getEdgeSource(edge)); } re...
java
public static <V> Set<V> getIncomingVertices(DirectedGraph<V, DefaultEdge> graph, V target) { Set<DefaultEdge> edges = graph.incomingEdgesOf(target); Set<V> sources = new LinkedHashSet<V>(); for (DefaultEdge edge : edges) { sources.add(graph.getEdgeSource(edge)); } re...
[ "public", "static", "<", "V", ">", "Set", "<", "V", ">", "getIncomingVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ",", "V", "target", ")", "{", "Set", "<", "DefaultEdge", ">", "edges", "=", "graph", ".", "incomingEdgesOf",...
Fetch all of the dependents of the given target vertex @return mutable snapshot of the source vertices of all incoming edges
[ "Fetch", "all", "of", "the", "dependents", "of", "the", "given", "target", "vertex" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L128-L135
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.getOutgoingVertices
public static <V> Set<V> getOutgoingVertices(DirectedGraph<V, DefaultEdge> graph, V source) { Set<DefaultEdge> edges = graph.outgoingEdgesOf(source); Set<V> targets = new LinkedHashSet<V>(); for (DefaultEdge edge : edges) { targets.add(graph.getEdgeTarget(edge)); } re...
java
public static <V> Set<V> getOutgoingVertices(DirectedGraph<V, DefaultEdge> graph, V source) { Set<DefaultEdge> edges = graph.outgoingEdgesOf(source); Set<V> targets = new LinkedHashSet<V>(); for (DefaultEdge edge : edges) { targets.add(graph.getEdgeTarget(edge)); } re...
[ "public", "static", "<", "V", ">", "Set", "<", "V", ">", "getOutgoingVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ",", "V", "source", ")", "{", "Set", "<", "DefaultEdge", ">", "edges", "=", "graph", ".", "outgoingEdgesOf",...
Fetch all of the dependencies of the given source vertex @return mutable snapshot of the target vertices of all outgoing edges
[ "Fetch", "all", "of", "the", "dependencies", "of", "the", "given", "source", "vertex" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L141-L148
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.copyGraph
public static <V> void copyGraph(DirectedGraph<V, DefaultEdge> sourceGraph, DirectedGraph<V, DefaultEdge> targetGraph) { addAllVertices(targetGraph, sourceGraph.vertexSet()); for (DefaultEdge edge : sourceGraph.edgeSet()) { targetGraph.addEdge(sourceGraph.getEdgeSource(edge), sourceGraph.get...
java
public static <V> void copyGraph(DirectedGraph<V, DefaultEdge> sourceGraph, DirectedGraph<V, DefaultEdge> targetGraph) { addAllVertices(targetGraph, sourceGraph.vertexSet()); for (DefaultEdge edge : sourceGraph.edgeSet()) { targetGraph.addEdge(sourceGraph.getEdgeSource(edge), sourceGraph.get...
[ "public", "static", "<", "V", ">", "void", "copyGraph", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "sourceGraph", ",", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "targetGraph", ")", "{", "addAllVertices", "(", "targetGraph", ",", "sour...
Copy the source graph into the target graph
[ "Copy", "the", "source", "graph", "into", "the", "target", "graph" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L153-L158
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.getLeafVertices
public static <V> Set<V> getLeafVertices(DirectedGraph<V, DefaultEdge> graph) { Set<V> vertexSet = graph.vertexSet(); Set<V> leaves = new HashSet<V>(vertexSet.size()*2); for (V vertex : vertexSet) { if (graph.outgoingEdgesOf(vertex).isEmpty()) { leaves.add(vertex); ...
java
public static <V> Set<V> getLeafVertices(DirectedGraph<V, DefaultEdge> graph) { Set<V> vertexSet = graph.vertexSet(); Set<V> leaves = new HashSet<V>(vertexSet.size()*2); for (V vertex : vertexSet) { if (graph.outgoingEdgesOf(vertex).isEmpty()) { leaves.add(vertex); ...
[ "public", "static", "<", "V", ">", "Set", "<", "V", ">", "getLeafVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ")", "{", "Set", "<", "V", ">", "vertexSet", "=", "graph", ".", "vertexSet", "(", ")", ";", "Set", "<", "V...
Find the leave vertices in the graph. I.E. Vertices that have no outgoing edges @param graph graph to search @return mutable snapshot of all leaf vertices.
[ "Find", "the", "leave", "vertices", "in", "the", "graph", ".", "I", ".", "E", ".", "Vertices", "that", "have", "no", "outgoing", "edges" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L165-L174
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java
GraphUtils.removeVertices
public static <V> void removeVertices(DirectedGraph<V, DefaultEdge> graph, Set<V> vertices) { for (V vertex : vertices) { if (graph.containsVertex(vertex)) { graph.removeVertex(vertex); } } }
java
public static <V> void removeVertices(DirectedGraph<V, DefaultEdge> graph, Set<V> vertices) { for (V vertex : vertices) { if (graph.containsVertex(vertex)) { graph.removeVertex(vertex); } } }
[ "public", "static", "<", "V", ">", "void", "removeVertices", "(", "DirectedGraph", "<", "V", ",", "DefaultEdge", ">", "graph", ",", "Set", "<", "V", ">", "vertices", ")", "{", "for", "(", "V", "vertex", ":", "vertices", ")", "{", "if", "(", "graph", ...
Removes vertices from graph @param graph raph to mutate @param vertices vertices to remove
[ "Removes", "vertices", "from", "graph" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/GraphUtils.java#L181-L187
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.findRootPathForResource
@Nullable public static Path findRootPathForResource(String resourceName, ClassLoader classLoader) { Objects.requireNonNull(resourceName, "resourceName"); Objects.requireNonNull(classLoader, "classLoader"); URL resource = classLoader.getResource(resourceName); if (resource != null)...
java
@Nullable public static Path findRootPathForResource(String resourceName, ClassLoader classLoader) { Objects.requireNonNull(resourceName, "resourceName"); Objects.requireNonNull(classLoader, "classLoader"); URL resource = classLoader.getResource(resourceName); if (resource != null)...
[ "@", "Nullable", "public", "static", "Path", "findRootPathForResource", "(", "String", "resourceName", ",", "ClassLoader", "classLoader", ")", "{", "Objects", ".", "requireNonNull", "(", "resourceName", ",", "\"resourceName\"", ")", ";", "Objects", ".", "requireNonN...
Find the root path for the given resource. If the resource is found in a Jar file, then the result will be an absolute path to the jar file. If the resource is found in a directory, then the result will be the parent path of the given resource. For example, if the resourceName is given as "scripts/myscript.groovy", an...
[ "Find", "the", "root", "path", "for", "the", "given", "resource", ".", "If", "the", "resource", "is", "found", "in", "a", "Jar", "file", "then", "the", "result", "will", "be", "an", "absolute", "path", "to", "the", "jar", "file", ".", "If", "the", "r...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L66-L83
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.findRootPathForClass
@Nullable public static Path findRootPathForClass(Class<?> clazz) { Objects.requireNonNull(clazz, "resourceName"); String resourceName = classToResourceName(clazz); return findRootPathForResource(resourceName, clazz.getClassLoader()); }
java
@Nullable public static Path findRootPathForClass(Class<?> clazz) { Objects.requireNonNull(clazz, "resourceName"); String resourceName = classToResourceName(clazz); return findRootPathForResource(resourceName, clazz.getClassLoader()); }
[ "@", "Nullable", "public", "static", "Path", "findRootPathForClass", "(", "Class", "<", "?", ">", "clazz", ")", "{", "Objects", ".", "requireNonNull", "(", "clazz", ",", "\"resourceName\"", ")", ";", "String", "resourceName", "=", "classToResourceName", "(", "...
Find the root path for the given class. If the class is found in a Jar file, then the result will be an absolute path to the jar file. If the resource is found in a directory, then the result will be the parent path of the given resource. @param clazz class to search for @return absolute path of the root of the resour...
[ "Find", "the", "root", "path", "for", "the", "given", "class", ".", "If", "the", "class", "is", "found", "in", "a", "Jar", "file", "then", "the", "result", "will", "be", "an", "absolute", "path", "to", "the", "jar", "file", ".", "If", "the", "resourc...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L107-L112
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.getJarPathFromUrl
public static Path getJarPathFromUrl(URL jarUrl) { try { String pathString = jarUrl.getPath(); // for Jar URL, the path is in the form of: file:/path/to/groovy/myJar.jar!/path/to/resource/myResource.txt int endIndex = pathString.lastIndexOf("!"); return Paths.get(...
java
public static Path getJarPathFromUrl(URL jarUrl) { try { String pathString = jarUrl.getPath(); // for Jar URL, the path is in the form of: file:/path/to/groovy/myJar.jar!/path/to/resource/myResource.txt int endIndex = pathString.lastIndexOf("!"); return Paths.get(...
[ "public", "static", "Path", "getJarPathFromUrl", "(", "URL", "jarUrl", ")", "{", "try", "{", "String", "pathString", "=", "jarUrl", ".", "getPath", "(", ")", ";", "// for Jar URL, the path is in the form of: file:/path/to/groovy/myJar.jar!/path/to/resource/myResource.txt", ...
Find the jar containing the given resource. @param jarUrl URL that came from a jar that needs to be parsed @return {@link Path} to the Jar containing the resource.
[ "Find", "the", "jar", "containing", "the", "given", "resource", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L120-L129
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.scanClassPath
public static Set<String> scanClassPath(final String classPath, final Set<String> excludeJarSet) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.processClassPathItem(classPath, excludeJarSet, pathSet); return pathS...
java
public static Set<String> scanClassPath(final String classPath, final Set<String> excludeJarSet) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.processClassPathItem(classPath, excludeJarSet, pathSet); return pathS...
[ "public", "static", "Set", "<", "String", ">", "scanClassPath", "(", "final", "String", "classPath", ",", "final", "Set", "<", "String", ">", "excludeJarSet", ")", "{", "final", "Set", "<", "String", ">", "pathSet", "=", "new", "HashSet", "<", "String", ...
Scan the classpath string provided, and collect a set of package paths found in jars and classes on the path. @param classPath the classpath string @param excludeJarSet a set of jars to exclude from scanning @return the results of the scan, as a set of package paths (separated by '/').
[ "Scan", "the", "classpath", "string", "provided", "and", "collect", "a", "set", "of", "package", "paths", "found", "in", "jars", "and", "classes", "on", "the", "path", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L181-L186
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.scanClassPath
public static Set<String> scanClassPath(final String classPath, final Set<String> excludeJarSet, final Set<String> excludePrefixes, final Set<String> includePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.process...
java
public static Set<String> scanClassPath(final String classPath, final Set<String> excludeJarSet, final Set<String> excludePrefixes, final Set<String> includePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.process...
[ "public", "static", "Set", "<", "String", ">", "scanClassPath", "(", "final", "String", "classPath", ",", "final", "Set", "<", "String", ">", "excludeJarSet", ",", "final", "Set", "<", "String", ">", "excludePrefixes", ",", "final", "Set", "<", "String", "...
Scan the classpath string provided, and collect a set of package paths found in jars and classes on the path. On the resulting path set, first exclude those that match any exclude prefixes, and then include those that match a set of include prefixes. @param classPath the classpath string @param excludeJarSet a set of ...
[ "Scan", "the", "classpath", "string", "provided", "and", "collect", "a", "set", "of", "package", "paths", "found", "in", "jars", "and", "classes", "on", "the", "path", ".", "On", "the", "resulting", "path", "set", "first", "exclude", "those", "that", "matc...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L199-L205
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.scanClassPathWithExcludes
public static Set<String> scanClassPathWithExcludes(final String classPath, final Set<String> excludeJarSet, final Set<String> excludePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.processClassPathItem(classPath...
java
public static Set<String> scanClassPathWithExcludes(final String classPath, final Set<String> excludeJarSet, final Set<String> excludePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.processClassPathItem(classPath...
[ "public", "static", "Set", "<", "String", ">", "scanClassPathWithExcludes", "(", "final", "String", "classPath", ",", "final", "Set", "<", "String", ">", "excludeJarSet", ",", "final", "Set", "<", "String", ">", "excludePrefixes", ")", "{", "final", "Set", "...
Scan the classpath string provided, and collect a set of package paths found in jars and classes on the path, excluding any that match a set of exclude prefixes. @param classPath the classpath string @param excludeJarSet a set of jars to exclude from scanning @param excludePrefixes a set of path prefixes that determin...
[ "Scan", "the", "classpath", "string", "provided", "and", "collect", "a", "set", "of", "package", "paths", "found", "in", "jars", "and", "classes", "on", "the", "path", "excluding", "any", "that", "match", "a", "set", "of", "exclude", "prefixes", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L216-L222
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java
ClassPathUtils.scanClassPathWithIncludes
public static Set<String> scanClassPathWithIncludes(final String classPath, final Set<String> excludeJarSet, final Set<String> includePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.processClassPathItem(classPath...
java
public static Set<String> scanClassPathWithIncludes(final String classPath, final Set<String> excludeJarSet, final Set<String> includePrefixes) { final Set<String> pathSet = new HashSet<String>(); // Defer to JDKPaths to do the actual classpath scanning. __JDKPaths.processClassPathItem(classPath...
[ "public", "static", "Set", "<", "String", ">", "scanClassPathWithIncludes", "(", "final", "String", "classPath", ",", "final", "Set", "<", "String", ">", "excludeJarSet", ",", "final", "Set", "<", "String", ">", "includePrefixes", ")", "{", "final", "Set", "...
Scan the classpath string provided, and collect a set of package paths found in jars and classes on the path, including only those that match a set of include prefixes. @param classPath the classpath string @param excludeJarSet a set of jars to exclude from scanning @param includePrefixes a set of path prefixes that d...
[ "Scan", "the", "classpath", "string", "provided", "and", "collect", "a", "set", "of", "package", "paths", "found", "in", "jars", "and", "classes", "on", "the", "path", "including", "only", "those", "that", "match", "a", "set", "of", "include", "prefixes", ...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/utils/ClassPathUtils.java#L233-L239
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleClassLoader.java
JBossModuleClassLoader.addClasses
public void addClasses(Set<Class<?>> classes) { for (Class<?> classToAdd: classes) { localClassCache.put(classToAdd.getName(), classToAdd); } }
java
public void addClasses(Set<Class<?>> classes) { for (Class<?> classToAdd: classes) { localClassCache.put(classToAdd.getName(), classToAdd); } }
[ "public", "void", "addClasses", "(", "Set", "<", "Class", "<", "?", ">", ">", "classes", ")", "{", "for", "(", "Class", "<", "?", ">", "classToAdd", ":", "classes", ")", "{", "localClassCache", ".", "put", "(", "classToAdd", ".", "getName", "(", ")",...
Manually add the compiled classes to this classloader. This method will not redefine the class, so that the class's classloader will continue to be compiler's classloader.
[ "Manually", "add", "the", "compiled", "classes", "to", "this", "classloader", ".", "This", "method", "will", "not", "redefine", "the", "class", "so", "that", "the", "class", "s", "classloader", "will", "continue", "to", "be", "compiler", "s", "classloader", ...
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleClassLoader.java#L81-L85
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleClassLoader.java
JBossModuleClassLoader.addClassBytes
public Class<?> addClassBytes(String name, byte[] classBytes) { Class<?> newClass = defineClass(name, classBytes, 0, classBytes.length); resolveClass(newClass); localClassCache.put(newClass.getName(), newClass); return newClass; }
java
public Class<?> addClassBytes(String name, byte[] classBytes) { Class<?> newClass = defineClass(name, classBytes, 0, classBytes.length); resolveClass(newClass); localClassCache.put(newClass.getName(), newClass); return newClass; }
[ "public", "Class", "<", "?", ">", "addClassBytes", "(", "String", "name", ",", "byte", "[", "]", "classBytes", ")", "{", "Class", "<", "?", ">", "newClass", "=", "defineClass", "(", "name", ",", "classBytes", ",", "0", ",", "classBytes", ".", "length",...
Manually add the compiled classes to this classloader. This method will define and resolve the class, binding this classloader to the class. @return the loaded class
[ "Manually", "add", "the", "compiled", "classes", "to", "this", "classloader", ".", "This", "method", "will", "define", "and", "resolve", "the", "class", "binding", "this", "classloader", "to", "the", "class", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleClassLoader.java#L92-L97
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/persistence/ArchiveRepositoryPoller.java
ArchiveRepositoryPoller.addRepository
public boolean addRepository(final ArchiveRepository archiveRepository, final int pollInterval, TimeUnit timeUnit, boolean waitForInitialPoll) { if (pollInterval <= 0) { throw new IllegalArgumentException("invalid pollInterval " + pollInterval); } Objects.requireNonNull(timeUnit, "ti...
java
public boolean addRepository(final ArchiveRepository archiveRepository, final int pollInterval, TimeUnit timeUnit, boolean waitForInitialPoll) { if (pollInterval <= 0) { throw new IllegalArgumentException("invalid pollInterval " + pollInterval); } Objects.requireNonNull(timeUnit, "ti...
[ "public", "boolean", "addRepository", "(", "final", "ArchiveRepository", "archiveRepository", ",", "final", "int", "pollInterval", ",", "TimeUnit", "timeUnit", ",", "boolean", "waitForInitialPoll", ")", "{", "if", "(", "pollInterval", "<=", "0", ")", "{", "throw",...
Add a repository and schedule polling @param archiveRepository repository to scan @param pollInterval how often this repository should be scanned @param timeUnit unit of the pollInterval param @param waitForInitialPoll whether or not to block until the initial poll is complete @return true if the repository was added. ...
[ "Add", "a", "repository", "and", "schedule", "polling" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/persistence/ArchiveRepositoryPoller.java#L118-L150
train
Netflix/Nicobar
nicobar-example/src/main/java/com/netflix/nicobar/example/groovy2/ExampleResourceLocator.java
ExampleResourceLocator.getGroovyRuntime
public static Path getGroovyRuntime() { Path path = ClassPathUtils.findRootPathForResource("META-INF/groovy-release-info.properties", ExampleResourceLocator.class.getClassLoader()); if (path == null) { throw new IllegalStateException("couldn't find groovy-all.n.n.n.jar in the classpath."); ...
java
public static Path getGroovyRuntime() { Path path = ClassPathUtils.findRootPathForResource("META-INF/groovy-release-info.properties", ExampleResourceLocator.class.getClassLoader()); if (path == null) { throw new IllegalStateException("couldn't find groovy-all.n.n.n.jar in the classpath."); ...
[ "public", "static", "Path", "getGroovyRuntime", "(", ")", "{", "Path", "path", "=", "ClassPathUtils", ".", "findRootPathForResource", "(", "\"META-INF/groovy-release-info.properties\"", ",", "ExampleResourceLocator", ".", "class", ".", "getClassLoader", "(", ")", ")", ...
Locate the groovy-all-n.n.n.jar file on the classpath. The ScriptModuleLoader will attempt to load the scripting runtimes into their own classloaders. To accomplish this, the loader requires the actual file location of the groovy runtime jar. This method is an example of a strategy for locating the groovy jar file in ...
[ "Locate", "the", "groovy", "-", "all", "-", "n", ".", "n", ".", "n", ".", "jar", "file", "on", "the", "classpath", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-example/src/main/java/com/netflix/nicobar/example/groovy2/ExampleResourceLocator.java#L49-L55
train
Netflix/Nicobar
nicobar-example/src/main/java/com/netflix/nicobar/example/groovy2/ExampleResourceLocator.java
ExampleResourceLocator.getGroovyPluginLocation
public static Path getGroovyPluginLocation() { String resourceName = ClassPathUtils.classNameToResourceName(GROOVY2_COMPILER_PLUGIN_CLASS); Path path = ClassPathUtils.findRootPathForResource(resourceName, ExampleResourceLocator.class.getClassLoader()); if (path == null) { throw new I...
java
public static Path getGroovyPluginLocation() { String resourceName = ClassPathUtils.classNameToResourceName(GROOVY2_COMPILER_PLUGIN_CLASS); Path path = ClassPathUtils.findRootPathForResource(resourceName, ExampleResourceLocator.class.getClassLoader()); if (path == null) { throw new I...
[ "public", "static", "Path", "getGroovyPluginLocation", "(", ")", "{", "String", "resourceName", "=", "ClassPathUtils", ".", "classNameToResourceName", "(", "GROOVY2_COMPILER_PLUGIN_CLASS", ")", ";", "Path", "path", "=", "ClassPathUtils", ".", "findRootPathForResource", ...
Locate the classpath root which contains the groovy2 plugin. The ScriptModuleLoader will load the groovy2 plugin into the same classlaoder as the groovy runtime. To accomplish this, the loader requires the file location of the groovy2 plugin. This method is an example strategy for locating the plugin's jar file in a p...
[ "Locate", "the", "classpath", "root", "which", "contains", "the", "groovy2", "plugin", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-example/src/main/java/com/netflix/nicobar/example/groovy2/ExampleResourceLocator.java#L67-L74
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java
JBossModuleUtils.populateModuleSpecWithCoreDependencies
public static void populateModuleSpecWithCoreDependencies(ModuleSpec.Builder moduleSpecBuilder, ScriptArchive scriptArchive) throws ModuleLoadException { Objects.requireNonNull(moduleSpecBuilder, "moduleSpecBuilder"); Objects.requireNonNull(scriptArchive, "scriptArchive"); Set<String> compilerP...
java
public static void populateModuleSpecWithCoreDependencies(ModuleSpec.Builder moduleSpecBuilder, ScriptArchive scriptArchive) throws ModuleLoadException { Objects.requireNonNull(moduleSpecBuilder, "moduleSpecBuilder"); Objects.requireNonNull(scriptArchive, "scriptArchive"); Set<String> compilerP...
[ "public", "static", "void", "populateModuleSpecWithCoreDependencies", "(", "ModuleSpec", ".", "Builder", "moduleSpecBuilder", ",", "ScriptArchive", "scriptArchive", ")", "throws", "ModuleLoadException", "{", "Objects", ".", "requireNonNull", "(", "moduleSpecBuilder", ",", ...
Populates a module spec builder with core dependencies on JRE, Nicobar, itself, and compiler plugins. @param moduleSpecBuilder builder to populate @param scriptArchive {@link ScriptArchive} to copy from
[ "Populates", "a", "module", "spec", "builder", "with", "core", "dependencies", "on", "JRE", "Nicobar", "itself", "and", "compiler", "plugins", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java#L142-L154
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java
JBossModuleUtils.createRevisionId
public static ModuleIdentifier createRevisionId(ModuleId scriptModuleId, long revisionNumber) { Objects.requireNonNull(scriptModuleId, "scriptModuleId"); return ModuleIdentifier.create(scriptModuleId.toString(), Long.toString(revisionNumber)); }
java
public static ModuleIdentifier createRevisionId(ModuleId scriptModuleId, long revisionNumber) { Objects.requireNonNull(scriptModuleId, "scriptModuleId"); return ModuleIdentifier.create(scriptModuleId.toString(), Long.toString(revisionNumber)); }
[ "public", "static", "ModuleIdentifier", "createRevisionId", "(", "ModuleId", "scriptModuleId", ",", "long", "revisionNumber", ")", "{", "Objects", ".", "requireNonNull", "(", "scriptModuleId", ",", "\"scriptModuleId\"", ")", ";", "return", "ModuleIdentifier", ".", "cr...
Helper method to create a revisionId in a consistent manner
[ "Helper", "method", "to", "create", "a", "revisionId", "in", "a", "consistent", "manner" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java#L283-L286
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java
JBossModuleUtils.buildFilters
private static PathFilter buildFilters(Set<String> filterPaths, boolean failedMatchValue) { if (filterPaths == null) return PathFilters.acceptAll(); else if (filterPaths.isEmpty()) { return PathFilters.rejectAll(); } else { MultiplePathFilterBuilder builder = ...
java
private static PathFilter buildFilters(Set<String> filterPaths, boolean failedMatchValue) { if (filterPaths == null) return PathFilters.acceptAll(); else if (filterPaths.isEmpty()) { return PathFilters.rejectAll(); } else { MultiplePathFilterBuilder builder = ...
[ "private", "static", "PathFilter", "buildFilters", "(", "Set", "<", "String", ">", "filterPaths", ",", "boolean", "failedMatchValue", ")", "{", "if", "(", "filterPaths", "==", "null", ")", "return", "PathFilters", ".", "acceptAll", "(", ")", ";", "else", "if...
Build a PathFilter for a set of filter paths @param filterPaths the set of paths to filter on. Can be null to indicate that no filters should be applied (accept all), can be empty to indicate that everything should be filtered (reject all). @param failedMatchValue the value the PathFilter returns when a path does not ...
[ "Build", "a", "PathFilter", "for", "a", "set", "of", "filter", "paths" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleUtils.java#L297-L308
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java
JBossModuleLoader.unloadAllModuleRevision
public void unloadAllModuleRevision(String scriptModuleId) { for (ModuleIdentifier revisionId : getAllRevisionIds(scriptModuleId)) { if (revisionId.getName().equals(scriptModuleId)) { unloadModule(revisionId); } } }
java
public void unloadAllModuleRevision(String scriptModuleId) { for (ModuleIdentifier revisionId : getAllRevisionIds(scriptModuleId)) { if (revisionId.getName().equals(scriptModuleId)) { unloadModule(revisionId); } } }
[ "public", "void", "unloadAllModuleRevision", "(", "String", "scriptModuleId", ")", "{", "for", "(", "ModuleIdentifier", "revisionId", ":", "getAllRevisionIds", "(", "scriptModuleId", ")", ")", "{", "if", "(", "revisionId", ".", "getName", "(", ")", ".", "equals"...
Unload all module revisions with the give script module id
[ "Unload", "all", "module", "revisions", "with", "the", "give", "script", "module", "id" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java#L108-L114
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java
JBossModuleLoader.unloadModule
public void unloadModule(ModuleIdentifier revisionId) { Objects.requireNonNull(revisionId, "revisionId"); Module module = findLoadedModule(revisionId); if (module != null) { unloadModule(module); } }
java
public void unloadModule(ModuleIdentifier revisionId) { Objects.requireNonNull(revisionId, "revisionId"); Module module = findLoadedModule(revisionId); if (module != null) { unloadModule(module); } }
[ "public", "void", "unloadModule", "(", "ModuleIdentifier", "revisionId", ")", "{", "Objects", ".", "requireNonNull", "(", "revisionId", ",", "\"revisionId\"", ")", ";", "Module", "module", "=", "findLoadedModule", "(", "revisionId", ")", ";", "if", "(", "module"...
Unload the given revision of a module from the local repository. @param revisionId {@link ModuleIdentifier} of the revision to unload
[ "Unload", "the", "given", "revision", "of", "a", "module", "from", "the", "local", "repository", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java#L119-L125
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java
JBossModuleLoader.getAllRevisionIds
public Set<ModuleIdentifier> getAllRevisionIds(String scriptModuleId) { Objects.requireNonNull(scriptModuleId, "scriptModuleId"); Set<ModuleIdentifier> revisionIds = new LinkedHashSet<ModuleIdentifier>(); for (ModuleIdentifier revisionId : moduleSpecs.keySet()) { if (revisionId.getNa...
java
public Set<ModuleIdentifier> getAllRevisionIds(String scriptModuleId) { Objects.requireNonNull(scriptModuleId, "scriptModuleId"); Set<ModuleIdentifier> revisionIds = new LinkedHashSet<ModuleIdentifier>(); for (ModuleIdentifier revisionId : moduleSpecs.keySet()) { if (revisionId.getNa...
[ "public", "Set", "<", "ModuleIdentifier", ">", "getAllRevisionIds", "(", "String", "scriptModuleId", ")", "{", "Objects", ".", "requireNonNull", "(", "scriptModuleId", ",", "\"scriptModuleId\"", ")", ";", "Set", "<", "ModuleIdentifier", ">", "revisionIds", "=", "n...
Find all module revisionIds with a common name
[ "Find", "all", "module", "revisionIds", "with", "a", "common", "name" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java#L216-L225
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java
JBossModuleLoader.getModuleNameGraph
public DirectedGraph<ModuleId, DefaultEdge> getModuleNameGraph() { SimpleDirectedGraph<ModuleId, DefaultEdge> graph = new SimpleDirectedGraph<ModuleId, DefaultEdge>(DefaultEdge.class); Map<ModuleId, ModuleIdentifier> moduleIdentifiers = getLatestRevisionIds(); GraphUtils.addAllVertices(graph, mo...
java
public DirectedGraph<ModuleId, DefaultEdge> getModuleNameGraph() { SimpleDirectedGraph<ModuleId, DefaultEdge> graph = new SimpleDirectedGraph<ModuleId, DefaultEdge>(DefaultEdge.class); Map<ModuleId, ModuleIdentifier> moduleIdentifiers = getLatestRevisionIds(); GraphUtils.addAllVertices(graph, mo...
[ "public", "DirectedGraph", "<", "ModuleId", ",", "DefaultEdge", ">", "getModuleNameGraph", "(", ")", "{", "SimpleDirectedGraph", "<", "ModuleId", ",", "DefaultEdge", ">", "graph", "=", "new", "SimpleDirectedGraph", "<", "ModuleId", ",", "DefaultEdge", ">", "(", ...
Construct the Module dependency graph of a module loader where each vertex is the module name @return a mutable snapshot of the underlying dependency
[ "Construct", "the", "Module", "dependency", "graph", "of", "a", "module", "loader", "where", "each", "vertex", "is", "the", "module", "name" ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java#L260-L272
train
Netflix/Nicobar
nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java
JBossModuleLoader.getDependencyScriptModuleIds
public static Set<ModuleId> getDependencyScriptModuleIds(ModuleSpec moduleSpec) { Objects.requireNonNull(moduleSpec, "moduleSpec"); if (!(moduleSpec instanceof ConcreteModuleSpec)) { throw new IllegalArgumentException("Unsupported ModuleSpec implementation: " + moduleSpec.getClass().getName(...
java
public static Set<ModuleId> getDependencyScriptModuleIds(ModuleSpec moduleSpec) { Objects.requireNonNull(moduleSpec, "moduleSpec"); if (!(moduleSpec instanceof ConcreteModuleSpec)) { throw new IllegalArgumentException("Unsupported ModuleSpec implementation: " + moduleSpec.getClass().getName(...
[ "public", "static", "Set", "<", "ModuleId", ">", "getDependencyScriptModuleIds", "(", "ModuleSpec", "moduleSpec", ")", "{", "Objects", ".", "requireNonNull", "(", "moduleSpec", ",", "\"moduleSpec\"", ")", ";", "if", "(", "!", "(", "moduleSpec", "instanceof", "Co...
Extract the Module dependencies for the given module in the form of ScriptModule ids.
[ "Extract", "the", "Module", "dependencies", "for", "the", "given", "module", "in", "the", "form", "of", "ScriptModule", "ids", "." ]
507173dcae4a86a955afc3df222a855862fab8d7
https://github.com/Netflix/Nicobar/blob/507173dcae4a86a955afc3df222a855862fab8d7/nicobar-core/src/main/java/com/netflix/nicobar/core/module/jboss/JBossModuleLoader.java#L278-L292
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/Hex.java
Hex.encode
private static char[] encode(final byte[] data, final char[] toDigits) { final int l = data.length; final char[] out = new char[l << 1]; // two characters form the hex value. for (int i = 0, j = 0; i < l; i++) { out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; out[j++...
java
private static char[] encode(final byte[] data, final char[] toDigits) { final int l = data.length; final char[] out = new char[l << 1]; // two characters form the hex value. for (int i = 0, j = 0; i < l; i++) { out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; out[j++...
[ "private", "static", "char", "[", "]", "encode", "(", "final", "byte", "[", "]", "data", ",", "final", "char", "[", "]", "toDigits", ")", "{", "final", "int", "l", "=", "data", ".", "length", ";", "final", "char", "[", "]", "out", "=", "new", "ch...
Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order. The returned array will be double the length of the passed array, as it takes two characters to represent any given byte. @param data a byte[] to convert to Hex characters @param toDigits the output alphab...
[ "Converts", "an", "array", "of", "bytes", "into", "an", "array", "of", "characters", "representing", "the", "hexadecimal", "values", "of", "each", "byte", "in", "order", ".", "The", "returned", "array", "will", "be", "double", "the", "length", "of", "the", ...
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/Hex.java#L90-L99
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/AddTorrentParams.java
AddTorrentParams.trackers
public void trackers(List<String> value) { string_vector v = new string_vector(); for (String s : value) { v.push_back(s); } p.set_trackers(v); }
java
public void trackers(List<String> value) { string_vector v = new string_vector(); for (String s : value) { v.push_back(s); } p.set_trackers(v); }
[ "public", "void", "trackers", "(", "List", "<", "String", ">", "value", ")", "{", "string_vector", "v", "=", "new", "string_vector", "(", ")", ";", "for", "(", "String", "s", ":", "value", ")", "{", "v", ".", "push_back", "(", "s", ")", ";", "}", ...
If the torrent doesn't have a tracker, but relies on the DHT to find peers, this method can specify tracker URLs for the torrent. @param value the list of trackers
[ "If", "the", "torrent", "doesn", "t", "have", "a", "tracker", "but", "relies", "on", "the", "DHT", "to", "find", "peers", "this", "method", "can", "specify", "tracker", "URLs", "for", "the", "torrent", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/AddTorrentParams.java#L110-L118
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/AddTorrentParams.java
AddTorrentParams.parseMagnetUri
public static AddTorrentParams parseMagnetUri(String uri) { error_code ec = new error_code(); add_torrent_params params = add_torrent_params.parse_magnet_uri(uri, ec); if (ec.value() != 0) { throw new IllegalArgumentException("Invalid magnet uri: " + ec.message()); } ...
java
public static AddTorrentParams parseMagnetUri(String uri) { error_code ec = new error_code(); add_torrent_params params = add_torrent_params.parse_magnet_uri(uri, ec); if (ec.value() != 0) { throw new IllegalArgumentException("Invalid magnet uri: " + ec.message()); } ...
[ "public", "static", "AddTorrentParams", "parseMagnetUri", "(", "String", "uri", ")", "{", "error_code", "ec", "=", "new", "error_code", "(", ")", ";", "add_torrent_params", "params", "=", "add_torrent_params", ".", "parse_magnet_uri", "(", "uri", ",", "ec", ")",...
Helper function to parse a magnet uri and fill the parameters. @param uri the magnet uri @return the params object filled with the data from the magnet
[ "Helper", "function", "to", "parse", "a", "magnet", "uri", "and", "fill", "the", "parameters", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/AddTorrentParams.java#L525-L532
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/SessionManager.java
SessionManager.stop
public void stop() { if (session == null) { return; } sync.lock(); try { if (session == null) { return; } onBeforeStop(); session s = session; session = null; // stop alerts loop and session metho...
java
public void stop() { if (session == null) { return; } sync.lock(); try { if (session == null) { return; } onBeforeStop(); session s = session; session = null; // stop alerts loop and session metho...
[ "public", "void", "stop", "(", ")", "{", "if", "(", "session", "==", "null", ")", "{", "return", ";", "}", "sync", ".", "lock", "(", ")", ";", "try", "{", "if", "(", "session", "==", "null", ")", "{", "return", ";", "}", "onBeforeStop", "(", ")...
This method blocks during the destruction of the native session, it could take some time, don't call this from the UI thread or other sensitive multithreaded code.
[ "This", "method", "blocks", "during", "the", "destruction", "of", "the", "native", "session", "it", "could", "take", "some", "time", "don", "t", "call", "this", "from", "the", "UI", "thread", "or", "other", "sensitive", "multithreaded", "code", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionManager.java#L128-L171
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/SessionManager.java
SessionManager.restart
public void restart() { sync.lock(); try { stop(); Thread.sleep(1000); // allow some time to release native resources start(); } catch (InterruptedException e) { // ignore } finally { sync.unlock(); } }
java
public void restart() { sync.lock(); try { stop(); Thread.sleep(1000); // allow some time to release native resources start(); } catch (InterruptedException e) { // ignore } finally { sync.unlock(); } }
[ "public", "void", "restart", "(", ")", "{", "sync", ".", "lock", "(", ")", ";", "try", "{", "stop", "(", ")", ";", "Thread", ".", "sleep", "(", "1000", ")", ";", "// allow some time to release native resources", "start", "(", ")", ";", "}", "catch", "(...
This method blocks for at least a second plus the time needed to destroy the native session, don't call it from the UI thread.
[ "This", "method", "blocks", "for", "at", "least", "a", "second", "plus", "the", "time", "needed", "to", "destroy", "the", "native", "session", "don", "t", "call", "it", "from", "the", "UI", "thread", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionManager.java#L177-L191
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/SessionManager.java
SessionManager.download
public void download(String magnetUri, File saveDir) { if (session == null) { return; } error_code ec = new error_code(); add_torrent_params p = add_torrent_params.parse_magnet_uri(magnetUri, ec); if (ec.value() != 0) { throw new IllegalArgumentException...
java
public void download(String magnetUri, File saveDir) { if (session == null) { return; } error_code ec = new error_code(); add_torrent_params p = add_torrent_params.parse_magnet_uri(magnetUri, ec); if (ec.value() != 0) { throw new IllegalArgumentException...
[ "public", "void", "download", "(", "String", "magnetUri", ",", "File", "saveDir", ")", "{", "if", "(", "session", "==", "null", ")", "{", "return", ";", "}", "error_code", "ec", "=", "new", "error_code", "(", ")", ";", "add_torrent_params", "p", "=", "...
Downloads a magnet uri. @param magnetUri the magnet uri to download @param saveDir the path to save the downloaded files
[ "Downloads", "a", "magnet", "uri", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionManager.java#L526-L558
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/alerts/DhtGetPeersReplyAlert.java
DhtGetPeersReplyAlert.peers
public ArrayList<TcpEndpoint> peers() { tcp_endpoint_vector v = alert.peers(); int size = (int) v.size(); ArrayList<TcpEndpoint> peers = new ArrayList<>(size); for (int i = 0; i < size; i++) { tcp_endpoint endp = v.get(i); String ip = new Address(endp.address())....
java
public ArrayList<TcpEndpoint> peers() { tcp_endpoint_vector v = alert.peers(); int size = (int) v.size(); ArrayList<TcpEndpoint> peers = new ArrayList<>(size); for (int i = 0; i < size; i++) { tcp_endpoint endp = v.get(i); String ip = new Address(endp.address())....
[ "public", "ArrayList", "<", "TcpEndpoint", ">", "peers", "(", ")", "{", "tcp_endpoint_vector", "v", "=", "alert", ".", "peers", "(", ")", ";", "int", "size", "=", "(", "int", ")", "v", ".", "size", "(", ")", ";", "ArrayList", "<", "TcpEndpoint", ">",...
This method creates a new list each time is called. @return the list of peers
[ "This", "method", "creates", "a", "new", "list", "each", "time", "is", "called", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/alerts/DhtGetPeersReplyAlert.java#L41-L53
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/WebSeedEntry.java
WebSeedEntry.extraHeaders
public ArrayList<Pair<String, String>> extraHeaders() { string_string_pair_vector v = e.getExtra_headers(); int size = (int) v.size(); ArrayList<Pair<String, String>> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { string_string_pair p = v.get(i); l.a...
java
public ArrayList<Pair<String, String>> extraHeaders() { string_string_pair_vector v = e.getExtra_headers(); int size = (int) v.size(); ArrayList<Pair<String, String>> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { string_string_pair p = v.get(i); l.a...
[ "public", "ArrayList", "<", "Pair", "<", "String", ",", "String", ">", ">", "extraHeaders", "(", ")", "{", "string_string_pair_vector", "v", "=", "e", ".", "getExtra_headers", "(", ")", ";", "int", "size", "=", "(", "int", ")", "v", ".", "size", "(", ...
Any extra HTTP headers that need to be passed to the web seed. @return
[ "Any", "extra", "HTTP", "headers", "that", "need", "to", "be", "passed", "to", "the", "web", "seed", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/WebSeedEntry.java#L54-L65
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/SessionStats.java
SessionStats.tick
private void tick(long tickIntervalMs) { for (int i = 0; i < NUM_AVERAGES; ++i) { stat[i].tick(tickIntervalMs); } }
java
private void tick(long tickIntervalMs) { for (int i = 0; i < NUM_AVERAGES; ++i) { stat[i].tick(tickIntervalMs); } }
[ "private", "void", "tick", "(", "long", "tickIntervalMs", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "NUM_AVERAGES", ";", "++", "i", ")", "{", "stat", "[", "i", "]", ".", "tick", "(", "tickIntervalMs", ")", ";", "}", "}" ]
should be called once every second
[ "should", "be", "called", "once", "every", "second" ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionStats.java#L101-L105
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/SessionHandle.java
SessionHandle.torrents
public List<TorrentHandle> torrents() { torrent_handle_vector v = s.get_torrents(); int size = (int) v.size(); ArrayList<TorrentHandle> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { l.add(new TorrentHandle(v.get(i))); } return l; }
java
public List<TorrentHandle> torrents() { torrent_handle_vector v = s.get_torrents(); int size = (int) v.size(); ArrayList<TorrentHandle> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { l.add(new TorrentHandle(v.get(i))); } return l; }
[ "public", "List", "<", "TorrentHandle", ">", "torrents", "(", ")", "{", "torrent_handle_vector", "v", "=", "s", ".", "get_torrents", "(", ")", ";", "int", "size", "=", "(", "int", ")", "v", ".", "size", "(", ")", ";", "ArrayList", "<", "TorrentHandle",...
Returns a list of torrent handles to all the torrents currently in the session. @return
[ "Returns", "a", "list", "of", "torrent", "handles", "to", "all", "the", "torrents", "currently", "in", "the", "session", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionHandle.java#L206-L217
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/SessionHandle.java
SessionHandle.dhtPutItem
public void dhtPutItem(byte[] publicKey, byte[] privateKey, Entry entry, byte[] salt) { s.dht_put_item(Vectors.bytes2byte_vector(publicKey), Vectors.bytes2byte_vector(privateKey), entry.swig(), Vectors.bytes2byte_vector(salt)); }
java
public void dhtPutItem(byte[] publicKey, byte[] privateKey, Entry entry, byte[] salt) { s.dht_put_item(Vectors.bytes2byte_vector(publicKey), Vectors.bytes2byte_vector(privateKey), entry.swig(), Vectors.bytes2byte_vector(salt)); }
[ "public", "void", "dhtPutItem", "(", "byte", "[", "]", "publicKey", ",", "byte", "[", "]", "privateKey", ",", "Entry", "entry", ",", "byte", "[", "]", "salt", ")", "{", "s", ".", "dht_put_item", "(", "Vectors", ".", "bytes2byte_vector", "(", "publicKey",...
calling the callback in between is convenient.
[ "calling", "the", "callback", "in", "between", "is", "convenient", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/SessionHandle.java#L537-L542
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/FileStorage.java
FileStorage.filePath
public String filePath(int index, String savePath) { // not calling the corresponding swig function because internally, // the use of the function GetStringUTFChars does not consider the case of // a copy not made return savePath + File.separator + fs.file_path(index); }
java
public String filePath(int index, String savePath) { // not calling the corresponding swig function because internally, // the use of the function GetStringUTFChars does not consider the case of // a copy not made return savePath + File.separator + fs.file_path(index); }
[ "public", "String", "filePath", "(", "int", "index", ",", "String", "savePath", ")", "{", "// not calling the corresponding swig function because internally,", "// the use of the function GetStringUTFChars does not consider the case of", "// a copy not made", "return", "savePath", "+...
returns the full path to a file. @param index @param savePath @return
[ "returns", "the", "full", "path", "to", "a", "file", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/FileStorage.java#L322-L327
train
frostwire/frostwire-jlibtorrent
src/main/java/com/frostwire/jlibtorrent/alerts/DhtStatsAlert.java
DhtStatsAlert.routingTable
public ArrayList<DhtRoutingBucket> routingTable() { dht_routing_bucket_vector v = alert.getRouting_table(); int size = (int) v.size(); ArrayList<DhtRoutingBucket> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { l.add(new DhtRoutingBucket(v.get(i))); } ...
java
public ArrayList<DhtRoutingBucket> routingTable() { dht_routing_bucket_vector v = alert.getRouting_table(); int size = (int) v.size(); ArrayList<DhtRoutingBucket> l = new ArrayList<>(size); for (int i = 0; i < size; i++) { l.add(new DhtRoutingBucket(v.get(i))); } ...
[ "public", "ArrayList", "<", "DhtRoutingBucket", ">", "routingTable", "(", ")", "{", "dht_routing_bucket_vector", "v", "=", "alert", ".", "getRouting_table", "(", ")", ";", "int", "size", "=", "(", "int", ")", "v", ".", "size", "(", ")", ";", "ArrayList", ...
Contains information about every bucket in the DHT routing table. @return the routing table
[ "Contains", "information", "about", "every", "bucket", "in", "the", "DHT", "routing", "table", "." ]
a29249a940d34aba8c4677d238b472ef01833506
https://github.com/frostwire/frostwire-jlibtorrent/blob/a29249a940d34aba8c4677d238b472ef01833506/src/main/java/com/frostwire/jlibtorrent/alerts/DhtStatsAlert.java#L48-L58
train