예제 #1
0
 static {
   try {
     transport = GoogleNetHttpTransport.newTrustedTransport();
   } catch (GeneralSecurityException | IOException e) {
     throw new RuntimeException(e);
   }
 }
 public static void main(String[] args) {
   try {
     try {
       HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
       // authorization
       Credential credential = authorize();
       // set up global FusionTables instance
       fusiontables =
           new Fusiontables.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
               .setApplicationName(APPLICATION_NAME)
               .build();
       // run commands
       listTables();
       String tableId = createTable();
       insertData(tableId);
       showRows(tableId);
       deleteTable(tableId);
       // success!
       return;
     } catch (IOException e) {
       System.err.println(e.getMessage());
     }
   } catch (Throwable t) {
     t.printStackTrace();
   }
   System.exit(1);
 }
  public RechercheLivreGoogle(String demande) {

    JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();

    try {

      if (demande.length() == 13 || demande.length() == 10) {
        demande = "isbn:" + demande;
      }

      // Création de la demande
      final Books books =
          new Books.Builder(GoogleNetHttpTransport.newTrustedTransport(), jsonFactory, null)
              .setApplicationName(NOM_APPLICATION)
              .setGoogleClientRequestInitializer(new BooksRequestInitializer(API_KEY))
              .build();
      System.out.println("Demande: [" + demande + "]");
      List listVolumes = books.volumes().list(demande);

      // Envoie de la demande
      Volumes volumes = listVolumes.execute();

      lesVolumes = volumes.getItems();

    } catch (Exception e) {
    }
  }
 static {
   try {
     HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
   } catch (Throwable t) {
     t.printStackTrace();
     System.exit(1);
   }
 }
 static {
   try {
     HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
     DATA_STORE_FACTORY = new FileDataStoreFactory(DATA_STORE_DIR);
   } catch (Throwable t) {
     t.printStackTrace();
     System.exit(1);
   }
 }
예제 #6
0
  @Bean
  public Calendar googleCalendar() throws GeneralSecurityException, IOException {
    JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance();
    HttpTransport transport = GoogleNetHttpTransport.newTrustedTransport();
    SocialConfig googleConfig = googleSocialConfig();
    HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
    GoogleCredential credential =
        new GoogleCredential.Builder()
            .setTransport(httpTransport)
            .setJsonFactory(jsonFactory)
            .setServiceAccountId(googleConfig.getServiceAccountEmail())
            .setServiceAccountPrivateKeyFromP12File(googleApiAuthResource.getFile())
            .setServiceAccountScopes(Collections.singleton(CalendarScopes.CALENDAR))
            .setServiceAccountUser(googleConfig.getCalendarOwner())
            .build();

    return new Calendar.Builder(transport, jsonFactory, credential)
        .setApplicationName("Techlooper")
        .build();
  }
  /**
   * Returns a cloud debugger connection given a user email to indicate the credentials to use. The
   * function may return null if the user is not logged in.
   */
  @Nullable
  private static Debugger getClient(final @Nullable String userEmail, final int timeout) {
    if (Strings.isNullOrEmpty(userEmail)) {
      LOG.warn("unexpected null email in controller initialize.");
      return null;
    }
    final String hashkey = userEmail + timeout;
    Debugger cloudDebuggerClient = myDebuggerClientsFromUserEmail.get(hashkey);

    if (cloudDebuggerClient == null) {
      try {
        final CredentialedUser user = GoogleLogin.getInstance().getAllUsers().get(userEmail);
        final Credential credential = (user != null ? user.getCredential() : null);
        if (credential != null) {
          user.getGoogleLoginState()
              .addLoginListener(
                  new LoginListener() {
                    @Override
                    public void statusChanged(boolean login) {
                      // aggressively remove the cached item on any status change.
                      myDebuggerClientsFromUserEmail.remove(hashkey);
                    }
                  });
          HttpRequestInitializer initializer =
              new HttpRequestInitializer() {
                @Override
                public void initialize(HttpRequest httpRequest) throws IOException {
                  httpRequest.setConnectTimeout(timeout);
                  httpRequest.setReadTimeout(timeout);
                  credential.initialize(httpRequest);
                }
              };

          HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
          cloudDebuggerClient =
              new Builder(httpTransport, JSON_FACTORY, initializer)
                  .setRootUrl(ROOT_URL)
                  .setApplicationName(GoogleLoginUtils.getCurrentPlatformName())
                  .build()
                  .debugger();
        }
      } catch (IOException ex) {
        LOG.warn("Error connecting to Cloud Debugger API", ex);
      } catch (GeneralSecurityException ex) {
        LOG.warn("Error connecting to Cloud Debugger API", ex);
      }

      if (cloudDebuggerClient != null) {
        myDebuggerClientsFromUserEmail.put(hashkey, cloudDebuggerClient);
      }
    }
    return cloudDebuggerClient;
  }
예제 #8
0
 public static Compute buildCompute(CloudCredential gcpCredential) {
   try {
     HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
     GoogleCredential credential = buildCredential(gcpCredential, httpTransport);
     return new Compute.Builder(httpTransport, JSON_FACTORY, null)
         .setApplicationName(gcpCredential.getName())
         .setHttpRequestInitializer(credential)
         .build();
   } catch (Exception e) {
     LOGGER.error("Error occurred while building Google Compute access.", e);
   }
   return null;
 }
 @SuppressWarnings({"oracle.jdeveloper.java.semantic-warning", "deprecation"})
 private Credential authorize() throws Exception {
   HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
   com.google.api.client.googleapis.auth.oauth2.GoogleCredential.Builder builder =
       new com.google.api.client.googleapis.auth.oauth2.GoogleCredential.Builder();
   builder.setTransport(HTTP_TRANSPORT);
   builder.setJsonFactory(JSON_FACTORY);
   builder.setServiceAccountId(getServiceAccountEmail());
   builder.setServiceAccountScopes(new String[] {"https://www.googleapis.com/auth/analytics"});
   builder.setServiceAccountPrivateKeyFromP12File(getServiceAccountPrivateKey().getFile());
   GoogleCredential credential = builder.build();
   return credential;
 }
 // -----------------------------------------------------------------------------------------------------------------
 // Create new instances of HTTP_TRANSPORT
 static //
 { // and DATA_STORE_FACTORY
   try //
   { //
     HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
     DATA_STORE_FACTORY = new FileDataStoreFactory(DATA_STORE_DIR);
   } //
   catch (Throwable t) //
   { //
     t.printStackTrace(); //
     System.exit(1); //
   } //
 } //
 public void initialise() throws AnalyticsException {
   logger.info("Entered");
   try {
     JSON_FACTORY = new JacksonFactory();
     HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
     analytics = initializeAnalytics();
     profileId = findProfileId(analytics, getAccountName());
     logger.info((new StringBuilder()).append("Profile ID: ").append(profileId).toString());
     if (profileId == null) logger.error("No profiles found.");
     enabled = true;
   } catch (Exception expGeneral) {
     logger.error("Exception during initalising.", expGeneral);
     expGeneral.printStackTrace();
     enabled = false;
   }
   logger.info("Leaving");
 }
  /**
   * Main demo. This first initializes an analytics service object. It then uses the MCF API to
   * retrieve the top 25 source paths with most total conversions. It will also retrieve the top 25
   * organic sources with most total conversions. Finally the results are printed to the screen. If
   * an API error occurs, it is printed here.
   *
   * @param args command line args.
   */
  public static void main(String[] args) {
    try {
      HTTP_TRANSPORT = GoogleNetHttpTransport.newTrustedTransport();
      DATA_STORE_FACTORY = new FileDataStoreFactory(DATA_STORE_DIR);
      Analytics analytics = initializeAnalytics();

      McfData mcfPathData = executePathQuery(analytics, TABLE_ID);
      printAllInfo(mcfPathData);

      McfData mcfInteractionData = executeInteractionQuery(analytics, TABLE_ID);
      printAllInfo(mcfInteractionData);

    } catch (GoogleJsonResponseException e) {
      System.err.println(
          "There was a service error: "
              + e.getDetails().getCode()
              + " : "
              + e.getDetails().getMessage());
    } catch (Throwable t) {
      t.printStackTrace();
    }
  }
예제 #13
0
  private Customsearch getCustomsearch(HandlerContext handlerContext) {
    Customsearch res = (Customsearch) handlerContext.get("customsearch");
    if (res == null) {
      Customsearch.Builder customSearchBuilder;
      try {
        customSearchBuilder =
            new Customsearch.Builder(
                GoogleNetHttpTransport.newTrustedTransport(), JSON_FACTORY, null);
        customSearchBuilder.setApplicationName(APPLICATION_NAME);
        String key = ((PixGameHandlerConfig) handlerContext.getHandlerConfig()).getKey();
        customSearchBuilder.setCustomsearchRequestInitializer(
            new CustomsearchRequestInitializer(key));
        res = customSearchBuilder.build();

        handlerContext.put("customsearch", res);
      } catch (Exception e) {
        Log.e(
            TAG,
            "PixGameHandler Could not initialize! PixGameHandler will not work until this problem is resolved",
            e);
      }
    }
    return res;
  }
  public List<BeanUsuarioDirectorio> BuscarUsuario() {

    String resultado = null;
    List<BeanUsuarioDirectorio> empleadosNuevos = new ArrayList<BeanUsuarioDirectorio>();
    BeanUsuarioDirectorio empleadoNuevo = null;

    try {

      List<String> SCOPES = Arrays.asList("email");

      String emailAddressDev =
          "*****@*****.**";

      JsonFactory JSON_FACTORY = JacksonFactory.getDefaultInstance();
      NetHttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
      GoogleCredential credential;

      credential =
          new GoogleCredential.Builder()
              .setTransport(httpTransport)
              .setJsonFactory(JSON_FACTORY)
              .setServiceAccountId(emailAddressDev)
              .setServiceAccountPrivateKey(key)
              .setServiceAccountScopes(SCOPES)
              .setServiceAccountUser("*****@*****.**")
              .build();

      if (listaRegistrosCyge != null) {

        for (BeanCyge registroCyge : listaRegistrosCyge) {
          if ((registroCyge.getEmail() != null)
              && (!registroCyge.getEmail().isEmpty())
              && !registroCyge.getEmail().trim().isEmpty()) {
            /*PRUEBA OFFLINE*/

            try {
              String URI =
                  "https://bbva-gapis.appspot.com/gprofile/users/" + registroCyge.getEmail();
              HttpRequestFactory requestFactory = httpTransport.createRequestFactory(credential);
              GenericUrl url = new GenericUrl(URI);
              HttpRequest request = requestFactory.buildGetRequest(url);
              HttpResponse response = request.execute();
              String content = response.parseAsString();

              resultado = content;
              /*END PRUEBA OFFLINE*/

              // resultado =
              // "{\"code\":\"OK\",\"message\":\"successful\",\"data\":{\"userDefinedFields\":[{\"key\":\"uid\",\"value\":\"MB58756\"},{\"key\":\"descOUPadre\",\"value\":\"SISTEMAS Y OPERACIONES\"},{\"key\":\"codCorporativo\",\"value\":\"00003719381\"},{\"key\":\"descEmpresaExterno\",\"value\":\" \"},{\"key\":\"codCargo\",\"value\":\"IHJ\"},{\"key\":\"descEmpresa\",\"value\":\"BBVA BANCOMER SERVICIO ADMINIS\"},{\"key\":\"codCSB\",\"value\":\"9016\"},{\"key\":\"descOUBase\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel10\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descCentroCoste\",\"value\":\"D Y D CANALES\"},{\"key\":\"uidJefe\",\"value\":\"M901737\"},{\"key\":\"codEstado\",\"value\":\"DF\"},{\"key\":\"codOUNivel10\",\"value\":\"00012899\"},{\"key\":\"codOUPadre\",\"value\":\"00005833\"},{\"key\":\"descpais\",\"value\":\"MÉXICO\"},{\"key\":\"c\",\"value\":\"MEX\"},{\"key\":\"telephoneNumber\",\"value\":\" \"},{\"key\":\"rangoGlobal\",\"value\":\" \"},{\"key\":\"codPostalCentroTrabajo\",\"value\":\"03339\"},{\"key\":\"codBancoOficinaPers\",\"value\":\"01853307\"},{\"key\":\"descCentroTrabajo\",\"value\":\"CENTRO BANCOMER D.F. (CON COME\"},{\"key\":\"descEstado\",\"value\":\"DISTRITO FEDERAL\"},{\"key\":\"mobile\",\"value\":\" \"},{\"key\":\"descLargaPlanta\",\"value\":\"N-6 C-A C-E M-7 E-24\"},{\"key\":\"esEmpleado\",\"value\":\"E\"},{\"key\":\"title\",\"value\":\"LIDER DE PROYECTO DYD A\"},{\"key\":\"o\",\"value\":\"0185\"},{\"key\":\"codCentroCoste\",\"value\":\"0000\"},{\"key\":\"posicion\",\"value\":\"00238344\"},{\"key\":\"pager\",\"value\":\" \"},{\"key\":\"apellido2\",\"value\":\"RAMIREZ\"},{\"key\":\"codCentroTrabajo\",\"value\":\"25001\"},{\"key\":\"descOUNivel2\",\"value\":\"MEXICO\"},{\"key\":\"descOUNivel1\",\"value\":\"MEXICO\"},{\"key\":\"mail\",\"value\":\"[email protected]\"},{\"key\":\"codOficina\",\"value\":\"01853307\"},{\"key\":\"codOUNivel1\",\"value\":\"00000141\"},{\"key\":\"codOUNivel2\",\"value\":\"00000141\"},{\"key\":\"apellido1\",\"value\":\"ROSAS\"},{\"key\":\"codOUNivel3\",\"value\":\"00005833\"},{\"key\":\"descCodPostalCentroTrabajo\",\"value\":\"DF\"},{\"key\":\"descOUNivel9\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel8\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel7\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel6\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel5\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel4\",\"value\":\"TECNOLOGIA MULTICANAL\"},{\"key\":\"descOUNivel3\",\"value\":\"SISTEMAS Y OPERACIONES\"},{\"key\":\"descBancoOficinaPers\",\"value\":\"3307\"},{\"key\":\"corporateNumber\",\"value\":\" \"},{\"key\":\"codOUNivel5\",\"value\":\"00012899\"},{\"key\":\"codOUNivel4\",\"value\":\"00010142\"},{\"key\":\"codOUNivel7\",\"value\":\"00012899\"},{\"key\":\"codOUNivel6\",\"value\":\"00012899\"},{\"key\":\"codOUNivel9\",\"value\":\"00012899\"},{\"key\":\"codOUNivel8\",\"value\":\"00012899\"}],\"id\":\"102286709937216158038\",\"addresses\":[{\"country\":\"MÉXICO\",\"countryCode\":\"ES\",\"formatted\":\"DISTRITO FEDERAL\\n03339\\nMÉXICO\",\"locality\":\"DF\",\"poBox\":\"03339\",\"postalCode\":\"03339\",\"streetAddress\":\"N-6 C-A C-E M-7 E-24\",\"type\":\"work\"}],\"updateTime\":1449889391185,\"customSchemas\":{\"ldapUserData\":{\"uid\":\"MB58756\",\"descOUPadre\":\"SISTEMAS Y OPERACIONES\",\"codCorporativo\":\"00003719381\",\"descEmpresaExterno\":\" \",\"codCargo\":\"IHJ\",\"descEmpresa\":\"BBVA BANCOMER SERVICIO ADMINIS\",\"codCSB\":\"9016\",\"descOUBase\":\"CANALES ATENDIDOS\",\"descOUNivel10\":\"CANALES ATENDIDOS\",\"descCentroCoste\":\"D Y D CANALES\",\"uidJefe\":\"M901737\",\"codEstado\":\"DF\",\"codOUNivel10\":\"00012899\",\"codOUPadre\":\"00005833\",\"descpais\":\"MÉXICO\",\"codPais\":\"MEX\",\"telephoneNumber\":\" \",\"rangoGlobal\":\" \",\"codPostalCentroTrabajo\":\"03339\",\"codBancoOficinaPers\":\"01853307\",\"descCentroTrabajo\":\"CENTRO BANCOMER D.F. (CON COME\",\"descEstado\":\"DISTRITO FEDERAL\",\"mobile\":\" \",\"descLargaPlanta\":\"N-6 C-A C-E M-7 E-24\",\"esEmpleado\":\"E\",\"title\":\"LIDER DE PROYECTO DYD A\",\"organization\":\"0185\",\"codCentroCoste\":\"0000\",\"posicion\":\"00238344\",\"pager\":\" \",\"apellido2\":\"RAMIREZ\",\"codCentroTrabajo\":\"25001\",\"descOUNivel2\":\"MEXICO\",\"descOUNivel1\":\"MEXICO\",\"mail\":\"[email protected]\",\"codOficina\":\"01853307\",\"codOUNivel1\":\"00000141\",\"codOUNivel2\":\"00000141\",\"apellido1\":\"ROSAS\",\"codOUNivel3\":\"00005833\",\"descCodPostalCentroTrabajo\":\"DF\",\"descOUNivel9\":\"CANALES ATENDIDOS\",\"descOUNivel8\":\"CANALES ATENDIDOS\",\"descOUNivel7\":\"CANALES ATENDIDOS\",\"descOUNivel6\":\"CANALES ATENDIDOS\",\"descOUNivel5\":\"CANALES ATENDIDOS\",\"descOUNivel4\":\"TECNOLOGIA MULTICANAL\",\"descOUNivel3\":\"SISTEMAS Y OPERACIONES\",\"descBancoOficinaPers\":\"3307\",\"corporateNumber\":\" \",\"codOUNivel5\":\"00012899\",\"codOUNivel4\":\"00010142\",\"codOUNivel7\":\"00012899\",\"codOUNivel6\":\"00012899\",\"codOUNivel9\":\"00012899\",\"codOUNivel8\":\"00012899\"}},\"emails\":[{\"address\":\"[email protected]\",\"primary\":true}],\"etag\":\"\\\"KuAr0EK1uUI7oJNfO_dWOREN2ro/dbE6bs1euQMov6wc4Dmi3rfnjUc\\\"\",\"externalIds\":[{\"customType\":\"Employee ID\",\"type\":\"custom\",\"value\":\"MB58756\"}],\"kind\":\"admin#directory#user\",\"name\":{\"familyName\":\"ROSAS RAMIREZ\",\"fullName\":\"PEDRO ROSAS RAMIREZ\",\"givenName\":\"PEDRO\"},\"nonEditableAliases\":[\"[email protected]\"],\"organizations\":[{\"customType\":\"Work\",\"department\":\"CANALES ATENDIDOS\",\"location\":\"018533073307\",\"name\":\"BBVA BANCOMER SERVICIO ADMINIS\",\"primary\":true,\"title\":\"LIDER DE PROYECTO DYD A\"}],\"primaryEmail\":\"[email protected]\",\"suspended\":false,\"status\":\"ACTIVE\",\"ouResponsible\":{\"id\":\"00012899\",\"name\":\"CANALES ATENDIDOS\",\"responsibleEmployeeId\":\"M62139\",\"updateDate\":1450243038394}}}";
              ParsearJson parser = new ParsearJson();

              empleadoNuevo = parser.ConvertirAUsuario(resultado);

              System.out.println(resultado);

              empleadosNuevos.add(empleadoNuevo);

            } catch (Exception e) {
              e.printStackTrace();
            }
          }
        }
      } else {
        for (String strEmailUsuario : listaEmailsUsuarios) {

          /*PRUEBA OFFLINE*/

          String URI = "https://bbva-gapis.appspot.com/gprofile/users/" + strEmailUsuario;
          HttpRequestFactory requestFactory = httpTransport.createRequestFactory(credential);
          GenericUrl url = new GenericUrl(URI);
          HttpRequest request = requestFactory.buildGetRequest(url);
          HttpResponse response = request.execute();
          String content = response.parseAsString();

          resultado = content;
          /*END PRUEBA OFFLINE*/

          // resultado =
          // "{\"code\":\"OK\",\"message\":\"successful\",\"data\":{\"userDefinedFields\":[{\"key\":\"uid\",\"value\":\"MB58756\"},{\"key\":\"descOUPadre\",\"value\":\"SISTEMAS Y OPERACIONES\"},{\"key\":\"codCorporativo\",\"value\":\"00003719381\"},{\"key\":\"descEmpresaExterno\",\"value\":\" \"},{\"key\":\"codCargo\",\"value\":\"IHJ\"},{\"key\":\"descEmpresa\",\"value\":\"BBVA BANCOMER SERVICIO ADMINIS\"},{\"key\":\"codCSB\",\"value\":\"9016\"},{\"key\":\"descOUBase\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel10\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descCentroCoste\",\"value\":\"D Y D CANALES\"},{\"key\":\"uidJefe\",\"value\":\"M901737\"},{\"key\":\"codEstado\",\"value\":\"DF\"},{\"key\":\"codOUNivel10\",\"value\":\"00012899\"},{\"key\":\"codOUPadre\",\"value\":\"00005833\"},{\"key\":\"descpais\",\"value\":\"MÉXICO\"},{\"key\":\"c\",\"value\":\"MEX\"},{\"key\":\"telephoneNumber\",\"value\":\" \"},{\"key\":\"rangoGlobal\",\"value\":\" \"},{\"key\":\"codPostalCentroTrabajo\",\"value\":\"03339\"},{\"key\":\"codBancoOficinaPers\",\"value\":\"01853307\"},{\"key\":\"descCentroTrabajo\",\"value\":\"CENTRO BANCOMER D.F. (CON COME\"},{\"key\":\"descEstado\",\"value\":\"DISTRITO FEDERAL\"},{\"key\":\"mobile\",\"value\":\" \"},{\"key\":\"descLargaPlanta\",\"value\":\"N-6 C-A C-E M-7 E-24\"},{\"key\":\"esEmpleado\",\"value\":\"E\"},{\"key\":\"title\",\"value\":\"LIDER DE PROYECTO DYD A\"},{\"key\":\"o\",\"value\":\"0185\"},{\"key\":\"codCentroCoste\",\"value\":\"0000\"},{\"key\":\"posicion\",\"value\":\"00238344\"},{\"key\":\"pager\",\"value\":\" \"},{\"key\":\"apellido2\",\"value\":\"RAMIREZ\"},{\"key\":\"codCentroTrabajo\",\"value\":\"25001\"},{\"key\":\"descOUNivel2\",\"value\":\"MEXICO\"},{\"key\":\"descOUNivel1\",\"value\":\"MEXICO\"},{\"key\":\"mail\",\"value\":\"[email protected]\"},{\"key\":\"codOficina\",\"value\":\"01853307\"},{\"key\":\"codOUNivel1\",\"value\":\"00000141\"},{\"key\":\"codOUNivel2\",\"value\":\"00000141\"},{\"key\":\"apellido1\",\"value\":\"ROSAS\"},{\"key\":\"codOUNivel3\",\"value\":\"00005833\"},{\"key\":\"descCodPostalCentroTrabajo\",\"value\":\"DF\"},{\"key\":\"descOUNivel9\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel8\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel7\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel6\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel5\",\"value\":\"CANALES ATENDIDOS\"},{\"key\":\"descOUNivel4\",\"value\":\"TECNOLOGIA MULTICANAL\"},{\"key\":\"descOUNivel3\",\"value\":\"SISTEMAS Y OPERACIONES\"},{\"key\":\"descBancoOficinaPers\",\"value\":\"3307\"},{\"key\":\"corporateNumber\",\"value\":\" \"},{\"key\":\"codOUNivel5\",\"value\":\"00012899\"},{\"key\":\"codOUNivel4\",\"value\":\"00010142\"},{\"key\":\"codOUNivel7\",\"value\":\"00012899\"},{\"key\":\"codOUNivel6\",\"value\":\"00012899\"},{\"key\":\"codOUNivel9\",\"value\":\"00012899\"},{\"key\":\"codOUNivel8\",\"value\":\"00012899\"}],\"id\":\"102286709937216158038\",\"addresses\":[{\"country\":\"MÉXICO\",\"countryCode\":\"ES\",\"formatted\":\"DISTRITO FEDERAL\\n03339\\nMÉXICO\",\"locality\":\"DF\",\"poBox\":\"03339\",\"postalCode\":\"03339\",\"streetAddress\":\"N-6 C-A C-E M-7 E-24\",\"type\":\"work\"}],\"updateTime\":1449889391185,\"customSchemas\":{\"ldapUserData\":{\"uid\":\"MB58756\",\"descOUPadre\":\"SISTEMAS Y OPERACIONES\",\"codCorporativo\":\"00003719381\",\"descEmpresaExterno\":\" \",\"codCargo\":\"IHJ\",\"descEmpresa\":\"BBVA BANCOMER SERVICIO ADMINIS\",\"codCSB\":\"9016\",\"descOUBase\":\"CANALES ATENDIDOS\",\"descOUNivel10\":\"CANALES ATENDIDOS\",\"descCentroCoste\":\"D Y D CANALES\",\"uidJefe\":\"M901737\",\"codEstado\":\"DF\",\"codOUNivel10\":\"00012899\",\"codOUPadre\":\"00005833\",\"descpais\":\"MÉXICO\",\"codPais\":\"MEX\",\"telephoneNumber\":\" \",\"rangoGlobal\":\" \",\"codPostalCentroTrabajo\":\"03339\",\"codBancoOficinaPers\":\"01853307\",\"descCentroTrabajo\":\"CENTRO BANCOMER D.F. (CON COME\",\"descEstado\":\"DISTRITO FEDERAL\",\"mobile\":\" \",\"descLargaPlanta\":\"N-6 C-A C-E M-7 E-24\",\"esEmpleado\":\"E\",\"title\":\"LIDER DE PROYECTO DYD A\",\"organization\":\"0185\",\"codCentroCoste\":\"0000\",\"posicion\":\"00238344\",\"pager\":\" \",\"apellido2\":\"RAMIREZ\",\"codCentroTrabajo\":\"25001\",\"descOUNivel2\":\"MEXICO\",\"descOUNivel1\":\"MEXICO\",\"mail\":\"[email protected]\",\"codOficina\":\"01853307\",\"codOUNivel1\":\"00000141\",\"codOUNivel2\":\"00000141\",\"apellido1\":\"ROSAS\",\"codOUNivel3\":\"00005833\",\"descCodPostalCentroTrabajo\":\"DF\",\"descOUNivel9\":\"CANALES ATENDIDOS\",\"descOUNivel8\":\"CANALES ATENDIDOS\",\"descOUNivel7\":\"CANALES ATENDIDOS\",\"descOUNivel6\":\"CANALES ATENDIDOS\",\"descOUNivel5\":\"CANALES ATENDIDOS\",\"descOUNivel4\":\"TECNOLOGIA MULTICANAL\",\"descOUNivel3\":\"SISTEMAS Y OPERACIONES\",\"descBancoOficinaPers\":\"3307\",\"corporateNumber\":\" \",\"codOUNivel5\":\"00012899\",\"codOUNivel4\":\"00010142\",\"codOUNivel7\":\"00012899\",\"codOUNivel6\":\"00012899\",\"codOUNivel9\":\"00012899\",\"codOUNivel8\":\"00012899\"}},\"emails\":[{\"address\":\"[email protected]\",\"primary\":true}],\"etag\":\"\\\"KuAr0EK1uUI7oJNfO_dWOREN2ro/dbE6bs1euQMov6wc4Dmi3rfnjUc\\\"\",\"externalIds\":[{\"customType\":\"Employee ID\",\"type\":\"custom\",\"value\":\"MB58756\"}],\"kind\":\"admin#directory#user\",\"name\":{\"familyName\":\"ROSAS RAMIREZ\",\"fullName\":\"PEDRO ROSAS RAMIREZ\",\"givenName\":\"PEDRO\"},\"nonEditableAliases\":[\"[email protected]\"],\"organizations\":[{\"customType\":\"Work\",\"department\":\"CANALES ATENDIDOS\",\"location\":\"018533073307\",\"name\":\"BBVA BANCOMER SERVICIO ADMINIS\",\"primary\":true,\"title\":\"LIDER DE PROYECTO DYD A\"}],\"primaryEmail\":\"[email protected]\",\"suspended\":false,\"status\":\"ACTIVE\",\"ouResponsible\":{\"id\":\"00012899\",\"name\":\"CANALES ATENDIDOS\",\"responsibleEmployeeId\":\"M62139\",\"updateDate\":1450243038394}}}";
          ParsearJson parser = new ParsearJson();

          empleadoNuevo = parser.ConvertirAUsuario(resultado);

          System.out.println(resultado);

          empleadosNuevos.add(empleadoNuevo);
        }
      }

    } catch (IOException e) {

      e.printStackTrace();

    } catch (Exception e) {
      e.printStackTrace();
    }

    return empleadosNuevos;
  }
예제 #15
0
 MockGmail() throws GeneralSecurityException, IOException {
   super(
       GoogleNetHttpTransport.newTrustedTransport(),
       JacksonFactory.getDefaultInstance(),
       new GoogleCredential());
 }