Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage;
 

Created by Jeff Gaynor
on 3/12/14 at 1:35 PM

public class TConverter2<V extends OA2ServiceTransactionextends TransactionConverter<V> {
    public TConverter2(OA2TransactionKeys keysIdentifiableProvider<V> identifiableProviderTokenForge tokenForgeClientStore<? extends Clientcs) {
        super(keysidentifiableProvidertokenForgecs);
    }
    protected OA2TransactionKeys getTCK() {
        return (OA2TransactionKeys;
    }
    protected TokenForge2 getTF2() {
        return (TokenForge2getTokenForge();
    }
    @Override
    public V fromMap(ConversionMap<StringObjectmap, V v) {
        V st = super.fromMap(mapv);
        Object refreshToken = map.get(getTCK().refreshToken());
        if (refreshToken != null) {
                  if (refreshToken instanceof RefreshToken) {
                      st.setRefreshToken((RefreshTokenrefreshToken);
                  } else {
                      st.setRefreshToken(getTF2().getRefreshToken(refreshToken.toString()));
                  }
              }
        st.setRefreshTokenLifetime(map.getLong(getTCK().expiresIn()));
        st.setCallback(map.getURI(getTCK().callbackUri()));
        return st;
    }
    @Override
    public void toMap(V tConversionMap<StringObjectmap) {
        super.toMap(tmap);
        if (t.getRefreshToken() != null) {
            map.put(getTCK().refreshToken(), t.getRefreshToken().getToken());
        }
        map.put(getTCK().refreshTokenValid(), t.isRefreshTokenValid());
        if (t.getCallback() != null) {
            map.put(getTCK().callbackUri(), t.getCallback().toString());
        }
        map.put(getTCK().expiresIn(), t.getRefreshTokenLifetime());
    }
New to GrepCode? Check out our FAQ X