Package dev.le_app.mcss_api_java
Class MCSSApi
java.lang.Object
dev.le_app.mcss_api_java.MCSSApi
The main class of the API.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInfo()Get general information about the MCSS installintGet the number of servers.intgetServerCount(ServerFilter filter) Get the number of servers.intgetServerCount(ServerFilter filter, String serverTypeID) Get the number of servers.Get the list of servers
-
Field Details
-
IP
-
token
-
version
-
expectedVersion
-
allowUnsafeSSL
-
-
Constructor Details
-
MCSSApi
public MCSSApi(String IP, String token) throws APIUnauthorizedException, APIVersionMismatchException, IOException Create a new MCSSApi object- Parameters:
IP- The IP of the MCSS servertoken- The token of the MCSS server- Throws:
APIUnauthorizedException- If the token is invalidAPIVersionMismatchException- If the API version of the MCSS server is not the same as the expected versionIOException- If there is an error connecting to the MCSS server
-
MCSSApi
public MCSSApi(String IP, String token, Boolean allowUnsafeSSL) throws APIUnauthorizedException, APIVersionMismatchException, IOException, NoSuchAlgorithmException, KeyManagementException Get the API object- Parameters:
IP- The IP of the MCSS servertoken- The token of the MCSS serverallowUnsafeSSL- True if you want to avoid checking the SSL certificate- Throws:
APIUnauthorizedException- If the token is invalidAPIVersionMismatchException- If the API version is not the same as the expected versionIOException- If there is an error while connecting to the APIKeyManagementException- If there is an error with the KeyManagmentNoSuchAlgorithmException- If there is an error with the SSLContext
-
-
Method Details
-
getInfo
Get general information about the MCSS install- Returns:
- Info object containing the information
- Throws:
IOException- General IO errorAPIUnauthorizedException- API token is invalid/expired
-
getServers
public ArrayList<Server> getServers() throws APIUnauthorizedException, APINotFoundException, IOException, APINoServerAccessExceptionGet the list of servers- Returns:
- ArrayList of servers
- Throws:
APIUnauthorizedException- API token is invalid/expiredAPINotFoundException- API not foundIOException- General IO errorAPINoServerAccessException- API does not have access to any server
-
getServerCount
Get the number of servers.- Returns:
- number of servers
- Throws:
APIUnauthorizedException- if the APIKey is invalidIOException- if there is an error with the connection
-
getServerCount
Get the number of servers.- Parameters:
filter- the filter to use- Returns:
- number of servers
- Throws:
APIUnauthorizedException- if the APIKey is invalidIOException- if there is an error with the connection
-
getServerCount
public int getServerCount(ServerFilter filter, String serverTypeID) throws APIUnauthorizedException, IOException Get the number of servers. Only used for the servertype filter.- Parameters:
filter- the ServerFilter to useserverTypeID- Only required if the filter is FILTER- Returns:
- number of servers
- Throws:
APIUnauthorizedException- if the APIKey is invalidIOException- if there is an error with the connection
-