com.skype.tutorial.util
Class SignInMgr

java.lang.Object
  extended by com.skype.tutorial.util.SignInMgr

public class SignInMgr
extends java.lang.Object

Collect common sign-in/sign-out fields and encapsulate common code as methods.

Since:
1.0
Author:
Andrea Drane

Field Summary
static int DELAY_CNT
          Request polling limit (iterations).
static int DELAY_INTERVAL
          Request polling interval (milliseconds).
static int LOGOUT_DELAY
          Delay interval prior to logout (milliseconds).
static java.lang.String MY_CLASS_TAG
          Info/Debug console output message prefix/identifier tag.
 
Constructor Summary
SignInMgr()
           
 
Method Summary
static boolean isLoggedIn(com.skype.api.Account myAccount)
          Dynamically determines if an Account is signed in.
 boolean Login(java.lang.String myTutorialTag, MySession mySession, java.lang.String myAccountPword)
          Common SkypeKit tutorial login processing.
 void Logout(java.lang.String myTutorialTag, MySession mySession)
          Common SkypeKit tutorial logout processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MY_CLASS_TAG

public static final java.lang.String MY_CLASS_TAG
Info/Debug console output message prefix/identifier tag. Corresponds to class name.

Since:
1.0
See Also:
Constant Field Values

DELAY_INTERVAL

public static final int DELAY_INTERVAL
Request polling interval (milliseconds).

Since:
1.0
See Also:
Constant Field Values

DELAY_CNT

public static final int DELAY_CNT
Request polling limit (iterations). Results in a maximum total delay of DELAY_CNT * DELAY_INTERVAL milliseconds before giving up and failing.

Since:
1.0
See Also:
Constant Field Values

LOGOUT_DELAY

public static final int LOGOUT_DELAY
Delay interval prior to logout (milliseconds).

Timing issue w/ some versions of SkypeKit runtime - "immediate" logout frequently causes the runtime to reflect an erroneous logout reason of Account.LOGOUTREASON.APP_ID_FAILURE, so wait a few seconds...

Since:
1.0
See Also:
Constant Field Values
Constructor Detail

SignInMgr

public SignInMgr()
Method Detail

Login

public boolean Login(java.lang.String myTutorialTag,
                     MySession mySession,
                     java.lang.String myAccountPword)
Common SkypeKit tutorial login processing.

Parameters:
myTutorialTag - Invoker's MY_CLASS_TAG.
mySession - Partially initialized session instance providing access to this sessions's Skype object.
Returns:
Since:
1.0

Logout

public void Logout(java.lang.String myTutorialTag,
                   MySession mySession)
Common SkypeKit tutorial logout processing. Delays the logout by a few seconds to ensure that the SkypeKit runtime has fully settled in if the interval between sign-in and sign-out is really, really short (such as exists in Tutorial_1). We don't want to see Account.LOGOUTREASON.APP_ID_FAILURE unless our AppToken is truly bogus!

Parameters:
myTutorialTag - Invoker's MY_CLASS_TAG.
mySession - Populated session object providing access to the invoker's Skype and Account objects.
Since:
1.0
See Also:
LOGOUT_DELAY

isLoggedIn

public static boolean isLoggedIn(com.skype.api.Account myAccount)
Dynamically determines if an Account is signed in.

Specifically, this involves determining if the Account's status property reflects Account.STATUS.LOGGED_IN.

Parameters:
myAccount - The target Account.
Returns:
  • true: currently signed in
  • false: currently signed out or target Account is null
Since:
1.0