org.mythtv.services.api.connect
Class MythAccessFactory

java.lang.Object
  extended by org.mythtv.services.api.connect.MythAccessFactory

public class MythAccessFactory
extends java.lang.Object


Constructor Summary
MythAccessFactory()
           
 
Method Summary
static ApiVersion getMythVersion(java.lang.String baseUri)
          Gets the api version of the given backend
static
<T> T
getServiceTemplateApiByType(java.lang.Class<T> serviceClass, java.lang.String baseUri)
          Get the service interface instance by inferring the mythtv version by providing the service class
static
<T> T
getServiceTemplateApiByType(java.lang.Class<T> serviceClass, java.lang.String baseUri, java.util.logging.Level logLevel)
          Get the service interface instance by inferring the mythtv version by providing the service class
static java.lang.Object getServiceTemplateApiByVersion(ApiVersion version, java.lang.String baseUri)
          Get the service interface instance by using the mythtv version
static java.lang.Object getServiceTemplateApiByVersion(ApiVersion version, java.lang.String baseUri, java.util.logging.Level logLevel)
          Get the service interface instance by using the mythtv version
static boolean isServerReachable(java.lang.String baseUrl)
          Check if the server is reachable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MythAccessFactory

public MythAccessFactory()
Method Detail

getServiceTemplateApiByType

public static <T> T getServiceTemplateApiByType(java.lang.Class<T> serviceClass,
                                                java.lang.String baseUri,
                                                java.util.logging.Level logLevel)
Get the service interface instance by inferring the mythtv version by providing the service class

Parameters:
serviceClass - the service class to use to infer the backend version
baseUri - the backend base uri
logLevel - the logging level to use
Returns:
the mythservice api instance or null if no version handling exists

getServiceTemplateApiByType

public static <T> T getServiceTemplateApiByType(java.lang.Class<T> serviceClass,
                                                java.lang.String baseUri)
Get the service interface instance by inferring the mythtv version by providing the service class

Parameters:
serviceClass - the service class to use to infer the backend version
baseUri - the backend base uri
Returns:
the mythservice api instance or null if no version handling exists

getServiceTemplateApiByVersion

public static java.lang.Object getServiceTemplateApiByVersion(ApiVersion version,
                                                              java.lang.String baseUri)
Get the service interface instance by using the mythtv version

Parameters:
version - the version to use
baseUri - the backend base uri
Returns:
the mythservice api instance or null if no version handling exists

getServiceTemplateApiByVersion

public static java.lang.Object getServiceTemplateApiByVersion(ApiVersion version,
                                                              java.lang.String baseUri,
                                                              java.util.logging.Level logLevel)
Get the service interface instance by using the mythtv version

Parameters:
version - the version to use
baseUri - the backend base uri
logLevel - the logging level to use
Returns:
the mythservice api instance or null if no version handling exists

getMythVersion

public static ApiVersion getMythVersion(java.lang.String baseUri)
Gets the api version of the given backend

Parameters:
baseUri - the backend services api url
Returns:
the Api version

isServerReachable

public static boolean isServerReachable(java.lang.String baseUrl)
Check if the server is reachable

Parameters:
baseUrl - The url of the server to test
Returns:
true if reachable otherwise false.