Package hamsam.protocol.aim.flap

Examples of hamsam.protocol.aim.flap.FlapHeader


     *
     * @param seqNum sequence number for the FlapHeader
     * @param buddy Buddy to be ignored
     */
    public RequestICBMParmCmd(int seqNum) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket = new SNACPacket(SNACConstants.SNAC_FAMILY_MESSAGING, SNACConstants.REQUEST_ICBM_PARMIFO);
    }
View Full Code Here


    /**
     * Constructor
     * @param cookie authorization cookie from the server
     */
    public BOSLoginCmd(byte[] cookie) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_CONNECT, 2);
        addTLV( new TLV(TLVConstants.TLV_TYPE_COOKIE, cookie) )
    }
View Full Code Here

     *
     * @param seqNum sequence number for the FlapHeader
     * @param buddy Buddy to be ignored
     */
    public IgnoreBuddyCmd(int seqNum, Buddy buddy) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket =
            new SNACPacket(SNACConstants.SNAC_FAMILY_PRIVACY_MANAGEMENT, SNACConstants.SNAC_SUBTYPE_ADD_INVISIBLE);

        buddyName = buddy.getUsername();
    }
View Full Code Here

     *
     * @param seqNum sequence number for the FlapHeader
     * @param buddy Buddy to be deleted
     */
    public DeleteBuddyCmd(int seqNum, Buddy buddy) {
        flapHdr        = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket     = new SNACPacket(SNACConstants.SNAC_FAMILY_BUDDY_LIST_MANAGEMENT,
                                        SNACConstants.SNAC_SUBTYPE_DEL_BUDDY);
                           
        buddyName = buddy.getUsername();
    }
View Full Code Here

     *
     * @param seqNum sequence number for FlapHeader
     * @param buddy Buddy to be added
     */
    public AddBuddyCmd(int seqNum, Buddy buddy) {
        flapHdr        = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket     = new SNACPacket(SNACConstants.SNAC_FAMILY_BUDDY_LIST_MANAGEMENT,
                                         SNACConstants.SNAC_SUBTYPE_ADD_BUDDY);
                           
        buddyName = buddy.getUsername();
    }
View Full Code Here

     * @throws IOException
     * @throws InterruptedException
     */
    public static Command getCommand(Connection conn) throws IOException, InterruptedException {
        byte[] cmdData = null;
        FlapHeader hdr = null;
        SNACPacket pkt = null;
        List tlvs = null;
       
        try {
            hdr = FlapHeader.getHeader(conn);
        } catch (IllegalStateException e1) {
            e1.printStackTrace();
        }

        if (hdr != null) {
            /* get the length of the data portion */
            int dataLength = hdr.getDataLength();

            /* now load the data portion */
            cmdData = new byte[dataLength];
            int count = 0;

            while (count != cmdData.length) {
                try {
                    count += conn.read(cmdData, count, cmdData.length - count);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
           
            // create the SNAC from the buffer
            if (hdr.getChannelId() == FlapConstants.FLAP_CHANNEL_SNAC) {
               
                // create snac packet
                pkt = new SNACPacket(cmdData);
               
                // moved all SNAC data into the SNACPacket
                cmdData = null;
               
            } else  if (hdr.getChannelId() == FlapConstants.FLAP_CHANNEL_DISCONNECT) {
           
                // anything left MAY/MAY not be a list of TLVs -
                tlvs = TLV.getTLVs(cmdData, 0);
            }
           
View Full Code Here

     *
     * @param seqNum sequence number for the FlapHeader
     * @param buddy Buddy to be ignored
     */
    public ClientSetICBMParmsCmd(int seqNum, int flags, byte[] snacData) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket = new SNACPacket(SNACConstants.SNAC_FAMILY_MESSAGING, SNACConstants.SET_ICBM_PARMS);
        snacData[5] = (byte) flags;
       
        // set max msg len to 8000 (ox1f40)
        snacData[6] = 0x1f;
View Full Code Here

     *
     * @param seqNum sequence number for the FlapHeader
     * @param buddy Buddy to be ignored
     */
    public TypingNotificationCmd(int seqNum, Buddy buddy, int typingState) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket =
            new SNACPacket(SNACConstants.SNAC_FAMILY_MESSAGING, SNACConstants.SNAC_SUBTYPE_MINI_TYPING_NOTIFICATION);

        buddyName = buddy.getUsername();
        typing = typingState;
View Full Code Here

     *
     * @param seqNum sequence number for the FlapHeader
     * @param buddy Buddy to be ignored
     */
    public UnignoreBuddyCmd(int seqNum, Buddy buddy) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket =
            new SNACPacket(SNACConstants.SNAC_FAMILY_PRIVACY_MANAGEMENT, SNACConstants.SNAC_SUBTYPE_DEL_INVISIBLE);

        buddyName = buddy.getUsername();
    }
View Full Code Here

     * @param seqNum flap header sequence number
     * @param snacFamily SNAC Packet family id
     * @param snacSubtype SNAC Packet subtype id
     */
    public BaseCmd(int seqNum, int snacFamily, int snacSubtype) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket = new SNACPacket(snacFamily, snacSubtype);
    }
View Full Code Here

TOP

Related Classes of hamsam.protocol.aim.flap.FlapHeader

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.