Package org.dspace.app.sherpa.v2
Class SHERPAResponse
- java.lang.Object
-
- org.dspace.app.sherpa.v2.SHERPAResponse
-
public class SHERPAResponse extends Object
Model class for the SHERPAv2 API (JSON) response for a publication (journal) search The structure and approached used is quite different to the simple v1 API used previously The structure is based on journal data, which in turn contains data about publishers and policies- Author:
- Kim Shepherd
- See Also:
SHERPAJournal
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSHERPAResponse.SHERPAFormat
-
Constructor Summary
Constructors Constructor Description SHERPAResponse(InputStream input, SHERPAResponse.SHERPAFormat format)Parse SHERPA v2 API for a given formatSHERPAResponse(String message)Create new response object to be handled as an error
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<SHERPAJournal>getJournals()StringgetMessage()SHERPASystemMetadatagetMetadata()booleanisError()voidsetMessage(String message)
-
-
-
Constructor Detail
-
SHERPAResponse
public SHERPAResponse(InputStream input, SHERPAResponse.SHERPAFormat format) throws IOException
Parse SHERPA v2 API for a given format- Parameters:
input- - input stream from the HTTP response contentformat- - requested format- Throws:
IOException
-
SHERPAResponse
public SHERPAResponse(String message)
Create new response object to be handled as an error- Parameters:
message- - the message to render in logs or error pages
-
-
Method Detail
-
isError
public boolean isError()
-
getMessage
public String getMessage()
-
setMessage
public void setMessage(String message)
-
getJournals
public List<SHERPAJournal> getJournals()
-
getMetadata
public SHERPASystemMetadata getMetadata()
-
-