class UmaTokenStore {

    PermissionTicket createPermissionTicket(String resourceSetId, Set<String> scopes, String clientId)
            throws ServerException, NotFoundException {
        UmaProviderSettings settings = settingsFactory.get(realm);
        PermissionTicket permissionTicket = new PermissionTicket(null, resourceSetId, scopes, clientId);
        permissionTicket.setRealm(realm);
        permissionTicket.setExpiryTime(currentTimeMillis() + (settings.getPermissionTicketLifetime() * 1000));
        try {
            cts.create(permissionTicketAdapter.toToken(permissionTicket));
        } catch (CoreTokenException e) {
            throw new ServerException(e);
        }
        return permissionTicket;
    }

    @Inject  UmaTokenStore(@Assisted String realm, JavaBeanAdapter<RequestingPartyToken> rptAdapter,
            JavaBeanAdapter<PermissionTicket> permissionTicketAdapter, CTSPersistentStore cts,
            UmaProviderSettingsFactory settingsFactory);

}