public class StudIPAPI extends Object
| Constructor and Description |
|---|
StudIPAPI()
Initializes a new
StudIPAPI instance. |
StudIPAPI(InputStream keyStore,
String password)
Initializes a new
StudIPAPI instance. |
StudIPAPI(List<org.apache.http.cookie.Cookie> cookies,
InputStream keyStore,
String password)
Initializes a new
StudIPAPI instance with cookies. |
| Modifier and Type | Method and Description |
|---|---|
void |
authenticate(String username,
String password)
Authenticates against the Shibboleth SSO.
|
de.femtopedia.studip.shib.ShibHttpResponse |
get(String url)
Performs a HTTP GET Request.
|
Contacts |
getContacts(String userID)
Returns data about the searched user's contacts.
|
Course |
getCourse(String courseID)
Returns data about the searched course.
|
Courses |
getCourses(String userID)
Returns data about the searched user's courses.
|
User |
getCurrentUserData()
Returns the currently logged in user's data.
|
<T> T |
getData(String api_url,
Class<T> obj_class)
Performs a HTTP GET Request and converts the site's content into the given Object type using Gson.
|
Events |
getEvents(String userID)
Returns data about the searched user's events.
|
Schedule |
getSchedule()
Returns data about the currently logged in user's schedule.
|
Schedule |
getSchedule(String userID)
Returns data about the currently logged in user's schedule.
|
Schedule |
getSchedule(String userID,
String semesterID)
Returns data about the currently logged in user's schedule.
|
Semester |
getSemester(String semesterID)
Returns data about the searched semester.
|
Semesters |
getSemesters()
Returns data about all semesters.
|
de.femtopedia.studip.shib.ShibbolethClient |
getShibbolethClient()
Returns the currently used
ShibbolethClient instance. |
User |
getUserData(String userID)
Returns data about the searched user.
|
void |
shutdown()
Shuts down the
ShibbolethClient. |
public StudIPAPI()
StudIPAPI instance.public StudIPAPI(InputStream keyStore, String password)
StudIPAPI instance.keyStore - A custom KeyStore as InputStream to set or nullpassword - The KeyStore's passwordpublic StudIPAPI(List<org.apache.http.cookie.Cookie> cookies, InputStream keyStore, String password)
StudIPAPI instance with cookies.cookies - the cookies to load into the Cookie StorekeyStore - A custom KeyStore as InputStream to set or nullpassword - The KeyStore's passwordpublic void authenticate(String username, String password) throws IOException, IllegalArgumentException, IllegalAccessException, IllegalStateException
username - The username to loginpassword - The password to loginIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the user credentials are not correctIllegalStateException - if cookies don't match the serverpublic de.femtopedia.studip.shib.ShibbolethClient getShibbolethClient()
ShibbolethClient instance.ShibbolethClient instancepublic de.femtopedia.studip.shib.ShibHttpResponse get(String url) throws IOException, IllegalArgumentException, IllegalAccessException
url - The URL to getShibHttpResponse representing the resultIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic <T> T getData(String api_url, Class<T> obj_class) throws IOException, IllegalArgumentException, IllegalAccessException
T - The wanted Generic typeapi_url - The URL to getobj_class - The class to cast toIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic User getCurrentUserData() throws IOException, IllegalArgumentException, IllegalAccessException
User objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic User getUserData(String userID) throws IOException, IllegalArgumentException, IllegalAccessException
userID - The user to search forUser objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Contacts getContacts(String userID) throws IOException, IllegalArgumentException, IllegalAccessException
userID - The user to search forContacts objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Events getEvents(String userID) throws IOException, IllegalArgumentException, IllegalAccessException
userID - The user to search forEvents objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Course getCourse(String courseID) throws IOException, IllegalArgumentException, IllegalAccessException
courseID - The course to search forCourse objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Courses getCourses(String userID) throws IOException, IllegalArgumentException, IllegalAccessException
userID - The user to search forCourses objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Semesters getSemesters() throws IOException, IllegalArgumentException, IllegalAccessException
Semesters objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Semester getSemester(String semesterID) throws IOException, IllegalArgumentException, IllegalAccessException
semesterID - The semester to search forSemester objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Schedule getSchedule() throws IOException, IllegalArgumentException, IllegalAccessException
Schedule objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Schedule getSchedule(String userID) throws IOException, IllegalArgumentException, IllegalAccessException
getSchedule() INSTEAD UNTIL THE PROBLEM IS FIXED!userID - The user to search forSchedule objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic Schedule getSchedule(String userID, String semesterID) throws IOException, IllegalArgumentException, IllegalAccessException
getSchedule() INSTEAD UNTIL THE PROBLEM IS FIXED!userID - The user to search forsemesterID - The semester to search forSchedule objectIOException - if reading errors occurIllegalArgumentException - if the header values are brokenIllegalAccessException - if the session isn't validpublic void shutdown()
ShibbolethClient.Copyright © 2019. All rights reserved.