Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Conf
- {
- public String activeMQPassword;
- public String activeMQPath;
- public String activeMQUser;
- public String jdbcPassword;
- public String jdbcUrl;
- public String jdbcUser;
- public String jmsserver;
- public String logPath;
- public String s3AccessKey;
- public String s3Path;
- public String s3SecretKey;
- public Conf(String activeMQPassword, String activeMQPath, String activeMQUser, String jdbcPassword, String jdbcUrl, String jdbcUser, String jmsserver, String logPath, String s3AccessKey, String s3Path, String s3SecretKey)
- {
- this.activeMQPassword = activeMQPassword;
- this.activeMQPath = activeMQPath;
- this.activeMQUser = activeMQUser;
- this.jdbcPassword = jdbcPassword;
- this.jdbcUrl = jdbcUrl;
- this.jdbcUser = jdbcUser;
- this.jmsserver = jmsserver;
- this.logPath = logPath;
- this.s3AccessKey = s3AccessKey;
- this.s3Path = s3Path;
- this.s3SecretKey = s3SecretKey;
- }
- }
- FirebaseOptions options = new FirebaseOptions.Builder()
- .setServiceAccount(new FileInputStream("c:/chaveFB/TesteNovaApi-0efd51a8ad0c.json"))
- .setDatabaseUrl("https://testenovaapi.firebaseio.com/")
- //.setDatabaseAuthVariableOverride(auth) //AQUI SETAMOS A RESTRIÇÃO DE ACESSO CRIADA LOGO ACIMA.
- .build();
- FirebaseApp.initializeApp(options);
- DatabaseReference ref = FirebaseDatabase
- .getInstance()
- .getReference("/conf");
- ref.addListenerForSingleValueEvent(new ValueEventListener() {
- @Override
- public void onDataChange(DataSnapshot dataSnapshot) {
- System.out.println("LA2LA2LA2LA2LA2LA2LA2LA2LA2LA2");
- Conf conf = dataSnapshot.getValue(Conf.class);
- System.out.println(conf.activeMQPassword);
- System.out.println(conf.activeMQPath);
- System.out.println(conf.activeMQUser);
- System.out.println(conf.jdbcPassword);
- System.out.println(conf.jdbcUser);
- System.out.println(conf.jmsserver);
- }
- @Override
- public void onCancelled(DatabaseError databaseError) {
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement