Class AuthorizationRestUtil


  • @Component
    public class AuthorizationRestUtil
    extends Object
    Utility class to manipulate the AuthorizationRest object
    Author:
    Andrea Bollini (andrea.bollini at 4science.it)
    • Constructor Detail

      • AuthorizationRestUtil

        public AuthorizationRestUtil()
    • Method Detail

      • getFeatureName

        public String getFeatureName​(String id)
        Extract the feature name from the Authorization business ID. See Authorization.getID()
        Parameters:
        id - the Authorization business ID
        Returns:
        the feature name
      • getObject

        public BaseObjectRest getObject​(org.dspace.core.Context context,
                                        String id)
                                 throws SQLException
        Get the object addressed in the authorization extracting its type and primary key from the authorization business ID (Authorization.getID()) and using the appropriate service
        Parameters:
        context - the DSpace context
        id - the Authorization business ID. See Authorization.getID()
        Returns:
        the object addressed in the authorization
        Throws:
        SQLException - if an error occur retrieving the data from the database
        IllegalArgumentException - if the specified id doesn't contain syntactically valid object information
      • getEperson

        public org.dspace.eperson.EPerson getEperson​(org.dspace.core.Context context,
                                                     String id)
                                              throws SQLException
        Get the eperson in the authorization extracting its uuid from the authorization business ID (Authorization.getID()) and retrieving the corresponding eperson object with the EPersonService. Please note that reference to deleted eperson will result in an IllegalArgumentException
        Parameters:
        context - the DSpace context
        id - the Authorization business ID. See Authorization.getID()
        Returns:
        the eperson addressed in the authorization or null if not specified.
        Throws:
        SQLException - if an error occur retrieving the data from the database
        IllegalArgumentException - if the specified id doesn't contain syntactically valid object information