Package org.openstreetmap.josm.io

Examples of org.openstreetmap.josm.io.OsmServerUserInfoReader


     *
     */
    protected void refreshUserIdentity(){
        JosmUserIdentityManager im = JosmUserIdentityManager.getInstance();
        try {
            OsmServerUserInfoReader infoReader = new OsmServerUserInfoReader();
            UserInfo info = infoReader.fetchUserInfo(getProgressMonitor().createSubTaskMonitor(1, false));
            im.setFullyIdentified(info.getDisplayName(), info);
        } catch(OsmTransferException e) {
            // retrieving the user info can fail if the current user is not authorised to
            // retrieve it, i.e. if he is working with an OAuth Access Token which doesn't
            // have the respective privileges or if he didn't or he can't authenticate with
View Full Code Here


     * @see #initFromPreferences
     * @since 5434
     */
    public void initFromOAuth(Component parent) {
        try {
            UserInfo info = new OsmServerUserInfoReader().fetchUserInfo(NullProgressMonitor.INSTANCE);
            setFullyIdentified(info.getDisplayName(), info);
        } catch (IllegalArgumentException | OsmTransferException e) {
            Main.error(e);
        }
    }
View Full Code Here

         *
         * @return the user info
         * @throws OsmTransferException thrown in case of any communication exception
         */
        protected UserInfo fetchUserInfo() throws OsmTransferException {
            OsmServerUserInfoReader reader = new OsmServerUserInfoReader();
            return reader.fetchUserInfo(getProgressMonitor().createSubTaskMonitor(1, false));
        }
View Full Code Here

     */
    protected void fullyIdentifyCurrentUser() throws OsmTransferException {
        getProgressMonitor().indeterminateSubTask(tr("Determine user id for current user..."));

        synchronized(this) {
            userInfoReader = new OsmServerUserInfoReader();
        }
        UserInfo info = userInfoReader.fetchUserInfo(getProgressMonitor().createSubTaskMonitor(1,false));
        synchronized(this) {
            userInfoReader = null;
        }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.io.OsmServerUserInfoReader

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.