*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.user
Class UserService
java.lang.Object
com.sas.services.AbstractRemoteService
com.sas.services.user.UserService
- All Implemented Interfaces:
com.sas.entities.EntityKeyInterface,ServiceNotificationBroadcasterInterface,RemoteServiceInterface,UserServiceInterface,Remote
@SASScope("ALL")
@BinaryCompatibilityOnly
public class UserService
extends AbstractRemoteService
implements UserServiceInterface
The UserServiceInterface provides mechanisms for storing information about
users and retrieving user information. Methods are provided to store and
retrieve user contexts, retrieve user profile information, retrieve
credential sets, and create new user contexts.
- Since:
- 1.1
- See Also:
-
Field Summary
Fields inherited from interface com.sas.services.RemoteServiceInterface
CLASS_IDENTIFIER, CLASS_IDENTIFIER_1_1, CLASS_IDENTIFIER_1_2, CLASS_IDENTIFIER_SERVICE_TYPE, CLASS_IDENTIFIER_SERVICE_TYPE_1_1, CLASS_IDENTIFIER_SERVICE_TYPE_1_2 -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(ServiceConfigurationInterface serviceConfiguration) Configures service.createProfile(UserContextInterface privUser, UserContextInterface user, String application) Create a new profile.createProfile(UserContextInterface user, String application) Create a new profile.voiddestroy()Destroys the service.fromByteArray(byte[] data) Create a UserContext from a byte array returned from theUserContext.toByteArray()method.Get the object that will handle credential challenge callbacks.booleanGet the flag indicating if group logins are allowed to be used to create User Contexts.List<IdentityGroupInterface> Get all the identity groups that a user belongs to.static InformationServiceInterfaceGets a foundation Information Service.static UserServiceInterfacegetInstance(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService) Gets a singleton instance of the user service for the specified service configuration.getProfile(PersonInterface person, String application) Get the profile for a Person object.getProfileDefinition(String application) Get the profile definition for an application.final RemoteServiceInterfaceGets the service proxy.getSummaryData(boolean includeDetails) Get the summary data regarding the active users.getUser(UserContextInterface privUser, String user) Get a user from the user service.getUser(String user) Get a user from the user service.intGet the count of users that are currently logged in.voidinitialize(UserServiceInitObject initObject) Initializes the user service.loadProfile(UserContextInterface searchContext, UserContextInterface user, String application) Get the profile object for the user from the searchContext's connected repositories.loadProfile(UserContextInterface user, String application) Get the profile object for the user from the user's connected repositories.voidGet credential sets for a user.voidloadUserCredentials(UserContextInterface searchContext, UserContextInterface user) Get the profile for a Person object.voidlogFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0) voidlogFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1) voidlogFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1, Object arg2) voidlogFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1, Object arg2, Object arg3) voidlogMessage(org.apache.logging.log4j.Level level, String message) voidlogMessage(org.apache.logging.log4j.Level level, String message, String context, Throwable t) newAuthenticatedUser(Subject subject) Create a new UserContext based on the Subject provided.newRemoteUser(SubjectMatter subject) Create a new UserContext using a SubjectMatter object that is populated with the PFS principals and credentials of an authenticated user.newRemoteUser(SubjectMatter subject, Map advancedOptions) Create a new UserContext using a SubjectMatter object that is populated with the PFS principals and credentials of an authenticated user.newUser()newUser(UserContextInterface privUser, String uid, String password, String domain) Create a new user context given a privileged context, user id, password, and authentication domain.newUser(UserContextInterface privUser, String uid, String password, String domain, String clientSource, String appSource) Create a new user context given a privileged context, user id, password, and authentication domain.newUser(UserContextInterface privUser, String uid, String password, String domain, String clientSource, String appSource, Map advancedOptions) Create a new user context given a privileged context, user id, password, and authentication domain.newUser(UserContext privUser, String uid, String password, String domain) Create a new user context given a privileged context, user id, password, and authentication domain.newUser(UserContext privUser, String uid, String password, String domain, String clientSource, String appSource) Create a new user context given a privileged context, user id, password, and authentication domain.newUser(UserContext privUser, String uid, String password, String domain, String clientSource, String appSource, Map advancedOptions) Create a new user context given a privileged context, user id, password, and authentication domain.newUser(String clientSource, String appSource) Create a new UserContext based on the current OS identity of the user.newUser(String uid, String password, String domain) Create a new user context given a user id, password, and authentication domain.newUser(String uid, String password, String domain, String clientSource, String appSource) Create a new user context given a user id, password, and authentication domain.newUser(String clientSource, String appSource, Map advancedOptions) Create a new UserContext based on the current OS identity of the user.newUserIdentity(Object principal, Object credential, String domain, String mechanism) Return a new user identity object given the Pricipal, credential, domain, and authentication mechanism.newUserWithInfoService(UserContext privUser, String uid, String password, String domain, InformationServiceInterface infoService) Deprecated.This method should no longer be used.booleanRemove a user from the user service.voidresetInternalPassword(String host, String port, String username, String oldPassword, String newPassword) Reset a user's internal metadata password.voidSet the object that will be used to handle credential challenge callbacks.voidsetGroupLoginEnabled(boolean groupLoginFlag) Set the UserService to allow group logins to be used to create User Contexts.voidsetUser(UserContextInterface user) Add a user to the user service.voidFor internal use only.Methods inherited from class com.sas.services.AbstractRemoteService
addServiceObserver, bindToDiscoveryService, getCreationTime, getDetails, getDiscoveryService, getEntityKey, getEnvironment, getServiceConfiguration, getServiceConfiguration, getServiceState, handleJVMShutdown, isAccessibleToRemoteClients, isExported, isHandlingJVMShutdown, notifyServiceObservers, reconfigure, removeAllServiceObservers, removeServiceObserver, sameEntity, setDiscoveryService, setEntityKey, setRemoteableExporter, setServiceState, toString, unbindFromDiscoveryServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.sas.entities.EntityKeyInterface
getEntityKey, sameEntity, setEntityKeyMethods inherited from interface com.sas.services.RemoteServiceInterface
getCreationTime, getServiceConfiguration, getServiceConfiguration, getServiceState, isAccessibleToRemoteClients, isExported, reconfigure, setServiceStateMethods inherited from interface com.sas.services.mgmt.ServiceNotificationBroadcasterInterface
addServiceObserver, notifyServiceObservers, removeAllServiceObservers, removeServiceObserver
-
Method Details
-
getInformationService
Gets a foundation Information Service.- Returns:
- Information Service.
- Throws:
ServiceException- if unable to obtain a foundation Information Service.
-
initialize
public void initialize(UserServiceInitObject initObject) Initializes the user service.- Parameters:
initObject- User service initialization data.
-
configure
public void configure(ServiceConfigurationInterface serviceConfiguration) throws RemoteException, ServiceException Configures service. Note that this method may used to initialize a service or to re-configure a previously initialized service.- Specified by:
configurein interfaceRemoteServiceInterface- Overrides:
configurein classAbstractRemoteService- Parameters:
serviceConfiguration- An object containing configuration data necessary to initialize or re-configure a service. Note that the service provider must verify that the object type is supported. AnInitializationExceptionshould be thrown if the initialization was not completed successfully to indicate that the instance should not be used.- Throws:
ServiceException- if unable to configure the service.RemoteException- if a network anomaly is encountered.
-
destroy
Destroys the service. The service should release any resources it holds in preparation for termination of use of this service.- Specified by:
destroyin interfaceRemoteServiceInterface- Overrides:
destroyin classAbstractRemoteService- Throws:
RemoteException- if a network anomaly is encountered.ServiceException- if the service is unable to prepare itself for destruction.
-
getServiceProxy
Gets the service proxy.- Specified by:
getServiceProxyin interfaceRemoteServiceInterface- Overrides:
getServiceProxyin classAbstractRemoteService- Returns:
- A proxy to this service or
nullif a proxy is not available.
-
getInstance
public static UserServiceInterface getInstance(ServiceConfigurationInterface serviceConfiguration, DiscoveryServiceInterface discoveryService) throws ServiceException Gets a singleton instance of the user service for the specified service configuration. If a user service has not yet been instantiated then one will be created. Otherwise the preexisting user service will be reconfigured using the new configuration.- Parameters:
serviceConfiguration- Configuration to be used to initialize the User Service.discoveryService- The DiscoveryService object to use to bind the new UserService instance.- Returns:
- Configured User Service.
- Throws:
ServiceException- if unable to obtain the user service.
-
setUser
Add a user to the user service. If a UserContext already exists with the same key, the new user will be added to a List of users with that key. Since this can make things confusing to try keep track of who's who, it is strongly recommended that applications set the key on the UserContext to some unique value before calling the setUser method.- Specified by:
setUserin interfaceUserServiceInterface- Parameters:
user- A new user context to add to the service.- Throws:
RemoteException- in the event of remote object failure.
-
userDestroyed
Description copied from interface:UserServiceInterfaceFor internal use only.- Specified by:
userDestroyedin interfaceUserServiceInterface- Parameters:
user- A user being destroyed.- Throws:
ServiceException- In case of service error.RemoteException- In the event of remote object failure.
-
removeUser
Remove a user from the user service.- Specified by:
removeUserin interfaceUserServiceInterface- Parameters:
user- The user to remove.- Returns:
- true if the user was found and removed, false otherwise.
- Throws:
RemoteException- in the event of remote object failure.
-
getUser
Get a user from the user service. This method is protected using JAAS permissions. A UserContextPermission is required to read a UserContext. UserContextPermission can be granted globally to specific UserContext names if they are known in advance to be publicly available.- Specified by:
getUserin interfaceUserServiceInterface- Parameters:
user- The user to retrieve. The string may be the name or key. The name is checked first. If it's found, the user is returned. If not, the key is searched.- Returns:
- The user context, or null if not found.
- Throws:
RemoteException- in the event of remote object failure.
-
getUser
public UserContextInterface getUser(UserContextInterface privUser, String user) throws RemoteException Get a user from the user service. This method is protected using JAAS permissions. A UserContextPermission is required to read a UserContext. UserContextPermission can be granted globally to specific UserContext names if they are known in advance to be publicly available.- Specified by:
getUserin interfaceUserServiceInterface- Parameters:
privUser- A UserContext whose principals will be checked for permission to perform the getUser function. This can be null, but if the method is invoked remotely, it will always fail with a null UserContext.user- The user to retrieve. The string may be the name or key. The name is checked first. If it's found, the user is returned. If not, the key is searched.- Returns:
- The user context, or null if not found.
- Throws:
RemoteException- in the event of remote object failure.
-
newUserIdentity
public UserIdentityInterface newUserIdentity(Object principal, Object credential, String domain, String mechanism) throws RemoteException, ServiceException Return a new user identity object given the Pricipal, credential, domain, and authentication mechanism.- Specified by:
newUserIdentityin interfaceUserServiceInterface- Parameters:
principal- An object (usually a string) that represents the user within a security domain.credential- An object that is used to authenticate a principal. Depending on the mechanism, this may be a password string, or a complex object such as a certificate.domain- A String representing a security domain. While this string is arbitrary, it should be consistent within an installation so that credential sets match with services.mechanism- A String that indicates the authentication mechanism to use, e.g., "simple", "Kerberos", etc.- Returns:
- A new user identity.
- Throws:
ServiceException- in the event of service object failure;RemoteException- in the event of remote object failure.
-
getProfileDefinition
public ProfileDomain getProfileDefinition(String application) throws ServiceException, RemoteException Get the profile definition for an application.- Specified by:
getProfileDefinitionin interfaceUserServiceInterface- Parameters:
application- The application to get the profile definition for.- Returns:
- A ProfileDomain object for the application, or null if none is defined.
- Throws:
ServiceException- In the event of a service failure.RemoteException- in the event of a network problem.
-
loadProfile
public ProfileInterface loadProfile(UserContextInterface user, String application) throws RemoteException, ServiceException Get the profile object for the user from the user's connected repositories. The initialization information should describe how to retrieve the information, and the user should have access to the required repository(s) before making this call.- Specified by:
loadProfilein interfaceUserServiceInterface- Parameters:
user- The user to retrieve the profile for.application- The name of the application requesting profile information.- Returns:
- User's profile obtained from connected repositories.
- Throws:
ServiceException- in the event of Platform Service failure.RemoteException- in the event of remote object failure.
-
loadProfile
public ProfileInterface loadProfile(UserContextInterface searchContext, UserContextInterface user, String application) throws RemoteException, ServiceException Get the profile object for the user from the searchContext's connected repositories. The initialization information should describe how to retrieve the information, and the user should have access to the required repository(s) before making this call. This method allows a client to use one context (possibly privileged) to search for profile information for another user.- Specified by:
loadProfilein interfaceUserServiceInterface- Parameters:
searchContext- The context to use to perform the search. The repository connections in this context will be used to perform the search for the profile information.user- The user to retrieve the profile for.application- The name of the application requesting profile information.- Returns:
- User's profile obtained from the search context.
- Throws:
ServiceException- in the event of Service failure.RemoteException- in the event of remote object failure.
-
getProfile
public ProfileInterface getProfile(PersonInterface person, String application) throws ServiceException, RemoteException Get the profile for a Person object. This method is intended for use when an application has a Person object representing a person that's not actively using the application, but may have profile data that affects a current user's interaction with them. A primary use is going to be getting the URL for the personal repository from the profile when publishing to a DAV subscriber.- Specified by:
getProfilein interfaceUserServiceInterface- Parameters:
person- The person to retrieve the profile for.application- The application whose profile you want.- Returns:
- A profile object for the person and application requested, or null if it doesn't exist.
- Throws:
ServiceException- In the event of a repository failure.RemoteException- in the event of a network error.
-
createProfile
public ProfileInterface createProfile(UserContextInterface user, String application) throws ServiceException, RemoteException Create a new profile. This will create the new repository entry, and return the ProfileInterface to the user.- Specified by:
createProfilein interfaceUserServiceInterface- Parameters:
user- The UserContextInterface of the user for whom the Profile is being created.application- The application string for the new profile.- Returns:
- The new ProfileInterface.
- Throws:
ServiceException- in the event of a service failure.RemoteException- in the event of network failure.
-
createProfile
public ProfileInterface createProfile(UserContextInterface privUser, UserContextInterface user, String application) throws ServiceException, RemoteException Create a new profile. This will create the new repository entry, and return the ProfileInterface to the user.- Specified by:
createProfilein interfaceUserServiceInterface- Parameters:
privUser- A privileged user context to use to create the new profile entry in the repository.user- The UserContextInterface of the user for whom the Profile is being created.application- The application string for the new profile.- Returns:
- The new ProfileInterface.
- Throws:
ServiceException- in the event of a service failure.RemoteException- in the event of network failure.
-
loadUserCredentials
Get credential sets for a user. The service performs a search for the credentials and creates appropriate identities and adds them to the user context.- Specified by:
loadUserCredentialsin interfaceUserServiceInterface- Parameters:
user- The user context to use to search and update with identities.- Throws:
ServiceException- In the event of a repository failure.RemoteException- in the event of remote object failure.
-
loadUserCredentials
public void loadUserCredentials(UserContextInterface searchContext, UserContextInterface user) throws ServiceException, RemoteException Get the profile for a Person object. This method is intended for use when an application has a Person object representing a person that's not actively using the application, but may have profile data that affects a current user's interaction with them. A primary use is going to be getting the URL for the personal repository from the profile when publishing to a DAV subscriber.- Specified by:
loadUserCredentialsin interfaceUserServiceInterface- Parameters:
searchContext- The search context.user- The person to retrieve the profile for.- Throws:
ServiceException- In the event of a repository failure.RemoteException- in the event of a network error.
-
getGroups
public List<IdentityGroupInterface> getGroups(UserContextInterface user) throws ServiceException, RemoteException Get all the identity groups that a user belongs to. Search all the repositories the UserContext has a handle to to find groups.- Specified by:
getGroupsin interfaceUserServiceInterface- Parameters:
user- The UserContext to find groups for.- Returns:
- A List of com.sas.services.information.metadata.IdentityGroupInterface objects that represent the groups the user is a member of.
- Throws:
ServiceException- in the event of service object failure.RemoteException- in the event of remote object failure.
-
newUser
public UserContextInterface newUser(String uid, String password, String domain) throws RemoteException, ServiceException, UserInitializationException Create a new user context given a user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.- Returns:
- A new UserContextInterface for the user.
- Throws:
ServiceException- if an unrecoverable exception occurs.RemoteException- in the event of a network error.UserInitializationException- if an initialization exception occurs.
-
newUser
public UserContextInterface newUser(String uid, String password, String domain, String clientSource, String appSource) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user.clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of remote object failure.ServiceException- in the event of service failure.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(UserContext privUser, String uid, String password, String domain) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a privileged context, user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use the user's own authenticated connection to search for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of a network error.ServiceException- if an unrecoverable exception occurs.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(UserContextInterface privUser, String uid, String password, String domain) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a privileged context, user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use the user's own authenticated connection to search for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of a network error.ServiceException- if an unrecoverable exception occurs.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(UserContext privUser, String uid, String password, String domain, String clientSource, String appSource) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a privileged context, user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use the user's own authenticated connection to search for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of a network error.ServiceException- if an unrecoverable exception occurs.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(UserContextInterface privUser, String uid, String password, String domain, String clientSource, String appSource) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a privileged context, user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use the user's own authenticated connection to search for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of a network error.ServiceException- if an unrecoverable exception occurs.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(UserContext privUser, String uid, String password, String domain, String clientSource, String appSource, Map advancedOptions) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a privileged context, user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use the user's own authenticated connection to search for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.advancedOptions- Map<String, Object> of advanced options.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of a network error.ServiceException- if an unrecoverable exception occurs.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(UserContextInterface privUser, String uid, String password, String domain, String clientSource, String appSource, Map advancedOptions) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new user context given a privileged context, user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use the user's own authenticated connection to search for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.advancedOptions- Map<String, Object> of advanced options.- Returns:
- A new UserContextInterface for the user.
- Throws:
RemoteException- in the event of a network error.ServiceException- if an unrecoverable exception occurs.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser() throws ServiceException, RemoteException, UserInitializationException- Throws:
ServiceExceptionRemoteExceptionUserInitializationException
-
newUser
public UserContextInterface newUser(String clientSource, String appSource) throws ServiceException, RemoteException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new UserContext based on the current OS identity of the user.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.- Returns:
- An authenticated and initialized UserContext for the current user.
- Throws:
ServiceException- if an unrecoverable exception occurs.RemoteException- in the event of a network error.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUser
public UserContextInterface newUser(String clientSource, String appSource, Map advancedOptions) throws ServiceException, RemoteException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new UserContext based on the current OS identity of the user.- Specified by:
newUserin interfaceUserServiceInterface- Parameters:
clientSource- A String (normally an IP address) that indicates the client location that initiated the login request.appSource- A String that identifies the application that is initiating the request. This should either be the main Java class name or an identifiable application name.advancedOptions- Map<String, Object> of advanced options.- Returns:
- An authenticated and initialized UserContext for the current user.
- Throws:
ServiceException- if an unrecoverable exception occurs.RemoteException- in the event of a network error.UserInitializationException- in the event of possibly recoverable exceptions during UserContext initialization.
-
newUserWithInfoService
public UserContextInterface newUserWithInfoService(UserContext privUser, String uid, String password, String domain, InformationServiceInterface infoService) throws RemoteException, ServiceException, UserInitializationException Deprecated.This method should no longer be used. In order for the platform to effectively direct requests in a clustered environment, the Discovery Service needs to be able to select the correct available service rather than having the client specify one. If this method is used, the Information Service parameter will be ignored.Create a new user context given a user id, password, and authentication domain. This method will create the user context, a new user identity, and attempt to authenticate the user. If the identity fails to authenticate, a ServiceException will be thrown.- Specified by:
newUserWithInfoServicein interfaceUserServiceInterface- Parameters:
privUser- The user context to use to search for credentials that the user himself may not be allowed to see. This may be null in order to use use the user's authenticated connection to look for credentials.uid- The user ID for the new userpassword- The password for the new user.domain- The authentication domain for the user. A null domain will cause a ServiceException to be thrown.infoService- A handle to an InformationService to use to make any repository connections.- Returns:
- A new UserContextInterface for the user.
- Throws:
ServiceException- For authentication failure, or unrecoverable service failure.UserInitializationException- if an error occurs, but the UserContext may still be useful.RemoteException- in the event of a network error.
-
getSummaryData
Description copied from interface:UserServiceInterfaceGet the summary data regarding the active users.- Specified by:
getSummaryDatain interfaceUserServiceInterface- Parameters:
includeDetails- If true, the active user details and failure detail data will be included.- Returns:
- A List of
SummaryDataobjects. - Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
newRemoteUser
public UserContextInterface newRemoteUser(SubjectMatter subject) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new UserContext using a SubjectMatter object that is populated with the PFS principals and credentials of an authenticated user. This should generally not be used directly, but through the SubjectAuthenticator newAuthenticatedUser method.- Specified by:
newRemoteUserin interfaceUserServiceInterface- Parameters:
subject- A SubjectMatter object with the principals and credentials.- Returns:
- Authenticated user context
- Throws:
RemoteException- In the event of remote object failure.ServiceException- If a service level exception occurs.UserInitializationException- If a recoverable exception occurs setting up the UserContext.
-
newRemoteUser
public UserContextInterface newRemoteUser(SubjectMatter subject, Map advancedOptions) throws RemoteException, ServiceException, UserInitializationException Description copied from interface:UserServiceInterfaceCreate a new UserContext using a SubjectMatter object that is populated with the PFS principals and credentials of an authenticated user. This should generally not be used directly, but through the SubjectAuthenticator newAuthenticatedUser method.- Specified by:
newRemoteUserin interfaceUserServiceInterface- Parameters:
subject- A SubjectMatter object with the principals and credentials.advancedOptions- Map<String, Object> of advanced options.- Returns:
- Authenticated user context
- Throws:
RemoteException- In the event of remote object failure.ServiceException- If a service level exception occurs.UserInitializationException- If a recoverable exception occurs setting up the UserContext.
-
newAuthenticatedUser
public UserContextInterface newAuthenticatedUser(Subject subject) throws RemoteException, ServiceException, UserInitializationException Create a new UserContext based on the Subject provided. In order for this to make much sense, the subject should have been authenticated using one of the Foundation Services login modules.- Specified by:
newAuthenticatedUserin interfaceUserServiceInterface- Parameters:
subject- A javax.security.auth.Subject to use to create a new UserContext. If the subject is null, the current subject from the AccessController context will be used (set from a doAs). If that's null, a ServiceException will be thrown.- Returns:
- An initialized UserContext.
- Throws:
ServiceException- if a service error occurs.UserInitializationException- if there's a recoverable error during UserContext initialization.RemoteException- in the event of remote object failure.
-
setChallengeCallbackHandler
Set the object that will be used to handle credential challenge callbacks.- Specified by:
setChallengeCallbackHandlerin interfaceUserServiceInterface- Parameters:
handler- The credential callback handler. This object will have to be an implementation of the javax.security.auth.callback.CallbackHandler interface.- Throws:
RemoteException- In the event of a remote failure.
-
getChallengeCallbackHandler
Get the object that will handle credential challenge callbacks.- Specified by:
getChallengeCallbackHandlerin interfaceUserServiceInterface- Returns:
- The callback handler
- Throws:
RemoteException- In the event of a remote failure.
-
setGroupLoginEnabled
Description copied from interface:UserServiceInterfaceSet the UserService to allow group logins to be used to create User Contexts.- Specified by:
setGroupLoginEnabledin interfaceUserServiceInterface- Parameters:
groupLoginFlag- True to allow group logins, false to prevent them. The default at initialization is to disallow group logins.- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
getGroupLoginEnabled
Description copied from interface:UserServiceInterfaceGet the flag indicating if group logins are allowed to be used to create User Contexts.- Specified by:
getGroupLoginEnabledin interfaceUserServiceInterface- Returns:
- true if group logins are allowed, false otherwise.
- Throws:
ServiceException- If a service level error occurs.RemoteException- In the event of remote object failure.
-
logFormat
public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0) throws RemoteException - Throws:
RemoteException
-
logFormat
public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1) throws RemoteException - Throws:
RemoteException
-
logFormat
public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1, Object arg2) throws RemoteException - Throws:
RemoteException
-
logFormat
public void logFormat(org.apache.logging.log4j.Level level, String context, ResourceBundle bundle, String key, Object arg0, Object arg1, Object arg2, Object arg3) throws RemoteException - Throws:
RemoteException
-
logMessage
public void logMessage(org.apache.logging.log4j.Level level, String message) throws RemoteException - Throws:
RemoteException
-
logMessage
public void logMessage(org.apache.logging.log4j.Level level, String message, String context, Throwable t) throws RemoteException - Throws:
RemoteException
-
getUserCount
Description copied from interface:UserServiceInterfaceGet the count of users that are currently logged in.- Specified by:
getUserCountin interfaceUserServiceInterface- Returns:
- The number of active users in the UserService.
- Throws:
ServiceException- if a service level error occurs.RemoteException- In the event of remote object failure.
-
fromByteArray
Description copied from interface:UserServiceInterfaceCreate a UserContext from a byte array returned from theUserContext.toByteArray()method.- Specified by:
fromByteArrayin interfaceUserServiceInterface- Parameters:
data-- Returns:
- A UserContext created from the byte array data.
- Throws:
ServiceException- If a service level exception occurs.RemoteException- In the event of remote object failure.
-
resetInternalPassword
public void resetInternalPassword(String host, String port, String username, String oldPassword, String newPassword) throws ServiceException, RemoteException Description copied from interface:UserServiceInterfaceReset a user's internal metadata password. This will work even for an expired password,- Specified by:
resetInternalPasswordin interfaceUserServiceInterface- Parameters:
host- The DNS hostname where the metadata server is running.port- The IP port the metadata server is listening on.username- The Name of the Person whose internal password is being reset.oldPassword- The old internal password.newPassword- The new internal password.- Throws:
ServiceException- In the event of communication failure, or an error resetting the password.RemoteException- In the event of remote object failure.
-