com.skype.tutorial.step12
Class Tutorial_12

java.lang.Object
  extended by com.skype.tutorial.step12.Tutorial_12

public class Tutorial_12
extends java.lang.Object

Getting Started With SkypeKit: Tutorial Application, Step 12. This example illustrates a simple SkypeKit-based program that:

  1. Takes a Skype Name, password, and optional AppToken path name as command-line arguments
  2. Initiates login for that user
  3. Waits until the login process is complete
  4. assembles and displays an event history of:
  5. Initiates logout
  6. Waits until logout is complete
  7. Cleans up and exits

Since:
1.0
Author:
Andrea Drane (ported/refactored from existing C++ tutorial code)

Field Summary
static int ACCOUNT_NAME_IDX
          Index of the account name in the command line argument list.
static int ACCOUNT_PWORD_IDX
          Index of the account password in the command line argument list.
static int APPTOKEN_FILE_IDX
          Index of the optional AppToken text file pathname in the command line argument list, which is always last.
static java.lang.String MY_CLASS_TAG
          Info/Debug console output message prefix/identifier tag.
private static AppToken myAppToken
           
private static MySession mySession
           
private static Tutorial_12 myTutorial
          "Extraneous" instance of this tutorial so we can invoke our business logic method from main(String[]) without having to declare it as being "static".
private static XmlStrMgr myXmlStrMgr
           
static int OPT_ARG_CNT
          Number of optional arguments in the command line argument list.
static int REQ_ARG_CNT
          Number of required arguments in the command line argument list.
static java.text.ParsePosition ZERO_POS
          ParsePosition instance representing the beginning of a target string.
 
Constructor Summary
Tutorial_12()
           
 
Method Summary
(package private)  void doEventHistory(MySession mySession)
          Handles event history.
(package private)  void doListIdentities(com.skype.api.Message currMsg)
          Writes identities associated with a Message to the console as a single string.
(package private)  void doRenderHistory(MySession mySession, com.skype.api.Message[] myMessages)
          Processes messages associated with a Conversation.
static void main(java.lang.String[] args)
          Main loop - Event History
 
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

ACCOUNT_NAME_IDX

public static final int ACCOUNT_NAME_IDX
Index of the account name in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

ACCOUNT_PWORD_IDX

public static final int ACCOUNT_PWORD_IDX
Index of the account password in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

REQ_ARG_CNT

public static final int REQ_ARG_CNT
Number of required arguments in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

OPT_ARG_CNT

public static final int OPT_ARG_CNT
Number of optional arguments in the command line argument list.

Since:
1.0
See Also:
Constant Field Values

APPTOKEN_FILE_IDX

public static final int APPTOKEN_FILE_IDX
Index of the optional AppToken text file pathname in the command line argument list, which is always last.

Since:
1.0
See Also:
Constant Field Values

ZERO_POS

public static final java.text.ParsePosition ZERO_POS
ParsePosition instance representing the beginning of a target string.

Since:
1.0

myAppToken

private static AppToken myAppToken

mySession

private static MySession mySession

myXmlStrMgr

private static XmlStrMgr myXmlStrMgr

myTutorial

private static Tutorial_12 myTutorial
"Extraneous" instance of this tutorial so we can invoke our business logic method from main(String[]) without having to declare it as being "static".

Since:
1.0
Constructor Detail

Tutorial_12

public Tutorial_12()
Method Detail

main

public static void main(java.lang.String[] args)
Main loop - Event History

Parameters:
args -
  1. Name of the target Skype account.
  2. Password for the target Skype account.
  3. Optional pathname of a text file containing an AppToken string.
Since:
1.0

doEventHistory

void doEventHistory(MySession mySession)
Handles event history.
  1. Obtains an unfiltered list of all Conservations
  2. For each conversation:
    1. Lists associated context messages
    2. Lists associated unconsumed messages

Parameters:
mySession - Populated session object
Since:
1.0

doRenderHistory

void doRenderHistory(MySession mySession,
                     com.skype.api.Message[] myMessages)
Processes messages associated with a Conversation. Processes only messages of type:

Parameters:
mySession - Populated session object
myMessages - Array of message strings to process.
Since:
1.0

doListIdentities

void doListIdentities(com.skype.api.Message currMsg)
Writes identities associated with a Message to the console as a single string.

If the target message's identities property is empty, writes --NONE--. Otherwise, writes the individual identity values separated by commas.

Makes no assumptions about any preceding characters already written to the console. Terminates the string with a colon followed by a space ("code>": "). Does not include any carriage return/line feed!

For example:
     (empty)     => --NONE--
                    ********
     abc         => abc:
                    *****
     abc def ghi => abc, def, ghi:
                    ***************
 

Parameters:
currMsg - Target Message instance.
Since:
1.0