Search in sources :

Example 1 with RemoteFetchConfigurationGetResponse

use of org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RemoteFetchConfigurationGetResponse in project identity-api-server by wso2.

the class ServerRemoteFetchConfigManagementService method createRemoteFetchConfigurationResponse.

/**
 * This method is used to create GET response from remote fetch configuration id.
 *
 * @param remoteFetchConfiguration remote fetch configuration domain object.
 * @return RemoteFetchConfigurationGetResponse.
 * @throws RemoteFetchCoreException RemoteFetchCoreException
 */
private RemoteFetchConfigurationGetResponse createRemoteFetchConfigurationResponse(RemoteFetchConfiguration remoteFetchConfiguration) throws RemoteFetchCoreException {
    RemoteFetchConfigurationGetResponse remoteFetchConfigurationGetResponse = new RemoteFetchConfigurationGetResponse();
    ActionListenerAttributes actionListenerAttributes = createActionListenerAttributeProperties(remoteFetchConfiguration);
    RepositoryManagerAttributes repositoryManagerAttributes = createRepositoryManagerAttributeProperties(remoteFetchConfiguration);
    remoteFetchConfigurationGetResponse.setActionListenerAttributes(actionListenerAttributes);
    remoteFetchConfigurationGetResponse.setRepositoryManagerAttributes(repositoryManagerAttributes);
    remoteFetchConfigurationGetResponse.setConfigurationDeployerAttributes(null);
    setIfNotNull(remoteFetchConfiguration.getRemoteFetchConfigurationId(), remoteFetchConfigurationGetResponse::setId);
    setIfNotNull(remoteFetchConfiguration.isEnabled(), remoteFetchConfigurationGetResponse::setIsEnabled);
    setIfNotNull(remoteFetchConfiguration.getRemoteFetchName(), remoteFetchConfigurationGetResponse::setRemoteFetchName);
    setIfNotNull(remoteFetchConfiguration.getRepositoryManagerType(), remoteFetchConfigurationGetResponse::setRepositoryManagerType);
    setIfNotNull(remoteFetchConfiguration.getConfigurationDeployerType(), remoteFetchConfigurationGetResponse::setConfigurationDeployerType);
    setIfNotNull(remoteFetchConfiguration.getRepositoryManagerType(), remoteFetchConfigurationGetResponse::setRepositoryManagerType);
    StatusListResponse statusListResponse = this.createStatusListResponse(RemoteFetchServiceHolder.getRemoteFetchConfigurationService().getDeploymentRevisions(remoteFetchConfiguration.getRemoteFetchConfigurationId()));
    remoteFetchConfigurationGetResponse.setStatus(statusListResponse);
    return remoteFetchConfigurationGetResponse;
}
Also used : RemoteFetchConfigurationGetResponse(org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RemoteFetchConfigurationGetResponse) ActionListenerAttributes(org.wso2.carbon.identity.api.server.fetch.remote.v1.model.ActionListenerAttributes) StatusListResponse(org.wso2.carbon.identity.api.server.fetch.remote.v1.model.StatusListResponse) RepositoryManagerAttributes(org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RepositoryManagerAttributes)

Aggregations

ActionListenerAttributes (org.wso2.carbon.identity.api.server.fetch.remote.v1.model.ActionListenerAttributes)1 RemoteFetchConfigurationGetResponse (org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RemoteFetchConfigurationGetResponse)1 RepositoryManagerAttributes (org.wso2.carbon.identity.api.server.fetch.remote.v1.model.RepositoryManagerAttributes)1 StatusListResponse (org.wso2.carbon.identity.api.server.fetch.remote.v1.model.StatusListResponse)1