public override void removeToken(ISecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName, String tokenName) { ++accessTokenRemoveCount; BasicOAuthStoreTokenIndex tokenKey = MakeBasicOAuthStoreTokenIndex(securityToken, serviceName, tokenName); tokens.Remove(tokenKey); }
public override void setTokenInfo(ISecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName, String tokenName, TokenInfo tokenInfo) { ++accessTokenAddCount; BasicOAuthStoreTokenIndex tokenKey = MakeBasicOAuthStoreTokenIndex(securityToken, serviceName, tokenName); tokens.Add(tokenKey, tokenInfo); }
public override TokenInfo getTokenInfo(ISecurityToken securityToken, ConsumerInfo consumerInfo, String serviceName, String tokenName) { ++accessTokenLookupCount; BasicOAuthStoreTokenIndex tokenKey = MakeBasicOAuthStoreTokenIndex(securityToken, serviceName, tokenName); return(tokens.ContainsKey(tokenKey)?tokens[tokenKey]:null); }
private static BasicOAuthStoreTokenIndex MakeBasicOAuthStoreTokenIndex(ISecurityToken securityToken, String serviceName, String tokenName) { BasicOAuthStoreTokenIndex tokenKey = new BasicOAuthStoreTokenIndex(); tokenKey.setGadgetUri(securityToken.getAppUrl()); tokenKey.setModuleId(securityToken.getModuleId()); tokenKey.setServiceName(serviceName); tokenKey.setTokenName(tokenName); tokenKey.setUserId(securityToken.getViewerId()); return(tokenKey); }
public override bool Equals(Object obj) { if (this == obj) { return(true); } if (obj == null) { return(false); } if (GetType() != obj.GetType()) { return(false); } BasicOAuthStoreTokenIndex other = (BasicOAuthStoreTokenIndex)obj; if (gadgetUri == null) { if (other.gadgetUri != null) { return(false); } } else if (!gadgetUri.Equals(other.gadgetUri)) { return(false); } if (moduleId != other.moduleId) { return(false); } if (serviceName == null) { if (other.serviceName != null) { return(false); } } else if (!serviceName.Equals(other.serviceName)) { return(false); } if (tokenName == null) { if (other.tokenName != null) { return(false); } } else if (!tokenName.Equals(other.tokenName)) { return(false); } if (userId == null) { if (other.userId != null) { return(false); } } else if (!userId.Equals(other.userId)) { return(false); } return(true); }
private static BasicOAuthStoreTokenIndex MakeBasicOAuthStoreTokenIndex(ISecurityToken securityToken, String serviceName, String tokenName) { BasicOAuthStoreTokenIndex tokenKey = new BasicOAuthStoreTokenIndex(); tokenKey.setGadgetUri(securityToken.getAppUrl()); tokenKey.setModuleId(securityToken.getModuleId()); tokenKey.setServiceName(serviceName); tokenKey.setTokenName(tokenName); tokenKey.setUserId(securityToken.getViewerId()); return tokenKey; }