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:21 PM

public class OA2FSTStore<V extends OA2ServiceTransactionextends DSFSTransactionStore<V> implements RefreshTokenStore<V> {
    public OA2FSTStore(File storeDirectoryFile indexDirectory,
                       IdentifiableProvider<V> idp,
                       TokenForge tokenForge,
                       MapConverter<V> cp) {
        super(storeDirectoryindexDirectoryidptokenForgecp);
    }
    @Override
    public V get(RefreshToken refreshToken) {
        return getIndexEntry(refreshToken.getToken());
    }
    @Override
    public void realSave(boolean checkExists, V t) {
         super.realSave(checkExistst);
         try {
             if (t.hasRefreshToken()) {
                 createIndexEntry(t.getRefreshToken().getToken(), t.getIdentifierString());
             }
         } catch (IOException e) {
             throw new GeneralException("Error serializing item " + t + "to file ");
         }
     }
    @Override
    public boolean delete(String identifier) {
        V t = (V) loadByIdentifier(identifier);
        boolean rc = super.delete(identifier);
        if (t.hasRefreshToken()) {
            removeIndexEntry(t.getRefreshToken().getToken());
        }
       return rc;
    }
New to GrepCode? Check out our FAQ X