001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: DataStoreProvider.java,v 1.2 2008/06/25 05:47:27 qcheng Exp $
026 *
027 */
028
029/**
030 * Portions Copyrighted 2013 ForgeRock AS
031 */
032
033package com.sun.identity.plugin.datastore;
034
035import java.util.Map;
036import java.util.Set;
037
038
039/**
040 * Interface used for storing & retrieving information. Also used to search
041 * user.
042 * @supported.all.api
043 */
044public interface DataStoreProvider {
045    
046    /**
047     * Initializes the provider.
048     * @param componentName Component name, such as saml, saml2, id-ff, disco,
049     *  authnsvc, and idpp.
050     * @throws DataStoreProviderException if an error occurred during
051     *  initialization.
052     */
053    public void init(String componentName)
054        throws DataStoreProviderException;
055
056    /**
057     * Gets user attribute.
058     * @param userID ID value for the user.
059     * @param attrName Name of the attribute whose value to be retrieved.
060     * @return Set of the values for the attribute.
061     * @throws DataStoreProviderException if an error occurred.
062     */
063    public Set<String> getAttribute(String userID, String attrName)
064        throws DataStoreProviderException;
065
066    /**
067     * Gets user attributes.
068     * @param userID ID value for the user.
069     * @param attrNames The Set of attribute names.
070     * @return Map of specified attributes. Map key is the attribute
071     *  name and value is the attribute value Set.
072     * @throws DataStoreProviderException if an error occurred.
073     */
074
075    public Map<String, Set<String>> getAttributes(String userID, Set<String> attrNames)
076        throws DataStoreProviderException;
077
078    /**
079     * Gets user binary attribute.
080     * @param userID ID value for the user.
081     * @param attrName Name of the attribute whose value to be retrieved.
082     * @return Set of the values for the attribute.
083     * @throws DataStoreProviderException if an error occurred.
084     */
085    public byte[][] getBinaryAttribute(String userID, String attrName)
086        throws DataStoreProviderException;
087
088    /**
089     * Gets user binary attributes.
090     * @param userID ID value for the user.
091     * @param attrNames The Set of attribute names.
092     * @return Map of specified attributes. Map key is the attribute
093     *  name and value is the attribute value Set.
094     * @throws DataStoreProviderException if an error occurred.
095     */
096    public Map<String, byte[][]> getBinaryAttributes(String userID, Set<String> attrNames)
097        throws DataStoreProviderException;
098
099    /**
100     * Sets user attributes.
101     * @param userID ID value for the user.
102     * @param attrMap Map of specified attributes to be set. Map key is
103     *  the attribute name and value is the attribute value Set.
104     * @throws DataStoreProviderException if an error occurred.
105     */
106    public void setAttributes(String userID, Map<String, Set<String>> attrMap)
107        throws DataStoreProviderException;
108
109    /**
110     * Searches user.
111     * @param orgDN The organization to search the user.
112     * @param avPairs Attribute value pairs that will be used for searching
113     *  the user.
114     * @throws DataStoreProviderException if an error occurred.
115     */
116    public String getUserID(String orgDN, Map<String, Set<String>> avPairs)
117        throws DataStoreProviderException;
118
119    /**
120     * Checks if the user exists with a given userid.
121     * @param userID ID of an user
122     * @return <code>true</code> if the user exists; <code>false</code>
123     *  otherwise.
124     * @throws DataStoreProviderException if an error occurred.
125     */
126    public boolean isUserExists(String userID) 
127       throws DataStoreProviderException;
128
129}




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.