summaryrefslogtreecommitdiffstats
blob: 1fd5b36395d1c9dd4d65dac1ca8b506b481da29f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
 * Copyright (c) 2012, Isode Limited, London, England.
 * All rights reserved.
 */
/*
 * Copyright (c) 2010 Remko Tronçon
 * Licensed under the GNU General Public License v3.
 * See Documentation/Licenses/GPLv3.txt for more information.
 */
package com.isode.stroke.queries.responders;

import com.isode.stroke.elements.SoftwareVersion;
import com.isode.stroke.jid.JID;
import com.isode.stroke.queries.GetResponder;
import com.isode.stroke.queries.IQRouter;

public class SoftwareVersionResponder extends GetResponder<SoftwareVersion> {

    public SoftwareVersionResponder(IQRouter router) {
        super(new SoftwareVersion(), router);
    }

    public void setVersion(final String client, final String version, final String os) {
        this.client = client;
        this.version = version;
        this.os = os;
    }

    @Override
    public boolean handleGetRequest(final JID from, final JID to, final String id, SoftwareVersion payload) {
        sendResponse(from, id, new SoftwareVersion(client, version, os));
        return true;
    }
    private String client;
    private String version;
    private String os;
}