Class AuthorizationRestUtil
- java.lang.Object
-
- org.dspace.app.rest.authorization.AuthorizationRestUtil
-
@Component public class AuthorizationRestUtil extends Object
Utility class to manipulate the AuthorizationRest object- Author:
- Andrea Bollini (andrea.bollini at 4science.it)
-
-
Constructor Summary
Constructors Constructor Description AuthorizationRestUtil()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EPersongetEperson(Context context, String id)Get the eperson in the authorization extracting its uuid from the authorization business ID (Authorization.getID()) and retrieving the corresponding eperson object with theEPersonService.StringgetFeatureName(String id)Extract the feature name from the Authorization business ID.BaseObjectRestgetObject(Context context, String id)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
-
-
-
Method Detail
-
getFeatureName
public String getFeatureName(String id)
Extract the feature name from the Authorization business ID. SeeAuthorization.getID()- Parameters:
id- the Authorization business ID- Returns:
- the feature name
-
getObject
public BaseObjectRest getObject(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 contextid- the Authorization business ID. SeeAuthorization.getID()- Returns:
- the object addressed in the authorization
- Throws:
SQLException- if an error occur retrieving the data from the databaseIllegalArgumentException- if the specified id doesn't contain syntactically valid object information
-
getEperson
public EPerson getEperson(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 theEPersonService. Please note that reference to deleted eperson will result in an IllegalArgumentException- Parameters:
context- the DSpace contextid- the Authorization business ID. SeeAuthorization.getID()- Returns:
- the eperson addressed in the authorization or null if not specified.
- Throws:
SQLException- if an error occur retrieving the data from the databaseIllegalArgumentException- if the specified id doesn't contain syntactically valid object information
-
-