protected BaseChannelProcessor(ChannelContract channel) { Channel = channel; Attributes = new AttributesReader(Channel.Attributes).Read(); StemmerBase stemmer = new RussianStemmer(); foreach (string s in Channel.Tags.Split(';')) { _tags.Add(stemmer.Stem(s.Trim())); } }
public static BaseChannelProcessor Create(ChannelContract channel) { switch (channel.Type) { //case ChannelTypes.Facebook: // return new FbProcessor(channel); case ChannelTypes.Vk: return(new VkProcessor(channel)); default: throw new NotImplementedException(); } }
public VkProcessor(ChannelContract channel) : base(channel) { Token = Attributes["Token"]; }
static BOAContextData Authenticate(BOAContextData data, Action <string> trace, ChannelContract channelContract) { if (data.authenticationResponse != null) { return(data); } data = LoadBOAConfigurationFile(data, trace); var request = new AuthenticationRequest { AuthenticationContext = new AuthenticationContext { Channel = channelContract, UserName = AuthenticationUserName } }; trace("Authenticate response waiting..."); var response = new UserManager().Authenticate(request); if (!response.Success) { throw new AuthenticationException("LoginFailed." + StringHelper.ResultToDetailedString(response.Results)); } trace("Authenticate is success."); return(data.WithAuthenticationResponse(response)); }
/// <summary> /// Authenticates the specified channel contract. /// </summary> public void Authenticate(ChannelContract channelContract) { data = Authenticate(data, trace, channelContract); }