Class CILSQLUserStore

  • All Implemented Interfaces:
    edu.uiuc.ncsa.security.core.Store<User>, edu.uiuc.ncsa.security.storage.MonitoredStoreInterface<User>, Map<edu.uiuc.ncsa.security.core.Identifier,​User>, UserStore

    public class CILSQLUserStore
    extends edu.uiuc.ncsa.security.storage.monitored.MonitoredSQLStore<User>
    implements UserStore

    Created by Jeff Gaynor
    on Mar 12, 2010 at 3:41:37 PM

    • Constructor Detail

      • CILSQLUserStore

        public CILSQLUserStore​(edu.uiuc.ncsa.security.storage.sql.ConnectionPool connectionPool,
                               edu.uiuc.ncsa.security.storage.sql.internals.Table table,
                               edu.uiuc.ncsa.security.core.util.IdentifiableProviderImpl<User> idp,
                               edu.uiuc.ncsa.security.storage.data.MapConverter converter,
                               Incrementable incrementable)
    • Method Detail

      • createAndRegisterUser

        public User createAndRegisterUser​(UserMultiID userMultiKey,
                                          String idP,
                                          String idPDisplayName,
                                          String firstName,
                                          String lastName,
                                          String email,
                                          String affiliation,
                                          String displayName,
                                          String organizationalUnit)
        Description copied from interface: UserStore
        Create a user from all the given possible information. Some of this might be missing, but the minimal set is the remoteUser and idp. Note that this creates the user uid too AND it registers the user.
        Specified by:
        createAndRegisterUser in interface UserStore
        Returns:
      • selectSnippet

        protected String selectSnippet​(PersonName personName,
                                       String key)
        This will find the name from the PersonName and, if there is one, return an SQL snippet of the form key=? to be added to the select statement.
        Parameters:
        personName -
        key -
        Returns:
      • get

        public Collection<User> get​(UserMultiID userMultiKey,
                                    String idP)
        Description copied from interface: UserStore
        The remote user and idp together form a composite key for access. (Our URIs are internally generated unique identifiers and are not used outside of the store).
        Specified by:
        get in interface UserStore
        Returns:
      • getUserID

        public edu.uiuc.ncsa.security.core.Identifier getUserID​(UserMultiID userMultiKey,
                                                                String idP)
        Description copied from interface: UserStore
        Resolves the user id given the remoteUser and IdP.
        Specified by:
        getUserID in interface UserStore
        Returns:
      • getUserProvider

        protected UserProvider getUserProvider()
      • get

        public User get​(Object o)
        API-specific. No user means user not found exception must be thrown.
        Specified by:
        get in interface Map<edu.uiuc.ncsa.security.core.Identifier,​User>
        Overrides:
        get in class edu.uiuc.ncsa.security.storage.monitored.MonitoredSQLStore<User>
        Parameters:
        o -
        Returns:
      • entrySet

        public Set<Map.Entry<edu.uiuc.ncsa.security.core.Identifier,​User>> entrySet()
        Specified by:
        entrySet in interface Map<edu.uiuc.ncsa.security.core.Identifier,​User>
        Overrides:
        entrySet in class edu.uiuc.ncsa.security.storage.sql.SQLStore<User>
      • getUserTable

        public UserTable getUserTable()
      • create

        public User create​(boolean newSerialString)
        Description copied from interface: UserStore
        Create a user, optionally with a new serial string. The default behavior for this store is that new users are not created with a new serial identifier (or various operations such as listing users can run through a great many unused identifiers and if they are expensive to create, such as from an SQL database, this might slow down the application noticeably.)
        Specified by:
        create in interface UserStore
        Returns:
      • create

        public User create()
        Specified by:
        create in interface edu.uiuc.ncsa.security.core.Store<User>
        Overrides:
        create in class edu.uiuc.ncsa.security.storage.sql.SQLStore<User>
      • get

        public User get​(String remoteUser,
                        String idP)
        API-specific get by remoteUser and IDP.
        Parameters:
        remoteUser -
        idP -
        Returns:
      • remove

        public boolean remove​(String remoteUser,
                              String idP)
      • update

        public void update​(User user)
        Update the user. NOTE: it is up to the programmer to archive the user prior to making any updates, if that is warranted. This updates the serial string!! If you do not want the serial string updated, you should use updateCheckSerialString(User, boolean) (User, boolean)} with the second argument of true.
        Specified by:
        update in interface edu.uiuc.ncsa.security.core.Store<User>
        Overrides:
        update in class edu.uiuc.ncsa.security.storage.sql.SQLStore<User>
        Parameters:
        user -
      • updateCheckSerialString

        public void updateCheckSerialString​(User user,
                                            boolean keepSerialID)
        Description copied from interface: UserStore
        Save the current user but do not change the serial identifier. Note that this circumvents the contract for Store.update(edu.uiuc.ncsa.security.core.Identifiable) for this interface, which, because of issue CIL-69 requires it in most cases. This is in effect an internal call that allows for administrative updates. If noNewSerialID = false, then the effect is the same as calling Store.update(Identifiable) and a new serial id is created.
        Specified by:
        updateCheckSerialString in interface UserStore
      • getUserID

        public edu.uiuc.ncsa.security.core.Identifier getUserID​(String userKey,
                                                                String personName,
                                                                String idP)
      • getUserID

        public edu.uiuc.ncsa.security.core.Identifier getUserID​(RemoteUserName remoteUser,
                                                                String idP)
      • getUserID

        public edu.uiuc.ncsa.security.core.Identifier getUserID​(OpenID openID,
                                                                String idP)
      • getMapConverter

        public edu.uiuc.ncsa.security.storage.data.MapConverter getMapConverter()
        Specified by:
        getMapConverter in interface UserStore
        Overrides:
        getMapConverter in class edu.uiuc.ncsa.security.storage.sql.SQLStore<User>
      • getCreationTSField

        public String getCreationTSField()
        Specified by:
        getCreationTSField in class edu.uiuc.ncsa.security.storage.sql.SQLStore<User>