@Override
 public String getCiSvnPath() throws PhrescoException {
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(configuration.getServerPath() + FrameworkConstants.REST_CI_SVN_PATH);
   return resource.accept(MediaType.TEXT_PLAIN).get(String.class);
 }
 private List<ApplicationType> getApplicationTypesFromServer() throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.getApplicationTypesFromServer()");
   }
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   Client client = ClientHelper.createClient();
   WebResource resource = client.resource(configuration.getServerPath() + REST_APPS_PATH);
   Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);
   GenericType<List<ApplicationType>> genericType = new GenericType<List<ApplicationType>>() {};
   return builder.get(genericType);
 }
 @Override
 public List<Reports> getReports(String techId) throws PhrescoException {
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(
           configuration.getServerPath() + FrameworkConstants.REST_REPORTS + "/" + techId);
   Builder builder = resource.accept(MediaType.APPLICATION_JSON);
   GenericType<List<Reports>> genericType = new GenericType<List<Reports>>() {};
   List<Reports> reportList = builder.get(genericType);
   return reportList;
 }
  public List<Environment> getEnvInfoFromService() throws PhrescoException {
    if (debugEnabled) {
      S_LOGGER.debug("Entering Method ServiceManagerImpl.getEnvFromService()");
    }
    Client client = ClientHelper.createClient();
    FrameworkConfiguration frameworkConfig = PhrescoFrameworkFactory.getFrameworkConfig();
    WebResource resource = client.resource(frameworkConfig.getServerPath() + REST_ENVE_PATH);
    Builder builder = resource.accept(MediaType.APPLICATION_JSON_TYPE);

    GenericType<List<Environment>> genericType = new GenericType<List<Environment>>() {};
    return builder.get(genericType);
  }
  public ClientResponse getEmailExtPlugin() throws PhrescoException {
    if (debugEnabled) {
      S_LOGGER.debug("Entering Method ServiceManagerImpl.getEmailExtPlugin");
    }

    Client client = ClientHelper.createClient();
    FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
    WebResource resource =
        client.resource(configuration.getServerPath() + FrameworkConstants.REST_CI_MAIL_PLUGIN);
    resource.accept(MediaType.APPLICATION_OCTET_STREAM);
    ClientResponse response = resource.get(ClientResponse.class);
    return response;
  }
 @Override
 public ClientResponse sendReport(LogInfo loginfo) throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.sendReport(LogInfo loginfo)");
   }
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(configuration.getServerPath() + FrameworkConstants.REST_LOG_PATH);
   ClientResponse response =
       resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, loginfo);
   return response;
 }
  public InputStream getMailerXml() throws PhrescoException {
    if (debugEnabled) {
      S_LOGGER.debug("Entering Method ServiceManagerImpl.getMailerXml");
    }

    Client client = ClientHelper.createClient();
    FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
    WebResource resource =
        client.resource(configuration.getServerPath() + FrameworkConstants.REST_CI_MAILER_HOME);
    resource.accept(MediaType.APPLICATION_XML);
    ClientResponse response = resource.type(MediaType.APPLICATION_XML).get(ClientResponse.class);
    InputStream is = response.getEntityInputStream();
    return is;
  }
 @Override
 public List<AdminConfigInfo> getAdminConfig() throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.getAdminConfig()");
   }
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(configuration.getServerPath() + FrameworkConstants.REST_ADMIN_CONFIG_PATH);
   resource.accept(MediaType.APPLICATION_JSON_TYPE);
   ClientResponse clientResponse =
       resource.type(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);
   GenericType<List<AdminConfigInfo>> genericType = new GenericType<List<AdminConfigInfo>>() {};
   return clientResponse.getEntity(genericType);
 }
 public User doLogin(Credentials credentials) throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.doLogin(Credentials credentials)");
   }
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(configuration.getServerPath() + FrameworkConstants.REST_LOGIN_PATH);
   resource.accept(MediaType.APPLICATION_JSON_TYPE);
   ClientResponse response =
       resource.type(MediaType.APPLICATION_JSON_TYPE).post(ClientResponse.class, credentials);
   GenericType<User> genericType = new GenericType<User>() {};
   User userInfo = response.getEntity(genericType);
   return userInfo;
 }
Ejemplo n.º 10
0
 public List<DownloadInfo> getDownloadsFromService(DownloadPropertyInfo downloadPropertyInfo)
     throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.loadVideosFromService()");
   }
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   Client client = ClientHelper.createClient();
   WebResource resource = client.resource(configuration.getServerPath() + REST_DOWNLOADS_PATH);
   ClientResponse response =
       resource
           .type(MediaType.APPLICATION_JSON_TYPE)
           .post(ClientResponse.class, downloadPropertyInfo);
   GenericType<List<DownloadInfo>> genericType = new GenericType<List<DownloadInfo>>() {};
   List<DownloadInfo> downloadInfo = response.getEntity(genericType);
   return downloadInfo;
 }
Ejemplo n.º 11
0
 public ClientResponse updateDocumentProject(ProjectInfo info) throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.updateProject(ProjectInfo info)");
   }
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(
           configuration.getServerPath() + FrameworkConstants.REST_APPS_UPDATEDOC_PATH);
   resource.accept(MediaType.APPLICATION_OCTET_STREAM);
   if (debugEnabled) {
     S_LOGGER.debug("updateDocumentProject() ProjectName = " + info.getName());
   }
   ClientResponse response =
       resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, info);
   return response;
 }
Ejemplo n.º 12
0
 public ClientResponse createProject(ProjectInfo info, User userInfo) throws PhrescoException {
   if (debugEnabled) {
     S_LOGGER.debug("Entering Method ServiceManagerImpl.createProject(ProjectInfo info)");
   }
   Client client = ClientHelper.createClient();
   FrameworkConfiguration configuration = PhrescoFrameworkFactory.getFrameworkConfig();
   WebResource resource =
       client.resource(configuration.getServerPath() + FrameworkConstants.REST_APPS_PATH);
   resource.accept(MediaType.APPLICATION_OCTET_STREAM);
   if (debugEnabled) {
     S_LOGGER.debug("createProject() ProjectName = " + info.getName());
   }
   ClientResponse response =
       resource
           .header(Constants.AUTH_TOKEN, userInfo.getToken())
           .type(MediaType.APPLICATION_JSON)
           .post(ClientResponse.class, info);
   //        reSetCacheAppTypes();
   return response;
 }