Package hamsam.protocol.aim.snac

Examples of hamsam.protocol.aim.snac.SNACPacket


     * @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


     * @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 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) {
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;
        snacData[7] = 0x40;
View Full Code Here

     * @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 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 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

    /**
     *
     */
    public ClientSetStatusCmd(int seqNum, int statusflag) {
        flapHdr = new FlapHeader(FlapConstants.FLAP_CHANNEL_SNAC, seqNum);
        snacPacket = new SNACPacket(SNACConstants.SNAC_FAMILY_GENERIC_SERVICE_CONTROLS, SNACConstants.CLIENT_STATUS);

        statusFlags |= statusflag;
        byte[] flags = ByteUtils.getUInt( modeFlags | statusFlags );
        addTLV( new TLV(TLVConstants.TLV_TYPE_USER_STATUS_FLAGS, flags ) );

View Full Code Here

TOP

Related Classes of hamsam.protocol.aim.snac.SNACPacket

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.