public class MMSUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MMSUtils.HttpRequestType |
static class |
MMSUtils.JsonBlobType |
Constructor and Description |
---|
MMSUtils() |
Modifier and Type | Method and Description |
---|---|
static org.apache.http.client.methods.HttpRequestBase |
buildImageRequest(org.apache.http.client.utils.URIBuilder requestUri,
java.io.File sendFile)
General purpose method for making http requests for file upload.
|
static org.apache.http.client.methods.HttpRequestBase |
buildRequest(MMSUtils.HttpRequestType type,
org.apache.http.client.utils.URIBuilder requestUri)
Convenience / clarity method for making http requests for JSON objects withoout body.
|
static org.apache.http.client.methods.HttpRequestBase |
buildRequest(MMSUtils.HttpRequestType type,
org.apache.http.client.utils.URIBuilder requestUri,
java.io.File sendData,
org.apache.http.entity.ContentType contentType)
General purpose method for making http requests for JSON objects.
|
static java.io.File |
createEntityFile(java.lang.Class<?> clazz,
org.apache.http.entity.ContentType contentType,
java.util.Collection nodes,
MMSUtils.JsonBlobType jsonBlobType) |
static java.lang.String |
getCredentialsTicket(com.nomagic.magicdraw.core.Project project,
java.lang.String username,
java.lang.String password,
com.nomagic.task.ProgressStatus progressStatus) |
static java.lang.String |
getCredentialsTicket(java.lang.String baseUrl,
java.lang.String username,
java.lang.String password,
com.nomagic.task.ProgressStatus progressStatus) |
static java.lang.String |
getDefaultSiteName(com.nomagic.ci.persistence.IProject iProject) |
static com.fasterxml.jackson.databind.node.ObjectNode |
getElement(com.nomagic.magicdraw.core.Project project,
java.lang.String elementId,
com.nomagic.task.ProgressStatus progressStatus) |
static java.io.File |
getElementRecursively(com.nomagic.magicdraw.core.Project project,
java.lang.String elementId,
int depth,
com.nomagic.task.ProgressStatus progressStatus) |
static java.io.File |
getElements(com.nomagic.magicdraw.core.Project project,
java.util.Collection<java.lang.String> elementIds,
com.nomagic.task.ProgressStatus progressStatus) |
static java.io.File |
getElementsRecursively(com.nomagic.magicdraw.core.Project project,
java.util.Collection<java.lang.String> elementIds,
int depth,
com.nomagic.task.ProgressStatus progressStatus) |
static java.util.concurrent.atomic.AtomicReference<java.lang.Exception> |
getLastException() |
static java.lang.String |
getMmsOrg(com.nomagic.magicdraw.core.Project project) |
static java.lang.String |
getServerUrl(com.nomagic.magicdraw.core.Project project) |
static org.apache.http.client.utils.URIBuilder |
getServiceOrgsUri(com.nomagic.magicdraw.core.Project project)
Returns a URIBuilder object with a path = "/alfresco/service/orgs"
|
static org.apache.http.client.utils.URIBuilder |
getServiceOrgsUri(java.lang.String baseUrl) |
static org.apache.http.client.utils.URIBuilder |
getServiceProjectsRefsElementsUri(com.nomagic.magicdraw.core.Project project)
Returns a URIBuilder object with a path = "/alfresco/service/projects/{$PROJECT_ID}/refs/{REF_ID}/elements"
if element is not null
|
static org.apache.http.client.utils.URIBuilder |
getServiceProjectsRefsUri(com.nomagic.magicdraw.core.Project project)
Returns a URIBuilder object with a path = "/alfresco/service/projects/{$PROJECT_ID}/refs"
|
static org.apache.http.client.utils.URIBuilder |
getServiceProjectsRefsUri(java.lang.String baseUrl,
java.lang.String projectId) |
static org.apache.http.client.utils.URIBuilder |
getServiceProjectsUri(com.nomagic.magicdraw.core.Project project)
Returns a URIBuilder object with a path = "/alfresco/service/projects"
|
static org.apache.http.client.utils.URIBuilder |
getServiceProjectsUri(java.lang.String baseUrl) |
static org.apache.http.client.utils.URIBuilder |
getServiceUri(com.nomagic.magicdraw.core.Project project)
Returns a URIBuilder object with a path = "/alfresco/service".
|
static org.apache.http.client.utils.URIBuilder |
getServiceUri(java.lang.String baseUrl) |
static java.io.File |
sendMMSRequest(com.nomagic.magicdraw.core.Project project,
org.apache.http.client.methods.HttpRequestBase request) |
static java.io.File |
sendMMSRequest(com.nomagic.magicdraw.core.Project project,
org.apache.http.client.methods.HttpRequestBase request,
com.nomagic.task.ProgressStatus progressStatus) |
static java.io.File |
sendMMSRequest(com.nomagic.magicdraw.core.Project project,
org.apache.http.client.methods.HttpRequestBase request,
com.nomagic.task.ProgressStatus progressStatus,
com.fasterxml.jackson.databind.node.ObjectNode responseJson)
General purpose method for sending a constructed http request via http client.
|
static java.lang.String |
validateCredentialsTicket(com.nomagic.magicdraw.core.Project project,
java.lang.String ticket,
com.nomagic.task.ProgressStatus progressStatus) |
public static java.util.concurrent.atomic.AtomicReference<java.lang.Exception> getLastException()
public static com.fasterxml.jackson.databind.node.ObjectNode getElement(com.nomagic.magicdraw.core.Project project, java.lang.String elementId, com.nomagic.task.ProgressStatus progressStatus) throws java.io.IOException, ServerException, java.net.URISyntaxException
java.io.IOException
ServerException
java.net.URISyntaxException
public static java.io.File getElementRecursively(com.nomagic.magicdraw.core.Project project, java.lang.String elementId, int depth, com.nomagic.task.ProgressStatus progressStatus) throws java.io.IOException, ServerException, java.net.URISyntaxException
java.io.IOException
ServerException
java.net.URISyntaxException
public static java.io.File getElements(com.nomagic.magicdraw.core.Project project, java.util.Collection<java.lang.String> elementIds, com.nomagic.task.ProgressStatus progressStatus) throws java.io.IOException, ServerException, java.net.URISyntaxException
elementIds
- collection of elements to get mms data forproject
- project to checkprogressStatus
- progress status object, can be nullServerException
java.io.IOException
java.net.URISyntaxException
public static java.io.File getElementsRecursively(com.nomagic.magicdraw.core.Project project, java.util.Collection<java.lang.String> elementIds, int depth, com.nomagic.task.ProgressStatus progressStatus) throws ServerException, java.io.IOException, java.net.URISyntaxException
elementIds
- collection of elements to get mms data fordepth
- depth to recurse through child elements. takes priority over recurse fieldproject
- project to checkprogressStatus
- progress status object, can be nullServerException
java.io.IOException
java.net.URISyntaxException
public static java.lang.String getCredentialsTicket(com.nomagic.magicdraw.core.Project project, java.lang.String username, java.lang.String password, com.nomagic.task.ProgressStatus progressStatus) throws ServerException, java.io.IOException, java.net.URISyntaxException
ServerException
java.io.IOException
java.net.URISyntaxException
public static java.lang.String getCredentialsTicket(java.lang.String baseUrl, java.lang.String username, java.lang.String password, com.nomagic.task.ProgressStatus progressStatus) throws ServerException, java.io.IOException, java.net.URISyntaxException
ServerException
java.io.IOException
java.net.URISyntaxException
public static java.lang.String validateCredentialsTicket(com.nomagic.magicdraw.core.Project project, java.lang.String ticket, com.nomagic.task.ProgressStatus progressStatus) throws ServerException, java.io.IOException, java.net.URISyntaxException
ServerException
java.io.IOException
java.net.URISyntaxException
public static org.apache.http.client.methods.HttpRequestBase buildImageRequest(org.apache.http.client.utils.URIBuilder requestUri, java.io.File sendFile) throws java.io.IOException, java.net.URISyntaxException
requestUri
- URI to send the request to. Methods to generate this URI are available in the class.sendFile
- File to send as an entity/body along with the requestjava.io.IOException
java.net.URISyntaxException
public static org.apache.http.client.methods.HttpRequestBase buildRequest(MMSUtils.HttpRequestType type, org.apache.http.client.utils.URIBuilder requestUri, java.io.File sendData, org.apache.http.entity.ContentType contentType) throws java.io.IOException, java.net.URISyntaxException
type
- Type of request, as selected from one of the options in the inner enum.requestUri
- URI to send the request to. Methods to generate this URI are available in the class.sendData
- Data to send as an entity/body along with the request, if desired. Support for GET and DELETE
with body is included.java.io.IOException
java.net.URISyntaxException
public static org.apache.http.client.methods.HttpRequestBase buildRequest(MMSUtils.HttpRequestType type, org.apache.http.client.utils.URIBuilder requestUri) throws java.io.IOException, java.net.URISyntaxException
type
- Type of request, as selected from one of the options in the inner enum.requestUri
- URI to send the request to. Methods to generate this URI are available in the class.java.io.IOException
java.net.URISyntaxException
public static java.io.File createEntityFile(java.lang.Class<?> clazz, org.apache.http.entity.ContentType contentType, java.util.Collection nodes, MMSUtils.JsonBlobType jsonBlobType) throws java.io.IOException
java.io.IOException
public static java.io.File sendMMSRequest(com.nomagic.magicdraw.core.Project project, org.apache.http.client.methods.HttpRequestBase request, com.nomagic.task.ProgressStatus progressStatus, com.fasterxml.jackson.databind.node.ObjectNode responseJson) throws java.io.IOException, ServerException, java.net.URISyntaxException
request
- java.io.IOException
ServerException
java.net.URISyntaxException
public static java.io.File sendMMSRequest(com.nomagic.magicdraw.core.Project project, org.apache.http.client.methods.HttpRequestBase request) throws java.io.IOException, ServerException, java.net.URISyntaxException
java.io.IOException
ServerException
java.net.URISyntaxException
public static java.io.File sendMMSRequest(com.nomagic.magicdraw.core.Project project, org.apache.http.client.methods.HttpRequestBase request, com.nomagic.task.ProgressStatus progressStatus) throws java.io.IOException, ServerException, java.net.URISyntaxException
java.io.IOException
ServerException
java.net.URISyntaxException
public static java.lang.String getServerUrl(com.nomagic.magicdraw.core.Project project) throws java.lang.IllegalStateException
project
- java.lang.IllegalStateException
public static java.lang.String getMmsOrg(com.nomagic.magicdraw.core.Project project) throws java.io.IOException, java.net.URISyntaxException, ServerException
java.io.IOException
java.net.URISyntaxException
ServerException
public static org.apache.http.client.utils.URIBuilder getServiceUri(com.nomagic.magicdraw.core.Project project)
project
- The project to gather the mms url and site name information fromjava.net.URISyntaxException
public static org.apache.http.client.utils.URIBuilder getServiceUri(java.lang.String baseUrl)
public static org.apache.http.client.utils.URIBuilder getServiceOrgsUri(com.nomagic.magicdraw.core.Project project)
project
- The project to gather the mms url and site name information frompublic static org.apache.http.client.utils.URIBuilder getServiceOrgsUri(java.lang.String baseUrl)
public static org.apache.http.client.utils.URIBuilder getServiceProjectsUri(com.nomagic.magicdraw.core.Project project)
project
- The project to gather the mms url and site name information frompublic static org.apache.http.client.utils.URIBuilder getServiceProjectsUri(java.lang.String baseUrl)
public static org.apache.http.client.utils.URIBuilder getServiceProjectsRefsUri(com.nomagic.magicdraw.core.Project project)
project
- The project to gather the mms url and site name information frompublic static org.apache.http.client.utils.URIBuilder getServiceProjectsRefsUri(java.lang.String baseUrl, java.lang.String projectId)
public static org.apache.http.client.utils.URIBuilder getServiceProjectsRefsElementsUri(com.nomagic.magicdraw.core.Project project)
project
- The project to gather the mms url and site name information frompublic static java.lang.String getDefaultSiteName(com.nomagic.ci.persistence.IProject iProject)