Class RemoteConnectionServiceImpl
- java.lang.Object
-
- org.onebusaway.admin.service.impl.RemoteConnectionServiceImpl
-
- All Implemented Interfaces:
RemoteConnectionService
@Component public class RemoteConnectionServiceImpl extends Object implements RemoteConnectionService
-
-
Constructor Summary
Constructors Constructor Description RemoteConnectionServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getContent(String url)
Opens a connection to the remote server and retrieves the content.String
getContent(String url, String sessionId)
<T> T
postBinaryData(String url, File data, Class<T> responseType)
Posts binary data to the given url and returns response of the given type<T> T
postBinaryData(String url, File data, String contentType, Class<T> responseType)
Posts binary data to the given url and returns response of the given typeString
postContent(String url, Map<String,String> params)
String
postContent(String url, Map<String,String> params, String sessionId)
-
-
-
Method Detail
-
postContent
public String postContent(String url, Map<String,String> params, String sessionId)
- Specified by:
postContent
in interfaceRemoteConnectionService
-
postContent
public String postContent(String url, Map<String,String> params)
- Specified by:
postContent
in interfaceRemoteConnectionService
-
getContent
public String getContent(String url, String sessionId)
- Specified by:
getContent
in interfaceRemoteConnectionService
-
getContent
public String getContent(String url)
Description copied from interface:RemoteConnectionService
Opens a connection to the remote server and retrieves the content. Content is returned as string separated by new line- Specified by:
getContent
in interfaceRemoteConnectionService
- Parameters:
url
- url of the remote server- Returns:
- the required content as string
-
postBinaryData
public <T> T postBinaryData(String url, File data, Class<T> responseType)
Description copied from interface:RemoteConnectionService
Posts binary data to the given url and returns response of the given type- Specified by:
postBinaryData
in interfaceRemoteConnectionService
- Parameters:
url
- remote server urldata
- binary data to post, posted as application/octet-streamresponseType
- desired type of post response- Returns:
- response returned by remote server
-
postBinaryData
public <T> T postBinaryData(String url, File data, String contentType, Class<T> responseType)
Description copied from interface:RemoteConnectionService
Posts binary data to the given url and returns response of the given type- Specified by:
postBinaryData
in interfaceRemoteConnectionService
- Parameters:
url
- remote server urldata
- binary data to postcontentType
- the Media type to use to post the data asresponseType
- desired type of post response- Returns:
- response returned by remote server
-
-