Class ClientService


  • @Named
    public class ClientService
    extends Object
    Provides operations with clients.
    Version:
    October 22, 2016
    Author:
    Javier Rojas Blum, Yuriy Movchan Date: 04/15/2014
    • Field Detail

      • CLIENT_OBJECT_CLASSES

        protected static final String[] CLIENT_OBJECT_CLASSES
    • Constructor Detail

      • ClientService

        public ClientService()
    • Method Detail

      • persist

        public void persist​(io.jans.as.common.model.registration.Client client)
      • merge

        public void merge​(io.jans.as.common.model.registration.Client client)
      • authenticate

        public boolean authenticate​(String clientId,
                                    String password)
        Authenticate client.
        Parameters:
        clientId - Client inum.
        password - Client password.
        Returns:
        true if success, otherwise false.
      • getClient

        public Set<io.jans.as.common.model.registration.Client> getClient​(Collection<String> clientIds,
                                                                          boolean silent)
      • getClient

        public io.jans.as.common.model.registration.Client getClient​(String clientId)
      • isPublic

        public boolean isPublic​(String clientId)
      • isPublic

        public boolean isPublic​(io.jans.as.common.model.registration.Client client)
      • getClient

        public io.jans.as.common.model.registration.Client getClient​(String clientId,
                                                                     String registrationAccessToken)
      • generateRegistrationAccessToken

        public String generateRegistrationAccessToken()
      • rotateRegistrationAccessToken

        public void rotateRegistrationAccessToken​(io.jans.as.common.model.registration.Client client)
      • getClientsByDns

        public Set<io.jans.as.common.model.registration.Client> getClientsByDns​(Collection<String> dnList)
      • getClientsByDns

        public Set<io.jans.as.common.model.registration.Client> getClientsByDns​(Collection<String> dnList,
                                                                                boolean silently)
      • getClientByDn

        public io.jans.as.common.model.registration.Client getClientByDn​(String dn)
        Returns client by DN.
        Parameters:
        dn - dn of client
        Returns:
        Client
      • getCustomAttribute

        public io.jans.orm.model.base.CustomObjectAttribute getCustomAttribute​(io.jans.as.common.model.registration.Client client,
                                                                               String attributeName)
      • setCustomAttribute

        public void setCustomAttribute​(io.jans.as.common.model.registration.Client client,
                                       String attributeName,
                                       String attributeValue)
      • getAllClients

        public List<io.jans.as.common.model.registration.Client> getAllClients​(String[] returnAttributes)
      • getAllClients

        public List<io.jans.as.common.model.registration.Client> getAllClients​(String[] returnAttributes,
                                                                               int size)
      • buildClientDn

        public String buildClientDn​(String clientId)
      • remove

        public void remove​(io.jans.as.common.model.registration.Client client)
      • removeFromCache

        public void removeFromCache​(io.jans.as.common.model.registration.Client client)
      • updateAccessTime

        public void updateAccessTime​(io.jans.as.common.model.registration.Client client,
                                     boolean isUpdateLogonTime)
      • getAttribute

        public Object getAttribute​(io.jans.as.common.model.registration.Client client,
                                   String clientAttribute)
      • decryptSecret

        public String decryptSecret​(String encryptedClientSecret)
                             throws io.jans.util.security.StringEncrypter.EncryptionException
        Throws:
        io.jans.util.security.StringEncrypter.EncryptionException
      • encryptSecret

        public String encryptSecret​(String clientSecret)
                             throws io.jans.util.security.StringEncrypter.EncryptionException
        Throws:
        io.jans.util.security.StringEncrypter.EncryptionException