001/*
002 * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Thierry Delprat
018 */
019package org.nuxeo.ecm.admin.oauth;
020
021import java.io.Serializable;
022import java.util.HashMap;
023import java.util.Map;
024
025import org.jboss.seam.ScopeType;
026import org.jboss.seam.annotations.Name;
027import org.jboss.seam.annotations.Scope;
028import org.nuxeo.ecm.platform.oauth.tokens.NuxeoOAuthToken;
029import org.nuxeo.ecm.platform.oauth.tokens.OAuthTokenStoreImpl;
030
031@Name("oauthConsumersTokensActions")
032@Scope(ScopeType.CONVERSATION)
033public class OAuthConsumersTokensActionBean extends DirectoryBasedEditor {
034
035    private static final long serialVersionUID = 1L;
036
037    @Override
038    protected Map<String, Serializable> getQueryFilter() {
039        Map<String, Serializable> filter = new HashMap<String, Serializable>();
040        filter.put("clientToken", 0);
041        return filter;
042    }
043
044    @Override
045    protected String getDirectoryName() {
046        return OAuthTokenStoreImpl.DIRECTORY_NAME;
047    }
048
049    @Override
050    protected String getSchemaName() {
051        return NuxeoOAuthToken.SCHEMA;
052    }
053
054}