Package net.solosky.maplefetion.util

Examples of net.solosky.maplefetion.util.AccountValidator


   * @param password    密码
   * @param domain    账号所在的域,默认为fetion.com.cn
   */
  public User(String account, String password, String domain)
  {
    AccountValidator validator = new AccountValidator(account);
    if(validator.isValidEmail()){
      this.email = account;
    }else if(validator.isValidMobile()){
      this.mobile = validator.getMobile();
    }else if(validator.getFetionId()>0){
      this.fetionId = validator.getFetionId();
    }else{
      throw new IllegalStateException("Invalid account "+account+", it should be CMCC mobile number, FetionId or Registered Email.");
    }
   
    this.password = password;
View Full Code Here


   *</pre>
   */
  public void addBuddy(String account, String localName, Cord cord, String desc, int promptId, ActionEventListener listener)
  {
    this.ensureOnline();
    AccountValidator validator = new AccountValidator(account);
    if(validator.isValidMobile()){
      this.dialogFactory.getServerDialog().addBuddy("tel:"+account, localName, cord, desc, promptId,  listener);
    }else if(validator.getFetionId()>0){
      this.dialogFactory.getServerDialog().addBuddy("sip:"+account, localName, cord, desc, promptId, listener);
    }else{
      if(listener!=null){
        listener.fireEevent(new FailureEvent(FailureType.INVALID_ACCOUNT));
      }
View Full Code Here

TOP

Related Classes of net.solosky.maplefetion.util.AccountValidator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.