query stringlengths 7 33.1k | document stringlengths 7 335k | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jTextField_Create_Savings_Acc_acchol.getText().contains("xxx")){
jTextField_Create_Savings_Acc_acchol.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jTextField_Create_Savings_Acc_accnum.getText().contains("xxx")){
jTextField_Create_Savings_Acc_accnum.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jTextField_Create_Savings_Acc_bal.getText().contains("000")){
jTextField_Create_Savings_Acc_bal.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jTextField_Create_Savings_Acc_joindate.getText().contains("xxx")){
jTextField_Create_Savings_Acc_joindate.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jTextField_Create_Savings_Acc_pass.getPassword().equals("xxx")){
jTextField_Create_Savings_Acc_pass.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jTextField_Create_Savings_Acc_usern.getText().contains("xxx")){
jTextField_Create_Savings_Acc_usern.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jtxt_accno.getText().contains("xxx")){
jtxt_accno.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jtxt_holderName.getText().contains("xxx")){
jtxt_holderName.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jtxt_joinDate.getText().contains("xxx")){
jtxt_joinDate.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jtxt_balance.getText().contains("000")){
jtxt_balance.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jtxt_userName.getText().contains("xxx")){
jtxt_userName.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jpw_createCurrentAccPw.getPassword().equals("xxx")){
jpw_createCurrentAccPw.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void focusGained(FocusEvent arg0) {
if(jtxt_createCurrentAccPIN.getText().contains("xxx")){
jtxt_createCurrentAccPIN.setText("");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
new num4();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
Get extra data included in the Intent | @Override
public void onReceive(Context context, Intent intent) {
String message = intent.getStringExtra("message");
Log.d("receiver", "Got message: " + message);
textView.setText(message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"String getExtra();",
"private void getExtrasFromCallingActivity() {\n extras = getIntent().getExtras();\n if (extras != null) {\n testIdString = extras.getString(\"TEST_ID_FOR_QUESTIONS\");\n } else {\n testIdString = \"-1\";\n }\n }",
"public String[] getExtraInfo() {\n return extraInfo;\n }",
"private void getIntentData() {\n\t\ttry{\n\t\t\tIN_CATEGORYID = getIntent().getStringExtra(CATEGORY_ID) == null ? \"0\" : getIntent().getStringExtra(CATEGORY_ID);\n\t\t\tIN_ARTICLENAME = getIntent().getStringExtra(ARTICLENAME) == null ? \"\" : getIntent().getStringExtra(ARTICLENAME) ;\n\t\t\tIN_ARTICLEID = getIntent().getStringExtra(ARTICLEID) == null ? \"\" : getIntent().getStringExtra(ARTICLEID);\n\t\t}catch(Exception e){\n\t\t}\n\t}",
"private void getIntentData() {\n if (getIntent() != null) {\n destinationLat = getIntent().getDoubleExtra(\"destinationLat\", 48.893478);\n destinationLng = getIntent().getDoubleExtra(\"destinationLng\", 2.334595);\n }\n }",
"private void getIntentData() {\r\n if (getIntent() != null && getIntent().getExtras() != null) {\r\n // Handling intent data from DirectoryDetailsActivity class\r\n if (Constant.ALBUM_TYPE.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n position = getIntent().getIntExtra(Constant.POSITION, 0);\r\n nameKey = getIntent().getStringExtra(Constant.KEY_NAME);\r\n } else if (Constant.LIST_TYPE.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n imageDataModel = getIntent().getParcelableExtra(Constant.DATA);\r\n } else if (Constant.SECURE_TAB.equalsIgnoreCase(getIntent().getExtras().getString(Constant.TYPE))) {\r\n imageDataModel = getIntent().getParcelableExtra(Constant.DATA);\r\n } else {\r\n // Handling other intent data like camera intent\r\n Uri uri = getIntent().getData();\r\n GalleryHelper.getImageFolderMap(this);\r\n File file = new File(getRealPathFromURI(uri));\r\n nameKey = FileUtils.getParentName(file.getParent());\r\n GalleryHelperBaseOnId.getMediaFilesOnIdBasis(this, GalleryHelper.imageFolderMap.get(nameKey).get(0).getBucketId());\r\n }\r\n }\r\n }",
"private void getIncomingIntent()\n {\n if(getIntent().hasExtra(\"Title\")\n && getIntent().hasExtra(\"Time\")\n && getIntent().hasExtra(\"Date\")\n && getIntent().hasExtra(\"Duration\")\n && getIntent().hasExtra(\"Location\")\n && getIntent().hasExtra(\"EventDetails\"))\n {\n Title = getIntent().getStringExtra(\"Title\");\n Time = getIntent().getStringExtra(\"Time\");\n Date = getIntent().getStringExtra(\"Date\");\n Duration = getIntent().getStringExtra(\"Duration\");\n Location = getIntent().getStringExtra(\"Location\");\n EventDetails = getIntent().getStringExtra(\"EventDetails\");\n\n setData(Title,Time,Date,Duration,Location,EventDetails);\n }\n }",
"void getBundleData(Intent intent);",
"@Override\n\tprotected void getIntentData(Bundle savedInstanceState) {\n\n\t}",
"public static Object getExtraObject(Activity context, String key) {\n \tObject param = null;\n \tBundle bundle = context.getIntent().getExtras();\n \tif(bundle!=null){\n \t\tparam = bundle.get(key);\n \t}\n \treturn param;\n\t}",
"private void getIntentValues() {\n\n// itemname= getIntent().getExtras().getString(IntentsConstants.item_name);\n// itemPrice = getIntent().getExtras().getDouble(IntentsConstants.item_price);\n Bundle bundle = getArguments();\n menusItem= (MenusItem) bundle.getSerializable(\"Item\");\n itemname=menusItem.getName();\n itemPrice=menusItem.getPrice();\n\n}",
"public void getintent() {\n Intent intent = this.getIntent();\n acceptDetailsModel = (AcceptDetailsModel) intent.getSerializableExtra(\"menu_item\");\n }",
"Map<String, Object> extras();",
"void getData() {\n Intent intent = this.getIntent();\n /* Obtain String from Intent */\n Sname = intent.getExtras().getString(\"name\");\n Sbloodbank = intent.getExtras().getString(\"bloodbank\");\n Sbranch = intent.getExtras().getString(\"branch\");\n Sdate = intent.getExtras().getString(\"date\");\n Stime = intent.getExtras().getString(\"time\");\n Sphone = intent.getExtras().getString(\"phone\");\n Log.d(\"userDetails received\", Sname + \",\" + Sphone ); //Don't ignore errors!\n }",
"private void getDataFromMainActivity(){\n Intent intent = getIntent();\n Bundle bundle = intent.getExtras();\n site = bundle.getString(\"site\");\n }",
"public java.util.Map getExtra(int status) throws android.os.RemoteException;",
"@Override\n protected void getFromIntent() {\n this.groupID = getIntent().getStringExtra(\"groupId\");\n this.groupName = getIntent().getStringExtra(\"groupName\");\n }",
"private void extractDataFromBundle() {\n Intent intent = getIntent();\n Bundle bundle = intent.getBundleExtra(MainActivity.PRACTICE_GAME_BUNDLE_KEY);\n\n mDifficulty = (Difficulty) bundle.getSerializable(MainActivity.DIFFICULTY_KEY);\n mPlayerGamePiece = (GamePiece) bundle.getSerializable(MainActivity.GAME_PIECE_KEY);\n\n }",
"private void showIntentInfo(Intent intent, TextView textView){\n StringBuilder infoBuilder = new StringBuilder();\n String action = intent.getAction();\n infoBuilder.append(\"Action=\");\n infoBuilder.append(action != null ? action : \"** NO Action **\");\n infoBuilder.append(\"\\n\");\n\n Bundle extras = intent.getExtras();\n if(extras == null){\n infoBuilder.append(\"** NO Extras **\");\n } else {\n infoBuilder.append(\"** Extras **\\n\");\n Set<String> keySet = extras.keySet();\n for(String key : keySet) {\n String value = extras.get(key).toString();\n infoBuilder.append(key);\n infoBuilder.append(\"=\");\n infoBuilder.append(value);\n infoBuilder.append(\"\\n\");\n }\n }\n textView.setText(infoBuilder.toString());\n }",
"private void getDataFromIntent(Intent intent) {\n panAadharCardDetail = intent.getParcelableExtra(\"panAadharDetail\");\n card_type = intent.getIntExtra(\"card_type\", 0);\n imageFileUri = intent.getStringExtra(\"imageFile\");\n }",
"public Object getExtraInformation() {\n\t\treturn extraInformation;\n\t}",
"private void getDataFromIntent() {\n\t\tfinal Intent intent = getIntent();\n\t\tdata.setmUsername(intent.getStringExtra(Constants.PARAM_USERNAME));\n\t\tdata.setmPassword(intent.getStringExtra(Constants.PARAM_PASSWORD));\n\t\tdata.setmHost(intent.getStringExtra(Constants.PARAM_HOST));\n\t\tdata.setmPort(intent.getIntExtra(Constants.PARAM_PORT, 389));\n\t\tdata.setmEncryption(intent.getIntExtra(Constants.PARAM_ENCRYPTION, 0));\n\t\tdata.setmRequestNewAccount((data.getmUsername() == null));\n\t\tdata.setmConfirmCredentials(intent.getBooleanExtra(Constants.PARAM_CONFIRMCREDENTIALS, false));\n\t}",
"public void getBundle (){\n idTemp = getIntent().getStringExtra(\"id\");\n }",
"static long m43010a(Intent intent) {\n if (intent == null) {\n return -1;\n }\n return intent.getLongExtra(\"com.tonyodev.fetch.extra_id\", -1);\n }",
"public static String getExtraString(Activity context, String key) {\n \tString param = \"\";\n \tBundle bundle = context.getIntent().getExtras();\n \tif(bundle!=null){\n \t\tparam = bundle.getString(key);\n \t}\n \treturn param;\n\t}",
"public Bundle getExtras() {\n }",
"private void getMoviesData() {\n movieId = getIntent().getIntExtra(MOVIE_ID, 0);\n }",
"private void getDataFromIntent(){\n Bundle extras = getIntent().getExtras();\n //para recibir los datos de una manera segura, se hace una verificacion\n //para ver si los extras no son nulos\n if (extras!=null){\n //en caso de tener datos en el extra, se obtendran y guardaran en variables para su uso deseado\n String data = extras.getString(\"data\");\n boolean isTrue = extras.getBoolean(\"boolean\");\n if (isTrue){\n tvData.setText(data);\n Toast.makeText(this, \"Se recibio un booleano desde MainActivity.\", Toast.LENGTH_SHORT).show();\n }\n else{\n Toast.makeText(this, \"No se recibio nada :c\", Toast.LENGTH_LONG).show();\n }\n //en caso de no tener daos dentro dle extra, entrara a esta parte de la condicion\n }else{\n Toast.makeText(this, \"No hay datos extras\", Toast.LENGTH_SHORT).show();\n }\n\n }",
"com.google.protobuf.ByteString getExtra();",
"public com.google.protobuf.ByteString getExtra() {\n return extra_;\n }",
"public com.google.protobuf.ByteString getExtra() {\n return extra_;\n }",
"public Bundle extra() {\n if (mExtra == null)\n mExtra = new Bundle();\n return mExtra;\n }",
"public String getExtra() {\n Object ref = extra_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n extra_ = s;\n return s;\n }\n }",
"private void receiveData()\n {\n Intent i = getIntent();\n loginStatus = i.getIntExtra(\"Login_Status\", 0);\n deviceStatus = i.getIntExtra(\"Device_Status\", 0);\n }",
"private void getIncomingContactData() {\n // create bundle object that refers to the bundle inside the intent\n Bundle extras = getIntent().getExtras();\n contact = getObjectFromJSONString( extras.getString(\"CONTACT\") );\n displayContactDetails();\n }",
"public Intent getIntent() {\n return mIntent;\n }",
"public String getExtra() {\n Object ref = extra_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n extra_ = s;\n return s;\n } else {\n return (String) ref;\n }\n }",
"public static Bundle m3a(Intent intent) {\n return intent.getBundleExtra(\"al_applink_data\");\n }",
"private Order getIntentData(Intent intent) {\n\t\treturn intent != null ? (Order) intent\n\t\t\t\t.getSerializableExtra(TarrifActivity.TICKET_CONTIANS_ORDER_SERIALIZABLE_KEY)\n\t\t\t\t: null;\n\t}",
"public Intent getIntent() {\n return mIntent;\n }",
"protected abstract Intent getIntent();",
"private void addExtras(Intent intent)\n\t{\n\t\tBundle extras = getIntent().getExtras();\n\t\t\n\t\t// Load in the unused extras from the\n\t\t// previous Activity.\n\t\tintent.putExtras(extras);\n\t\t\n\t\t////////////////////////////////////////\n\t\t// Add optional standings categories. //\n\t\t////////////////////////////////////////\n\t\tif (_points.isChecked())\n\t\t{\n\t\t\tintent.putExtra(\"POINTS_ACTIVE\", true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tintent.putExtra(\"POINTS_ACTIVE\", false);\n\t\t}\n\t\t\n\t\tif (_score.isChecked())\n\t\t{\n\t\t\tintent.putExtra(\"SCORE_ACTIVE\", true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tintent.putExtra(\"SCORE_ACTIVE\", false);\n\t\t}\n\t\t/////////////////////////////////////////\n\t}",
"private String getStringExtra(Bundle savedInstanceState, String strWhich) {\n String strRet = (savedInstanceState != null ? savedInstanceState.getString(strWhich) : \"\");\r\n \r\n if (strRet == \"\") {\r\n \tBundle extras = getIntent().getExtras(); \r\n \tstrRet = (extras != null ? extras.getString(strWhich) : \"\");\r\n }\r\n \r\n return strRet;\r\n\r\n\t}",
"public void setExtraInfo (String info) {\n\tthis.extraInfo = info;\n }",
"private void logPushExtras(Intent intent) {\n Set<String> keys = intent.getExtras().keySet();\n for (String key : keys) {\n\n // ignore standard C2DM extra keys\n List<String> ignoredKeys = (List<String>) Arrays.asList(\n \"collapse_key\",// c2dm collapse key\n \"from\",// c2dm sender\n PushManager.EXTRA_NOTIFICATION_ID,// int id of generated notification (ACTION_PUSH_RECEIVED only)\n PushManager.EXTRA_PUSH_ID,// internal UA push id\n PushManager.EXTRA_ALERT);// ignore alert\n if (ignoredKeys.contains(key)) {\n continue;\n }\n Log.i(logTag,\n \"Push Notification Extra: [\" + key + \" : \"\n + intent.getStringExtra(key) + \"]\"\n );\n }\n }",
"@SuppressWarnings(\"unchecked\")\n protected <V extends Parcelable> V getParcelableExtra( final String name )\n {\n return (V) getIntent().getParcelableExtra( name );\n }",
"String getAdditionalInfo();",
"private void getAndSetIncomingIntent(){\n if (getIntent().hasExtra(\"asso\")) {\n Log.d(TAG, getIntent().getStringExtra(\"asso\"));\n edt_asso_name.setText(getIntent().getStringExtra(\"asso\"));\n }\n if (getIntent().hasExtra(\"school\")) {\n edt_school.setText(getIntent().getStringExtra(\"school\"));\n }\n if (getIntent().hasExtra(\"purpose\")) {\n edt_purpose.setText(getIntent().getStringExtra(\"purpose\"));\n }\n if (getIntent().hasExtra(\"link\")) {\n edt_link.setText(getIntent().getStringExtra(\"link\"));\n }\n if (getIntent().hasExtra(\"type\")) {\n selectedSpinnerType = getIntent().getStringExtra(\"type\");\n }\n\n }",
"public Bundle getExtras() {\n return mBundle.getBundle(KEY_EXTRAS);\n }",
"public void setExtraInfo(String[] extraInfo) {\n this.extraInfo = extraInfo;\n this.bextraInfo = true;\n }",
"void mo21580A(Intent intent);",
"private void BundleData(Intent intent) {\n bundle=new Bundle();\n bundle.putString(\"FNAME\",fname);\n bundle.putString(\"LNAME\",lname);\n bundle.putString(\"LOCALITY\",locality);\n bundle.putString(\"CITY\",city);\n bundle.putInt(\"PINCODE\",pincode);\n bundle.putString(\"TIME_TO_CALL\",timers);\n bundle.putString(\"PHONE\",phone);\n bundle.putString(\"ALTPHONE\",altphone);\n bundle.putString(\"EMAIL\",emailid);\n intent.putExtras(bundle);\n }",
"@Override public java.util.Map getExtra(int status) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.util.Map _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeInt(status);\nmRemote.transact(Stub.TRANSACTION_getExtra, _data, _reply, 0);\n_reply.readException();\njava.lang.ClassLoader cl = (java.lang.ClassLoader)this.getClass().getClassLoader();\n_result = _reply.readHashMap(cl);\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}",
"public Intent getActivityIntent() {\n Intent intent = new Intent(this.context, InterstitialActivity.class);\n intent.setFlags(268435456);\n intent.addFlags(67108864);\n intent.putExtra(\"id\", getPlacementID());\n if (this.setAutoPlay) {\n intent.putExtra(\"auto_play\", this.autoPlay);\n }\n if (this.setCanClose) {\n intent.putExtra(\"can_close\", isBackButtonCanClose());\n }\n if (this.setMute) {\n intent.putExtra(\"mute\", getMute());\n }\n intent.putExtra(\"cat\", getCategories());\n intent.putExtra(\"pbk\", getPostback());\n intent.putExtra(\"b_color\", getButtonColor());\n intent.putExtra(\"skip_title\", getSkipText());\n intent.putExtra(\"creative\", getCreative());\n return intent;\n }",
"public String getAdditionalData() {\n return additionalData;\n }",
"@Override\n\tprotected void obtainIntentValue() {\n\n\t}",
"public ListaAttributi getExtra() {\r\n return this.extra;\r\n }",
"public static Bundle getExtrasBundle(Bundle intentExtras) {\n if (!Constants.IS_AMAZON) {\n return intentExtras.getBundle(Constants.APPBOY_PUSH_EXTRAS_KEY);\n } else {\n return intentExtras;\n }\n }",
"@Override\n \tpublic void onReceive(Context context, Intent intent)\n \t{\n \tMediaInfoArtist = intent.getStringExtra(\"artist\");\n \tMediaInfoAlbum = intent.getStringExtra(\"album\");\n \tMediaInfoTrack = intent.getStringExtra(\"track\");\n \tMediaInfoNeedsUpdate = true;\n \tLog.d(\"OLV Music\",\"Artist: \"+MediaInfoArtist+\", Album: \"+MediaInfoAlbum+\" and Track: \"+MediaInfoTrack);\n \t}",
"public static String getStringIntent(Intent intent, String name) {\n\t\tString retval = null;\n\t\tif (intent != null) {\n\t\t\tif (intent.hasExtra(name))\n\t\t\t\tretval = intent.getStringExtra(name);\n\t\t}\n\t\treturn retval;\n\t}",
"public void addExtraInfo(final ArrayList<PersonInfo> extra) {\n info.addAll(extra);\n hasExtra = true;\n }",
"public String getAdditionalInfo() {\n return additionalInfo;\n }",
"public String getAdditionalInfo() {\n return additionalInfo;\n }",
"public String getAdditionalInfo() {\r\n return additionalInfo;\r\n }",
"private void getIncomingData() {\n Bundle bundle = getIntent().getExtras();\n if (bundle.containsKey(\"DOCTOR_ID\")\n && bundle.containsKey(\"DOCTOR_NAME\")\n && bundle.containsKey(\"CLINIC_ID\")\n && bundle.containsKey(\"CLINIC_NAME\")\n && bundle.containsKey(\"CLINIC_LATITUDE\")\n && bundle.containsKey(\"CLINIC_LONGITUDE\")\n && bundle.containsKey(\"CLINIC_ADDRESS\")) {\n DOCTOR_ID = bundle.getString(\"DOCTOR_ID\");\n DOCTOR_NAME = bundle.getString(\"DOCTOR_NAME\");\n CLINIC_ID = bundle.getString(\"CLINIC_ID\");\n CLINIC_NAME = bundle.getString(\"CLINIC_NAME\");\n CLINIC_LATITUDE = bundle.getDouble(\"CLINIC_LATITUDE\");\n CLINIC_LONGITUDE = bundle.getDouble(\"CLINIC_LONGITUDE\");\n CLINIC_ADDRESS = bundle.getString(\"CLINIC_ADDRESS\");\n\n if (DOCTOR_NAME != null) {\n txtDoctorName.setText(DOCTOR_NAME);\n }\n\n if (CLINIC_NAME != null) {\n txtClinicName.setText(CLINIC_NAME);\n }\n\n if (CLINIC_ADDRESS != null) {\n txtClinicAddress.setText(CLINIC_ADDRESS);\n }\n } else {\n Toast.makeText(getApplicationContext(), \"Failed to get required info....\", Toast.LENGTH_SHORT).show();\n finish();\n }\n }",
"boolean hasExtra();",
"private void getIntentAndDisplayData(Intent i) {\n\t\t\tif (!isCancelled()) {\n\t\t\t\tforumTopicID = i.getStringExtra(\"topicID\");\n\t\t\t\tuserID = i.getStringExtra(\"userID\");\n\t\t\t\tgetDataFromServer(forumTopicID);\n\t\t\t}\n\t\t}",
"public Intent getRequestIntent() {\n return requestIntent;\n }",
"@Override\n public Bundle getExtras() {\n Bundle extras = contactsCursor == null ? new Bundle() : contactsCursor.getExtras();\n extras.putInt(FAVORITES_COUNT, favoritesCount);\n return extras;\n }",
"@Override\n public void dataAvailable(Intent intent) {\n String uuid = BLEService.getmCharacteristicToPass().getUuid().toString();\n }",
"public interface extras {\n\n Extras getExtras();\n\n}",
"protected String getBundleData() {\n Bundle bundle = getIntent().getExtras();\n StringBuilder temp = new StringBuilder();\n SessionManager session = new SessionManager(getApplicationContext());\n\n temp.append(\"User: \").append(session.getUserName()).append(\"\\r\\n\");\n temp.append(\"Layout: \").append(getBundle(bundle, \"layout\")).append(\"\\r\\n\");\n temp.append(\"Orientation: \").append(getBundle(bundle, \"orientation\")).append(\"\\r\\n\");\n temp.append(\"Variation: \").append(getBundle(bundle, \"variation\")).append(\"\\r\\n\");\n temp.append(\"Hardwareaddons: \").append(getBundle(bundle, \"hardwareaddons\")).append(\"\\r\\n\");\n temp.append(\"Input: \").append(getBundle(bundle, \"input\")).append(\"\\r\\n\");\n temp.append(\"Posture: \").append(getBundle(bundle, \"posture\")).append(\"\\r\\n\");\n temp.append(\"Externalfactors: \").append(getBundle(bundle, \"externalfactors\")).append(\"\\r\\n\").append(\"\\r\\n\");\n //data = temp.toString();\n return temp.toString();\n }",
"@SuppressWarnings(\"unused\")\npublic interface Constants {\n /**\n * Extra data key. Used with intent or some others.\n */\n class Extras {\n public static final String TAG = \"ext_tag\";\n public static final String FLAG = \"ext_flag\";\n public static final String DATA = \"ext_data0\";\n public static final String DATA_1 = \"ext_data1\";\n public static final String DATA_2 = \"ext_data2\";\n public static final String DATA_3 = \"ext_data3\";\n public static final String DATA_4 = \"ext_data4\";\n public static final String DATA_5 = \"ext_data5\";\n public static final String DATA_6 = \"ext_data6\";\n public static final String DATA_7 = \"ext_data7\";\n public static final String DATA_8 = \"ext_data8\";\n public static final String GRADE_INFO = \"ext_grade_info\";\n public static final String MEMBER_VP_INFO = \"ext_member_vp_info\";\n public static final String MEMBER_VP_POSITION = \"ext_member_vp_position\";\n }\n\n\n}",
"@Override\n public void onNewIntent(Activity activity, Intent data) {\n }",
"com.google.protobuf.ByteString\n getExtraBytes();",
"@NonNull\n final public Map<String, Object> getExtras() {\n return new HashMap<String, Object>(mExtras);\n }",
"@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tputExtra();\n\t\t\t\t\n\t\t\t}",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n Log.d(TAG, \"onReceive: -->\");\r\n String str = intent.getDataString();\r\n Toast.makeText(context, \"Got brocastcast\" + intent.getStringExtra(\"Extra\"), Toast.LENGTH_SHORT).show();\r\n }",
"public String getExtraOptions() {\n return this.extraOptions;\n }",
"@Override\r\n public void onClick(View v) {\n String robodata=\"robot data\";\r\n String stringdata = \"throwing\";\r\n Intent mysqlintent = new Intent(collect_Data.this,mysql.class); //defining the intent.\r\n mysqlintent.putExtra(robodata, stringdata); //putting the data into the intent\r\n startActivity(mysqlintent); //launching the mysql activity\r\n }",
"private ArrayList<TodoData> getTodos() {\n Intent intent = (Intent) getIntent();\n return (ArrayList<TodoData>) intent.getSerializableExtra(\"todos\");\n }",
"private void receiveData()\n {\n Intent i = getIntent();\n productSelected = Paper.book().read(Prevalent.currentProductKey);\n vendorID = i.getStringExtra(\"vendorID\");\n if (productSelected != null) {\n\n productName = i.getStringExtra(\"productName\");\n productImage = i.getStringExtra(\"imageUrl\");\n productLongDescription = i.getStringExtra(\"productLongDescription\");\n productCategory = i.getStringExtra(\"productCategory\");\n productPrice = i.getStringExtra(\"productPrice\");\n productSizesSmall = i.getStringExtra(\"productSizesSmall\");\n productSizesMedium = i.getStringExtra(\"productSizesMedium\");\n productSizesLarge = i.getStringExtra(\"productSizesLarge\");\n productSizesXL = i.getStringExtra(\"productSizesXL\");\n productSizesXXL = i.getStringExtra(\"productSizesXXL\");\n productSizesXXXL = i.getStringExtra(\"productSizesXXXL\");\n productQuantity = i.getStringExtra(\"productQuantity\");\n }\n }",
"private String addExtra() {\n\t\t// One Parameter: ExtraName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|extra:\" + parameters[0]);\n\t\treturn tag.toString();\n\t}",
"public void intentHandler() {\n Intent intent = getIntent();\n if (intent.hasExtra(\"DATA\")) {\n data = (String[]) getIntent().getSerializableExtra(\"DATA\");\n recievedPosition = (int) getIntent().getSerializableExtra(\"POS\");\n if(recievedPosition != 0){\n IOException e = new IOException();\n try {\n itemArrAdapt.updateItem(recievedPosition, data, e);\n this.setPrefs();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }\n } else {\n // Start Normal\n }\n }",
"public String getExtra3() {\n return extra3;\n }",
"static /* synthetic */ byte[] m10276k(Intent intent) {\n if (intent == null) {\n return null;\n }\n Parcel obtain = Parcel.obtain();\n obtain.setDataPosition(0);\n intent.writeToParcel(obtain, 0);\n byte[] marshall = obtain.marshall();\n obtain.recycle();\n return marshall;\n }",
"public com.google.protobuf.ByteString\n getExtraBytes() {\n Object ref = extra_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n extra_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public static Bundle getBundle(Activity c) {\n\t\treturn c.getIntent().getExtras();\n\t}",
"public String getExtra2() {\n return extra2;\n }",
"abstract protected void addExtras();",
"@Override\n public void onReceive(Context context, Intent intent) {\n Toast.makeText(context,\"静态广播:\"+intent.getAction()+\":\"+intent.getStringExtra(\"tv\"),\n Toast.LENGTH_LONG).show();\n System.out.println(intent.getStringExtra(\"tv\"));\n }",
"public void onCreate(Bundle bundle) {\n super.onCreate(bundle);\n Intent intent = getIntent();\n if (intent != null) {\n this.Z = intent.getStringExtra(\"extra_deep_link_ots\");\n this.Y = intent.getStringExtra(\"extra_deep_link_email\");\n }\n }",
"@Override\n\t public void onReceive(Context context, Intent intent) {\n\t Toast.makeText(appContext, intent.getStringExtra(\"cmd_value\"), Toast.LENGTH_SHORT).show();\n\t }",
"protected List<Info> getInfo() {\n\n return (List<Info>) getExtraData().get(ProcessListener.EXTRA_DATA_INFO);\n }",
"@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\n\t\tString activityName = \"com.sonyericsson.media.infinite.EXTRA_ACTIVITY_NAME\";\n\n\t\tif (intent.getStringExtra(activityName) != null && intent.getStringExtra(activityName).equals(MusicPreferenceActivity.class.getName())) {\n\n\t\t\tBundle extras = new Bundle();\n\n\t\t\t// Build a URI for the string resource for the description text\n\t\t\tString description = new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE).authority(context.getPackageName()).appendPath(Integer.toString(R.string.description)).build()\n\t\t\t\t\t.toString();\n\n\t\t\t// And return it to the infinite framework as an extra\n\t\t\textras.putString(\"com.sonyericsson.media.infinite.EXTRA_DESCRIPTION\", description);\n\t\t\tsetResultExtras(extras);\n\n\t\t}\n\t}",
"public com.google.protobuf.ByteString\n getExtraBytes() {\n Object ref = extra_;\n if (ref instanceof String) {\n com.google.protobuf.ByteString b = \n com.google.protobuf.ByteString.copyFromUtf8(\n (String) ref);\n extra_ = b;\n return b;\n } else {\n return (com.google.protobuf.ByteString) ref;\n }\n }",
"public static Bundle m4b(Intent intent) {\n Bundle a = m3a(intent);\n if (a == null) {\n return null;\n }\n return a.getBundle(AppLinkData.ARGUMENTS_EXTRAS_KEY);\n }",
"protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n if (resultCode == RESULT_OK && requestCode == 1) {\n // Extract name value from result extras\n site = data.getExtras().getString(\"site\");\n color = data.getExtras().getString(\"color\");\n type = data.getExtras().getString(\"type\");\n size = data.getExtras().getString(\"size\");\n // Toast the name to display temporarily on screen\n\n }\n }",
"public void getDetails() {\n presenter = new SkillPresenter(this, this);\n try {\n if (getIntent().getExtras().get(\"from\").toString().equalsIgnoreCase(\"notification\")) {\n presenter.getSkillsNotification(this, getIntent().getIntExtra(\"notification_id\", 0));\n } else if (getIntent().getExtras().get(\"from\").toString().equalsIgnoreCase(\"notificationAdapter\")) {\n presenter.getSkillsNotification(this, getIntent().getIntExtra(\"notification_id\", 0));\n } else {\n presenter.getSkills(this);\n }\n }catch (Exception e){\n e.printStackTrace();\n presenter.getSkills(this);\n }\n }",
"public String getExtra1() {\n return extra1;\n }",
"private void handleIntent() {\n // Get the intent set on this activity\n Intent intent = getIntent();\n\n // Get the uri from the intent\n Uri uri = intent.getData();\n\n // Do not continue if the uri does not exist\n if (uri == null) {\n return;\n }\n\n // Let the deep linker do its job\n Bundle data = mDeepLinker.buildBundle(uri);\n if (data == null) {\n return;\n }\n\n // See if we have a valid link\n DeepLinker.Link link = DeepLinker.getLinkFromBundle(data);\n if (link == null) {\n return;\n }\n\n // Do something with the link\n switch (link) {\n case HOME:\n break;\n case PROFILE:\n break;\n case PROFILE_OTHER:\n break;\n case SETTINGS:\n break;\n }\n\n String msg;\n long id = DeepLinker.getIdFromBundle(data);\n if (id == 0) {\n msg = String.format(\"Link: %s\", link);\n } else {\n msg = String.format(\"Link: %s, ID: %s\", link, id);\n }\n\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n }"
] | [
"0.7976446",
"0.7306751",
"0.7294586",
"0.7218195",
"0.7154684",
"0.7119123",
"0.69274694",
"0.68558574",
"0.665363",
"0.6604471",
"0.6603971",
"0.6529888",
"0.6460084",
"0.64293754",
"0.6410902",
"0.64082104",
"0.6394297",
"0.6389732",
"0.63541335",
"0.6350085",
"0.6336622",
"0.6327171",
"0.6326564",
"0.6234799",
"0.623077",
"0.62253374",
"0.6179544",
"0.6152251",
"0.6137608",
"0.6112882",
"0.61071277",
"0.6083492",
"0.60713196",
"0.6061057",
"0.60458875",
"0.6015518",
"0.60099286",
"0.6001028",
"0.59726495",
"0.59667736",
"0.596252",
"0.59564203",
"0.5935012",
"0.59239924",
"0.58941126",
"0.5881095",
"0.5878875",
"0.5850501",
"0.58301014",
"0.5814611",
"0.58038217",
"0.5797673",
"0.5794096",
"0.5731925",
"0.57302463",
"0.57291454",
"0.57118964",
"0.56938666",
"0.5674815",
"0.5674197",
"0.5669862",
"0.5650707",
"0.5650707",
"0.5647139",
"0.5638774",
"0.56309",
"0.56213135",
"0.56007993",
"0.55951864",
"0.55909204",
"0.55753946",
"0.55704206",
"0.5561137",
"0.55594116",
"0.55549175",
"0.55533814",
"0.55414957",
"0.55261093",
"0.55209905",
"0.5518462",
"0.5516228",
"0.5512507",
"0.5506857",
"0.55049545",
"0.5490202",
"0.54859865",
"0.5485403",
"0.5480949",
"0.5478128",
"0.5478",
"0.54721683",
"0.5454495",
"0.54381967",
"0.54215145",
"0.5413508",
"0.54034346",
"0.5397108",
"0.5378658",
"0.53764975",
"0.53763366",
"0.5369716"
] | 0.0 | -1 |
Returns a string representing whether this attribute is required or optional. | @SuppressWarnings("unused") // Used by markdown template.
public String getMandatoryString() {
return mandatory ? "required" : "optional";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@NonNull\n String getNecessaryAttribute();",
"private String required() {\n return this._required;\n }",
"boolean getRequired();",
"boolean getRequired();",
"boolean getRequired();",
"public boolean isRequired()\n {\n return this.isRequired;\n }",
"public boolean isRequired() {\r\n return required;\r\n }",
"public String getIsEntityRequired() {\n return Boolean.TRUE.toString();\n }",
"public boolean isRequired() {\r\n return required;\r\n }",
"public boolean isRequired() {\r\n return required;\r\n }",
"public boolean isRequired () {\n return required;\n }",
"public boolean isIsRequired() {\n return isRequired;\n }",
"public boolean isRequired()\n {\n if(_attrDef.isIndexed() && _isSingleIndexedCriterion())\n {\n return true;\n }\n \n return _attrDef.isMandatory();\n }",
"public boolean isRequired() {\n return required;\n }",
"public boolean isRequired() {\r\n\t\treturn required;\r\n\t}",
"public boolean isRequired() {\n return field.isRequired();\n }",
"public final boolean isRequired() {\n\t\treturn JsUtils.getNativePropertyBoolean(this, \"required\");\n\t}",
"public boolean isRequired()\n\t{\n\t\treturn required;\n\t}",
"@java.lang.Override\n public boolean getRequired() {\n return required_;\n }",
"public boolean isRequired();",
"@java.lang.Override\n public boolean getRequired() {\n return required_;\n }",
"@NonNull\n String getOptionalAttribute(final int field);",
"boolean isOptional();",
"boolean isRequired();",
"boolean isRequired();",
"boolean isRequired();",
"public boolean isRequired() {\n \treturn model.isRequired();\n }",
"boolean isNilAttributeTypeDisplayName();",
"java.lang.String getOptionalValue();",
"boolean isAttribute();",
"public String printAttributes() {\n checkNotUnknown();\n StringBuilder b = new StringBuilder();\n if (hasDontDelete()) {\n b.append(\"(DontDelete\");\n if (isMaybeDontDelete())\n b.append(\"+\");\n if (isMaybeNotDontDelete())\n b.append(\"-\");\n b.append(\")\");\n }\n if (hasDontEnum()) {\n b.append(\"(DontEnum\");\n if (isMaybeDontEnum())\n b.append(\"+\");\n if (isMaybeNotDontEnum())\n b.append(\"-\");\n b.append(\")\");\n }\n if (hasReadOnly()) {\n b.append(\"(ReadOnly\");\n if (isMaybeReadOnly())\n b.append(\"+\");\n if (isMaybeNotReadOnly())\n b.append(\"-\");\n b.append(\")\");\n }\n return b.toString();\n }",
"default boolean renderRequired() {\n // if (!isPrimaryKey() && isRequired() && ) constraints.add(JdlUtils.validationRequired());\n return isRequired() && !(getName().equals(\"id\") && getType().equals(JdlFieldEnum.UUID));\n }",
"@javax.annotation.Nullable\n @ApiModelProperty(value = \"Define if the task is required.\")\n @JsonProperty(JSON_PROPERTY_IS_REQUIRED)\n @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)\n\n public Boolean getIsRequired() {\n return isRequired;\n }",
"public Boolean getRequired() {\n return fieldRequired;\n }",
"public boolean isOptional() {\n return isOptional;\n }",
"protected boolean isOptional()\n {\n return false;\n }",
"boolean hasOptionalValue();",
"org.apache.xmlbeans.XmlBoolean xgetRequired();",
"public void setIsRequired(final boolean attrIsRequired) {\r\n this.required = attrIsRequired;\r\n }",
"public boolean isOptional() {\n return optional;\n }",
"public abstract String[] getRequiredAttributeNames();",
"public String getNullAttribute();",
"public String getStringAttribute();",
"public boolean isAttribute() {\n\t\treturn false;\n\t}",
"public boolean isOptional() {\n return m_optional;\n }",
"int getNumberOfOptionalAttributeFields();",
"boolean isMandatory();",
"public Boolean getRequired() {\n\t\treturn mFieldRequired;\n\t}",
"Rule FieldReq() {\n // No effect on the value stack\n return FirstOf(\"required \", \"optional \");\n }",
"@Override\r\n public String toString() {\r\n final StringBuilder strBuild = new StringBuilder();\r\n \r\n AttributeUtil.appendIfNotNull(strBuild, getName());\r\n strBuild.append(EIDASValues.ATTRIBUTE_TUPLE_SEP.toString());\r\n AttributeUtil.appendIfNotNull(strBuild, String.valueOf(isRequired()));\r\n strBuild.append(EIDASValues.ATTRIBUTE_TUPLE_SEP.toString());\r\n strBuild.append('[');\r\n \r\n if (isEmptyValue()) {\r\n if (!isEmptyComplexValue()) {\r\n AttributeUtil.appendIfNotNull(strBuild, AttributeUtil.mapToString(\r\n getComplexValue(), EIDASValues.ATTRIBUTE_VALUE_SEP.toString()));\r\n }\r\n } else {\r\n AttributeUtil.appendIfNotNull(\r\n strBuild,\r\n AttributeUtil.listToString(getValue(),\r\n EIDASValues.ATTRIBUTE_VALUE_SEP.toString()));\r\n }\r\n \r\n strBuild.append(']');\r\n strBuild.append(EIDASValues.ATTRIBUTE_TUPLE_SEP.toString());\r\n AttributeUtil.appendIfNotNull(strBuild, getStatus());\r\n strBuild.append(EIDASValues.ATTRIBUTE_SEP.toString());\r\n \r\n return strBuild.toString();\r\n }",
"public boolean isOptional() {\n\t\treturn _optional;\n\t}",
"public boolean isOptional() {\n\t\treturn optional;\n\t}",
"public boolean isMandatory() {\n return mandatory;\n }",
"public boolean isMandatory() {\n return mandatory;\n }",
"public String getNeedsAttentionDisplay() {\n if (needsAttention.booleanValue()) {\n return NEEDS_ATTN_YES;\n }\n return NEEDS_ATTN_NO;\n }",
"boolean isSetRequired();",
"public Boolean isOptional() {\n return this.optional;\n }",
"public static List<String> getRequiredAttributes() {\n\t\treturn TestObject.REQUIRED_ATTRIBUTES;\n\t}",
"boolean hasAttributes();",
"boolean hasAttributes();",
"public boolean isMandatory() {\n return mandatory;\n }",
"@Override\r\n\t\tpublic boolean hasAttribute(String name)\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}",
"@JSProperty\n boolean isRequired();",
"@Kroll.getProperty @Kroll.method\n\tpublic boolean getSpecified() {\n\t\tif (attr.getOwnerElement() == null) {\n\t\t\treturn true;\n\t\t}\n\t\treturn attr.getSpecified();\n\t}",
"@Override\n public Map<String, Set<String>> getRequiredAttributes() {\n return requiredAttributes;\n }",
"public final boolean hasAttribute ()\r\n {\r\n return _value.hasAttribute();\r\n }",
"@Override\r\n\tpublic String toString() {\r\n\t\tif (value != null)\r\n\t\t\treturn String.format(\"Optional[%s]\", value);\r\n\t\telse\r\n\t\t\treturn \"Optional.empty\";\r\n\t}",
"public final String getAttributesString() {\n String returnAttributes = \"\";\n boolean debut = true;\n for (int i = 0; i < this.attributes.length; i++) {\n if (debut) {\n debut = false;\n } else {\n returnAttributes += \"|\";\n }\n returnAttributes += this.attributes[i];\n }\n return returnAttributes;\n }",
"public String getAtLeast() {\n return atLeast;\n }",
"public String getQualFlag() {\r\n return (String) getAttributeInternal(QUALFLAG);\r\n }",
"public int getRequired() {\n return required;\n }",
"public String getAttributes() {\n StringBuilder sb = new StringBuilder();\n\n // class\n if (!getClassAttribute().isEmpty()) {\n sb.append(\"class='\").append(getClassAttribute()).append(\"' \");\n }\n\n // data-*\n if (!getDataAttributes().isEmpty()) {\n sb.append(getDataAttributes()).append(\" \");\n }\n\n // hidden\n if (isHiddenAttribute()) {\n //sb.append(\"hidden \");\n addSpecialAttribute(\"hidden\");\n }\n\n // id\n if (!getIdAttribute().isEmpty()) {\n sb.append(\"id='\").append(getIdAttribute()).append(\"' \");\n }\n\n // style\n if (!getStyleAttribute().isEmpty()) {\n sb.append(\"style='\").append(getStyleAttribute()).append(\"' \");\n }\n\n // title\n if (!getTitleAttribute().isEmpty()) {\n sb.append(\"title='\").append(getTitleAttribute()).append(\"' \");\n }\n\n // custom\n if (!getCustomAttributes().isEmpty()) {\n sb.append(getCustomAttributes()).append(\" \");\n }\n \n // special\n if (!getSpecialAttribute().isEmpty()) {\n sb.append(getSpecialAttribute());\n }\n\n return sb.toString().trim();\n }",
"@Override\r\n\t\tpublic boolean hasAttributes()\r\n\t\t\t{\n\t\t\t\treturn false;\r\n\t\t\t}",
"public String toString() {\n StringBuilder out = new StringBuilder(\"Requirements:\\n\");\n for (Fact fact: requiredFacts) {\n out.append(fact.toString());\n if (requiredFacts.indexOf(fact) < requiredFacts.size() - 1) out.append(reqIsAnd ? \"AND\\n\" : \"OR\\n\");\n }\n return out.toString();\n }",
"boolean isUniqueAttribute();",
"public Boolean getOptional() {\n return this.optional;\n }",
"public String getCardRequired() {\n return cardRequired1;\n }",
"public java.lang.String getRequires()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(REQUIRES$28);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getStringValue();\r\n }\r\n }",
"boolean isNameRequired();",
"public static List<String> getRequiredAttributes2() {\n\t\treturn TestObject.REQUIRED_ATTRIBUTES;\n\t}",
"public boolean isRequiredParam() {\n return this.isRequiredParam;\n }",
"public static boolean getDefaultAttributeQuote()\n {\n return defaults.attribute_quote;\n }",
"public String getNecessary() {\n return necessary;\n }",
"public boolean isRequired(String label)\n {\n return false;\n }",
"public boolean hasDynamicAttributes();",
"public List<String> getRequired() {\n\t\treturn required;\n\t}",
"@Override\n public boolean isAttribute()\n {\n return attribute;\n }",
"@Override\n public String getAttributesToString() {\n StringBuilder attributes = new StringBuilder();\n attributes.append(\"1 - Nominal Power: \" + nominalPower + \"\\n\");\n attributes.append(\"2 - Number of Bottles: \" + numberOfBottles + \"\\n\");\n attributes.append(\"3 - Annual Energy Consumption: \" + annualEnergyConsumption + \"\\n\");\n\n return attributes.toString();\n }",
"boolean hasAttribute(String name);",
"default String getRequiredMessage() {\n return null;\n }",
"public java.lang.String getOptionalValue() {\n java.lang.Object ref = optionalValue_;\n if (!(ref instanceof java.lang.String)) {\n java.lang.String s = ((com.google.protobuf.ByteString) ref)\n .toStringUtf8();\n optionalValue_ = s;\n return s;\n } else {\n return (java.lang.String) ref;\n }\n }",
"public String getExactly() {\n return exactly;\n }",
"public String toString()\r\n {\r\n StringBuffer sb = new StringBuffer(super.toString());\r\n\r\n if (requires_CHV)\r\n sb.append(\" CHV\" + number_of_CHV);\r\n if (requires_AUT)\r\n sb.append(\" AUT\" + number_of_key);\r\n if (requires_PRO)\r\n sb.append(\" PRO\" + number_of_key);\r\n if (requires_ENC)\r\n sb.append(\" ENC\" + number_of_key);\r\n\r\n if (never_accessible)\r\n sb.append(\" Never\");\r\n\r\n return sb.toString();\r\n }",
"public Boolean getBooleanAttribute();",
"public java.lang.String getOptionalValue() {\n java.lang.Object ref = optionalValue_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = \n (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n optionalValue_ = s;\n }\n return s;\n }\n }",
"@Override\n\tpublic boolean isMissing(final Attribute att) {\n\t\treturn false;\n\t}",
"public void setRequired(boolean value) {\r\n this.required = value;\r\n }",
"public String getPartProbationFlag() {\n return (String)getAttributeInternal(PARTPROBATIONFLAG);\n }",
"public String getLable () {\n return getString(ATTRIBUTE_LABEL);\n }"
] | [
"0.70932764",
"0.6792421",
"0.6298931",
"0.6298931",
"0.6298931",
"0.6295582",
"0.62838423",
"0.6276083",
"0.62707984",
"0.62707984",
"0.6252744",
"0.62360454",
"0.62292796",
"0.6204478",
"0.6190738",
"0.61844915",
"0.6150538",
"0.6142149",
"0.6139762",
"0.6138231",
"0.60957783",
"0.6049439",
"0.6038951",
"0.6037774",
"0.6037774",
"0.6037774",
"0.60107124",
"0.60081285",
"0.6006065",
"0.59927154",
"0.5969068",
"0.5960849",
"0.5934186",
"0.5857566",
"0.5856896",
"0.5842787",
"0.5821971",
"0.5809326",
"0.57793033",
"0.57728136",
"0.5758294",
"0.5752848",
"0.5750531",
"0.5749778",
"0.57231075",
"0.57172424",
"0.57152265",
"0.5693749",
"0.56891936",
"0.56882995",
"0.5680461",
"0.5678244",
"0.5667963",
"0.5667963",
"0.5662005",
"0.56384563",
"0.5638371",
"0.56267065",
"0.5620069",
"0.5620069",
"0.5617474",
"0.560814",
"0.55834264",
"0.55730397",
"0.55721104",
"0.5565711",
"0.55475676",
"0.5539061",
"0.55218947",
"0.5517571",
"0.5487222",
"0.5484594",
"0.5469356",
"0.54631823",
"0.54555327",
"0.54515785",
"0.5423725",
"0.54231566",
"0.5421549",
"0.5417559",
"0.53947425",
"0.5377575",
"0.5375385",
"0.5343302",
"0.53422517",
"0.5337964",
"0.5318247",
"0.53164464",
"0.5316433",
"0.53163636",
"0.53133094",
"0.5299081",
"0.52971697",
"0.5267488",
"0.5255951",
"0.52525175",
"0.5248395",
"0.5222666",
"0.52097124"
] | 0.7522697 | 1 |
This needs to read through the netflix data and for each point if it belongs to a canopy, then emit it to it. Final form will be CanopyID1:CanopyID2:... MovieID:movieVector where movieVector contains the userID,rating pairs. | @Override
public void map(Text key,Text values,Context context) throws IOException, InterruptedException {
count += 1;
String movie_id = key.toString();
String data = ((Text)values).toString();
String status = count+":"+capopyCenters.size()+":"+movie_id;
context.setStatus(status);
NetflixMovie curr = new NetflixMovie(movie_id, data);
boolean emitted = false;
StringBuilder builder = new StringBuilder();
for(NetflixMovie center: capopyCenters) {
int matchCount = curr.MatchCount(center);
if(matchCount > 2) {
emitted |= true;
if(builder.length()>0)
builder.append(":");
builder.append(center.movie_id);
}
}
if(emitted) {
builder.append(":");
builder.append(movie_id);
builder.append(":");
builder.append(data);
String to_emit = builder.toString();
context.write(new Text(movie_id), new Text(to_emit));
}else
context.setStatus("Did not emit: "+movie_id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void printAverageRatingsByDirectors(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n String[] directors = {\"Charles Chaplin\",\"Michael Mann\",\"Spike Jonze\"};\n \n DirectorsFilter dir_filter = new DirectorsFilter(directors);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, dir_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_dir = database.getDirector(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_dir + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }",
"public void printAverageRatingsByDirectorsAndMinutes(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n String[] directors = {\"Spike Jonze\",\"Michael Mann\",\"Charles Chaplin\",\"Francis Ford Coppola\"};\n int min = 30;\n int max = 170;\n \n AllFilters all_filter = new AllFilters();\n MinutesFilter mins_filter = new MinutesFilter(min, max);\n DirectorsFilter dir_filter = new DirectorsFilter(directors);\n \n all_filter.addFilter(mins_filter);\n all_filter.addFilter(dir_filter);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, all_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_dirs = database.getDirector(rating.getItem());\n \n int mov_mins = database.getMinutes(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_dirs + \"\\t\" + mov_mins + \"\\t\" + title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n }",
"@SuppressWarnings({ \"unchecked\", \"resource\" })\n\tprivate static void writeRatings(Object treasureMap, PrintWriter pw, File treasureFile, PrintWriter pwCategories) throws IOException {\n\t\tfor (Map.Entry<String, Object> treasure : ((Map<String, Object>) treasureMap).entrySet()) {\n\n\t\t\tString treasureName=treasure.getKey();\n\t\t\tObject userFeedbackMap= treasure.getValue(); // TREASURE\n\t\t\tfor(Entry<String, Object> userFeedback: ((LinkedHashMap<String, Object>) userFeedbackMap).entrySet())\n\t\t\t{\n\t\t\t\tString userName=userFeedback.getKey(); // USER\n\t\t\t\tObject userFeedbackObj=userFeedback.getValue();\n\t\t\t\tfor(Entry<String, Object> userFeedbackEntry: ((LinkedHashMap<String, Object>) userFeedbackObj).entrySet())\n\t\t\t\t{\n\t\t\t\t\tif(userFeedbackEntry.getKey().equals(\"rating\")) // RATING\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(treasureName + \" \" + userName);\n\t\t\t\t\t\tString rating=userFeedbackEntry.getValue().toString();\n\t\t\t\t\t\t/* write to the csv file the the user + the treasure name + the rating */\n\t\t\t\t\t\tlong userNameDecoded = new BigInteger(userName.getBytes()).longValue();\n\t\t\t\t\t\tlong treasureNameDecoded = new BigInteger(treasureName.getBytes()).longValue();\n\n\n\t\t\t\t\t\tfloat ratingFloat = (float)Integer.parseInt(rating);\n\n\t\t\t\t\t\tpw.write(userNameDecoded+\",\"+treasureNameDecoded+\",\"+ratingFloat+\"\\n\");\n\n\t\t\t\t\t\t/* write to category csv file user + category + rating */\n\t\t\t\t\t\tFileReader fileReader=new FileReader(treasureFile);\n\t\t\t\t\t\tBufferedReader br = null;\n\t\t\t\t\t\tString line = \"\";\n\t\t\t\t\t\tString cvsSplitBy = \",\";\n\t\t\t\t\t\tbr = new BufferedReader(fileReader);\n\t\t\t\t\t\twhile ((line = br.readLine()) != null) {\n\n\t\t\t\t\t\t\t// use comma as separator\n\t\t\t\t\t\t\tString[] treasureStr = line.split(cvsSplitBy);\n\t\t\t\t\t\t\tif(treasureStr[0]!=null&&Long.parseLong(treasureStr[0])==treasureNameDecoded)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(treasureStr[2]!=null)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(userCategoryMap.get(userNameDecoded+\",\"+new BigInteger(treasureStr[3].getBytes()).longValue())==null)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tuserCategoryMap.put(userNameDecoded+\",\"+new BigInteger(treasureStr[3].getBytes()).longValue(), 1.0);\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\tdouble val=userCategoryMap.get(userNameDecoded+\",\"+new BigInteger(treasureStr[3].getBytes()).longValue());\n\t\t\t\t\t\t\t\t\t\tuserCategoryMap.put(userNameDecoded+\",\"+new BigInteger(treasureStr[3].getBytes()).longValue(), val+1.0);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(Entry<String,Double> entry: userCategoryMap.entrySet())\n\t\t{\n\t\t\tString usercategory=entry.getKey();\n\t\t\tString[] arr=usercategory.split(\",\");\n\t\t\tString userNameDecoded=arr[0];\n\t\t\tString categoryDecoded=arr[1];\n\t\t\tdouble numberOfVisits=entry.getValue();\n\t\t\tpwCategories.write(userNameDecoded+\",\"+categoryDecoded+\",\"+numberOfVisits+\"\\n\");\n\t\t}\n\t\tpwCategories.close();\n\t\tpw.close();\n\t}",
"public void printAverageRatingsByDirectors(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new DirectorsFilter(\"Clint Eastwood,Joel Coen,Martin Scorsese,Roman Polanski,Nora Ephron,Ridley Scott,Sydney Pollack\"); \n int minRatings = 4;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\"\n + MovieDatabase.getDirector(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"@Override\r\n\t//Mapper Method\r\n\tpublic void map(LongWritable key, Text value, Context c) throws IOException, InterruptedException\r\n\t{\n\tString line = value.toString();\r\n\t//Split them into tokens \r\n\tString [] tokens = line.split(\"\\\\;\");\r\n\t//Store the year of the movie title\r\n\tString year = tokens[3];\r\n\t//Check if the data is present or not(\\N)\r\n\t//If it is present then check if it is a movie after 2000\r\n\tif(year.startsWith(\"2\"))\r\n\t{\r\n\t//Take the various genres of the movie \r\n\t\tString genre=tokens[4];\r\n\t\t//Split and store each genre seperately\r\n\t\tString [] tokens_genre=genre.split(\"\\\\,\");\r\n\t\t//For each genre in the genre list of the movie run the loop\r\n\t\tfor(int i=0;i<tokens_genre.length;i++)\r\n\t\t{\t\r\n\t\t//Check if the data is provided in the genre list(not \\N)\r\n\tif(!tokens_genre[i].startsWith(\"\\\\N\"))\r\n\t{\r\n\t//For each genre set the mapper key\r\n\t//Here each key is the year of the movie and its genre connected with a '_'\r\n\t\tmapperKey.set(new Text(year) + \"_\" + new Text(tokens_genre[i]));\r\n\t\t//Create the key value pair\r\n\t\tc.write(mapperKey, new Text(\"1\"));\r\n\t}\r\n\t\t}\r\n\t\r\n\t}\r\n\t\r\n\t}",
"public static void main(String[] args) throws IOException, TasteException {\n NetflixModel model = new NetflixModel(new File(\"data/netflix_data.txt\"));\n\n // 3 users used for recommendation\n final long[] users = {1641844, 1011593, 519380};\n\n // For output export\n OutputPrinter printer = new OutputPrinter();\n\n printer.writeStringToFile(\"SVDPlusPlusFactorizer\");\n for (long user : users) {\n\n // Recommended movies for a user\n List<String> movies = new ArrayList<>();\n\n SVDPlusPlusFactorizer factorizer = new SVDPlusPlusFactorizer(model, 10, 10);\n Recommender recommender = new SVDRecommender(model, factorizer);\n\n // Recommend 4 movies\n List<RecommendedItem> recommendedItems = recommender.recommend(user, 4);\n\n for(RecommendedItem item : recommendedItems) {\n movies.add(model.getMovieNameFromID(item.getItemID()));\n }\n\n printer.writeToFile(user + \"\", movies);\n }\n printer.writeStringToFile(\"----------------------------------------------------\\n\");\n\n\n printer.writeStringToFile(\"ALSWRFactorizer\");\n for (long user : users) {\n\n // Recommended movies for a user\n List<String> movies = new ArrayList<>();\n\n ALSWRFactorizer factorizer = new ALSWRFactorizer(model, 10, 0.02, 10);\n Recommender recommender = new SVDRecommender(model, factorizer);\n\n // Recommend 4 movies\n List<RecommendedItem> recommendedItems = recommender.recommend(user, 4);\n\n for(RecommendedItem item : recommendedItems) {\n movies.add(model.getMovieNameFromID(item.getItemID()));\n }\n\n printer.writeToFile(user + \"\", movies);\n }\n printer.writeStringToFile(\"----------------------------------------------------\\n\");\n\n\n printer.writeStringToFile(\"GenericUserBasedRecommender\");\n for (long user : users) {\n\n // Recommended movies for a user\n List<String> movies = new ArrayList<>();\n\n UserSimilarity userSimilarity = new PearsonCorrelationSimilarity(model);\n UserNeighborhood neighborhood = new NearestNUserNeighborhood(100, userSimilarity, model);\n Recommender recommender = new GenericUserBasedRecommender(model, neighborhood, userSimilarity);\n\n // Recommend 4 movies\n List<RecommendedItem> recommendedItems = recommender.recommend(user, 4);\n\n for(RecommendedItem item : recommendedItems) {\n movies.add(model.getMovieNameFromID(item.getItemID()));\n }\n\n printer.writeToFile(user + \"\", movies);\n }\n }",
"public void printAverageRatingsByDirectorsAndMinutes(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n AllFilters f = new AllFilters();\n MinutesFilter m = new MinutesFilter(90, 180);\n DirectorsFilter d = new DirectorsFilter(\"Clint Eastwood,Joel Coen,Tim Burton,Ron Howard,Nora Ephron,Sydney Pollack\");\n f.addFilter(m);\n f.addFilter(d);\n int minRatings = 3;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + \"Time: \" \n + MovieDatabase.getMinutes(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" \n + MovieDatabase.getDirector(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"private ArrayList<Rating> getSimilarities(String id){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n RaterDatabase database = new RaterDatabase();\n database.initialize(ratingsfile);\n \n ArrayList<Rating> dot_list = new ArrayList<Rating>();\n \n Rater me = database.getRater(id);\n \n for (Rater rater : database.getRaters()){\n \n if(rater != me){\n \n double dot_product = dotProduct(me, rater);\n \n if (dot_product >= 0.0){\n \n Rating new_rating = new Rating(rater.getID() , dot_product);\n \n dot_list.add(new_rating);\n }\n \n }\n \n }\n \n Collections.sort(dot_list , Collections.reverseOrder());\n \n return dot_list;\n \n }",
"public NetFlixPredictor(String movieFilePath, String ratingFilePath, String tagFilePath, String linkFilePath) {\n\t\tArrayList<String> movieStrings = FileIO.read(movieFilePath);\n\t\tArrayList<String> tagStrings = FileIO.read(tagFilePath);\n\t\tArrayList<String> ratingStrings = FileIO.read(ratingFilePath);\n\t\tArrayList<String> linkStrings = FileIO.read(linkFilePath);\n\t\tusers = new ArrayList<User>();\n\t\tusers.add(new User(1));\n\n\t\tmovieStrings.remove(0);\n\t\ttagStrings.remove(0);\n\t\tratingStrings.remove(0);\n\n\t\tMovieLensCSVTranslator translator = new MovieLensCSVTranslator();\n\n\t\tfor(String s: movieStrings) {\n\t\t\tmovies.add(translator.parseMovie(s));\n\t\t}\n\t\tCollections.sort(movies);\n\t\tfor(String s: tagStrings) {\n\t\t\ttags.add(translator.parseTag(s));\n\t\t}\n\n\t\tfor(String s: ratingStrings) {\n\t\t\tratings.add(translator.parseRating(s, movies));\n\t\t}\n\t\tCollections.sort(ratings);\n\n\t\tint userId = users.get(0).getId();\n\t\tfor(Rating r: ratings) {\n\t\t\tint user = r.getUserId();\n\t\t\tif(user == userId) {\n\t\t\t\tusers.get(user-1).addRating(r);\n\t\t\t\tint ind = Collections.binarySearch(movies, new Movie(r.getMovieId()));\n\t\t\t\tif(ind >= 0) \n\t\t\t\t\tusers.get(user-1).addMovie(movies.get(ind));\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuserId = r.getUserId();\n\t\t\t\tUser x = new User(user);\n\t\t\t\tx.addRating(r);\n\t\t\t\tint ind = Collections.binarySearch(movies, new Movie(r.getMovieId()));\n\t\t\t\tif(ind >= 0) {\n\t\t\t\t\tx.addMovie(movies.get(ind));\n\t\t\t\t\tusers.add(x);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(Tag t: tags) {\n\t\t\tint ind = Collections.binarySearch(movies, new Movie(t.getMovieId()));\n\t\t\tif(ind >= 0)\n\t\t\t\tmovies.get(ind).addTag(t);\n\t\t\tboolean userExists = false;\n\t\t\tfor(int i = 0; i < users.size(); i++) {\n\t\t\t\tif(users.get(i).getId() == t.getUserId()) {\n\t\t\t\t\tusers.get(i).addTag(t);\n\t\t\t\t\tuserExists = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!userExists) {\n\t\t\t\tUser u = new User(t.getUserId());\n\t\t\t\tu.addTag(t);\n\t\t\t\tusers.add(u);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(users);\n\n\t\tfor(int i = 1; i < linkStrings.size(); i++) {\n\t\t\tString s = linkStrings.get(i);\n\t\t\ttranslator.parseLinks(s, movies);\n\t\t}\n\t}",
"public void printAverageRatingsByYearAfterAndGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n int year = 1980;\n String genre = \"Romance\";\n \n AllFilters all_filter = new AllFilters();\n GenreFilter gf = new GenreFilter(genre);\n YearAfterFilter yf = new YearAfterFilter(year);\n \n all_filter.addFilter(yf);\n all_filter.addFilter(gf);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, all_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n int mov_year = database.getYear(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" + mov_year + \"\\t\" + title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }",
"public void movieDetailes (Movie movie) throws IOException, JSONException{\n\t\t\n\t MovieImages poster= movie.getImages(movie.getID());\n\t System.out.println(poster.posters);\n\t \n\t Set<MoviePoster> temp = new HashSet<MoviePoster>();\n\t for(MoviePoster a: poster.posters) {\n\t \t \n\t \t posterurl = \"\";\n\t \t largerposterurl = \"\";\n\t \t if(a.getSmallestImage() != null){\n\t \t\t posterurl = a.getSmallestImage().toString();\n\t \t }\n\t \t if(a.getImage(Size.MID) != null){\n\t \t\t largerposterurl = a.getImage(Size.MID).toString();\n\t \t }\n\t \t //System.out.println(a.getSmallestImage());\n\t \t break;\n\t }\n\n\t System.out.println(\"Cast:\");\n\t // Get the full decsription of the movie.\n\t Movie moviedetail = Movie.getInfo(movie.getID());\n\t if(moviedetail != null){\n\t \tmovieName = moviedetail.getOriginalName();\n\t\t overview = moviedetail.getOverview();\n\t\t if(moviedetail.getTrailer() != null){\n\t\t \ttrailerURL = moviedetail.getTrailer().toString();\n\t\t }\n\t\t if(moviedetail.getReleasedDate() != null){\n\t\t \treleaseDate = moviedetail.getReleasedDate().toString();\n\t\t }\n\t\t rating = moviedetail.getRating();\n\t\t cast = \"\\n\\nCast: \\n\";\n\t\t for (CastInfo moviecast : moviedetail.getCast()) {\n\t\t\t System.out.println(\" \" + moviecast.getName() + \" as \"\n\t\t\t + moviecast.getCharacterName()\t);\n\t\t\t cast = cast + \" \" + moviecast.getName() + \"\\n\";\n\t\t\t }\n\t\t \n\t\t ID = moviedetail.getID();\n\t }\n\t \n\t}",
"List<PersonPageRank> getPageRank() throws Exception {\n // first map to pair of pID and uID and keep only distinct\n JavaPairRDD<String, String> graph = movieReviews\n .mapToPair(s->new Tuple2<>(s.getMovie().getProductId(), s.getUserId())).distinct();\n // now, join graph to graph (by pId) and filter out those with the same uID\n // then, map to \" \" divided string of pID and uID and keep only distinct pairs\n JavaRDD<String> graphCart =\n graph.join(graph)\n .filter(s->(!s._2._1.equals(s._2._2)))\n .map(s->s._2._1 + \" \" + s._2._2)\n .distinct();\n // call pageRank code and return it's result\n return JavaPageRank.pageRank(graphCart, 100);\n }",
"public void printAverageRatingsByGenre(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n String genre = \"Crime\";\n \n GenreFilter genre_filter = new GenreFilter(genre);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, genre_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n String mov_genre = database.getGenres(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_genre + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n }",
"private void insertCastsData(Connection conn)\n\t{\n\t\ttry {\n\t\t\tString filmid = null;\n\t\t\tString actorstageName = null;\n\t\t\tint starId;\n\t\t\tint movieId;\n\t\t\tint flag = 0;\n\t\t\tPreparedStatement ptinsertStarMovie = null;\n\t\t\tptinsertStarMovie = (PreparedStatement) conn.prepareStatement(\"Insert into stars_in_movies (starId, movieId) Values (? ,?);\");\n\n\t\t\tElement docElem = dom.getDocumentElement();\n\t\t\tNodeList dirfilmsList = docElem.getElementsByTagName(\"dirfilms\");\n\t\t\tfor (int i = 0; i < dirfilmsList.getLength(); i++) {\n\t\t\t\tElement dirfilmsElem = (Element) dirfilmsList.item(i);\n\t\t\t\tNodeList filmcList = dirfilmsElem.getElementsByTagName(\"filmc\");\n\t\t\t\tif (filmcList != null) {\n\t\t\t\t\tfor (int j = 0; j < filmcList.getLength(); j++) {\n\t\t\t\t\t\tElement filmcElem = (Element) filmcList.item(j);\n\t\t\t\t\t\tNodeList mList = filmcElem.getElementsByTagName(\"m\");\n\t\t\t\t\t\tif (mList != null) {\n\t\t\t\t\t\t\tfor (int k = 0; k < mList.getLength(); k++) {\n\t\t\t\t\t\t\t\tfilmid = null;\n\t\t\t\t\t\t\t\tactorstageName = null;\n\t\t\t\t\t\t\t\tflag = 0;\n\t\t\t\t\t\t\t\t// count3++;\n\t\t\t\t\t\t\t\tElement mElem = (Element) mList.item(k);\n\t\t\t\t\t\t\t\t// Get Film ID\n\t\t\t\t\t\t\t\tNodeList fList = mElem.getElementsByTagName(\"f\");\n\t\t\t\t\t\t\t\tif (fList != null && fList.getLength() > 0) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tfilmid = fList.item(0).getFirstChild().getNodeValue();\n\t\t\t\t\t\t\t\t\t\tfilmid = filmid.trim();\n\t\t\t\t\t\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tNodeList aList = mElem.getElementsByTagName(\"a\");\n\t\t\t\t\t\t\t\tif (aList != null) {\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tactorstageName = aList.item(0).getFirstChild().getNodeValue();\n\t\t\t\t\t\t\t\t\t\tactorstageName = actorstageName.trim();\n\t\t\t\t\t\t\t\t\t\tactorstageName = actorstageName.toLowerCase();\n\t\t\t\t\t\t\t\t\t} catch (Exception e2) {\n\t\t\t\t\t\t\t\t\t\t// do nothing\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (actorstageName != null && filmid != null) {\n\n\t\t\t\t\t\t\t\t\tif (!movie_map.containsKey(filmid)) {\n\t\t\t\t\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (!star_map.containsKey(actorstageName)) {\n\t\t\t\t\t\t\t\t\t\tflag = 1;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (flag == 0) {\n\t\t\t\t\t\t\t\t\t\tstarId = star_map.get(actorstageName);\n\t\t\t\t\t\t\t\t\t\tmovieId = movie_map.get(filmid);\n\t\t\t\t\t\t\t\t\t\tptinsertStarMovie.setString(1, \"nm\" + starId);\n\t\t\t\t\t\t\t\t\t\tptinsertStarMovie.setString(2, \"tt\" + movieId);\n\t\t\t\t\t\t\t\t\t\tptinsertStarMovie.addBatch();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tptinsertStarMovie.executeBatch();\n\t\t\tconn.commit();\n\t\t\tptinsertStarMovie.close();\n\t\t\t// PreparedStatement temp = (PreparedStatement)\n\t\t\t// conn.prepareStatement(\"ALTER IGNORE TABLE stars_in_movies ADD\n\t\t\t// constraint myuniqueconstaint UNIQUE (star_id, movie_id);\");\n\t\t\t// temp.executeUpdate();\n\t\t\t// temp.close();\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t}",
"@Override\n public void getMovieContentData() {\n Cursor movieCursor = queryMovieData();\n\n ArrayList<MovieData> movieData = new ArrayList<>();\n\n if(movieCursor != null) {\n //do stuff\n while(movieCursor.moveToNext()) {\n MovieData movie = new MovieData();\n movie.setName(movieCursor.getString(movieCursor.getColumnIndex(MovieUriContract.MovieEntry.COLUMN_NAME)));\n movie.setDate(movieCursor.getString(movieCursor.getColumnIndex(MovieUriContract.MovieEntry.COLUMN_RELEASE_DATE)));\n movie.setGenreId(movieCursor.getInt(movieCursor.getColumnIndex(MovieUriContract.MovieEntry.COLUMN_GENRE)));\n }\n movieCursor.close();\n }\n\n //query genre data next, using the GenreId in Movie Data\n for (MovieData movie : movieData) {\n Cursor genreCursor = queryGenreData(movie.getGenreId());\n\n if(genreCursor != null) {\n //do stuff\n if (genreCursor.moveToFirst()) {\n movie.setGenre(movieCursor.getString(movieCursor.getColumnIndex(MovieUriContract.GenreEntry.COLUMN_NAME)));\n }\n genreCursor.close();\n }\n }\n\n view.updateMovieDataView(movieData);\n }",
"public void printAverageRatingsByYear(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n int year = 2000;\n \n YearAfterFilter year_filter = new YearAfterFilter(year);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, year_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n int mov_year = database.getYear(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_year + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n \n \n }",
"public static void main(String[] args) throws IOException {\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"FilmTrust Dataset Testing.\");\n System.out.println(\"------------------------------------------------\");\n\n double duration = System.currentTimeMillis();\n filmTrust = new Network(new File(\"src//data//ratings.txt\"),\n new File(\"src//data//trust.txt\"));\n\n filmTrust.connect();\n duration = System.currentTimeMillis() - duration;\n System.out.println(\"FilmTrust connected in \" + duration / 1000 + \" seconds.\");\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"Data Statistics:\");\n filmTrust.showStatistics();\n System.out.println(\"------------------------------------------------\");\n\n duration = System.currentTimeMillis();\n\n if (metaPath.equals(\"TrTeTr\")) {\n System.out.println(\"PathSim using Trustor -> Trustee -> Trustor :\");\n String predictionFileName = similaritMatrixFileName+metaPath+ \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n \n\n Set<Integer> trustorUsers = filmTrust.getTrustorUsers(); \n \n for (int userId : trustorUsers) { \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath); \n writeSimilarityToFile(similarTrustors, userId, pFile);\n \n }// for trustor users \n \n pFile.close();\n System.out.println(\"\"); \n System.out.println(\"End of TrTeTr path\");\n } // if TrTeTr\n \n else if (metaPath.equals(\"TrTeTrTeTr\")) {\n System.out.println(\"PathSim using Trustor -> Trustee -> Trustor -> Trustee -> Trustor :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trustorUsers = filmTrust.getTrustorUsers(); \n\n int counter = 0,processStatus=0, size = trustorUsers.size();\n for (int userId : trustorUsers) {\n \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath);\n writeSimilarityToFile(similarTrustors, userId, pFile); \n \n }// for \n\n pFile.close();\n System.out.println(\"End of TrTeTrTeTr path\");\n } // if TrTeTrTeTr\n \n else if (metaPath.equals(\"TrTrTeTrTr\")) {\n System.out.println(\"PathSim using Trustor -> Trustor -> Trustee -> Trustor -> Trustor :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName)); \n \n Set<Integer> trustorUsers = filmTrust.getTrustorUsers();\n\n\n for (int userId : trustorUsers) { \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath);\n writeSimilarityToFile(similarTrustors, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of TrTrTeTrTr path\");\n } // if TrTrTeTrTr\n \n else if (metaPath.equals(\"TeTrTe\")) {\n System.out.println(\"PathSim using Trustee -> Trustor -> Trustee :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile); \n }\n pFile.close();\n System.out.println(\"End of TeTrTe path\");\n } // if TeTrTe\n \n else if (metaPath.equals(\"TeTrTeTrTe\")) {\n System.out.println(\"PathSim using Trustee -> Trustor -> Trustee -> Trustor -> Trustee:\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile);\n }\n\n pFile.close();\n System.out.println(\"End of TeTrTeTrTe path\");\n } // if TeTrTeTrTe \n \n else if (metaPath.equals(\"TeTeTrTeTe\")) {\n System.out.println(\"PathSim using Trustee -> Trustee -> Trustor -> Trustee -> Trustee:\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile);\n }\n\n pFile.close();\n System.out.println(\"End of TeTeTrTeTe path\");\n } // if TeTeTrTeTe\n \n else if (metaPath.equals(\"UrImUr\")) {\n System.out.println(\"PathSim using User -> Item -> User :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> ratingUsers = filmTrust.getRatingUsers();\n \n for (int userId : ratingUsers) {\n filmTrust.resetDataOfUsers();\n ArrayList<RatingUser> similarRatingUsers = filmTrust.PathSimRatingUser(userId, metaPath);\n writeSimilarityToFile(similarRatingUsers, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of UrImUr path\");\n }// if UrImUr\n else if (metaPath.equals(\"TrImTr\")) {\n System.out.println(\"PathSim using Trustor -> Item -> Trustor :\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n \n Set<Integer> trustorUsers = filmTrust.getTrustorUsers();\n\n for (int userId : trustorUsers) { \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath);\n writeSimilarityToFile(similarTrustors, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of TrImTr path\");\n }// if TrImTr\n \n else if (metaPath.equals(\"TeImTe\")) {\n System.out.println(\"PathSim using Trustee -> Item -> Trustee :\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of TeImTe path\");\n }// if TrImTr\n else if(metaPath.equals(\"Test\")){\n System.out.println(\"sperating users:\");\n HashMap<Integer, RatingUser> ratingUsersItems = filmTrust.getRatingUsersItems(); \n HashMap<Integer, RatedItem> ratedItemsUsers = filmTrust.getRatedItemsUsers();\n \n System.out.println(\"cold users...\");\n String seperatedUsers = \"filmtrust-coldusers\";\n String seperatedFileName = seperatedUsers + \".txt\";\n FileWriter pFile = new FileWriter(new File(seperatedFileName));\n \n writeColdUsersToFile(ratingUsersItems, pFile); \n pFile.close();\n \n System.out.println(\"heavy users...\");\n seperatedUsers = \"filmtrust-heavyusers\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeHeavyUsersToFile(ratingUsersItems, pFile); \n pFile.close(); \n \n System.out.println(\"opinionated users...\");\n seperatedUsers = \"filmtrust-opinionatedusers\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeOpinionatedUsersToFile(ratingUsersItems, pFile); \n pFile.close(); \n \n System.out.println(\"niche items...\"); \n seperatedUsers = \"filmtrust-nicheitems\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeNicheItemsToFile(ratedItemsUsers, pFile); \n pFile.close();\n \n System.out.println(\"controversial items...\"); \n seperatedUsers = \"filmtrust-controversialitems\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeControversialItemsToFile(ratedItemsUsers, pFile); \n pFile.close();\n \n System.out.println(\"End of seperation\");\n }//test\n\n duration = System.currentTimeMillis() - duration;\n\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"calculations done in \" + duration / 1000 + \" seconds.\");\n\n }",
"public void printAverageRatingsByYear(){\n ThirdRatings MoviesRated = new ThirdRatings(\"data/ratings.csv\");\r\n //ThirdRatings MoviesRated = new ThirdRatings(\"data/ratings_short.csv\");\r\n \r\n // to oad movies\r\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\r\n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\r\n \r\n // to check equality of the size of the HashMap and files readed\r\n System.out.println(\"Movie size : \" + MovieDatabase.size());\r\n System.out.println(\"Rater size: \"+ MoviesRated.getRaterSize());\r\n \r\n //System.out.println(\"title: \"+ MoviesRated.getTitle(\"68646\"));\r\n //System.out.println(\"avg by ID: \"+ MoviesRated.getAverageByID(\"68646\",10));\r\n \r\n // to get avg ratings for the movies rated by \"n\" tarets: MoviesRated.getAverageRatings(n);\r\n ArrayList<Rating> avgMovieRatings = MoviesRated.getAverageRatingsByFilter(20,new YearAfterFilter(2000));\r\n \r\n // to print how many movies are get avg rating\r\n System.out.println(\"The # of movies with avg rating: \"+avgMovieRatings.size());\r\n \r\n //HashMap<String, Double> avgMovieRatings = MoviesRated.getAverageRatings(12);\r\n \r\n // to sort movies by ratings ascending\r\n Collections.sort(avgMovieRatings);\r\n \r\n // to print rating and title of each movie in the list\r\n for (Rating movie:avgMovieRatings){\r\n if (movie.getValue()>0){\r\n System.out.println(movie.getValue()+\": \"+ MovieDatabase.getTitle(movie.getItem()));} \r\n }\r\n \r\n //for (String movie:avgMovieRatings.keySet()){\r\n // if (avgMovieRatings.get(Movie)>0){\r\n // System.out.println(avgMovieRatings.get(Movie)+\": \"+ MoviesRated.getTitle(movie.getItem()));} \r\n //}\r\n \r\n \r\n }",
"public void printAverageRatingsByMinutes(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size); \n \n int min = 110;\n int max = 170;\n \n MinutesFilter mins_filter = new MinutesFilter(min, max);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatingsByFilter(1, mins_filter);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n int mov_time = database.getMinutes(rating.getItem());\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + mov_time + \"\\t\" +title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n }",
"public static void Pubmed() throws IOException \n\t{\n\t\t\n\t\tMap<String,Map<String,List<String>>> trainset = null ; \n\t\t//Map<String, List<String>> titles = ReadXMLFile.ReadCDR_TestSet_BioC() ;\n\t File fFile = new File(\"F:\\\\TempDB\\\\PMCxxxx\\\\articals.txt\");\n\t List<String> sents = readfiles.readLinesbylines(fFile.toURL()); \n\t\t\n\t\tSentinfo sentInfo = new Sentinfo() ; \n\t\t\n\t\ttrainset = ReadXMLFile.DeserializeT(\"F:\\\\eclipse64\\\\eclipse\\\\TrainsetTest\") ;\n\t\tLinkedHashMap<String, Integer> TripleDict = new LinkedHashMap<String, Integer>();\n\t\tMap<String,List<Integer>> Labeling= new HashMap<String,List<Integer>>() ;\n\t\t\n\t\tMetaMapApi api = new MetaMapApiImpl();\n\t\tList<String> theOptions = new ArrayList<String>();\n\t theOptions.add(\"-y\"); // turn on Word Sense Disambiguation\n\t theOptions.add(\"-u\"); // unique abrevation \n\t theOptions.add(\"--negex\"); \n\t theOptions.add(\"-v\");\n\t theOptions.add(\"-c\"); // use relaxed model that containing internal syntactic structure, such as conjunction.\n\t if (theOptions.size() > 0) {\n\t api.setOptions(theOptions);\n\t }\n\t \n\t\t\n\t\tif (trainset == null )\n\t\t{\n\t\t\ttrainset = new HashMap<String, Map<String,List<String>>>();\n\t\t}\n\t\t\n\t\t\n\t\t/************************************************************************************************/\n\t\t//Map<String, Integer> bagofwords = semantic.getbagofwords(titles) ; \n\t\t//trainxmllabeling(trainset,bagofwords); \n\t\t/************************************************************************************************/\n\t\t\n\t\t\n\t\tint count = 0 ;\n\t\tint count1 = 0 ;\n\t\tModel candidategraph = ModelFactory.createDefaultModel(); \n\t\tMap<String,List<String>> TripleCandidates = new HashMap<String, List<String>>();\n\t\tfor(String title : sents)\n\t\t{\n\t\t\t\n\t\t\tModel Sentgraph = sentInfo.graph;\n\t\t\tif (trainset.containsKey(title))\n\t\t\t\tcontinue ; \n\t\t\t//8538\n\t\t\tcount++ ; \n\n\t\t\tMap<String, List<String>> triples = null ;\n\t\t\t// get the goldstandard concepts for current title \n\t\t\tList<String> GoldSndconcepts = new ArrayList<String> () ;\n\t\t\tMap<String, Integer> allconcepts = null ; \n\t\t\t\n\t\t\t// this is optional and not needed here , it used to measure the concepts recall \n\t\t\tMap<String, List<String>> temptitles = new HashMap<String, List<String>>(); \n\t\t\ttemptitles.put(title,GoldSndconcepts) ;\n\t\t\t\t\t\t\n\t\t\t// get the concepts \n\t\t\tallconcepts = ConceptsDiscovery.getconcepts(temptitles,api);\n\t\t\t\n\t\t\tArrayList<String> RelInstances1 = SyntaticPattern.getSyntaticPattern(title,allconcepts,FILE_NAME_Patterns) ;\n\t\t\t//Methylated-CpG island recovery assay: a new technique for the rapid detection of methylated-CpG islands in cancer\n\t\t\tif (RelInstances1 != null && RelInstances1.size() > 0 )\n\t\t\t{\n\t\t\t\tcount1++ ;\n\t\t\t\tTripleCandidates.put(title, RelInstances1) ;\n\t\t\t\t\n\t\t\t\tif (count1 == 30)\n\t\t\t\t{\n\t\t\t\t\tReadXMLFile.Serialized(TripleCandidates,\"F:\\\\eclipse64\\\\eclipse\\\\Relationdisc1\") ;\n\t\t\t\t\tcount1 = 0 ;\n\t\t\t\t}\n\t\t\t}\n \n\t\t}\n\t\t\n\t\tint i = 0 ;\n\t\ti++ ; \n\t}",
"public void getSimilarity(){\r\n\t\tfor(Integer i : read.rateMap.keySet()){\r\n\t\t\tif(i != this.userID){\r\n\t\t\t\t//Calculate the average rate.\r\n\t\t\t\tdouble iAverage = average.get(i);\r\n\t\t\t\tdouble a = 0.0;\r\n\t\t\t\tdouble b = 0.0;\r\n\t\t\t\tdouble c = 0.0;\r\n\t\t\t\t//Set a flag by default meaning the user does not have common rate with this user.\r\n\t\t\t\tboolean intersection = false;\r\n\t\t\t\tArrayList<Map.Entry<String, Double>> list = read.rateMap.get(i);\r\n\t\t\t\tfor(int j = 0; j < list.size(); j++){\r\n\t\t\t\t\tdouble userRate = 0;\r\n\t\t\t\t\tif(ratedID.contains(list.get(j).getKey())){\r\n\t\t\t\t\t\t//The user has common rated movies with this user\r\n\t\t\t\t\t\tintersection = true;\r\n\t\t\t\t\t\tfor(int k = 0; k < read.rateMap.get(userID).size(); k++){\r\n\t\t\t\t\t\t\tif(read.rateMap.get(userID).get(k).getKey().equals(list.get(j).getKey())){\r\n\t\t\t\t\t\t\t\tuserRate = read.rateMap.get(userID).get(k).getValue();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ta += (list.get(j).getValue() - iAverage) * (userRate- this.userAverageRate);\r\n\t\t\t\t\t\tb += (list.get(j).getValue() - iAverage) * (list.get(j).getValue() - iAverage);\r\n\t\t\t\t\t\tc += (userRate - this.userAverageRate) * (userRate - this.userAverageRate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Check if this user rated all the movies with the same rate.\r\n\t\t\t\tif(intersection && c == 0){\r\n\t\t\t\t\tfuckUser = true;//really bad user.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} \r\n\t\t\t\t//Check if current user rated all the movies with the same rate. If so, just set similarity as 0.\r\n\t\t\t\tif(intersection && b != 0){\r\n\t\t\t\t\tdouble s = a / (Math.sqrt(b) * Math.sqrt(c));\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdouble s = 0;\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Create a heap storing the similarity pairs in a descending order.\r\n\t\tthis.heap = new ArrayList<Map.Entry<Integer, Double>>();\r\n\t\tIterator<Map.Entry<Integer, Double>> it = similarity.entrySet().iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tMap.Entry<Integer, Double> newest = it.next();\r\n\t\t\theap.add(newest);\r\n\t\t}\r\n\t\tCollections.sort(this.heap, new Comparator<Map.Entry<Integer, Double>>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Map.Entry<Integer, Double> a, Map.Entry<Integer, Double> b){\r\n\t\t\t\treturn -1 * (a.getValue().compareTo(b.getValue()));\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"public static void main(String[] args) throws Exception\n\t{\n\n\n\t\tSystem.out.println(\"hi\");\n\t\tString imdb_movies = \"IMDB/IMDb movies.csv\";\n\t\tString imdb_ratings = \"IMDB/IMDb ratings.csv\";\n\n\t\tBufferedReader alReader = new BufferedReader(new FileReader(imdb_movies));\n\t\tArrayList<String[]> movies = new ArrayList<String[]>();\n\t\tString line;\n\t\tString[] alTuple;\n\t\tMap<String, Integer> actor_pop = new HashMap<>();\n\n\t\tString regex = \",(?=(?:[^\\\"]*\\\"[^\\\"]*\\\")*[^\\\"]*$)\";\n\n\t\talReader.readLine();\n\t\t//alReader.readLine();\n\t\twhile ((line = alReader.readLine()) != null) {\n\t\t\talTuple = line.split(regex, -1);\n\t\t\tif(alTuple[3].equals(\"1894\")){\n\t\t\t\talTuple[4] = \"10/9/94\";\n\t\t\t}\n\n\t\t\tif(alTuple[0].equals(\"tt0002199\")){\n\t\t\t\talTuple[4] = \"1/1/13\";\n\t\t\t}\n\n\t\t\talTuple[5] = alTuple[5].replaceAll(\"\\\"\", \"\");\n\t\t\talTuple[7] = alTuple[7].replaceAll(\"\\\"\", \"\");\n\t\t\talTuple[9] = alTuple[9].replaceAll(\"\\\"\", \"\");\n\t\t\talTuple[10] = alTuple[10].replaceAll(\"\\\"\", \"\");\n\t\t\tmovies.add(alTuple);\n\t\t\tString actors = alTuple[12];\n\t\t\tactors = actors.replaceAll(\"\\\"\", \"\");\n\t\t\tString[] actor_list = actors.split(\",\");\n\t\t\tfor (String actor : actor_list) {\n\t\t\t\tif(!actor.equals(\"\")){\n\t\t\t\tif(actor_pop.containsKey(actor)) {\n\t\t\t\t\tactor_pop.replace(actor, actor_pop.get(actor) + 1);\n\t\t\t\t} else {\n\t\t\t\t\tactor_pop.put(actor, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t//create data for movie --> number of popular actors\n\t\tList<Integer> movieActorPop = new ArrayList<>();\n\t\tfor (String[] movie: movies) {\n\n\t\t\tint countPopActors = 0;\n\n\t\t\tString actors = movie[12];\n\t\t\tactors = actors.replaceAll(\"\\\"\", \"\");\n\t\t\tString[] actor_list = actors.split(\",\");\n\n\t\t\tif(actor_list.length > 0){\n\t\t\t\tfor(String actor: actor_list) {\n\t\t\t\t\tif(!actor.equals(\"\")){\n\t\t\t\t\tif(actor_pop.get(actor) >= POP_THRESHOLD){\n\t\t\t\t\t\tcountPopActors += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\tmovieActorPop.add(countPopActors);\n\t\t}\n\n\n\t\tBufferedReader apReader = new BufferedReader(new FileReader(imdb_ratings));\n\n\t\tapReader.readLine();\n\t\tArrayList<String[]> ratings = new ArrayList<String[]>();\n\t\tString[] tempTuple; // temporary tuple to receive information from csv\n\t\twhile ((line = apReader.readLine()) != null) {\n\t\t\ttempTuple = line.split(regex, -1);\n\t\t\tratings.add(tempTuple);\n\t\t}\n\n\t\t// initialize the connection to the database\n\t\tClass.forName(\"org.sqlite.JDBC\");\n\t\tString DB_FILE = \"movies.db\";\n\t\tConnection conn = DriverManager.getConnection(\"jdbc:sqlite:\" + DB_FILE);\n\n\t\t// enable FOREIGN KEY constraint checking\n\t\tStatement stat = conn.createStatement();\n\t\tstat.executeUpdate(\"PRAGMA foreign_keys = OFF;\");\n\n\t\t// speed up INSERTs\n\t\tstat.executeUpdate(\"PRAGMA synchronous = OFF;\");\n\t\tstat.executeUpdate(\"PRAGMA journal_mode = MEMORY;\");\n\n\t\t// DELETE statement to overwrite any existing data in the database\n\t\tstat.executeUpdate(\"DROP TABLE IF EXISTS movies;\");\n\t\tstat.executeUpdate(\"DROP TABLE IF EXISTS ratings;\");\n\t\tstat.executeUpdate(\"DROP TABLE IF EXISTS actors;\");\n\n\t\tstat.executeUpdate(\"PRAGMA foreign_keys = ON;\");\n\n\t\t// CREATE the mvoies table with the schema:\n\t\tstat.executeUpdate(\"CREATE TABLE movies \"\n\t\t\t\t+ \"(id CHAR(9) NOT NULL PRIMARY KEY,\"\n\t\t\t\t+ \"title VARCHAR(150) NOT NULL,\"\n\t\t\t\t+ \"original_title VARCHAR NOT NULL,\"\n\t\t\t\t+ \"year INTEGER NOT NULL,\"\n\t\t\t\t+ \"month_published INTEGER NOT NULL,\"\n\t\t\t + \"genre VARCHAR(150) NOT NULL,\"\n\t\t\t + \"duration INTEGER NOT NULL,\"\n\t\t\t\t+ \"country VARCHAR(200) NOT NULL,\"\n\t\t\t\t+ \"language VARCHAR(200) NOT NULL,\"\n\t\t\t\t+ \"director VARCHAR(200) NOT NULL,\"\n\t\t\t\t+ \"writer VARCHAR(200) NOT NULL,\"\n\t\t\t\t+ \"production_company VARCHAR(200) NOT NULL, \"\n\t\t\t\t+ \"popular_actors INTEGER NOT NULL);\");\n\n\t\t// CREATE the actors table with the schema:\n\t\tstat.executeUpdate(\"CREATE TABLE actors \"\n\t\t\t\t+ \"(actor_name VARCHAR(150) PRIMARY KEY NOT NULL, \"\n\t\t\t\t+ \"num_movies INTEGER NOT NULL);\");\n\n\t\t// CREATE the ratings table with the schema\n\t\tstat.executeUpdate(\"CREATE TABLE ratings \"\n\t\t\t\t+ \"(id CHAR(9) NOT NULL,\"\n\t\t\t\t+ \"weighted_avg_vote REAL NOT NULL, \"\n\t\t\t\t+ \"total_votes INTEGER NOT NULL, \"\n\t\t\t + \"mean_vote REAL NOT NULL, \"\n\t\t\t\t+ \"median_vote INTEGER NOT NULL, \"\n\t\t\t\t+ \"votes_10 INTEGER NOT NULL, \"\n\t\t\t + \"votes_9 INTEGER NOT NULL, \"\n\t\t\t + \"votes_8 INTEGER NOT NULL, \"\n\t\t \t+ \"votes_7 INTEGER NOT NULL, \"\n\t\t \t+ \"votes_6 INTEGER NOT NULL, \"\n\t\t \t+ \"votes_5 INTEGER NOT NULL, \"\n\t\t\t + \"votes_4 INTEGER NOT NULL, \"\n\t\t \t+ \"votes_3 INTEGER NOT NULL, \"\n\t\t \t+ \"votes_2 INTEGER NOT NULL, \"\n\t\t \t+ \"votes_1 INTEGER NOT NULL, \"\n\t\t \t+ \"us_voter_rating REAL NOT NULL, \"\n\t\t \t+ \"us_voter_count INTEGER NOT NULL, \"\n\t\t\t\t+ \"foreign_voter_rating REAL NOT NULL, \"\n\t\t\t\t+ \"foreign_voter_count INTEGER NOT NULL, \"\n\t\t\t\t+ \"male_avg_vote REAL NOT NULL,\"\n\t\t\t\t+ \"male_votes INTEGER NOT NULL,\"\n\t\t\t\t+ \"female_avg_vote REAL NOT NULL,\"\n\t\t\t\t+ \"female_votes INTEGER NOT NULL,\"\n\t\t\t\t+ \"PRIMARY KEY (id),\"\n\t\t\t\t+ \"FOREIGN KEY (id) references movies(id) ON DELETE CASCADE);\");\n\n\t\tPreparedStatement prepAl = conn.prepareStatement(\"INSERT OR IGNORE INTO \"\n\t\t\t\t+ \"movies (id, title, original_title, year, month_published, genre, duration, country, language, \" +\n\t\t\t\"director, writer, production_company, popular_actors) VALUES (?,?, ?,?, ?,?, ?,?, ?,?, ?,?, ?)\");\n\n\t\tint count = 0;\n\t\tfor (String[] tuple : movies) {\n\t\t\t\tprepAl.setString(1, tuple[0]); //id\n\t\t\t\tprepAl.setString(2, tuple[1]); //title\n\t\t\t\tprepAl.setString(3, tuple[2]); //original_title\n\n\t\t\t\tprepAl.setInt(4, Integer.parseInt(tuple[3])); //year\n\n\t\t\t\t//month published\n\t\t\t\tPattern pattern = Pattern.compile(\".+?(?=/)\");\n\t\t\t\tMatcher matcher = pattern.matcher(tuple[4]);\n\t\t\t\tString month;\n\t\t\t\tif(matcher.find() == false) {\n\t\t\t\t\tmonth = \"0\";\n\t\t\t\t} else{\n\t\t\t\t\tmonth = matcher.group();\n\t\t\t\t}\n\n\t\t\t\tprepAl.setInt(5, Integer.parseInt(month)); //month\n\t\t\t\tprepAl.setString(6, tuple[5]); //genre\n\t\t\t\tprepAl.setInt(7, Integer.parseInt(tuple[6])); //duration\n\t\t\t\tprepAl.setString(8, tuple[7]); //country\n\t\t\t\tif(tuple[8].equals(\"\")){\n\t\t\t\t\ttuple[8] = \"None\";\n\t\t\t\t}\n\t\t\t\tprepAl.setString(9, tuple[8]); //language\n\t\t\t\tprepAl.setString(10, tuple[9]); //director\n\t\t\t\tprepAl.setString(11, tuple[10]); //writer\n\t\t\t\tprepAl.setString(12, tuple[11]);\n\t\t\t\tprepAl.setInt(13, movieActorPop.get(count));\n\t\t\t\tprepAl.addBatch();\n\t\t\t\tcount += 1;\n\t\t}\n\n\t\tconn.setAutoCommit(false);\n\t\tprepAl.executeBatch();\n\t\tconn.setAutoCommit(true);\n\n\t\tPreparedStatement prepAp = conn.prepareStatement(\"INSERT OR IGNORE INTO \"\n\t\t\t\t+ \"actors (actor_name, num_movies) VALUES (?,?)\");\n\t\tfor (String tuple : actor_pop.keySet()) {\n\n\t\t\t\tprepAp.setString(1, tuple);\n\t\t\t\tprepAp.setInt(2, actor_pop.get(tuple));\n\t\t\t\tprepAp.addBatch();\n\n\t\t}\n\n\t\tconn.setAutoCommit(false);\n\t\tprepAp.executeBatch();\n\t\tconn.setAutoCommit(true);\n\n\t\t// populate flights\n\t\tPreparedStatement prepFl = conn.prepareStatement(\"INSERT OR IGNORE INTO ratings (id, weighted_avg_vote, \" +\n\t\t\t\"total_votes, mean_vote, median_vote, votes_10, votes_9, votes_8, votes_7, votes_6, \"\n\t\t\t+ \"votes_5, votes_4, votes_3, votes_2, votes_1, male_avg_vote, male_votes, female_avg_vote, female_votes, us_voter_rating, us_voter_count, foreign_voter_rating,\" +\n\t\t\t\"foreign_voter_count) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n\t\tfor (String[] tuple : ratings) {\n\n\t\t\t// only after all constraints have been checked and passed: add the tuple's info\n\t\t\t// into the relation\n\t\t\tprepFl.setString(1, tuple[0]); // id\n\t\t\tprepFl.setDouble(2, Double.parseDouble(tuple[1])); //weighted ag\n\t\t\tprepFl.setInt(3, Integer.parseInt(tuple[2])); // total_votes\n\t\t\tprepFl.setDouble(4, Double.parseDouble(tuple[3])); // mean_vote\n\t\t\ttry {\n\t\t\t\tprepFl.setInt(5, Integer.parseInt(tuple[4])); // median vote\n\t\t\t} catch(Exception e) {\n\t\t\t\tprepFl.setInt(5, (int) Double.parseDouble(tuple[4])); // median vote\n\t\t\t}\n\n\t\t\tprepFl.setInt(6, Integer.parseInt(tuple[5]));\n\t\t\tprepFl.setInt(7, Integer.parseInt(tuple[6]));\n\t\t\tprepFl.setInt(8, Integer.parseInt(tuple[7]));\n\t\t\tprepFl.setInt(9, Integer.parseInt(tuple[8]));\n\t\t\tprepFl.setInt(10, Integer.parseInt(tuple[9]));\n\t\t\tprepFl.setInt(11, Integer.parseInt(tuple[10]));\n\t\t\tprepFl.setInt(12, Integer.parseInt(tuple[11]));\n\t\t\tprepFl.setInt(13, Integer.parseInt(tuple[12]));\n\t\t\tprepFl.setInt(14, Integer.parseInt(tuple[13]));\n\t\t\tprepFl.setInt(15, Integer.parseInt(tuple[14]));\n\n\n\t\t\t// avg male vote\n\t\t\ttry {\n\t\t\t\tprepFl.setDouble(16, Double.parseDouble(tuple[23]));\n\t\t\t} catch(Exception e) {\n\t\t\t\tif(tuple[23].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t} else{\n\t\t\t\t\tprepFl.setDouble(16, (double)Integer.parseInt(tuple[23]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\tprepFl.setInt(17, Integer.parseInt(tuple[24]));\n\t\t\t} catch(Exception e) {\n\t\t\t\tif(tuple[24].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\t// avg female vote\n\t\t\ttry{\n\t\t\t\tprepFl.setDouble(18, Double.parseDouble(tuple[33]));\n\t\t\t} catch(Exception e) {\n\t\t\t\tif(tuple[33].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t} else{\n\t\t\t\t\tprepFl.setDouble(18, (double)Integer.parseInt(tuple[33]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\tprepFl.setInt(19, Integer.parseInt(tuple[34]));\n\t\t\t} catch(Exception e){\n\t\t\t\tif (tuple[34].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// us/foreign\n\t\t\ttry {\n\t\t\t\tprepFl.setDouble(20, Double.parseDouble(tuple[45]));\n\t\t\t} catch(Exception e) {\n\t\t\t\tif(tuple[45].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tprepFl.setDouble(20, (double)Integer.parseInt(tuple[45]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tprepFl.setInt(21, Integer.parseInt(tuple[46]));\n\t\t\t} catch (Exception e) {\n\t\t\t\tif(tuple[46].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t} else{\n\t\t\t\t\tprepFl.setInt(21, (int)Double.parseDouble(tuple[46]));\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tprepFl.setDouble(22, Double.parseDouble(tuple[47]));\n\t\t\t} catch(Exception e) {\n\t\t\t\tif(tuple[47].equals(\"\")){\n\t\t\t\t\tcontinue;\n\t\t\t\t} else {\n\t\t\t\t\tprepFl.setDouble(22, (double)Integer.parseInt(tuple[47]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttry{\n\t\t\t\tprepFl.setInt(23, Integer.parseInt(tuple[48]));\n\t\t\t} catch(Exception e){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// add the batch\n\t\t\tprepFl.addBatch();\n\n\t\t}\n\n\t\tconn.setAutoCommit(false);\n\t\tprepFl.executeBatch();\n\t\tconn.setAutoCommit(true);\n\n\t}",
"public static void main(String[] args) throws Exception {\n Bridges bridges = new Bridges(3, \"cutching\",\r\n \"553004712356\");\r\n DataSource ds = bridges.getDataSource();\r\n List<ActorMovieIMDB>movieData = null;\r\n List<ActorMovieIMDB> filteredMovieList = new ArrayList<>();\r\n try{\r\n movieData = ds.getActorMovieIMDBData(Integer.MAX_VALUE);\r\n }\r\n catch(Exception e){\r\n System.out.println(\"Unable to connect to Bridges\");\r\n }\r\n\r\n for(int i = 0; i < 5; i++) {\r\n\r\n ActorMovieIMDB entry = movieData.get(i);\r\n System.out.println(\"\" + i + \". \" + entry.getActor() + \" was in \" + entry.getMovie());\r\n }\r\n\r\n for (ActorMovieIMDB i: movieData) {\r\n if(i.getMovie().equals(\"Being_John_Malkovich_(1999)\")){\r\n filteredMovieList.add(i);\r\n }\r\n }\r\n\r\n filteredMovieList.sort(new ActorComparator());\r\n\r\n for (ActorMovieIMDB i: filteredMovieList) {\r\n System.out.println(i.getActor());\r\n }\r\n\r\n }",
"public void printAverageRatings(){\n \n String moviefile = \"data/ratedmovies_short.csv\";\n String ratingsfile = \"data/ratings_short.csv\";\n \n \n ThirdRatings tr = new ThirdRatings(ratingsfile);\n \n int rating_size = tr.getRaterSize();\n \n System.out.println(\"The number of raters read is : \"+ rating_size);\n \n MovieDatabase database = new MovieDatabase();\n \n database.initialize(moviefile);\n \n int movie_size = database.size();\n \n System.out.println(\"The number of movies read is : \"+ movie_size);\n \n ArrayList<Rating> ratings_list = tr.getAverageRatings(3);\n \n HashMap<String, Double> map = new HashMap<String, Double>();\n \n Collections.sort(ratings_list);\n \n int count = 0; \n \n for(Rating rating : ratings_list){\n \n String title = database.getTitle(rating.getItem());\n \n double val = rating.getValue();\n \n if(val != 0.0 ){\n \n map.put(title , val);\n \n count += 1;\n\n System.out.println(val + \"\\t\" + title );\n }\n\n }\n \n System.out.println(\"The number of movies found with minimal number of ratings is : \"+ count); \n \n }",
"public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {\n // Get the current line\n \n String line = value.toString();\n String[] linevalues = line.split(\"\\t\");\n IntWritable movieId = new IntWritable(Integer.parseInt(linevalues[1]));\n Text userId = new Text(linevalues[0]);\n context.write(movieId, userId);\n // for (String v : linevalues) {\n // System.out.println(\"Value: \" + v);\n // }\n // context.write(new IntWritable(Integer.parseInt(linevalues[0])), new Text(linevalues[1] + \",\" + linevalues[2]));\n }",
"public void getAverageRatingOneMovie() {\n String shortMovieCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratedmovies_short.csv\";\n //String shortRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n String shortRatingsCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n //String bigMovieCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratedmoviesfull.csv\";\n //String bigRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings.csv\";\n //String bigRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings_file_test.csv\";\n\n SecondRatings secondRatings = new SecondRatings(shortMovieCsv, shortRatingsCsv);\n //SecondRatings secondRatings = new SecondRatings(bigMovieCsv, bigRatingsCsv);\n\n String movieId = secondRatings.getID(\"Vacation\");\n ArrayList<Rating> ratingArrayList = secondRatings.getAverageRatings(1);\n for (Rating rating : ratingArrayList) {\n if (rating.getItem().contains(movieId)) {\n System.out.println(secondRatings.getTitle(movieId) + \" has average rating: \" + rating.getValue());\n }\n }\n }",
"private void fetchMovieDetails() {\n Stream.of(movieListings).forEach(movieListing -> {\n Picasso.with(MoviesApplication.getApp()).load(movieListing.getPosterUrl()).fetch();\n MoviesApplication.getApp().getApiManager().getEndpoints().getMovieDetails(movieListing.getId()).enqueue(movieDetailCallback);\n MoviesApplication.getApp().getApiManager().getEndpoints().getMovieVideos(movieListing.getId()).enqueue(movieVideoCallback);\n MoviesApplication.getApp().getApiManager().getEndpoints().getMovieReviews(movieListing.getId()).enqueue(movieReviewCallback);\n });\n }",
"public void printAverageRatingsByYearAfterAndGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n AllFilters f = new AllFilters();\n YearAfterFilter y = new YearAfterFilter(1990);\n GenreFilter g = new GenreFilter(\"Drama\");\n f.addFilter(y);\n f.addFilter(g);\n int minRatings = 8;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" \n + MovieDatabase.getYear(r.getItem()) + \"\\t\"\n + MovieDatabase.getTitle(r.getItem()) + \"\\t\"\n + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"@Override\n \t\tpublic void coGroup(PactString url, Iterator<PactNull> visits, Iterator<Tuple> ranks, Collector<PactString, Tuple> out) {\n \t\t\t// Check if there is a entry in the visits relation\n \t\t\tif (!visits.hasNext()) {\n \t\t\t\twhile (ranks.hasNext()) {\n \t\t\t\t\t// Emit all rank pairs\n \t\t\t\t\tout.collect(url, ranks.next());\n \t\t\t\t}\n \t\t\t}\n \t\t}",
"public static void main(String[] args) {\n RatingRegister ratings = new RatingRegister();\n\n Film goneWithTheWind = new Film(\"Gone with the Wind\");\n Film theBridgesOfMadisonCounty = new Film(\"The Bridges of Madison County\");\n Film eraserhead = new Film(\"Eraserhead\");\n// Film saksiKasi = new Film(\"saksiKasi\");\n// Film haifisch = new Film(\"haifisch\");\n\n Person matti = new Person(\"Matti\");\n Person pekka = new Person(\"Pekka\");\n Person mikke = new Person(\"Mikke\");\n \n// Person jukka = new Person(\"Jukka\");\n\n ratings.addRating(matti, goneWithTheWind, Rating.BAD);\n ratings.addRating(matti, theBridgesOfMadisonCounty, Rating.GOOD);\n ratings.addRating(matti, eraserhead, Rating.FINE);\n\n ratings.addRating(pekka, goneWithTheWind, Rating.FINE);\n ratings.addRating(pekka, theBridgesOfMadisonCounty, Rating.BAD);\n ratings.addRating(pekka, eraserhead, Rating.MEDIOCRE);\n\n// ratings.addRating(pekka, eraserhead, Rating.FINE);\n// ratings.addRating(pekka, saksiKasi, Rating.FINE);\n// ratings.addRating(saksiKasi, Rating.FINE);\n// ratings.addRating(saksiKasi, Rating.GOOD);\n// ratings.addRating(haifisch, Rating.BAD);\n// ratings.addRating(haifisch, Rating.BAD);\n\n Reference ref = new Reference(ratings);\n \n Film recommended = ref.recommendFilm(mikke);\n System.out.println(\"The film recommended to Michael is: \" + recommended);\n//*/\n }",
"@Override\n \t\tpublic void map(PactString key, Tuple visitRecord, Collector<PactString, PactNull> out) {\n \t\t\t\n \t\t\t// Parse date string with the format YYYY-MM-DD and extract the year\n \t\t\tint year = Integer.parseInt(visitRecord.getStringValueAt(2).substring(0,4));\n \t\t\tif (year == yearFilter) {\n \t\t\t\t\n \t\t\t\t// Extract the URL from the record and emit it\n \t\t\t\tPactString url = new PactString(visitRecord.getStringValueAt(1));\n \t\t\t\tout.collect(url, new PactNull());\n \t\t\t\t\n \t\t\t\tLOG.debug(\"Emit key: \"+url);\n \t\t\t}\n \t\t}",
"public void printAverageRatingsByGenre(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new GenreFilter(\"Comedy\"); \n int minRatings = 20;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + MovieDatabase.getYear(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()) + \"\\t\" + MovieDatabase.getGenres(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"@Override\n \t\tpublic void map(PactString key, Tuple rankRecord, Collector<PactString, Tuple> out) {\n \t\t\t\n \t\t\t// Extract rank from record \n \t\t\tint rank = (int) rankRecord.getLongValueAt(0);\n \t\t\tif (rank > rankFilter) {\n \t\t\t\t\n \t\t\t\t// create new key and emit key-value-pair\n \t\t\t\tPactString url = new PactString(rankRecord.getStringValueAt(1));\n \t\t\t\tout.collect(url, rankRecord);\n \t\n \t\t\t\tLOG.debug(\"Emit: \"+url+\" , \"+rankRecord);\n \t\t\t}\n \t\t}",
"private void getMovies() {\n\n database = FirebaseDatabase.getInstance();\n reference = database.getReference().child(userId).child(\"movies\");\n reference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n movieList.clear();\n baseMovieList.clear();\n i = (int) dataSnapshot.getChildrenCount();\n for (final DataSnapshot child : dataSnapshot.getChildren())\n {\n String id = child.getKey();\n Client Client = new Client();\n Service apiService =\n Client.getClient().create(Service.class);\n Call<Movie> call;\n call = apiService.getDetails(id, BuildConfig.THE_MOVIE_DB_API_TOKEN);\n\n call.enqueue(new Callback<Movie>() {\n @Override\n public void onResponse(Call<Movie> call, Response<Movie> response) {\n Movie info;\n info = response.body();\n if(child.child(\"watched\").getValue().equals(\"true\"))\n info.setWatched(true);\n\n baseMovieList.add(info);\n\n i = i -1;\n if(i <= 0) {\n pd.dismiss();\n progressBar();\n sort();\n }\n }\n\n @Override\n public void onFailure(Call<Movie> call, Throwable t) {\n Toast.makeText(MyWatchlist.this, \"Error Fetching Data!\", Toast.LENGTH_SHORT).show();\n }\n } );\n\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n }",
"public void crawl() {\n\t\tOOSpider.create(Site.me().setSleepTime(3000).setRetryTimes(3).setDomain(\"movie.douban.com\")//.setHttpProxy(httpProxy)\n .setUserAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36\"),\n filmInfoDaoPipeline, DoubanFilm.class)\n .addUrl(\"https://movie.douban.com/top250\")//entry url\n .thread(1)\n .run();\n }",
"@Override \n public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException \n {\n\t String[] line2 = value.toString().split(\";\");\n String ISBN_Rating = trimQuotes(line2[1].trim()); \n\t String Rating = trimQuotes(line2[2].trim()); \n \n \n if (!ISBN_Rating.equals(\"ISBN\") && !Rating.equals(\"Book-Rating\")) \n { \t \n \t\n \t int RTNG_CD = Integer.parseInt(Rating);\n \t System.out.println(\"output from b mapper:\"+ISBN_Rating+\"\\t\"+RTNG_CD);\n \t context.write(new TextPair(new Text(ISBN_Rating), new Text(\"b\")), new IntWritable(RTNG_CD));\n } \n \n }",
"@GetMapping(\"/{userId}\")\n public ResponseEntity<?> getMovieRatingsByUserId(@PathVariable int userId)\n {\n UserRatingResponse ratingSrviceReponse=restTemplateClient.getForObject(\"http://movie-rating-service/ratings/\"+userId,UserRatingResponse.class);\n List<MovieRating> movieRatingList=ratingSrviceReponse.getMovieRatingList();\n\n //getting movie descriptions\n List<MovieRatingMapping> mapping=movieRatingList.stream().map(movieRating -> {\n Movie movie=restTemplateClient.getForObject(\"http://movie-info-service/movies/\"+movieRating.getMovieId(), Movie.class);\n return new MovieRatingMapping(movie.getName(),movie.getDescription(),movieRating.getRating(),movie.getId());\n }).collect(Collectors.toList());\n RatingResponse response=new RatingResponse(mapping);\n return new ResponseEntity<RatingResponse>(response, HttpStatus.OK);\n }",
"private void storeFilesToCollection(String movieDetails, ArrayList<Movie> movies) \n {\n String[] allMovieInfo = movieDetails.split(\";\");\n \n for (int line = 0; line < allMovieInfo.length ; line++)\n {\n String[] details = allMovieInfo[line].split(\",\");\n String title = details[0];\n String director = details[1];\n String actorOne = details[2];\n String actorTwo = details[3];\n String actorThree = details[4];\n int rating = Integer.parseInt(details[5]);\n addMovieToArray(movies,title, director, actorOne, actorTwo, actorThree, rating);\n }\n }",
"@Override\n public void map(LongWritable key, Text value, Context context) throws IOException, \n InterruptedException {\n \tString text = value.toString();\n \n // declare and initialize variables for tokens of each of 3 reading frames\n \tStringTokenizer st1 = new StringTokenizer(text, \"\\n\");\n \tStringTokenizer st2 = new StringTokenizer(text.substring(1), \"\\n\");\n \tStringTokenizer st3 = new StringTokenizer(text.substring(2), \"\\n\");\n \t\n \n // read, process, and write reading frame 1\n // TCA GCC TTT TCT TTG ACC TCT TCT TTC TGT TCA TGT GTA TTT GCT GTC TCT TAG CCC AGA\n // does TCA exist in codon2aaMap?\n // if so, write (key, value) pair to context \n \tsetup(context);\n \tString frame1;\n \t\n \twhile(st1.hasMoreTokens())\n \t{\n \t\tframe1 = st1.nextToken().toString();\n \t\t\n \t\tfor (int i=0; i< frame1.length()-1; i+=3)\n \t\t{\n \t\t\tif(codon2aaMap.containsKey(frame1.substring(i, i+3)))\n \t\t\t{\n \t\t\t\tString ProteinFound = codon2aaMap.get(frame1.substring(i, i+3));\n \t\t\t\tcontext.write(new Text(ProteinFound), new Text(\"Frame1_1\"));\n \t\t\t}\n \t\t}\n \t}\n \t\n\n // read, process, and write reading frame 2\n // T CAG CCT TTT CTT TGA CCT CTT CTT TCT GTT CAT GTG TAT TTG CTG TCT CTT AGC CCA GA\n // does CAG exist in codon2aaMap?\n // if so, write (key, value) pair to context \n \tString frame2;\n \twhile(st2.hasMoreTokens())\n \t{\n \t\tframe2 = st2.nextToken().toString();\n \t\t\n \t\tfor (int i=0; i< frame2.length()-3; i+=3)\n \t\t{\n \t\t\tif(codon2aaMap.containsKey(frame2.substring(i, i+3)))\n \t\t\t{\n \t\t\t\tString ProteinFound = codon2aaMap.get(frame2.substring(i, i+3));\n \t\t\t\tcontext.write(new Text(ProteinFound), new Text(\"Frame2_1\"));\n \t\t\t}\n \t\t}\n \t}\n \n // read, process, and write reading frame 3\n // TC AGC CTT TTC TTT GAC CTC TTC TTT CTG TTC ATG TGT ATT TGC TGT CTC TTA GCC CAG A\n // does AGC exist in codon2aaMap?\n // if so, write (key, value) pair to context \n \t\n \tString frame3;\n \twhile(st3.hasMoreTokens())\n \t{\n \t\tframe3 = st3.nextToken().toString();\n \t\t\n \t\tfor (int i=0; i< frame3.length()-2; i+=3)\n \t\t{\n \t\t\tif(codon2aaMap.containsKey(frame3.substring(i, i+3)))\n \t\t\t{\n \t\t\t\tString ProteinFound = codon2aaMap.get(frame3.substring(i, i+3));\n \t\t\t\tcontext.write(new Text(ProteinFound), new Text(\"Frame3_1\"));\n \t\t\t}\n \t\t}\n \t}\n \n }",
"public List<Movie> theaters() {\n String url = \"http://api.rottentomatoes.com/api/public/v1.0/lists/movies/in_theaters.json?\"\n + \"apikey=yedukp76ffytfuy24zsqk7f5\";\n apicall(url);\n\n Gson gson = new Gson();\n MovieResponse response = gson.fromJson(data, MovieResponse.class);\n List<Movie> movies = response.getMovies();\n movieData = movies;\n System.out.println(url);\n return movieData;\n }",
"@Override\n public void onResponse(DistanceMatrixResponse response) {\n for (int i = 0; i < doctors.size(); i++) {\n // create a hashmap\n HashMap<String, String> hashMap = new HashMap<>();\n\n // convert image int to a string and place it into the hashmap with an images key\n hashMap.put(\"id\", String.valueOf(doctors.get(i).getID()));\n hashMap.put(\"name\", \"Dr. \" + doctors.get(i).getFirstName() + \" \" + doctors.get(i).getLastName());\n hashMap.put(\"address\", doctors.get(i).getOfficeAddress());\n hashMap.put(\"distance\", String.valueOf(response.getDistance().get(i + 1)));\n\n DistanceMatrixResponse.Location location = response.getLocations().get(i + 1);\n hashMap.put(\"lat\", String.valueOf(location.getLatLng().getLat()));\n hashMap.put(\"lng\", String.valueOf(location.getLatLng().getLng()));\n\n // add this hashmap to the list\n nearbyDoctorsData.add(hashMap);\n }\n\n displayNearbyDoctors(mListViewDoctors);\n\n\n }",
"public static List<List<String>> getFilmography(String actorID) throws IOException{\n\t\t\n\t\tList<List<String>> filmography = new ArrayList<List<String>>();\n\t\t\n\t\tURL url = new URL(\"https://api.themoviedb.org/3/person/\" + actorID + \"/movie_credits?api_key=cc10b91ab6be4842679242b80c13bb31&language=en-US\");\n\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\n con.setDoOutput(true);\n con.setRequestMethod(\"GET\");\n con.setRequestProperty(\"Content-Type\", \"application/json\");\n\n BufferedReader br = new BufferedReader(new InputStreamReader((con.getInputStream())));\n\n String filmResults = br.readLine(); //the raw results of all movies listed for that actor\n \n String beg = \"\\\"title\\\":\";\n String end = \"}\";\n String x = Pattern.quote(beg) + \"(.*?)\" + Pattern.quote(end); //returns just the titles in quotes\n //from the raw results\n String begChar = \",\\\"character\\\":\";\n String endChar = \",\\\"credit_id\";\n String xChar = Pattern.quote(begChar) + \"(.*?)\" + Pattern.quote(endChar);//returns character played\n \n String begJob = \",\\\"job\\\":\";\n String endJob = \",\\\"original_title\";\n String xJob = Pattern.quote(begJob) + \"(.*?)\" + Pattern.quote(endJob);//returns job title on film\n \n String begYR = \"release_date\\\":\";\n String endYR = \",\\\"title\";\n String xYR = Pattern.quote(begYR) + \"(.*?)\" + Pattern.quote(endYR);//returns just the release yrs\n //from the raw results\n String begID = \"\\\"id\\\":\";\n String endID = \",\";//\\\"original_title\\\":\";\n String xID = Pattern.quote(begID) + \"(.*?)\" + Pattern.quote(endID); //returns just the movie ID#s \n //from the raw results\n \n Pattern patternTitle = Pattern.compile(x);\n Pattern patternID = Pattern.compile(xID);\n Pattern patternYR = Pattern.compile(xYR);\n Pattern patternChar = Pattern.compile(xChar);\n Pattern patternJob = Pattern.compile(xJob);\n \n Matcher matcher = patternTitle.matcher(filmResults);\n Matcher matcherID = patternID.matcher(filmResults);\n Matcher matcherYR = patternYR.matcher(filmResults);\n Matcher matcherChar = patternChar.matcher(filmResults);\n Matcher matcherJob = patternJob.matcher(filmResults);\n \n List<String> filmArray = new ArrayList<String>();\n List<String> idArray = new ArrayList<String>(); \n List<String> yrArray = new ArrayList<String>(); \n List<String> charArray = new ArrayList<String>(); \n \n \n while (matcher.find()) { \t \n \tString titlesFound = matcher.group(1);\n \tfilmArray.add(titlesFound);\n }\n while(matcherID.find()){\t\n \tString IDsFound = matcherID.group(1);\n \tidArray.add(IDsFound);\n }\n while(matcherYR.find()){\n \tString yrsFound = matcherYR.group(1);\n \tyrArray.add(yrsFound);\t\n }\n while(matcherChar.find()){ \n \tString charsFound = matcherChar.group(1); //character names and job titles\n \tString chars2 = charsFound.replace(\"\\\\\", \"\"); //both get added to charArray\n \tcharArray.add(chars2);\t //because the raw results always\n } //print out crew credits after all\n while(matcherJob.find()){ // the acting credits\n \tString jobsFound = matcherJob.group(1);\n \tcharArray.add(jobsFound);\t\n }\n \n\t\tfor(int i = 0; i < filmArray.size(); i++){\n\t\t\tif(filmArray.get(i).length() > 40){\n\t\t\t\tString q = filmArray.get(i).substring(0, 30); \n\t\t\t\tfilmArray.set(i, q);\n\t\t\t}\n\t\t\tif(charArray.get(i).length() > 40){\n\t\t\t\tString z = charArray.get(i).substring(0, 30); \n\t\t\t\tcharArray.set(i, z);\n\t\t\t}\n\t\t}\n \n String chars = \"\";\n String yrss = \"\";\n String film = \"\";\n String ids = \"\";\n for(int i = 0; i < filmArray.size(); i++){\n\n \tString yrs = yrArray.get(i).replace(\"\\\"\", \"0\");\n \tString yrs2 = yrs.replace(\"-\", \"0\");\n\n \tif(yrArray.get(i).equals(\"null\") || yrArray.get(i) == null){\n \t\tyrss = yrArray.get(i) + \";000000000000\";\n \t\tfilm = filmArray.get(i) + \";000000000000\";\n \t\tchars = charArray.get(i) + \";000000000000\";\n \t\tids = idArray.get(i) + \";000000000000\";\n \t} else {\n \t\tyrss = yrArray.get(i) + \";\" + yrs2;\n \t\tfilm = filmArray.get(i) + \";\" + yrs2;\n \t\tchars = charArray.get(i) + \";\" + yrs2;\n \t\tids = idArray.get(i) + \";\" + yrs2;\n \t}\n \t\n \tfilmArray.set(i, film);\n \tcharArray.set(i, chars);\n \tyrArray.set(i, yrss);\n \tidArray.set(i, ids);\n }\n \n Collections.sort(filmArray, Comparator.comparing(s -> s.split(\";\")[1]));\n Collections.sort(charArray, Comparator.comparing(s -> s.split(\";\")[1]));\n Collections.sort(yrArray, Comparator.comparing(s -> s.split(\";\")[1]));\n Collections.sort(idArray, Comparator.comparing(s -> s.split(\";\")[1]));\n \n Collections.reverse(filmArray);\n Collections.reverse(charArray);\n Collections.reverse(yrArray);\n Collections.reverse(idArray);\n \n\t\tfor(int j = 0; j < filmArray.size(); j ++){\n\t\t\tString xx = filmArray.get(j);\n\t\t\tfilmArray.set(j, xx.substring( 0, xx.length() - 13));\n\t\t\tString y = yrArray.get(j);\n\t\t\tyrArray.set(j, y.substring( 0, y.length() - 13));\n\t\t\tString z = charArray.get(j);\n\t\t\tcharArray.set(j, z.substring( 0, z.length() - 13));\n\t\t\tString zz = idArray.get(j);\n\t\t\tidArray.set(j, zz.substring( 0, zz.length() - 13));\n\t\t}\t\n \n filmography.add(filmArray);\n filmography.add(idArray);\n filmography.add(yrArray);\n filmography.add(charArray);\n \n return filmography;\n\t\t\n\t}",
"public static void main(String[] args) {\n readFile(moviesFile, movies);\n movies.forEach((key, value) -> {\n int[] ratings = (int[])value;\n double average = ratings[1]/(double)ratings[0];\n System.out.println(key);\n System.out.println(\"Reviews \" + ratings[0] + \" Average Rating \" +average +\"/5\");\n });\n\n }",
"public static void DumpLocationCoordinatestoKMLRevised(Places places) throws IOException{\n\n String filen = folder_path+\"loc2kmlRevised.txt\";\n File file = new File(filen);\n if (!file.exists()) {\n file.createNewFile();\n }\n BufferedWriter output = new BufferedWriter(new FileWriter(file));\n\n for(int i=0;i<places.places.size();i++){\n LocationCluster locationcls=places.places.get(i);\n output.write(locationcls.placeID+\"~\");\n\n List<UserPhoto> sublist=locationcls.getIdenticalsubLocations();\n if(sublist.size()>2){\n\n for(int j=0;j<sublist.size()-1;j++){\n\n output.write(sublist.get(j).geotag.lat+\",\"+sublist.get(j).geotag.lng);\n if(j<sublist.size()-2){\n output.write(\"|\");\n }\n }\n\n }\n else{\n\n GeoTag center =locationcls.GetCentriod();\n output.write(center.lat+\",\"+center.lng);\n }\n\n\n output.write(\"\\n\");\n\n\n\n\n }\noutput.flush();\n\n }",
"public void getCosineSimilarity(){\r\n\t\tfor(Integer i : read.rateMap.keySet()){\r\n\t\t\tif(i != this.userID){\r\n\t\t\t\t//Calculate the average rate.\r\n//\t\t\t\tdouble iAverage = average.get(i);\r\n\t\t\t\tdouble a = 0.0;\r\n\t\t\t\tdouble b = 0.0;\r\n\t\t\t\tdouble c = 0.0;\r\n\t\t\t\t//Set a flag by default meaning the user does not have common rate with this user.\r\n\t\t\t\tboolean intersection = false;\r\n\t\t\t\tArrayList<Map.Entry<String, Double>> list = read.rateMap.get(i);\r\n\t\t\t\tfor(int j = 0; j < list.size(); j++){\r\n\t\t\t\t\tdouble userRate = 0;\r\n\t\t\t\t\tif(ratedID.contains(list.get(j).getKey())){\r\n\t\t\t\t\t\t//The user has common rated movies with this user\r\n\t\t\t\t\t\tintersection = true;\r\n\t\t\t\t\t\tfor(int k = 0; k < read.rateMap.get(userID).size(); k++){\r\n\t\t\t\t\t\t\tif(read.rateMap.get(userID).get(k).getKey().equals(list.get(j).getKey())){\r\n\t\t\t\t\t\t\t\tuserRate = read.rateMap.get(userID).get(k).getValue();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ta += userRate * list.get(j).getValue();\r\n\t\t\t\t\t\tb += userRate * userRate;\r\n\t\t\t\t\t\tc += list.get(j).getValue() * list.get(j).getValue();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//Check if this user rated all the movies with the same rate.\r\n\t\t\t\tif(intersection && b == 0){\r\n\t\t\t\t\tfuckUser = true;//really bad user.\r\n\t\t\t\t\treturn;\r\n\t\t\t\t} \r\n\t\t\t\t//Check if current user rated all the movies with the same rate. If so, just set similarity as 0.\r\n\t\t\t\tif(intersection && c != 0){\r\n\t\t\t\t\tdouble s = a / (Math.sqrt(b) * Math.sqrt(c));\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}else{\r\n\t\t\t\t\tdouble s = 0;\r\n\t\t\t\t\tsimilarity.put(i, s);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.heap = new ArrayList<Map.Entry<Integer, Double>>();\r\n\t\tIterator<Map.Entry<Integer, Double>> it = similarity.entrySet().iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tMap.Entry<Integer, Double> newest = it.next();\r\n\t\t\theap.add(newest);\r\n\t\t}\r\n\t\tCollections.sort(this.heap, new Comparator<Map.Entry<Integer, Double>>() {\r\n\t\t\t@Override\r\n\t\t\tpublic int compare(Map.Entry<Integer, Double> a, Map.Entry<Integer, Double> b){\r\n\t\t\t\treturn -1 * (a.getValue().compareTo(b.getValue()));\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@RequestMapping(\"/{userId}\")\n public List<CatalogItem> getCatalog(@PathVariable(\"userId\") String userId){\n\n List<Rating> ratings = Arrays.asList(\n new Rating( \"1234\", 4),\n new Rating( \"5678\", 5)\n );\n\n //For each movieId, call movie info Service and get details\n /*return ratings.stream().map(rating -> new CatalogItem(\"Tranformers\", \"Test\", 4))\n .collect(Collectors.toList());*/\n return ratings.stream().map( rating -> {\n Movie movie = restTemplate.getForObject( \"http://localhost:8083/movies/\" + rating.getMovieId(), Movie.class);\n return new CatalogItem( movie.getName(), \"Test\", rating.getRating() );\n })\n .collect(Collectors.toList() );\n\n //Put them all together\n /*return Collections.singletonList(\n //new CatalogItem(\"Tranformers\", \"Test\", 4)\n );*/\n\n \n }",
"private Movie mapMovie(final Record movieRecord) {\n return new Movie(\n movieRecord.get(\"title\").asString(),\n movieRecord.get(\"tagline\").asString(),\n movieRecord.get(\"released\").asInt()\n );\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate static void writeTreasures(Object treasureMap,\n\t\t\tPrintWriter pwTreasures) {\n\t\tfor (Map.Entry<String, Object> treasure : ((Map<String, Object>) treasureMap).entrySet()) \n\t\t{\n\t\t\tString treasureName=treasure.getKey();\n\t\t\tlong treasureNameDecoded = new BigInteger(treasureName.getBytes()).longValue();\n\t\t\tObject treasureObj=treasure.getValue();\n\t\t\tfor(Entry<String, Object> treasureObjEntry: ((LinkedHashMap<String, Object>) treasureObj).entrySet())\n\t\t\t{\n\t\t\t\tif(treasureObjEntry.getKey().equals(\"category\")) // RATING\n\t\t\t\t{\n\t\t\t\t\tString category = treasureObjEntry.getValue().toString();\n\t\t\t\t\tlong categoryDecoded = new BigInteger(category.getBytes()).longValue();\n\n\t\t\t\t\tpwTreasures.write(treasureNameDecoded+\",\"+treasureName+\",\"+categoryDecoded+\",\"+category+\"\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tpwTreasures.close();\n\n\t}",
"public void map(Object key, Text value, Context context\n ) throws IOException, InterruptedException {\n\n String pointID = value.toString().split(\",\")[0];\n double xCord = Double.parseDouble(value.toString().split(\",\")[1]);\n double yCord = Double.parseDouble(value.toString().split(\",\")[2]);\n double distance;\n //compute distance\n distance=Math.sqrt(Math.pow((xCord-xVal),2)+Math.pow((yCord-yVal),2));\n\n outKey=new DoubleWritable(distance);\n outVal=new Text(String.valueOf(pointID));\n //emit key and values\n context.write(outKey,outVal);\n\n }",
"@Override\n protected void cleanup(Context context) throws IOException, InterruptedException {\n for (String artistId: songStat.keySet()) {\n // count#-#artistID%%artistName%%count\n String outVal = \"count#-#\"+songStat.get(artistId).getCount();\n// context.write(new Text(songStat.get(artistId).getSongId()), new Text(outVal));\n context.write(new Text(artistId), new Text(outVal));\n }\n// HashMap<Double, ArrayList<String>> minUniqueness = artistUniqueness.getMinSimilarArtist();\n// if (minUniqueness.size() > 0) {\n// double tmpKey = minUniqueness.keySet().iterator().next();\n// for (String artist : minUniqueness.get(tmpKey)) {\n// context.write(new Text(\"similar\"), new Text(artist + \"%-%\" + tmpKey));\n// System.out.println(\"Similar Min Mapper: \" + artist + \" \" + tmpKey);\n//\n// }\n// }\n// HashMap<Double, ArrayList<String>> maxUniqueness = artistUniqueness.getMaxSimilarArtist();\n// if (maxUniqueness.size() > 0) {\n// double tmpKey = maxUniqueness.keySet().iterator().next();\n// for (String artist : maxUniqueness.get(tmpKey)) {\n// context.write(new Text(\"similar\"), new Text(artist + \"%-%\" + tmpKey));\n// System.out.println(\"Similar Max Mapper: \" + artist + \" \" + tmpKey);\n//\n// }\n// }\n artistUniqueness.sendFromMapperContext(context, \"similar\");\n\n }",
"@Override\n\tpublic void write(DataOutput dataout) throws IOException {\n\t\tsports.write(dataout);\n\t\tcountry.write(dataout);\n\t\t\n\t\t\n\t}",
"@Override\n\tprotected String doInBackground(String... params) {\n\t\tContext context = null;\n\t\ttry {\n\t\t\tSystem.out.println(moviename);\n\t\t\t//System.out.println(getMovieName());\n\t\t List<Movie> movies = Movie.search(moviename);\n\t\t movieList(movies);\n\t\t /*for (Movie movie : movies) {\n\t\t System.out.println(\"====================\");\n\t\t System.out.println(movie.getName());\n\t\t System.out.println(movie.getOverview());\n\t\t //MovieImages poster = movie.getImages();\n\t\t //movieName = movie.getName();\n\t\t MovieImages poster= Movie.getImages(movie.getID());\n\t\t System.out.println(poster.posters);\n\t\t //ImageView image = (ImageView) findViewById(R.id.movieImage);\n\t\t Set<MoviePoster> temp = new HashSet<MoviePoster>();\n\t\t for(MoviePoster a: poster.posters) {\n\t\t \t \n\t\t \t //URL url = new URL(a.getSmallestImage().toString());\n\t\t \t //Bitmap bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());\n\t\t \t //image.setImageBitmap(bmp);\n\n\n\t\t \t posterurl = a.getSmallestImage().toString();\n\t\t \t System.out.println(a.getSmallestImage());\n\t\t \t break;\n\t\t }\n\t\t //ImageView image = new ImageView(context);\n\t\t //image = (ImageView) poster.posters;\n\t\t //image.setImageResource(resId);\n\t\t System.out.println(\"Cast:\");\n\t\t // Get the full decsription of the movie.\n\t\t Movie moviedetail = Movie.getInfo(movie.getID());\n\t\t movieName = moviedetail.getOriginalName();\n\t\t overview = moviedetail.getOverview();\n\t\t trailerURL = moviedetail.getTrailer().toString();\n\t\t //aff \n\t\t ID = movie.getID();\n\t\t //System.out.println(\"Printing trailer url\"+ u);\n//\t\t for (CastInfo cast : movieFull.getCast()) {\n\t//\t System.out.println(\" \" + cast.getName() + \" as \"\n\t\t// + cast.getCharacterName()\t);\n\t\t // }\n\t\t //break;\n\t\t }*/\n\t\t} catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"@Override\n public void apply(String key, TimeWindow window, Iterable<Tuple2<Point, Point>> input, Collector<Tuple2<Point, Point>> out) throws Exception {\n\n HashMap<String, Point> secondIDPointMap = new HashMap<>();\n Point firstPoint = null;\n Boolean firstPointSet = false;\n\n for (Tuple2<Point, Point> e :input) {\n\n // Setting the first pair point, if not already set\n if(!firstPointSet){\n firstPoint = e.f0;\n firstPointSet = true;\n }\n\n Point existingPoint = secondIDPointMap.get(e.f1.objID);\n if(existingPoint != null){ // If element is already in the set\n Long oldTimestamp = existingPoint.timeStampMillisec;\n if(e.f1.timeStampMillisec > oldTimestamp){ // if new timestamp is larger, replace the old element with new\n secondIDPointMap.replace(e.f1.objID, e.f1);\n }\n }\n else { // insert new element if does not exist\n secondIDPointMap.put(e.f1.objID, e.f1);\n }\n }\n\n // Collecting output\n for (Map.Entry<String, Point> entry : secondIDPointMap.entrySet()){\n out.collect(Tuple2.of(firstPoint, entry.getValue()));\n }\n }",
"@Override\n public void apply(String key, TimeWindow window, Iterable<Tuple2<Point, Point>> input, Collector<Tuple2<Point, Point>> out) throws Exception {\n\n HashMap<String, Point> secondIDPointMap = new HashMap<>();\n Point firstPoint = null;\n Boolean firstPointSet = false;\n\n for (Tuple2<Point, Point> e :input) {\n\n // Setting the first pair point, if not already set\n if(!firstPointSet){\n firstPoint = e.f0;\n firstPointSet = true;\n }\n\n Point existingPoint = secondIDPointMap.get(e.f1.objID);\n if(existingPoint != null){ // If element is already in the set\n Long oldTimestamp = existingPoint.timeStampMillisec;\n if(e.f1.timeStampMillisec > oldTimestamp){ // if new timestamp is larger, replace the old element with new\n secondIDPointMap.replace(e.f1.objID, e.f1);\n }\n }\n else { // insert new element if does not exist\n secondIDPointMap.put(e.f1.objID, e.f1);\n }\n }\n\n // Collecting output\n for (Map.Entry<String, Point> entry : secondIDPointMap.entrySet()){\n out.collect(Tuple2.of(firstPoint, entry.getValue()));\n }\n }",
"@Override\n public void apply(String key, TimeWindow window, Iterable<Tuple2<Point, Point>> input, Collector<Tuple2<Point, Point>> out) throws Exception {\n\n HashMap<String, Point> secondIDPointMap = new HashMap<>();\n Point firstPoint = null;\n Boolean firstPointSet = false;\n\n for (Tuple2<Point, Point> e :input) {\n\n // Setting the first pair point, if not already set\n if(!firstPointSet){\n firstPoint = e.f0;\n firstPointSet = true;\n }\n\n Point existingPoint = secondIDPointMap.get(e.f1.objID);\n if(existingPoint != null){ // If element is already in the set\n Long oldTimestamp = existingPoint.timeStampMillisec;\n if(e.f1.timeStampMillisec > oldTimestamp){ // if new timestamp is larger, replace the old element with new\n secondIDPointMap.replace(e.f1.objID, e.f1);\n }\n }\n else { // insert new element if does not exist\n secondIDPointMap.put(e.f1.objID, e.f1);\n }\n }\n\n // Collecting output\n for (Map.Entry<String, Point> entry : secondIDPointMap.entrySet()){\n out.collect(Tuple2.of(firstPoint, entry.getValue()));\n }\n }",
"private Map<String, Integer> getPuntuationCat(List<Point> points, Trial trial){\n\t\t\n\t\t//Categoria master40\n\t\tMap<String, Integer> puntuation = setPuntuation(points, this.getMaster(trial.getId(), 40));\n\t\t \n\t\t//Categoria master30\n\t\tMap<String, Integer> puntuationMaster30 = setPuntuation(points, this.getMaster(trial.getId(), 30));\n\t\t//unir los dos maps\n\t\tpuntuationMaster30.forEach((k, v) -> {\n\t\t\tpuntuation.merge(k, v, (v1, v2) -> v1 += v2);\n\t\t});\n\t\t\n\t\t//Categoria master20\n\t\tMap<String, Integer> puntuationMaster20 = setPuntuation(points, this.getMaster(trial.getId(), 20));\n\t\t//unir los dos maps\n\t\tpuntuationMaster20.forEach((k, v) -> {\n\t\t\tpuntuation.merge(k, v, (v1, v2) -> v1 += v2);\n\t\t});\n\t\t\n\t\t\n\t\treturn puntuation;\n\t}",
"public static void main(String[] args) {\n Logger.getLogger(\"org\").setLevel(Level.OFF);\n Logger.getLogger(\"akka\").setLevel(Level.OFF);\n\n\n String watchedMoviesPath;\n String preferencesPath;\n String moviesPath;\n String outputPath;\n double threshold;\n\n watchedMoviesPath = args[0];\n preferencesPath = args[1];\n moviesPath = args[2];\n outputPath = args[3];\n threshold = Double.parseDouble(args[4]);\n\n\n // Create a configuration object and set the name of the application\n SparkConf conf = new SparkConf().setAppName(\"ex44\");\n\n // Create a Spark Context object\n JavaSparkContext sc = new JavaSparkContext(conf);\n\n // Read the content of the input file/folder\n //map to pair (movieID, userID)\n JavaPairRDD<String, String> watchedMovieRDD = sc.textFile(watchedMoviesPath).mapToPair(line -> {\n String[] fields = line.split(\",\");\n String userID = fields[0];\n String movieID = fields[1];\n return new Tuple2<>(movieID, userID);\n });\n\n //map to pair (movieID, genre)\n JavaPairRDD<String, String> moviesRDD = sc.textFile(moviesPath).mapToPair(line -> {\n String[] fields = line.split(\",\");\n String movieID = fields[0];\n String genre = fields[2];\n return new Tuple2<>(movieID, genre);\n });\n\n // join the previous two to obtain (userID, genre)\n JavaPairRDD<String, String> userIdGenre = watchedMovieRDD.join(moviesRDD).mapToPair(joinedPair -> {\n String userID = joinedPair._2._1;\n String genre = joinedPair._2._2;\n return new Tuple2<>(userID, genre);\n });\n\n // create list of preference\n JavaPairRDD<String, Iterable<String>> listPreferencesRDD = sc.textFile(preferencesPath)\n .mapToPair(line -> {\n String[] fields = line.split(\",\");\n String userID = fields[0];\n String genre = fields[1];\n return new Tuple2<>(userID, genre);\n })\n .groupByKey();\n\n // Join userId watched genre with list of preferences\n // detect the misleading views\n // compute misleading percentage\n // filter above threshold\n // retrieve userID\n JavaPairRDD<String, Double> misleadingUsersRDD = userIdGenre\n .join(listPreferencesRDD)\n .mapToPair(view -> {\n String userId = view._1;\n String watchedGenre = view._2._1;\n\n List<String> likeList = new ArrayList<>();\n // store the list\n for (String value : view._2._2) {\n likeList.add(value);\n }\n\n return new Tuple2<>(userId, new Misleading(likeList.contains(watchedGenre) ? 0 : 1, 1));\n })\n .reduceByKey(Misleading::sum)\n .mapValues(Misleading::CriticalPercent)\n .filter(pair -> pair._2 > threshold);\n\n // count for each user the movie genre watched\n JavaPairRDD<String, Tuple2<String, Integer>> countedGenreRDD = userIdGenre.mapToPair(pair -> {\n String userID = pair._1;\n String genre = pair._2;\n\n return new Tuple2<>(new Tuple2<>(userID, genre), 1);\n }).reduceByKey(Integer::sum)\n .mapToPair(pair -> {\n String userID = pair._1._1;\n String genre = pair._1._2;\n int nTimes = pair._2;\n return new Tuple2<>(userID, new Tuple2<>(genre, nTimes));\n });\n\n // Join the misleading userID with their list of preferences\n // Join with the counted Genre\n JavaPairRDD<String, Tuple2<Tuple2<Double, Iterable<String>>, Tuple2<String, Integer>>> misleadingListRDD = misleadingUsersRDD\n .join(listPreferencesRDD)\n .join(countedGenreRDD);\n\n // filter the list\n JavaPairRDD<String,String> filteredListRDD = misleadingListRDD.flatMapValues(value -> {\n String genre = value._2._1;\n int nTimes = value._2._2;\n List<String> likedGenre = new ArrayList<>();\n for (String v : value._1._2) {\n likedGenre.add(v);\n }\n\n List<String> newGenre = new ArrayList<>();\n if(!likedGenre.contains(genre) && nTimes >= 5){\n newGenre.add(genre);\n }\n \n return newGenre;\n });\n\n // store the RDD\n filteredListRDD.saveAsTextFile(outputPath);\n\n\n // Close the Spark context\n sc.close();\n }",
"@Test\n\t\tpublic void testproductdatacollect() {\n\t\t\t//Initializing Spark Context\n\t\t\tSparkConf conftest = new SparkConf().setAppName(\"testBigdata\").setMaster(\"local[2]\");\n\t\t\tJavaSparkContext jsc = new JavaSparkContext(conftest);\n\t\t\tString input = \"src/main/resources/mllib/movies.dat\";\n\t\t\tJavaRDD<String> productData = jsc.textFile(input);\n\n\t\t\tMap<Integer, String> products = productData.mapToPair(\n\t\t\t new PairFunction<String, Integer, String>() {\n\t\t\t\t\t\tprivate static final long serialVersionUID = 1L;\n\t\t\t\t\t\tpublic Tuple2<Integer, String> call(String s) throws Exception {\n\t\t\t String[] sarray = s.split(\"::\");\n\t\t\t return new Tuple2<Integer, String>(Integer.parseInt(sarray[0]), sarray[1]);\n\t\t\t }\n\t\t\t }\n\t\t\t).collectAsMap();\n\t\t\tassertNotNull(products);\n\t jsc.close();\n\t\t}",
"public void writeVisits() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/visits.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(visits);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public void map(Object key, Text value, Context context) throws IOException, InterruptedException {\n StringTokenizer itr = new StringTokenizer(value.toString());\n while (itr.hasMoreTokens()) {\n word = itr.nextToken().toLowerCase();\n for(String word2 : WordMap){\n\n Double similarity = calculateJaccardSimilarity(word, word2);\n\n // which have Jaccard similarity not 0 and no larger than 0.15?\n if ((similarity > 0.0) && (similarity <= 0.15)) {\n DoubleWritable result = new DoubleWritable(similarity);\n context.write(new Text(word+\"\\t\"+word2), result);\n }\n }\n }\n }",
"public void uLoad(HashMap<Integer, ArrayList<Rating>> oRatings) {\n\t\tfor (Integer movie : oRatings.keySet()) {\n//\t\t\tSystem.out.println(\"movie is \" + movie);\n\t\t\t// for each rating in that movie\n\t\t\tArrayList<Rating> mRatings = oRatings.get(movie);\n\t\t\t// the following binary search doesn't need to sort; ratings is already sorted (see MovieLensCSVTranslator)\n\t\t\tint i = Collections.binarySearch(mRatings, new Rating(userID));\n\t\t\tif (i > -1) {\n\t\t\t\tratings.put(mRatings.get(i).getMovieId(), mRatings.get(i).getRatingInt());\n\t\t\t}\n\t\t}\n\t}",
"public void setMovieDataFromCursor(Cursor cursor) {\n if(null != cursor) {\n int count = cursor.getCount();\n\n if (count > 0) {\n // Indices\n int idIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry._ID);\n int movieIdIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_MOVIE_ID);\n int titleIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_TITLE);\n int posterPathIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_POSTER_PATH);\n int backdropPathIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_BACKDROP_PATH);\n int plotSynopsisIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_PLOT_SYNOPSIS);\n int userRatingIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_USER_RATING);\n int releaseDateIndex = cursor.getColumnIndex(MoviesContract.MoviesEntry.COLUMN_RELEASE_DATE);\n\n mMovieInfoData = new MovieInfo[count];\n int i = 0;\n while (cursor.moveToNext()) {\n // Determine the values of the wanted data\n int id = cursor.getInt(idIndex);\n String movieIdStr = cursor.getString(movieIdIndex);\n int movieId = Integer.parseInt(movieIdStr);\n String title = cursor.getString(titleIndex);\n String posterPath = cursor.getString(posterPathIndex);\n String backdropPath = cursor.getString(backdropPathIndex);\n String plotSynopsis = cursor.getString(plotSynopsisIndex);\n String userRatingStr = cursor.getString(userRatingIndex);\n int userRating = Integer.parseInt(userRatingStr);\n String releaseDate = cursor.getString(releaseDateIndex);\n\n //Set values\n MovieInfo movieInfo = new MovieInfo(movieId, title, posterPath, backdropPath, plotSynopsis, userRating, releaseDate);\n mMovieInfoData[i] = movieInfo;\n i++;\n }\n notifyDataSetChanged();\n }\n cursor.close();\n }\n }",
"public void printAverageRatings(int minimalRaters) {\n String shortMovieCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratedmovies_short.csv\";\n //String shortRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n String shortRatingsCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratings_short.csv\";\n\n //String bigMovieCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratedmoviesfull.csv\";\n //String bigMovieCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratedmoviesfull.csv\";\n //String bigRatingsCsv = \"C:/Users/greg/IdeaProjects/capstone-coursera/data/ratings.csv\";\n //String bigRatingsCsv = \"/home/greg/IdeaProjects/capstone-coursera/data/ratings.csv\";\n\n SecondRatings secondRatings = new SecondRatings(shortMovieCsv, shortRatingsCsv);\n //SecondRatings secondRatings = new SecondRatings(bigMovieCsv, bigRatingsCsv);\n\n System.out.println(\"Number of movies loaded from file: \" + secondRatings.getMovieSize());\n System.out.println(\"Number of raters loaded from file: \" + secondRatings.getRaterSize());\n\n ArrayList<Rating> ratingArrayList = secondRatings.getAverageRatings(minimalRaters);\n ratingArrayList.sort(Comparator.naturalOrder());\n System.out.println(\"Total of movies with at least \" + minimalRaters + \" raters: \" + ratingArrayList.size());\n for (Rating rating : ratingArrayList) {\n System.out.println(rating.getValue() + \" \" + secondRatings.getTitle(rating.getItem()));\n }\n }",
"private void addPoints(MapReader mr, Map<Integer, Mdr5Record> cityMap) {\n \t\tList<Point> list = mr.pointsForLevel(0);\n \t\tfor (Point p : list) {\n \t\t\tLabel label = p.getLabel();\n \t\t\tif (p.getNumber() > 256) {\n \t\t\t\t// I think we limit the number of points+ind-points, but just in case\n \t\t\t\tSystem.out.println(\"point number too big\");\n \t\t\t\tcontinue;\n \t\t\t}\n \n \t\t\tMdr5Record city = null;\n \t\t\tif (p.getType() < 0x11) {\n \t\t\t\t// This is itself a city, it gets a reference to its own MDR 5 record.\n\t\t\t\tint cnum = (p.getSubdiv().getNumber() << 8) + p.getNumber();\n\t\t\t\tcity = cityMap.get(cnum);\n \n \t\t\t} else {\n \t\t\t\t// This is not a city, but we have information about which city\n \t\t\t\t// it is in. If so then add the mdr5 record number of the city.\n \t\t\t\tPOIRecord poi = p.getPOIRecord();\n \t\t\t\tCity c = poi.getCity();\n \t\t\t\tif (c != null)\n\t\t\t\t\tcity = cityMap.get(c.getIndex());\n\t\t\t}\n\n\t\t\tif (city != null) {\n\t\t\t\tcity.setLblOffset(label.getOffset());\n\t\t\t\tcity.setName(label.getText());\n \t\t\t}\n \n \t\t\tif (label != null && label.getText().trim().length() > 0)\n \t\t\t\tmdrFile.addPoint(p, city);\n \t\t}\n \t}",
"public void printAverageRatingsByMinutes(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"read data for \" + raters + \" raters\");\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"read data for \" + MovieDatabase.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n \n Filter f = new MinutesFilter(105, 135); \n int minRatings = 5;\n ArrayList<Rating> aveRat = sr.getAverageRatingsByFilter(minRatings, f);\n System.out.println(\"Found \" + aveRat.size() + \" movies\");\n System.out.println(\"-------------------------------------\");\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \"\\t\" + \"Time: \" \n + MovieDatabase.getMinutes(r.getItem()) + \"\\t\" \n + MovieDatabase.getTitle(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n \n }",
"private void graphInfo() {\n \n this.distances = new double[this.cities.size()][this.cities.size()];\n \n City c1, c2;\n \n // take the city\n for (int i = 0; i < this.cities.size(); i++) {\n // go through all the other cities\n c1 = this.cities.get(i);\n for (int j = 0; j < this.cities.size(); j++) {\n c2 = this.cities.get(j);\n this.distances[i][j] = c1.to(c2);\n }\n }\n \n }",
"private void getData(Path inputOne, Path inputTwo) throws IOException {\n String line;\n\n try (BufferedReader br = Files.newBufferedReader(inputOne, StandardCharsets.ISO_8859_1)) {\n\n while((line = br.readLine()) != null){\n City source = null;\n City target = null;\n\n String[] split = line.split(\",\");\n if(!cities.stream().anyMatch(o -> o.getCityName().equalsIgnoreCase(split[0]))) {\n cities.add(source = new City(split[0]));\n }\n if(!cities.stream().anyMatch(o -> o.getCityName().equalsIgnoreCase(split[1]))){\n cities.add(target = new City(split[1]));\n }\n\n for (City city : cities){\n if(city.getCityName().equalsIgnoreCase(split[0])){\n source = city;\n }\n if(city.getCityName().equalsIgnoreCase(split[1])){\n target = city;\n }\n if(source != null && target != null){\n Road newroad = new Road(source, target, Integer.parseInt(split[2]), Integer.parseInt(split[3]));\n roads.add(newroad);\n break;\n }\n }\n }\n }\n\n try (BufferedReader br = Files.newBufferedReader(inputTwo, StandardCharsets.ISO_8859_1)) {\n while((line = br.readLine()) != null) {\n String[] split = line.split(\",\");\n\n for(City city : cities){\n if(city.getCityName().equalsIgnoreCase(split[1])){\n city.addAttraction(split[0]);\n }\n }\n }\n }\n }",
"private void addMovieToArray(ArrayList<Movie> movies, String movieName, String directorName, String act1, String act2, String act3, int star)\n {\n Movie clip = new Movie(movieName, directorName, act1, act2, act3, star);\n movies.add(clip);\n }",
"public List<Rating> findRatingByMovie(String movieID);",
"public Obs algorithm2_4(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\n\t\tfor (int i = 0; i < towers.length;) {\n\t\t\tboolean flag = true;\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// buffer.add(towers[i]);\n\t\t\t// tbuffer.add(tstamps[i]);\n\t\t\tif (max_distance > dist_th) {\n\t\t\t\tjava.util.Date sTime;\n\t\t\t\tjava.util.Date eTime;\n\t\t\t\tflag = false;\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tsTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\teTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\n\t\t\t\t\tcal.setTime(sTime);\n\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t\tif (time_diff >= time_th) {\n\t\t\t\t\tflag = true;\n\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t */\n\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t/**\n\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t */\n\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t * observables.\n\t\t\t\t\t */\n\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t\t\t\tbuffer.remove(0);\n\t\t\t\t\ttbuffer.remove(0);\n\n\t\t\t\t\t// i--; // to keep a as it is.\n\n\t\t\t\t\t// buffer = new ArrayList<>();\n\t\t\t\t\t// tbuffer = new ArrayList<>();\n\t\t\t\t\tmax_distance = 0;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (flag) {\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}",
"public void map(MapOutputCollector collector, Key key, Value val)\r\n\t\t\tthrows TwisterException {\r\n\t\t// load centroids data from memcache\r\n\t\tMemCacheAddress memCacheKey = (MemCacheAddress) val;\r\n\t\tif (memCacheKey.getRange() != 1) {\r\n\t\t\tthrow new TwisterException(\"MemCache size is not 1.\");\r\n\t\t}\r\n\t\tBcastCentroidVectorData centroids = (BcastCentroidVectorData) (MemCache\r\n\t\t\t\t.getInstance().get(this.jobConf.getJobId(),\r\n\t\t\t\tmemCacheKey.getMemCacheKeyBase() + memCacheKey.getStart()));\r\n\t\tif (centroids == null) {\r\n\t\t\tthrow new TwisterException(\"No centroid data.\");\r\n\t\t}\r\n\t\tif (centroids.getVecLen() != this.image.getVecLen()) {\r\n\t\t\tthrow new TwisterException(\r\n\t\t\t\t\t\"Centroids and Image data are not matched.\");\r\n\t\t}\r\n\t\t// ExecutorService taskExecutor = Executors.newSingleThreadExecutor();\r\n\t\t// CentroidsPrintingThread thread = new CentroidsPrintingThread(centroids,\r\n\t\t\t\t// 0);\r\n\t\t// taskExecutor.execute(thread);\r\n\t\tint vecLen = this.image.getVecLen();\r\n\t\t// image data\r\n\t\tbyte[][] imageData = this.image.getData();\r\n\t\tint numImageData = this.image.getNumData();\r\n\t\t// index recording\r\n\t\tdouble[] minDis = new double[numImageData];\r\n\t\tint[] minCentroidIndex = new int[numImageData];\r\n\t\t// centroid data\r\n\t\tint numCentroidsData = centroids.getNumData();\r\n\t\tbyte[][] centroidData = centroids.getData();\r\n\t\t// tmp data\r\n\t\tdouble dis = 0;\r\n\t\tif (numCentroidsData > numImageData) {\r\n\t\t\t// for each row\r\n\t\t\tfor (int i = 0; i < numCentroidsData; i++) {\r\n\t\t\t\tfor (int j = 0; j < numImageData; j++) {\r\n\t\t\t\t\tdis = getEuclidean(imageData[j], centroidData[i], vecLen);\r\n\t\t\t\t\t// set init minDis for a new coming data point\r\n\t\t\t\t\t// we know i is 0, no need to set min block and row\r\n\t\t\t\t\tif (i == 0) {\r\n\t\t\t\t\t\tminDis[j] = dis;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dis < minDis[j]) {\r\n\t\t\t\t\t\tminDis[j] = dis;\r\n\t\t\t\t\t\tminCentroidIndex[j] = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor (int i = 0; i < numImageData; i++) {\r\n\t\t\t\tfor (int j = 0; j < numCentroidsData; j++) {\r\n\t\t\t\t\tdis = getEuclidean(imageData[i], centroidData[j], vecLen);\r\n\t\t\t\t\t// set init minDis for a new coming data point\r\n\t\t\t\t\tif (j == 0) {\r\n\t\t\t\t\t\tminDis[i] = dis;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (dis < minDis[i]) {\r\n\t\t\t\t\t\tminDis[i] = dis;\r\n\t\t\t\t\t\tminCentroidIndex[i] = j;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// set block and row map\r\n\t\tMap<Integer, Map<Integer, List<Integer>>> centroidsMap = new TreeMap<Integer, Map<Integer, List<Integer>>>();\r\n\t\t// record the assignment of the points\r\n\t\tfor (int i = 0; i < numImageData; i++) {\r\n\t\t\t// System.out.println(\" \" + minCentroidIndex[i] + \" \" + numCentroidsData);\r\n\t\t\tint[]blockRowIndex = getBlockRowIndex(minCentroidIndex[i], numCentroidsData);\r\n\t\t\t// System.out.println(\" \" + blockRowIndex[0] + \" \" + blockRowIndex[1]);\r\n\t\t\t// block\r\n\t\t\tMap<Integer, List<Integer>> block = centroidsMap\r\n\t\t\t\t\t.get(blockRowIndex[0]);\r\n\t\t\tif (block == null) {\r\n\t\t\t\tblock = new HashMap<Integer, List<Integer>>();\r\n\t\t\t\tcentroidsMap.put(blockRowIndex[0], block);\r\n\t\t\t}\r\n\t\t\t// row\r\n\t\t\tList<Integer> row = block.get(blockRowIndex[1]);\r\n\t\t\tif (row == null) {\r\n\t\t\t\trow = new ArrayList<Integer>();\r\n\t\t\t\tblock.put(blockRowIndex[1], row);\r\n\t\t\t}\r\n\t\t\t// add image index\r\n\t\t\trow.add(i);\r\n\t\t}\r\n\t\t//System.out.println(\"size of centroids map \" + centroidsMap.size());\r\n\t\t// do collect\r\n\t\tint blockNumData = 0;\r\n\t\tdouble totalMinDis = 0;\r\n\t\tMap<Key, Value> keyvals = new HashMap<Key, Value>();\r\n\t\tfor (int blockIndex : centroidsMap.keySet()) {\r\n\t\t\tblockNumData = getBlockNumData(blockIndex, numCentroidsData);\r\n\t\t\t// create new object\r\n\t\t\tint[] newCentroidRowCount = new int[blockNumData];\r\n\t\t\tint[][] newCentroidData = new int[blockNumData][vecLen];\r\n\t\t\t// get block records\r\n\t\t\tMap<Integer, List<Integer>> block = centroidsMap.get(blockIndex);\r\n\t\t\t// get row\r\n\t\t\tfor (int rowIndex : block.keySet()) {\r\n\t\t\t\tList<Integer> row = block.get(rowIndex);\r\n\t\t\t\t// for each image index\r\n\t\t\t\tfor (int imageIndex : row) {\r\n\t\t\t\t\tfor (int i = 0; i < vecLen; i++) {\r\n\t\t\t\t\t\tnewCentroidData[rowIndex][i] = newCentroidData[rowIndex][i]\r\n\t\t\t\t\t\t\t\t+ (int) imageData[imageIndex][i];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// image count on this centroid\r\n\t\t\t\t\tnewCentroidRowCount[rowIndex] = newCentroidRowCount[rowIndex] + 1;\r\n\t\t\t\t\ttotalMinDis = totalMinDis + minDis[imageIndex];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tkeyvals.put(new ShuffleKey(blockIndex), new ShuffleVectorData(\r\n\t\t\t\t\tblockNumData, vecLen, totalMinDis, newCentroidRowCount,\r\n\t\t\t\t\tnewCentroidData));\r\n\r\n\t\t\tif (keyvals.size() == 25) {\r\n\t\t\t\tcollector.collect(keyvals);\r\n\t\t\t\tkeyvals.clear();\r\n\t\t\t}\r\n\t\t}\r\n\t\t//add empty block, for benchmark shuffling only\r\n\t\t/*\r\n\t\tfor (int i = 0; i < this.jobConf.getNumReduceTasks(); i++) {\r\n\t\t\tif (centroidsMap.get(i) == null) {\r\n\t\t\t\tblockNumData = getBlockNumData(i, numCentroidsData);\r\n\t\t\t\tint[] newCentroidRowCount = new int[blockNumData];\r\n\t\t\t\tint[][] newCentroidData = new int[blockNumData][vecLen];\r\n\t\t\t\tkeyvals.put(new ShuffleKey(i), new ShuffleVectorData(\r\n\t\t\t\t\t\tblockNumData, vecLen, 0, newCentroidRowCount,\r\n\t\t\t\t\t\tnewCentroidData));\r\n\t\t\t}\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n\t\t// collect\r\n\t\tif (!keyvals.isEmpty()) {\r\n\t\t\tcollector.collect(keyvals);\r\n\t\t}\r\n\t}",
"private void readReviews(final String filename) \n\t{\n\t\ttry\n\t\t{\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(new File(\"dataset\" + File.separator + filename)));\n\t\t\tString line;\n\t\t\t\n\t\t\twhile ((line = br.readLine()) != null) \n\t\t\t{\n\t\t\t\tString[] tokens = line.split(\";;\");\n\t\t\t\tif(tokens.length != 12)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Error reading from file \\\"\" + filename + \"\\\"\");\n\t\t\t\t\tSystem.exit(1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tString reviewId = tokens[0];\n\t\t\t\tString reviewerUrl = tokens[1];\n\t\t\t\t\n\t\t\t\tString productCategory = tokens[2];\n\t\t\t\tString productId = tokens[3];\n\t\t\t\tString productName = tokens[4];\n\t\t\t\t\n\t\t\t\tString reviewTitle = tokens[5];\n\t\t\t\tString reviewText = tokens[6];\n\t\t\t\tdouble reviewRating = Double.parseDouble(tokens[7]);\n\t\t\t\tString reviewDate = tokens[8];\n\t\t\t\t\n\t\t\t\tint posVotes = Integer.parseInt(tokens[9]);\n\t\t\t\tint totalVotes = Integer.parseInt(tokens[10]);\n\t\t\t\tdouble helpfulness = Double.parseDouble(tokens[11]);\n\t\t\t\t\n\t\t\t\treviews.add(new Review(reviewId, reviewerUrl, productCategory, productId, productName, reviewTitle, reviewText, reviewRating, reviewDate, posVotes, totalVotes, helpfulness));\n\t\t\t\t\n\t\t\t\t/** stores the helpfulness of reviews rated from 1 to 5 **/\t\t\t\n\t\t\t\tif (reviewRating == (int)(reviewRating))\n\t\t\t\t{\n\t\t\t\t\tList<Double> list = ratings.containsKey(reviewRating)? ratings.get(reviewRating): new ArrayList<Double>();\n\t\t\t\t\tlist.add(helpfulness);\n\t\t\t\t\tratings.put(reviewRating, list);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// update the information in for the product\n\t\t\t\tupdateProduct(productId, reviewRating);\n\t\t\t\t// create a new ReviewInstance object\n\t\t\t\tReviewInstance ri = new ReviewInstance();\n\t\t\t\t// store rating of this review\n\t\t\t\tri.setRating(reviewRating);\n\t\t\t\t// classify whether this review is helpful or not\n\t\t\t\tri.setReviewHelpfulness(helpfulness>=0.75 ? \"helpful\" : \"unhelpful\");\n\t\t\t\t\n\t\t\t\t// store the ReviewInstance\n\t\t\t\tthis.reInstanceList.add(ri);\n\t\t\t\treInstanceMap.put(reviewId, ri);\n\t\t\t}\n\t\t\tcomputeStdDevRating();\n\t\t\tbr.close();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"double collectOutput(List<NeuronsConnection> inputConnections);",
"private void parseMovie(String url) {\n\t\tBoolean is3D = false;\n\t\tDocument doc;\n\t\ttry {\n\t\t\tdoc = Jsoup.connect(WOLFF + url).get();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\t\t\n\n\t\tString movietitle = doc.select(\"#wrapper_left h2\").first().text().trim();\n\t\tSystem.out.println(\"Movie: \" + movietitle);\n\t\t\n\t\t// check if it is 3D movie\n\t\tif(url.contains(\"-3d\")) {\n\t\t\tis3D = true;\n\t\t}\n\n\t\t//create resource movie with the type 'Movie' and data property 'title'\n\t\tResource movie = m.createResource(MOVIE + url.replace(\"/film/\", \"\"));\n\t\tmovie.addProperty(RDF.type, m.getProperty(NS + \"Movie\"))\n\t\t\t .addProperty(m.getProperty(NS + \"title\"), movietitle);\n\n\t\t//if it is 3D movie..\n\t\tif(is3D)\n\t\t\tmovie.addProperty(m.getProperty(NS + \"hasPresentation\"), m.getResource(NS + \"3D\"));\n\n\t\t// does it have corresponding dbpedia resource?\n\t\tString mResult;\n\t\tif((mResult = SparqlQuery.movieInDbpediaEn(movietitle)) != null) {\n\t\t\ttemp = ResourceFactory.createResource(mResult);\n\t\t\tmovie.addProperty(OWL.sameAs, temp);\n\t\t} //else if((mResult = SparqlQuery.movieInDbpediaNl(movietitle)) != null) {\n//\t\t\ttemp = ResourceFactory.createResource(mResult);\n//\t\t\tmovie.addProperty(OWL.sameAs, temp);\n//\t\t}else if((mResult = SparqlQuery.movieInDbpediaDe(movietitle)) != null) {\n//\t\t\ttemp = ResourceFactory.createResource(mResult);\n//\t\t\tmovie.addProperty(OWL.sameAs, temp);\n//\t\t}\n//\t\t\n\t\t//parse sidebar information\n\t\tElements sidebar = doc.select(\".sidebar_container\").get(1).select(\".table_view tr td\");\n\t\t\n\t\tfor (Element element:sidebar) {\n\t\t\tswitch (element.select(\"strong\").text()) {\n\t\t\t//get all actors\n\t\t\tcase \"Acteurs\":\n\t\t\t\tString[] actors = element.text().substring(8).split(\", \"); //Remove \"Acteurs\" from string\n\t\t\t\tfor(String actor : actors) {\n\t\t\t\t\tResource person = m.createResource(PERSON + actor.replace(\" \", \"_\"));\n\t\t\t\t\tperson.addProperty(RDF.type, m.getProperty(NS + \"Person\"))\n\t\t\t\t\t\t .addProperty(m.getProperty(NS + \"name\"), actor.trim());\n\t\t\t\t\tmovie.addProperty(m.getProperty(NS + \"hasActor\"), person);\n\t\t\t\t\t\n\t\t\t\t\t//check if the actor has dbpedia page. Describe as sameAs if true\n\t\t\t\t\tString qResult;\n\t\t\t\t\tif((qResult = SparqlQuery.personInDbpediaEn(actor)) != null) { // in dbpedia.org\n\t\t\t\t\t\ttemp = ResourceFactory.createResource(qResult);\n\t\t\t\t\t\tperson.addProperty(OWL.sameAs, temp);\n\t\t\t\t\t} //else if((qResult = SparqlQuery.personInDbpediaNl(actor)) != null) { // in nl.dbpedia.org\n//\t\t\t\t\t\ttemp = ResourceFactory.createResource(qResult);\n//\t\t\t\t\t\tperson.addProperty(OWL.sameAs, temp);\n//\t\t\t\t\t} else if((qResult = SparqlQuery.personInDbpediaDe(actor)) != null) { // in de.dbpedia.org\n//\t\t\t\t\t\ttemp = ResourceFactory.createResource(qResult);\n//\t\t\t\t\t\tperson.addProperty(OWL.sameAs, temp);\n//\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the director\n\t\t\tcase \"Regie\": //director\n\t\t\t\tString nameString = element.text().substring(6).toString().trim(); //Remove \"Regie\" from string\n\t\t\t\tResource person = m.createResource(PERSON + nameString.replace(\" \", \"_\"));\n\t\t\t\tperson.addProperty(m.getProperty(NS + \"name\"), nameString);\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"hasDirector\"), person);\n\t\t\t\t\n\t\t\t\t//check if the director has dbpedia page. Describe as sameAs if true \n\t\t\t\tString qResult;\n\t\t\t\tif((qResult = SparqlQuery.personInDbpediaEn(nameString)) != null) { // in dbpedia.org\n\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR + qResult);\n\t\t\t\t}// else if((qResult = SparqlQuery.personInDbpediaNl(nameString)) != null) { // in nl.dbpedia.org\n//\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR_NL + qResult);\n//\t\t\t\t} else if((qResult = SparqlQuery.personInDbpediaDe(nameString)) != null) { // in de.dbpedia.org\n//\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR_DE + qResult);\n//\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// a little bit cheating for JJ Abrams\n\t\t\t\tif(nameString.equals(\"Jeffrey (J.J.) Abrams\")) {\n\t\t\t\t\tperson.addProperty(OWL.sameAs, DBR + \"J._J._Abrams\");\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t//get the duration\n\t\t\tcase \"Speelduur\":\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"duration\"), last(element).toString().trim().split(\" \")[0], XSDDatatype.XSDint);\n\t\t\t\tbreak;\n\n\t\t\t//get the genre\n\t\t\tcase \"Genre\":\n\t\t\t\tString[] genres = last(element).toString().toLowerCase().split(\", \");\n\t\t\t\tfor (String genreName:genres) {\n\t\t\t\t\tif(GENRE_MAP.containsKey(genreName))\n\t\t\t\t\t\tgenreName = GENRE_MAP.get(genreName);\n\t\t\t\t\telse { //unknown genre; report it and create new resource to acommodate\n\t\t\t\t\t\tSystem.out.println(\"*) another genre found: \" + genreName);\n\t\t\t\t\t\tm.createResource(GENRE + genreName)\n\t\t\t\t\t\t .addProperty(RDF.type, m.getProperty(NS + \"Genre\"));\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\tmovie.addProperty(m.getProperty(NS + \"hasGenre\"), m.getResource(GENRE + genreName));\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the language presentation\n\t\t\tcase \"Taal\":\n\t\t\t\tString lang = last(element).toString().trim().toLowerCase();\n\t\t\t\tif(LANGUAGE.containsKey(lang)) {\n\t\t\t\t\tlang = LANGUAGE.get(lang);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"another language found: \" + lang);\n\t\t\t\t}\n\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"language\"), lang);\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the release date\n\t\t\tcase \"In de bioscoop sinds\":\n\t\t\t\tString[] releasedate = last(element).toString().trim().split(\" \");\n\t\t\t\tString day = releasedate[0];\n\t\t\t\tString month = String.valueOf((Arrays.asList(DUTCH_MONTH).indexOf(releasedate[1].toLowerCase()) + 1));\n\t\t\t\tString year = releasedate[2];\n\t\t\t\tString formatteddate = year + \"-\" + month + \"-\" + day + \"T00:00:00\";\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"releaseDate\"), formatteddate, XSDDatatype.XSDdateTime);\t\t\t\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t//get the local distributor\n\t\t\tcase \"Distributeur\":\n\t\t\t\tNode distributorLink = (Node) last(element);\n\t\t\t\tResource distributorResource;\n\t\t\t\tif (distributorLink instanceof Element) {\n\t\t\t\t\tdistributorResource = m.createResource(COMPANY + ((Element) distributorLink).text().replace(\" \", \"_\"));\n\t\t\t\t\tdistributorResource.addProperty(m.getProperty(NS + \"companyURL\"), distributorLink.attr(\"href\"));\n\t\t\t\t\tdistributorResource.addProperty(m.getProperty(NS + \"companyName\"), ((Element) distributorLink).text());\n\t\t\t\t\tmovie.addProperty(m.getProperty(NS + \"isDistributedBy\"), distributorResource);\n\t\t\t\t} else {\n\t\t\t\t\tdistributorResource = m.createResource(COMPANY + distributorLink.toString().replace(\" \", \"_\"));\n\t\t\t\t\tdistributorResource.addProperty(m.getProperty(NS + \"companyName\"), distributorLink.toString());\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tmovie.addProperty(m.getProperty(NS + \"isDistributedBy\"), distributorResource);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public void printAverageRatings(){\n ThirdRatings sr = new ThirdRatings();\n int raters = sr.getRaterSize();\n System.out.println(\"raters: \" + raters);\n System.out.println(\"-------------------------------------\");\n \n //MovieDatabase.initialize(\"ratedmovies_short.csv\");\n MovieDatabase.initialize(\"ratedmoviesfull.csv\");\n System.out.println(\"movies: \" + MovieDatabase.size());\n System.out.println(\"-------------------------------------\");\n \n \n int minRatings = 35;\n ArrayList<Rating> aveRat = sr.getAverageRatings(minRatings);\n System.out.println(\"Number of ratings at least \" + minRatings + \": \" + aveRat.size());\n // sort arraylist\n Collections.sort(aveRat);\n for(Rating r: aveRat){\n System.out.println(r.getValue() + \" : \" + MovieDatabase.getTitle(r.getItem()));\n }\n System.out.println(\"-------------------------------------\");\n \n// Filter f = new AllFilters();\n// f.addFilter(new YearsAfterFilter(2001));\n ArrayList<String> movies = MovieDatabase.filterBy(new YearAfterFilter(2001)); \n int c = 0;\n for(Rating r: aveRat){\n if(movies.contains(r.getItem())){c++;}\n }\n System.out.println(\"Number of ratings at least \" + minRatings + \" and made on or after 2001 : \" + c);\n System.out.println(\"-------------------------------------\");\n \n \n \n }",
"@Override\n public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {\n Map<String, Double> relationMap = new HashMap<String, Double>();\n Map<String, Double> userRating = new HashMap<String, Double>();\n\n for (Text value:values) {\n String valueSt = value.toString().trim();\n if (valueSt.contains(\"=\")) {\n String[] words = valueSt.split(\"=\");\n relationMap.put(words[0], Double.parseDouble(words[1]));\n } else {\n String[] words = valueSt.split(\":\");\n relationMap.put(words[0], Double.parseDouble(words[1]));\n }\n }\n\n for (Map.Entry<String, Double> entry: relationMap.entrySet()) {\n String movie = entry.getKey();\n double relation = entry.getValue();\n for (Map.Entry<String, Double> userEntry: userRating.entrySet()) {\n String user = userEntry.getKey();\n double rating = userEntry.getValue();\n String outputKey = user + \":\" + movie;\n double outputValue = relation * rating;\n context.write(new Text(outputKey), new DoubleWritable(outputValue));\n }\n }\n\n }",
"void receivedDataSuccess(List<Data.Movie> data) ;",
"private Film getFilmFromData(String[] line){\n \n Director director = this.getDirectorFromData(line); //Director object created using data from line array\n Actor actor = this.getActorFromData(line); //Actor object created using data from line array\n //filmID, filmName etc. give the index number for their respective values, NOT the values themselves\n Film film = new Film(line[AppVariables.filmID].trim(), \n line[AppVariables.filmName].trim(),\n line[AppVariables.imdbRating].trim(),\n line[AppVariables.filmYear].trim());\n film.directors.add(director);\n film.actors.add(actor);\n \n return film; \n }",
"public void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {\n\t\t\tText gxy = new Text();\n\t\t\tText ij = new Text();\n\t\t\tgxy.clear();\n\t\t\tij.clear();\n\t\t\tString line = value.toString();\n\t\t\tString[] w = line.split(\":\");\n\t\t\tString[] IJ = w[0].split(\",\");\n\t\t\tint i = Integer.parseInt(IJ[0]);\n\t\t\tint j = Integer.parseInt(IJ[1]);\n\t\t\tint k = Integer.parseInt(w[1]);\n\t\t\t//int d = Integer.parseInt(w[2]);\n\t\t\tif (i==k || j==k){\n\t\t\t\tfor (int l=1; l<=4; l++){\n\t\t\t\t\tif (j==k){\n\t\t\t\t\t\tij.set(IJtoString(i, l));\n\t\t\t\t\t\tgxy.set(GXYtoString(i, j, k, w[2]));\n\t\t\t\t\t System.out.println(\"Mapper emitting\"+\" \"+ij+\" \"+gxy);\n\t\t\t\t\t\tcontext.write(ij, gxy);\n\t\t\t\t\t}\n\t\t\t\t\tif (i==k){\n\t\t\t\t\t\tij.set(IJtoString(l, j));\n\t\t\t\t\t\tgxy.set(GXYtoString(i, j, k, w[2]));\n\t\t\t\t\t\tSystem.out.println(\"Mapper emitting\"+\" \"+ij+\" \"+gxy);\n\t\t\t\t\t\tcontext.write(ij, gxy);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tij.set(IJtoString(i, j));\n\t\t\t\tgxy.set(GXYtoString(i, j, k, w[2]));\n\t\t\t\tSystem.out.println(\"Mapper emitting\"+\" \"+ij+\" \"+gxy);\n\t\t\t\tcontext.write(ij, gxy);\n\t\t\t}\n\n\t\t}",
"public void saveToXML() {\n\t\tList<String> vendorList = map.values().stream().sorted().distinct().collect(Collectors.toList());\n\t\t//Iterate over the vendor list\n\t\tfor (int i=0;i < vendorList.size();i++) {\n\t\t\tProducts vendorSpecificList = new Products(); //create a product object just for a member\n\t\t\tList<output.Product> miniProductList = new ArrayList<>(); //holds the list of individual Product\n\t\t\t//iterate the whole map\t\n\t\t\tfor (Entry<Product, String> entry : map.entrySet()) {\t\t\n\t\t\t\t//identify members of the distinct vendor\n\t\t\t\tif(vendorList.get(i).equals(entry.getValue())) {\t\t\t\t\n\t\t\t\t\tminiProductList.add(entry.getKey()); //add to a subset\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvendorSpecificList.setProduct(miniProductList); //populate with subset\n\t\t\tprintFile(vendorSpecificList,vendorList.get(i)); //prints the subset\n\n\t\t}\n\t}",
"private void getMoviesData() {\n movieId = getIntent().getIntExtra(MOVIE_ID, 0);\n }",
"public static void main(String[] args) throws Exception {\n \tSparkConf conf = new SparkConf().setAppName(\"airports\");\n \tif(args.length==0) {\n \t\tconf.setMaster(\"local[500]\");\n \t}\n \t\n \n\n JavaSparkContext sc = new JavaSparkContext(conf);\n \n \n \n \n\n JavaRDD<String> airports = sc.textFile(\"in/airports2.text\");\n\n JavaRDD<String> airportsInItaly = airports.filter(line -> line.split(Utils.COMMA_DELIMITER)[3].equals(\"\\\"Italy\\\"\"));\n\n \n //Map Transformation here\n JavaRDD<String> airportsNameAndCityNames = airportsInItaly.map(line -> {\n String[] splits = line.split(Utils.COMMA_DELIMITER);\n return StringUtils.join(new String[]{splits[1], splits[2]}, \",\");\n }\n );\n \n System.out.println(\"The size is:\"+airportsNameAndCityNames.count());\n airportsNameAndCityNames.saveAsTextFile(\"out/airports_in_italy.text\");\n \n sc.close();\n }",
"public void obtainFinalRecs(){\n\n //Step 1 - obtain all scores and put in a data structure\n //Step 1a - get movie ID from commonRec\n //Step 1b - initialise data structure\n //Step 1c - search originalList for movie ID and get score\n //Step 1d - search ... recMap for movie ID and get scores?\n //pull each list out and search that\n //put each score into a list\n\n for (ScoredId aCommonRec : commonRec) {\n Long mID = aCommonRec.getId();\n Double score1 = aCommonRec.getScore();\n\n ArrayList<Double> scores = new ArrayList<>();\n scores.add(score1);\n\n for (Map.Entry<Long, List<ScoredId>> entry : recMap.entrySet()) {\n\n List<ScoredId> tempList = entry.getValue();\n\n for (ScoredId aTempList : tempList) {\n\n if (aTempList.getId() == mID) {\n Double tempscore = aTempList.getScore();\n scores.add(tempscore);\n }\n }\n\n }\n\n\n //Step 2 - average all scores\n\n Double averageScore;\n Double total = 0.0;\n\n for (Double score : scores) {\n total += score;\n }\n\n\n averageScore = total / scores.size();\n\n //Step 3 - put into finalRecs - Long = movie ID, Double = average predicted score\n\n finalRecs.put(mID, averageScore);\n }\n\n }",
"@Override\r\n protected Instances mapsToSingleInstance(Instances miData) throws Exception {\r\n Instances siMinData = new Instances(miData.attribute(1).relation(), miData.numInstances());\r\n Instances siMaxData = new Instances(miData.attribute(1).relation(), miData.numInstances());\r\n\r\n for (int i = 0; i < miData.numInstances(); i++) {\r\n Instances bag = miData.attribute(1).relation(i);\r\n double[] attrMinVals = new double[bag.numAttributes()];\r\n double[] attrMaxVals = new double[bag.numAttributes()];\r\n for (int j = 0; j < bag.numAttributes(); j++) {\r\n Stats stats = new Stats();\r\n for (int k = 0; k < bag.numInstances(); k++) {\r\n stats.add(bag.get(k).value(j));\r\n }\r\n attrMinVals[j] = stats.min;\r\n attrMaxVals[j] = stats.max;\r\n }\r\n siMinData.add(new DenseInstance(1, attrMinVals));\r\n siMaxData.add(new DenseInstance(1, attrMaxVals));\r\n }\r\n RenameAttribute raFilter = new RenameAttribute();\r\n try {\r\n raFilter.setOptions(new String[]{\"-find\", \"(^)\", \"-replace\", \"min_\", \"-R\", \"first-last\"});\r\n raFilter.setInputFormat(siMinData);\r\n siMinData = Filter.useFilter(siMinData, raFilter);\r\n raFilter.setOptions(new String[]{\"-find\", \"(^)\", \"-replace\", \"max_\", \"-R\", \"first-last\"});\r\n raFilter.setInputFormat(siMaxData);\r\n siMaxData = Filter.useFilter(siMaxData, raFilter);\r\n } catch (Exception ex) {\r\n Logger.getLogger(MinMaxMappingBagNoiseFilter.class.getName()).log(Level.SEVERE, null, ex);\r\n throw new Exception(\"There was some problem renaming attributes to mix-max mapping method\");\r\n }\r\n Instances siData = Instances.mergeInstances(siMinData, siMaxData);\r\n Add filter = new Add();\r\n try {\r\n filter.setOptions(new String[]{\"-T\", \"NOM\", \"-N\", \"class\", \"-L\", \"0,1\"});\r\n } catch (Exception ex) {\r\n Logger.getLogger(MinMaxMappingBagNoiseFilter.class.getName()).log(Level.SEVERE, null, ex);\r\n throw new Exception(\"There was some problem when adding the class attribute in the mapped dataset\");\r\n }\r\n filter.setInputFormat(siData);\r\n siData = Filter.useFilter(siData, filter);\r\n siData.setClassIndex(siData.numAttributes() - 1);\r\n for (int i = 0; i < miData.numInstances(); i++) {\r\n siData.get(i).setClassValue(miData.get(i).classValue());\r\n }\r\n return siData;\r\n }",
"public Obs algorithm2(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * trips sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\t\ttry {\n\n\t\t\tdouble max_distance = 0;\n\t\t\tint time_diff = 0;\n\t\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tbuffer.add(towers[i]);\n\t\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (NumberFormatException numberFormatException) {\n\t\t\tSystem.err.println(\"NumberFormatException\\t\" + numberFormatException.getMessage());\n\t\t} catch (ParseException parseException) {\n\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t}\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\n\t\t}\n\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t}",
"public PointOfInterest(String name, String description, LatLng location, String city, int typeOfLocation, String user, int numRatings) {\n this.name = name;\n this.description = description;\n this.latitude = location.latitude;\n this.longitude = location.longitude;\n this.typeOfLocation = typeOfLocation;\n this.user = user;\n this.city = city;\n this.numRatings = numRatings;\n this.favorites = new HashMap<>();\n\n }",
"public static List<String> getPersonInfo(String actorID) throws IOException{\n\t\t\n\t\tURL url = new URL(\"https://api.themoviedb.org/3/person/\" + actorID + \"?api_key=cc10b91ab6be4842679242b80c13bb31&language=en-US\");\n\t\tHttpURLConnection con = (HttpURLConnection) url.openConnection();\n\t con.setDoOutput(true);\n\t con.setRequestMethod(\"GET\");\n\t con.setRequestProperty(\"Content-Type\", \"application/json\");\n\t \n\t BufferedReader br = new BufferedReader(new InputStreamReader((con.getInputStream())));\n\n\t String actorData = br.readLine(); //the raw results for actor with the ID# from the url\n\t \n\t String beg = \"\\\"name\\\":\";\n String end = \",\\\"place_of_birth\";\n String x = Pattern.quote(beg) + \"(.*?)\" + Pattern.quote(end); //returns just the name\n\t \n\t String begYr = \"\\\"birthday\\\":\";\n String endYr = \",\\\"deathday\";\n String xYr = Pattern.quote(begYr) + \"(.*?)\" + Pattern.quote(endYr); //returns just the birthday\n \n String begBio = \"\\\"biography\\\":\";\n String endBio = \",\\\"birthday\";\n String xBio = Pattern.quote(begBio) + \"(.*?)\" + Pattern.quote(endBio); //returns just the Bio\n \n String begTown = \"\\\"place_of_birth\\\":\";\n String endTown = \",\\\"popularity\";\n String xTown = Pattern.quote(begTown) + \"(.*?)\" + Pattern.quote(endTown); //returns just the hometown\n\t\t\n\t\tString begPic = \"\\\"profile_path\\\":\\\"/\";\n\t\tString endPic = \"\\\"}\";\n\t\tString xPic = Pattern.quote(begPic) + \"(.*?)\" + Pattern.quote(endPic); //returns just the picture\n\t\t\n\t\tPattern pattern = Pattern.compile(x);\n\t\tPattern patternYr = Pattern.compile(xYr);\n\t\tPattern patternBio = Pattern.compile(xBio);\n\t\tPattern patternTown = Pattern.compile(xTown);\n\t\tPattern patternPic = Pattern.compile(xPic);\n\t\t\n\t\tMatcher matcher = pattern.matcher(actorData);\n\t\tMatcher matcherYr = patternYr.matcher(actorData);\n\t\tMatcher matcherBio = patternBio.matcher(actorData);\n\t\tMatcher matcherTown = patternTown.matcher(actorData);\n\t\tMatcher matcherPic = patternPic.matcher(actorData);\n\t\t\n\t\tString name = \"\";\n\t\tString year = \"\";\n\t\tString bio = \"\";\n\t\tString hometown = \"\";\n\t\tString picture = \"\";\n\t\t\n\t\twhile(matcher.find()){\n\t\t\tname = matcher.group(1);\n\t\t}\n\t\twhile(matcherYr.find()){ \n \tyear = matcherYr.group(1);\n }\n while(matcherBio.find()){ \n \tString preBio1 = matcherBio.group(1);\n \tString preBio2 = preBio1.replace(\"\\\\n\\\\n\", \" \");\n \tString preBio3 = preBio2.replace(\"&\", \"&\");\n \tbio = preBio3.replace('\\\\', ' ');\n }\n while(matcherTown.find()){ \n \thometown = matcherTown.group(1);\n \t\n }\n while(matcherPic.find()){\n \tString pic = matcherPic.group(1);\n \tpicture = \"http://image.tmdb.org/t/p/w500//\" + pic;\t\n }\n \n\t\tList<String> actorInfo = new ArrayList<String>();\n actorInfo.add(name);\n\t\tactorInfo.add(year);\n actorInfo.add(bio);\n actorInfo.add(hometown);\n actorInfo.add(picture);\n \n\t\treturn actorInfo;\n\t\t\t\t\n\t}",
"public PointOfInterest(String name, String description, LatLng location, String city, int typeOfLocation, List<String> photos, List<String> photosThumbs, String user, Date date, int numRatings) {\n this.name = name;\n this.description = description;\n this.latitude = location.latitude;\n this.longitude = location.longitude;\n this.typeOfLocation = typeOfLocation;\n this.photos = photos;\n this.photosThumbs = photosThumbs;\n this.user = user;\n this.date = date;\n this.city = city;\n this.numRatings = numRatings;\n this.favorites = new HashMap<>();\n\n }",
"public YelpDB(String restaurants, String reviews, String users) throws IOException {\n\n this.gson = new Gson();\n this.restaurantMap = new ConcurrentHashMap<String, Restaurant>();\n this.reviewMap = new ConcurrentHashMap<String, Review>();\n this.userMap = new ConcurrentHashMap<String, YelpUser>();\n\n // Process restaurants\n try (BufferedReader reader = new BufferedReader(new FileReader(restaurants))) {\n String line;\n while ((line = reader.readLine()) != null) {\n Restaurant r = gson.fromJson(line, Restaurant.class);\n String business_id = r.getID();\n this.restaurantMap.put(business_id, r);\n }\n }\n\n // Process reviews\n try (BufferedReader reader = new BufferedReader(new FileReader(reviews))) {\n String line;\n while ((line = reader.readLine()) != null) {\n Review r = gson.fromJson(line, Review.class);\n String review_id = r.getID();\n this.reviewMap.put(review_id, r);\n }\n }\n\n // Process users\n try (BufferedReader reader = new BufferedReader(new FileReader(users))) {\n String line;\n while ((line = reader.readLine()) != null) {\n YelpUser u = gson.fromJson(line, YelpUser.class);\n String user_id = u.getID();\n this.userMap.put(user_id, u);\n }\n }\n }",
"public Obs algorithm2_2(String[] towers, String[] tstamps, Hashtable<Integer, Vertex> towersXY) {\n\n\t\tDateFormat formatter = new SimpleDateFormat(\"HH:mm:ss\");\n\t\tCalendar cal = Calendar.getInstance();\n\n\t\t/**\n\t\t * Stops sets and time stamps for these stops\n\t\t */\n\t\tArrayList<String> trips = new ArrayList<>();\n\t\tArrayList<String> tstrips = new ArrayList<>();\n\n\t\t/**\n\t\t * Buffers: <\\n buffer holds sequence of observations that did not meet\n\t\t * buffer clearance criterias.> <\\n tbuffer holds time stamps values\n\t\t * corresponding to those in the buffer.>\n\t\t */\n\t\tArrayList<String> buffer = new ArrayList<>();\n\t\tArrayList<String> tbuffer = new ArrayList<>();\n\n\t\tdouble max_distance = 0;\n\t\tint time_diff = 0;\n\t\tfor (int i = 0; i < towers.length; i++) {\n\t\t\tVertex a = towersXY.get(Integer.parseInt(towers[i]));\n\t\t\tfor (int j = 0; j < buffer.size(); j++) {\n\t\t\t\tVertex b = towersXY.get(Integer.parseInt(buffer.get(j)));\n\t\t\t\t// System.out.println(\"b\"+Integer.parseInt(buffer.get(j)));\n\t\t\t\tdouble tmp_distance = eculidean(a.getX(), b.getX(), a.getY(), b.getY());\n\t\t\t\tif (tmp_distance > max_distance) {\n\t\t\t\t\tmax_distance = tmp_distance;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tbuffer.add(towers[i]);\n\t\t\ttbuffer.add(tstamps[i]);\n\n\t\t\tif (max_distance > dist_th) {\n\n\t\t\t\ttry {\n\t\t\t\t\t/**\n\t\t\t\t\t * if the time exceeds timing threshold, then check the\n\t\t\t\t\t * distance between towers. If this distance less than the\n\t\t\t\t\t * distance threshold, then previous tower is the end of the\n\t\t\t\t\t * current trip.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t\tjava.util.Date sTime = formatter.parse(tbuffer.get(0));\n\t\t\t\t\tjava.util.Date eTime = formatter.parse(tbuffer.get(tbuffer.size() - 1));\n\t\t\t\t\tcal.setTime(sTime);\n\t\t\t\t\tint hour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint minute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\tcal.setTime(eTime);\n\t\t\t\t\tint ehour = cal.get(Calendar.HOUR);\n\t\t\t\t\tint eminute = cal.get(Calendar.MINUTE);\n\n\t\t\t\t\ttime_diff = Math.abs((ehour - hour)) * HOUR + (eminute - minute);\n\n\t\t\t\t\tif (time_diff > time_th) {\n\n\t\t\t\t\t\tif (trips.isEmpty()) {\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttrips.add(buffer.get(0));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(0));\n\t\t\t\t\t\t\ttrips.add(RLM);\n\t\t\t\t\t\t\ttstrips.add(RLM);\n\t\t\t\t\t\t\ttrips.add(buffer.get(buffer.size() - 1));\n\t\t\t\t\t\t\ttstrips.add(tbuffer.get(buffer.size() - 1));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset buffers.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Reset maximum distances\n\t\t\t\t\t\t */\n\t\t\t\t\t\tmax_distance = 0;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Add the first observation as the origin of the first\n\t\t\t\t\t\t * trips and the remaining part of the buffer as the\n\t\t\t\t\t\t * traveling observations, else add the complete buffer\n\t\t\t\t\t\t * elements as the observation seq of the traveling\n\t\t\t\t\t\t * observables.\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttrips.addAll(buffer);\n\t\t\t\t\t\ttstrips.addAll(tbuffer);\n\n\t\t\t\t\t\tbuffer = new ArrayList<>();\n\t\t\t\t\t\ttbuffer = new ArrayList<>();\n\t\t\t\t\t\tmax_distance = 0;\n\t\t\t\t\t}\n\t\t\t\t} catch (ParseException parseException) {\n\t\t\t\t\tSystem.err.println(\"ParseException\\t\" + parseException.getMessage());\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif (!buffer.isEmpty()) {\n\t\t\ttrips.add(buffer.get(0));\n\t\t\ttstrips.add(tbuffer.get(0));\n\n\t\t}\n\n\t\t// System.out.println(\"stops:\\t\" + Arrays.toString(trips.toArray(new\n\t\t// String[trips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\t// System.out.println(\"time stamps:\\t\" +\n\t\t// Arrays.toString(tstrips.toArray(new\n\t\t// String[tstrips.size()])).replaceAll(\" \", \"\").replaceAll(CLM + RLM +\n\t\t// CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\t\treturn new Obs(\n\t\t\t\tArrays.toString(trips.toArray(new String[trips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"),\n\t\t\t\tArrays.toString(tstrips.toArray(new String[tstrips.size()])).replaceAll(\" \", \"\")\n\t\t\t\t\t\t.replaceAll(CLM + RLM + CLM, RLM).replace(\"[\", \"\").replace(\"]\", \"\"));\n\n\t}",
"private void createDicts(String inputFile){\n\t\tproductIds = new TreeMap<>();\n\t\ttokenDict = new TreeMap<>();\n\t\treviewIds = new TreeMap<>();\n\n\t\tDataParser dataParser = null;\n\t\ttry {\n\t\t\tdataParser = new DataParser(inputFile);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error occurred while reading the reviews input file.\");\n\t\t\tSystem.exit(1);\n\t\t}\n\n\t\tfor (int i = 0; i < dataParser.allReviews.size(); i++) {\n\t\t\taddProductId(dataParser.allReviews.get(i).get(\"productId\"), i + 1);\n\t\t\tint length = addReviewText(dataParser.allReviews.get(i).get(\"text\"), i + 1);\n\t\t\taddReviewId(dataParser.allReviews.get(i), i, length);\n\t\t}\n\t}",
"public static ArrayList<Movie> createDataBase (int movieQt){ //utility function to read from stdin\n ArrayList<Movie> movieList = new ArrayList<Movie>();\n for(int i=0; i < movieQt; i++){\n String movieInfo = readLn(200);\n //System.out.println(movieInfo);\n String[] parts = movieInfo.split(\" \");\n int movieDate = Integer.parseInt(parts[0]);\n //System.out.println(movieDate);\n int movieRent = Integer.parseInt(parts[1]);\n //System.out.println(movieRent);\n String movieName = String.join(\" \", Arrays.copyOfRange(parts, 2, parts.length));\n //System.out.println(movieName);\n Movie newMovie = new Movie(movieName, movieRent, movieDate);\n movieList.add(newMovie);\n }\n return movieList;\n }",
"public void placeData() {\n // get a user stream to manipulate users of the graph\n User[] users = this.getUsers();\n List<SystemNode> nodes = this.getSystemNodes().collect(Collectors.toList());\n // retrieve data of each user\n List<Data> dataList = this.getData(users);\n\n do {\n List<SystemNode> remainingNodes = new ArrayList<>(nodes);\n dataList\n // for each data, get interested users and call placeData for the specific data\n .forEach(data -> this.putOnBestSpot(data, remainingNodes, Arrays.stream(users)\n .filter(user -> arrayContains(user.getInterests(), data.getId()))\n .toArray(User[]::new)\n ));\n\n // store invalid positioned data to position the in the next loop insertion\n dataList = remainingNodes.stream()\n // retrieve overweight nodes\n .filter(SystemNode::isOverweight)\n // remove theme from accessible nodes\n .peek(nodes::remove)\n // find the best arrangement for each node and get excess data\n .flatMap(this::removeInvalidData)\n // collect them and put them in the datalist for next iteration\n .collect(Collectors.toList());\n\n // we can quit the loop if all data are place or if there isn't enough place\n } while (dataList.size() > 0 && nodes.size() > 0);\n\n if (dataList.size() > 0) throw new RuntimeException(\"There isn't enough space\");\n }",
"public void writeTourResultsAllCarrier() {\n\t\tString fileName = this.outputFolder + \"total_tour_infos_per_vehicleType.csv\";\n\t\tFile file = new File(fileName);\n\n\t\ttry {\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(file));\n\t\t\tbw.write(fileName);\n\t\t\tbw.newLine();\n\t\t\tbw.write(\"____________________________________________________________________________\");\n\t\t\tbw.newLine();\n\n\t\t\tbw.write(\"personId; vehType Id;distance [m] ; distance [km] ;TravelTime [s]; TravelTime [h];\" +\n\t\t\t\t\t\"FuelConsumption[l]; Emission [t Co2]; FuelConsumptionRate[l/100m]; \" +\n\t\t\t\t\t\"EmissionRate [g/m]; \");\n\t\t\tbw.newLine();\n\n\n\n\t\t\t//\t\t\tKT:\n\t\t\tMap<Id<Person>, Double> personId2tourDistance = this.handler.getPersonId2TourDistances();\n\t\t\tMap<Id<Person>, Double> personId2tourTravelTimes = this.handler.getPersonId2TravelTimes();\n\n\t\t\tMap<Id<VehicleType>, VehicleTypeSpezificCapabilities> vehTypId2Capabilities = new TreeMap<Id<VehicleType>, VehicleTypeSpezificCapabilities>();\n\n\t\t\tCarrierVehicleTypes vehicleTypes = this.handler.getVehicleTypes();\n\n\t\t\t//preparation:\n\t\t\tfor (Id<VehicleType> vehicleTypeId : vehicleTypes.getVehicleTypes().keySet()){\n\t\t\t\tVehicleTypeSpezificCapabilities capabilities = this.handler.getVehTypId2Capabilities().get(vehicleTypeId);\n\t\t\t\tif (capabilities != null){\n\t\t\t\t\tvehTypId2Capabilities.put(vehicleTypeId, capabilities);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//write results:\n\t\t\tfor (Id<Person> personId :personId2tourDistance.keySet()) {\n\n\t\t\t\tDouble tourDistanceMeter = personId2tourDistance.get(personId);\n\t\t\t\tDouble tourTravelTimeSec = personId2tourTravelTimes.get(personId);\n\n\t\t\t\tId<VehicleType> vehTypeId = null;\n\n\t\t\t\tfor (Id<VehicleType> vehTypeIdsAvail : vehicleTypes.getVehicleTypes().keySet()) {\n\t\t\t\t\tif(personId.toString().contains(\"_\"+vehTypeIdsAvail.toString()+\"_\")){\n\t\t\t\t\t\tif (vehTypeIdsAvail.toString().endsWith(\"frozen\") == personId.toString().contains(\"frozen\")) {//only frozen\n\t\t\t\t\t\t\tvehTypeId = vehTypeIdsAvail;\n\t\t\t\t\t\t} else { //not \"frozen\"\n\t\t\t\t\t\t\tvehTypeId = vehTypeIdsAvail;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (vehTypeId == null) {\n\t\t\t\t\tlog.error(\"Vehicle type for person not defined: \" + personId);\n\t\t\t\t}\n\n\t\t\t\tdouble fuelConsuptionRate = (vehTypId2Capabilities.get(vehTypeId)).getFuelConsumtion()*1000; // Usually in l/100km\n\t\t\t\tdouble emissionsRatePerMeter = vehTypId2Capabilities.get(vehTypeId).getEmissionsPerMeter(); \n\n\t\t\t\tbw.write(personId + \";\" +\n\t\t\t\t\t\tvehTypeId + \";\" +\n\t\t\t\t\t\ttourDistanceMeter + \";\" + \n\t\t\t\t\t\ttourDistanceMeter/1000 + \";\" + //km\n\t\t\t\t\t\ttourTravelTimeSec + \";\" + \n\t\t\t\t\t\ttourTravelTimeSec/3600 + \";\" + \t//h\n\t\t\t\t\t\ttourDistanceMeter*fuelConsuptionRate/100/1000 + \";\" + // rate is in [liter/100km]\n\t\t\t\t\t\ttourDistanceMeter*emissionsRatePerMeter /1000000 +\";\" + \t// CO2-Ausstoss in t (= 1Mio g)\n\t\t\t\t\t\tfuelConsuptionRate+ \";\" + \n\t\t\t\t\t\temissionsRatePerMeter \n\t\t\t\t\t\t);\n\t\t\t\tbw.newLine();\n\n\t\t\t}\t\n\t\t\t\n\t\t\tlog.info(\"Output written to \" + fileName);\n\t\t\tbw.close();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n public String toString() {\n return String.format(\"(%s:%s)-[%s:%s]->(%s:%s)\", user.getId(), user.getName(), id, \"RATING: {stars:\" + stars + \", comment:'\" + comment + \"'}\", movie.getId(),movie.getTitle());\n\n }",
"public void printTopRatingMovies() {\n\t\tCollections.sort(this.dataList, new SortByRating());\n\t\tint top = Math.min(5, getDataLength());\n\t\tfor (int i=0; i<top; ++i) {\n\t\t\tSystem.out.println(this.dataList.get(i).toString());\n\t\t}\n\t\tCollections.sort(this.dataList);\n\t}",
"@Override\n\t public void map(Object key, Text value, Context context\n\t \n\t ) throws IOException, InterruptedException {\n\t\t// read line by line, with each transaction, verify if a candidate is all in this transaction, if yes, write candiate, one\n\t\t// value is a line\n\t\t \n\t\tString line = value.toString();\n\t\t\n\t\t// convert transaction to List<Integer>\n\t\tString[] s = line.split(\"\\\\s+\");\n\t\tList<Integer> t = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t// count how many frequent items appear in this transaction\n\t\tint count = 0;\n\t\tfor(int i=0; i<s.length; i++) {\n\t\t t.add(Integer.parseInt(s[i]));\n\t\t if (hashItems.containsKey(Integer.parseInt(s[i])))\n\t\t\t\tcount++;\n\t\t}\n\t\t\n\n\t\tif (count >= 2) {\n\t\t\t Text word = new Text();\n\t\t\t String newT = new String();\n\n\t\t\t // we sort transaction t:\n\t\t\t Collections.sort(t);\n\t\t\t \n\t\t\t // convert transaction to List<Integer>\n\t\t\t for (Integer x: t)\n\t\t\t\t if (hashItems.containsKey(x)) {\n\t\t\t\t\tnewT = newT + x.toString() + \" \";\t\t\t\t\t\n\t\t\t\t }\n\t\t\t // now newT is the transaction with only frequent items, we will output it\n\t\t\t \n\t\t\t \n\t\t\t word.set(newT);\n\n\t\t\t context.write(word, new Text(\"1 1\")); // 1 support, 1 for data (to avoid error)\n\t\t\t\n\t\t}\n\t\t \n\t\t\n\t\t\n\t\t\t\n\n\t\t\n\n\t }",
"@Override\r\n\tpublic String getMovie(String actor1, String actor2)\r\n\t{\r\n\t\tActor act1 = new Actor(actor1);\r\n\t\tActor act2 = new Actor(actor2);\t\r\n\t\t\r\n\t\tif(graph.containsEdge(act1,act2 ))\r\n\t\t{\r\n\t\t\tMovieEdge movieName = graph.getEdge(act1, act2);\r\n\t\t\t\r\n\t\t\treturn movieName.getMovieName();\t\r\n\t\t}\t\r\n\t\treturn null;\t\r\n\t}",
"public static List<Map<String,Object>> getData(){\n\t\tList<Map<String,Object>> coupons = new ArrayList<Map<String,Object>>();\n\t\t\n\t\tMap<String,Object> ChoclateCpn = new HashMap<String,Object>();\n\t\tMap<String,Object> MeatCpn = new HashMap<String,Object>();\n\t\tMap<String,Object> ChkCpn = new HashMap<String,Object>();\n\t\tMap<String,Object> FruitCpn = new HashMap<String,Object>();\n\t\tMap<String,Object> FishCpnSalmon = new HashMap<String,Object>();\n\t\tMap<String,Object> FishCpnCatish = new HashMap<String,Object>();\n\t\t\n\t\tChoclateCpn.put(\"sku\" , \"SKU001\");\n\t\tChoclateCpn.put(\"id\",\"100\");\n\t\tChoclateCpn.put(\"type\",\"GROC\");\n\t\tChoclateCpn.put(\"price\",12);\n\t\tChoclateCpn.put(\"amount\",2);\n\t\t\n\t\tMeatCpn.put(\"sku\" , \"SKU002\");\n\t\tMeatCpn.put(\"id\",\"101\");\n\t\tMeatCpn.put(\"type\",\"MT\");\n\t\tMeatCpn.put(\"price\",10);\n\t\tMeatCpn.put(\"amount\",2);\n\t\t\n\t\tChkCpn.put(\"sku\" , \"SKU003\");\n\t\tChkCpn.put(\"id\",\"103\");\n\t\tChkCpn.put(\"type\",\"MT\");\n\t\tChkCpn.put(\"price\",6);\n\t\tChkCpn.put(\"amount\",1);\n\t\t\n\t\tFruitCpn.put(\"sku\" , \"SKU004\");\n\t\tFruitCpn.put(\"id\",\"104\");\n\t\tFruitCpn.put(\"type\",\"FRUT\");\n\t\tFruitCpn.put(\"price\", 20);\n\t\tFruitCpn.put(\"amount\", 4);\n\t\t\n\t\tFishCpnSalmon.put(\"sku\" , \"SKU005\");\n\t\tFishCpnSalmon.put(\"id\",\"105\");\n\t\tFishCpnSalmon.put(\"type\",\"MT\");\n\t\tFishCpnSalmon.put(\"price\", 12);\n\t\tFishCpnSalmon.put(\"amount\", 2);\n\t\t\n\t\tFishCpnCatish.put(\"sku\" , \"SKU006\");\n\t\tFishCpnCatish.put(\"id\",\"106\");\n\t\tFishCpnCatish.put(\"type\",\"MT\");\n\t\tFishCpnCatish.put(\"price\", 5 );\n\t\tFishCpnCatish.put(\"amount\", 1.5 );\n\t\t\n\t\tcoupons.add( ChoclateCpn);\n\t\tcoupons.add( MeatCpn );\n\t\t\n\t\tcoupons.add( ChkCpn );\n\t\tcoupons.add( FruitCpn );\n\t\t\n\t\tcoupons.add( FishCpnSalmon );\n\t\tcoupons.add( FishCpnCatish );\n\t\t\n\t\treturn coupons;\n\t}",
"public void testLoadMovies () {\n ArrayList<Movie> movies = loadMovies(\"ratedmoviesfull\"); \n System.out.println(\"Numero de peliculas: \" + movies.size()); \n String countInGenre = \"Comedy\"; // variable\n int countComedies = 0; \n int minutes = 150; // variable\n int countMinutes = 0;\n \n for (Movie movie : movies) {\n if (movie.getGenres().contains(countInGenre)) {\n countComedies +=1;\n }\n \n if (movie.getMinutes() > minutes) {\n countMinutes +=1;\n }\n }\n \n System.out.println(\"Hay \" + countComedies + \" comedias en la lista \");\n System.out.println(\"Hay \" + countMinutes + \" películas con más de \" + minutes + \" minutos en la lista \");\n \n // Cree un HashMap con el recuento de cuántas películas filmó cada director en particular\n HashMap<String,Integer> countMoviesByDirector = new HashMap<String,Integer> ();\n for (Movie movie : movies) {\n String[] directors = movie.getDirector().split(\",\"); \n for (String director : directors ) {\n director = director.trim();\n if (! countMoviesByDirector.containsKey(director)) {\n countMoviesByDirector.put(director, 1); \n } else {\n countMoviesByDirector.put(director, countMoviesByDirector.get(director) + 1);\n }\n }\n }\n \n // Contar el número máximo de películas dirigidas por un director en particular\n int maxNumOfMovies = 0;\n for (String director : countMoviesByDirector.keySet()) {\n if (countMoviesByDirector.get(director) > maxNumOfMovies) {\n maxNumOfMovies = countMoviesByDirector.get(director);\n }\n }\n \n // Cree una ArrayList con directores de la lista que dirigieron el número máximo de películas\n ArrayList<String> directorsList = new ArrayList<String> ();\n for (String director : countMoviesByDirector.keySet()) {\n if (countMoviesByDirector.get(director) == maxNumOfMovies) {\n directorsList.add(director);\n }\n }\n \n System.out.println(\"Número máximo de películas dirigidas por un director: \" + maxNumOfMovies);\n System.out.println(\"Los directores que dirigieron mas películas son \" + directorsList);\n }"
] | [
"0.5444558",
"0.53293455",
"0.52925843",
"0.5252344",
"0.52356154",
"0.5175403",
"0.50631785",
"0.4992546",
"0.496144",
"0.49410793",
"0.4869072",
"0.48167992",
"0.4790108",
"0.47265393",
"0.47120202",
"0.46674353",
"0.46333688",
"0.46269777",
"0.4620261",
"0.45876953",
"0.45589185",
"0.4550767",
"0.45230898",
"0.45190993",
"0.4517205",
"0.45159727",
"0.45126522",
"0.44912177",
"0.4489912",
"0.44888353",
"0.44758874",
"0.44562814",
"0.4440377",
"0.44285533",
"0.43827224",
"0.43752456",
"0.43613356",
"0.43476707",
"0.43462056",
"0.43353555",
"0.43287414",
"0.43287167",
"0.4327299",
"0.4314587",
"0.43089145",
"0.43008894",
"0.42996117",
"0.4294129",
"0.42916983",
"0.42887014",
"0.42793232",
"0.42791596",
"0.42694065",
"0.42694065",
"0.42694065",
"0.42671078",
"0.42616042",
"0.42601684",
"0.42599374",
"0.42589083",
"0.4242074",
"0.42325312",
"0.42196855",
"0.421101",
"0.42109644",
"0.42106816",
"0.41998532",
"0.41917357",
"0.41895953",
"0.41885215",
"0.4188044",
"0.41822305",
"0.4181588",
"0.41808623",
"0.4169213",
"0.41687244",
"0.41652125",
"0.41644663",
"0.41588995",
"0.4158671",
"0.41486302",
"0.4145335",
"0.41435438",
"0.41412243",
"0.41404676",
"0.41357547",
"0.41340122",
"0.4131627",
"0.41291264",
"0.4125446",
"0.41235211",
"0.4123203",
"0.4121089",
"0.41185457",
"0.41184106",
"0.4118001",
"0.41132757",
"0.41116107",
"0.41083032",
"0.41021988"
] | 0.6064487 | 0 |
TODO Autogenerated method stub | @Override
public String deleteStatement() throws Exception {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public String insertStatement() throws Exception {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public String updateStatement() throws Exception {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onBind(Cursor cursor) {
this.tableName = cursor.getString(cursor.getColumnIndex("name"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
private SimpleDateFormat DATETIME = new SimpleDateFormat("dd/MM/yyyy hh:mm"); | public boolean isNullOrEmpty(String str){
return str!=null && !str.isEmpty() ? false : true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"MM/dd/yyyy HH:mm\");\n Date date = new Date();\n return dateFormat.format(date);\n }",
"private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }",
"private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }",
"private String getDateTime() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"[yyyy/MM/dd - HH:mm:ss]\");\n return sdf.format(new Date());\n }",
"public static String ShowDate(){\n Date date = new Date();\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss.SS a\");\n String HH_MM = sdf.format(date);\n return HH_MM;\n }",
"public static String getDateTime(){\n String pattern = \"MM/dd/yyyy HH:mm:ss\";\n DateFormat df = new SimpleDateFormat(pattern);\n Date today = Calendar.getInstance().getTime();\n String todayAsString = df.format(today);\n return todayAsString;\n }",
"private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }",
"private String getDate() {\n\t\tSimpleDateFormat parseFormat = new SimpleDateFormat(\"hh:mm a\");\n\t\tDate date = new Date();\n\t\tString s = parseFormat.format(date);\n\t\treturn s;\n\t}",
"private void formatTime() {\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat ft = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\r\n\t\tm_timeSent = ft.format(date).toString();\r\n\t}",
"@RequiresApi(api = Build.VERSION_CODES.N)\n private String getDateTime() {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\");\n Date date = new Date();\n return dateFormat.format(date);\n }",
"public static String getDateTime() {\n\t\treturn new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\").format(new Date());\n\t}",
"public DateUtility () {\n dateFormat = new SimpleDateFormat(\"MM/dd/yyyy\");\n }",
"private static String getTime() {\n\t\tDate getDate = new Date();\n\t\tString timeFormat = \"M/d/yy hh:mma\";\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(timeFormat);\n\t\treturn \"[\" + sdf.format(getDate) + \"]\\t\";\n\t}",
"private String getDate()\r\n\t{\r\n\t\tCalendar cal = Calendar.getInstance();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\r\n\t\treturn sdf.format(cal.getTime());\r\n\t}",
"public static SimpleDateFormat getHourFormat() {\n return new SimpleDateFormat(\"HH:mm\");\n }",
"public String getDateCreationLibelle() {\n\t\tDateTimeFormatter format = DateTimeFormatter.ofPattern(\"dd/MM/yyyy hh:mm:ss\");\n\t\treturn this.dateCreation.format(format);\n\t}",
"public String dar_hora(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"HH:mm:ss\");\n return dateFormat.format(date).toString();\n }",
"public static String getDateTime() {\n\t\tString sDateTime=\"\";\n\t\ttry {\n\t\t\tSimpleDateFormat sdfDate = new SimpleDateFormat(\"dd-MM-yyyy\");\n\t\t\tSimpleDateFormat sdfTime = new SimpleDateFormat(\"HH:mm:ss\");\n\t\t\tDate now = new Date();\n\t\t\tString strDate = sdfDate.format(now);\n\t\t\tString strTime = sdfTime.format(now);\n\t\t\tstrTime = strTime.replace(\":\", \"-\");\n\t\t\tsDateTime = \"D\" + strDate + \"_T\" + strTime;\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(e);\n\t\t}\n\t\treturn sDateTime;\n\t}",
"private String formatTime(Date dateObject) {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n return timeFormat.format(dateObject);\n }",
"private String formatDate(Date date){\n SimpleDateFormat format = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\", Locale.getDefault());\n\n return format.format(date);\n }",
"public static String getDateAndTime() {\n Calendar JCalendar = Calendar.getInstance();\n String JMonth = JCalendar.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.UK);\n String JDate = JCalendar.getDisplayName(Calendar.DATE, Calendar.LONG, Locale.UK);\n String JHour = JCalendar.getDisplayName(Calendar.HOUR, Calendar.LONG, Locale.UK);\n String JSec = JCalendar.getDisplayName(Calendar.SECOND, Calendar.LONG, Locale.UK);\n\n return JDate + \"th \" + JMonth + \"/\" + JHour + \".\" + JSec + \"/24hours\";\n }",
"public void createDate(){\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy_MM_dd\"); //TODO -HHmm si dejo diagonales separa bonito en dia, pero para hacer un armado de excel creo que debo hacer un for mas\n currentDateandTime = sdf.format(new Date());\n Log.e(TAG, \"todays date is: \"+currentDateandTime );\n\n}",
"private void constructVssDateTimeFormat() {\n vssDateTimeFormat = new SimpleDateFormat(\"'Date: '\" + this.dateFormat + \" 'Time: 'hh:mma\"); \n }",
"private static String setDate() {\n mDate = new Date();\n DateFormat dateFormat = DateFormat.getDateInstance();\n String dateString = dateFormat.format(mDate);\n return dateString;\n }",
"public static void dateFormat() {\n }",
"private void setTimeDate(){\n tvTime = (TextView) findViewById(R.id.tv_time);\n dateFormat = new SimpleDateFormat(\"hh:mm a\");\n tvTime.setText(dateFormat.format(new Date()).toString());\n\n //Set Date to Top TextView\n tvDate = (TextView) findViewById(R.id.tv_date);\n dateFormat = new SimpleDateFormat(\"EEE, MMM d\");\n tvDate.setText(dateFormat.format(new Date()).toString());\n }",
"private void configDate(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd\");\n tvDateLost.setText(dateFormat.format(date));\n }",
"private String formatTime(Date dateObject) {\r\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\r\n return timeFormat.format(dateObject);\r\n }",
"public String formatDateAndTime(String date){\n\n return dateTimeFormatter.parse(date).toString();\n\n }",
"public String formatoCortoDeFecha(Date fecha){\n SimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy HH:mm\");\n return format.format(fecha);\n }",
"private void getDateTime() {\n String todayDateTime = String.valueOf(Calendar.getInstance().getTime());\n\n // Calendar.getInstance().getTime() returns a long string of various data for today, split and access what we need\n String[] splitTime = todayDateTime.split(\" \");\n\n dayDate = splitTime[1] + \" \" + splitTime[2] + \" \" + splitTime[5]; // Month, Day, Year\n dayTime = splitTime[3];\n }",
"public void mostrarHora(String formato){\n Date objDate = new Date();\n SimpleDateFormat objSDF = new SimpleDateFormat(formato);\n //este sera el resultado de la fechas\n fecha=objSDF.format(objDate);\n }",
"private static SimpleDateFormat getDateFormat() {\r\n\t\tif(dateFormat == null)\r\n\t\t\tdateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\t\treturn dateFormat;\r\n\t}",
"private String formatTime(Date dateObject) {\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\", Locale.getDefault());\n return timeFormat.format(dateObject);\n }",
"public String convertDateToTime(String date){\n Date test = null;\n if(date !=null) {\n try {\n test = sdf.parse(date);\n } catch (ParseException e) {\n System.out.println(\"Parse not working: \" + e);\n }\n calendar.setTime(test);\n return String.format(\"%02d:%02d\",\n calendar.get(Calendar.HOUR_OF_DAY),\n calendar.get(Calendar.MINUTE)\n );\n }\n return \"n\";\n }",
"public String getTimeAndDate() {\n\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"dd MMM hh:mm\");\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tString dateAndTime = dateFormat.format(cal.getTime());\n\t\t\treturn dateAndTime;\n\t\t}",
"public static Date fotmatDate21(String myDate) {\n\t\tDate dDate = new SimpleDateFormat(\"HH:mm:ss\").parse(myDate,\r\n\t\t\t\tnew ParsePosition(0));\r\n\t\treturn dDate;\r\n\t}",
"@Override\n protected SimpleDateFormat getDateFormat() {\n return dateFormat;\n }",
"public registration() {\n initComponents();\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd\");\n Date d = new Date();\n String dt = df.format(d);\n tdate.setText(dt);\n \n }",
"private static String getDate() {\n return new SimpleDateFormat(\"yyyyMMddHHmmss\").format\n (new Date(System.currentTimeMillis()));\n }",
"public String getTime() {\n String pattern = \"yyyy-MM-dd HH:mm:ss\";\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\n String date = simpleDateFormat.format(new Date());\n return date;\n }",
"public String DateFormatted(){\n\t\tSimpleDateFormat simDate = new SimpleDateFormat(\"E, dd/MM/yy hh:mm:ss a\");\n\t\treturn simDate.format(date.getTime());\n\t}",
"public DateFormat getDateFormat(){\n\treturn dateFormat;\n }",
"public String getTime()\n {\n SimpleDateFormat newDateFormat = new SimpleDateFormat(\"HH:mm\");\n String MySDate = newDateFormat.format(this.dueDate);\n return MySDate;\n }",
"public String getSystemDateTime() {\n\t\tjava.text.SimpleDateFormat sdfDate = new java.text.SimpleDateFormat(\"yyyy/MM/dd\");\n java.text.SimpleDateFormat sdfTime = new java.text.SimpleDateFormat(\"HH:mm\");\n Date now = new Date();\n String strDate = sdfDate.format(now);\n String strTime = sdfTime.format(now);\n System.out.println(\"Date: \" + strDate);\n System.out.println(\"Time: \" + strTime); \n return \"date\"+strDate+\" \"+strTime;\n\t}",
"private String formatTime(Date dateObject)\n {\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n timeFormat.setTimeZone(Calendar.getInstance().getTimeZone());\n return timeFormat.format(dateObject);\n }",
"public static void main(String[] args) throws Exception {\n Calendar cal = Calendar.getInstance();\n SimpleDateFormat simpleformat = new SimpleDateFormat(\"E, dd MMM yyyy HH:mm:ss Z\");\n System.out.println(\"Today's date and time = \"+simpleformat.format(cal.getTime()));\n // displaying date\n simpleformat = new SimpleDateFormat(\"dd/MMMM/yyyy\");\n String str = simpleformat.format(new Date());\n System.out.println(\"Current Date = \"+str);\n // current time\n simpleformat = new SimpleDateFormat(\"HH:mm:ss\");\n String strTime = simpleformat.format(new Date());\n System.out.println(\"Current Time = \"+strTime);\n // displaying hour in HH format\n simpleformat = new SimpleDateFormat(\"HH\");\n String strHour = simpleformat.format(new Date());\n System.out.println(\"Hour in HH format = \"+strHour);\n\n\n\n //formato ideal\n simpleformat = new SimpleDateFormat(\"dd/MM/yyyy - HH:mm:ss\");\n String strTimeDay = simpleformat.format(new Date());\n System.out.println(\"Dia e Hora = \" + strTimeDay);\n\n }",
"private String formatTime(String dateObject){\n\n SimpleDateFormat input = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\"); // format kita \"HARUS SAMA TIDAK BOLEH FORMATNYA BEDA BAHKAN 1 CHAR PUN\n SimpleDateFormat output= new SimpleDateFormat(\"h:mm a\");\n Date jam = null;\n try {\n jam = input.parse(dateObject);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return output.format(jam);\n }",
"private void setDate(String beginning, String end){\n try {\n\n this.beginTime=ShortDateFormat.parse(beginning);\n this.endTime = ShortDateFormat.parse(end);\n }\n catch(ParseException ex){\n System.out.println(\"Error Parsing the time, please enter valid time, dont forget to include am/pm \" +ex.getMessage());\n System.exit(1);\n }\n }",
"public String getDateTimeFormated(Context context){\n SimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss\"\n , context.getResources().getConfiguration().locale);\n sdf.setTimeZone(TimeZone.getDefault());\n return sdf.format(new Date(mDateTime));\n //setting the dateformat to dd/MM/yyyy HH:mm:ss which is how the date is displayed when a dream is saved\n }",
"public static String timestamp(){\n\t\tDate date = new Date();\n\t\tDateFormat hourdateFormat = new SimpleDateFormat(\"dd/MM/yyyy HH:mm:ss \");\n\t\treturn hourdateFormat.format(date);\n\t}",
"public String Get_date() \n {\n \n return date;\n }",
"public void updateDate(){\n SimpleDateFormat formatter = new SimpleDateFormat(\"yyyy/MM/dd\");\n Date curDate=new Date(System.currentTimeMillis());\n String date=formatter.format(curDate);\n TextView TextTime=(TextView)this.findViewById(R.id.tv_date);\n TextTime.setText(date);\n }",
"public String getDatetime() {\n return datetime;\n }",
"private static String time() throws Exception {\n\t\tDateFormat dateFormat = new SimpleDateFormat(\"HH-mm-ss \");\n\t\t// get current date time with Date()\n\t\tDate date = new Date();\n\t\t// Now format the date\n\t\tString date1 = dateFormat.format(date);\n\t\t// System.out.println(date1);\n\t\treturn date1;\n\t}",
"public static String getHHMM()\r\n/* 74: */ {\r\n/* 75: 94 */ String nowTime = \"\";\r\n/* 76: 95 */ Date now = new Date();\r\n/* 77: 96 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 78: 97 */ nowTime = formatter.format(now);\r\n/* 79: 98 */ return nowTime;\r\n/* 80: */ }",
"public String getTimestamp() \n{\n Calendar now = Calendar.getInstance();\n return String.format(\"20%1$ty-%1$tm-%1$td_%1$tHh%1$tMm%1$tSs\", now);\n}",
"public String getDate(){\n return date;\n }",
"public String getDate(){ return this.start_date;}",
"public static String getYYYYMMDDHHMMSS()\r\n/* 56: */ {\r\n/* 57: 68 */ String nowTime = \"\";\r\n/* 58: 69 */ Date now = new Date();\r\n/* 59: 70 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMddHHmmss\");\r\n/* 60: 71 */ nowTime = formatter.format(now);\r\n/* 61: 72 */ return nowTime;\r\n/* 62: */ }",
"private static String timeFor(Date date)\n\t{\n\t\tDateFormat df = new InternetDateFormat();\n\t\tString theTime = df.format(date);\n\t\treturn theTime;\n\t}",
"public synchronized static DateFormat getTimeFormat()\n\t{\n\t\treturn TIME_FORMAT;\n\t}",
"private String getFecha() {\n\t\tLocalDateTime myDateObj = LocalDateTime.now();\n\t\tDateTimeFormatter myFormatObj = DateTimeFormatter.ofPattern(\"dd-MM-yyyy HH:mm:ss\");\n\t\tString formattedDate = myDateObj.format(myFormatObj);\n \n\t\treturn formattedDate;\n }",
"public Date getDateTime(SimpleDateFormat format) {\n\t\tDate dt = null;\n\t\ttry {\t\t\t\t\n\t\t\tString dateInString = this.month + \"/\" + this.day + \"/\" + this.year + \" \" +\n\t\t\t\tthis.hour + \":\" + this.minute + \":\" + this.second;\n\t\t\tif(dateInString.trim().length() > 5 ) {\n\t\t\t\tdt = format.parse(dateInString);\n\t\t\t}\n\t\t} catch (Exception e ) {\n\t\t\tdt = null;\n\t\t}\n\t\treturn dt;\n\t}",
"protected static SimpleDateFormat dateFormat() {\n return dateFormat(true, false);\n }",
"public String getDate(){\n return date;\n }",
"public static String getYYYYMMDD()\r\n/* 65: */ {\r\n/* 66: 81 */ String nowTime = \"\";\r\n/* 67: 82 */ Date now = new Date();\r\n/* 68: 83 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 69: 84 */ nowTime = formatter.format(now);\r\n/* 70: 85 */ return nowTime;\r\n/* 71: */ }",
"public static String getDate()\r\n {\r\n Date now = new Date();\r\n DateFormat df = new SimpleDateFormat (\"yyyy-MM-dd'T'hh-mm-ss\");\r\n String currentTime = df.format(now);\r\n return currentTime; \r\n \r\n }",
"public void formatDateTime() {\n // Check if type of parsing is for display or not. \n // If it is for display, no need to check if date has already passed.\n if (parseType != 2) {\n startDate = dtFormat.formatDate(startDate,0);\n endDate = dtFormat.formatDate(endDate,0);\n } else {\n startDate = dtFormat.formatDate(startDate,1);\n endDate = dtFormat.formatDate(endDate,1);\n }\n \n startTime = dtFormat.formatTime(startTime);\n endTime = dtFormat.formatTime(endTime);\n }",
"public DateTime(Date date) {\r\n\t\tthis.timeString = YYYY_MMT_DD_T_HH_MM_SS_FORMATTER.format(date);\r\n\t}",
"private static String timeLine()\n {\n return String.format(STR_FORMAT_1 + STR_FORMAT_2, TIME_STR, TIME);\n }",
"@Override\n public void actionPerformed(ActionEvent e) {\n Date date = new Date();\n DateFormat timeFormat = new SimpleDateFormat(\"HH:mm:ss\");\n String time = timeFormat.format(date);\n relogio.setText(time);\n \n Date date2 = new Date();\n DateFormat timeFormat2 = new SimpleDateFormat(\"dd/MM/yyyy\");\n String time2 = timeFormat2.format(date2);\n data.setText(time2);\n }",
"private static String timeHandler(String date) {\n SimpleDateFormat dbFormat = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'\");\n SimpleDateFormat dayFormat = new SimpleDateFormat(\"MM-dd\");\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm\");\n dbFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n String today = dayFormat.format(new Date());\n String day = \"\";\n String time = \"\";\n try {\n time = timeFormat.format(dbFormat.parse(date));\n day = dayFormat.format(dbFormat.parse(date));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n if (day.equals(today)) {\n return \"Today \" + time;\n } else if (day.equals(dayFormat.format(yesterday()))) {\n return \"Yesterday \" + time;\n } else {\n return day + \" \" + time;\n }\n }",
"public String retornaHora(){\n\t\tCalendar calendar = new GregorianCalendar();\n\t\tSimpleDateFormat hora = new SimpleDateFormat(\"HH\");\n\t\tSimpleDateFormat minuto = new SimpleDateFormat(\"mm\");\n\t\tDate date = new Date();\n\t\tcalendar.setTime(date);\n\t\treturn hora.format(calendar.getTime()) + \"h\" + minuto.format(calendar.getTime());\n\t}",
"DateTime getTime();",
"public String getDate(){\n return mDate;\n }",
"public static String TimeFormate() {\n\t\tString time;\n\t\tSimpleDateFormat dateFormat1 = new SimpleDateFormat();\n\t dateFormat1.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t Calendar cal = Calendar.getInstance();\n\t cal.add(Calendar.MINUTE, 3);\n String n=dateFormat1.format(cal.getTime());\n //n=\"03/09/20 8:30 AM\";\n System.out.println(\"Full Date = \" +n);\n int colonindex=n.indexOf(\":\");\n //System.out.println(\": placed= \" +colonindex);\n //String tt =n.substring(colonindex, n.length());\n //System.out.println(\"tt= \" +tt);\n String tt1 =n.substring(colonindex-2,colonindex-1);\n System.out.println(\"tt1= \" +tt1);\n if(tt1.equals(\"1\")) {\n \t time=n.substring(colonindex-2, n.length());\n \t System.out.println(\"Time with two digits in hours= \" +time);\n }\n else {\n \t time=n.substring(colonindex-1, n.length());\n \t System.out.println(\"Time with one digit in hours= \" +time);\n }\n return time;\n\t}",
"public DateHour(String dateHourRepresentation)\n\t{\n\t\tString[] arrString = dateHourRepresentation.split(\"/\");\n\t\tm_day = Integer.parseInt(arrString[0]);\n\t\tm_month = Integer.parseInt(arrString[1]);\n\t\tm_year = Integer.parseInt(arrString[2]);\n\t\tm_hour = Integer.parseInt(arrString[3]);\n\t}",
"public String getCurrentDateTimeHourMinSec() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}",
"public Date getdCreatetime() {\n return dCreatetime;\n }",
"public static String getDateString(){\n\t\t\tCalendar now = Calendar.getInstance();\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd__HH-mm-ss\");\n\t\t\treturn sdf.format(now.getTime());\n\t }",
"public static DateFormat defaultFormat() {\n return convertFormat(Locale.getDefault(), \"dd/MM/yyyy hh:mma\");\n }",
"Date getTimeField();",
"public final /* synthetic */ Object initialValue() {\n return new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\", Locale.US);\n }",
"public synchronized static DateFormat getDateTimeFormat()\n\t{\n\t\treturn DATE_TIME_FORMAT;\n\t}",
"protected void updateDate() {\r\n\t\tDate date = new Date();\r\n\t\tdate.setTime(mTime);\r\n\t\tDateFormat dateFormat = android.text.format.DateFormat.getDateFormat(getApplicationContext());\r\n\t\tString text = dateFormat.format(date);\r\n\t\tmDatePickerText.setText(text);\r\n\t}",
"public Date getCreate_time() {\n return create_time;\n }",
"public Date getCreate_time() {\n return create_time;\n }",
"public String dar_fecha(){\n Date date = new Date();\n DateFormat dateFormat = new SimpleDateFormat(\"dd/MM/yyyy\");\n return dateFormat.format(date).toString();\n\n }",
"public String getTime(DateTime date) {\n DateTimeFormatter time = DateTimeFormat.forPattern(\"hh:mm a\");\n return date.toString(time);\n }",
"private String setDate() {\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\n return sdf.format(new Date());\n }",
"public String getFormatDate()\n {\n return formatDate;\n }",
"public String getCurrentDateTimeHourMin() {\n\t\t\t\t// DateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\t\t\t// need to change after the date format is decided\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\t\t\tDate date = new Date();\n\t\t\t\treturn dateFormat.format(date);\n\t\t\t}",
"public SimpleDateFormat() {\n\t\tthis(getDefaultPattern(), null, null, null, null, true, null);\n\t}",
"String getDate();",
"String getDate();",
"public static Date getDateFromString(String date) {\r\n Date newdate = null;\r\n SimpleDateFormat dateformat = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\r\n\r\n try {\r\n newdate = dateformat.parse(date);\r\n System.out.println(newdate);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n\r\n return newdate;\r\n }",
"@Override\n\t\t\t\t\t\t\tpublic void onTimeSet(TimePicker view, int hourOfDay, int minute) {\n\t\t\t\t\t\t\t\tcalendar.set(Calendar.HOUR_OF_DAY,hourOfDay);\n\t\t\t\t\t\t\t\tcalendar.set(Calendar.MINUTE,minute);\n\t\t\t\t\t\t\t\tcalendar.set(Calendar.SECOND,0);\n\t\t\t\t\t\t\t\tdate=new SimpleDateFormat(\"yyyy/MM/dd hh:mm\").format(calendar.getTimeInMillis());\n\t\t\t\t\t\t\t\ttv_tiem.setText(date);\n\t\t\t\t\t\t\t}",
"private static String getDate()\n\t{\n\t\tString dateString = null;\n\t\tDate sysDate = new Date( System.currentTimeMillis() );\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"dd-MM-yy HH:mm:ss\");\n\t\tdateString = sdf.format(sysDate);\n\t\treturn dateString;\n\t}",
"public static Date parseDateTime(String val, int hour, int minute) {\n\n\t\tDate d = null;\n\t\tval = val + \" \" + hour + \":\" + minute;\n\t\tif (val != null && !val.equals(\"0\")) {\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd/MM/yyyy hh:mm\");\n\t\t\ttry {\n\t\t\t\td = format.parse(val);\n\t\t\t} catch (ParseException e) {\n\t\t\t}\n\t\t}\n\n\t\treturn d;\n\n\t}",
"public String getTimeString() {\n DateFormat format = new SimpleDateFormat(\"HH:mm\");\n return format.format(mDate);\n }"
] | [
"0.6952368",
"0.67616135",
"0.67616135",
"0.6727369",
"0.64684343",
"0.6461631",
"0.6453157",
"0.638278",
"0.63665843",
"0.63346124",
"0.6310908",
"0.6232839",
"0.62115616",
"0.62004954",
"0.61984307",
"0.6127236",
"0.60593325",
"0.6041708",
"0.60186374",
"0.59675765",
"0.5953449",
"0.59488857",
"0.59436184",
"0.5939989",
"0.5932658",
"0.5914461",
"0.5914313",
"0.5903604",
"0.5899689",
"0.5896078",
"0.5894343",
"0.58925885",
"0.58868355",
"0.58802843",
"0.5855975",
"0.5855743",
"0.5846269",
"0.5829047",
"0.58155876",
"0.5804508",
"0.57975274",
"0.5794224",
"0.57803506",
"0.57485974",
"0.574587",
"0.5728995",
"0.5728276",
"0.5712934",
"0.57054025",
"0.57039535",
"0.5697078",
"0.5688609",
"0.5680514",
"0.56781816",
"0.5676495",
"0.5675615",
"0.5672248",
"0.5667167",
"0.56571645",
"0.56401396",
"0.5639246",
"0.5629555",
"0.56258804",
"0.5611732",
"0.55987865",
"0.5590383",
"0.55861455",
"0.557098",
"0.55653524",
"0.5547859",
"0.5546735",
"0.5533468",
"0.55280906",
"0.5525748",
"0.55210763",
"0.55206656",
"0.55145997",
"0.5501786",
"0.5491249",
"0.54804516",
"0.5479943",
"0.5476631",
"0.5470873",
"0.5469759",
"0.5467832",
"0.5460602",
"0.54526633",
"0.54526633",
"0.5450269",
"0.5449924",
"0.54483443",
"0.5446879",
"0.54441494",
"0.5442151",
"0.5434161",
"0.5434161",
"0.5429207",
"0.5428839",
"0.542563",
"0.5425445",
"0.5417393"
] | 0.0 | -1 |
Long to Byte Converters | public static byte[] longToBytes(long x) {
ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES);
buffer.putLong(x);
return buffer.array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public native static long getConvertBytes();",
"public byte[] l2b(long value) {\n byte[] data = new byte[8];\n data[0] = (byte) ((value >> 56) & 0xFF);\n data[1] = (byte) ((value >> 48) & 0xFF);\n data[2] = (byte) ((value >> 40) & 0xFF);\n data[3] = (byte) ((value >> 32) & 0xFF);\n data[4] = (byte) ((value >> 24) & 0xFF);\n data[5] = (byte) ((value >> 16) & 0xFF);\n data[6] = (byte) ((value >> 8) & 0xFF);\n data[7] = (byte) (value & 0xFF);\n return data;\n }",
"public static byte[] convertLong(long v, boolean isLE)\r\n {\r\n byte[] bytes = new byte[8];\r\n if (isLE)\r\n {\r\n bytes[0] = (byte) (v >>> 0);\r\n bytes[1] = (byte) (v >>> 8);\r\n bytes[2] = (byte) (v >>> 16);\r\n bytes[3] = (byte) (v >>> 24);\r\n bytes[4] = (byte) (v >>> 32);\r\n bytes[5] = (byte) (v >>> 40);\r\n bytes[6] = (byte) (v >>> 48);\r\n bytes[7] = (byte) (v >>> 56);\r\n }\r\n else\r\n {\r\n bytes[0] = (byte) (v >>> 56);\r\n bytes[1] = (byte) (v >>> 48);\r\n bytes[2] = (byte) (v >>> 40);\r\n bytes[3] = (byte) (v >>> 32);\r\n bytes[4] = (byte) (v >>> 24);\r\n bytes[5] = (byte) (v >>> 16);\r\n bytes[6] = (byte) (v >>> 8);\r\n bytes[7] = (byte) (v >>> 0);\r\n }\r\n return bytes;\r\n }",
"public static byte[] toBytes(long val) {\n byte [] b = new byte[8];\n for (int i = 7; i > 0; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n b[0] = (byte) val;\n return b;\n }",
"private long convertByteValueToLong(byte[] b) {\n long m = 0;\n for (int i = 0; i < b.length; i++) {\n m = m * 256 + (b[i] < 0 ? (256 + (long) b[i]) : b[i]);\n }\n return m;\n }",
"private long byteToLong(byte b)\n\t{\n\t\treturn (b & 0xFF);\n\t}",
"long decodeLong();",
"static byte[] long2byteArray(long number, int length, boolean swapHalfWord) {\n }",
"public static byte[] getLongAsBytes(long l) {\n\t\treturn new byte[] {\n\t\t\t\t(byte) (l >> 56),\n\t\t\t\t(byte) (l >> 48),\n\t\t\t\t(byte) (l >> 40),\n\t\t\t\t(byte) (l >> 32),\n\t\t\t\t(byte) (l >> 24),\n\t\t\t\t(byte) (l >> 16),\n\t\t\t\t(byte) (l >> 8),\n\t\t\t\t(byte) l\n\t\t\t};\n\t}",
"public long toLong()\n\t{\n\t\t// holds the int to return\n\t\tlong result = 0;\n\t\t\n\t\t// for every byte value\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\t// Extract the bits out of the array by \"and\"ing them with the\n\t\t\t// maximum value of\n\t\t\t// a byte. This is done because java does not support unsigned\n\t\t\t// types. Now that the\n\t\t\t// unsigned byte has been extracted, shift it to the right as far as\n\t\t\t// it is needed.\n\t\t\t// Examples:\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x00} = 256\n\t\t\t//\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x8C 0xF0} = 0x018CF0\n\t\t\tresult += (byteToLong(bytes[i]) << (Byte.SIZE * (bytes.length - i - 1)));\n\t\t}\n\t\t\n\t\t// return the int\n\t\treturn result;\n\t}",
"private static final byte[] longToByteArray(long l) {\n\t\tbyte[] retVal = new byte[8];\n\n\t\tfor (int i = 0; i < 8; i++) {\n\t\t\tretVal[i] = (byte) l;\n\t\t\tl >>= 8;\n\t\t}\n\n\t\treturn retVal;\n\t}",
"public static byte[] longToBytes(long l) {\n\n ByteBuffer byteBuffer = ByteBuffer.allocate(NUM_BYTES_IN_LONG);\n byteBuffer.putLong(l);\n return byteBuffer.array();\n\n }",
"public synchronized static byte [] LongToBytes ( long ldata, int n )\n {\n byte buff[] = new byte [ n ];\n\n for ( int i=n-1; i>=0; i--)\n {\n // Keep assigning the right most 8 bits to the\n // byte arrays while shift 8 bits during each iteration\n buff [ i ] = (byte) ldata;\n ldata = ldata >> 8;\n }\n return buff;\n }",
"public static byte[] getBytes(long value) {\r\n\t\treturn ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(value).array();\r\n\t}",
"static Number bytesAsGB(Long numBytes) {\n\t\tif(numBytes == null || numBytes == 0L) {\n\t\t\treturn numBytes;\n\t\t}\n\t\tdouble value = new Double(numBytes) / ONE_GIGABYTE;\n\t\tif(value % 1 == 0) {\n\t\t\treturn (long) (double) value;\n\t\t} else {\n\t\t\treturn value;\n\t\t}\n\t}",
"private byte[] toByte(long address) {\n byte[] addressInBytes = new byte[]{\n (byte) (address >> 40 & 0xff),\n (byte) (address >> 32 & 0xff),\n (byte) (address >> 24 & 0xff),\n (byte) (address >> 16 & 0xff),\n (byte) (address >> 8 & 0xff),\n (byte) (address >> 0 & 0xff)\n };\n return addressInBytes;\n }",
"public static long convertToLong(byte[] longBuffer)\r\n {\r\n if (longBuffer.length >= 8)\r\n {\r\n return (((long) longBuffer[0] << 56)\r\n + ((long) (longBuffer[1] & 255) << 48)\r\n + ((long) (longBuffer[2] & 255) << 40)\r\n + ((long) (longBuffer[3] & 255) << 32)\r\n + ((long) (longBuffer[4] & 255) << 24)\r\n + ((longBuffer[5] & 255) << 16)\r\n + ((longBuffer[6] & 255) << 8) + ((longBuffer[7] & 255) << 0));\r\n }\r\n return 0;\r\n }",
"public static byte[] toBytes(final long number) {\n\t\treturn new byte[] {\n\t\t\t(byte) (number >>> 56),\n\t\t\t(byte) (number >>> 48),\n\t\t\t(byte) (number >>> 40),\n\t\t\t(byte) (number >>> 32),\n\t\t\t(byte) (number >>> 24),\n\t\t\t(byte) (number >>> 16),\n\t\t\t(byte) (number >>> 8),\n\t\t\t(byte) (number)\n\t\t};\n\t}",
"private static BIG byte_to_BIG(byte [] array){\n BIG result = new BIG();\n long[] long_ = new long[4];\n for(int i=long_.length; i > 0;i--){\n long_[i-1] =\n ((array[i*7-3] & 0xFFL) << 48) |\n ((array[i*7-2] & 0xFFL) << 40) |\n ((array[i*7-1] & 0xFFL) << 32) |\n ((array[i*7] & 0xFFL) << 24) | \n ((array[i*7+1] & 0xFFL) << 16) | \n ((array[i*7+2] & 0xFFL) << 8) | \n ((array[i*7+3] & 0xFFL) << 0) ; \n }\n int int_ = \n (int) (((array[0] & 0xFFL) << 24) |\n\t\t ((array[1] & 0xFFL) << 16) |\n\t\t ((array[2] & 0xFFL) << 8) |\n\t\t ((array[3] & 0xFFL) << 0)) ;\n \n long[] temp = {long_[3],long_[2],long_[1],long_[0],int_};\n\n result = new BIG(temp);\n return result;\n }",
"public static byte[] longToByteArray_ASN1_Value(long toBeConverted) {\n\t\t\t\n\t\t\t//create the temporary version of what will be returned\n\t\t\tbyte[] tempToBeReturned = {\n\t\t\t\t\t(byte)(toBeConverted >> 56),\n\t\t\t\t\t(byte)(toBeConverted >> 48),\n\t\t\t\t\t(byte)(toBeConverted >> 40),\n\t\t\t\t\t(byte)(toBeConverted >> 32),\n\t\t\t\t\t(byte)(toBeConverted >> 24),\n\t\t\t\t\t(byte)(toBeConverted >> 16),\n\t\t\t\t\t(byte)(toBeConverted >> 8),\n\t\t\t\t\t(byte)toBeConverted};\n\t\t\t\n\t\t\t\n\t\t\t//converting positive long values\n\t\t\tif(toBeConverted >= 0) {\n\t\t\t\t//0 to 127: return only one octet\n\t\t\t\tif(toBeConverted<=127) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//128 to 32768-1 return two octets\n\t\t\t\telse if(toBeConverted<=32767) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//32767 to 8388607 return three octets\n\t\t\t\telse if(toBeConverted<=8388607) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//8388608 to 2147483647 return four octets\n\t\t\t\telse if(toBeConverted<=2147483647) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//2147483648 to 549755813887 return five octets\n\t\t\t\telse if((Long.compare(toBeConverted, 549755813888L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//549755813888 to 140737488355327 return six octets\n\t\t\t\telse if((Long.compare(toBeConverted, 140737488355328L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//140737488355328 to 36028797018963967 return seven octets\n\t\t\t\telse if((Long.compare(toBeConverted, 36028797018963967L))<0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//above: return eight octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//converting negative long values\n\t\t\telse if(toBeConverted<0) {\n\t\t\t\t//-1 to -128 1 octet \n\t\t\t\tif(toBeConverted>=-128) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[1];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[7];\t\t\t\t\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-129 to -32768 2 octets\n\t\t\t\telse if(toBeConverted>=-32768) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[2];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[6];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-32769 to -8388608 3 octets\n\t\t\t\telse if(toBeConverted>=-8388608) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[3];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[5];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//-8388609 to -2147483648 4 octets\n\t\t\t\telse if(toBeConverted>=-2147483648) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[4];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[4];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//the value 0 if x == y; a value less than 0 if x < y; and a value greater than 0 if x > y\n\t\t\t\t//-2147483649 to -549755813888 5 octets \n\t\t\t\telse if((Long.compare(toBeConverted, -549755813889L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[5];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[3];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-549755813889 to -140737488355328 6 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -140737488355329L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[6];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[2];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//-140737488355329 to 36028797018963968 7 octets\n\t\t\t\telse if((Long.compare(toBeConverted, -36028797018963969L))>0) {\n\t\t\t\t\tbyte[] toBeReturned = new byte[7];\n\t\t\t\t\ttoBeReturned[0] = tempToBeReturned[1];\t\t\t\t\n\t\t\t\t\ttoBeReturned[1] = tempToBeReturned[2];\n\t\t\t\t\ttoBeReturned[2] = tempToBeReturned[3];\n\t\t\t\t\ttoBeReturned[3] = tempToBeReturned[4];\n\t\t\t\t\ttoBeReturned[4] = tempToBeReturned[5];\n\t\t\t\t\ttoBeReturned[5] = tempToBeReturned[6];\n\t\t\t\t\ttoBeReturned[6] = tempToBeReturned[7];\n\t\t\t\t\treturn toBeReturned;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//below that: 8 octets\n\t\t\t\telse {\n\t\t\t\t\treturn tempToBeReturned;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//if method fails for any reason, it returns null\n\t\t\treturn null;\n\t\t}",
"public static void longToByteArray(long value, byte[] buffer, int offset) {\n buffer[offset] = (byte) (value >> 56 & 0xFF);\n buffer[offset + 1] = (byte) (value >> 48 & 0xFF);\n buffer[offset + 2] = (byte) (value >> 40 & 0xFF);\n buffer[offset + 3] = (byte) (value >> 32 & 0xFF);\n buffer[offset + 4] = (byte) (value >> 24 & 0xFF);\n buffer[offset + 5] = (byte) (value >> 16 & 0xFF);\n buffer[offset + 6] = (byte) (value >> 8 & 0xFF);\n buffer[offset + 7] = (byte) (value & 0xFF);\n }",
"public static void main(String[] args) {\n\t\tbyte aByte = (byte) 0b00100001;\r\n\r\n\t\t// A 16-bit 'short' value:\r\n\t\tshort aShort = (short) 0b1010000101000101;\r\n\r\n\t\t// Some 32-bit 'int' values:\r\n\t\tint anInt1 = 0b10100001010001011010000101000101;\r\n\t\tint anInt2 = 0b101;\r\n\t\tint anInt3 = 0B101; // The B can be upper or lower case.\r\n\r\n\t\t// A 64-bit 'long' value. Note the \"L\" suffix:\r\n\t\tlong aLong = 0b1010000101000101101000010100010110100001010001011010000101000101L;\r\n\t}",
"byte[] IntToByte(int i)\r\n {\r\n return Integer.toString(i).getBytes();\r\n }",
"public byte getByte(String key) {\n Object value = get(key);\n return ((value instanceof Long) ? (byte)((Long)value).intValue() : 0);\n }",
"byte toByteValue() {\n return (byte) value;\n }",
"@SuppressWarnings(\"cast\")\n public static long makeLong(int b1, int b2, int b3, int b4, int b5, int b6, int b7, int b8) {\n return ((long) b1 << 56) +\n ((long) (b2 & 255) << 48) +\n ((long) (b3 & 255) << 40) +\n ((long) (b4 & 255) << 32) +\n ((long) (b5 & 255) << 24) +\n (long) ((b6 & 255) << 16) +\n (long) ((b7 & 255) << 8) +\n (long) ((b8 & 255));\n }",
"public static byte[] toBytes(final long... numbers) {\n\t\tbyte[] bytes = new byte[numbers.length * 8];\n\t\tfor (int i = 0, j = 0; i < numbers.length; i++, j += 8) {\n\t\t\tSystem.arraycopy(toBytes(numbers[i]), 0, bytes, j, 8);\n\t\t}\n\t\treturn bytes;\n\t}",
"private static long bytesToMega(long bytes) {\n return bytes / MEGABYTE;\n }",
"@Test\n public void testFromLong() throws Exception {\n assertEquals(\"1 a\", undertest2.fromLong(0));\n // 0b100 => 0b10->1->\"2\", 0b0->0->\"a\"\n assertEquals(\"2 a\", undertest2.fromLong(1));\n // 0b010 => 0b01->2->\"3\", 0b0->0->\"a\"\n assertEquals(\"3 a\", undertest2.fromLong(2));\n // 0b110 => 0b11->3->\"4\", 0b0->0->\"a\"\n assertEquals(\"4 a\", undertest2.fromLong(3));\n // 0b001 => 0b00->0->\"1\", 0b1->1->\"b\"\n assertEquals(\"1 b\", undertest2.fromLong(4));\n // 0b101 => 0b10->1->\"2\", 0b1->1->\"b\"\n assertEquals(\"2 b\", undertest2.fromLong(5));\n // 0b011 => 0b01->2->\"3\", 0b1->1->\"b\"\n assertEquals(\"3 b\", undertest2.fromLong(6));\n // 0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromLong(7));\n // 255l->0b11111111->0b111 => 0b11->3->\"4\", 0b1->1->\"b\"\n assertEquals(\"4 b\", undertest2.fromLong(255));\n }",
"public static byte[] LongToOpaque(long number) { \n long temp = number; \n byte[] b = new byte[16]; //0-7 time stamp, 8-15 customized \n for (int i = 0; i < 8; i++) { \n b[i] = new Long(temp & 0xff).byteValue();\n temp = temp >> 8; // right shift 8\n } \n return b; \n }",
"public int toByte(){\n return toByte(0);\n }",
"long mo25074b();",
"public static void main(String[] args) {\n\n byte byteVal = 5;\n short shortVal = 10;\n int intVal = 100;\n long longVal = 50000L + (byteVal + shortVal + intVal) * 10L;\n\n System.out.println(longVal);\n\n }",
"public static double toMegaByte(long bytes) {\n return (bytes / (double) (1024 * 1024));\n }",
"public Byte _parseByte(JsonParser jVar, DeserializationContext gVar) throws IOException {\n JsonToken l = jVar.mo29328l();\n if (l == JsonToken.VALUE_STRING) {\n String trim = jVar.mo29334t().trim();\n if (_hasTextualNull(trim)) {\n return (Byte) _coerceTextualNull(gVar, this._primitive);\n }\n if (trim.length() == 0) {\n return (Byte) _coerceEmptyString(gVar, this._primitive);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n try {\n int a = NumberInput.m23779a(trim);\n if (_byteOverflow(a)) {\n return (Byte) gVar.mo31517b(this._valueClass, trim, \"overflow, value cannot be represented as 8-bit value\", new Object[0]);\n }\n return Byte.valueOf((byte) a);\n } catch (IllegalArgumentException unused) {\n return (Byte) gVar.mo31517b(this._valueClass, trim, \"not a valid Byte value\", new Object[0]);\n }\n } else if (l == JsonToken.VALUE_NUMBER_FLOAT) {\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"Byte\");\n }\n return Byte.valueOf(jVar.mo29335A());\n } else if (l == JsonToken.VALUE_NULL) {\n return (Byte) _coerceNullToken(gVar, this._primitive);\n } else {\n if (l == JsonToken.START_ARRAY) {\n return (Byte) _deserializeFromArray(jVar, gVar);\n }\n if (l == JsonToken.VALUE_NUMBER_INT) {\n return Byte.valueOf(jVar.mo29335A());\n }\n return (Byte) gVar.mo31493a(this._valueClass, jVar);\n }\n }",
"private int byteToInt(byte b) { int i = b & 0xFF; return i; }",
"private static byte int2(int x) { return (byte)(x >> 16); }",
"public int toByte(int dontCareValue){\n if(dontCareValue != 0 && dontCareValue != 1){\n throw new IllegalArgumentException(\"dontCareValue must be 0 or 1\");\n }\n int bite = 0;\n for(int idx = LENGTH - 1; idx >= 0; idx--){\n int bit;\n switch(value[idx]){\n case ZERO: bit = 0; break;\n case ONE: bit = 1; break;\n default: bit = dontCareValue; break;\n }\n bite |= bit;\n bite <<= 1;\n }\n //During conversion, we shifted one too many.\n return bite >> 1;\n }",
"private Integer extractByteFromLong(final Long longvalue, final Byte offset) {\n\t\tfinal Long mask = 0xFFL << ((long) offset * 0x8L);\n\t\tfinal Long tmpval = longvalue & mask;\n\t\tfinal Long ret = (tmpval >>> ((long) offset * 0x8L));\n\t\treturn ret.intValue();\n\t}",
"public static Bytes bytes(final long bytes)\n\t{\n\t\treturn new Bytes(bytes);\n\t}",
"public void printLongBinary(long l) {\n\t}",
"public static long getBytesAsLong(byte[] b) {\n\t\treturn ((long) (b[0] & 0xff) << 56)\n\t\t\t\t| ((long) (b[1] & 0xFF) << 48)\n\t\t\t\t| ((long) (b[2] & 0xFF) << 40)\n\t\t\t\t| ((long) (b[3] & 0xFF) << 32)\n\t\t\t\t| ((long) (b[4] & 0xFF) << 24)\n\t\t\t\t| ((long) (b[5] & 0xFF) << 16)\n\t\t\t\t| ((long) (b[6] & 0xFF) << 8)\n\t\t\t\t| ((long) (b[7] & 0xFF));\n\t}",
"byte mo25264b(int i);",
"public void testToByte(){\t\r\n\t\t\r\n\t\tbyte[] lRes = ByteUtil.intToByteArray(fIntToTest);\r\n\t\t\r\n\t\tfor(int lCnt =0; lCnt< lRes.length; lCnt++){\r\n\t\t\tassertEquals(lRes[lCnt], fIntToTestByteArray[lCnt]);\r\n\t\t}\r\n\t\t\r\n\t}",
"public static byte[] longToByteArray(long value, int valueSize, int length) {\n long val = value;\n // Convert the long to 8-byte BE representation\n byte[] b = new byte[8];\n for (int i = 7; i >= 0 && val != 0L; i--) {\n b[i] = (byte) val;\n val >>>= 8;\n }\n // Then copy the rightmost valueSize bytes\n // e.g., for an integer we want rightmost 4 bytes\n return Arrays.copyOfRange(b, 8 - valueSize, 8 + length - valueSize);\n }",
"Long mo20729a();",
"public static long toInt64(byte[] value) {\r\n\t\treturn toInt16(value, 0);\r\n\t}",
"final byte getByte(int column) {\n switch (jdbcTypes_[column - 1]) {\n case Types.BOOLEAN:\n return CrossConverters.getByteFromBoolean(get_BOOLEAN(column));\n case Types.SMALLINT:\n int smallInt = get_SMALLINT(column);\n if (smallInt > Byte.MAX_VALUE || smallInt < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + smallInt);\n return (byte) smallInt;\n case Types.INTEGER:\n int i = get_INTEGER(column);\n if (i > Byte.MAX_VALUE || i < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + i);\n return (byte) i;\n case Types.BIGINT:\n long l = get_BIGINT(column);\n if (l > Byte.MAX_VALUE || l < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + l);\n return (byte) l;\n case Types.REAL:\n float f = get_FLOAT(column);\n if (f > Byte.MAX_VALUE || f < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + f);\n return (byte) f;\n case Types.DOUBLE:\n double d = get_DOUBLE(column);\n if (d > Byte.MAX_VALUE || d < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + d);\n return (byte) d;\n case Types.DECIMAL:\n // For performance we don't materialize the BigDecimal, but convert directly from decimal bytes to a long.\n long ld = getLongFromDECIMAL(column, \"byte\");\n if (ld > Byte.MAX_VALUE || ld < Byte.MIN_VALUE)\n throw new IllegalArgumentException(\"Value outside of byte range: \" + ld);\n return (byte) ld;\n case Types.CHAR:\n return CrossConverters.getByteFromString(get_CHAR(column));\n case Types.VARCHAR:\n case Types.LONGVARCHAR:\n return CrossConverters.getByteFromString(get_VARCHAR(column));\n default:\n throw coercionError( \"byte\", column );\n }\n }",
"private long getUnsigned(byte b) {\n\t\tif(b>=0)\n\t\t\treturn b;\n\t\treturn 256+b;\n\t\t\n\t}",
"private static byte[] getBytes(int val) {\n log.log(Level.FINEST, String.format(\"%d\", val));\n byte[] ret = new byte[NekoIOConstants.INT_LENGTH];\n for (int i = 0; i < NekoIOConstants.INT_LENGTH; i++) {\n if (NekoIOConstants.BIG_ENDIAN) {\n ret[NekoIOConstants.INT_LENGTH - 1 - i] = (byte) val;\n } else {\n ret[i] = (byte) val;\n }\n val >>= 8;\n }\n return ret;\n }",
"private void toDec(){\n\t\tlong temp = Long.parseLong(binary.substring(binary.length()/2, binary.length()));\n\t\tlong tempbin = 0;\n\t\tint j = 0;//splits the string in half with 2 for loops \n\t\tfor (int i = 0; i < binary.length()/2;i++){//second half of string\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));//convert binary to dec adding as it runs\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\ttemp = Long.parseLong(binary.substring(0, binary.length()/2));//first half of string\n\t\tfor (int i = 0; i <= binary.length()/2;i++){\n\t\t\ttempbin+=((long)(Math.pow(2,j))*(temp%10));\n\t\t\ttemp/=10;\n\t\t\tj++;\n\t\t}\n\t\tbinary = Long.toString(tempbin);\n\t}",
"private static int getBytes(long r23) {\n /*\n java.lang.ThreadLocal<byte[]> r0 = TEMP_NUMBER_BUFFER\n java.lang.Object r0 = r0.get()\n byte[] r0 = (byte[]) r0\n r1 = 20\n if (r0 != 0) goto L_0x0013\n byte[] r0 = new byte[r1]\n java.lang.ThreadLocal<byte[]> r2 = TEMP_NUMBER_BUFFER\n r2.set(r0)\n L_0x0013:\n r2 = -9223372036854775808\n r4 = 54\n r5 = 57\n r6 = 45\n r7 = 53\n r8 = 56\n r9 = 55\n r10 = 51\n r11 = 50\n r12 = 0\n r13 = 48\n r14 = 1\n int r15 = (r23 > r2 ? 1 : (r23 == r2 ? 0 : -1))\n if (r15 != 0) goto L_0x0076\n r0[r12] = r6\n r0[r14] = r5\n r2 = 2\n r0[r2] = r11\n r2 = 3\n r0[r2] = r11\n r2 = 4\n r0[r2] = r10\n r2 = 5\n r0[r2] = r10\n r2 = 6\n r0[r2] = r9\n r2 = 7\n r0[r2] = r11\n r2 = 8\n r0[r2] = r13\n r2 = 9\n r0[r2] = r10\n r2 = 10\n r0[r2] = r4\n r2 = 11\n r0[r2] = r8\n r2 = 12\n r0[r2] = r7\n r2 = 13\n r3 = 52\n r0[r2] = r3\n r2 = 14\n r0[r2] = r9\n r2 = 15\n r0[r2] = r9\n r2 = 16\n r0[r2] = r7\n r2 = 17\n r0[r2] = r8\n r2 = 18\n r0[r2] = r13\n r2 = 19\n r0[r2] = r8\n return r1\n L_0x0076:\n r1 = 0\n int r3 = (r23 > r1 ? 1 : (r23 == r1 ? 0 : -1))\n if (r3 != 0) goto L_0x007f\n r0[r12] = r13\n return r14\n L_0x007f:\n if (r3 >= 0) goto L_0x0088\n r0[r12] = r6\n long r15 = java.lang.Math.abs(r23)\n goto L_0x008b\n L_0x0088:\n r14 = 0\n r15 = r23\n L_0x008b:\n r17 = 9\n r19 = 10\n r21 = 1\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0099\n r17 = r21\n goto L_0x017e\n L_0x0099:\n r17 = 99\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00a3\n r17 = r19\n goto L_0x017e\n L_0x00a3:\n r17 = 999(0x3e7, double:4.936E-321)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00ad\n r17 = 100\n goto L_0x017e\n L_0x00ad:\n r17 = 9999(0x270f, double:4.94E-320)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00b7\n r17 = 1000(0x3e8, double:4.94E-321)\n goto L_0x017e\n L_0x00b7:\n r17 = 99999(0x1869f, double:4.9406E-319)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00c2\n r17 = 10000(0x2710, double:4.9407E-320)\n goto L_0x017e\n L_0x00c2:\n r17 = 999999(0xf423f, double:4.94065E-318)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00ce\n r17 = 100000(0x186a0, double:4.94066E-319)\n goto L_0x017e\n L_0x00ce:\n r17 = 9999999(0x98967f, double:4.940656E-317)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00da\n r17 = 1000000(0xf4240, double:4.940656E-318)\n goto L_0x017e\n L_0x00da:\n r17 = 99999999(0x5f5e0ff, double:4.9406564E-316)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00e6\n r17 = 10000000(0x989680, double:4.9406565E-317)\n goto L_0x017e\n L_0x00e6:\n r17 = 999999999(0x3b9ac9ff, double:4.940656453E-315)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x00f2\n r17 = 100000000(0x5f5e100, double:4.94065646E-316)\n goto L_0x017e\n L_0x00f2:\n r17 = 9999999999(0x2540be3ff, double:4.940656458E-314)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0100\n r17 = 1000000000(0x3b9aca00, double:4.94065646E-315)\n goto L_0x017e\n L_0x0100:\n r17 = 99999999999(0x174876e7ff, double:4.94065645836E-313)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0110\n r17 = 10000000000(0x2540be400, double:4.9406564584E-314)\n goto L_0x017e\n L_0x0110:\n r17 = 999999999999(0xe8d4a50fff, double:4.940656458408E-312)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x011f\n r17 = 100000000000(0x174876e800, double:4.9406564584E-313)\n goto L_0x017e\n L_0x011f:\n r17 = 9999999999999(0x9184e729fff, double:4.940656458412E-311)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x012e\n r17 = 1000000000000(0xe8d4a51000, double:4.94065645841E-312)\n goto L_0x017e\n L_0x012e:\n r17 = 99999999999999(0x5af3107a3fff, double:4.9406564584124E-310)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x013d\n r17 = 10000000000000(0x9184e72a000, double:4.9406564584125E-311)\n goto L_0x017e\n L_0x013d:\n r17 = 999999999999999(0x38d7ea4c67fff, double:4.94065645841246E-309)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x014c\n r17 = 100000000000000(0x5af3107a4000, double:4.94065645841247E-310)\n goto L_0x017e\n L_0x014c:\n r17 = 9999999999999999(0x2386f26fc0ffff, double:5.431165199810527E-308)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x015b\n r17 = 1000000000000000(0x38d7ea4c68000, double:4.940656458412465E-309)\n goto L_0x017e\n L_0x015b:\n r17 = 99999999999999999(0x16345785d89ffff, double:5.620395787888204E-302)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x016a\n r17 = 10000000000000000(0x2386f26fc10000, double:5.431165199810528E-308)\n goto L_0x017e\n L_0x016a:\n r17 = 999999999999999999(0xde0b6b3a763ffff, double:7.832953389245684E-242)\n int r3 = (r15 > r17 ? 1 : (r15 == r17 ? 0 : -1))\n if (r3 > 0) goto L_0x0179\n r17 = 100000000000000000(0x16345785d8a0000, double:5.620395787888205E-302)\n goto L_0x017e\n L_0x0179:\n r17 = 1000000000000000000(0xde0b6b3a7640000, double:7.832953389245686E-242)\n L_0x017e:\n long r1 = r15 / r17\n int r3 = (int) r1\n switch(r3) {\n case 0: goto L_0x01b6;\n case 1: goto L_0x01af;\n case 2: goto L_0x01aa;\n case 3: goto L_0x01a5;\n case 4: goto L_0x019e;\n case 5: goto L_0x0199;\n case 6: goto L_0x0194;\n case 7: goto L_0x018f;\n case 8: goto L_0x018a;\n case 9: goto L_0x0185;\n default: goto L_0x0184;\n }\n L_0x0184:\n goto L_0x01bb\n L_0x0185:\n int r3 = r14 + 1\n r0[r14] = r5\n goto L_0x01ba\n L_0x018a:\n int r3 = r14 + 1\n r0[r14] = r8\n goto L_0x01ba\n L_0x018f:\n int r3 = r14 + 1\n r0[r14] = r9\n goto L_0x01ba\n L_0x0194:\n int r3 = r14 + 1\n r0[r14] = r4\n goto L_0x01ba\n L_0x0199:\n int r3 = r14 + 1\n r0[r14] = r7\n goto L_0x01ba\n L_0x019e:\n int r3 = r14 + 1\n r6 = 52\n r0[r14] = r6\n goto L_0x01ba\n L_0x01a5:\n int r3 = r14 + 1\n r0[r14] = r10\n goto L_0x01ba\n L_0x01aa:\n int r3 = r14 + 1\n r0[r14] = r11\n goto L_0x01ba\n L_0x01af:\n int r3 = r14 + 1\n r6 = 49\n r0[r14] = r6\n goto L_0x01ba\n L_0x01b6:\n int r3 = r14 + 1\n r0[r14] = r13\n L_0x01ba:\n r14 = r3\n L_0x01bb:\n int r3 = (r17 > r21 ? 1 : (r17 == r21 ? 0 : -1))\n if (r3 != 0) goto L_0x01c0\n goto L_0x01d8\n L_0x01c0:\n java.lang.Long.signum(r17)\n long r1 = r1 * r17\n long r15 = r15 - r1\n r1 = 0\n int r3 = (r15 > r1 ? 1 : (r15 == r1 ? 0 : -1))\n if (r3 != 0) goto L_0x01d9\n L_0x01cc:\n int r1 = (r17 > r21 ? 1 : (r17 == r21 ? 0 : -1))\n if (r1 <= 0) goto L_0x01d8\n int r1 = r14 + 1\n r0[r14] = r13\n long r17 = r17 / r19\n r14 = r1\n goto L_0x01cc\n L_0x01d8:\n return r14\n L_0x01d9:\n long r17 = r17 / r19\n goto L_0x017e\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.unboundid.util.ByteStringBuffer.getBytes(long):int\");\n }",
"byte mo30283c();",
"long readLong();",
"public static String binConvertInt(long num) {\n\t\tString binString = \"\";\n\n\t\t// ORIGINAL CODE FOR INT BINCONVERT\n\n\t\tlong binary = 0;\n\t\tint count = 0;\n\n\t\tif (num >= 0) {\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t}\n\n\t\telse {\n\n\t\t\tnum = -1 * num;\n\n\t\t\twhile (num > 0) {\n\t\t\t\tbinary = num % 2;\n\t\t\t\tif (binary == 1) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\n\t\t\t\tbinString = binary + \"\" + binString;\n\t\t\t\tnum = num / 2;\n\t\t\t}\n\n\t\t\t// flip the binary to negative conversion\n\n\t\t\tchar ch[] = binString.toCharArray();\n\t\t\tboolean addedOne = false;\n\n\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\tif (ch[i] == '0') {\n\t\t\t\t\tch[i] = '1';\n\t\t\t\t} else {\n\t\t\t\t\tch[i] = '0';\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (ch[binString.length() - 1] == '0') {\n\n\t\t\t\tch[binString.length() - 1] = '1';\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tch[binString.length() - 1] = '0';\n\t\t\t\tfor (int i = binString.length() - 1; i >= 0; i--) {\n\t\t\t\t\tif(ch[i] == '1') {\n\t\t\t\t\t\tch[i] = '0';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tch[i] = '1';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\tbinString = new String(ch);\n\t\t}\n\n\t\t\n\t\treturn binString;\n\t}",
"public static String byteConvertToLabel(final long value) {\r\n\t\tfinal long[] dividers = new long[] { T, G, M, K, 1 };\r\n\t\tfinal String[] units = new String[] { \"TB\", \"GB\", \"MB\", \"KB\", \"B\" };\r\n\t\tif (value < 0)\r\n\t\t\tthrow new IllegalArgumentException(\"Invalid file size: \" + value);\r\n\t\tString result = null;\r\n\t\tfor (int i = 0; i < dividers.length; i++) {\r\n\t\t\tfinal long divider = dividers[i];\r\n\t\t\tif (value >= divider) {\r\n\t\t\t\tresult = decimalFormatLabel(value, divider, units[i]);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"private static final void encodeBEInt(int paramInt1, byte[] paramArrayOfByte, int paramInt2)\r\n/* 137: */ {\r\n/* 138:209 */ paramArrayOfByte[(paramInt2 + 0)] = ((byte)(paramInt1 >>> 24));\r\n/* 139:210 */ paramArrayOfByte[(paramInt2 + 1)] = ((byte)(paramInt1 >>> 16));\r\n/* 140:211 */ paramArrayOfByte[(paramInt2 + 2)] = ((byte)(paramInt1 >>> 8));\r\n/* 141:212 */ paramArrayOfByte[(paramInt2 + 3)] = ((byte)paramInt1);\r\n/* 142: */ }",
"public static long byteToUnsignedLong(byte b) {\n return b & 0xff;\n }",
"byte decodeByte();",
"public static void main(String[] args) {\n byte b1=125;\n System.out.println(b1);\n byte b2=(byte)129;\n System.out.println(b2);\t\t\n\t}",
"public static double bitsToBytes(double num) { return (num/8); }",
"public static long consecutiveBytesAsLong(byte... bytes) {\r\n\t\tlong result = 0;\r\n\t\tfor(int i=0; i<bytes.length; i++) {\r\n\t\t\tint shiftFactor = 8 * (bytes.length - (i + 1));\r\n\t\t\tresult += bytes[i] << shiftFactor;\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public static double yottaBytesToBits(double num) { return gigaBitsToBits(yottaBytesToGigaBits(num)); }",
"public static String bytesToMegaBytes(long bytes) {\n double megaBytes = (double) bytes / (double) MEGABYTES_DIVIDER;\n return new DecimalFormat(\"##0.00\").format(megaBytes) + \" MB\";\n }",
"public long encode(long value) {\n\n return value ^ (value >> 1);\n }",
"@Test\n public void formatBytesReturnBytesTest() {\n assertEquals(\"-20 Bytes\", Format.formatBytes(-20));\n long almostOneKbyte = 1023L;\n assertEquals(\"1,023 Bytes\", Format.formatBytes(almostOneKbyte));\n }",
"static StringBuilder convert_to_binary(String msg) {\n byte[] bytes = msg.getBytes();\r\n StringBuilder binary = new StringBuilder();\r\n for (byte b : bytes) {\r\n int val = b;\r\n for (int i = 0; i < 8; i++) {\r\n binary.append((val & 128) == 0 ? 0 : 1);\r\n val <<= 1;\r\n }\r\n binary.append(\"\");\r\n }\r\n return binary;\r\n }",
"public static byte[] intToByte(int i) {\n return new byte[] {(byte)(i>>24), (byte)(i>>16), (byte)(i>>8), (byte)i};\n }",
"C3197iu mo30281b(long j);",
"public int getUByte() { return bb.get() & 0xff; }",
"long mo107678c(Integer num);",
"public static void main(String[] args) {\n\t\tbyte bs = -127;\n\t\t\n\t\tSystem.out.println(bs);\n\t\t\n\t\t//int iVal = 12345678900;\n\t\tlong lVal = 2147483647;\n\t\tlong lVal1 = 9999999999L; //기준 이상값을때는 L을 넣어주는것이 좋다.\n\t\t\n\t}",
"ByteOrder byteOrder();",
"public static byte[] intToHex(long value){\n\t\tint count=7;\n\t\tshort[] bytes = new short[8];\n\t\tcal(value,count,bytes);\n\t\treturn shorts2bytes(bytes);\n\t}",
"static long flippingBits(long n) {\n\n String strBinary = String.format(\"%32s\", Long.toBinaryString(n)).replace(' ', '0');\n String strBinaryFlip = \"\";\n\n for (int i = 0; i < strBinary.length(); i++) {\n if (strBinary.charAt(i) == '0') {\n strBinaryFlip = strBinaryFlip + '1';\n } else {\n strBinaryFlip = strBinaryFlip + '0';\n }\n }\n\n String result = String.format(\"%32s\", strBinaryFlip).replace(' ', '0');\n long base10 = parseLong(result,2);\n return base10;\n }",
"String longWrite();",
"private int bytesToGibibytes(long a){\n\t\tlong gibibytes = a >> (30);\n\t\t//If storageGigs isn't an integer number, round it up \n\t\tif(gibibytes << 30 < a) {\n\t\t\tgibibytes ++;\n\t\t}\n\t\treturn (int) gibibytes;\n\t}",
"public long b2l(byte[] b, int offset) {\n return (b[offset + 7] & 0xFF)\n | ((b[offset + 6] & 0xFF) << 8)\n | ((b[offset + 5] & 0xFF) << 16)\n | ((b[offset + 4] & 0xFF) << 24)\n | ((b[offset + 3] & 0xFF) << 32)\n | ((b[offset + 2] & 0xFF) << 40)\n | ((b[offset + 1] & 0xFF) << 48)\n | ((b[offset] & 0xFF) << 56);\n }",
"public static int OpaqueToType(byte[] b) { \n int type = b[8];\n return type; \n }",
"@Test\n public void testReadWriteLong() {\n System.out.println(\"readLong\");\n ByteArray instance = new ByteArray();\n \n instance.writeLong(12, 0);\n instance.writeLong(12345678, 8);\n instance.writeLong(13, instance.compacity());\n \n assertEquals(12, instance.readLong(0));\n assertEquals(12345678, instance.readLong(8));\n assertEquals(13, instance.readLong(instance.compacity() - 8));\n \n instance.writeLong(14, 8);\n assertEquals(14, instance.readLong(8));\n }",
"private long m674a(byte[] bArr) {\n return ((((long) bArr[7]) & 255) << 56) | ((((long) bArr[6]) & 255) << 48) | ((((long) bArr[5]) & 255) << 40) | ((((long) bArr[4]) & 255) << 32) | ((((long) bArr[3]) & 255) << 24) | ((((long) bArr[2]) & 255) << 16) | ((((long) bArr[1]) & 255) << 8) | (255 & ((long) bArr[0]));\n }",
"private long read_long(MappedByteBuffer buff) throws IOException {\n long number = 0;\n for (int i = 0; i < 8; ++i) {\n number += ((long) (buff.get() & 0xFF)) << (8 * i);\n }\n return number;\n }",
"public static long uint32_tToLong(byte b0, byte b1, byte b2, byte b3) {\n return (unsignedByteToInt(b0) +\n (unsignedByteToInt(b1) << 8) +\n (unsignedByteToInt(b2) << 16) +\n (unsignedByteToInt(b3) << 24)) &\n 0xFFFFFFFFL;\n }",
"public static int decodeHighBits(long l) {\n\n long key = l & 0xFFFFFFFF00000000l;\n\n key >>= 32;\n\n return (int) key;\n\n }",
"private byte[] intToBits(int number, int n) {\n\t\tbyte[] bits = new byte[n];\n\t\t\n\t\tString bitString = Integer.toBinaryString(number);\n\t\twhile (bitString.length() < n) {\n\t\t\tbitString = \"0\" + bitString;\n\t\t}\n\t\t\n\t\tfor(int i = 0, maxLen = bits.length; i < maxLen; i++) {\n\t\t\tbits[i] = (byte) (bitString.charAt(i) == 1 ? 1 : 0);\n\t\t}\n\t\t\n\t\treturn bits;\n\t}",
"private byte[] bit_conversion(int i) {\n // originally integers (ints) cast into bytes\n // byte byte7 = (byte)((i & 0xFF00000000000000L) >>> 56);\n // byte byte6 = (byte)((i & 0x00FF000000000000L) >>> 48);\n // byte byte5 = (byte)((i & 0x0000FF0000000000L) >>> 40);\n // byte byte4 = (byte)((i & 0x000000FF00000000L) >>> 32);\n\n // only using 4 bytes\n byte byte3 = (byte) ((i & 0xFF000000) >>> 24); // 0\n byte byte2 = (byte) ((i & 0x00FF0000) >>> 16); // 0\n byte byte1 = (byte) ((i & 0x0000FF00) >>> 8); // 0\n byte byte0 = (byte) ((i & 0x000000FF));\n // {0,0,0,byte0} is equivalent, since all shifts >=8 will be 0\n return (new byte[] { byte3, byte2, byte1, byte0 });\n }",
"long getLongValue();",
"long getLongValue();",
"@Test\n public void testToLong() throws Exception {\n assertEquals(0, undertest2.toLong(\"1 a\"));\n // \"2\"->1->0b10, \"a\"->0->0b0 => 0b100->1l\n assertEquals(1, undertest2.toLong(\"2 a\"));\n // \"3\"->2->0b01, \"a\"->0->0b0 => 0b010->2l\n assertEquals(2, undertest2.toLong(\"3 a\"));\n // \"4\"->3->0b11, \"a\"->0->0b0 => 0b110->3l\n assertEquals(3, undertest2.toLong(\"4 a\"));\n // \"1\"->0->0b00, \"b\"->1->0b1 => 0b001->4l\n assertEquals(4, undertest2.toLong(\"1 b\"));\n // \"2\"->1->0b10, \"b\"->1->0b1 => 0b101->5l\n assertEquals(5, undertest2.toLong(\"2 b\"));\n // \"3\"->2->0b01, \"b\"->1->0b1 => 0b011->6l\n assertEquals(6, undertest2.toLong(\"3 b\"));\n // \"4\"->3->0b11, \"b\"->1->0b1 => 0b111->7l\n assertEquals(7, undertest2.toLong(\"4 b\"));\n }",
"public ByteArray(final long value)\n\t{\n\t\t// create the array\n\t\tthis.bytes = new byte[8];\n\t\t\n\t\t// for every byte\n\t\tfor (int i = 0; i < 8; i++)\n\t\t{\n\t\t\t// assign the array of bytes\n\t\t\tthis.bytes[i] = (byte) (value >> ((7 - i) * 8));\n\t\t}\n\t}",
"public static void main(String[] args) {\n int a=10;\n byte b=(byte)a; //explicit casting\n System.out.println(b);\n\n double DecimalNumber=10.5;\n float FloatNumber=(float) DecimalNumber;\n System.out.println(FloatNumber);\n\n double DecimalNumber2=10.5;\n float FloatNumber2=(int) DecimalNumber;//double>float\n System.out.println(FloatNumber2);\n\n long LongNum=300L;\n int IntNum=(short)LongNum;\n System.out.println(IntNum);\n\n //implicit casting: small size data to larger size of data...\n byte ByteNum=100;\n int IntNum2=ByteNum;\n System.out.println(IntNum2);\n\n\n short ShortNum=100;\n long LongNum2=ShortNum;\n\n\n \n }",
"public /*byte[]*/String BinaryCaster(Object item){\n String Sitem = Integer.toBinaryString((int)item);\n //byte[] b = new byte[Sitem.length()];\n //for(int i=0;i<Sitem.length();i++){\n // b[i] = (byte)Sitem.charAt(i);\n //}\n //return b;\n return Sitem;\n }",
"public byte readByte() {\n return ((byte) readLong());\n }",
"public static byte[] longToBytes(float x) {\n int bits = Float.floatToIntBits(x);\n byte[] buffer = new byte[4];\n buffer[0] = (byte)(bits & 0xff);\n buffer[1] = (byte)((bits >> 8) & 0xff);\n buffer[2] = (byte)((bits >> 16) & 0xff);\n buffer[3] = (byte)((bits >> 24) & 0xff);\n\n return buffer;\n }",
"public String FormatarValor(long value){\n return FormatUtil.formatBytes(value);\n }",
"public static long toNumber(final byte[] bytes) {\n\t\treturn toNumber(bytes, 0, bytes.length);\n\t}",
"public static byte getB(final short key)\n {\n return (byte) (key & BITS);\n }",
"private String toBinary( byte[] bytes )\n\t{\n \t\tStringBuilder sb = new StringBuilder(bytes.length * Byte.SIZE);\n\t\tfor( int i = 0; i < Byte.SIZE * bytes.length; i++ )\n\t\t\tsb.append((bytes[i / Byte.SIZE] << i % Byte.SIZE & 0x80) == 0 ? '0' : '1');\n\t\treturn sb.toString();\n\t}",
"public long convertBandwidth(long reportedBandwidth){\n\t\t//CONVERT FROM MEGABITS TO BITS\n\t\tlong newBandwidth = reportedBandwidth * 1000;\n\t\treturn newBandwidth;\n\t}",
"public static void main (String[] args){\n int myValue = 2_000;\n\n //Byte = 2^8 (8 bits - 1 byte)\n byte myByteValue = 10;\n\n //Java promotes variables to int to perform any binary operation.\n //Thus, results of expressions are integers. In order to store the result\n //in a variables of different type, explicit cast is needed.\n //The parenthesis are needed to cast the whole expression.\n byte myNewByteValue = (byte)(myByteValue/2);\n\n\n //Short = 2^16 (16 bits - 2 bytes)\n short myShort = 1_000;\n short myNewShortValue = (short)(myShort/2);\n /*\n Long = 2^64 (64 bits - 8 bytes)\n Without L suffix, Java considers the literal as an integer.\n Since int is a smaller type than long, int is auto casted and stored as a long\n without information loss (underflow or overflow)\n */\n long myLongValue = 100_000L;\n\n //Exercise:\n //Converts the expression automatically to long, since sizeof(long) > sizeof(int)\n //This rule applies for any two types that one is lager than the order, since the smaller is stored into the larger.\n //Otherwise, a explicit cast is need, like the short type below\n long myNewLongValue = 50_000L + 10L *(myByteValue+myShort+myValue);\n short myShortCastedValue = (short) (100 + 2*(myByteValue+myNewShortValue+myValue));\n System.out.println(myNewLongValue);\n System.out.println(myShortCastedValue);\n }"
] | [
"0.7030018",
"0.67420095",
"0.654445",
"0.65410453",
"0.6512213",
"0.65121216",
"0.6497941",
"0.6495975",
"0.6423086",
"0.6420268",
"0.64172107",
"0.61513144",
"0.61218596",
"0.60998356",
"0.6071498",
"0.605877",
"0.6034789",
"0.598381",
"0.593908",
"0.5926176",
"0.5921889",
"0.5899083",
"0.5861701",
"0.5855907",
"0.5846809",
"0.58292395",
"0.5827009",
"0.5766981",
"0.5762829",
"0.57440007",
"0.57365805",
"0.5735665",
"0.57295156",
"0.57055146",
"0.5703467",
"0.5684192",
"0.56646127",
"0.56487304",
"0.563741",
"0.5629025",
"0.5611343",
"0.55994725",
"0.5596339",
"0.5566507",
"0.555331",
"0.55471736",
"0.5537316",
"0.5535548",
"0.5531074",
"0.55218315",
"0.5512061",
"0.5499784",
"0.54863495",
"0.5460117",
"0.5457496",
"0.5443071",
"0.54401284",
"0.5437499",
"0.54336685",
"0.5430868",
"0.5428541",
"0.5425852",
"0.54160815",
"0.54116994",
"0.5410909",
"0.5400795",
"0.53924507",
"0.5387488",
"0.53861976",
"0.5385935",
"0.53765976",
"0.5371767",
"0.53715694",
"0.5362879",
"0.53478754",
"0.53475296",
"0.53461254",
"0.5334268",
"0.53339756",
"0.5326082",
"0.53167087",
"0.53163785",
"0.5307227",
"0.53070307",
"0.5306389",
"0.53060126",
"0.53039426",
"0.53039426",
"0.52962625",
"0.5274848",
"0.5258343",
"0.5254646",
"0.5251056",
"0.5244659",
"0.5237712",
"0.5237599",
"0.523499",
"0.5230786",
"0.5226941",
"0.5225524"
] | 0.61025894 | 13 |
implements matlab function and parameters for repmat(m(row,:), nRowsFactor, nColsFactor) e.g. extract a single row from the m.numRows present in m, then replicate into the output matrix that single row nRowsFactor times along rows then replicate all of the output columns, nColsFactor times along columns. the result is a matrix of size nRowsFactor X nColsFactor m.numCols(). | public static DenseMatrix exRowRepl(DenseMatrix m, int row, int nRowsFactor, int nColsFactor) {
//repmat(m(3,:),1,3) <--- replicate row 2, 1 time by row, 3 times by columns
int nRows = nRowsFactor;
int nCols = m.numColumns() * nColsFactor;
DenseMatrix out = new DenseMatrix(nRows, nCols);
// replicate the row along rows
for (int c = 0; c < m.numColumns(); ++c) {
double v = m.get(row, c);
for (int r = 0; r < nRows; ++r) {
out.set(r, c, v);
}
}
/* nRowsFactor=2 nColsFactor=3
0 1 2 0 1 2 0 1 2
0 1 2
*/
// replicate along columns
for (int r = 0; r < nRows; ++r) {
for (int cf = 0; cf < nColsFactor; ++cf) {
int c2 = m.numColumns() * cf;
for (int c = 0; c < m.numColumns(); ++c) {
double v = out.get(r, c);
out.set(r, c2 + c, v);
}
}
}
return out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DenseMatrix exRowConjRepl(DenseMatrix m, int row, int nRowsFactor, int nColsFactor) {\n \n // 0) repmat(X2(3,:)',1,3). X2 size is 3 X nData.\n // extract row 2 for all columns. this is 1 X nData of all \"1's\"\n // transpose X2 extract. result is nData X 1 matrix.\n // replicate it to new matrix once along rows, and 3 times along\n // columns.\n \n DenseMatrix at = exRowRepl(m, row, nColsFactor, nRowsFactor);\n \n DenseMatrix out = MatrixUtil.transpose(at);\n \n return out;\n }",
"public Matrix copy() {\n\t\tComplexNumber[][] rows = new ComplexNumber[M][];\n\t\tfor (int row = 0; row < M; row++) {\n\t\t\trows[row] = new ComplexNumber[N];\n\t\t\tfor (int col = 0; col < N; col++) {\n\t\t\t\trows[row][col] = ROWS[row][col];\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(rows);\n\t}",
"public Mat2 mult(Mat2 m) {\n\t\tdouble[][] newData = new double[rows][m.cols];\n\t\t//if(rows != m.cols) throw new IllegalArgumentException(\"cannot multiply a \" + rows + \" by \" + cols + \n\t\t\t//\t\" matrix and a \" + m.rows + \" by \" + m.cols + \" matrix\");\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<m.cols; j++) {\n\t\t\t\tdouble total = 0.0;\n\t\t\t\tfor(int c=0; c<cols; c++) {\n\t\t\t\t\ttotal += data[i][c] * m.data[c][j];\n\t\t\t\t}\n\t\t\t\tnewData[i][j] = total;\n\t\t\t}\n\t\t}\n\t\treturn new Mat2(newData);\n\t}",
"Matrix mul(Matrix m){\n if(m.cols != this.cols || m.rows != this.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n Matrix matrix_to_return = new Matrix(m.rows, m.cols);\n for(int i=0; i<m.rows * m.cols; i++){\n matrix_to_return.data[i] = this.data[i] * m.data[i];\n }\n return matrix_to_return;\n }",
"public static int[][] transposeMultMatrix(int initialValue,int rows,int columns)\n {\n int[][] ori = new int[rows][columns];\n int[][] orit = new int[columns][rows];\n int[][] res = new int[rows][rows];\n int i,j;\n for(i=0; i<rows; i++) {\n for(j=0; j<columns; j++) {\n ori[i][j] = initialValue;\n orit[j][i] = initialValue;\n initialValue++;\n }\n }\n int xi,yj;\n for(i=0; i<rows; i++) {\n for(j=0; j<rows; j++) {\n for(xi=0,yj=0; xi<columns&&yj<columns; xi++,yj++) {\n res[i][j] += ori[i][xi]*orit[yj][j];\n }\n }\n }\n return res;\n }",
"public Matrix4f GetMultipliedMatrix(Matrix4f m) {\n\n\t/*\n\tinputs--\n\t\n\tm :\n\t The input matrix m, instance of Matrix4f\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tmul :\n\t The matrix this times m\n\t*/\n\t\n\t// Create new matrix to hold the results\n\tMatrix4f mul = new Matrix4f();\n\t\n\t// Double for loop based standard multiplication\n\tfor (int n_i = 0; n_i < 4; n_i ++) {\n\t \n\t for(int n_j = 0; n_j < 4 ; n_j ++) {\n\t\t\n\t\t// Set entry one by one\n\t\tfloat f_val = 0;\n\t\tfor (int n_k = 0; n_k < 4; n_k ++) {\n\t\t\n\t\t f_val += this.mat_f_m[n_i][n_k]*m.GetComponent(n_k, n_j);\n\t\t\n\t\t}\n\t\tmul.SetComponent(n_i, n_j, f_val);\n\t\t\n\t }\n\t\n\t}\n\t\n\t// Return the multiplied matrix\n\treturn mul;\n \n }",
"public double[] getRowPackedCopy() {\n double[] vals = new double[m*n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n vals[i*n+j] = data[i][j];\n }\n }\n return vals;\n }",
"public static Matrix rows(double[] rs) {\n\t\tint rows = rs.length;\n\t\tint columns = 1;\n\t\tMatrix m = new Matrix(rows, columns);\n\t\tfor (int r = 0; r < rows; r++) {\n\t\t\tm.matrix[r][0] = rs[r];\n\t\t}\n\t\treturn m;\n\t}",
"private void replicate(Version theTask) {\n\tsynchronized(_replicatorQueue) {\n\t for (int i = 0; i < _replicatorQueue.size(); i++) {\n\t\tReplicatorHandle rh = (ReplicatorHandle) \n\t\t _replicatorQueue.get(i);\n\t\trh.replicate(theTask, _replicatorQueue, this);\n\t }\n\t}\n }",
"private static DenseMatrix generateRandomMatrix (int rows, int cols, int m_seed){\n\n Random random_value = new Random(m_seed);\n DenseMatrix randomMX = new DenseMatrix(rows, cols);\n for (int i=0; i<rows; i++){\n for (int j=0; j<cols;j++){\n randomMX.set(i,j, random_value.nextDouble());\n }\n }\n return randomMX;\n }",
"public interface IMatrixMultiplicator {\n\n\t/**\n\t * Multiplies two matrixes and returns the result in a new matrix \n\t * \n\t * @param matrixA first matrix\n\t * @param matrixB second matrix \n\t * @return result of the multiplication\n\t */\n\tpublic long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res);\n\t \n\t\n}",
"public static int[][] generateMatrix() {\n int rowsCount = RANDOM.nextInt( MAX_ROWS_COUNT ) + 1;\n int[][] result = new int[rowsCount][];\n for (int i = 0; i < rowsCount; i++) {\n result[i] = new int[RANDOM.nextInt( MAX_COLUMNS_COUNT ) + 1];\n fillArray( result[i] );\n }\n return result;\n }",
"public static Matrix product(Matrix m) {\n int rows_c = m.rows(), cols_c = m.cols();\n Matrix d;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c, m);\n for (int col = 1; col <= cols_c; col++) {\n double prodCol = 1D;\n for (int row = 1; row <= rows_c; row++) {\n prodCol = prodCol * m.get(row, col);\n }\n d.set(1, col, prodCol);\n }\n }\n return d;\n }",
"public Matrix copy() {\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n C[i][j] = data[i][j];\n }\n }\n return X;\n }",
"public static Matrix Identity(int n) {\n List<List<Double>> backingArray = get2DListOfSize(n);\n for(int i = 0; i < n; i++)\n backingArray.get(i).set(i, 1d);\n return new Matrix(backingArray);\n }",
"public static int[][] makeReflexive(int[][] m)\n {\n return new int[m.length][m[0].length];\n }",
"protected abstract T createMatrix( int numRows, int numCols, MatrixType type );",
"public Matrix(Fraction[][] rows) {\n\t\tComplexNumber[][] complexRows = new ComplexNumber[rows.length][];\n\t\tfor (int row = 0; row < rows.length; row++) {\n\t\t\tcomplexRows[row] = new ComplexNumber[rows[row].length];\n\t\t\tfor (int col = 0; col < rows[row].length; col++) {\n\t\t\t\tcomplexRows[row][col] = new ComplexNumber(rows[row][col]);\n\t\t\t}\n\t\t}\n\t\tROWS = complexRows;\n\t\tM = complexRows.length;\n\t\tN = complexRows[0].length;\n\t\tfor (int row = 0; row < M; row++) {\n\t\t\tif (complexRows[row].length != N) {\n\t\t\t\tthrow new RuntimeException(\"Non-Rectangular Matrix!\");\n\t\t\t}\n\t\t}\n\t}",
"Matrix(double[][] input) {\n matrixVar = input;\n columns = matrixVar[0].length;\n rows = matrixVar.length;\n }",
"protected ArrayList<double[]> newMatrix(int _rows, int _cols) {\n ArrayList<double[]> matrix = new ArrayList<double[]>();\n for (int i=0; i<_rows; i++) {\n matrix.add(new double[_cols]);\n }\n return matrix;\n }",
"public int[][] generateMatrix(int n) {\n\t\tint[][] res = new int[n][n];\r\n\t\tint x = 0;\r\n\t\tint num = 1;\r\n\t\twhile (n > 1) {\r\n\t\t\tfor (int i = x; i < x + n - 1; i++)\r\n\t\t\t\tres[x][i] = num++;\r\n\t\t\tfor (int i = x; i < x + n - 1; i++)\r\n\t\t\t\tres[i][x + n - 1] = num++;\r\n\t\t\tfor (int i = x + n - 1; i > x; i--)\r\n\t\t\t\tres[x + n - 1][i] = num++;\r\n\t\t\tfor (int i = x + n - 1; i > x; i--)\r\n\t\t\t\tres[i][x] = num++;\r\n\t\t\tn -= 2;\r\n\t\t\tx++;\r\n\t\t}\r\n\t\tif (n == 1)\r\n\t\t\tres[x][x] = num;\r\n\t\treturn res;\r\n\t}",
"public static void RepeatedElementsRow(int[][] array) {\n\n }",
"public Matrix times(double constant){\r\n \tMatrix cmat = new Matrix(this.nrow, this.ncol);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\tcarray[i][j] = this.matrix[i][j]*constant;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}",
"private static double[][] clone(double[][] matrix)\n {\n int length = matrix.length;\n double[][] clone;\n\n clone = new double[length][];\n for (int i = 0; i < length; i++)\n clone[i] = matrix[i].clone();\n return clone;\n }",
"public static Matrix constructWithCopy(double[][] A) throws JPARSECException {\n int m = A.length;\n int n = A[0].length;\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n if (A[i].length != n) {\n throw new JPARSECException\n (\"All rows must have the same length.\");\n }\n for (int j = 0; j < n; j++) {\n C[i][j] = A[i][j];\n }\n }\n return X;\n }",
"static Matrix vectorize(Matrix input) {\n int m = input.getRowDimension();\n int n = input.getColumnDimension();\n\n Matrix result = new Matrix(m * n, 1);\n for (int p = 0; p < n; p++) {\n for (int q = 0; q < m; q++) {\n result.set(p * m + q, 0, input.get(q, p));\n }\n }\n return result;\n }",
"public Matrix multiplyTransposeM(Matrix m) {\n\t\tMatrix newMatrix = new Matrix(nbRows, m.getNbRows());\n\t\tmultiplyTransposeB(this, m, newMatrix);\n\n\t\treturn newMatrix;\n\t}",
"public Matrice(int dim){\n\t\tnr=dim;\n\t\tnc=nr;\n\t\tmat = new int[nr][nc];\n\t}",
"Matrix mult(Matrix M){\n if(this.getSize() != M.getSize()){\n throw new RuntimeException(\"Matrix\");\n\n } \n int newMatrixSize = this.getSize();\n Matrix newM = M.transpose();\n Matrix resultMatrix = new Matrix(newMatrixSize);\n double resultMatrix_Entry = 0;\n for(int i = 1; i <= newMatrixSize; i++){\n for(int j = 1; j<= newMatrixSize; j++){\n List itRow_A = this.rows[i - 1];\n List itRow_B = newM.rows[j-1];\n itRow_A.moveFront();\n itRow_B.moveFront();\n while((itRow_A.index() != -1) && (itRow_B.index() != -1)){\n Entry c_A = (Entry)itRow_A.get();\n Entry c_B = (Entry) itRow_B.get();\n if(c_A.column == c_B.column){\n resultMatrix_Entry += (c_A.value)*(c_B.value);\n itRow_A.moveNext();\n itRow_B.moveNext();\n\n } else if(c_A.column > c_B.column){\n itRow_B.moveNext();\n\n }else{\n itRow_A.moveNext();\n }\n\n }\n resultMatrix.changeEntry(i, j, resultMatrix_Entry);\n resultMatrix_Entry = 0;\n }\n }\n return resultMatrix;\n\n }",
"public Matrix copy() {\n Matrix m = new Matrix(rows, cols);\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n m.getMatrix().get(i)[j] = this.get(i, j);\n }\n }\n return m;\n }",
"Matrix copy() {\n Matrix newMatrix = new Matrix(matrixSize);\n for (int i = 0; i < matrixSize; i++) {\n if (!rows[i].isEmpty()) {\n rows[i].moveFront();\n while (rows[i].index() != -1) {\n Entry entry = (Entry)rows[i].get();\n newMatrix.changeEntry(i + 1, entry.column, entry.value);\n rows[i].moveNext();\n }\n }\n }\n return newMatrix;\n }",
"@Test\r\n\tvoid deepArrayCopyElementsMultiDim() {\r\n\t\tInteger[][] intArr = new Integer[10][];\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t\tintArr[i] = new Integer[4];\r\n\t\t\tfor (int j = 0; j < 4; j++) {\r\n\t\t\t\tintArr[i][j] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger[][] clone = ArrayUtil.deepArrayCopy(intArr);\r\n\t\tassertTrue(Arrays.deepEquals(intArr, clone));\r\n\t}",
"private ICalculator[][] createMultipleRows(int rowCount, ICalculator[] calcPrototypes ){\n ICalculator[][] result = new ICalculator[rowCount][calcPrototypes.length];\n \tfor(int i=0; i< rowCount; i++){\n \t\tresult[i] = new ICalculator[calcPrototypes.length];\n \t\tfor (int j = 0; j < calcPrototypes.length; j++) {\n \t\t\tresult[i][j] = (ICalculator)calcPrototypes[j].clone();\n \t\t}\n \t}\n return result;\n }",
"public interface IMatrix {\n\n\tpublic int getRowsCount();\n\tpublic int getColsCount();\n\tpublic double get(int numberOne, int numberTwo);\n\tpublic IMatrix set(int numberOne, int numberTwo, double numberThree);\n\tpublic IMatrix copy();\n\tpublic IMatrix newInstance(int numberOne, int numberTwo);\n\tpublic IMatrix nTranspose(boolean trans);\n\tpublic IMatrix add(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nAdd(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix sub(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nSub(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nMultiply(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic double determinant() throws OperationNotSupportedException;\n\tpublic IMatrix subMatrix(int numberOne, int numberTwo, boolean subM);\n\tpublic IMatrix nInvert() throws OperationNotSupportedException;\n\tpublic double[][] toArray();\n\tpublic IVector toVector(boolean toVect) throws OperationNotSupportedException;\n\tpublic IMatrix scalarMultiply(double value);\n\tpublic IMatrix nScalarMultiply(double value);\n\t\n}",
"public static Matrix identityMatrix(int nrow){\r\n \tMatrix u = new Matrix(nrow, nrow);\r\n \tfor(int i=0; i<nrow; i++){\r\n \t\tu.matrix[i][i]=1.0;\r\n \t}\r\n \treturn u;\r\n \t}",
"Matrix scalarMult(double x){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n itRow.moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(i, c.column, (x*c.value));\n itRow.moveNext();\n }\n }\n\n return newM;\n }",
"public void matrixMultiply(Matrix m) {\n if (cols == m.getRows()) {\n ArrayList<double[]> result = newMatrix(rows, m.getCols());\n for (int i=0; i<rows; i++) {\n for (int k=0; k<m.getCols(); k++) {\n double sum = 0;\n for (int j=0; j<cols; j++) {\n sum += matrix.get(i)[j] * m.get(j, k);\n }\n result.get(i)[k] = sum;\n }\n }\n setMatrix(result, rows, m.getCols()); // Rows is that of original matrix, Columns is that of the multiplying matrix\n }\n else {\n throw new MatrixMultiplicationDimensionException();\n }\n }",
"static void printMatrix(int[][] inp){\n\n for(int i=0;i<inp.length;i++){\n for(int j=0;j<inp[0].length;j++){\n System.out.print(inp[i][j]+\" \");\n }\n System.out.println(\"\");\n }\n }",
"public int[][] generateMatrix(int n) {\n\t\tif (n <= 0) {\n\t\t\treturn new int[0][0];\n\t\t}\n\n\t\tint[][] res = new int[n][n];\n\t\tint num = 1;\n\t\tint r1 = 0, c1 = 0, r2 = n-1, c2 = n-1;\n\t\twhile (r1 <= r2 && c1 <= c2) {\n\t\t\tfor (int c = c1; c <= c2; c++) {\n\t\t\t\tres[r1][c] = num++;\n\t\t\t}\n\n\t\t\tfor (int r = r1 + 1; r <= r2; r++) {\n\t\t\t\tres[r][c2] = num++;\n\t\t\t}\n\n\t\t\tif (r1 < r2) {\n\t\t\t\tfor (int c = c2 - 1; c > c1; c--) {\n\t\t\t\t\tres[r2][c] = num++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (c1 < c2) {\n\t\t\t\tfor (int r = r2; r > r1; r--) {\n\t\t\t\t\tres[r][c1] = num++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr1++;\n\t\t\tc1++;\n\t\t\tr2--;\n\t\t\tc2--;\n\t\t}\n\n\t\treturn res;\n\t}",
"Matrix mul(double w){\n Matrix matrix_to_return = new Matrix(this.rows, this.cols);\n for(int i=0; i<this.rows * this.cols; i++){\n matrix_to_return.data[i] = this.data[i] * w;\n }\n return matrix_to_return;\n }",
"double[][] makeCopy(double[][] M, int row, int column) {\n\t\tdouble _M[][] = new double[row][column];\n\t\tfor (int i = 0; i < row; i++)\n\t\t\tfor (int j = 0; j < column; j++)\n\t\t\t\t_M[i][j] = M[i][j];\n\t\treturn _M;\n\t}",
"public long[][] smultiply(int i){\n\t\tint sl = this.mat.length; //jumps to method sideLength to obtain the side length n of the matrix A\n\t\t//the global record contains an array of columns, where each column is an array of row elements. i.e.\n\t\t//the record contains the transpose of matrix A, where every row in the record is a column in A\n\t\t//a temporary 2D array tempMatA, and is made equal to the transpose of A\n\t\tlong[][] tempMatA = transpose(this.mat);\n\t\tlong[][] tempMat2 = new long[sl][sl]; //creates a temporary 2D matrix of the same size as tempMatA\n\t\tlong[][] outMat = new long[sl][sl];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"+\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//return matrix must be re-transposed to return a the proper format of 2D array for the global array\n\t\toutMat = transpose(outMat);\n\t\treturn outMat;\n\t}",
"public int[][] getMat() {\n // Note: java has no return read-only so we won't return matrix;\n // b\\c that would expose internal representation. Instead we will\n // copy each row into a new matrix, and return that.\n return Helper.cloneMatrix(matrix);\n }",
"public SudokuSolver(int[][] m) {\n // ideally we would have liked to have just done:\n // this.matrix = m; but this would allow outside class\n // to change our internal representation, safer to copy instead.\n // Note: intentionally not doing a clone of rows.\n matrix = new int[DIM][DIM];\n IntStream.range(0, DIM * DIM)\n .forEach(\n n -> {\n int i = n / DIM;\n int j = n % DIM;\n matrix[i][j] = m[i][j];\n });\n }",
"void reshape(int newRows,int newCols) {\n if (rows * cols != newRows * newCols)\n throw new IllegalArgumentException(String.format(\"%d x %d matrix can't be reshaped to %d x %d\", rows, cols, newRows, newCols));\n this.cols = newCols;\n this.rows = newRows;\n double[][] tmp = this.asArray();\n int k = 0;\n for (int i = 0; i < cols; i++) {\n for (int j = 0; j < rows; j++) {\n this.data[k] = tmp[j][i];\n k++;\n }\n }\n }",
"private int[][] deepCopy(int[][] matrix){\n int [][] myInt = new int[matrix.length][];\n for(int i = 0; i < matrix.length; i++)\n myInt[i] = matrix[i].clone();\n return myInt;\n }",
"public CDenseMatrix64F(int numRows, int numCols) {\n this.numRows = numRows;\n this.numCols = numCols;\n this.data = new double[numRows*numCols*2];\n }",
"public int[][] initMatrix(int n)\n {\n\t// create an empty 2d array and return it! Simple stuff here.\n\t int[][] retMatrix = new int[n][n];\n\t return retMatrix;\n }",
"public static long[][] multiplyMod(long F[][], long M[][]){\n long x = (F[0][0]*M[0][0])%MOD + (F[0][1]*M[1][0])%MOD; \n long y = (F[0][0]*M[0][1])%MOD + (F[0][1]*M[1][1])%MOD; \n long z = (F[1][0]*M[0][0])%MOD + (F[1][1]*M[1][0])%MOD; \n long w = (F[1][0]*M[0][1])%MOD + (F[1][1]*M[1][1])%MOD; \n\n return new long[][]{{x,y},{z,w}};\n }",
"public Matrix times(double[][] bmat){\r\n \t int nr=bmat.length;\r\n \tint nc=bmat[0].length;\r\n\r\n \tif(this.ncol!=nr)throw new IllegalArgumentException(\"Nonconformable matrices\");\r\n\r\n \tMatrix cmat = new Matrix(this.nrow, nc);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n \tdouble sum = 0.0D;\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tsum=0.0D;\r\n \t\tfor(int k=0; k<this.ncol; k++){\r\n \t\t\tsum += this.matrix[i][k]*bmat[k][j];\r\n \t\t}\r\n \t\tcarray[i][j]=sum;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}",
"public Matrice(int nr, int nc){\n\t\tthis.nr=nr;\n\t\tthis.nc=nc;\n\t\tmat = new int[nr][nc];\n\t}",
"public int[][] generateMatrix(int n) {\n int[][] matrix = new int[n][n];\r\n generateMatrix(matrix, 0, 1);\r\n return matrix;\r\n }",
"public void reshape( int numRows, int numCols ) {\n if (mat.getType().isFixed()) {\n throw new IllegalArgumentException(\"Can't reshape a fixed sized matrix\");\n } else {\n ((ReshapeMatrix)mat).reshape(numRows, numCols);\n }\n }",
"public Matrix multiplyTransposeSelf(Matrix m) {\n\t\tMatrix newMatrix = new Matrix(nbColumns, m.getNbColumns());\n\t\tmultiplyTransposeA(this, m, newMatrix);\n\n\t\treturn newMatrix;\n\t}",
"@Override\n public Matrix like(int rows, int columns) {\n return new PivotedMatrix(base.like(rows, columns));\n }",
"public Matrix rowMultiply(int row, Fraction weight) {\n\t\treturn rowMultiply(row, new ComplexNumber(weight));\n\t}",
"public interface ExprMatrix extends ExprCellIterator{\n public int getColumnsDimension();\n\n public int getRowsDimension();\n\n public Expr apply(int row, int column);\n\n public Expr get(int row, int column);\n\n public void set(Expr exp, int row, int col);\n\n\n /**\n * create a preloaded sequence (all element are pre evaluated)\n * @return\n */\n public ExprMatrix preload();\n\n /**\n * same as index, provided for scala compatibility\n *\n * @param index index\n * @return get(index)\n */\n /**\n * create a cached instance of this expression sequence\n * @return\n */\n public ExprMatrix withCache();\n\n /**\n * create a sequence of simplified elements\n * @return\n */\n public ExprMatrix simplify() ;\n}",
"public List<List<GenPolynomial<C>>> \n normalizeMatrix(int flen, List<List<GenPolynomial<C>>> M) { \n if ( M == null ) {\n return M;\n }\n if ( M.size() == 0 ) {\n return M;\n }\n List<List<GenPolynomial<C>>> N = new ArrayList<List<GenPolynomial<C>>>();\n List<List<GenPolynomial<C>>> K = new ArrayList<List<GenPolynomial<C>>>();\n int len = M.get( M.size()-1 ).size(); // longest row\n // pad / extend rows\n for ( List<GenPolynomial<C>> row : M ) {\n List<GenPolynomial<C>> nrow = new ArrayList<GenPolynomial<C>>( row );\n for ( int i = row.size(); i < len; i++ ) {\n nrow.add( null );\n }\n N.add( nrow );\n }\n // System.out.println(\"norm N fill = \" + N);\n // make zero columns\n int k = flen;\n for ( int i = 0; i < N.size(); i++ ) { // 0\n List<GenPolynomial<C>> row = N.get( i );\n if ( debug ) {\n logger.info(\"row = \" + row);\n }\n K.add( row );\n if ( i < flen ) { // skip identity part\n continue;\n }\n List<GenPolynomial<C>> xrow;\n GenPolynomial<C> a;\n //System.out.println(\"norm i = \" + i);\n for ( int j = i+1; j < N.size(); j++ ) {\n List<GenPolynomial<C>> nrow = N.get( j );\n //System.out.println(\"nrow j = \" +j + \", \" + nrow);\n if ( k < nrow.size() ) { // always true\n a = nrow.get( k );\n //System.out.println(\"k, a = \" + k + \", \" + a);\n if ( a != null && !a.isZERO() ) {\n xrow = blas.scalarProduct( a, row);\n xrow = blas.vectorAdd(xrow,nrow);\n //System.out.println(\"xrow = \" + xrow);\n N.set( j, xrow );\n }\n }\n }\n k++;\n }\n //System.out.println(\"norm K reduc = \" + K);\n // truncate \n N.clear();\n for ( List<GenPolynomial<C>> row: K ) {\n List<GenPolynomial<C>> tr = new ArrayList<GenPolynomial<C>>();\n for ( int i = 0; i < flen; i++ ) {\n tr.add( row.get(i) );\n }\n N.add( tr );\n }\n K = N;\n //System.out.println(\"norm K trunc = \" + K);\n return K;\n }",
"public Matrix times(double s) {\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n C[i][j] = s*data[i][j];\n }\n }\n return X;\n }",
"public Row3 smultiply(int i){\n\t\tRow3 tempRec = this.mat; //creates a temporary duplicate of the global record\n\t\tlong[][] tempMatA = new long[3][3]; //creates the matrix A as a 2D array\n\t\ttempMatA[0][0] = tempRec.r1.col1;\n\t\ttempMatA[0][1] = tempRec.r1.col2;\n\t\ttempMatA[0][2] = tempRec.r1.col3;\n\t\ttempMatA[1][0] = tempRec.r2.col1;\n\t\ttempMatA[1][1] = tempRec.r2.col2;\n\t\ttempMatA[1][2] = tempRec.r2.col3;\n\t\ttempMatA[2][0] = tempRec.r3.col1;\n\t\ttempMatA[2][1] = tempRec.r3.col2;\n\t\ttempMatA[2][2] = tempRec.r3.col3;\n\t\t\n\t\tlong[][] tempMat2 = new long[3][3]; //creates a 2D array of the same size as A\n\t\tlong[][] outMat = new long[3][3];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//after matrix multiplication is performed, the respective elements of the 2D array tempMatA are stored in\n\t\t//the temporary register tempRec2, which is then returned\n\t\tcolRow3 a1 = new colRow3(outMat[0][0], outMat[0][1], outMat[0][2]);\n\t\tcolRow3 b1 = new colRow3(outMat[1][0], outMat[1][1], outMat[1][2]);\n\t\tcolRow3 c1 = new colRow3(outMat[2][0], outMat[2][1], outMat[2][2]);\n\t\tRow3 tempRec2 = new Row3(a1, b1, c1);\n\t\treturn tempRec2;\n\t}",
"public interface Matrix {\n\n void initZeroValues();\n\n void fillRandomValues();\n\n int getRows();\n\n int getColumns();\n\n Entity getEntity(int i, int j);\n\n String toString();\n}",
"public Matrix(int[][] rows) {\n\t\tComplexNumber[][] complexRows = new ComplexNumber[rows.length][];\n\t\tfor (int row = 0; row < rows.length; row++) {\n\t\t\tcomplexRows[row] = new ComplexNumber[rows[row].length];\n\t\t\tfor (int col = 0; col < rows[row].length; col++) {\n\t\t\t\tFraction real = new Fraction(rows[row][col]);\n\t\t\t\tFraction imaginary = new Fraction(0);\n\t\t\t\tcomplexRows[row][col] = new ComplexNumber(real, imaginary);\n\t\t\t}\n\t\t}\n\t\tROWS = complexRows;\n\t\tM = complexRows.length;\n\t\tN = complexRows[0].length;\n\t\tfor (int row = 0; row < M; row++) {\n\t\t\tif (complexRows[row].length != N) {\n\t\t\t\tthrow new RuntimeException(\"Non-Rectangular Matrix!\");\n\t\t\t}\n\t\t}\n\t}",
"public int[][] generateMatrix(int n) {\n\t\tint[][] res = {};\n\t\tif (n <= 0) {\n\t\t\treturn res;\n\t\t}\n\t\tres = new int[n][n];\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint count = 1;\n\n\t\twhile (n > 0) {\n\t\t\tif (n == 1) {\n\t\t\t\tres[x][y] = count;\n\t\t\t}\n\t\t\t// move right\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x][y++] = count++;\n\t\t\t}\n\t\t\t// move down\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x++][y] = count++;\n\t\t\t}\n\t\t\t// move left\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x][y--] = count++;\n\t\t\t}\n\t\t\t// move up\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x--][y] = count++;\n\t\t\t}\n\t\t\tx = x + 1;\n\t\t\ty = y + 1;\n\t\t\tn = n - 2;\n\t\t}\n\t\treturn res;\n\t}",
"public static int[][] reshapeMatrix(int nums[][], int r, int c)\n\t{\n\t\tint size = nums.length * nums[0].length;\n\t\tQueue<Integer> q = new LinkedList<>();\n\t\t// Result array\n\t\tint[][] result = new int[r][c];\n\t\t//If dimensions don't match\n\t\tif (size != r*c)\n\t\t{\n\t\t\treturn nums;\n\t\t}\n\t\t\n\t\t//Without Queue\n\t\tint rows = 0, cols = 0;\n\t\tfor (int i = 0; i < nums.length; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < nums[0].length; j++)\n\t\t\t{\n\t\t\t\tresult[rows][cols] = nums[i][j];\n\t\t\t\tcols++;\n\t\t\t\tif (cols == c)\n\t\t\t\t{\n\t\t\t\t\trows++;\n\t\t\t\t\tcols = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"public static void testMulRec() {\n\n try {\n\n Matrix m1 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m2 = new Matrix(new double[][]{\n {1, 2, 3, 4},\n {5, 6, 7, 8},\n {1, 2, 3, 4},\n {5, 6, 7, 8}});\n\n Matrix m3 = Matrix.multiplyRec(m1, m2, 0);\n\n System.out.println(m3);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }",
"public static long[][] multiply(long F[][], long M[][]){\n long x = F[0][0]*M[0][0] + F[0][1]*M[1][0]; \n long y = F[0][0]*M[0][1] + F[0][1]*M[1][1]; \n long z = F[1][0]*M[0][0] + F[1][1]*M[1][0]; \n long w = F[1][0]*M[0][1] + F[1][1]*M[1][1]; \n\n return new long[][]{{x,y},{z,w}};\n }",
"public static int[][] generateMatrix(int rows, int columns) {\n\tint[][] result = new int[rows][columns];\n\tfor (int i = 0; i < rows; i++) {\n\tfor (int j = 0; j < columns; j++) {\n\tresult[i][j] = (int) (Math.random() * 100) + 1;\n\t}\n\t}\n\treturn result;\n\t}",
"public Matrix(int nrOfRows, int nrOfCols) {\n this.nrOfRows = nrOfRows;\n this.nrOfCols = nrOfCols;\n inner = new BigInteger[nrOfRows][nrOfCols];\n }",
"public Matrix(int nrOfRows, int nrOfCols, Random rand, BigInteger q) {\n this(nrOfRows, nrOfCols);\n for (int col = 0; col < nrOfCols; col++) {\n for (int row = 0; row < nrOfRows; row++) {\n inner[row][col] = rand.nextRandom(q);\n }\n }\n }",
"public ExprMatrix simplify() ;",
"public Matrix copy(){\r\n \t if(this==null){\r\n \t return null;\r\n \t }\r\n \t else{\r\n \t int nr = this.nrow;\r\n \t int nc = this.ncol;\r\n \t Matrix b = new Matrix(nr,nc);\r\n \t double[][] barray = b.getArrayReference();\r\n \t b.nrow = nr;\r\n \t b.ncol = nc;\r\n \t for(int i=0; i<nr; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tbarray[i][j]=this.matrix[i][j];\r\n \t\t}\r\n \t }\r\n \t for(int i=0; i<nr; i++)b.index[i] = this.index[i];\r\n \t return b;\r\n \t}\r\n \t}",
"public int[][] generateMatrix(int n) {\n int[][] result = new int[n][n];\n int val = 1;\n int rowBegin = 0;\n int colBegin = 0;\n int rowEnd = n - 1;\n int colEnd = n - 1;\n while (rowBegin <= rowEnd && colBegin <= colEnd) {\n // travel right\n for (int j = colBegin; j <= colEnd; j++) {\n result[rowBegin][j] = val++;\n }\n rowBegin++;\n // travel down\n for (int i = rowBegin; i <= rowEnd; i++) {\n result[i][colEnd] = val++;\n }\n colEnd--;\n // travel left\n if (rowBegin <= rowEnd) {\n for (int j = colEnd; j >= colBegin; j--) {\n result[rowEnd][j] = val++;\n }\n }\n rowEnd--;\n // travel up\n if (colBegin <= colEnd) {\n for (int i = rowEnd; i >= rowBegin; i--) {\n result[i][colBegin] = val++;\n }\n }\n colBegin++;\n }\n return result;\n\n }",
"public void mult(Mat2 m, Mat2 dest) {\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<m.cols; j++) {\n\t\t\t\tdouble total = 0.0f;\n\t\t\t\tfor(int c=0; c<cols; c++) {\n\t\t\t\t\ttotal += data[i][c] * m.data[c][j];\n\t\t\t\t}\n\t\t\t\tdest.set(i, j, total);\n\t\t\t}\n\t\t}\n\t}",
"public static Matrix times(Matrix amat, double constant){\r\n \tMatrix cmat = new Matrix(amat.nrow, amat.ncol);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n\r\n \t \tfor(int i=0; i<amat.nrow; i++){\r\n \t\tfor(int j=0; j<amat.ncol; j++){\r\n \t\tcarray[i][j] = amat.matrix[i][j]*constant;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}",
"public static ArrayList<ArrayList<Integer>> generate(int numRows) {\n ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>(); \n ArrayList<Integer> curRow;\n if ( 0 == numRows) return rst;\n curRow = new ArrayList<Integer>();\n curRow.add(1);\n rst.add(curRow);\n if (1 == numRows) return rst;\n \n curRow = new ArrayList<Integer>();\n curRow.add(1);\n curRow.add(1);\n rst.add(curRow);\n if (2 == numRows) return rst;\n ArrayList<Integer> lastRow = curRow;\n curRow = new ArrayList<Integer>();\n \n for (int i=3;i<=numRows;i++) {\n curRow.add(1);\n \tfor (int j=1; j<i-1; j++) \n \t\tcurRow.add(lastRow.get(j-1) + lastRow.get(j));\n \tcurRow.add(1);\n \trst.add(curRow);\n \tlastRow = curRow;\n \tcurRow = new ArrayList<Integer>(); \n }\n return rst;\n }",
"public Matrix rowMultiply(int row, ComplexNumber weight) {\n\t\t// row *= weight\n\t\tMatrix m = copy();\n\t\tfor (int col = 0; col < m.N; col++) {\n\t\t\tm.ROWS[row][col] = weight.multiply(m.ROWS[row][col]);\n\t\t}\n\t\treturn m;\n\t}",
"public Matrix(int m, int n) {\n this.m = m;\n this.n = n;\n data = new double[m][n];\n }",
"public interface IMatrix extends IArray<IMatrix>{\n\n IVector getRow(int index);\n\n IVector getColumn(int index);\n\n// IMatrix addi(IMatrix mat);\n\n// IMatrix subi(IMatrix mat);\n\n double[][] asDouble();\n\n float[][] asFloat();\n\n IMatrix subiColumn(int index, IVector vec);\n\n// IMatrix dup();\n\n IMatrix putiRow(int index, IVector vec);\n\n int rows();\n\n int columns();\n}",
"public static Matrix random(int m, int n) {\n Matrix A = new Matrix(m,n);\n double[][] X = A.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n X[i][j] = Math.random();\n }\n }\n return A;\n }",
"static void printMat(Integer mat[][], int n)\n\t{\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}",
"public Mat2 mult(double s) {\n\t\tdouble[][] newData = new double[rows][cols];\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<cols; j++) {\n\t\t\t\tnewData[i][j] = data[i][j] * s;\n\t\t\t}\n\t\t}\n\t\treturn new Mat2(newData);\n\t}",
"public Matrix(int n) {\n\t\tsize = n;\n\t\tm = new int[size][size];\n\t}",
"public static Matrix rows(double[][] rscs) {\n\t\tint rows = rscs.length;\n\t\tint columns = rscs[0].length;\n\t\tMatrix m = new Matrix(rows, columns);\n\t\tfor (int r = 0; r < rows; r++) {\n\t\t\tfor (int c = 0; c < columns; c++) {\n\t\t\t\tm.matrix[r][c] = rscs[r][c];\n\t\t\t}\n\t\t}\n\t\treturn m;\n\t}",
"public Matrix rowMultiply(int row, int weight) {\n\t\treturn rowMultiply(row, new ComplexNumber(new Fraction(weight)));\n\t}",
"@Override\n\tpublic IMatrix nMultiply(IMatrix other) {\n\n\t\tif (this.getColsCount() != other.getRowsCount()) {\n\t\t\tthrow new IncompatibleOperandException(\n\t\t\t\t\t\"For matrix multiplication first matrix must have same number of columns as number of rows of the other matrix!\");\n\t\t}\n\t\tint m = this.getRowsCount();\n\t\tint n = other.getColsCount();\n\t\tint innerDimension = this.getColsCount();\n\t\tdouble[][] p = new double[m][n];\n\n\t\tfor (int i = 0; i < m; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\tdouble sum = 0;\n\t\t\t\tfor (int k = 0; k < innerDimension; k++) {\n\t\t\t\t\tsum += this.get(i, k) * other.get(k, j);\n\t\t\t\t}\n\t\t\t\tp[i][j] = sum;\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(m, n, p, true);\n\t}",
"@Override\n public Matrix idct(final MatrixView in) {\n check(in);\n double[][] out = new double[in.getRows()][in.getColumns()];\n double tmp1, tmp2, tmp3, tmp4;\n double tmpm0 = 0, tmpm1 = 0, tmpm2 = 0, tmpm3 = 0, tmpm4 = 0, tmpm5 = 0, tmpm6 = 0, tmpm7 = 0;\n double tmpm20, tmpm21, tmpm22, tmpm23, tmpm24, tmpm25, tmpm26, tmpm27 = 0;\n double[] outtmpmyi = null;\n\n for (int my = 0; my < in.getRows(); my += SIZE) {\n for (int mx = 0; mx < in.getColumns(); mx += SIZE) {\n for (int i = 0; i < 8; i++) {\n outtmpmyi = out[my + i];\n\n tmpm0 = in.getDouble(my + i, mx + 0);\n tmpm1 = in.getDouble(my + i, mx + 1);\n tmpm2 = in.getDouble(my + i, mx + 2);\n tmpm3 = in.getDouble(my + i, mx + 3);\n tmpm4 = in.getDouble(my + i, mx + 4);\n tmpm5 = in.getDouble(my + i, mx + 5);\n tmpm6 = in.getDouble(my + i, mx + 6);\n tmpm7 = in.getDouble(my + i, mx + 7);\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n outtmpmyi[mx + 0] = tmpm0 + tmpm7;\n outtmpmyi[mx + 7] = tmpm0 - tmpm7;\n outtmpmyi[mx + 1] = tmpm1 + tmpm6;\n outtmpmyi[mx + 6] = tmpm1 - tmpm6;\n outtmpmyi[mx + 2] = tmpm2 + tmpm5;\n outtmpmyi[mx + 5] = tmpm2 - tmpm5;\n outtmpmyi[mx + 3] = tmpm3 + tmpm4;\n outtmpmyi[mx + 4] = tmpm3 - tmpm4;\n\n }\n\n for (int i = 0; i < 8; i++) {\n\n tmpm0 = out[my + 0][mx + i];\n tmpm1 = out[my + 1][mx + i];\n tmpm2 = out[my + 2][mx + i];\n tmpm3 = out[my + 3][mx + i];\n tmpm4 = out[my + 4][mx + i];\n tmpm5 = out[my + 5][mx + i];\n tmpm6 = out[my + 6][mx + i];\n tmpm7 = out[my + 7][mx + i];\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n out[my + 0][mx + i] = tmpm0 + tmpm7;\n out[my + 7][mx + i] = tmpm0 - tmpm7;\n out[my + 1][mx + i] = tmpm1 + tmpm6;\n out[my + 6][mx + i] = tmpm1 - tmpm6;\n out[my + 2][mx + i] = tmpm2 + tmpm5;\n out[my + 5][mx + i] = tmpm2 - tmpm5;\n out[my + 3][mx + i] = tmpm3 + tmpm4;\n out[my + 4][mx + i] = tmpm3 - tmpm4;\n }\n }\n }\n\n return new DoubleMatrix(in.getRows(), in.getColumns(), out);\n }",
"public static int[][] generate(int dimension){\n int[][] matrix = new int[dimension][dimension];\n for (int i = 0; i < dimension; i++) {\n for (int j = 0; j < dimension; j++) {\n matrix[i][j] = r.nextInt(10);\n }\n }\n return matrix;\n }",
"public Matrix rref() {\n\t\tMatrix m = ref();\n\t\tint pivotRow = m.M - 1;\n\t\tArrayList<Integer> pivotColumns = m.pivotColumns();\n\t\tCollections.reverse(pivotColumns);\n\t\tfor (int i = 0; i < pivotColumns.size(); i++) {\n\t\t\tint pivotCol = pivotColumns.get(i);\n\t\t\twhile (pivotRow >= 0 && m.ROWS[pivotRow][pivotCol].equals(new ComplexNumber(0))) {\n\t\t\t\tpivotRow--;\n\t\t\t}\n\t\t\tfor (int upperRow = pivotRow - 1; upperRow > -1; upperRow--) {\n\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\tComplexNumber factor2 = m.ROWS[upperRow][pivotCol];\n\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][pivotCol];\n\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\tm = m.rowAdd(upperRow, pivotRow, weight);\n\t\t\t}\n\t\t\tpivotRow--;\n\t\t}\n\t\treturn m;\n\t}",
"public Matrix(double[][] A, int m, int n) {\n this.data = A;\n this.m = m;\n this.n = n;\n }",
"public int[][] generateMatrix(int n) {\n // input checking\n if (n < 0) {\n return null;\n }\n\n // start fill in the matrix (consider what happen when n == 0)\n // test case: input == 0; expect [];\n int[][] matrix = new int[n][n];\n int lo = 0, hi = matrix.length - 1;\n int num = 1;\n while (lo <= hi) {\n // pay attention to when lo == hi\n if (lo == hi) {\n matrix[lo][lo] = num;\n break;\n }\n // otherwise, fill this layer\n for (int i = lo; i < hi; i++) { // attention i < hi not i <= hi\n matrix[lo][i] = num++;\n }\n for (int i = lo; i < hi; i++) {\n matrix[i][hi] = num++;\n }\n for (int i = hi; i > lo; i--) {\n matrix[hi][i] = num++;\n }\n for (int i = hi; i > lo; i--) {\n matrix[i][lo] = num++;\n }\n lo++;\n hi--;\n }\n return matrix;\n }",
"public static Matrix rowMultiplyE(int row, ComplexNumber weight, int m) {\n\t\treturn identity(m).rowMultiply(row, weight);\n\t}",
"private static void countRiddle(int[][] a, int m) {\n for (int i=0; i<9; ++i) {\n for (int j=0; j<9; ++j) {\n a[i][j] = ( a[i][j] * m ) % 9 + 1;\n }\n }\n }",
"public T createLike() {\n return createMatrix(numRows(), numCols(), getType());\n }",
"private void imprimirMatriz(int[][] m) {\n\n\t\tSystem.out.println(\"-------------------------------------------\");\n\t\tfor (int i = 0; i < 4; i++) {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tSystem.out.println(\"M[\" + i + \"][\" + j + \"] = \" + m[i][j]);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"-------------------------------------------\");\n\t}",
"public List<List<Integer>> generate(int numRows)\n {\n List<List<Integer>> allrows = new ArrayList<List<Integer>>();\n ArrayList<Integer> row = new ArrayList<Integer>();\n for(int i=0;i<numRows;i++)\n {\n row.add(0, 1);\n for(int j=1;j<row.size()-1;j++)\n row.set(j, row.get(j)+row.get(j+1));\n allrows.add(new ArrayList<Integer>(row));\n }\n return allrows;\n }",
"public Matrix(int nrow, int ncol){\r\n\t\tthis.nrow = nrow;\r\n\t\tthis.ncol = ncol;\r\n\t \tthis.matrix = new double[nrow][ncol];\r\n\t\tthis.index = new int[nrow];\r\n for(int i=0;i<nrow;i++)this.index[i]=i;\r\n }",
"private void expand(DMatrixRMaj M){\n Equation eq = new Equation();\n eq.alias(M, \"M\");\n\n for(int i=0; i < this.expansionPow-1; i++){\n eq.process(\"M = M * M\");\n }\n }",
"@Override\n\tpublic ImgRep getRep(int num) {\n\t\treturn dao.select(num);\n\t}",
"int[][] multiple(int size) {\n\t\t size++; // наверняка пользователь захочет получить таблицу до того номера ВКЛЮЧИТЕЛЬНО, который укажет во входных параметрах\n\t\t int[][] mult = new int[size][size]; \n\t\t for (int i = 0; i < size; i++) {\n\t\t\t for (int j = 0; j < size; j++) {\n\t\t\t\t mult[i][j] = i * j;\n\t\t\t }\n\t\t }\n\t\t return mult;\n\t }",
"public int[][] generateMatrix(int n) {\n int[][] matrix = new int[n][n];\n int counter = 1;\n for(int layer = 0; layer < (n + 1)/2; layer++){\n matrix[layer][layer] = counter++;\n for(int i = layer + 1; i < n - layer; i++) matrix[layer][i] = counter++;\n for(int i = layer + 1; i < n - layer; i++) matrix[i][n-layer-1] = counter++;\n //if(layer == (n + 1)/2 - 1 && n % 2 == 1) break;\n for(int i = n - layer - 2; i >= layer; i--) matrix[n-layer-1][i] = counter++;\n for(int i = n - layer - 2; i > layer; i--) matrix[i][layer] = counter++;\n }\n return matrix;\n }"
] | [
"0.68633795",
"0.5239531",
"0.5120538",
"0.50425506",
"0.50140154",
"0.50041103",
"0.5001834",
"0.49926543",
"0.49902546",
"0.49836633",
"0.49797547",
"0.4959355",
"0.4921879",
"0.48935443",
"0.48321986",
"0.48141986",
"0.48037714",
"0.47779644",
"0.47754914",
"0.47679377",
"0.47526237",
"0.47326875",
"0.47280413",
"0.47230315",
"0.47173974",
"0.47062856",
"0.4705632",
"0.4668353",
"0.46645516",
"0.46628207",
"0.46501675",
"0.46486405",
"0.4648308",
"0.46217108",
"0.46170294",
"0.46057567",
"0.46033743",
"0.46013853",
"0.45973736",
"0.4596904",
"0.4594835",
"0.45911536",
"0.45868474",
"0.45865673",
"0.45577484",
"0.45561248",
"0.45531517",
"0.45511413",
"0.45506945",
"0.45444262",
"0.4543004",
"0.45404404",
"0.45348343",
"0.45326927",
"0.45126644",
"0.45125568",
"0.449988",
"0.44900495",
"0.44855422",
"0.4484267",
"0.4476556",
"0.4476109",
"0.44756782",
"0.44678888",
"0.44660354",
"0.44567338",
"0.44402957",
"0.44157633",
"0.441488",
"0.4413501",
"0.44119734",
"0.44114804",
"0.4408869",
"0.44041735",
"0.4403816",
"0.44036993",
"0.44023472",
"0.44012815",
"0.4396888",
"0.4396433",
"0.43928194",
"0.43896332",
"0.43836752",
"0.43808407",
"0.4380112",
"0.4380016",
"0.43788084",
"0.4372884",
"0.43603358",
"0.43580174",
"0.43576947",
"0.43548214",
"0.4351599",
"0.43479848",
"0.43476844",
"0.43356892",
"0.4328864",
"0.43056792",
"0.42995012",
"0.42943513"
] | 0.70687586 | 0 |
implements matlab function and parameters for repmat(m(row,:)', nRowsFactor, nColsFactor) e.g. extract a single row from the m.numRows present in m, (this is a 1 X m.numCols vector), then transpose that vector (result is m.numCols X 1), then replicate into the output matrix that single column nRowsFactor times along rows then replicate all of the output columns, nColsFactor times along columns. the result is a matrix of size (nRowsFactor m.numCols) X nColsFactor. | public static DenseMatrix exRowConjRepl(DenseMatrix m, int row, int nRowsFactor, int nColsFactor) {
// 0) repmat(X2(3,:)',1,3). X2 size is 3 X nData.
// extract row 2 for all columns. this is 1 X nData of all "1's"
// transpose X2 extract. result is nData X 1 matrix.
// replicate it to new matrix once along rows, and 3 times along
// columns.
DenseMatrix at = exRowRepl(m, row, nColsFactor, nRowsFactor);
DenseMatrix out = MatrixUtil.transpose(at);
return out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static DenseMatrix exRowRepl(DenseMatrix m, int row, int nRowsFactor, int nColsFactor) {\n\n //repmat(m(3,:),1,3) <--- replicate row 2, 1 time by row, 3 times by columns\n \n int nRows = nRowsFactor;\n int nCols = m.numColumns() * nColsFactor;\n \n DenseMatrix out = new DenseMatrix(nRows, nCols);\n // replicate the row along rows\n for (int c = 0; c < m.numColumns(); ++c) {\n double v = m.get(row, c);\n for (int r = 0; r < nRows; ++r) {\n out.set(r, c, v);\n }\n }\n \n /* nRowsFactor=2 nColsFactor=3\n 0 1 2 0 1 2 0 1 2\n 0 1 2\n */\n \n // replicate along columns\n for (int r = 0; r < nRows; ++r) {\n for (int cf = 0; cf < nColsFactor; ++cf) {\n int c2 = m.numColumns() * cf;\n for (int c = 0; c < m.numColumns(); ++c) {\n double v = out.get(r, c);\n out.set(r, c2 + c, v);\n }\n }\n }\n\n return out;\n }",
"public static int[][] transposeMultMatrix(int initialValue,int rows,int columns)\n {\n int[][] ori = new int[rows][columns];\n int[][] orit = new int[columns][rows];\n int[][] res = new int[rows][rows];\n int i,j;\n for(i=0; i<rows; i++) {\n for(j=0; j<columns; j++) {\n ori[i][j] = initialValue;\n orit[j][i] = initialValue;\n initialValue++;\n }\n }\n int xi,yj;\n for(i=0; i<rows; i++) {\n for(j=0; j<rows; j++) {\n for(xi=0,yj=0; xi<columns&&yj<columns; xi++,yj++) {\n res[i][j] += ori[i][xi]*orit[yj][j];\n }\n }\n }\n return res;\n }",
"public Matrix copy() {\n\t\tComplexNumber[][] rows = new ComplexNumber[M][];\n\t\tfor (int row = 0; row < M; row++) {\n\t\t\trows[row] = new ComplexNumber[N];\n\t\t\tfor (int col = 0; col < N; col++) {\n\t\t\t\trows[row][col] = ROWS[row][col];\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(rows);\n\t}",
"public Matrix multiplyTransposeM(Matrix m) {\n\t\tMatrix newMatrix = new Matrix(nbRows, m.getNbRows());\n\t\tmultiplyTransposeB(this, m, newMatrix);\n\n\t\treturn newMatrix;\n\t}",
"public Mat2 mult(Mat2 m) {\n\t\tdouble[][] newData = new double[rows][m.cols];\n\t\t//if(rows != m.cols) throw new IllegalArgumentException(\"cannot multiply a \" + rows + \" by \" + cols + \n\t\t\t//\t\" matrix and a \" + m.rows + \" by \" + m.cols + \" matrix\");\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<m.cols; j++) {\n\t\t\t\tdouble total = 0.0;\n\t\t\t\tfor(int c=0; c<cols; c++) {\n\t\t\t\t\ttotal += data[i][c] * m.data[c][j];\n\t\t\t\t}\n\t\t\t\tnewData[i][j] = total;\n\t\t\t}\n\t\t}\n\t\treturn new Mat2(newData);\n\t}",
"public static Matrix product(Matrix m) {\n int rows_c = m.rows(), cols_c = m.cols();\n Matrix d;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c, m);\n for (int col = 1; col <= cols_c; col++) {\n double prodCol = 1D;\n for (int row = 1; row <= rows_c; row++) {\n prodCol = prodCol * m.get(row, col);\n }\n d.set(1, col, prodCol);\n }\n }\n return d;\n }",
"Matrix mul(Matrix m){\n if(m.cols != this.cols || m.rows != this.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n Matrix matrix_to_return = new Matrix(m.rows, m.cols);\n for(int i=0; i<m.rows * m.cols; i++){\n matrix_to_return.data[i] = this.data[i] * m.data[i];\n }\n return matrix_to_return;\n }",
"protected abstract T createMatrix( int numRows, int numCols, MatrixType type );",
"public static int[][] generateMatrix() {\n int rowsCount = RANDOM.nextInt( MAX_ROWS_COUNT ) + 1;\n int[][] result = new int[rowsCount][];\n for (int i = 0; i < rowsCount; i++) {\n result[i] = new int[RANDOM.nextInt( MAX_COLUMNS_COUNT ) + 1];\n fillArray( result[i] );\n }\n return result;\n }",
"public static Matrix Identity(int n) {\n List<List<Double>> backingArray = get2DListOfSize(n);\n for(int i = 0; i < n; i++)\n backingArray.get(i).set(i, 1d);\n return new Matrix(backingArray);\n }",
"public static Matrix rows(double[] rs) {\n\t\tint rows = rs.length;\n\t\tint columns = 1;\n\t\tMatrix m = new Matrix(rows, columns);\n\t\tfor (int r = 0; r < rows; r++) {\n\t\t\tm.matrix[r][0] = rs[r];\n\t\t}\n\t\treturn m;\n\t}",
"private static DenseMatrix generateRandomMatrix (int rows, int cols, int m_seed){\n\n Random random_value = new Random(m_seed);\n DenseMatrix randomMX = new DenseMatrix(rows, cols);\n for (int i=0; i<rows; i++){\n for (int j=0; j<cols;j++){\n randomMX.set(i,j, random_value.nextDouble());\n }\n }\n return randomMX;\n }",
"public int[][] generateMatrix(int n) {\n\t\tint[][] res = new int[n][n];\r\n\t\tint x = 0;\r\n\t\tint num = 1;\r\n\t\twhile (n > 1) {\r\n\t\t\tfor (int i = x; i < x + n - 1; i++)\r\n\t\t\t\tres[x][i] = num++;\r\n\t\t\tfor (int i = x; i < x + n - 1; i++)\r\n\t\t\t\tres[i][x + n - 1] = num++;\r\n\t\t\tfor (int i = x + n - 1; i > x; i--)\r\n\t\t\t\tres[x + n - 1][i] = num++;\r\n\t\t\tfor (int i = x + n - 1; i > x; i--)\r\n\t\t\t\tres[i][x] = num++;\r\n\t\t\tn -= 2;\r\n\t\t\tx++;\r\n\t\t}\r\n\t\tif (n == 1)\r\n\t\t\tres[x][x] = num;\r\n\t\treturn res;\r\n\t}",
"public Matrix4f GetMultipliedMatrix(Matrix4f m) {\n\n\t/*\n\tinputs--\n\t\n\tm :\n\t The input matrix m, instance of Matrix4f\n\t*/\n\t\n\t/*\n\toutputs--\n\t\n\tmul :\n\t The matrix this times m\n\t*/\n\t\n\t// Create new matrix to hold the results\n\tMatrix4f mul = new Matrix4f();\n\t\n\t// Double for loop based standard multiplication\n\tfor (int n_i = 0; n_i < 4; n_i ++) {\n\t \n\t for(int n_j = 0; n_j < 4 ; n_j ++) {\n\t\t\n\t\t// Set entry one by one\n\t\tfloat f_val = 0;\n\t\tfor (int n_k = 0; n_k < 4; n_k ++) {\n\t\t\n\t\t f_val += this.mat_f_m[n_i][n_k]*m.GetComponent(n_k, n_j);\n\t\t\n\t\t}\n\t\tmul.SetComponent(n_i, n_j, f_val);\n\t\t\n\t }\n\t\n\t}\n\t\n\t// Return the multiplied matrix\n\treturn mul;\n \n }",
"static Matrix vectorize(Matrix input) {\n int m = input.getRowDimension();\n int n = input.getColumnDimension();\n\n Matrix result = new Matrix(m * n, 1);\n for (int p = 0; p < n; p++) {\n for (int q = 0; q < m; q++) {\n result.set(p * m + q, 0, input.get(q, p));\n }\n }\n return result;\n }",
"public Matrix multiplyTransposeSelf(Matrix m) {\n\t\tMatrix newMatrix = new Matrix(nbColumns, m.getNbColumns());\n\t\tmultiplyTransposeA(this, m, newMatrix);\n\n\t\treturn newMatrix;\n\t}",
"public double[] getRowPackedCopy() {\n double[] vals = new double[m*n];\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n vals[i*n+j] = data[i][j];\n }\n }\n return vals;\n }",
"public Matrix times(double constant){\r\n \tMatrix cmat = new Matrix(this.nrow, this.ncol);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\tcarray[i][j] = this.matrix[i][j]*constant;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}",
"public int[][] generateMatrix(int n) {\n\t\tif (n <= 0) {\n\t\t\treturn new int[0][0];\n\t\t}\n\n\t\tint[][] res = new int[n][n];\n\t\tint num = 1;\n\t\tint r1 = 0, c1 = 0, r2 = n-1, c2 = n-1;\n\t\twhile (r1 <= r2 && c1 <= c2) {\n\t\t\tfor (int c = c1; c <= c2; c++) {\n\t\t\t\tres[r1][c] = num++;\n\t\t\t}\n\n\t\t\tfor (int r = r1 + 1; r <= r2; r++) {\n\t\t\t\tres[r][c2] = num++;\n\t\t\t}\n\n\t\t\tif (r1 < r2) {\n\t\t\t\tfor (int c = c2 - 1; c > c1; c--) {\n\t\t\t\t\tres[r2][c] = num++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (c1 < c2) {\n\t\t\t\tfor (int r = r2; r > r1; r--) {\n\t\t\t\t\tres[r][c1] = num++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tr1++;\n\t\t\tc1++;\n\t\t\tr2--;\n\t\t\tc2--;\n\t\t}\n\n\t\treturn res;\n\t}",
"private void replicate(Version theTask) {\n\tsynchronized(_replicatorQueue) {\n\t for (int i = 0; i < _replicatorQueue.size(); i++) {\n\t\tReplicatorHandle rh = (ReplicatorHandle) \n\t\t _replicatorQueue.get(i);\n\t\trh.replicate(theTask, _replicatorQueue, this);\n\t }\n\t}\n }",
"public Matrix(Fraction[][] rows) {\n\t\tComplexNumber[][] complexRows = new ComplexNumber[rows.length][];\n\t\tfor (int row = 0; row < rows.length; row++) {\n\t\t\tcomplexRows[row] = new ComplexNumber[rows[row].length];\n\t\t\tfor (int col = 0; col < rows[row].length; col++) {\n\t\t\t\tcomplexRows[row][col] = new ComplexNumber(rows[row][col]);\n\t\t\t}\n\t\t}\n\t\tROWS = complexRows;\n\t\tM = complexRows.length;\n\t\tN = complexRows[0].length;\n\t\tfor (int row = 0; row < M; row++) {\n\t\t\tif (complexRows[row].length != N) {\n\t\t\t\tthrow new RuntimeException(\"Non-Rectangular Matrix!\");\n\t\t\t}\n\t\t}\n\t}",
"public interface IMatrixMultiplicator {\n\n\t/**\n\t * Multiplies two matrixes and returns the result in a new matrix \n\t * \n\t * @param matrixA first matrix\n\t * @param matrixB second matrix \n\t * @return result of the multiplication\n\t */\n\tpublic long multiplyMatrix(final Matrix matrixA, final Matrix matrixB, final Matrix res);\n\t \n\t\n}",
"protected ArrayList<double[]> newMatrix(int _rows, int _cols) {\n ArrayList<double[]> matrix = new ArrayList<double[]>();\n for (int i=0; i<_rows; i++) {\n matrix.add(new double[_cols]);\n }\n return matrix;\n }",
"public int[][] generateMatrix(int n) {\n int[][] matrix = new int[n][n];\r\n generateMatrix(matrix, 0, 1);\r\n return matrix;\r\n }",
"Matrix(double[][] input) {\n matrixVar = input;\n columns = matrixVar[0].length;\n rows = matrixVar.length;\n }",
"public static int[][] makeReflexive(int[][] m)\n {\n return new int[m.length][m[0].length];\n }",
"public static Matrix identityMatrix(int nrow){\r\n \tMatrix u = new Matrix(nrow, nrow);\r\n \tfor(int i=0; i<nrow; i++){\r\n \t\tu.matrix[i][i]=1.0;\r\n \t}\r\n \treturn u;\r\n \t}",
"Matrix mult(Matrix M){\n if(this.getSize() != M.getSize()){\n throw new RuntimeException(\"Matrix\");\n\n } \n int newMatrixSize = this.getSize();\n Matrix newM = M.transpose();\n Matrix resultMatrix = new Matrix(newMatrixSize);\n double resultMatrix_Entry = 0;\n for(int i = 1; i <= newMatrixSize; i++){\n for(int j = 1; j<= newMatrixSize; j++){\n List itRow_A = this.rows[i - 1];\n List itRow_B = newM.rows[j-1];\n itRow_A.moveFront();\n itRow_B.moveFront();\n while((itRow_A.index() != -1) && (itRow_B.index() != -1)){\n Entry c_A = (Entry)itRow_A.get();\n Entry c_B = (Entry) itRow_B.get();\n if(c_A.column == c_B.column){\n resultMatrix_Entry += (c_A.value)*(c_B.value);\n itRow_A.moveNext();\n itRow_B.moveNext();\n\n } else if(c_A.column > c_B.column){\n itRow_B.moveNext();\n\n }else{\n itRow_A.moveNext();\n }\n\n }\n resultMatrix.changeEntry(i, j, resultMatrix_Entry);\n resultMatrix_Entry = 0;\n }\n }\n return resultMatrix;\n\n }",
"public void reshape( int numRows, int numCols ) {\n if (mat.getType().isFixed()) {\n throw new IllegalArgumentException(\"Can't reshape a fixed sized matrix\");\n } else {\n ((ReshapeMatrix)mat).reshape(numRows, numCols);\n }\n }",
"Matrix transpose(){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n // if(!itRow[i].isEmpty()){\n itRow.moveFront();\n // itRow[i].moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(c.column, i, c.value);\n itRow.moveNext();\n }\n }\n return newM;\n }",
"public Matrix copy() {\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n C[i][j] = data[i][j];\n }\n }\n return X;\n }",
"public int[][] generateMatrix(int n) {\n\t\tint[][] res = {};\n\t\tif (n <= 0) {\n\t\t\treturn res;\n\t\t}\n\t\tres = new int[n][n];\n\t\tint x = 0;\n\t\tint y = 0;\n\t\tint count = 1;\n\n\t\twhile (n > 0) {\n\t\t\tif (n == 1) {\n\t\t\t\tres[x][y] = count;\n\t\t\t}\n\t\t\t// move right\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x][y++] = count++;\n\t\t\t}\n\t\t\t// move down\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x++][y] = count++;\n\t\t\t}\n\t\t\t// move left\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x][y--] = count++;\n\t\t\t}\n\t\t\t// move up\n\t\t\tfor (int i = 0; i < n - 1; ++i) {\n\t\t\t\tres[x--][y] = count++;\n\t\t\t}\n\t\t\tx = x + 1;\n\t\t\ty = y + 1;\n\t\t\tn = n - 2;\n\t\t}\n\t\treturn res;\n\t}",
"public Matrix times(double[][] bmat){\r\n \t int nr=bmat.length;\r\n \tint nc=bmat[0].length;\r\n\r\n \tif(this.ncol!=nr)throw new IllegalArgumentException(\"Nonconformable matrices\");\r\n\r\n \tMatrix cmat = new Matrix(this.nrow, nc);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n \tdouble sum = 0.0D;\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<nc; j++){\r\n \t\tsum=0.0D;\r\n \t\tfor(int k=0; k<this.ncol; k++){\r\n \t\t\tsum += this.matrix[i][k]*bmat[k][j];\r\n \t\t}\r\n \t\tcarray[i][j]=sum;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}",
"public Matrix transpose() {\n\t\tMatrix a = copy();\n\t\tComplexNumber[][] values = new ComplexNumber[a.N][];\n\t\tfor (int col = 0; col < a.N; col++) {\n\t\t\tvalues[col] = new ComplexNumber[a.M];\n\t\t\tfor (int row = 0; row < a.M; row++) {\n\t\t\t\tvalues[col][row] = a.ROWS[row][col]; \t\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(values);\n\t}",
"public static int[][] transposeMatrix(int[][] A){\n //takes 2 D and returns 2D\n int newWidth=A.length;\n int newHeight=A[0].length;\n //get two dimensions for new matrix\n int[][] transposeA=new int[newHeight][newWidth];\n //switch dimensions\n //use for loop to reassign values\n for(int i=0; i<newHeight; i++){\n for(int k=0; k<newWidth; k++){\n //imbedded for loop for individual values\n transposeA[i][k]=A[k][i];\n System.out.print(transposeA[i][k]+\" \");\n \n }\n System.out.println();\n }\n return transposeA;\n \n }",
"public static void RepeatedElementsRow(int[][] array) {\n\n }",
"public Matrix xMatrixTranspose(){\n if(!this.pcaDone)this.pca();\n double denom = this.nItems;\n if(!super.nFactorOption)denom -= 1.0;\n Matrix mat = dataMinusMeansTranspose.times(1.0/Math.sqrt(denom));\n return mat;\n }",
"void reshape(int newRows,int newCols) {\n if (rows * cols != newRows * newCols)\n throw new IllegalArgumentException(String.format(\"%d x %d matrix can't be reshaped to %d x %d\", rows, cols, newRows, newCols));\n this.cols = newCols;\n this.rows = newRows;\n double[][] tmp = this.asArray();\n int k = 0;\n for (int i = 0; i < cols; i++) {\n for (int j = 0; j < rows; j++) {\n this.data[k] = tmp[j][i];\n k++;\n }\n }\n }",
"public int[][] initMatrix(int n)\n {\n\t// create an empty 2d array and return it! Simple stuff here.\n\t int[][] retMatrix = new int[n][n];\n\t return retMatrix;\n }",
"public void matrixMultiply(Matrix m) {\n if (cols == m.getRows()) {\n ArrayList<double[]> result = newMatrix(rows, m.getCols());\n for (int i=0; i<rows; i++) {\n for (int k=0; k<m.getCols(); k++) {\n double sum = 0;\n for (int j=0; j<cols; j++) {\n sum += matrix.get(i)[j] * m.get(j, k);\n }\n result.get(i)[k] = sum;\n }\n }\n setMatrix(result, rows, m.getCols()); // Rows is that of original matrix, Columns is that of the multiplying matrix\n }\n else {\n throw new MatrixMultiplicationDimensionException();\n }\n }",
"public int[][] generateMatrix(int n) {\n int[][] result = new int[n][n];\n int val = 1;\n int rowBegin = 0;\n int colBegin = 0;\n int rowEnd = n - 1;\n int colEnd = n - 1;\n while (rowBegin <= rowEnd && colBegin <= colEnd) {\n // travel right\n for (int j = colBegin; j <= colEnd; j++) {\n result[rowBegin][j] = val++;\n }\n rowBegin++;\n // travel down\n for (int i = rowBegin; i <= rowEnd; i++) {\n result[i][colEnd] = val++;\n }\n colEnd--;\n // travel left\n if (rowBegin <= rowEnd) {\n for (int j = colEnd; j >= colBegin; j--) {\n result[rowEnd][j] = val++;\n }\n }\n rowEnd--;\n // travel up\n if (colBegin <= colEnd) {\n for (int i = rowEnd; i >= rowBegin; i--) {\n result[i][colBegin] = val++;\n }\n }\n colBegin++;\n }\n return result;\n\n }",
"public static Matrix constructWithCopy(double[][] A) throws JPARSECException {\n int m = A.length;\n int n = A[0].length;\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n if (A[i].length != n) {\n throw new JPARSECException\n (\"All rows must have the same length.\");\n }\n for (int j = 0; j < n; j++) {\n C[i][j] = A[i][j];\n }\n }\n return X;\n }",
"static void printMatrix(int[][] inp){\n\n for(int i=0;i<inp.length;i++){\n for(int j=0;j<inp[0].length;j++){\n System.out.print(inp[i][j]+\" \");\n }\n System.out.println(\"\");\n }\n }",
"public Matrix times(double s) {\n Matrix X = new Matrix(m,n);\n double[][] C = X.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n C[i][j] = s*data[i][j];\n }\n }\n return X;\n }",
"public SudokuSolver(int[][] m) {\n // ideally we would have liked to have just done:\n // this.matrix = m; but this would allow outside class\n // to change our internal representation, safer to copy instead.\n // Note: intentionally not doing a clone of rows.\n matrix = new int[DIM][DIM];\n IntStream.range(0, DIM * DIM)\n .forEach(\n n -> {\n int i = n / DIM;\n int j = n % DIM;\n matrix[i][j] = m[i][j];\n });\n }",
"@Override\n public Matrix like(int rows, int columns) {\n return new PivotedMatrix(base.like(rows, columns));\n }",
"private ICalculator[][] createMultipleRows(int rowCount, ICalculator[] calcPrototypes ){\n ICalculator[][] result = new ICalculator[rowCount][calcPrototypes.length];\n \tfor(int i=0; i< rowCount; i++){\n \t\tresult[i] = new ICalculator[calcPrototypes.length];\n \t\tfor (int j = 0; j < calcPrototypes.length; j++) {\n \t\t\tresult[i][j] = (ICalculator)calcPrototypes[j].clone();\n \t\t}\n \t}\n return result;\n }",
"public static int[][] reshapeMatrix(int nums[][], int r, int c)\n\t{\n\t\tint size = nums.length * nums[0].length;\n\t\tQueue<Integer> q = new LinkedList<>();\n\t\t// Result array\n\t\tint[][] result = new int[r][c];\n\t\t//If dimensions don't match\n\t\tif (size != r*c)\n\t\t{\n\t\t\treturn nums;\n\t\t}\n\t\t\n\t\t//Without Queue\n\t\tint rows = 0, cols = 0;\n\t\tfor (int i = 0; i < nums.length; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < nums[0].length; j++)\n\t\t\t{\n\t\t\t\tresult[rows][cols] = nums[i][j];\n\t\t\t\tcols++;\n\t\t\t\tif (cols == c)\n\t\t\t\t{\n\t\t\t\t\trows++;\n\t\t\t\t\tcols = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn result;\n\t}",
"Matrix scalarMult(double x){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n itRow.moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(i, c.column, (x*c.value));\n itRow.moveNext();\n }\n }\n\n return newM;\n }",
"public List<List<GenPolynomial<C>>> \n normalizeMatrix(int flen, List<List<GenPolynomial<C>>> M) { \n if ( M == null ) {\n return M;\n }\n if ( M.size() == 0 ) {\n return M;\n }\n List<List<GenPolynomial<C>>> N = new ArrayList<List<GenPolynomial<C>>>();\n List<List<GenPolynomial<C>>> K = new ArrayList<List<GenPolynomial<C>>>();\n int len = M.get( M.size()-1 ).size(); // longest row\n // pad / extend rows\n for ( List<GenPolynomial<C>> row : M ) {\n List<GenPolynomial<C>> nrow = new ArrayList<GenPolynomial<C>>( row );\n for ( int i = row.size(); i < len; i++ ) {\n nrow.add( null );\n }\n N.add( nrow );\n }\n // System.out.println(\"norm N fill = \" + N);\n // make zero columns\n int k = flen;\n for ( int i = 0; i < N.size(); i++ ) { // 0\n List<GenPolynomial<C>> row = N.get( i );\n if ( debug ) {\n logger.info(\"row = \" + row);\n }\n K.add( row );\n if ( i < flen ) { // skip identity part\n continue;\n }\n List<GenPolynomial<C>> xrow;\n GenPolynomial<C> a;\n //System.out.println(\"norm i = \" + i);\n for ( int j = i+1; j < N.size(); j++ ) {\n List<GenPolynomial<C>> nrow = N.get( j );\n //System.out.println(\"nrow j = \" +j + \", \" + nrow);\n if ( k < nrow.size() ) { // always true\n a = nrow.get( k );\n //System.out.println(\"k, a = \" + k + \", \" + a);\n if ( a != null && !a.isZERO() ) {\n xrow = blas.scalarProduct( a, row);\n xrow = blas.vectorAdd(xrow,nrow);\n //System.out.println(\"xrow = \" + xrow);\n N.set( j, xrow );\n }\n }\n }\n k++;\n }\n //System.out.println(\"norm K reduc = \" + K);\n // truncate \n N.clear();\n for ( List<GenPolynomial<C>> row: K ) {\n List<GenPolynomial<C>> tr = new ArrayList<GenPolynomial<C>>();\n for ( int i = 0; i < flen; i++ ) {\n tr.add( row.get(i) );\n }\n N.add( tr );\n }\n K = N;\n //System.out.println(\"norm K trunc = \" + K);\n return K;\n }",
"Matrix mul(double w){\n Matrix matrix_to_return = new Matrix(this.rows, this.cols);\n for(int i=0; i<this.rows * this.cols; i++){\n matrix_to_return.data[i] = this.data[i] * w;\n }\n return matrix_to_return;\n }",
"public Matrice(int dim){\n\t\tnr=dim;\n\t\tnc=nr;\n\t\tmat = new int[nr][nc];\n\t}",
"public Matrix rowMultiply(int row, Fraction weight) {\n\t\treturn rowMultiply(row, new ComplexNumber(weight));\n\t}",
"public interface IMatrix {\n\n\tpublic int getRowsCount();\n\tpublic int getColsCount();\n\tpublic double get(int numberOne, int numberTwo);\n\tpublic IMatrix set(int numberOne, int numberTwo, double numberThree);\n\tpublic IMatrix copy();\n\tpublic IMatrix newInstance(int numberOne, int numberTwo);\n\tpublic IMatrix nTranspose(boolean trans);\n\tpublic IMatrix add(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nAdd(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix sub(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nSub(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic IMatrix nMultiply(IMatrix matrix) throws OperationNotSupportedException;\n\tpublic double determinant() throws OperationNotSupportedException;\n\tpublic IMatrix subMatrix(int numberOne, int numberTwo, boolean subM);\n\tpublic IMatrix nInvert() throws OperationNotSupportedException;\n\tpublic double[][] toArray();\n\tpublic IVector toVector(boolean toVect) throws OperationNotSupportedException;\n\tpublic IMatrix scalarMultiply(double value);\n\tpublic IMatrix nScalarMultiply(double value);\n\t\n}",
"public long[][] smultiply(int i){\n\t\tint sl = this.mat.length; //jumps to method sideLength to obtain the side length n of the matrix A\n\t\t//the global record contains an array of columns, where each column is an array of row elements. i.e.\n\t\t//the record contains the transpose of matrix A, where every row in the record is a column in A\n\t\t//a temporary 2D array tempMatA, and is made equal to the transpose of A\n\t\tlong[][] tempMatA = transpose(this.mat);\n\t\tlong[][] tempMat2 = new long[sl][sl]; //creates a temporary 2D matrix of the same size as tempMatA\n\t\tlong[][] outMat = new long[sl][sl];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"+\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//return matrix must be re-transposed to return a the proper format of 2D array for the global array\n\t\toutMat = transpose(outMat);\n\t\treturn outMat;\n\t}",
"private int[][] convertToTwnDimensionMatrix(int[] oneDimensionMatrix, int varNum)\r\n\t{\r\n\t\t// oneDimensionMatrix: the one dimension matrix that you want to convert:\r\n\t\t// matrixSize: the size (equals to the row or the column length) of the two dimension matrix of the result\r\n\t\tint[][] result = new int[varNum][varNum];\r\n\t\t\r\n\t\tfor (int m = 0; m < varNum; m++)\r\n\t\t{\r\n\t\t\tfor (int n = 0; n < varNum; n++)\r\n\t\t\t{\r\n\t\t\t\tresult[m][n] = oneDimensionMatrix[m*varNum + n];\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t return result;\r\n\t}",
"public Matrix transpose() {\n Matrix A = new Matrix(N, M);\n for (int i = 0; i < M; i++)\n for (int j = 0; j < N; j++)\n A.data[j][i] = this.data[i][j];\n return A;\n }",
"public Matrix(int[][] rows) {\n\t\tComplexNumber[][] complexRows = new ComplexNumber[rows.length][];\n\t\tfor (int row = 0; row < rows.length; row++) {\n\t\t\tcomplexRows[row] = new ComplexNumber[rows[row].length];\n\t\t\tfor (int col = 0; col < rows[row].length; col++) {\n\t\t\t\tFraction real = new Fraction(rows[row][col]);\n\t\t\t\tFraction imaginary = new Fraction(0);\n\t\t\t\tcomplexRows[row][col] = new ComplexNumber(real, imaginary);\n\t\t\t}\n\t\t}\n\t\tROWS = complexRows;\n\t\tM = complexRows.length;\n\t\tN = complexRows[0].length;\n\t\tfor (int row = 0; row < M; row++) {\n\t\t\tif (complexRows[row].length != N) {\n\t\t\t\tthrow new RuntimeException(\"Non-Rectangular Matrix!\");\n\t\t\t}\n\t\t}\n\t}",
"public static long[][] multiplyMod(long F[][], long M[][]){\n long x = (F[0][0]*M[0][0])%MOD + (F[0][1]*M[1][0])%MOD; \n long y = (F[0][0]*M[0][1])%MOD + (F[0][1]*M[1][1])%MOD; \n long z = (F[1][0]*M[0][0])%MOD + (F[1][1]*M[1][0])%MOD; \n long w = (F[1][0]*M[0][1])%MOD + (F[1][1]*M[1][1])%MOD; \n\n return new long[][]{{x,y},{z,w}};\n }",
"public Matrix transpose(){\r\n \tMatrix tmat = new Matrix(this.ncol, this.nrow);\r\n \tdouble[][] tarray = tmat.getArrayReference();\r\n \tfor(int i=0; i<this.ncol; i++){\r\n \t\tfor(int j=0; j<this.nrow; j++){\r\n \t\ttarray[i][j]=this.matrix[j][i];\r\n \t\t}\r\n \t}\r\n \treturn tmat;\r\n \t}",
"public Matrix copy() {\n Matrix m = new Matrix(rows, cols);\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n m.getMatrix().get(i)[j] = this.get(i, j);\n }\n }\n return m;\n }",
"public static int[][] generateMatrix(int rows, int columns) {\n\tint[][] result = new int[rows][columns];\n\tfor (int i = 0; i < rows; i++) {\n\tfor (int j = 0; j < columns; j++) {\n\tresult[i][j] = (int) (Math.random() * 100) + 1;\n\t}\n\t}\n\treturn result;\n\t}",
"public static ArrayList<ArrayList<Integer>> generate(int numRows) {\n ArrayList<ArrayList<Integer>> rst = new ArrayList<ArrayList<Integer>>(); \n ArrayList<Integer> curRow;\n if ( 0 == numRows) return rst;\n curRow = new ArrayList<Integer>();\n curRow.add(1);\n rst.add(curRow);\n if (1 == numRows) return rst;\n \n curRow = new ArrayList<Integer>();\n curRow.add(1);\n curRow.add(1);\n rst.add(curRow);\n if (2 == numRows) return rst;\n ArrayList<Integer> lastRow = curRow;\n curRow = new ArrayList<Integer>();\n \n for (int i=3;i<=numRows;i++) {\n curRow.add(1);\n \tfor (int j=1; j<i-1; j++) \n \t\tcurRow.add(lastRow.get(j-1) + lastRow.get(j));\n \tcurRow.add(1);\n \trst.add(curRow);\n \tlastRow = curRow;\n \tcurRow = new ArrayList<Integer>(); \n }\n return rst;\n }",
"public Matrix(int n) {\n\t\tsize = n;\n\t\tm = new int[size][size];\n\t}",
"private static ArrayList<ArrayList<Integer>> transposeMatrix(ArrayList<ArrayList<Integer>> matrix){\r\n\t\tint numRows = matrix.size();\r\n\t\tint numCols = matrix.get(0).size();\r\n\t\tArrayList<ArrayList<Integer>> newMat = new ArrayList<ArrayList<Integer>>();\r\n\t\t//Put this in second for-loop to not have to loop twice?\r\n\t\tfor(int i = 0; i < numCols; i++) newMat.add(new ArrayList<Integer>());\r\n\t\tfor(int i = 0; i < numRows; i++){\r\n\t\t\tfor (int j = 0; j < numCols; j++){\r\n\t\t\t\tnewMat.get(j).add(matrix.get(i).get(j));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn newMat;\r\n\t}",
"Matrix copy() {\n Matrix newMatrix = new Matrix(matrixSize);\n for (int i = 0; i < matrixSize; i++) {\n if (!rows[i].isEmpty()) {\n rows[i].moveFront();\n while (rows[i].index() != -1) {\n Entry entry = (Entry)rows[i].get();\n newMatrix.changeEntry(i + 1, entry.column, entry.value);\n rows[i].moveNext();\n }\n }\n }\n return newMatrix;\n }",
"public static Matrix times(Matrix amat, double constant){\r\n \tMatrix cmat = new Matrix(amat.nrow, amat.ncol);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n\r\n \t \tfor(int i=0; i<amat.nrow; i++){\r\n \t\tfor(int j=0; j<amat.ncol; j++){\r\n \t\tcarray[i][j] = amat.matrix[i][j]*constant;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}",
"public CDenseMatrix64F(int numRows, int numCols) {\n this.numRows = numRows;\n this.numCols = numCols;\n this.data = new double[numRows*numCols*2];\n }",
"private static double[][] clone(double[][] matrix)\n {\n int length = matrix.length;\n double[][] clone;\n\n clone = new double[length][];\n for (int i = 0; i < length; i++)\n clone[i] = matrix[i].clone();\n return clone;\n }",
"public static long[][] multiply(long F[][], long M[][]){\n long x = F[0][0]*M[0][0] + F[0][1]*M[1][0]; \n long y = F[0][0]*M[0][1] + F[0][1]*M[1][1]; \n long z = F[1][0]*M[0][0] + F[1][1]*M[1][0]; \n long w = F[1][0]*M[0][1] + F[1][1]*M[1][1]; \n\n return new long[][]{{x,y},{z,w}};\n }",
"public Matrix(int nrOfRows, int nrOfCols) {\n this.nrOfRows = nrOfRows;\n this.nrOfCols = nrOfCols;\n inner = new BigInteger[nrOfRows][nrOfCols];\n }",
"public int[][] generateMatrix(int n) {\n int[][] matrix = new int[n][n];\n int counter = 1;\n for(int layer = 0; layer < (n + 1)/2; layer++){\n matrix[layer][layer] = counter++;\n for(int i = layer + 1; i < n - layer; i++) matrix[layer][i] = counter++;\n for(int i = layer + 1; i < n - layer; i++) matrix[i][n-layer-1] = counter++;\n //if(layer == (n + 1)/2 - 1 && n % 2 == 1) break;\n for(int i = n - layer - 2; i >= layer; i--) matrix[n-layer-1][i] = counter++;\n for(int i = n - layer - 2; i > layer; i--) matrix[i][layer] = counter++;\n }\n return matrix;\n }",
"public Matrix rowMultiply(int row, ComplexNumber weight) {\n\t\t// row *= weight\n\t\tMatrix m = copy();\n\t\tfor (int col = 0; col < m.N; col++) {\n\t\t\tm.ROWS[row][col] = weight.multiply(m.ROWS[row][col]);\n\t\t}\n\t\treturn m;\n\t}",
"public Matrix rowMultiply(int row, int weight) {\n\t\treturn rowMultiply(row, new ComplexNumber(new Fraction(weight)));\n\t}",
"public List<List<Integer>> generate(int numRows)\n {\n List<List<Integer>> allrows = new ArrayList<List<Integer>>();\n ArrayList<Integer> row = new ArrayList<Integer>();\n for(int i=0;i<numRows;i++)\n {\n row.add(0, 1);\n for(int j=1;j<row.size()-1;j++)\n row.set(j, row.get(j)+row.get(j+1));\n allrows.add(new ArrayList<Integer>(row));\n }\n return allrows;\n }",
"public int[][] generateMatrix(int n) {\n // input checking\n if (n < 0) {\n return null;\n }\n\n // start fill in the matrix (consider what happen when n == 0)\n // test case: input == 0; expect [];\n int[][] matrix = new int[n][n];\n int lo = 0, hi = matrix.length - 1;\n int num = 1;\n while (lo <= hi) {\n // pay attention to when lo == hi\n if (lo == hi) {\n matrix[lo][lo] = num;\n break;\n }\n // otherwise, fill this layer\n for (int i = lo; i < hi; i++) { // attention i < hi not i <= hi\n matrix[lo][i] = num++;\n }\n for (int i = lo; i < hi; i++) {\n matrix[i][hi] = num++;\n }\n for (int i = hi; i > lo; i--) {\n matrix[hi][i] = num++;\n }\n for (int i = hi; i > lo; i--) {\n matrix[i][lo] = num++;\n }\n lo++;\n hi--;\n }\n return matrix;\n }",
"public Matrix(int m, int n) {\n this.m = m;\n this.n = n;\n data = new double[m][n];\n }",
"@Override\n public Matrix idct(final MatrixView in) {\n check(in);\n double[][] out = new double[in.getRows()][in.getColumns()];\n double tmp1, tmp2, tmp3, tmp4;\n double tmpm0 = 0, tmpm1 = 0, tmpm2 = 0, tmpm3 = 0, tmpm4 = 0, tmpm5 = 0, tmpm6 = 0, tmpm7 = 0;\n double tmpm20, tmpm21, tmpm22, tmpm23, tmpm24, tmpm25, tmpm26, tmpm27 = 0;\n double[] outtmpmyi = null;\n\n for (int my = 0; my < in.getRows(); my += SIZE) {\n for (int mx = 0; mx < in.getColumns(); mx += SIZE) {\n for (int i = 0; i < 8; i++) {\n outtmpmyi = out[my + i];\n\n tmpm0 = in.getDouble(my + i, mx + 0);\n tmpm1 = in.getDouble(my + i, mx + 1);\n tmpm2 = in.getDouble(my + i, mx + 2);\n tmpm3 = in.getDouble(my + i, mx + 3);\n tmpm4 = in.getDouble(my + i, mx + 4);\n tmpm5 = in.getDouble(my + i, mx + 5);\n tmpm6 = in.getDouble(my + i, mx + 6);\n tmpm7 = in.getDouble(my + i, mx + 7);\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n outtmpmyi[mx + 0] = tmpm0 + tmpm7;\n outtmpmyi[mx + 7] = tmpm0 - tmpm7;\n outtmpmyi[mx + 1] = tmpm1 + tmpm6;\n outtmpmyi[mx + 6] = tmpm1 - tmpm6;\n outtmpmyi[mx + 2] = tmpm2 + tmpm5;\n outtmpmyi[mx + 5] = tmpm2 - tmpm5;\n outtmpmyi[mx + 3] = tmpm3 + tmpm4;\n outtmpmyi[mx + 4] = tmpm3 - tmpm4;\n\n }\n\n for (int i = 0; i < 8; i++) {\n\n tmpm0 = out[my + 0][mx + i];\n tmpm1 = out[my + 1][mx + i];\n tmpm2 = out[my + 2][mx + i];\n tmpm3 = out[my + 3][mx + i];\n tmpm4 = out[my + 4][mx + i];\n tmpm5 = out[my + 5][mx + i];\n tmpm6 = out[my + 6][mx + i];\n tmpm7 = out[my + 7][mx + i];\n\n tmp1 = (tmpm1 * Z7) - (tmpm7 * Z1);\n tmp4 = (tmpm7 * Z7) + (tmpm1 * Z1);\n tmp2 = (tmpm5 * Z3) - (tmpm3 * Z5);\n tmp3 = (tmpm3 * Z3) + (tmpm5 * Z5);\n\n tmpm20 = (tmpm0 + tmpm4) * Z4;\n tmpm21 = (tmpm0 - tmpm4) * Z4;\n tmpm22 = (tmpm2 * Z6) - (tmpm6 * Z2);\n tmpm23 = (tmpm6 * Z6) + (tmpm2 * Z2);\n tmpm4 = tmp1 + tmp2;\n tmpm25 = tmp1 - tmp2;\n tmpm26 = tmp4 - tmp3;\n tmpm7 = tmp4 + tmp3;\n\n tmpm5 = (tmpm26 - tmpm25) * Z0;\n tmpm6 = (tmpm26 + tmpm25) * Z0;\n tmpm0 = tmpm20 + tmpm23;\n tmpm1 = tmpm21 + tmpm22;\n tmpm2 = tmpm21 - tmpm22;\n tmpm3 = tmpm20 - tmpm23;\n\n out[my + 0][mx + i] = tmpm0 + tmpm7;\n out[my + 7][mx + i] = tmpm0 - tmpm7;\n out[my + 1][mx + i] = tmpm1 + tmpm6;\n out[my + 6][mx + i] = tmpm1 - tmpm6;\n out[my + 2][mx + i] = tmpm2 + tmpm5;\n out[my + 5][mx + i] = tmpm2 - tmpm5;\n out[my + 3][mx + i] = tmpm3 + tmpm4;\n out[my + 4][mx + i] = tmpm3 - tmpm4;\n }\n }\n }\n\n return new DoubleMatrix(in.getRows(), in.getColumns(), out);\n }",
"public static Matrix random(int m, int n) {\n Matrix A = new Matrix(m,n);\n double[][] X = A.getArray();\n for (int i = 0; i < m; i++) {\n for (int j = 0; j < n; j++) {\n X[i][j] = Math.random();\n }\n }\n return A;\n }",
"public static void multTable(int n) {\n int row, col;\n\n for (row = 1; row <= n; row += 1) {\n for (col = 1; col <= n; col += 1) {\n System.out.print(row * col + \" \");\n }\n System.out.println();\n }\n }",
"double[][] makeCopy(double[][] M, int row, int column) {\n\t\tdouble _M[][] = new double[row][column];\n\t\tfor (int i = 0; i < row; i++)\n\t\t\tfor (int j = 0; j < column; j++)\n\t\t\t\t_M[i][j] = M[i][j];\n\t\treturn _M;\n\t}",
"public ExprMatrix simplify() ;",
"public T transpose() {\n T ret = createMatrix(mat.getNumCols(), mat.getNumRows(), mat.getType());\n\n ops.transpose(mat, ret.mat);\n\n return ret;\n }",
"public int[][] getMat() {\n // Note: java has no return read-only so we won't return matrix;\n // b\\c that would expose internal representation. Instead we will\n // copy each row into a new matrix, and return that.\n return Helper.cloneMatrix(matrix);\n }",
"public static Matrix identity(int n) {\n\t\tComplexNumber[][] rows = new ComplexNumber[n][];\n\t\tfor (int row = 0; row < n; row++) {\n\t\t\trows[row] = new ComplexNumber[n];\n\t\t\tfor (int col = 0; col < n; col++) {\n\t\t\t\tint term = (row == col) ? 1 : 0;\n\t\t\t\trows[row][col] = new ComplexNumber(term);\n\t\t\t}\n\t\t}\n\t\treturn new Matrix(rows);\n\t}",
"public Matrix(int nrOfRows, int nrOfCols, Random rand, BigInteger q) {\n this(nrOfRows, nrOfCols);\n for (int col = 0; col < nrOfCols; col++) {\n for (int row = 0; row < nrOfRows; row++) {\n inner[row][col] = rand.nextRandom(q);\n }\n }\n }",
"public static Matrix rowMultiplyE(int row, ComplexNumber weight, int m) {\n\t\treturn identity(m).rowMultiply(row, weight);\n\t}",
"public double[][] convert_img_mat()\n\t{\n\t\tif(orderflag)\n\t\t{\n\t\t\tputpixel_1();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//rotate the image and get the pixels as usual form\t\n \t\tputpixel_2();\n\t\t}\n\treturn matrix;\n\t}",
"public Matrix(double[][] A, int m, int n) {\n this.data = A;\n this.m = m;\n this.n = n;\n }",
"public Matrice(int nr, int nc){\n\t\tthis.nr=nr;\n\t\tthis.nc=nc;\n\t\tmat = new int[nr][nc];\n\t}",
"public static List<List<Integer>> generate(int numRows){\r\n\t\tList<List<Integer>> list = new ArrayList<List<Integer>>();\r\n\t\tArrayList<Integer> row = new ArrayList<Integer>();\r\n\t\tfor( int i = 0; i < numRows ; ++i ){\r\n\t\t\trow.add(0, 1);\r\n\t\t\tfor( int j = 1; j < row.size()-1; ++j )\r\n\t\t\t\trow.set(j, row.get(j)+row.get(j+1));\r\n\t\t\tlist.add(new ArrayList<Integer>(row));\r\n\t\t}\r\n\t\treturn list;\r\n\t}",
"public T createLike() {\n return createMatrix(numRows(), numCols(), getType());\n }",
"public static List<List<Integer>> generate(int numRows) {\n List<List<Integer>> result = new ArrayList<>();\n if (numRows == 0) {\n return result;\n }\n result.add(new ArrayList<>());\n result.get(0).add(1);\n for (int rowNum = 1; rowNum < numRows; rowNum++) {\n List<Integer> row = new ArrayList<>();\n List<Integer> preRow = result.get(rowNum - 1);\n row.add(1);\n for (int j = 1; j < rowNum; j++) {\n row.add(preRow.get(j - 1) + preRow.get(j));\n }\n row.add(1);\n result.add(row);\n }\n return result;\n }",
"public Row3 smultiply(int i){\n\t\tRow3 tempRec = this.mat; //creates a temporary duplicate of the global record\n\t\tlong[][] tempMatA = new long[3][3]; //creates the matrix A as a 2D array\n\t\ttempMatA[0][0] = tempRec.r1.col1;\n\t\ttempMatA[0][1] = tempRec.r1.col2;\n\t\ttempMatA[0][2] = tempRec.r1.col3;\n\t\ttempMatA[1][0] = tempRec.r2.col1;\n\t\ttempMatA[1][1] = tempRec.r2.col2;\n\t\ttempMatA[1][2] = tempRec.r2.col3;\n\t\ttempMatA[2][0] = tempRec.r3.col1;\n\t\ttempMatA[2][1] = tempRec.r3.col2;\n\t\ttempMatA[2][2] = tempRec.r3.col3;\n\t\t\n\t\tlong[][] tempMat2 = new long[3][3]; //creates a 2D array of the same size as A\n\t\tlong[][] outMat = new long[3][3];\n\t\t\n\t\tif (i > 1){\n\t\t\t//see for loop explanation in class \"Matrix3x3flat\"\n\t\t\tfor (int j = 1; j < i; j ++){ //loops until j == input variable i.\n\t\t\t\t//j == 1 because matrix multiplication will occur on the first loop, so if i == 2, tempMat2 == A^3, not A^2\n\t\t\t\tfor (int a = 0; a < 3; a++){ //loops until a == side length of A\n\t\t\t\t\tfor (int b = 0; b < 3; b++){ //loops until b == side length of A\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++){ //loops until c == side length of A\n\t\t\t\t\t\t\ttempMat2[a][b] = tempMat2[a][b] + (tempMatA[a][c] * tempMatA[c][b]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t//returns tempMat2 as output matrix\n\t\t\toutMat = copy(tempMat2, outMat);\n\t\t}\n\t\t//returns A as output matrix, since A^1 = A\n\t\telse if (i == 1){\n\t\t\toutMat = copy(tempMatA, outMat);\n\t\t}\n\t\t//returns a 3x3 matrix filled with ones if i == 0\n\t\t//A^0 = 1\n\t\telse if (i == 0){\n\t\t\tfor (int m = 0; m < 3; m++){\n\t\t\t\tfor (int n = 0; n < 3; n++){\n\t\t\t\t\tif (m == n){\n\t\t\t\t\t\toutMat[m][n] = 1;\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutMat[m][n] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//after matrix multiplication is performed, the respective elements of the 2D array tempMatA are stored in\n\t\t//the temporary register tempRec2, which is then returned\n\t\tcolRow3 a1 = new colRow3(outMat[0][0], outMat[0][1], outMat[0][2]);\n\t\tcolRow3 b1 = new colRow3(outMat[1][0], outMat[1][1], outMat[1][2]);\n\t\tcolRow3 c1 = new colRow3(outMat[2][0], outMat[2][1], outMat[2][2]);\n\t\tRow3 tempRec2 = new Row3(a1, b1, c1);\n\t\treturn tempRec2;\n\t}",
"public Mat2 mult(double s) {\n\t\tdouble[][] newData = new double[rows][cols];\n\t\tfor(int i=0; i<rows; i++) {\n\t\t\tfor(int j=0; j<cols; j++) {\n\t\t\t\tnewData[i][j] = data[i][j] * s;\n\t\t\t}\n\t\t}\n\t\treturn new Mat2(newData);\n\t}",
"public static int[][] generate(int dimension){\n int[][] matrix = new int[dimension][dimension];\n for (int i = 0; i < dimension; i++) {\n for (int j = 0; j < dimension; j++) {\n matrix[i][j] = r.nextInt(10);\n }\n }\n return matrix;\n }",
"@Test\r\n\tvoid deepArrayCopyElementsMultiDim() {\r\n\t\tInteger[][] intArr = new Integer[10][];\r\n\t\tfor (int i = 0; i < 10; i++) {\r\n\t\t\tintArr[i] = new Integer[4];\r\n\t\t\tfor (int j = 0; j < 4; j++) {\r\n\t\t\t\tintArr[i][j] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tInteger[][] clone = ArrayUtil.deepArrayCopy(intArr);\r\n\t\tassertTrue(Arrays.deepEquals(intArr, clone));\r\n\t}",
"public static Matrix rows(double[][] rscs) {\n\t\tint rows = rscs.length;\n\t\tint columns = rscs[0].length;\n\t\tMatrix m = new Matrix(rows, columns);\n\t\tfor (int r = 0; r < rows; r++) {\n\t\t\tfor (int c = 0; c < columns; c++) {\n\t\t\t\tm.matrix[r][c] = rscs[r][c];\n\t\t\t}\n\t\t}\n\t\treturn m;\n\t}",
"public Matrix rref() {\n\t\tMatrix m = ref();\n\t\tint pivotRow = m.M - 1;\n\t\tArrayList<Integer> pivotColumns = m.pivotColumns();\n\t\tCollections.reverse(pivotColumns);\n\t\tfor (int i = 0; i < pivotColumns.size(); i++) {\n\t\t\tint pivotCol = pivotColumns.get(i);\n\t\t\twhile (pivotRow >= 0 && m.ROWS[pivotRow][pivotCol].equals(new ComplexNumber(0))) {\n\t\t\t\tpivotRow--;\n\t\t\t}\n\t\t\tfor (int upperRow = pivotRow - 1; upperRow > -1; upperRow--) {\n\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\tComplexNumber factor2 = m.ROWS[upperRow][pivotCol];\n\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][pivotCol];\n\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\tm = m.rowAdd(upperRow, pivotRow, weight);\n\t\t\t}\n\t\t\tpivotRow--;\n\t\t}\n\t\treturn m;\n\t}",
"int[][] multiple(int size) {\n\t\t size++; // наверняка пользователь захочет получить таблицу до того номера ВКЛЮЧИТЕЛЬНО, который укажет во входных параметрах\n\t\t int[][] mult = new int[size][size]; \n\t\t for (int i = 0; i < size; i++) {\n\t\t\t for (int j = 0; j < size; j++) {\n\t\t\t\t mult[i][j] = i * j;\n\t\t\t }\n\t\t }\n\t\t return mult;\n\t }"
] | [
"0.7074712",
"0.54355335",
"0.5148844",
"0.51130396",
"0.5111906",
"0.509528",
"0.50609446",
"0.5051283",
"0.5046162",
"0.50400156",
"0.5031062",
"0.50304604",
"0.50290686",
"0.50017804",
"0.49425754",
"0.49015164",
"0.48888415",
"0.48633978",
"0.48467574",
"0.48126137",
"0.48114428",
"0.48063526",
"0.47960487",
"0.47888917",
"0.4788521",
"0.47856355",
"0.47761464",
"0.47538057",
"0.4737346",
"0.47272447",
"0.4726425",
"0.47191754",
"0.47021633",
"0.4690968",
"0.4685844",
"0.46797216",
"0.46765134",
"0.46579772",
"0.465492",
"0.46535498",
"0.4650681",
"0.46414492",
"0.46401116",
"0.46381322",
"0.4633434",
"0.4628271",
"0.46273816",
"0.4619711",
"0.46033362",
"0.45935598",
"0.45905414",
"0.4586803",
"0.4586166",
"0.45844787",
"0.45820603",
"0.45809215",
"0.45780322",
"0.4562447",
"0.45616946",
"0.45500657",
"0.4549657",
"0.4545434",
"0.45440558",
"0.4543428",
"0.4540915",
"0.4535516",
"0.45294923",
"0.45231667",
"0.45214966",
"0.45134956",
"0.45131442",
"0.45129177",
"0.45024207",
"0.45014146",
"0.44851112",
"0.4482976",
"0.44813195",
"0.4473321",
"0.44703138",
"0.44671488",
"0.4459384",
"0.44573084",
"0.4453248",
"0.44448787",
"0.4436843",
"0.44359365",
"0.44324213",
"0.4427453",
"0.44217974",
"0.44182757",
"0.44165352",
"0.44139388",
"0.44117802",
"0.44117257",
"0.44083303",
"0.44079065",
"0.4407734",
"0.44065577",
"0.44064495",
"0.4395764"
] | 0.69645536 | 1 |
implement in one part of matlab's function 'sum' to return the sum of the elements of A along the first array dimension whose size does not equal 1. A is a matrix, so sum(A) returns a row vector containing the sum of each column. | public static double[] sumEachColumn(double[][] a) {
double[] out = new double[a[0].length];
for (int r = 0; r < a.length; ++r) {
for (int c = 0; c < a[r].length; ++c) {
out[c] += a[r][c];
}
}
return out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static int sum1( int[][] a )\n {\n\t int sum = 0;\t\t\t\t\t\t\t\t\t//initiate variable to hold value of sum \n\n\t for (int i = 0; i < a.length; i++) {\t\t\t//iterate over each array\n\n\t\t for (int n = 0; n < a[i].length; n++) {\t//iterate over the contents of each array\n\t\t\t sum += a[i][n];\t\t\t\t\t\t//add each value to the sum variable\n\t\t }\n\n\t }\n\n\t return sum;\t\t\t\t\t\t\t\t\t//return said sum variable\n }",
"private int getSumD1(int[][] a) {\n int sum = 0;\n for (int j = 0; j < a.length; j++) {\n sum += a[j][j];\n }\n return sum;\n }",
"public static int sum(int[][] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tsum += a[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public static int sum1( int[][] a )\n {\n int sum = 0; //initialize sum\n for (int[] i : a) { //for each array a, turn into an array called i\n\t for (int j : i) { //and then for each value in i...\n\t sum += j; //add the value of it to the sum\n\t }\n }\n return sum; //return the sum, an int\n }",
"public static int sum(int[] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tsum += a[i];\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public double elementSum() {\n return ops.elementSum(mat);\n }",
"public static int sumArray( int [] A ) {\n\tint sum = 0;\n\tfor( int a : A ) sum +=a;\n\treturn sum;\n }",
"public int sum()\n\t{\n\t\tint sum = 0;\n\t\tfor (int index = 0; index < arraySize; index++)\n\t\t{\n\t\t\tsum += array[index];\n\t\t}\n\t\treturn sum;\n\t}",
"public static double sum(double[] a){\n\n\t\t double sum = 0;\n\t\t for(int i = 0; i < a.length; i++)\n\t\t \tsum += a[i];\n\n\t \treturn sum;\n\n }",
"public static int sum(int[] a) {\n int sum = 0;\n for (int i = 0; i < a.length; i = i + 1) {\n sum = sum + a[i];\n }\n return sum;\n }",
"public int sum()\n {\n return sum(0,0,size);\n }",
"public static int noDiagSum(int[][] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (i != j) {\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public static int diagSum(int[][] a) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public int sum(int[] array) {\n if (array == null || array.length == 0){\n return 0;\n }\n int sum = 0;\n for (int i = 0; i < array.length; i++){\n sum += array[i];\n }\n return sum;\n }",
"public static int getSum(int[] array) {\n\n int[] arrayA = array;\n int length = arrayA.length;\n int sum = 0;\n\n for (int i = 0; i < length; i++) {\n sum += arrayA[i];\n }\n\n System.out.println(\"Sum of array elements is: \" + sum);\n\n return sum;\n }",
"private int getSumD2(int[][] a) {\n int sum = 0;\n\n int jd1 = 0;\n int jd2 = a.length - 1;\n while (jd1 < a.length) {\n sum += a[jd1][jd2];\n jd2--;\n jd1++;\n }\n return sum;\n }",
"public static double sum(double[] array) {\n\t\tif (array==null)\n\t\t\treturn Double.NaN;\n\t\tdouble re = 0;\n\t\tfor (double i : array)\n\t\t\tre+=i;\n\t\treturn re;\n\t}",
"public static int sumArray(int[] a) {\n\t\tint sum = 0;\n\t\tfor(int i=0;(i<=a.length-1);i++) {\n\t\t\tsum = sum + a[i];\n\t\t}\n\t\treturn sum;\n\t}",
"public static int sumRow1( int r, int[][] a )\n {\n\t int sum = 0;\t\t\t\t\t\t\t\t//initialize variable to store sum of a row\n\n\t for ( int i = 0; i < a[r].length; i++) {\t//loop through the specific \"row\" (array) given\n\n\t\t\tsum += a[r][i];\t\t\t\t\t\t//add each value to our sum variable\n\n\t }\n\n\t return sum;\t\t\t\t\t\t\t\t//return the sum variable\n }",
"public static double sum(double[] array) {\r\n\t\tdouble ret = 0.0;\r\n\t\tfor (double v : array) {\r\n\t\t\tret += v;\r\n\t\t}\r\n\t\treturn ret;\r\n\t}",
"public double negativeElementsSum(double[] arr) {\n return 0;\n }",
"public static void SumRowsColumns(int[][] array) {\n\n }",
"public long sum() {\n\t\tlong result = 0;\n\t\tfor (int i=0; i<numElements; i++) {\n\t\t\tresult += theElements[i];\n\t\t}\n\t\treturn result;\n\t}",
"public static int ArraySum(int[] A, int n){\r\n if (n < A.length - 1){\r\n return A[n] + ArraySum(A,n+1);\r\n }\r\n else{\r\n return A[n];\r\n }\r\n }",
"private double sumArray(double[] array) {\r\n\t\tdouble sum = 0.0;\r\n\t\t// Run through the array and add the numbers to the sum variable.\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tsum += array[i];\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public static int sumRow( int r, int[][] a )\n {\n int sum = 0; //initialize sum\n for (int i = 0; i < a[r].length; i++) { //for the width of an array...\n\t sum += a[r][i]; //add the point to the sum\n }\n return sum; //return sum, an int\n }",
"Matrix sumRows(){\n Matrix matrix_to_return = new Matrix(1, this.cols);\n double[][] tmp = this.asArray();\n int k=0;\n for(int i=0; i<this.cols; i++){\n for(int j=0; j<this.rows; j++) {\n matrix_to_return.data[k] += tmp[j][i];\n }\n k++;\n }\n return matrix_to_return;\n }",
"protected int sumAll() {\n\t\tint total = 0;\n\t\t//iterate all rows\n\t\tfor(int i = 0;i<size();i++){\n\t\t\t//itreate all columns\n\t\t\tfor(int j = 0;j<size();j++){\n\t\t\t\tInteger cell = matrix.get(i).get(j);\n\t\t\t\ttotal+=cell;\n\t\t\t}\n\t\t}\n\t\treturn total;\n\t}",
"private int[] columnSum(int[][] matrix) {\n int[] result = new int[matrix.length];\n for(int i = 0; i < matrix.length; i++) {\n result[i] = 0;\n for(int j = 0; j < matrix[i].length; j++) {\n result[i] += matrix[i][j];\n }\n }\n return result;\n }",
"public static int completeSum(int [] array){\n int sum = 0;\n for(int i = 0; i < array.length; i++){\n sum+= array[i];\n }\n return sum;\n }",
"public static int sum(int[] theArray) {\n\n\n //Converts the array to a list\n List<Integer> values = Arrays.stream(theArray).boxed().collect(Collectors.toList());\n\n //Streams through all the values and using lambda sums them up.\n //result is current sum and currentElement is the current element that is being added\n //see javadocs for reduce for more info.\n// int sum = values.stream().reduce(0, (result, currentElement) -> result + currentElement);\n int sum = values.stream().reduce(0, Integer::sum);\n // sum = integers.reduce(0, Integer::sum);\n return sum;\n\n\n ////Alternative code does the same job.\n// int sum = 0;\n// for (int num : theArray) {\n// sum += num;\n// }\n// return sum;\n\n }",
"public static int sum1DArr(int[] myArr1D)\n {\n return sum1DArrRecursive(myArr1D, 0, myArr1D.length - 1);\n }",
"public static double getSum(double data[]) {\r\n\t\t\t\r\n\t\t\tint datLength = data.length;\r\n\t\t\tdouble sum = 0;\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < datLength; i++) {\r\n\t\t\t\tsum = sum + data[i];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn sum;\r\n\t\t}",
"public double sum() {\n final int size = size();\n double sum = 0.0;\n\n // Compute the average of all values\n for (int i = 0; i < size; i++) {\n final Number number = get(i);\n if (number == null) continue;\n if (Double.isNaN(number.doubleValue())) continue;\n\n sum += number.doubleValue();\n }\n\n return sum;\n }",
"public static int sumArray(int[] array) {\r\n\t\tint total = 0;\r\n\r\n\t\tfor (int i = 0; i < myList.length; i++) {\r\n\t\t\ttotal += myList[i];\r\n\t\t}\r\n\r\n\t\treturn total;\r\n\t}",
"public int vectorSum()\n\t{\n\t\tint sum =0;\n\t\tfor(int i=0;i<vector.size();i++)\n\t\t{\n\t\t\tsum += vector.get(i);\n\t\t}\n\t\treturn sum;\n\t}",
"public static int sumatory(int [] mySingleArray) {\r\n int counter = 0, sum = 0;\r\n while (counter < mySingleArray.length){\r\n sum = sum + mySingleArray[counter];\r\n counter++;\r\n }\r\n return sum;\r\n }",
"@Override\n\tpublic IDoubleVector sumColumns() {\n\t\treturn null;\n\t}",
"static int performSum(int[][] ar){\n\n int pDia = 0;\n int sDia = 0;\n int counter = ar.length;\n for (int i = 0; i < ar.length; i++) {\n\n pDia = pDia + ar[i][i];\n\n // keeping track of counter for second diagonal\n counter = counter-1;\n\n sDia = sDia + ar[i][counter];\n\n }\n System.out.println(sDia);\n return pDia;\n }",
"public int sumOfArray(Integer[] array, int index) {\n\t\treturn (index == 0)? array[0] : array[index] + sumOfArray(array,--index);\n\t}",
"public static int ArraySum(int[] inputArray){\n int sum=0;\n for(int i=0;i<inputArray.length;i++){\n sum=sum+inputArray[i];\n }\n return sum;\n }",
"public static int sum2( int [][] m )\n {\n int sum = 0; //initialize sum\n int v = 0; //initialize a row counter\n for (int[] i : m) { //for each array in m, make an array called i\n\t sum += sumRow( v, m); //add the sumRow of the row counter and\n\t //original array to the stated sum\n\t v++; //add 1 to the counter\n }\n return sum; //return sum, an int\n }",
"public static int sum2( int [][] m )\n {\n\t int sum = 0;\t\t\t\t\t\t\t//initialize variable to hold/track sum so far\n\t\n\t for (int i = 0; i < m.length; i++) { \t//loop through the arrays\n\n\t\t sum += sumRow1(i, m);\t\t\t\t//procure the sum of each row, and add it to the sum variable\n\n\t }\n\n\t return sum;\t\t\t\t\t\t\t//return the sum\n }",
"public static int sumArray(int[] array) {\n\t\t\tint sum = 0;\n\t\t\t\n\t\t\tfor (int num : array)\n\t\t\t\tsum+=num;\n\t\t\treturn sum;\n\t\t\n\t\t}",
"public static int sum1(int[] a, int n) // summen av de n første\n {\n if (n == 1) return a[0]; // summen er verdien selv\n return sum1(a,n-1) + a[n-1]; // summen av de n-1 første + a[n-1]\n }",
"@Override\n\tpublic IDoubleVector sumRows() {\n\t\treturn null;\n\t}",
"public static int sum(int[] arr, int arrlen){ // sum of array\r\n int sum = 0;\r\n for (int i = 0; i < arrlen; i++) {\r\n sum += arr[i];\r\n }\r\n return sum;\r\n }",
"public static int sumArray(int[] arr)\n\t{\n\t\tint x=0;\n\t\tfor(int y:arr)\n\t\t{\n\t\t\tx+=y;\n\t\t}\n\t\treturn x;\n\t}",
"public int get_sum_a() {\n return (int)getSIntBEElement(offsetBits_sum_a(), 32);\n }",
"static long subArraySum(int[] data) {\n\n long result = 0;\n\n // computing sum of sub array using formula\n int n = data.length;\n for (int i = 0; i < n; i++) {\n // x * (x at first index) + (x at other indices)\n result += (data[i] * (i * (n - i) + (n - i)));\n//\t\t\tresult += (data[i] * (i + 1) * (n - i));\n }\n\n // return all sub array sum\n return result;\n }",
"public static int simpleArraySum() { //(List<Integer> ar)\n \n Integer []ar = {1,2,3}; \n\n Integer sum =0;\n for(Integer i : ar){\n sum +=i;\n }\n return sum; \n }",
"public double getTotal(){\n double total = 0;\n for(int i=0;i<array.length; i++){\n total += array[i].doubleValue();\n }\n return total;\n }",
"public int sumItems(double[] source) {\n int sum = 0;\n System.out.println(\"double array is called\");\n for(int i=0; i < source.length; i++) {\n sum += source[i];\n }\n return sum;\n }",
"double getSum();",
"double getSum();",
"public static Matrix sum(Matrix m) {\n int rows_c = m.rows(), cols_c = m.cols();\n Matrix d;\n if (rows_c == 1) {\n return m;\n } else {\n d = MatrixFactory.getMatrix(1, cols_c,m);\n for (int col = 1; col <= cols_c; col++) {\n double sumCol = 0D;\n for (int row = 1; row <= rows_c; row++) {\n sumCol += m.get(row, col);\n }\n d.set(1, col, sumCol);\n }\n }\n return d;\n }",
"public static double sumSqrt(double[] a) {\n\t\tdouble sum = 0.0;\n\t\tfor(int i = 0; i<a.length; i++) {\n\t\t\tsum = sum + Math.sqrt(a[i]);\n\t\t}\n\t\treturn sum;\n\t}",
"public int iSumaVec(int[] vector)\r\n\t{\r\n\t\tint iSuma=0;\r\n\t\tfor(int i=0;i<vector.length;i++)\r\n\t\t{\r\n\t\t\tiSuma+=vector[i];\r\n\t\t}\r\n\t\treturn iSuma;\r\n\t}",
"public int getSum(List<Integer> a){\n\n int sum = 0;\n\n for(int i = 0; i<a.size(); i++){\n if(a.get(i)<0){\n continue;\n } else{\n sum +=a.get(i);\n }\n }\n return sum;\n }",
"public int arraySum(int[] array, int n) {\n\t\tif (n == 0) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\treturn arraySum(array, n - 1) + array[n - 1];\n\t\t}\n\t}",
"static double calculateArraySum(double... value) {\n double sum = 0;\n for (double i : value) {\n sum += i;\n }\n return sum;\n }",
"protected static double seqArraySum(final double[] input) {\n double sum = 0;\n\n // Compute sum of reciprocals of array elements\n for (int i = 0; i < input.length; i++) {\n sum += 1 / input[i];\n }\n\n return sum;\n }",
"public static void SumTestCase() {\n\tSystem.out.println(\"\\nQuestion (4) Sum Array\");\n\tSystem.out.println(\"----------------------\");\n\tint N = 100;\n\tint [] A = createAndFillArray( N );\n\tint sum = sumArray(A);\n\tSystem.out.println(\"The sum of \" + A[0] + \" to \" + A[A.length-1] + \" = \" + sum );\n }",
"public static double sum(double[] s)\n {\n double sum = 0;\n for (int i = 0; i < s.length; i++) sum = sum + s[i];\n return sum;\n }",
"public static int sum(int ...a)\r\n\t{\r\n\t\tint ans=0;\r\n\t\tfor(int i:a) {\r\n\t\t\tans=ans+i;\r\n\t\t}\r\n\t\treturn ans;\r\n\t}",
"public static int rowSum(int[][] a, int rowIndex) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (i == rowIndex) {\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public int calcSum() {\n\t\tint sum = 0;\n\t\tfor (int count = 0; count < data.size(); count++)\n\t\t\tsum += (int)data.get(count);\n\t\treturn sum;\n\t}",
"public void calculateArray() {\n\n for (int i = 0; i < array.length; i++) {\n sum += array[i];\n }\n }",
"private static int sum1DArrRecursive(int[] myArr1D, int min, int max)\n {\n int sum = 0;\n if(min==max)\n { \n sum += myArr1D[max];\n return sum;\n }\n else\n {\n sum += myArr1D[min] + sum1DArrRecursive(myArr1D, min+1, max);\n return sum;\n }\n }",
"public static int sum(int[] mainArray) {\r\n\t\tint sum = 0;\r\n\t\tfor (int counter = 0; counter < mainArray.length; counter ++) {\r\n\t\t\tsum += mainArray[counter];\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public static double arrayTotal(int[] array ) throws IOException {\r\n double total = 0;\r\n\r\n for (int i = 0; i != array.length; i++) {\r\n total = total + array[i];\r\n }\r\n return total;\r\n }",
"public int solution(int[] A) {\n int sumRange = 0;\n for (int i = 1; i <= A.length+1; i++){\n sumRange+=i;\n }\n \n int sumArray = 0;\n for(int a : A) {\n sumArray+=a;\n }\n\n\t//Take the total without the missing number, and subtract the total with the missing number\n return sumRange-sumArray;\n }",
"public T sum();",
"public double sum() {\n double sum = x;\n Lista iter = new Lista(this);\n while (iter.next != null) {\n sum += iter.next.x;\n iter = iter.next;\n }\n return sum;\n }",
"public int[][] sumOfMatrices(int row, int col, int array1[][], int array2[][]) {\n int[][] sum = new int[row][col];\n for (int i = 0; i < row; i++) {\n for (int j = 0; j < col; j++) {\n sum[i][j] = array1[i][j] + array2[i][j];\n }\n }\n return sum;\n }",
"@Override\n public double asum(INDArray x) {\n return NativeBlas.sasum(x.length(), x.data(), x.offset(), 1);\n }",
"public static int sum(int[] s)\n {\n int sum = 0;\n for (int i = 0; i < s.length; i++) sum = sum + s[i];\n return sum;\n }",
"public static int sumUsingStreams(int []arr)\n{\n //Your code here\n //using stream.sum()\n return Arrays.stream( arr)\n .sum(); \n \n}",
"public ArrayList<Integer> continuousSubarraySum(int[] A) {\n ArrayList<Integer> result = new ArrayList<>();\n\n int temp = A[0];\n for (int i = 0; i<A.length;i++) {\n int val = A[i];\n for (int j = i + 1; j<A.length; j++) {\n val += A[j];\n if (temp < val) {\n result.clear();\n result.add(i);\n result.add(j);\n \n }\n else { continue;}\n temp = val;\n }\n \n }\n return result;\n \n }",
"public static int colSum(int[][] a, int colIndex) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (j == colIndex) {\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public static int[][] horizontalSums(int[][] a, int sumToFind){\r\n\t\tint [][]b = new int[a.length][a[0].length] ;\r\n\t\tfor (int r=0;r<a.length;r++) {\r\n\t\t\tfor(int c=0;c<a[0].length;c++){\r\n\t\t\tint sum=0;\r\n\t\t\t//int temp=0;\r\n\t\t\tint temp;\r\n\t\t\t\r\n\t\t\t//int column=0;\r\n\t\t\tfor (temp=c; temp<a[r].length && sum!=sumToFind;temp++){\r\n\t\t\t\tsum=sum+a[r][temp] ; \r\n\t\t\t}\r\n\t\t\tif(sum==sumToFind){\r\n\t\t\t\tfor (int i=c; i<temp;i++) {\r\n\t\t\t\t\tb[r][i]=a[r][i] ;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t}\r\n\t\treturn b ;\r\n\t}",
"public int sumOfElements(){\n\t\tint sum = 0;\n\t\tNode temp = this.head;\n\t\twhile(temp != null){\n\t\t\tsum += temp.data;\n\t\t\ttemp = temp.next;\n\t\t}\n\t\treturn sum;\n\t}",
"public double sum() {\n double resultat = 0;\n for (int i = 0; i < tab.size(); i++) {\n resultat += CalculatorArray.sum(tab.get(i));\n }\n System.out.println(\"Sum colonne:\" + resultat);\n return resultat;\n }",
"public static double getTotal(int[][] numbers) {\n int totalValue = 0;\n for (int i = 0; i < numbers.length; i++) {\n for (int j = 0; j < numbers[i].length; j++) {\n totalValue = totalValue + numbers[i][j];\n }\n }\n return totalValue;\n }",
"int absoluteValuesSumMinimization(int[] a) {\n return a[(a.length-1)/2];\n }",
"private static int[][] fillWithSum(int[][] matrix) {\n if (null == matrix || matrix.length == 0) {\n return null;\n }\n\n int M = matrix.length;\n int N = matrix[0].length;\n\n // fill leetcoce.matrix such that at given [i,j] it carries the sum from [0,0] to [i,j];\n int aux[][] = new int[M][N];\n\n // 1 2 3\n // 4 5 6\n // 7 8 9\n\n // 1. copy first row of leetcoce.matrix to aux\n for (int j = 0; j < N; j++) {\n aux[0][j] = matrix[0][j];\n }\n // after 1,\n // 1 2 3\n // 0 0 0\n // 0 0 0\n\n // 2. Do column wise sum\n for (int i = 1; i < M; i++) {\n for (int j = 0; j < N; j++) {\n aux[i][j] = matrix[i][j] + aux[i-1][j]; // column wise sum\n }\n }\n // after 2,\n // 1 2 3\n // 5 7 9\n // 12 15 18\n\n // 3. Do row wise sum\n for (int i = 0; i < M; i++) {\n for (int j = 1; j < N; j++) {\n aux[i][j] += aux[i][j-1];\n }\n }\n // after 3,\n // 1 3 6\n // 5 12 21\n // 12 27 45\n\n // sum between [1,1] to [2,2] = 45 + 1 - 12 - 6 = 46 - 18 = 28\n return aux;\n }",
"private int sum(int[] widths) {\n int sum = 0;\n\n for (int width : widths) {\n sum += width;\n }\n\n return sum;\n }",
"public static void LargestSumRow(int[][] array) {\n\n }",
"public static int getColumnTotal(int[][] numbers, int a) {\n int total = 0;\n for (int i = 0; i < numbers.length; i++) {\n total += numbers[i][0];\n }\n return total;\n }",
"public double sumXs() {\n double $ = 0;\n for (int ¢ = 0; ¢ < xVals.size(); ++¢)\n $ += unbox(cantBeNull(xVals.get(¢)));\n return $;\n }\n\n // calculate the sum of all the y values\n public double sumYs() {\n double $ = 0;\n for (int ¢ = 0; ¢ < yVals.size(); ++¢)\n $ += unbox(cantBeNull(yVals.get(¢)));\n return $;\n }",
"public static int getSum(int arr[], int n)\n{\n\tint total = 0;\n\tfor (int i = 0; i < n; i++)\n\t\ttotal += arr[i];\n\treturn total;\n}",
"public static int sumOfElements(int[][] number) {\n\t\t\n\t\tint sum = number[0][0];\n\t for (int o= 0; o < number.length; o++) {\n\t \tfor(int l=0;l<number[o].length;l++){\n\t \t\t if (number[o][l] < sum) {\n\t \t sum += number[o][l];\n\t \t }\n\t \t }\t\n\t \t}\n\t \n\t return sum;\n\t}",
"private static long[] sums(Mat m,boolean byRow) {\r\n\t\tint rows = m.rows();\r\n\t\tint cols = m.cols();\r\n\t\tbyte[] data = new byte[rows*cols];\r\n\t\tlong[] retSums = null;\r\n\t\t\r\n\t\tint status = m.get(0, 0,data);\r\n\t\t\r\n\t\tlong total = 0;\r\n\t\tfor (int k=0;k<data.length;k++) {\r\n\t\t\ttotal += Byte.toUnsignedInt(data[k]);\r\n\t\t}\r\n\t\tif (byRow) {\r\n\t\t\tretSums = new long[cols];\r\n\t\t\tfor (int col=0;col<cols;col++) {\r\n\t\t\t\tretSums[col] = 0;\r\n\t\t\t\tfor (int row=0;row<rows;row++) {\r\n\t\t\t\t\tint k = row*cols+col;\r\n\t\t\t\t\tretSums[col] += Byte.toUnsignedInt(data[k]);\r\n\t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\telse {\r\n \t\t\tretSums = new long[rows];\r\n \t\t\tfor (int row=0;row<rows;row++) {\r\n \t\t\t\tretSums[row] = 0;\r\n \t\t\t\tfor (int col=0;col<cols;col++) {\r\n \t\t\t\t\tint k = row*cols+col;\r\n \t\t\t\t\tretSums[row] += Byte.toUnsignedInt(data[k]);\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n\t\t\r\n\t\tint total1 = 0;\r\n\t\tfor (int k=0; k < retSums.length; k++) {\r\n\t\t\ttotal1 += retSums[k];\r\n\t\t}\r\n\t\r\n\t\treturn retSums;\r\n\t}",
"public static int partOfRowSum(int[][] a, int rowIndex, int startCol,\r\n\t\t\tint endCol) {\r\n\t\tint rowNum = a.length;\r\n\t\tint colNum = a[0].length;\r\n\t\tint sum = 0;\r\n\t\tfor (int i = 0; i < rowNum; i++) {\r\n\t\t\tfor (int j = 0; j < colNum; j++) {\r\n\t\t\t\tif (i == rowIndex && j >= startCol && j <= endCol) {\r\n\t\t\t\t\tsum += a[i][j];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public double getSumXX() { \n\t\treturn sumX1X1; \n\t}",
"public int sum(int array[], int start, int finish) {\r\n\t\tint sum = 0;\r\n\t\tint i = 0;\r\n\t\tfor (i = start; i < finish; i++) {\r\n\t\t\tsum += array[i];\r\n\t\t}\r\n\t\treturn sum;\r\n\t}",
"public static int getRowTotal(int[][] numbers, int a) {\n int total = 0;\n for (int i = 0; i < numbers[a].length; i++) {\n total += numbers[a][i];\n }\n return total;\n }",
"private void getSum() {\n\t\tint sum =0;\r\n\t\t\r\n\t\tfor(int i=0; i<index; i++) {\r\n\t\t\tif(products[i] != null)\r\n\t\t\t\tsum += products[i].getPrice();\r\n\t\t}\r\n\t\tSystem.out.println(sum);\r\n\t}",
"public double sum()\r\n {\r\n double sum = 0.0;\r\n for (Double c : this.values())\r\n sum += c;\r\n\r\n return sum;\r\n }",
"public int sum(int[] bit, int index) {\n index = index + 1;\n int sum = 0;\n while (index > 0) {\n sum += bit[index];\n index = getParent(index);\n }\n return sum;\n }"
] | [
"0.7359252",
"0.73343647",
"0.7199101",
"0.71791697",
"0.6855488",
"0.6854246",
"0.6827711",
"0.6766996",
"0.6679267",
"0.6647164",
"0.6507501",
"0.6501088",
"0.6499034",
"0.6463751",
"0.63717914",
"0.6364444",
"0.6354373",
"0.6327726",
"0.632483",
"0.62531495",
"0.6220322",
"0.6216975",
"0.62109965",
"0.616213",
"0.61389613",
"0.60928756",
"0.6086398",
"0.6069724",
"0.60319364",
"0.60295147",
"0.601384",
"0.5978837",
"0.5935534",
"0.5909671",
"0.59056556",
"0.58987516",
"0.58934116",
"0.58764064",
"0.58676535",
"0.58598244",
"0.5849264",
"0.5826497",
"0.5817713",
"0.5795929",
"0.5791822",
"0.5761716",
"0.57468736",
"0.5735213",
"0.5722811",
"0.5696159",
"0.5694209",
"0.5675392",
"0.5673687",
"0.56707025",
"0.56707025",
"0.565537",
"0.5649336",
"0.56248915",
"0.5617937",
"0.559753",
"0.5591739",
"0.5580078",
"0.55704504",
"0.55585647",
"0.5537585",
"0.55323815",
"0.5530308",
"0.55158365",
"0.5515192",
"0.55074364",
"0.55058587",
"0.54901695",
"0.5488764",
"0.5467562",
"0.5463489",
"0.543247",
"0.5417024",
"0.5407472",
"0.539634",
"0.5391031",
"0.53729504",
"0.5369418",
"0.5356227",
"0.53404605",
"0.53205657",
"0.5316188",
"0.5301027",
"0.52971333",
"0.52963185",
"0.52877295",
"0.5279618",
"0.52665335",
"0.52649903",
"0.52535754",
"0.52350086",
"0.5219574",
"0.5217051",
"0.5213217",
"0.5212037",
"0.5208915"
] | 0.65345633 | 10 |
This method sets value of model grid at str | private void setModelValue(String str) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
model.setValueAt(str, x, y);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void setGrid(int x ,int y,char newValue){\n\t\tGrid[x][y] = newValue;\n\t}",
"public void setSpaceAt(int x, int y, int val){\n grids[x][y].setValue(val);\n }",
"@Override\n public void setValueAt(Object aValue, int aRow, int aColumn) {\n model.setValueAt(aValue, aRow, aColumn); \n }",
"private void setCell(int x, int y, int newValue) {\n hiddenGrid[x][y] = newValue;\n }",
"public void setCell(Object value, int col, int row) {\n ((DefaultTableModel) getModel()).setValueAt(value, row, col);\n }",
"@Override\r\n public void setModel(String model) {\n }",
"public void setValuesForDisplay() {\n \tthis.trainModelGUI.tempLabel.setText(Integer.toString(this.temperature) + DEGREE + \"F\");\n\n //this.trainCars = this.trainModelGUI.numCars();\n this.trainWheels = this.trainCars * TRAIN_NUM_WHEELS;\n this.trainModelGUI.crewCountLabel.setText(Integer.toString(crew));\n this.trainModelGUI.heightVal.setText(Double.toString(truncateTo(this.trainHeight, 2)));\n this.trainModelGUI.widthVal.setText(Double.toString(truncateTo(this.trainWidth, 2)));\n this.trainModelGUI.lengthVal.setText(Double.toString(truncateTo(this.trainLength, 2)));\n this.trainModelGUI.weightVal.setText(Integer.toString(((int)this.trainWeight)));\n this.trainModelGUI.capacityVal.setText(Integer.toString(this.trainCapacity));\n this.trainModelGUI.powerVal.setText(Double.toString(truncateTo(this.powerIn/1000,2)));\n \n GPSAntenna = this.trainModelGUI.signalFailStatus();\n if(!GPSAntenna) {\n \tthis.trainModelGUI.gpsAntennaStatusLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.gpsAntennaStatusLabel.setText(\"OFF\");\n }\n MBOAntenna = this.trainModelGUI.signalFailStatus();\n if(!MBOAntenna) {\n \tthis.trainModelGUI.mboAntennaStatusLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.mboAntennaStatusLabel.setText(\"OFF\");\n }\n \t\n \tthis.trainModelGUI.timeVal.setText(trnMdl.currentTime.toString());\n \tthis.trainModelGUI.stationVal.setText(this.station);\n \t\n \tif(rightDoorIsOpen == true) {\n \tthis.trainModelGUI.rightDoorStatusLabel.setText(\"OPEN\");\n } else {\n \tthis.trainModelGUI.rightDoorStatusLabel.setText(\"CLOSED\");\n }\n \tif(leftDoorIsOpen == true) {\n \tthis.trainModelGUI.leftDoorStatusLabel.setText(\"OPEN\");\n } else {\n \tthis.trainModelGUI.leftDoorStatusLabel.setText(\"CLOSED\");\n }\n\n \tif(lightsAreOn == true) {\n \t\tthis.trainModelGUI.lightStatusLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.lightStatusLabel.setText(\"OFF\");\n }\n \t\n \tthis.trainModelGUI.numPassengers.setText(Integer.toString(this.numPassengers));\n \tthis.trainModelGUI.numCarsSpinner.setText(Integer.toString(this.trainCars));\n \tthis.trainModelGUI.authorityVal.setText(Double.toString(truncateTo(this.CTCAuthority/METERS_PER_MILE,2)));\n \tthis.trainModelGUI.ctcSpeedLabel.setText(Double.toString(truncateTo(this.CTCSpeed*KPH_TO_MPH,2)));\n \t\n \tif(serviceBrake) {\n \t\tthis.trainModelGUI.serviceLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.serviceLabel.setText(\"OFF\");\n }\n \tif(emerBrake) {\n \t\tthis.trainModelGUI.emergencyLabel.setText(\"ON\");\n } else {\n \tthis.trainModelGUI.emergencyLabel.setText(\"OFF\");\n }\n \t\n \tif(this.arrivalStatus == ARRIVING) {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"ARRIVING\");\n \t} else if (this.arrivalStatus == EN_ROUTE) {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"EN ROUTE\");\n \t} else if (this.arrivalStatus == APPROACHING) {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"APPROACHING\");\n \t} else {\n \t\tthis.trainModelGUI.arrivalStatusLabel.setText(\"DEPARTING\");\n embarkingPassengersSet = false;\n \t}\n\n \tthis.trainModelGUI.currentSpeedLabel.setText(Double.toString(truncateTo((this.currentSpeed*MS_TO_MPH), 2)));\n \n \tif (this.lineColor.equals(\"GREEN\")) {\n \t\tthis.trainModelGUI.lblLine.setText(lineColor);\n \t\tthis.trainModelGUI.lblLine.setForeground(Color.GREEN);\n \t} else {\n \t\tthis.trainModelGUI.lblLine.setText(\"RED\");\n \t\tthis.trainModelGUI.lblLine.setForeground(Color.RED);\n }\n \t\n }",
"void set(Model model);",
"public void setModel(Board b) { model = b; repaint(); }",
"private native void setModel(int i);",
"public void setRealCell(String inputVal){\n\t\tuserInput = inputVal;\n\t}",
"String setValue();",
"void editCell(Coord coord, String string);",
"public void setModel(String model){\n String validModel = model.toLowerCase();\n if(validModel.equals(\"Model S\") || validModel.equals(\"Enzo\")){\n this.model = model;\n }else{\n this.model = \"Unknown\";\n }\n\n }",
"public void setValueAt(Object value, int row, int col) {\n if(row < getRowCount()){\n if (DEBUG) {\n System.out.println(\"Setting value at \" + row + \",\" + col\n + \" to \" + value\n + \" (an instance of \"\n + value.getClass() + \")\");\n }\n String[] r = data.get(row);\n r[col] = (String) value;\n fireTableCellUpdated(row, col);\n\n if (DEBUG) {\n System.out.println(\"New value of data:\");\n printDebugData();\n }\n }\n }",
"private void setCellGrid(){\n count=0;\n status.setText(\"Player 1 Move\");\n field = new ArrayList<>();\n for (int i=0; i< TwoPlayersActivity.CELL_AMOUNT; i++) {\n field.add(new Cell(i));\n }\n }",
"public void setCell(int row, int col, String val) {\n board[row][col] = val;\n }",
"public abstract void setCellValue(int cellValue, int row, int col);",
"protected void set(int row, int col, Cell cell) {\n\t\tmyGrid.set(row, col, cell);\n\t}",
"private void setControlModel(String setting, Object value) {\n\t\tHub.dataModel.put(setting, value);\n\t\tLog.d(TAG, \"Control model updated.\");\n\t}",
"public void setValue(int col, String value) {\n\t\tint row = rowList.getSelectedIndex();\n\t\tdm.setValue(col, row, value);\n\t}",
"public void setModel(String model) { // we've just created a SETTER\r\n String validModel = model.toLowerCase();\r\n if (validModel.equals(\"carrera\") || validModel.equals(\"commodore\")) {\r\n this.model = model;\r\n } else {\r\n this.model = \"Unknown\";\r\n }\r\n }",
"protected abstract double setCell(\r\n int row,\r\n int col,\r\n double valueToSet);",
"private void setTrainingGrid(TrainingGrid trainGrid) {\n\t\tif (trainGrid == null) {\n\t\t\t_currentTrainGrid = null;\n\t\t\tsetSelectList((char)0);\n\t\t\t_gridPanel.clear();\n\t\t} else {\n\t\t\t_currentTrainGrid = trainGrid;\n\t\t\tsetSelectList(_currentTrainGrid.getValue());\n\t\t\t_gridPanel.setGrid(trainGrid.getGrid());\n\t\t}\n\t\tcheckEnableDisable();\n\t}",
"@Override\n\t\tpublic void setModel(int model) {\n\t\t\t\n\t\t}",
"public void setTextAreaValue(String str){\n\t\tcenterPanel.setTextAreaValue(str);\n\t}",
"public void setValue(String value) {\n\t this.valueS = value;\n\t }",
"void setValue(String value);",
"void setValue(String value);",
"public void updateGrid() {\n\t\tfor (int row = 0; row < Sudoku.ROWS; row++ ) {\n\t\t\tfor (int col = 0; col < Sudoku.COLUMNS; col++) {\n\t\t\t\tVariable var = Sudoku.grid[row][col];\n\t\t\t\tif (!var.isFound() && var.domain.size() == 1) {\n\t\t\t\t\tvar.setValue(var.domain.get(0)); // only one value available in domain\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public void updateGridX();",
"public void setValue (String Value);",
"void setModel(Model model);",
"public void setValueAt(Object val, int row, int col) {\r\n }",
"public void setValueAt(Object value, int row, int col) {\n \n \t\tFermentable m = (Fermentable) data.get(row);\n \t\ttry {\n \t\t\tswitch (col) {\n \t\t\t\tcase 0 :\n \t\t\t\t\tm.setName(value.toString());\n\t\t\t\t\tif (NewSwingApp.DEBUG){\n \t\t\t\t\t\tSystem.out.println(\"value is:\" + value);\n\t\t\t\t\t}\n \t\t\t\tcase 1 :\n \t\t\t\t\tm.setAmount(Double.parseDouble(value.toString()));\n \t\t\t\tcase 2 :\n \t\t\t\t\tm.setUnits(value.toString());\n \t\t\t\tcase 3 :\n \t\t\t\t\tm.setPppg(Double.parseDouble(value.toString()));\n \t\t\t\tcase 4 :\n \t\t\t\t\tm.setLov(Double.parseDouble(value.toString()));\n \t\t\t\tcase 5 :\n \t\t\t\t\tm.setCost(Double.parseDouble(value.toString()));\n \t\t\t\tcase 6 :\n \t\t\t\t\tm.setPercent(Double.parseDouble(value.toString()));\n \n \t\t\t}\n \t\t} catch (Exception e) {\n \t\t};\n \n \t\tfireTableCellUpdated(row, col);\n \t\t\n \t}",
"private void setCellText(final CellsGUI the_cell) {\r\n\r\n\t\t// if (the_cell == null)\r\n\t\t// return;\r\n\t\tCell cell = cellMap.get(the_cell.getToken().toString());\r\n\t\tmyCell = cell;\r\n\t\tif (myCell == null)\r\n\t\t\treturn;\r\n\t\tif (cell != null) {\r\n\t\t\tdouble value = 0;\r\n\t\t\tvalue = roundDecimal(cell.last_value);\r\n\t\t\tthe_cell.setText(Double.toString(value));\r\n\t\t} else {\r\n\t\t\tthe_cell.setText(\"\");\r\n\t\t}\r\n\r\n\t\tdouble cellValue = roundDecimal(myCell.last_value);\r\n\t\tString textValue = String.valueOf(cellValue);\r\n\r\n\t\tif (myCell.formula == null)\r\n\t\t\tthe_cell.setText(\"\");\r\n\t\telse\r\n\t\t\tthe_cell.setText(textValue);\r\n\t}",
"public void setScore(String str){\r\n formattedTextField1.setText(str);\r\n }",
"public void setGrid(Grid grid) {\n if (grid == null) {\n throw new IllegalArgumentException(\"Invalid Grid\");\n }\n this.grid = grid;\n }",
"public void updategrid(int[][] grid) {\n this.grid = grid;\n }",
"public void setValue(String value);",
"public void setValue(String value);",
"public void setValue(String value);",
"public void setValue(String value);",
"void setElement(int row, String field, Object value);",
"void setGridX(int i);",
"public void setGrid(GridAlg grid) {\n\t\tthis.grid = grid;\n\t}",
"@Override\n\tpublic void cellLabelChanged(Object cell, Object value, boolean autoSize) {\n\t\tmodel.beginUpdate();\n\t\ttry {\n\t\t\tSpot spot = cellToVertexMap.get(cell);\n\t\t\tif (null == spot)\n\t\t\t\treturn;\n\t\t\tString str = (String) value;\n\t\t\tspot.setName(str);\n\t\t\tgetModel().setValue(cell, str);\n\n\t\t\tif (autoSize) {\n\t\t\t\tcellSizeUpdated(cell, false);\n\t\t\t}\n\t\t} finally {\n\t\t\tmodel.endUpdate();\n\t\t}\n\t}",
"@Override\n public void setValueAt(Object obj, int row, int col) {\n if (isCellEditable(row,col)){\n Feature f = fc.get(row);\n LifeStageAttributesInterface atts = (LifeStageAttributesInterface) f.getAttribute(1);\n if (debug) logger.info(\"SetValue for row \"+atts.getCSV());\n atts.setValue(keys.get(col), obj);\n fireTableCellUpdated(row, col);\n }\n }",
"private void setGridElement (int row, int column, Player player)\n {\n mGrid[row][column] = new Move(player, row, column);\n }",
"public void setModelTransformation(final AffineTransform gridToCRS) {\n final double[] modelTransformation = new double[16];\n modelTransformation[0] = gridToCRS.getScaleX();\n modelTransformation[1] = gridToCRS.getShearX();\n modelTransformation[2] = 0;\n modelTransformation[3] = gridToCRS.getTranslateX();\n modelTransformation[4] = gridToCRS.getShearY();\n modelTransformation[5] = gridToCRS.getScaleY();\n modelTransformation[6] = 0;\n modelTransformation[7] = gridToCRS.getTranslateY();\n modelTransformation[8] = 0;\n modelTransformation[9] = 0;\n modelTransformation[10] = 0;\n modelTransformation[11] = 0;\n modelTransformation[12] = 0;\n modelTransformation[13] = 0;\n modelTransformation[14] = 0;\n modelTransformation[15] = 1;\n\n nTransform = createTiffField(Tag.ModelTransformationTag);\n final Node nValues = createTiffDoubles(modelTransformation);\n nTransform.appendChild(nValues);\n }",
"@SuppressWarnings(\"unchecked\")\n public void changeValue(String typeString,String offsetString,String valueString) throws IllegalArgumentException{\n try{\n //modify type string\n if(!typeString.startsWith(\"0x\")) typeString = \"0x\" + typeString;\n //modify offset string\n if(!offsetString.startsWith(\"0x\")) offsetString = \"0x\" + offsetString;\n boolean valueChanged = false;\n for(Value value : getModel().getValues()){\n String currentValueTypeString = value.getValueType().getType();\n String currentOffsetString = \"0x\" + Integer.toHexString(value.getOffset());\n if(currentValueTypeString.equalsIgnoreCase(typeString) && currentOffsetString.equalsIgnoreCase(offsetString)){\n logger.debug(\"Sensor/\" + getModel().getId() + \" changing value set by server (from->to): \" + value.asMessageString() + \" -> \" + valueString);\n String oldValue = value.asMessageString();\n Platform.runLater(() -> {\n value.setValue(value.fromStringToValueType(valueString));\n if(isFullMessage()){\n adapterController.sendMessage(\n \"Adapter/\" + adapterController.getAdapter().getId() + \" -> \" +\n \"Sensor \"\n + getModel().getName() + \"/\" + getModel().getId()\n + \" changed value of \" + value.getName() + \" (from->to): \"\n + oldValue + \" -> \" + value.asMessageString());\n }else {\n adapterController.sendMessage(\"Sensor \"\n + getModel().getName() + \"/\" + getModel().getId()\n + \" changed value of \" + value.getName() + \" (from->to): \"\n + oldValue + \" -> \" + value.asMessageString());\n }\n });\n valueChanged = true;\n break;\n }\n }\n if(!valueChanged) throw new IllegalArgumentException(toString() + \" -> message \\\"set\\\" -> Cannot find value with type-> \" + typeString + \" offset -> \" + offsetString);\n }catch (NumberFormatException e){\n throw new IllegalArgumentException(\"Cannot set value to -> \" + valueString + \" on sensor \" + getModel().getId());\n }\n\n }",
"@Override\r\n\tpublic void setModel() {\n\t}",
"public void putValue(float value, int X, int Y)\n {\n m_grid[X][Y] = value;\n }",
"@Override\r\n\tpublic void setCell(Integer x, Integer y, Integer value) {\n\t\tgame[x][y] = value;\r\n\t}",
"@Override\n public void setValueAt(Object value, int row, int column) { data[row][column] = value; }",
"public void setModel(String model) {\r\n this.model = Objects.requireNonNull(model);\r\n }",
"public void setValueAt(Object value, int row, int col) {\n if (rows != null && row >=0 && row < rows.size()) {\n PredefinedAttributeRow singleRow = (PredefinedAttributeRow) rows.get(row);\n if (singleRow != null) {\n switch (col) {\n case iColName:\n singleRow.setName((String) value); \n break;\n case iColIncluded:\n singleRow.setIncluded((String) value); \n break;\n case iColRequired:\n singleRow.setRequired((String) value); \n default:\n return;\n }\n }\n fireTableCellUpdated(row, col);\n }\n }",
"void setModel(Model m);",
"protected abstract V makeModelCellValue(C column);",
"public void set(String value){\n switch (field){\n case 0:\n nomComplet = value;\n break;\n case 1:\n rv1 = value;\n break;\n case 2:\n dateDispo = LocalDate.parse(value,formatter);\n break;\n case 3:\n competencePrincipale = value;\n break;\n case 4:\n exp = Double.parseDouble(value);\n break;\n case 5:\n trancheExp = value;\n break;\n case 6:\n ecole = value;\n break;\n case 7:\n classeEcole = value;\n break;\n case 8:\n fonctions = value;\n break;\n case 9:\n dateRV1 = LocalDate.parse(value,formatter);\n case 10:\n rv2 = value;\n break;\n case 11:\n metiers = value;\n break;\n case 12:\n originePiste = value;\n break;\n }\n field++;\n }",
"public void setValueAt(Object value, int row, int col)\n {\n if (col == 1)\n {\n matchResults.get(row).setFirstName(value.toString());\n }\n // set the last name string\n else if (col == 3)\n { \n matchResults.get(row).setlastName(value.toString());\n }\n fireTableCellUpdated(row, col);\n }",
"void setRowSelection(int index, String value) {\r\n int val;\r\n try {\r\n val = ( (Integer) nameToIndexMap.get(value)).intValue();\r\n }\r\n catch (Exception e) {\r\n return;\r\n }\r\n ySelections[index] = val;\r\n\r\n // now, for all the plots in this row, update the objectives\r\n for (int i = 0; i < 2; i++) {\r\n plots[index][i].setObjectives(xSelections[i], val);\r\n /////////////////////////////////\r\n plots[index][i].redraw();\r\n /////////////////////////////////\r\n }\r\n fireTableDataChanged();\r\n }",
"protected abstract void setValue(Entity e,FloatTrait t,float value);",
"public void setValueAt(Object value, int row, int col) {\r\n \tswitch(col){\r\n case 0:\r\n \tattributs.get(row).setPk((Boolean)value);\r\n \tbreak;\r\n case 1:\r\n \tSystem.out.println(value);\r\n \tattributs.get(row).setName((String)value);\r\n \tbreak;\r\n case 2:\r\n \tattributs.get(row).setType((String)value);\r\n \tbreak;\r\n case 3:\r\n \tattributs.get(row).setTaille((String)value);\r\n \tbreak;\r\n case 4:\r\n \tattributs.get(row).setNul((Boolean)value);\r\n \tbreak;\r\n case 5:\r\n \tattributs.get(row).setUk((Boolean)value);\r\n \tbreak;\r\n \t\r\n \t}\r\n fireTableCellUpdated(row, col);\r\n }",
"public void setValueAt(Object value, int row, int col) {\n if (rows != null && row >=0 && row < rows.size()) {\n ExtendedAttributeRow singleRow = (ExtendedAttributeRow) rows.get(row);\n if (singleRow != null) {\n switch (col) {\n case iColName:\n singleRow.setName((String) value); \n break;\n case iColDefaultValue:\n singleRow.setDefaultValue((String) value); \n break;\n case iColSearchable:\n singleRow.setSearchable((String) value);\n break;\n case iColRequired:\n singleRow.setRequired((String) value);\n break;\n default:\n return;\n }\n }\n fireTableCellUpdated(row, col);\n }\n }",
"@Override\n\tpublic void setValueAt( final Object o, final int row, final int col ) {\n\t switch( col ) {\n\t\tcase 0:\n\t\t posten[row].setGebueH( (String) o );\n\t\t break;\n\t\tcase 1:\n\t\t posten[row].setGOAE( (String) o );\n\t\t break;\n\t\tcase 2:\n\t\t posten[row].setText( (String) o );\n\t\t break;\n\t\tcase 3:\n\t\t try {\n\t\t\tfinal int defaultCurrency = useEuro ? CurrencyNumber.EUR : CurrencyNumber.DM;\n\t\t\tfinal CurrencyNumber cn = CurrencyNumber.parse( o.toString(), defaultCurrency );\n\t\t\tposten[row].setPreis( cn.doubleValue() );\n\t\t\tposten[row].setEuro( cn.getCurrency() == CurrencyNumber.EUR );\n\t\t } catch( final IllegalArgumentException x ) {\n\t\t\tx.printStackTrace();\n\t\t\tposten[row].setPreis( 0.0 );\n\t\t\tposten[row].setEuro( useEuro );\n\t\t }\n\t }\n\t try {\n\t\tposten[row].save();\n\t } catch( final java.sql.SQLException e ) {\n\t\te.printStackTrace();\n\t }\n\t presenter.getModel().setRechnungsPosten( posten );\n\n\t update();\n\t}",
"protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }",
"public void setConvertedSplitQty (BigDecimal ConvertedSplitQty)\n{\nset_Value (\"ConvertedSplitQty\", ConvertedSplitQty);\n}",
"public void setConvertedShrinkQty (BigDecimal ConvertedShrinkQty)\n{\nset_Value (\"ConvertedShrinkQty\", ConvertedShrinkQty);\n}",
"public void setModel(String model)\n {\n this.model = model;\n }",
"@Override\n\tpublic void setModel(String model) {\n\t\tthis.model = model;\n\t}",
"public void setM_Locator_ID (int M_Locator_ID)\n{\nset_Value (\"M_Locator_ID\", new Integer(M_Locator_ID));\n}",
"public void setModel(String model) {\r\n if (model != null) {\r\n store.put(Names.model, model);\r\n } else {\r\n \tstore.remove(Names.model);\r\n }\r\n }",
"public void setValueAt(Object value, int row, int col) {\n\t\tprescaleTable.setPrescale(row, col - 1, (Integer) value);\n\n\t\tfireTableDataChanged(); // Fire event to alert a listener at ConfDbGUI.java (bug 89524).\n\t}",
"public void setParam(String str) {\n\t\tSystem.out.println(\" --IndexDao 传送值 = \"+str);\n\t}",
"public void setConvertedProductQty (BigDecimal ConvertedProductQty)\n{\nset_Value (\"ConvertedProductQty\", ConvertedProductQty);\n}",
"public void setValueAt(Object value, int row, int col)\n {\n if (col != 1)\n return;\n\n prop_map.put(row,value);\n fireTableCellUpdated(row, col);\n }",
"public void setModel(String model) {\r\n this.model = model;\r\n }",
"public void setValueAt(Object value, int row, int col) {\r\n pvValues[row][col] = value;\r\n fireTableCellUpdated(row, col);\r\n }",
"public void setValueAt(Object value, int row, int col) {\n\t\t// data[row][col] = value;\n\t\tfireTableCellUpdated(row, col);\n\t}",
"public void setValueAt(Object value, int row, int column){\n dataEntries[row][column] = value;\n }",
"protected void setValue( String strValue )\n {\n _strValue = strValue;\n }",
"@Override\n public void setValueAt(Object value, int row, int col) {\n data[row][col] = value;\n fireTableCellUpdated(row, col);\n }",
"public void updateMapGrid() {\n char[][] map = controller.getPopulatedMap();\n\t if (mapGrid == null) {\n mapGrid = new MapGrid(map.length, map[0].length, ICON_SIZE);\n }\n mapGrid.insertCharMap(map);\n }",
"public void setValueAt(Object value, int row, int col) {\n\t\t\tsuper.setValueAt(value,row,col);\n\t\t\tif (DEBUG) {\n\t\t\t\tSystem.out.println(\"Changed a row at \" + row + \",\" + col\n\t\t\t\t\t\t\t\t + \" to \" + value\n\t\t\t\t\t\t\t\t + \" (an instance of \"\n\t\t\t\t\t\t\t\t + value.getClass() + \")\");\n\t\t\t}\n\n\t\t\tif (col==1 || col==2 || col==9){// length or Girth\n\t\t\t\tint bFt=0, bIn=0, breadthIn=0; double rateclass=0 ; double cft=0, amt =0.0; String wclass=\"\";\n\n\t\t\t\tStringTokenizer st = new StringTokenizer((getValueAt(row,2)).toString(),\".\");\n\t\t\t\t\t\t\t\tif (st.hasMoreTokens()) bFt= (new Integer(st.nextToken())).intValue();\n\t\t\t\t\t\t\t\tif (st.hasMoreTokens()) bIn= (new Integer(st.nextToken().trim())).intValue();\n\t\t\t\t\t\t\t\telse bIn = (new Integer(0)).intValue();\n\t\t\t\tbreadthIn = bFt *12 + bIn;\n\n\t\t\t\tdouble x = ((Double)getValueAt(row,1)).doubleValue();\n\t\t\t\tcft = (( x * breadthIn * breadthIn)/2304.0) * ((Integer)getValueAt(row,9)).intValue();\n\n\t\t\t\tConvertLobs.subTCFT((new Double((String)getValueAt(row,11))).doubleValue());\n\t\t\t\tConvertLobs.subAmount(((Double)getValueAt(row,10)).doubleValue());\n\n\t\t\t\tString cl = (String)getValueAt(row, 7);\n\t\t\t\t\t\t\tif (cl.equals(\"A\")) super.setValueAt(\" \", row, 3);\n\t\t\t\t\t\t\tif (cl.equals(\"B\")) super.setValueAt(\" \", row, 4);\n\t\t\t\t\t\t\tif (cl.equals(\"C\")) super.setValueAt(\" \", row, 5);\n\t\t\t\t\t\t\tif (cl.equals(\"D\")) super.setValueAt(\" \", row, 6);\n\n\t\t\t\tif ((breadthIn)>=Converter.classAlimit) { wclass = \"A\"; rateclass = Converter.rateA;\n\t\t\t\t\t\t\t\tamt = rateclass*cft;\n\t\t\t\t\t\t\t\tConvertLobs.subTCFTA((new Double((String)getValueAt(row,3))).doubleValue()); ConvertLobs.addTCFTA(cft);\n\t\t\t\t\t\t\t\tsuper.setValueAt(new Double(cft).toString(), row, 11);\n\t\t\t\t\t\t\t\tsuper.setValueAt(new Double(cft).toString(), row, 3);\n\t\t\t\t\t\t\t\t }\n\t\t\t\telse if ((breadthIn)>=Converter.classBlimit) {wclass = \"B\"; rateclass = Converter.rateB;ConvertLobs.addTCFTB(cft);\n\t\t\t\t\t\t\t\tamt = rateclass*cft;\n\t\t\t\t\t\t\t\tConvertLobs.subTCFTB((new Double((String)getValueAt(row,4))).doubleValue());\n\t\t\t\t\t\t\t\tsuper.setValueAt(new Double(cft).toString(), row, 11);\n\t\t\t\t\t\t\t\tsuper.setValueAt(new Double(cft).toString(), row, 4);\n\t\t\t\t\t\t\t\t}\n\t\t\t\telse if ((breadthIn)>=Converter.classClimit) {wclass = \"C\";rateclass = Converter.rateC; ConvertLobs.addTCFTC(cft);\n\t\t\t\t\t\t\t\t\t amt = rateclass*cft;\n\t\t\t\t\t\t\t ConvertLobs.subTCFTC((new Double((String)getValueAt(row,5))).doubleValue());\n\t\t\t\t\t\t\t super.setValueAt(new Double(cft).toString(), row, 11);\n\t\t\t\t\t\t\t super.setValueAt(new Double(cft).toString(), row, 5);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\telse if ((breadthIn)>=Converter.classDlimit) {wclass = \"D\";rateclass = Converter.rateD; ConvertLobs.addTCFTD(cft);\n\t\t\t\t\t\t\t\t\t\t\tamt = rateclass*cft;\n\t\t\t\t\t\tConvertLobs.subTCFTD((new Double((String)getValueAt(row,6))).doubleValue());\n\t\t\t\t\t\tsuper.setValueAt(new Double(cft).toString(), row, 11);\n\t\t\t\t\t\tsuper.setValueAt(new Double(cft).toString(), row, 6);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\tsuper.setValueAt(wclass, row, 7);\n\t\t\t\tsuper.setValueAt(new Double(rateclass), row, 8);\n\t\t\t\tConvertLobs.addAmount(amt);\n\t\t\t\tsuper.setValueAt(new Double(amt), row, 10);\n\t\t\t\tConvertLobs.addTCFT(cft);\n\n\t\t\t}\n\n\t\t\tif (col == 12){// get row vector and get tcft\n\t\t\tDouble temp= new Double((String)getValueAt(row, col-1));\n\t\t\tConvertLobs.subTCFT(temp.doubleValue());\n\t\t\tDouble temp1= new Double((String)getValueAt(row, col-2));\n\t\t\tConvertLobs.subAmount(temp1.doubleValue());\n\t\t\tInteger temp2= (Integer)getValueAt(row, col-3);\n\t\t\tConvertLobs.subQuantity(temp2.intValue());\n\t\t\tConvertLobs.sno--;\n\t\t\tfor (int i=row-1; i >= 0; i--) super.setValueAt(new Integer( ((Integer)getValueAt(i,0)).intValue() - 1 ), i, 0);\n\n\t\t\tString cl = (String)getValueAt(row, col-5);//\n\t\t\tif (cl.equals(\"A\")) ConvertLobs.subTCFTA(temp.doubleValue());\n\t\t\tif (cl.equals(\"B\")) ConvertLobs.subTCFTB(temp.doubleValue());\n\t\t\tif (cl.equals(\"C\")) ConvertLobs.subTCFTC(temp.doubleValue());\n\t\t\tif (cl.equals(\"D\")) ConvertLobs.subTCFTD(temp.doubleValue());\n\n\t\t\t\t\t\t\tremoveRow(row);\n\t\t\t}\n\t\t\tif (col == 0){\n\t\t\t\tConvertLobs.sno = ((Integer)getValueAt(row,col)).intValue();\n\t\t\t}\n\n\t\t}",
"public void setLogModel(LogModel[] param) {\n validateLogModel(param);\n\n localLogModelTracker = true;\n\n this.localLogModel = param;\n }",
"public void setGrid(Grid grid) {\n\t\tif ((_grid == null && grid == null) || (_grid != null && _grid.equals(grid))) return;\r\n\t\t_grid = grid;\r\n\r\n\t\tmakeDirty(_slide.getSize(), false);\r\n\t\trepaint();\r\n\t}",
"public void setValueAt(Object value, int row, int column)\n\t{\n\t\tgetModel().setDataAt(value, row, convertColumnIndexToModel(column));\n\t}",
"public static void setModel(SnagliModel model1) {\n\t\tmodel = model1;\n\t}",
"public void setCar_model( java.lang.String newValue ) {\n __setCache(\"car_model\", newValue);\n }",
"void setGridY(int i);",
"public void setValueAt(Object value, int row, int col)\n\t{\n\t\tdatas.set(row,value);\n\t\tfireTableCellUpdated(row, col);\n\t}",
"public void setValueAt(Object value,int row, int col)\n {\n\tif (col==1) {\n\t smartPrescaleTable.modRowSetScale(row, (Long)value);\n\t //fireTableStructureChanged();\n\t fireTableDataChanged();\n\t return;\n\t}\n\t\n\tString strCondition = SmartPrescaleTable.regularise((String)value);\n\tif(strCondition.equals(\"\")) return;\n\n\tStringTokenizer pathTokens = new StringTokenizer(strCondition,\"/ \");\n\n\twhile ( pathTokens.hasMoreTokens()) {\n\t String strPath = pathTokens.nextToken().trim();\n\t if (strPath.length()<5) continue;\n\t int g = -10000;\n\t try { \n\t\tg = Integer.parseInt(strPath); \n\t }catch (NumberFormatException e) { \n\t\tg = -10000;\n\t }\n\t if ( (g<0)\n\t\t && ! strPath.equals(\"FALSE\")\n && ! (strPath.indexOf(\"*\") >= 0) // quick hack to allow wildcards\n\t\t && ! smartPrescaleTable.checkL1TCondExists(strPath)\n\t\t && ! smartPrescaleTable.checkHLTPathExists(strPath) ) {\n\t\treturn;\n\t }\n\t}\n\n\t// replace conditions containing only FALSE by empty conditions\n\tstrCondition = SmartPrescaleTable.simplify(strCondition);\n\n\tif (!strCondition.equals(\"\")) {\n\t smartPrescaleTable.modRow(row,strCondition);\n\t //fireTableStructureChanged();\n\t fireTableDataChanged();\n\t}\n }",
"public void setData(int x,int y,boolean v){\r\n\t\tgrid[x][y] = v;\r\n\t}",
"private void updateValue(Widget sender){\r\n\t\tint index = getWidgetIndex(sender) - 1;\r\n\t\tTaskParam param = taskDef.getParamAt(index);\r\n\t\tparam.setValue(((TextBox)sender).getText());\r\n\t\ttaskDef.setDirty(true);\r\n\t}",
"public void setValueAt(Object value, int row, int col)\r\n throws IllegalStateException {\r\n\r\n if(columnsAreNum != null && columnsAreNum.length>0){\r\n\t for(int i =0; i< columnsAreNum.length; i++){\r\n\t if(col == columnsAreNum[i]){\r\n\t value = new Double(tranferStringToNum(value.toString()));\r\n\t break;\r\n\t }\r\n\t }\r\n\t}\r\n //Set value at cell\r\n ( (Vector) data.elementAt(row)).setElementAt(value, col);\r\n //Set status modify to this row.\r\n if (!(Integer.parseInt( ( (Vector) data.elementAt(row)).elementAt\r\n (numberOfcolumns).toString()) == IS_INSERTED)) {\r\n ((Vector) data.elementAt(row)).setElementAt(new Integer(IS_MODIFIED),\r\n numberOfcolumns);\r\n this.updatedStatus = true;\r\n }\r\n }",
"public void setCell(Cell cell)\n {\n myCell = cell;\n }",
"public abstract void setCell(int row, int column, T item);",
"private void updateGrid() {\n if (intersection != null) {\n colorizeGrid();\n for (int x = 0; x < field.length; x++) {\n for (int y = 0; y < field[0].length; y++) {\n field[x][y].setText(intersection.getLetterCode(x, y));\n }\n }\n }\n }",
"public void setQualityGrid( QualityGridBO pQualityGrid )\r\n {\r\n mQualityGrid = pQualityGrid;\r\n }"
] | [
"0.6919874",
"0.6133848",
"0.60637236",
"0.603541",
"0.6001048",
"0.59563905",
"0.594573",
"0.5942175",
"0.59245896",
"0.5917765",
"0.5896841",
"0.5869352",
"0.58680564",
"0.5839671",
"0.5823396",
"0.58148265",
"0.5810854",
"0.5808541",
"0.5800883",
"0.5788203",
"0.5784031",
"0.5733771",
"0.57169366",
"0.57155025",
"0.5702207",
"0.56652373",
"0.56558955",
"0.56496507",
"0.56496507",
"0.56345844",
"0.5631024",
"0.5615627",
"0.56138927",
"0.5611902",
"0.56075937",
"0.5598498",
"0.5574627",
"0.5571324",
"0.5569335",
"0.55648637",
"0.55648637",
"0.55648637",
"0.55648637",
"0.5530073",
"0.5528644",
"0.5516238",
"0.5515554",
"0.55062246",
"0.5499188",
"0.5482989",
"0.54760796",
"0.546764",
"0.54649967",
"0.5446845",
"0.54341793",
"0.54317886",
"0.54307896",
"0.54295653",
"0.5427394",
"0.54264575",
"0.5418256",
"0.54088366",
"0.53868765",
"0.5384873",
"0.5375638",
"0.5375602",
"0.53738546",
"0.5373347",
"0.5359284",
"0.5353871",
"0.53460485",
"0.5344827",
"0.5334547",
"0.53337204",
"0.533062",
"0.5330528",
"0.53288084",
"0.53232795",
"0.53139836",
"0.53109914",
"0.53094256",
"0.53064805",
"0.5304596",
"0.5302489",
"0.5302207",
"0.5298537",
"0.52921367",
"0.52883863",
"0.5285185",
"0.52720183",
"0.5270087",
"0.5267409",
"0.52666056",
"0.5265612",
"0.5255792",
"0.5255243",
"0.52549326",
"0.5254487",
"0.5248066",
"0.52357346"
] | 0.79377866 | 0 |
This mwthod updates value of the specified JLabel by pl | private void updateLabel(JLabel label, int pl) {
synchronized (label) {
String val = label.getText();
int next = Integer.parseInt(val) + pl;
label.setText("" + next);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract void updateLabels();",
"private void updateLabel() {\n\t\tString translation = lp.getString(key);\n\t\tsetText(translation);\n\n\t}",
"String updateLabel(String oldLabel, String newLabel);",
"public void refreshPointsLabel(){\n\t\tpointsLab.setText(\"Points: \" + points);\n\t}",
"@Override\n\tpublic void updateParameter(String parameterLabel, double newValue) {\n\t\tif (parameterLabel.equals(PROBCATCH_PARAMETER_LABEL_GUI)) {\n\t\t\tprobCatch = newValue;\n\t\t}\n\n\t}",
"public void calcVal(JLabel l){\n\t\tdouble total = 0;\n\t\tfor(int i = 0; i < coinList.size(); i++){\n\t\t\ttotal += coinList.get(i).getValue();\n\t\t}\n\t\tl.setText(\"Total Money: $\" + toPercent(total));\n\t}",
"@Override\n\tpublic void updateLabels() {\n\n\t}",
"public void setLabel()\r\n {\r\n int i = Converter(Input);\r\n \r\n if(j<i && label.getText().equals(\"Player 1\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n \r\n }else if(j<i && label.getText().equals(\"Player 2\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n }else if(j<i && label.getText().equals(\"Player 3\"))\r\n {\r\n j++;\r\n label.setText(\"Player \"+j);\r\n }else if(j==i && label.getText().equals(\"Player \"+j))\r\n {\r\n j=1;\r\n label.setText(\"Player \"+j);\r\n }\r\n \r\n \r\n }",
"@Override\n public void update(Object source) {\n\t// on change le texte du label de compteur de mouvement puis on repaint\n\t// ce label et on repaint aussi le dessin de la grille\n\tthis.labNbMoves.setText(\"\" + this.board.getNbMoves());\n\tthis.labNbMoves.repaint();\n\tthis.view.repaint();\n }",
"public void updatePlayerPanel()\n {\n playerInfoPanel.updateLabel();\n }",
"private void updateComputerPlayerMoney()\n {\n lb_money_1.setText(\"My money: \" + computerPlayer_1.getMoney());\n\n // step 2. set lb_money_2 to be \"\"My money: \" + computerPlayer_2.getMoney(), using setText() of the label\n lb_money_2.setText(\"My money: \" + computerPlayer_2.getMoney());\n }",
"@Override\n public void repaint() {\n this.jLabel2.setText(Float.toString(this.c.getVd()));\n this.jLabel4.setText(df.format(this.c.getUu()));\n this.jLabel6.setText(this.c.getSmax());\n this.jLabel8.setText(Float.toString(this.c.getAs()));\n this.jLabel10.setText(df.format(this.c.getVc()));\n this.jLabel11.setText(this.c.getSecc());\n this.jLabel12.setText(this.c.getE());\n this.jLabel13.setText(df.format(this.c.getEval()));\n }",
"Label setLocation();",
"void setLabel(Label label);",
"protected void modify(int i) {\n\n\t\tvalue += i;\n\t\tlabel.setText(Integer.toString(value));\n\t\t\n\t}",
"public void update(){\n label = tag.getSelectedItemPosition() == 0 ? \"all\" : mLabel[tag.getSelectedItemPosition()];\n Refresh();\n }",
"public void updateCaption(Paintable component, UIDL uidl) {\n }",
"public void set(Object requestor, String field, JLabel comp);",
"@Override\r\n\tpublic void update() {\r\n\t\t// get the first element and set the values according to its\r\n\t\t// information\r\n\t\tIqmDataBox iqmDataBox = (IqmDataBox) this.workPackage.getSources().get(0);\r\n\t\tPlanarImage pi = iqmDataBox.getImage();\r\n\r\n\t\tjFormattedTextFieldOldWidth.setValue(pi.getWidth());\r\n\t\tjFormattedTextFieldOldHeight.setValue(pi.getHeight());\r\n\r\n\t\tint left = ((Number) jSpinnerLeft.getValue()).intValue();\r\n\t\tint right = ((Number) jSpinnerRight.getValue()).intValue();\r\n\t\tint top = ((Number) jSpinnerTop.getValue()).intValue();\r\n\t\tint bottom = ((Number) jSpinnerBottom.getValue()).intValue();\r\n\r\n\t\t// Set image dependent initial values;\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pi.getWidth() + left + right);\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.setValue(pi.getHeight() + top + bottom);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\t\t\r\n\t\tif (buttConst.isSelected()){\r\n\t\t\ttbConst.setTitleColor(Color.BLACK);\r\n\t\t\tjLabelConst.setEnabled(true);\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\ttbConst.setTitleColor(Color.GRAY);\r\n\t\t\tjLabelConst.setEnabled(false);\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\t\tthis.repaint(); //because of tb TitledBorder cahnge of color\r\n\t\t\r\n\r\n\t\tthis.updateParameterBlock();\r\n\t\tthis.setParameterValuesToGUI();\r\n\t}",
"public void updateLabels() {\n\t\t//if credit less than 9 add 0 in front of the credit value \n\t\tif (obj.getCredit() < 10)\n\t\t\tcreditLabel.setText(\"0\" + String.valueOf(obj.getCredit()));\n\t\telse\n\t\t\tcreditLabel.setText(String.valueOf(obj.getCredit()));\n\t\t//if bet less than 9 add 0 in front of the credit value\n\t\tif (obj.getBet() < 10)\n\t\t\tbetLebal.setText(\"0\" + String.valueOf(obj.getBet()));\n\t\telse\n\t\t\tbetLebal.setText(String.valueOf(obj.getBet()));\n\t}",
"@Override\n\tpublic void update(Observable o, Object arg) {\n\t\tJLabelNbMort.setText(\"Nb mort : \"+m.getMort());\n\t\tJLabelNbVivant.setText(\"Nb vivant : \"+m.getVivant());\n\t\t//JLabelTemps.setText(\"Temps : \"+m.getTemps());\n\t\tJLabelNbCoup.setText(\"Nb coups : \"+m.getCoup());\n\t}",
"private void updateHubHelps(BoundedRangeModel subModel , JLabel component) {\n DecimalFormat df = new DecimalFormat(\"#00.00\");\n float prc_current = (float)subModel.getValue() / (float)( subModel.getMaximum() - subModel.getMinimum() ) * 100f;\n float prc_total = this.hub.getWeight( this.hub.indexOf( subModel ) ) / this.hub.getTotalWeight() * 100f;\n component.setText( df.format(prc_current) + \" % of \" + df.format(prc_total) + \" %\" );\n }",
"private void updateLabel(String text) {\r\n labelT.setText(text);\r\n labelT.setToolTipText(text);\r\n }",
"private void updatePriceLabel(double aPrice) {\n price = aPrice;\n String out = String.format(\"<html><b>Price</b><br>$%.2f</html>\", price);\n priceLabel.setText(out);\n }",
"public void updateScoreUI() {\n\t\tMap<Integer, Integer> scoreMap = gameLogic.getScoreboard().getTotalScore();\n\n\t\tlblScoreA.setText(String.valueOf(scoreMap.get(0)));\n lblScoreB.setText(String.valueOf(scoreMap.get(1)));\n lblScoreC.setText(String.valueOf(scoreMap.get(2)));\n lblScoreD.setText(String.valueOf(scoreMap.get(3)));\n\t}",
"public void update_statusfield(StatusField field,String text)\r\n {\r\n JLabel targetfield;\r\n if (field==StatusField.STATUSFIELD1) {targetfield=this.statusfield1;}\r\n else if (field==StatusField.STATUSFIELD2) {targetfield=this.statusfield2;}\r\n else {targetfield=this.statusfield3;}\r\n \r\n targetfield.setText(text);\r\n targetfield.repaint();\r\n }",
"public void updateLabels() {\n\t\tfinal PlayerInfo player = ControllerImpl.getController().getCurrentPlayer();\n\t\tplayerLabel.setText(\"Player:\\n\" + player.getName());\n\t\tcashLabel.setText(\"Cash:\\n\" + player.getMoney());\n\t\tnetWorthLabel.setText(\"Net Worth:\\n\" + player.totalAssets());\n\t\tprisonLabel.setText(player.isInJail() ? \"In jail\" : \"Free\");\n\t}",
"private void pSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_pSliderStateChanged\n float tmp_value = ((float)this.pSlider.getValue())/10;\n this.paramPLabel.setText(\"\" + tmp_value);\n }",
"@Override\n protected void positionChanged () {\n\n\n valueLabel.setPosition( this.getX() + ((this.getScaleX() * this.getWidth() - valueLabel.getScaleX() * valueLabel.getWidth()) / 2),\n this.getY() + ((this.getScaleY() * this.getHeight() - valueLabel.getScaleY() * valueLabel.getHeight()) / 2) );\n }",
"public void setL1(JLabel l1) {\n this.l1 = l1;\n }",
"public void updatePortLabel(String newPort) {\n if (portLabel == null) {\n portLabel = new JLabel();\n }\n portLabel.setText(\"Port: \" + newPort);\n }",
"public void updateP1(String stats)\r\n\t{\r\n\t\tp1.setText(stats);\r\n\t}",
"public void updateLabelsAndCharts() {\n\t\terror.setText(\"\");\r\n\t\tPerson p = this.listviewPersons.getSelectionModel().getSelectedItem();\r\n\t\tif (p == null) {\r\n\t\t\tdots.setText(\"\");\r\n\t\t} else {\r\n\t\t\tdots.setText(dotsReadable(p));\r\n\t\t\tif (personToData.containsKey(p)) {\r\n\t\t\t\tData<String, Integer> d = personToData.get(p);\r\n\t\t\t\td.setYValue(p.getDots());\r\n\t\t\t}\r\n\t\t\tif (personToPiechartData.containsKey(p)) {\r\n\t\t\t\tPieChart.Data pd = personToPiechartData.get(p);\r\n\t\t\t\tpd.setPieValue(Math.max(p.getDots(), 0));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public void updateProgressLabel1 (String label1)\n\t{\n\t\t\n\t\tmProgressLabel1.setText(label1);\n\t\tmProgressLabel1.repaint();\n\t\n\t}",
"private void updateValue(Widget sender){\r\n\t\tint index = getWidgetIndex(sender) - 1;\r\n\t\tTaskParam param = taskDef.getParamAt(index);\r\n\t\tparam.setValue(((TextBox)sender).getText());\r\n\t\ttaskDef.setDirty(true);\r\n\t}",
"void setLabel(String label);",
"private void iSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_iSliderStateChanged\n float tmp_value = ((float)this.iSlider.getValue())/10;\n this.paramILabel.setText(\"\" + tmp_value);\n }",
"private void updateScore(int point){\n mScoreView.setText(\"\" + mScore);\n }",
"protected void updateDisplay() {\r\n setValue(Integer.toString(value.getValue()));\r\n }",
"public void updateToPlace(int p) {\n\t\t_units.setText(\"Units to place: \"+p);\n\t\tvalidate();\n\t\trepaint();\n\t}",
"public void setLabel(Object v) \n {\n this.label = v;\n }",
"private void setPlus(JButton btn, JLabel lbl) {\n \tbtn.addActionListener(new ActionListener() {\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tif (blingCount >= 3) return;\n\t\t\t\tint num = Integer.parseInt(lbl.getText()) + 1;\n\t\t\t\tlbl.setText(String.valueOf(num));\n\t\t\t\tblingCount++;\n\t\t\t}\n \t});\n }",
"@Override\n public void update(final Progress progress) {\n SwingUtilities.invokeLater(new Runnable() {\n\n @Override\n public void run() {\n progressBar.setValue(progress.getIntPercentage());\n progressField.setText(roundToSingleDigit(progress.getPercentage()) + \"%\");\n }\n });\n }",
"@Override\n public void update() {\n jTextField1.setText(mCalculator.getDisplay());\n }",
"public void update() {\n\t\tif (this.block.getValue() != 0) {\n\t\t\tthis.displayNumberBlock.removeAll();\n\t\t\tthis.displayNumberBlock.setLayout(new GridLayout(1,1));\n\t\t\tthis.label = new JLabel(\"\" + this.block.getValue(), SwingConstants.CENTER);\n\t\t\tthis.label.setFont(new Font(\"Serif\", Font.PLAIN, 25));\n\t\t\tthis.displayNumberBlock.add(this.label, BorderLayout.CENTER);\n\t\t\t\n\t\t\tthis.displayNumberBlock.revalidate();\n\t\t} else {\n\t\t\tthis.displayNumberBlock.removeAll();\n\t\t\tthis.displayNumberBlock.setLayout(new GridLayout(3,3));\n\t\t\t\n\t\t\tfor(int i = 0; i < SudokuPanel.gameSize; i++){\n\t\t\t\tString temp = \"\";\n\t\t\t\tif(this.getBlock().getNotes()[i]){\n\t\t\t\t\ttemp = \"\" + (i+1);\n\t\t\t\t}\n\t\t\t\tJLabel tempLabel = new JLabel(temp);\n\t\t\t\ttempLabel.setFont(new Font(\"Serif\", Font.PLAIN, 10));\n\t\t\t\tthis.displayNumberBlock.add(tempLabel);\n\t\t\t}\n\t\t\tthis.displayNumberBlock.revalidate();\n\t\t}\n\t}",
"public void updateAnswer(String text) {\n\t\tclearAnswer();\n\t\t\n\t\t// Add new label with the string\n\t\tlbl.setText(text);\n\t\tvPanel.add(lbl);\n\n\t\treturn;\n\t}",
"public void setPnl(double value) {\r\n this.pnl = value;\r\n }",
"public void updateVariables(){\n Map<String, Integer> specialParameter = myLogic.getSpecialParameterToDisplay();\n liveScore.setText(Double.toString(myLogic.getScore()));\n for (String parameter: specialParameter.keySet()) {\n numLives.setText(parameter + specialParameter.get(parameter));\n }\n myMoney.setText(Double.toString(myLogic.getCash()));\n }",
"public void updateExpStatus(String str) {\n final String status = str;\n Runnable doUpdate = new Runnable() {\n public void run() {\n infoLabel.setText(status);\n }\n };\n SwingUtilities.invokeLater(doUpdate);\n }",
"public void updateUI(){}",
"private void updateLabels(ArrayList<String[]> configu, int R) {\r\n\t\t\r\n\t\tfor (int i = 1; i < 5; i++) \r\n\t\t\tlabelText.add(configu.get(R)[i]); //update LabelText in new label\r\n\t\t\r\n\t\t//update in frame\r\n\t\tleftText.setText(labelText.get(0));\r\n\t\tupText.setText(labelText.get(1));\r\n\t\trightText.setText(labelText.get(2));\r\n\t\tdownText.setText(labelText.get(3));\r\n\t}",
"public void actionPerformed(ActionEvent e){\n //Note that because this class is defined inside\n // the GUI class which is defined inside the\n // SampProg127 class, this method has direct\n // access to the members of both the SampProg127\n // class and the GUI class. Therefore, this method\n // can directly access the reference variable named\n // myLabel without having to access it via an\n // object of type GUI.\n myLabel.setText(\"Ouch\");\n\n }",
"public void setPlayer1Label(JLabel playerLabel){\r\n\t\tplayer1Label = playerLabel; \r\n\t\tadd(player1Label, BorderLayout.SOUTH);\r\n\t\tthis.revalidate();\r\n\t}",
"public void setLabel(String rawLabel) { //sets the label\n\t\tthis.rawLabel = rawLabel; //save the raw label\n\n\t\t//Add spaces to each end of the rawLabel to make it\n\t\t// easier to center the label in the LWButton.\n\t\tthis.label = \" \" + rawLabel + \" \";\n\t\tthis.invalidate();\n\t\tthis.repaint();\n\t}",
"public void doubleTileValue() {\n value = value*2;\n label.setText(Integer.toString(value));\n if (value > 4) {\n label.setForeground(other);\n } \n }",
"private void setupLabelUI(Label l, String ff, double f, double w, Pos p, double x, double y) {\n\t\tl.setFont(Font.font(ff, f));\n\t\tl.setMinWidth(w);\n\t\tl.setAlignment(p);\n\t\tl.setLayoutX(x);\n\t\tl.setLayoutY(y);\n\t}",
"private void updateScore(int point){\n sScore.setText(\"\" + mScore + \"/\" + mQuizLibrary.getLength());\n\n }",
"public void status(){\n lblStats.setText(\"\"+level+\"L\");\n }",
"@Override\n\t\t\tpublic void stateChanged(ChangeEvent e) {\n\t\t\t\tint perPersonTipPercentage=((JSlider) e.getSource()).getValue();\n\t\t\t\tfloat perPersonNewTip=(((float)perPersonTipPercentage)/100)*(Float.valueOf(TipCalcView.getInstance().totalTip.getText()).floatValue());\n\t\t\n\t\t\t\tDecimalFormat decimalFormat=new DecimalFormat(\"#.##\");\n\t\t\t\tTipTailorView.getInstance().labels[no].setText(String.valueOf(decimalFormat.format(perPersonNewTip)));\n\t\t\t\tTipCalcView.getInstance().perPersonTip.setText(\"Not Applicable\");\n\t\t\t\tTipCalcView.getInstance().perPersonTip.setEditable(false);\n\t\t\t\t\n\t\t\t\t\n\t\t\t}",
"@Override\r\n public void visitLabel(final Label arg0) {\r\n lab = arg0;\r\n }",
"private void updatePanel() {\n\t\tProbeUtilities.updateModelProbePanel();\n\t}",
"public void updatePenaltyLabel(int currPenalty) {\n penaltyLabel.setText(\"Stacked Penalty: \" + currPenalty);\n }",
"public void update() {\r\n\t\tlabel.setText(time / 60 + \":\" + ((time % 60 <= 9)? (\"0\" + time % 60) : (time % 60)));\r\n\t}",
"public void updateP2(String stats)\r\n\t{\r\n\t\tp2.setText(stats);\r\n\t}",
"@SuppressWarnings(\"unused\")\n\tprotected void updateLabel (String name) {\n Image image = new ImageIcon(\"Resource/\" + name + \".png\").getImage().getScaledInstance(200, 200, Image.SCALE_SMOOTH);\n ImageIcon icon = new ImageIcon(image);\n picture.setIcon(icon);\n if (icon != null) {\n picture.setText(null);\n } else {\n picture.setText(\"Image not found\");\n }\n }",
"public void update(Observable o, Object arg) {\r\n\t\tBufferedImage background = map.getRm().getEmptyMap();\r\n\t\tthis.setIcon(new ImageIcon(this.getImageMap(background)));\r\n\t\tif (map.isSuccess()) // GameSuccess Like Google Style\r\n\t\t{\r\n\t\t\tthis.setHorizontalTextPosition(JLabel.CENTER);\r\n\t\t\tthis.setText(\"<HTML><B><H1><I><FONT COLOR='BLUE'>S</FONT>\"\r\n\t\t\t\t\t+ \"<FONT COLOR='RED'>U</FONT><FONT COLOR='YELLOW'>CC</FONT>\"\r\n\t\t\t\t\t+ \"<FONT COLOR='BLUE'>E</FONT><FONT COLOR='GREEN'>S</FONT>\"\r\n\t\t\t\t\t+ \"<FONT COLOR='RED'>S</FONT></I></H1></B></HTML>\");\r\n\t\t}\r\n\t}",
"private void updateAmplificationValue() {\n ((TextView) findViewById(R.id.zoomUpDownText)).setText(String.valueOf(curves[0].getCurrentAmplification()));\n }",
"void updateControls();",
"public void updatePlayerHealthUI() {\n CharSequence text = String.format(\"Score: %d\", getscore());\n scoreLabel.setText(text);\n }",
"private void updateActualAndDisplayedResult() {\n\t\tresultTipValue = calculateTip( amountValue, percentValue, splitValue);\n\t\ttvResult.setText( \"Tip: $\" + String.format(\"%.2f\", resultTipValue) + \" per person.\" );\t\n\t}",
"public\t\tvoid\t\tsetLabel(String text)\n\t\t{\n\t\tif (label != null)\n\t\t\t{\n\t\t\tif (label instanceof MiWidget)\n\t\t\t\t((MiWidget )label).setValue(text);\n\t\t\telse if (label instanceof MiText)\n\t\t\t\t((MiText )label).setText(text);\n\t\t\telse\n\t\t\t\tlabel.replaceSelf(new MiText(text));\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tlabel = new MiText(text);\n\t\t\tappendPart(label);\n\t\t\t}\n\t\t}",
"public void setLabel(double label) {\n\t\tthis.label = label;\n\t}",
"private void label(Index3D index) {\n // assert imageMask.isTrue(index.i1(), index.i2(), index.i3());\n labelledVolume.set(index.i1(), index.i2(), index.i3(), currentLabel);\n }",
"String updateSliderLabel() {\n if (this.direction.equals(\"H\"))\n return \"Percentage of Width : \";\n if (this.direction.equals(\"V\"))\n return \"Percentage of Height : \";\n return \"/!\\\\ Direction issue! Please relaunch the App /!\\\\\";\n }",
"private void updatePanels() // updatePanels method start\n\t{\n\t\tbalanceOutput.setText(log.balanceReport());\n\t\tlogOutput.setText(log.logReport());\n\t\tATBOutput.setText(log.adjustedTrialBalance());\n\t\tISOutput.setText(log.incomeStatement());\n\t\tRESOutput.setText(log.retainedEarningsStatement());\n\t\tBSOutput.setText(log.balanceSheet());\n\t}",
"public void\nsetNewLabel()\nthrows Exception\n{\n\tdouble lineLength = this.getNucLabelLineLength();\n\tif (lineLength <= 0.0)\n\t\tlineLength = ComplexDefines.NUCLABEL_LINE_LENGTH;\n\tthis.setNewLabel(\n\t\tnew Font(\"Helvetica\", Font.PLAIN, 12),\n\t\tthis.getParentSSData2D().getNucLabelLineWidth(),\n\t\tlineLength, Color.black, this.getID());\n}",
"private void updateStatus(final String status)\n {\n jLabelStatus.setText(status);\n jLabelStatus.paintImmediately(jLabelStatus.getVisibleRect());\n }",
"@Override\n public void setLabel(String arg0)\n {\n \n }",
"private void ssSliderStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_ssSliderStateChanged\n float tmp_value = ((float)this.ssSlider.getValue())/10;\n this.paramssLabel.setText(\"\" + tmp_value);\n }",
"public void switchToLabel() {\n if (deckPanel.getVisibleWidget() == LABEL_INDEX) {\n return;\n }\n // Fires the ValueChanged event.\n setValue(textArea.getText(), true);\n deckPanel.showWidget(LABEL_INDEX);\n }",
"public void\nsetNewLabel(Font font)\nthrows Exception\n{\n\tdouble lineLength = this.getNucLabelLineLength();\n\tif (lineLength <= 0.0)\n\t\tlineLength = ComplexDefines.NUCLABEL_LINE_LENGTH;\n\tthis.setNewLabel(font,\n\t\tthis.getParentSSData2D().getNucLabelLineWidth(), lineLength,\n\t\tColor.black, this.getID());\n}",
"public void label_change(int p, int q){\r\n\t\t// checking root label\r\n\t\tint p_l = label[find(p)];\r\n\t\tint q_l = label[find(q)];\r\n\t\t//System.out.println(p_l + \"\" \"\" + q_l);\r\n\t\tif(p_l > q_l){\r\n\t\t\t//System.out.println(\"\"id = \"\" +find(p) + \"\" label = \"\" + q_l);\r\n\t\t\tlabel[find(p)] = q_l;\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t//System.out.println(\"\"id = \"\" +find(q) + \"\"label = \"\" + p_l);\r\n\t\t\tlabel[find(q)] = p_l;\r\n\t\t}\r\n\t}",
"public void setPoint(int point) {\n\tthis.score_num.setText(String.valueOf(point));\r\n}",
"void setlabel (String label){\r\n\t\tthis.label = label;\r\n\t}",
"@Override\n public void onNotify(StatsPacket statusPacket, ComponentType component) {\n this.hpVal = statusPacket.getEnergyPoints().getHealthPoints();\n this.hpValCapacity = statusPacket.getEnergyPoints().getHealthPointsCapacity();\n\n this.mpVal = statusPacket.getEnergyPoints().getManaPoints();\n this.mpValCapacity = statusPacket.getEnergyPoints().getManaPointsCapacity();\n\n this.xpVal = statusPacket.getExp();\n this.xpValCapacity = statusPacket.getCurrentExpCapacity();\n\n this.levelVal = statusPacket.getLevel();\n\n if(component != ComponentType.LEVEL_UP_SYSTEM_COMPONENT){\n this.goldVal = statusPacket.getGold();\n }\n\n this.hpValLabel.setText(hpVal);\n this.mpValLabel.setText(mpVal);\n this.xpValLabel.setText(xpVal);\n this.goldValLabel.setText(goldVal);\n this.levelValLabel.setText(levelVal.ordinal()+1);\n\n updateBar(hpBar, hpVal, hpValCapacity);\n updateBar(mpBar, mpVal, mpValCapacity);\n updateBar(xpBar, xpVal, xpValCapacity);\n }",
"private void initComponents_label(){\n label_today_date.setText(\"Today Date : \" + Main.DATE_FORMAT.format(Main.getToday_date()));\n this.neon.setIcon(new ImageIcon(Interface_Payment.getScaledImage(new ImageIcon(\"resource/neon.png\").getImage(), 524, 160)));\n this.menu_lable_1.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/pos_main_menu.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_2.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/customer_manager.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_3.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/order_manager.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_4.setIcon(new ImageIcon(new ImageIcon(\"resource/menu_button/exit.png\").getImage().getScaledInstance(485, 60, Image.SCALE_DEFAULT)));\n this.menu_lable_1.setCursor(new Cursor(Cursor.HAND_CURSOR));\n this.menu_lable_2.setCursor(new Cursor(Cursor.HAND_CURSOR));\n this.menu_lable_3.setCursor(new Cursor(Cursor.HAND_CURSOR));\n this.menu_lable_4.setCursor(new Cursor(Cursor.HAND_CURSOR)); \n }",
"public\t\tvoid\t\tsetLabel(MiPart obj)\n\t\t{\n\t\tif (label == obj)\n\t\t\treturn;\n\n\t\tif (obj != null)\n\t\t\tobj.setCenter(getCenter());\n\n\t\tif (label != null)\n\t\t\tremovePart(label);\n\t\tlabel = obj;\n\t\tif (label != null)\n\t\t\tappendPart(label);\n\t\t}",
"@Override\n\tpublic void valueChanged(ListSelectionEvent e) {\n\t\t// TODO Auto-generated method stub\n\t\tString name = ((JList) e.getSource()).getName();\n\t\tif (name.equals(\"pred\")){\n\t\t\tint selected = displayPred.getSelectedIndex();\n\t\t\tif (selected == -1)\n\t\t\t\tselected = 0;\n\t\t\tString loc = predParticles.get(selected).getPath();\n\t\t\tvm.updateParticleGame(loc);\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tint selected = displayPrey.getSelectedIndex();\n\t\t\tString loc = preyParticles.get(selected).getPath();\n\t\t\tvm.updateParticleGame(loc);\n\t\t}\n\t}",
"@FXML\r\n private void updateNumDotsLabel() {\r\n numDotsLabel.setText(\"Number of Dots: \" + picture.getNumDots());\r\n }",
"public abstract void updateSlider();",
"public void valueChanged(ListSelectionEvent e) {\n\t\t\t\tif(!e.getValueIsAdjusting()){\n\n\t\t\t\t\tlabel.setText(\"\");\n\n\t\t\t\t\t//get the product\n\t\t\t\t\tProduct product = catalog.getProduct(list.getSelectedValue()+\"\");\n\t\t\t\t\tlabelTypeInfo.setText(product.getType());\n\t\t\t\t\tlabelNameInfo.setText(product.getName());\n\t\t\t\t\tlabelCodeInfo.setText(product.getCode());\n\t\t\t\t\tlabelPriceInfo.setText(product.getPrice() + \"\");\n\n\n\t\t\t\t\t//judge product is coffee or tea milk, output the different value to the label.\n\t\t\t\t\tif (product.getType() == \"Coffee\") {\n\n\t\t\t\t\t\tlabelTempInfo.setText(((Coffee)product).getTemperature());\n\t\t\t\t\t\tlabelTempInfo.setBorder(new LineBorder(Color.BLACK, 1, true));\n\t\t\t\t\t\tlabelOriginInfo.setText(((Coffee)product).getOrigin());\n\t\t\t\t\t\tlabelOriginInfo.setBorder(new LineBorder(Color.BLACK, 1, true));\n\t\t\t\t\t\tlabelSweetInfo.setText(\"\");\n\t\t\t\t\t\tlabelSweetInfo.setBorder(new LineBorder(Color.LIGHT_GRAY, 1, true));\n\n\n\t\t\t\t\t}else if (product.getType() == \"TeaMilk\") {\n\n\t\t\t\t\t\tlabelSweetInfo.setText(((TeaMilk)product).isSweetness() + \"\");\n\t\t\t\t\t\tlabelSweetInfo.setBorder(new LineBorder(Color.BLACK, 1, true));\n\t\t\t\t\t\tlabelTempInfo.setText(\"\");\n\t\t\t\t\t\tlabelTempInfo.setBorder(new LineBorder(Color.LIGHT_GRAY, 1, true));\n\t\t\t\t\t\tlabelOriginInfo.setText(\"\");\n\t\t\t\t\t\tlabelOriginInfo.setBorder(new LineBorder(Color.LIGHT_GRAY, 1, true));\n\n\t\t\t\t\t}else {\n\t\t\t\t\t\tSystem.out.println(\"an Error\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// set the image to the label to display the product appearance.\n\t\t\t\t\tImageIcon icon = new ImageIcon(\"src/image/\" + product.getName() + \".jpg\");\n\t\t\t\t\timageLabel.setIcon(icon);\n\t\t\t\t\timageLabel.setSize(200, 200);\n\t\t\t\t\tpanelImage.add(imageLabel);\t\n\t\t\t\t}\n\n\n\t\t\t}",
"public void changeVarLabel() {\n if (inHouse.isSelected()) {\n varLabel.setText(\"Machine ID\");\n variableTextField.setPromptText(\"Machine ID...\");\n variableTextField.setMaxLength(9);\n int textLength = partId.getText().length();\n variableTextField.setText(variableTextField.getText().replaceAll(\"[^\\\\d.]\", \"\"));\n variableTextField.positionCaret(textLength);\n } else if (outsourced.isSelected()) {\n varLabel.setText(\"Company Name\");\n variableTextField.setPromptText(\"Company Name...\");\n variableTextField.setMaxLength(26);\n }\n }",
"public void setP1Van() {\n p1Points.setText(\"Ad\");\n }",
"public void setLabel( String label )\n { \n this.label = label;\n show_text();\n }",
"public void setY(double aValue)\n{\n if(_y==aValue) return; // If value already set, just return\n repaint(); // Register repaint\n firePropertyChange(\"Y\", _y, _y = aValue, -1); // Set value and fire PropertyChange\n if(_parent!=null) _parent.setNeedsLayout(true); // Rather bogus\n}",
"public void setLabel( String label ) {\r\n lbl = label;\r\n }",
"public void updatePlayerPoints() {\n setText(Integer.toString(owner.getPlayerPoints()) + \" points\");\n }",
"public void stateChanged(ChangeEvent e)\n {\n slideLabel.setText(\"The speed is \" + speedSlider.getValue());\n }",
"@Override\r\n\tpublic void setParameterValuesToGUI() {\r\n\t\tthis.pb = this.workPackage.getParameters();\r\n\r\n\t\tjSpinnerLeft.removeChangeListener(this);\r\n\t\tjSpinnerRight.removeChangeListener(this);\r\n\t\tjSpinnerTop.removeChangeListener(this);\r\n\t\tjSpinnerBottom.removeChangeListener(this);\r\n\t\tjSpinnerConst.removeChangeListener(this);\r\n\r\n\t\tjSpinnerLeft.setValue(pb.getIntParameter(\"Left\"));\r\n\t\tjSpinnerRight.setValue(pb.getIntParameter(\"Right\"));\r\n\t\tjSpinnerTop.setValue(pb.getIntParameter(\"Top\"));\r\n\t\tjSpinnerBottom.setValue(pb.getIntParameter(\"Bottom\"));\r\n\t\tjSpinnerConst.setValue(pb.getIntParameter(\"Const\"));\r\n\r\n\t\tjSpinnerLeft.addChangeListener(this);\r\n\t\tjSpinnerRight.addChangeListener(this);\r\n\t\tjSpinnerTop.addChangeListener(this);\r\n\t\tjSpinnerBottom.addChangeListener(this);\r\n\t\tjSpinnerConst.addChangeListener(this);\r\n\r\n\t\tjSpinnerNewWidth.removeChangeListener(this);\r\n\t\tjSpinnerNewHeight.removeChangeListener(this);\r\n\t\tjSpinnerNewWidth.setValue(pb.getIntParameter(\"NewWidth\"));\r\n\t\tjSpinnerNewHeight.setValue(pb.getIntParameter(\"NewHeight\"));\r\n\t\tjSpinnerNewWidth.addChangeListener(this);\r\n\t\tjSpinnerNewHeight.addChangeListener(this);\r\n\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.ZERO) buttZero.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.CONSTANT) buttConst.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.COPY) buttCopy.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.REFLECT) buttReflect.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"Method\") == IqmOpBorderDescriptor.WRAP) buttWrap.setSelected(true);\r\n\r\n\t\tif (buttConst.isSelected()) {\r\n\t\t\tjSpinnerConst.setEnabled(true);\r\n\t\t} else {\r\n\t\t\tjSpinnerConst.setEnabled(false);\r\n\t\t}\r\n\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_BORDER) buttBorder.setSelected(true);\r\n\t\tif (pb.getIntParameter(\"BorderOrSize\") == IqmOpBorderDescriptor.PREFERENCE_SIZE) buttSize.setSelected(true);\r\n\r\n\t}",
"@Override\r\n\tpublic void update() {\n\t\tthis.repaint();\r\n\t}"
] | [
"0.6889352",
"0.68144786",
"0.6625514",
"0.6494462",
"0.6412218",
"0.64041114",
"0.6291184",
"0.6269807",
"0.62579554",
"0.6201627",
"0.6167449",
"0.61643845",
"0.61302227",
"0.6113094",
"0.6069159",
"0.6057777",
"0.60555905",
"0.6042923",
"0.6039597",
"0.60333127",
"0.59884936",
"0.59831244",
"0.5963639",
"0.59625983",
"0.5921862",
"0.5912212",
"0.5911876",
"0.5899102",
"0.58948946",
"0.5881176",
"0.5875759",
"0.587395",
"0.5868162",
"0.58498394",
"0.5843082",
"0.58236563",
"0.5816743",
"0.5790748",
"0.5768863",
"0.5765319",
"0.575314",
"0.57459325",
"0.57161355",
"0.57131433",
"0.5711772",
"0.57096153",
"0.57021785",
"0.5700788",
"0.5673244",
"0.5673183",
"0.56698513",
"0.5669705",
"0.5646629",
"0.5637856",
"0.56303954",
"0.56233704",
"0.5622706",
"0.5619992",
"0.56187105",
"0.56053674",
"0.55991477",
"0.55976355",
"0.559283",
"0.55804944",
"0.5575816",
"0.5546851",
"0.554128",
"0.5537713",
"0.5537352",
"0.55300117",
"0.55263907",
"0.55253714",
"0.5512308",
"0.549713",
"0.5494473",
"0.54895604",
"0.547642",
"0.54759866",
"0.5471291",
"0.5464393",
"0.5452546",
"0.5451064",
"0.54468584",
"0.5446632",
"0.5444067",
"0.54411817",
"0.54405385",
"0.5427519",
"0.54253894",
"0.54195017",
"0.5411623",
"0.54042643",
"0.54002196",
"0.53987974",
"0.539352",
"0.53902704",
"0.53898585",
"0.5388295",
"0.53769135",
"0.53660214"
] | 0.7641713 | 0 |
TODO: Maybe solve this via Map | public InputNeuron getInputNeuronFromName(String name) {
for (InputNeuron neuron : inputLayer) {
if (name.equals(neuron.getName())) {
return neuron;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String[] map() throws TooFewNocNodesException;",
"String map( String principal );",
"private void getMapping() {\n double [][] chars = new double[CHAR_SET_SIZE][1];\n for (int i = 0; i < chars.length; i++) {\n chars[i][0] = i;\n }\n Matrix b = new Matrix(key).times(new Matrix(chars));\n map = b.getArray();\n }",
"Map getAll();",
"Map<Element, Map<Element, Element>> getOperationMap();",
"private void processTilesetMap() {\r\n for (int t = 0; t < this.getTileSetCount(); t++) {\r\n TileSet tileSet = this.getTileSet(t);\r\n this.tilesetNameToIDMap.put(tileSet.name, t);\r\n }\r\n }",
"ProcessOperation<Map<String, Object>> map();",
"MapType map(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);",
"private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}",
"private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }",
"Map<String, String> mo14888a();",
"public abstract java.util.Map<java.lang.Double, java.util.List<java.lang.Integer>> pnlListMap();",
"abstract Map<String, Integer> mapOfNamesToSalary();",
"private static Map<String, String> createMapFromList(final List<String> all) {\n\t\tfinal Map<String, String> map = new ConcurrentHashMap<>();\n\n\t\tfor (final String documentElement : all) {\n\t\t\tif (documentElement != null) {\n\t\t\t\tmap.put(documentElement, documentElement);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}",
"private static Map<String,List<Integer>> getProvisionIdMapStream(Map<String,List<Integer>> nameMapIdMap,Map<String,Integer> mapIdProbIdMap){\n return null;\n }",
"protected Map method_1552() {\n return super.method_1552();\n }",
"protected abstract Map<String, Object> _getMulti(Set<String> keys);",
"@Test\r\n\tvoid mapLMethod() {\r\n\t\tMap<String, List<TransactionBean>> postsPerType = transactions.stream()\r\n .collect(Collectors.groupingBy(TransactionBean::getValue));\r\n\t\tSystem.out.println(ToStringBuilder.reflectionToString(postsPerType, new MultilineRecursiveToStringStyle()));\r\n\r\n\t}",
"static void func2() {\n \t\n \tvar list = List.of(\"a\");\n \t\n \tvar set = Set.of(12L, 24L, 48L);\n \t\n \tvar map = Map.of(\"a\", 1, \"b\", 2);\n \t\n \tSystem.out.println(list);\n \tSystem.out.println(set);\n \tSystem.out.println(map);\n }",
"public void testEntrySetIteratorHasProperMappings() {\n return;\r\n }",
"protected abstract Map<String, Serializable> getEventKeyAndIdMap();",
"private <T extends Reference> void buildMap(Map<String, T> map, List<T> objects) {\n for (T candidateObject : objects) {\n String rid = candidateObject.getId();\n log.debug(\"...... caching RID: {}\", rid);\n map.put(rid, candidateObject);\n }\n }",
"abstract protected Map<String, T> lookup(List<String> values);",
"java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();",
"private static List<Department> compute(Collection<Employee> employees) {\n Map<String, Employee> employeeMap = employees.stream().collect(Collectors.toMap(e -> e.getDeptName(), Function.identity(), (old, newOne) -> newOne));\n\n\n// Map<string, dept>\n// getEmp\n// get account\n// check slap\n// construct department\n// put department in List\n\n\nreturn null;\n\n }",
"private Set<String> getNames(Map<String, String> map) {\r\n\t\tSet<String> set = new HashSet<>();\r\n\t\t\r\n\t\tmap.forEach((k,v) -> set.add(k));\r\n\t\t\r\n\t\treturn Collections.unmodifiableSet(set);\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tMap<Integer,Employee> map = new HashMap<Integer, Employee>();\n\t\tMap<String, Employee> hashMap = new HashMap();\n\t\tMap<Employee, Integer> hashMap1 = new HashMap();\n\t\tfor (int i =1; i<=10; i++){\n\t\t\t\n\t\t\tmap.put(i, new Employee(i+3, \"Manish\"+(i+3)));\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tEmployee emp1 = new Employee(4, \"Manish3\");\n\t\t//Use of Contains\n\t\tSystem.out.println(map.containsValue(emp1)); \n\t\t\n\t\t//Key Set\n\t\tSystem.out.println(map.keySet());\n\t\t\n\t\t//retrieve entry set\n\t\tSystem.out.println(map.entrySet());\n\t\t\n\t\t//map.forEach(action);; TO DO- need to understand this method\n\t\t\n\n\t\t//Returns in sorted order when Key is natural (permitives or String or Enum)\n\t\thashMap.put(\"A\", new Employee(1, \"Manish\"));\n\t\thashMap.put(\"C\", new Employee(3, \"Gaurav\"));\n\t\thashMap.put(\"B\", new Employee(2, \"Vinay\"));\n\t\tSystem.out.println(hashMap);\n\t\t\n\t\t//maintains insertion order when key is Object type(dont have any natural order)\n\t\thashMap1.put(new Employee(1, \"Manish\"),1);\n\t\thashMap1.put(new Employee(3, \"Gaurav\"),3);\n\t\thashMap1.put(new Employee(2, \"Vinay\"),2);\n\t\tSystem.out.println(hashMap1);\n\t\tHashMap<Long, String> masterRoomPoolMapping = new HashMap<Long, String>();\n\t\tmasterRoomPoolMapping.put(new Long(123), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(124), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(125), \"Manish\");\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSet<Long> keySet = masterRoomPoolMapping.keySet();\n\t\tSet<Long> newKeySet = new HashSet<Long>();\n\t\tfor(Long key : keySet){\n\t\t\tnewKeySet.add(new Long(key));\n\t\t}\n\t\tSystem.out.println(\"newKeySet***************************************************\");\n\t\tif(newKeySet.contains(new Long(123)))\n\t\t\tnewKeySet.remove(new Long(123));\n\t\tfor(Long key : newKeySet){\n\t\t\tSystem.out.println(key);\n\t\t}\n\t\tSystem.out.println(\"keySet1***************************************************\");\n\t\tSet<Long> keySet1 = masterRoomPoolMapping.keySet();\n\t\tfor(Long key : keySet1){\n\t\t\tSystem.out.println(masterRoomPoolMapping.get(key));\n\t\t}\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSystem.out.println(masterRoomPoolMapping);\n\t}",
"@Test\n public void test12() {\n cashRegister.addPennies(99);\n cashRegister.addDimes(2);\n cashRegister.addDimes(3);\n cashRegister.addFives(10);\n cashRegister.addNickels(4);\n cashRegister.addOnes(1);\n cashRegister.addQuarters(1);\n cashRegister.addTens(5);\n Map<Integer, Integer> map = new TreeMap<Integer, Integer>();\n map.put(1000,5);\n map.put(500,10);\n map.put(100,1);\n map.put(25,1);\n map.put(10,5);\n map.put(5,4);\n map.put(1,99);\n\n assertEquals(map,cashRegister.getContents());\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n map1 = cashRegister.getContents();\n map1.put(0,1);\n assertEquals(map,cashRegister.getContents());\n }",
"private static <T extends AbstractApiIdentifiableDTO> Map<Long, List<T>> generateIdMapList(List<T> idList) {\n Map<Long, List<T>> results = new HashMap<>();\n\n for (T idSingle : idList) {\n Long sourceId = idSingle.getId();\n if (results.containsKey(sourceId)) {\n results.get(sourceId).add(idSingle);\n } else {\n // ID didn't exist so add a new list\n List<T> list = new ArrayList<>(1);\n list.add(idSingle);\n results.put(sourceId, list);\n }\n }\n\n return results;\n }",
"private static Map<Long, Set<XliffAlt>> getXliffAltMap(List<XliffAlt> alts)\n {\n // tuvId : Set<XliffAlt>\n Map<Long, Set<XliffAlt>> xlfAltMap = new HashMap<Long, Set<XliffAlt>>();\n\n for (XliffAlt alt : alts)\n {\n Set<XliffAlt> myAlts = xlfAltMap.get(alt.getTuvId());\n if (myAlts == null)\n {\n myAlts = new HashSet<XliffAlt>();\n myAlts.add(alt);\n xlfAltMap.put(alt.getTuvId(), myAlts);\n }\n else\n {\n myAlts.add(alt);\n xlfAltMap.put(alt.getTuvId(), myAlts);\n }\n }\n\n return xlfAltMap;\n }",
"@Test\n public void test10() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n cashRegister.addPennies(199);\n map1.put(1,199);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(2);\n map1.put(10,2);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(3);\n map1.put(10,5);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addFives(10);\n map1.put(500,10);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addNickels(4);\n map1.put(5,4);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addOnes(1);\n map1.put(100,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addQuarters(1);\n map1.put(25,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addTens(5);\n map1.put(1000,5);\n assertEquals(map1, cashRegister.getContents());\n }",
"Map getSPEXDataMap();",
"interface MapComp<K extends Comparable<K>, V> {\n\n // Add given key-value to this map\n MapComp<K, V> add(K k, V v);\n\n // Count the number of key-values in this map\n Integer count();\n\n // Look up the value associated with given key in this map (if it exists)\n Optional<V> lookup(K k);\n\n // Produce a set of key-values in this map\n Set<Pairof<K, V>> keyVals();\n\n // Produce a list of key-values in ascending sorted order\n Listof<Pairof<K, V>> sortedKeyVals();\n\n // Produce a set of keys in this map\n Set<K> keys();\n\n // Produce a set of keys in ascending sorted order\n Listof<K> sortedKeys();\n\n // Produce a list of values in this map (order is unspecified)\n Listof<V> vals();\n\n // Produce a list of values in the ascending sorted order\n // of their keys in this map\n // NOTE: list is not itself sorted\n Listof<V> sortedVals();\n\n // Is this map the same as m?\n // (Does it have the same keys mapping to the same values?)\n Boolean same(MapComp<K, V> m);\n\n // Remove any key-value with the given key from this map\n MapComp<K, V> remove(K k);\n\n // Remove all key-values with keys that satisfy given predicate\n MapComp<K, V> removeAll(Predicate<K> p);\n\n // Remove all key-values w/ key-values that satisfy given binary predicate\n MapComp<K, V> removeAllPairs(BiPredicate<K, V> p);\n\n // Join this map and given map (entries in this map take precedence)\n MapComp<K, V> join(MapComp<K, V> m);\n}",
"@SuppressWarnings(\"unused\")\n private static <T extends AbstractApiIdentifiableDTO> Map<Long, T> generateIdMap(List<T> idList) {\n Map<Long, T> results = new HashMap<>(idList.size());\n\n for (T idSingle : idList) {\n results.put(idSingle.getId(), idSingle);\n }\n\n return results;\n }",
"private LinkedHashMap<String, Type> scalarMappingODU() {\r\n\t\tLinkedHashMap<String, Type> scalarMapping = new LinkedHashMap<String, Type>();\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODUID, StandardBasicTypes.LONG); // 0\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITE_GROUP,\r\n\t\t\t\tStandardBasicTypes.STRING); // 1\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_CHILD,\r\n\t\t\t\tStandardBasicTypes.STRING); // 2\r\n\t\tscalarMapping.put(DaoConstants.MAP_NAME, StandardBasicTypes.STRING); // 3\r\n\t\tscalarMapping.put(DaoConstants.MAP_CENTRAL_ADDRESS,\r\n\t\t\t\tStandardBasicTypes.STRING); // 4\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_ID, StandardBasicTypes.LONG); // 5\r\n\t\tscalarMapping.put(DaoConstants.MAP_TYPE, StandardBasicTypes.STRING); // 6\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 7\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 8\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 9\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 10\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODU_SVG_PATH,\r\n\t\t\t\tStandardBasicTypes.STRING); // 11\r\n\t\tscalarMapping.put(DaoConstants.MAP_SEVERITY, StandardBasicTypes.STRING); // 12\r\n\t\tscalarMapping.put(DaoConstants.MAP_SLINKADD, StandardBasicTypes.STRING); // 13\r\n\t\tscalarMapping.put(DaoConstants.MAP_ALARM_CODE,\r\n\t\t\t\tStandardBasicTypes.STRING); // 14\r\n\t\tscalarMapping.put(DaoConstants.MAP_C2, StandardBasicTypes.DOUBLE); // 15\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Outdoor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Temp\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_1, StandardBasicTypes.LONG); // 16\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_1\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_2, StandardBasicTypes.LONG); // 17\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_2\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_3, StandardBasicTypes.LONG); // 18\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_3\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_4, StandardBasicTypes.LONG); // 19\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// PAC\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_5, StandardBasicTypes.LONG); // 20\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// EngineWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_6, StandardBasicTypes.LONG); // 21\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NOT_IN_USE_EnginOilChange\r\n\t\tscalarMapping.put(DaoConstants.MAP_G44, StandardBasicTypes.STRING); // 22\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// GenerationPower\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGID, StandardBasicTypes.LONG); // 23\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGNAME, StandardBasicTypes.STRING); // 24\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS1, StandardBasicTypes.DOUBLE); // 25\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS2, StandardBasicTypes.DOUBLE); // 26\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS3, StandardBasicTypes.DOUBLE); // 27\r\n\t\tscalarMapping.put(DaoConstants.MAP_PACHRS, StandardBasicTypes.DOUBLE); // 28\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPHRS, StandardBasicTypes.DOUBLE); // 29\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPOIL, StandardBasicTypes.DOUBLE); // 30\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITEPATH, StandardBasicTypes.STRING); // 31\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPANYNAME,\r\n\t\t\t\tStandardBasicTypes.STRING); // 32\r\n\t\tscalarMapping.put(DaoConstants.MAP_CASTATUS, StandardBasicTypes.STRING); // 33\r\n\t\tscalarMapping.put(DaoConstants.MAP_V23, StandardBasicTypes.STRING); // 34\r\n\t\t// Demand\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR1,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 35\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR2,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 36\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR3,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 37\r\n\t\t//add by shanf\r\n\t\tscalarMapping.put(DaoConstants.DEVICE_MODEL,\r\n\t\t\t\tStandardBasicTypes.STRING); // 38\r\n\r\n\t\treturn scalarMapping;\r\n\t}",
"private void processNameToObjectMap() {\r\n for (int i = 0; i < this.getObjectGroupCount(); i++) {\r\n ObjectGroup g = this.objectGroups.get(i);\r\n this.objectGroupNameToOffset.put(g.name, i);\r\n HashMap<String, Integer> nameToObjectMap = new HashMap<String, Integer>();\r\n for (int ib = 0; ib < this.getObjectCount(i); ib++) {\r\n nameToObjectMap.put(this.getObjectName(i, ib), ib);\r\n }\r\n g.setObjectNameMapping(nameToObjectMap);\r\n }\r\n }",
"XClass getMapKey();",
"public Hashtable getRemappedValues() throws Exception;",
"private static void testMap(final OurMap<Integer, String> map) {\n System.out.printf(\"%n%s%n\", map.getClass());\n assert map.size() == 0;\n assert !map.containsKey(117);\n assert !map.containsKey(-2);\n assert map.get(117) == null;\n assert map.put(117, \"A\") == null;\n assert map.containsKey(117);\n assert map.get(117).equals(\"A\");\n assert map.put(17, \"B\") == null;\n assert map.size() == 2;\n assert map.containsKey(17);\n assert map.get(117).equals(\"A\");\n assert map.get(17).equals(\"B\");\n assert map.put(117, \"C\").equals(\"A\");\n assert map.containsKey(117);\n assert map.get(117).equals(\"C\");\n assert map.size() == 2;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n assert map.remove(117).equals(\"C\");\n assert !map.containsKey(117);\n assert map.get(117) == null;\n assert map.size() == 1;\n assert map.putIfAbsent(17, \"D\").equals(\"B\");\n assert map.get(17).equals(\"B\");\n assert map.size() == 1;\n assert map.containsKey(17);\n assert map.putIfAbsent(217, \"E\") == null;\n assert map.get(217).equals(\"E\");\n assert map.size() == 2;\n assert map.containsKey(217);\n assert map.putIfAbsent(34, \"F\") == null;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n }",
"Map getIDPEXDataMap();",
"public static void main(String[] args) {\n HashMap<Integer, String> Hm = new HashMap<Integer, String>();\n Hm.put(0, \"USA\");\n Hm.put(1, \"UK\");\n Hm.put(2, \"India\");\n Hm.put(3, \"Maldives\");\n \n Set sn=Hm.entrySet();\n Iterator i= sn.iterator(); \n while(i.hasNext()) {\n Map.Entry mp=(Map.Entry)i.next();\n System.out.println(mp.getKey());\n System.out.println(mp.getValue());\n }\n \n\t}",
"int getClassIdXyPairsMapCount();",
"public HashMap<String, NeonValue> getMap();",
"public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, InstantiationException {\n\r\n Map<String, Shape> shapeMap = new HashMap<>();\r\n\r\n shapeMap.put(\"Triangle\", new SimpleTriangle(3, 5, 5));\r\n shapeMap.put(\"Circle\", new SimpleCircle(5));\r\n\r\n for (Map.Entry<String, Shape> entry : shapeMap.entrySet()) {\r\n System.out.println(\"Key - \" + entry.getKey() + \" Value \" + entry.getValue());\r\n }\r\n\r\n //Write a Java program to count the number of key-value (size) mappings in a map\r\n\r\n int size = shapeMap.size();\r\n System.out.println(size);\r\n\r\n //Write a Java program to copy all of the mappings from the specified map to another map.\r\n\r\n Map<String, Shape> shapeMap1 = new HashMap<>();\r\n shapeMap1.put(\"Square7\", new SimpleSquare(7));\r\n shapeMap1.put(\"Square9\", new SimpleSquare(9));\r\n\r\n shapeMap.putAll(shapeMap1);\r\n\r\n System.out.println(shapeMap);\r\n\r\n //Write a Java program to check whether a map contains key-value mappings (empty) or not.Try to use .clear()\r\n\r\n shapeMap1.clear();\r\n System.out.println(shapeMap1.isEmpty());\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified key.\r\n\r\n boolean what = shapeMap.containsKey(\"Square7\");\r\n System.out.println(what);\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified value.\r\n\r\n boolean whatValue = shapeMap.containsValue(new SimpleSquare(7));\r\n System.out.println(whatValue);\r\n\r\n //Write a Java program to create a set view of the mappings contained in a map.\r\n\r\n\r\n //Tree Set\r\n\r\n Set<Employee> treeSet = new TreeSet<>();\r\n treeSet.add(new Employee(17_000, \"J\"));\r\n treeSet.add(new Employee(20_000, \"K\"));\r\n\r\n System.out.println(treeSet);\r\n\r\n final EmployeeAgeComparator ageComparator = new EmployeeAgeComparator();\r\n Set<Employee> treeSetByAge = new TreeSet<>(ageComparator);\r\n treeSetByAge.add(new Employee(22_000, 35, \"L\"));\r\n treeSetByAge.add(new Employee(78_000, 19, \"J\"));\r\n treeSetByAge.add(new Employee(93_000, 55, \"P\"));\r\n\r\n System.out.println(treeSetByAge);\r\n\r\n final EmployeeSalaryComparator salaryComparator = new EmployeeSalaryComparator();\r\n Set<Employee> treeSetBySalary = new TreeSet<>(salaryComparator);\r\n treeSetBySalary.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetBySalary.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetBySalary.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetBySalary);\r\n\r\n System.out.println(\"==============================================\");\r\n\r\n Set<Employee> treeSetByName = new TreeSet<Employee>((o1, o2) -> o1.getName().compareTo(o2.getName()));\r\n\r\n treeSetByName.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetByName.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetByName.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetByName);\r\n\r\n Employee newEmployee = null;\r\n final Constructor<?>[] constructorsEmp = Employee.class.getConstructors();\r\n for (Constructor constructor : constructorsEmp) {\r\n System.out.println(constructor.getParameterCount());\r\n if (constructor.getParameterCount() == 2) {\r\n newEmployee = (Employee) constructor.newInstance(66_000, \"From Reflection\");\r\n }\r\n }\r\n if(newEmployee != null){\r\n System.out.println(newEmployee);\r\n }\r\n\r\n }",
"public abstract Set<Map.Entry<K, V>> a();",
"public static void main(String[] args) {\n\tMap <String, Integer>phones=new HashMap<>();\r\n\tphones.put(\"Mila\", 98232433);\r\n\tphones.put(\"Jenia\", 2834732);\r\n\tphones.put(\"Yerlan\", 77398274);\r\n\tphones.put(\"Mila\",1263584);\r\n\t//last one will override the first one\r\n\t\r\n\tIterator <String> iterator=phones.keySet().iterator();\r\n\twhile (iterator.hasNext()){\r\n\t\tString key=iterator.next();\r\n\t\tInteger value=phones.get(key);\r\n\t\tSystem.out.println(key+\" \"+value);\r\n\t}\r\n\t\r\n\t//store keys in Set\r\n\tSet<String> keys=phones.keySet();\r\n\tfor (String key : keys) {\r\n\t\tSystem.out.println(key);\r\n\t}\r\n\t//store values in Collection\r\n Collection <Integer> val=phones.values();\r\n for (Integer values : val) {\r\n \tSystem.out.println(values);\r\n\t\t\r\n\t}\r\n \r\n Set<Entry<String,Integer>> entry=phones.entrySet();\r\n for (Entry<String, Integer> entry2 : entry) {\r\n\t\t//System.out.println(entry2);\r\n\t\tSystem.out.println(entry2.getKey()+\" \"+entry2.getValue());\r\n\t}\r\n}",
"protected abstract Set method_1559();",
"public WeirdList map(IntUnaryFunction func) {\n return null; // REPLACE THIS LINE WITH THE RIGHT ANSWER.\n }",
"private List<EventInfo> map(List<EventLog> entries) {\n List<EventInfo> events = new ArrayList<>();\n for (EventLog entry : entries) {\n events.add(map(entry));\n }\n return events;\n }",
"private void initIDFMap(List<List<Map<String,List<Double>>>> tfMap){\n\t\tfor (int i = 0; i < tfMap.size(); i++) {\n\t\t\tList<Map<String,List<Double>>> gestureDocument = tfMap.get(i);\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String,List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet().iterator();\n\t\t\t\t while (it.hasNext()) {\n\t\t\t\t Map.Entry<String,Integer> pairs = (Map.Entry)it.next(); \n\t\t\t\t if(getTfIDFMapGlobal().containsKey(pairs.getKey()))\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), getTfIDFMapGlobal().get(pairs.getKey())+1);\n\t\t\t\t else\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), 1);\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}",
"public interface MapP2P<K, V> {\n\n /** Adds key and value in associative array */\n boolean put(K key, V value);\n\n /** Gets from associative array particular value which associated with received key */\n V get(K key);\n\n /** Removes from associative array particular value which associated with received key */\n V remove(K key);\n\n /** Adds in current map other collection which implements interface MapP2P */\n boolean addAll(MapP2P<K, V> mapP2P);\n\n /** Returns information informing whether the given key is in the collection */\n boolean containsKey(K key);\n\n /** Returns information informing whether the given value is in the collection */\n boolean containsValue(Object value);\n\n /** Returns amount element which stored in the associative array */\n int size();\n\n /** Removes all elements (key-value) from collection */\n void clear();\n\n /** Returns set of nodes which contains key-value */\n Set<Node<K, V>> entrySet();\n\n /** Returns information about whether there are elements on the current associative array */\n boolean isEmpty();\n\n /** Interface for Node that contains key and value */\n interface Node<K, V> {\n /** Returns the key of current node */\n K getKey();\n /** Returns the value of current node */\n V getValue();\n }\n\n /** Performs the given action for each node in this map */\n default void forEach(BiConsumer<? super K, ? super V> action) {\n Objects.requireNonNull(action);\n for (Node<K, V> node : entrySet()) {\n action.accept(node.getKey(), node.getValue());\n }\n }\n\n}",
"private void processLayerMap() {\r\n for (int l = 0; l < layers.size(); l++) {\r\n Layer layer = layers.get(l);\r\n this.layerNameToIDMap.put(layer.name, l);\r\n }\r\n }",
"private static HashSet<String> addElement(Map m, String key,int count) {\n\t\tIterator it = m.entrySet().iterator();\n\t\tHashSet<String> allParents=new HashSet<String>();\n\t\tHashSet<String> newNodeHS=new HashSet<String>();\n\t\tHashSet<String> receive=new HashSet<String>();\n\t\tString parent=\"\";\n\t\tif(readNodes.get(key)==null)\n\t\t{\n\t\t\tif(!(key.equals(root)))\n\t\t\t{\n\t\t\tallParents=(HashSet)m.get(key);\n\t\t\tIterator iter = allParents.iterator();\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tparent=(String)iter.next();\n\t\t\t\tcount++;\n\t\t\t\treceive=addElement(m,parent,count);\n\t\t\t\tString str=key+\"-\"+parent;\n\t\t\t\tIterator toRecieve = receive.iterator();\n\t\t\t\twhile(toRecieve.hasNext())\n\t\t\t\t{\n\t\t\t\t\tnewNodeHS.add((String)toRecieve.next());\n\t\t\t\t}\n\t\t\t\tnewNodeHS.add(str);\n\t\t\t\tcount--;\n\t\t\t}\n\t\t\t\tif(count==0)\n\t\t\t\t{\n\t\t\t\t\tIterator<HashSet> iternew = totalDAG.iterator();\n\t\t\t\t\tHashSet<HashSet> inProgressDAG=new HashSet<HashSet>(totalDAG); \n\t\t\t\t\twhile (iternew.hasNext()) {\n\t\t\t\t\t HashSet<String> tillCreatedDAG=iternew.next();\n\t\t\t\t\t HashSet<String> union=new HashSet<String>(newNodeHS);\n\t\t\t\t\t union.addAll(tillCreatedDAG);\n\t\t\t\t\t inProgressDAG.add(union);\n\t\t\t\t\t}\n\t\t\t\t\ttotalDAG.clear();\n\t\t\t\t\ttotalDAG=inProgressDAG;\n\t\t\t\t\ttotalDAG.add(newNodeHS);\n\t\t\t\t\treadNodes.put(key, newNodeHS);\n\t\t\t\t\tSystem.out.println(\"Size: \" +totalDAG.size()+\" Nodes: \"+(++totalCount));\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t\t\tcount--;\n\t\t\t\treturn newNodeHS;\t\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString str=root;\n\t\t\t\t\tnewNodeHS.add(str);\n\t\t\t\t\tcount--;\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (HashSet)readNodes.get(key);\n\t\t}\n\t}",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();",
"public static void main(String[] args) {\n String[] names= {\"Mehmet\", \"Asha\", \"Amina\", \"Omar\", \"Siyar\", \"Danny\"};\n \n Map<Integer, String> nameMap=new LinkedHashMap<>();\n \n int key=1;\n \n for(String name:names) {\n nameMap.put(key, name);\n key++;\n }\n System.out.println(nameMap);\n \n for(Map.Entry<Integer,String>entry:nameMap.entrySet()) {\n \t\tString mapValue=entry.getKey()+\" == \"+entry.getValue();\n \t\tSystem.out.println(mapValue);\n \t\t\n \t\t\n \t}\n \n Iterator<Entry<Integer, String>>it=nameMap.entrySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tMap.Entry entry=it.next();\n\t\t\tString valueFromMap=entry.getKey()+\" : \"+entry.getValue();\n\t\t\tSystem.out.println(valueFromMap);\n\t\t}\n\t\t\n\n }",
"public static void main(String[] args) {\n Map<String, Set<Integer>> ms = new HashMap<>(); \n Set<Integer> s1 = new HashSet<>(Arrays.asList(1,2,3));\n Set<Integer> s2 = new HashSet<>(Arrays.asList(4,5,6));\n Set<Integer> s3 = new HashSet<>(Arrays.asList(7,8,9));\n ms.put(\"one\", s1);\n ms.put(\"two\", s2);\n ms.put(\"three\", s3);\n System.out.println(ms); \n // ch07.collections.Ch0706InterfacesVsConcrete$1\n // {one=[1, 2, 3], two=[4, 5, 6], three=[7, 8, 9]}\n\n // this is how LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>>\n // can be initially initialized\n LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>> toc =\n new LinkedHashMap<>();\n System.out.println(toc); // just using toc to get rid of eclipse warning about not using it\n \n \n\n\n\n }",
"@Test\n public void test1(){\n Map map = us.selectAll(1, 1);\n System.out.println(map);\n }",
"private static void paixu(ArrayList<Integer> p1, Map<Integer, String> map) {\n\t\tCollections.sort(p1);\n\t\tfor (Integer integer : p1) {\n\t\t\tint key = integer;\n\t\t\tString card = map.get(key);\n\t\t\tSystem.out.print(card + \" \");\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\n\t\t//map.\n\t}",
"MAP createMAP();",
"private Set<String> getInfo(Map<String, Set<String>> info, String label) {\n\t\treturn (info.containsKey(label)) ? info.get(label)\n\t\t\t\t: new HashSet<String>();\n\t}",
"@Test\n public void test2 ()\n {\n MyMap m = new MyMap();\n m.put(\"a\", \"1\");\n m.put(\"b\", \"2\");\n m.put(\"a\", \"3\");\n assertEquals(2, m.size());\n assertEquals(\"3\", m.get(\"a\"));\n assertEquals(\"2\", m.get(\"b\"));\n assertNull(m.get(\"c\"));\n }",
"@SuppressWarnings(\"unchecked\")\n private static <T> Map<String, T> mapOf(Object... inputs) {\n Map<String, T> map = new HashMap<>();\n for (int i = 0; i < inputs.length; i += 2) {\n String key = (String) inputs[i];\n T value = (T) inputs[i + 1];\n map.put(key, value);\n }\n return map;\n }",
"private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }",
"static Set get_mapping(HashMap callee_to_caller, Node callee_n) {\n Set s = (Set)callee_to_caller.get(callee_n);\n if (s != null) return s;\n s = NodeSet.FACTORY.makeSet(); s.add(callee_n);\n return s;\n }",
"Map<Double, Element> getElements();",
"public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }",
"@Test\n public void test4 ()\n {\n MyMap m = new MyMap();\n int SIZE = 10000;\n \n // Add SIZE mappings\n for (int i = 0; i < SIZE; i++)\n {\n m.put(i+\"\", (i*17)+\"\");\n }\n \n // Add some of the keys again with new values.\n for (int i = 0; i < SIZE; i+=2)\n {\n m.put(i+\"\", (i*18)+\"\");\n }\n \n // Remove every third element.\n for (int i = 0; i < SIZE; i += 3)\n {\n m.remove(i+\"\");\n }\n \n // Remove some of them again. This should make no difference.\n for (int i = 0; i < SIZE; i += 6)\n {\n m.remove(i+\"\");\n }\n \n // Assert that the size is as expected\n assertEquals(SIZE - (int) Math.ceil(SIZE / 3.0), m.size());\n \n // Assert that membership is as expected\n for (int i = 0; i < SIZE; i++)\n {\n if (i%3 == 0)\n {\n assertNull(m.get(i+\"\"));\n }\n else if (i%2 == 0)\n {\n assertEquals((i*18)+\"\", m.get(i+\"\"));\n }\n else\n {\n \tassertEquals((i*17)+\"\", m.get(i+\"\"));\n }\n }\n }",
"void mo53966a(HashMap<String, ArrayList<C8514d>> hashMap);",
"@Override\r\n public ParaMap index(ParaMap inMap) throws Exception {\n return null;\r\n }",
"private void storeValues(int source,\n Map<VWBetw, Double> map,\n DiskBufferDriver output) throws DriverException {\n for (Entry<VWBetw, Double> e : map.entrySet()) {\n storeValue(source, e.getKey().getID(), e.getValue(), output);\n }\n }",
"private Map<String,MyTargetsBean> getALOrderVal(ArrayList<MyTargetsBean> alMyTargets){\n Map<String,MyTargetsBean> mapMyTargetBean=new HashMap<>();\n if(alMyTargets!=null && alMyTargets.size()>0){\n\n for(MyTargetsBean bean:alMyTargets)\n if(mapOrderValAch.containsKey(bean.getOrderMaterialGroupID())) {\n double mDoubMonthAchived = Double.parseDouble(bean.getMTDA()) + mapOrderValAch.get(bean.getOrderMaterialGroupID());\n mapOrderValAch.put(bean.getOrderMaterialGroupID(), mDoubMonthAchived);\n mapMyTargetBean.put(bean.getOrderMaterialGroupID(),bean);\n }else {\n double mDoubMonthAchived = Double.parseDouble(bean.getMTDA()) ;\n mapOrderValAch.put(bean.getOrderMaterialGroupID(), mDoubMonthAchived);\n mapMyTargetBean.put(bean.getOrderMaterialGroupID(),bean);\n }\n }\n\n\n return mapMyTargetBean;\n }",
"private Map<CollectionCacheableTestId, CollectionCacheableTestValue> findByIdsInternal(Collection<CollectionCacheableTestId> ids) {\n Map<CollectionCacheableTestId, CollectionCacheableTestValue> result = new HashMap<>();\n for (CollectionCacheableTestId id : ids) {\n CollectionCacheableTestValue value = myDbRepository.findById(id);\n // do not explicitly put null values into map\n if (value != null) {\n result.put(id, value);\n }\n }\n return result;\n }",
"private static void fillListFromMap(List<Integer> bucketContents, Map<Double, List<Integer>> m) {\r\n\t\tIterator<Double> iter = m.keySet().iterator();\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tDouble key = iter.next();\r\n\t\t\tbucketContents.addAll(m.get(key));\r\n\t\t}\r\n\t}",
"public abstract Map<K, V> a();",
"private static Map<String, String> getArgMap(String[] args) {\n \t\r\n Map<String,String> argMap = new HashMap<String,String>();\r\n for (int i = 0; i < args.length; i++) {\r\n \tlogger.info(\"arg[\"+i+\"]=\"+args[i]);\r\n String[] argArray = args[i].split(\"=\"); //$NON-NLS-1$\r\n\r\n if (argArray.length == 2) {\r\n argMap.put(argArray[0], argArray[1]);\r\n }\r\n }\r\n return argMap;\r\n }",
"private static void fillupmap(Map<String, Object> m) {\n\t\tRectangle r =new Rectangle(\"A\",2,3);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tr =new Rectangle(\"B\",4,1);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tCircle c =new Circle(\"C\",3);\r\n\t\tm.put(c.getCname(),c);\r\n\t\tc =new Circle(\"D\",4);\r\n\t\tm.put(c.getCname(),c);\r\n\t\t\r\n\t}",
"String getMapCode();",
"public static void main(String[] args) {\n Person.insertToPeopleMap(new Person(39105153322l,\"Romas\",\"Garkas\"));\n Person.insertToPeopleMap(new Person(38512013245l,\"Arnas\",\"Lionginas\"));\n Person.insertToPeopleMap(new Person(48603142299l,\"Maryte\",\"Melninkaite\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Dalia\",\"Morka\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Milda\",\"Morkiene\"));\n\n\n for (Map.Entry<Long, List<Person>> personEntry : Person.getPeople().entrySet()){\n for (Person person : personEntry.getValue()){\n System.out.println(\"A.K.: \" + person.getCitizenCode() + \" Vardas: \" + person.getName() + \" Pavarde: \" + person.getSurname());\n }\n }\n }",
"private static Map<String, Field> schemaToMap(Set<Field> schema){\r\n\t\tMap<String, Field> map = new LinkedHashMap<String, Field>(schema.size());\r\n\t\t\r\n\t\tfor(Field f: schema)\r\n\t\t\tmap.put(f.name, f);\r\n\t\t\r\n\t\treturn map;\r\n\t}",
"@Override\n\tpublic void getStat(Map<String, String> map) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, Integer> priceMap = new HashMap<>(); \n\t\tpriceMap.put(\"TV\", 500); priceMap.put(\"Phone\", 200); \n\t\tpriceMap.put(\"Car\", 20000); priceMap.put(\"Bike\", 6000); \n\t\tpriceMap.put(\"Furniture\", 700); \n\t\n\t\tSystem.out.println(\"price map: \" + priceMap); \n\t\t\n\t\tSet<String> keys = priceMap.keySet(); \n\t\tCollection<Integer> values = priceMap.values();\n\t\t\n\t\tSet<Entry<String, Integer>> entries = priceMap.entrySet(); \n\t\tSystem.out.println(\"keys of Map : \" + keys); \n\t\tSystem.out.println(\"values from Map :\" + values); \n\t\tSystem.out.println(\"entries from Map :\" + entries);\n\n\t\t//Output: price map: {Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500} keys of Map : [Car, Phone, Bike, Furniture, TV] values from Map :[20000, 200, 6000, 700, 500] entries from Map :[Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500]\n\n\t\t\t\t\n\t}",
"private final java.lang.String B(java.util.Map<java.lang.String, ? extends java.lang.Object> r11) {\n /*\n r10 = this;\n r11 = r11.entrySet();\n r11 = (java.lang.Iterable) r11;\n r0 = new java.util.ArrayList;\n r0.<init>();\n r0 = (java.util.Collection) r0;\n r11 = r11.iterator();\n L_0x0011:\n r1 = r11.hasNext();\n if (r1 == 0) goto L_0x004e;\n L_0x0017:\n r1 = r11.next();\n r2 = r1;\n r2 = (java.util.Map.Entry) r2;\n r3 = r2.getKey();\n r3 = (java.lang.CharSequence) r3;\n r3 = r3.length();\n r4 = 1;\n r5 = 0;\n if (r3 <= 0) goto L_0x002e;\n L_0x002c:\n r3 = 1;\n goto L_0x002f;\n L_0x002e:\n r3 = 0;\n L_0x002f:\n if (r3 == 0) goto L_0x0047;\n L_0x0031:\n r2 = r2.getValue();\n r2 = r2.toString();\n r2 = (java.lang.CharSequence) r2;\n r2 = r2.length();\n if (r2 <= 0) goto L_0x0043;\n L_0x0041:\n r2 = 1;\n goto L_0x0044;\n L_0x0043:\n r2 = 0;\n L_0x0044:\n if (r2 == 0) goto L_0x0047;\n L_0x0046:\n goto L_0x0048;\n L_0x0047:\n r4 = 0;\n L_0x0048:\n if (r4 == 0) goto L_0x0011;\n L_0x004a:\n r0.add(r1);\n goto L_0x0011;\n L_0x004e:\n r0 = (java.util.List) r0;\n r1 = r0;\n r1 = (java.lang.Iterable) r1;\n r11 = \"&\";\n r2 = r11;\n r2 = (java.lang.CharSequence) r2;\n r3 = 0;\n r4 = 0;\n r5 = 0;\n r6 = 0;\n r11 = com.iqoption.core.connect.http.Http$urlEncode$2.baR;\n r7 = r11;\n r7 = (kotlin.jvm.a.b) r7;\n r8 = 30;\n r9 = 0;\n r11 = kotlin.collections.u.a(r1, r2, r3, r4, r5, r6, r7, r8, r9);\n r11 = r10.ft(r11);\n return r11;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.core.connect.http.c.B(java.util.Map):java.lang.String\");\n }",
"public abstract void map(String key, String value) throws Exception;",
"private static Map<String, FeatureType> buildAvailableFeatureMap(List<FeatureType> features){\r\n\t\tMap<String, FeatureType> featureMap = new HashMap<String, FeatureType>();\r\n\t\tfor(FeatureType feature : features){\r\n\t\t\tfeatureMap.put(feature.getExternalId(), feature);\r\n\t\t}\r\n\t\treturn featureMap;\r\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, List<String>> map = new HashMap<>();\n\t\tList<String> list = new ArrayList<>();\n\t\tmap.put(\"key1\", list);\n\t\tmap.get(\"key1\").add(\"value1\");\n\t\tmap.get(\"key1\").add(\"value2\");\n\t\t\n\n\t\t//(map.get(\"key1\").get(0)).isEqualTo(\"value1\");\n\t\t//(map.get(\"key1\").get(1)).isEqualTo(\"value2\");\n\t\t\n\t\tMap<String, String> map1 = Stream.of(new String[][] {\n\t\t\t { \"Hello\", \"World\" }, \n\t\t\t { \"John\", \"Doe\" }, \n\t\t\t}).collect(Collectors.toMap(data -> data[0], data -> data[1])); \n\t\t//Notice here the data type of key and value of the Map is same.\n\t\t//In order to make it more generic letís take the array of Objects and perform the same operation:\n\t\tMap<String, Integer> map2 = Stream.of(new Object[][] { \n\t\t { \"data1\", 1 }, \n\t\t { \"data2\", 2 }, \n\t\t}).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\t\t//Here, we create a map of the key as String and value as an Integer.\n\t}",
"static void func1() {\n \t\n \tList<String> list = List.of(\"a\");\n \t\n \tSet<Long> set = Set.of(12L, 24L, 48L);\n \t\n \tMap<String, Integer> map = Map.of(\"a\", 1, \"b\", 2);\n \t\n \tSystem.out.println(list);\n \tSystem.out.println(set);\n \tSystem.out.println(map);\n }",
"private Map<String, String> solutionForCNSHIsFullCNCHHasOnlyOnePlace() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[2].getName());\r\n map.put(this.students[1].getName(), this.schools[2].getName());\r\n map.put(this.students[2].getName(), this.schools[1].getName());\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"Map <String,Integer> RepresentationBinaire(BasicSet A){\r\n\t\tMap<String,Integer> bit=new TreeMap<String,Integer>();\r\n\t\tVector<String> v=context.getAttributes();\t\t\r\n\t\tBasicSet attributes=new BasicSet();\r\n\t\tattributes.addAll(v);\r\n\r\n\t\tfor(String item: attributes )\r\n\t\t{\r\n\t\t\tbit.put(item,0);\t\t\r\n\t\t}\r\n\t\tfor(String item: attributes)\r\n\t\t{\t\t\r\n\t\t\tfor(String it: A){\t\r\n\t\t\t\tif(it.equals(item)){\r\n\t\t\t\t\tbit.put(item,1);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bit;\r\n\t}",
"public void buildMap()\n {\n for(int letterNum=0; letterNum < myText.length()-myNum; letterNum++) {\n String key = myText.substring(letterNum,letterNum+myNum);\n String nextLetter = String.valueOf(myText.charAt(letterNum + myNum));\n if (!map.containsKey(key)) {\n ArrayList<String> lettersArray = new ArrayList<String>();\n lettersArray.add(nextLetter);\n map.put(key,lettersArray);\n }else\n {\n map.get(key).add(nextLetter);\n }\n }\n }",
"@Test\n public void whenHaveListOfUsersThenMakeMapOfUsers() {\n HashMap<Integer, User> expect = new HashMap<>();\n User firstUser = new User(1, \"Vasya\", \"Murmansk\");\n User secondUser = new User(5, \"Vova\", \"Vologda\");\n expect.put(1, firstUser);\n expect.put(5, secondUser);\n List<User> list = new ArrayList<>();\n list.add(firstUser);\n list.add(secondUser);\n UserConvert userConvert = new UserConvert();\n assertThat(userConvert.process(list), is(expect));\n }",
"@Test\n public void testGetValue() throws Exception {\n\n Map<String, IMetaData<SampleMark>> name2MetaData;\n name2MetaData = factory.class2MetaDataByFullPath(Person.class);\n\n assertEquals(3, name2MetaData.size());\n\n for (Person p : persons) {\n\n Person.assertPerson(p,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|lastname\").getValue(p),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|weight\").getValue(p),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|age\").getValue(p));\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Driver.class);\n\n assertEquals(4, name2MetaData.size());\n\n for (Driver d : drivers) {\n\n Driver.assertDriver(d,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|lastname\").getValue(d),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|weight\").getValue(d),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|age\").getValue(d),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|hasDrivingLicense\").getValue(d));\n\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Car.class);\n\n assertEquals(10, name2MetaData.size());\n\n for (Car c : cars) {\n Driver.assertDriver(c.getDriver(),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|lastname\").getValue(c),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\").getValue(c),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|age\").getValue(c),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|hasDrivingLicense\").getValue(c));\n Driver.assertDriver((Driver) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|lastname\").getValue(c),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\").getValue(c),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|age\").getValue(c),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|hasDrivingLicense\").getValue(c));\n Engine.assertEngine(c.getEngine(),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\").getValue(c));\n Engine.assertEngine((Engine) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\").getValue(c));\n\n Oil.assertOil(c.getEngine().oil,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|vendorName\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|producentName\").getValue(c));\n Oil.assertOil((Oil) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|vendorName\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|producentName\").getValue(c));\n }\n\n }",
"public static void main(String[] args) {\n\t\tProduct proone=new Product();\r\n\t\tproone.setProdid(10001);\r\n\t\tproone.setProdname(\"lg\");\r\n\t\tproone.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct protwo=new Product();\r\n\t\tprotwo.setProdid(10008);\r\n\t\tprotwo.setProdname(\"lg\");\r\n\t\tprotwo.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct prothree=new Product();\r\n\t\tprothree.setProdid(10011);\r\n\t\tprothree.setProdname(\"lg\");\r\n\t\tprothree.setProdprice(1181.11);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n /* Map<Integer,String> myMap=new HashMap<>();\r\n myMap.put(1, \"abcd\");\r\n myMap.put(2,\"life\");\r\n myMap.put(3,\"veena\");\r\n */\r\n\t\t Map<Integer,Product> myMap=new HashMap<>();\r\n\t myMap.put(1, protwo);\r\n\t myMap.put(3,prothree);\r\n System.out.println(myMap);\r\n System.out.println(myMap.keySet());//give all keys\r\n System.out.println(myMap.get(2));\r\n System.out.println(myMap.values());//all values\r\n System.out.println(\"____________________for loop_=====================\");\r\n \r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(\"Keys are:\"+keys+\"Values \"+myMap.get(keys));\r\n }\r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(myMap.get(keys).getProdid());\r\n \t System.out.println(myMap.get(keys).getProdname());\r\n \t System.out.println(myMap.get(keys).getProdprice());\r\n \t \r\n }\r\n System.out.println(\"____________________Iterator=====================\");\r\n \r\n // Iterator it=myMap.iterator(); error becoz map is not part of collection but list nd set are part of collection\r\n //convert to set wid help of keyset...keyset will only convert keys entryset will convert evrythng\r\n \r\n Set myData=myMap.entrySet();\r\n Iterator it=myData.iterator();\r\n \r\n while(it.hasNext())\r\n {\r\n \t System.out.println(it.next());\r\n }\r\n \r\n System.out.println(\"============================\");\r\n //Collections.sort(myMap);\r\n \r\n // Set<Product> trgtset=new HashSet<>(myMap.values());\r\n Collection<Product> mySet=myMap.values(); \r\n //Set<Product> sett=new TreeSet<>(mySet);\r\n List<Product> myList=new LinkedList<>(mySet);\r\n Collections.sort(myList);\r\n \r\n /* for(Product prod:myList)\r\n {\r\n \t System.out.println(prod.getProdid());\r\n \t System.out.println(prod.getProdname());\r\n \t System.out.println(prod.getProdprice());\r\n }\r\n\r\n */\r\n Iterator it1=myData.iterator();\r\n \r\n while(it1.hasNext())\r\n {\r\n \t System.out.println(it1.next());\r\n }\r\n Map mp=new HashMap<>();\r\n mp.put(null,null);\r\n mp.put(1, null);\r\n mp.put(2, null);\r\n mp.put(null,null);\r\n System.out.println(mp);\r\n //is same above snippet written with map mp=new HashTable<>() it will giv nullpointer exception\r\n \r\n\t}",
"private void mapPrecincts() {\r\n\t\tMap<Integer, Precinct> allPrecincts = new HashMap<Integer, Precinct>();\r\n\t\tMap<Integer, Precinct> currPrecincts;\r\n\t\tfor (CongressionalDistrict district : districts.values()) {\r\n\t\t\tcurrPrecincts = district.getPrecincts(); // lazy loaded\r\n\t\t\tif (currPrecincts == null) {\r\n\t\t\t\tthrow new IllegalStateException();\r\n\t\t\t}\r\n\t\t\tallPrecincts.putAll(currPrecincts);\r\n\t\t\tfor (Precinct precinct : currPrecincts.values()) {\r\n\t\t\t\tprecinct.setConDistrict(district); // make sure the object is the same\r\n\t\t\t}\r\n\t\t}\r\n\t\tmapNeighborPrecincts(allPrecincts);\r\n\t\tstate.setPrecincts(allPrecincts); //allow for retrieving maps and data later\r\n\t}",
"HashMap <String, Command> getMap();",
"private static Map<String, Integer> getSourceMap() {\n\t\tList<Source> sources = SourceService.findAll();\n\t\tMap<String, Integer> sourceMap = new HashMap<String, Integer>();\n\t\t\n\t\tfor (Source source : sources) {\n\t\t\tsourceMap.put(source.getDomain(), source.getId());\n\t\t}\n\t\t\n\t\treturn sourceMap;\n\t}",
"private Map<String, String> solutionForCNSHIsFull() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[1].getName());\r\n map.put(this.students[1].getName(), this.schools[1].getName());\r\n map.put(this.students[2].getName(), this.schools[1].getName());\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"private Map<Integer, Integer> buildRenaming() {\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\n\t\tfor(int i = 0; i < this.dimension; i++){\n\t\t\tfor(int j = 0; j < this.dimension; j++)\n\t\t\t\tmap.put(board_p[i][j].var(), board[i][j].var());\n\t\t}\n\n\t\treturn map;\n\t}",
"public Object map(String key, Object input);",
"@Test\n public void test3() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n assertEquals(map1, cashRegister.getContents());\n }",
"protected SortedMap getSortedMap() {\n/* 65 */ return (SortedMap)this.map;\n/* */ }",
"@Test\n public void mapContains() {\n check(MAPCONT);\n query(MAPCONT.args(MAPNEW.args(), 1), false);\n query(MAPCONT.args(MAPENTRY.args(1, 2), 1), true);\n }"
] | [
"0.5949002",
"0.5820586",
"0.5645101",
"0.5637478",
"0.5539182",
"0.5455818",
"0.54280734",
"0.54169387",
"0.539714",
"0.5390419",
"0.5362793",
"0.5311873",
"0.53032565",
"0.5301217",
"0.52845186",
"0.5264148",
"0.5263294",
"0.52549326",
"0.5247456",
"0.5224857",
"0.5217127",
"0.5216162",
"0.5202731",
"0.51776195",
"0.5166023",
"0.5164531",
"0.51570016",
"0.5154836",
"0.5142552",
"0.5139961",
"0.5137125",
"0.5130147",
"0.51078594",
"0.51060045",
"0.5104529",
"0.5096302",
"0.5093292",
"0.50898325",
"0.5087522",
"0.5085821",
"0.5085005",
"0.507752",
"0.5077351",
"0.50744176",
"0.50741327",
"0.50697917",
"0.50554156",
"0.5048491",
"0.50451607",
"0.50388044",
"0.5038223",
"0.50374126",
"0.5032155",
"0.50318575",
"0.50300145",
"0.50286883",
"0.502861",
"0.5011374",
"0.500935",
"0.50052893",
"0.50042534",
"0.50041556",
"0.50012857",
"0.4990259",
"0.49884874",
"0.49715108",
"0.4971371",
"0.4956665",
"0.49517652",
"0.4951096",
"0.4948914",
"0.49456954",
"0.49453422",
"0.49442357",
"0.4936949",
"0.49363762",
"0.4926932",
"0.49182263",
"0.4915636",
"0.49054015",
"0.48984",
"0.48968723",
"0.4893947",
"0.48906988",
"0.48861048",
"0.48860058",
"0.48855287",
"0.48848066",
"0.48824066",
"0.4880053",
"0.48766714",
"0.4873673",
"0.48691383",
"0.4864855",
"0.4862611",
"0.4861792",
"0.48570535",
"0.4853276",
"0.48482046",
"0.48469225",
"0.48428202"
] | 0.0 | -1 |
TODO: Maybe solve this via Map | public WorkingNeuron getHiddenNeuronFromName(String name) {
for (WorkingNeuron neuron : hiddenLayer) {
if (name.equals(neuron.getName())) {
return neuron;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String[] map() throws TooFewNocNodesException;",
"String map( String principal );",
"private void getMapping() {\n double [][] chars = new double[CHAR_SET_SIZE][1];\n for (int i = 0; i < chars.length; i++) {\n chars[i][0] = i;\n }\n Matrix b = new Matrix(key).times(new Matrix(chars));\n map = b.getArray();\n }",
"Map getAll();",
"Map<Element, Map<Element, Element>> getOperationMap();",
"private void processTilesetMap() {\r\n for (int t = 0; t < this.getTileSetCount(); t++) {\r\n TileSet tileSet = this.getTileSet(t);\r\n this.tilesetNameToIDMap.put(tileSet.name, t);\r\n }\r\n }",
"ProcessOperation<Map<String, Object>> map();",
"MapType map(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);",
"private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}",
"private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }",
"Map<String, String> mo14888a();",
"public abstract java.util.Map<java.lang.Double, java.util.List<java.lang.Integer>> pnlListMap();",
"abstract Map<String, Integer> mapOfNamesToSalary();",
"private static Map<String, String> createMapFromList(final List<String> all) {\n\t\tfinal Map<String, String> map = new ConcurrentHashMap<>();\n\n\t\tfor (final String documentElement : all) {\n\t\t\tif (documentElement != null) {\n\t\t\t\tmap.put(documentElement, documentElement);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}",
"private static Map<String,List<Integer>> getProvisionIdMapStream(Map<String,List<Integer>> nameMapIdMap,Map<String,Integer> mapIdProbIdMap){\n return null;\n }",
"protected Map method_1552() {\n return super.method_1552();\n }",
"protected abstract Map<String, Object> _getMulti(Set<String> keys);",
"@Test\r\n\tvoid mapLMethod() {\r\n\t\tMap<String, List<TransactionBean>> postsPerType = transactions.stream()\r\n .collect(Collectors.groupingBy(TransactionBean::getValue));\r\n\t\tSystem.out.println(ToStringBuilder.reflectionToString(postsPerType, new MultilineRecursiveToStringStyle()));\r\n\r\n\t}",
"static void func2() {\n \t\n \tvar list = List.of(\"a\");\n \t\n \tvar set = Set.of(12L, 24L, 48L);\n \t\n \tvar map = Map.of(\"a\", 1, \"b\", 2);\n \t\n \tSystem.out.println(list);\n \tSystem.out.println(set);\n \tSystem.out.println(map);\n }",
"public void testEntrySetIteratorHasProperMappings() {\n return;\r\n }",
"protected abstract Map<String, Serializable> getEventKeyAndIdMap();",
"private <T extends Reference> void buildMap(Map<String, T> map, List<T> objects) {\n for (T candidateObject : objects) {\n String rid = candidateObject.getId();\n log.debug(\"...... caching RID: {}\", rid);\n map.put(rid, candidateObject);\n }\n }",
"abstract protected Map<String, T> lookup(List<String> values);",
"java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();",
"private static List<Department> compute(Collection<Employee> employees) {\n Map<String, Employee> employeeMap = employees.stream().collect(Collectors.toMap(e -> e.getDeptName(), Function.identity(), (old, newOne) -> newOne));\n\n\n// Map<string, dept>\n// getEmp\n// get account\n// check slap\n// construct department\n// put department in List\n\n\nreturn null;\n\n }",
"private Set<String> getNames(Map<String, String> map) {\r\n\t\tSet<String> set = new HashSet<>();\r\n\t\t\r\n\t\tmap.forEach((k,v) -> set.add(k));\r\n\t\t\r\n\t\treturn Collections.unmodifiableSet(set);\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tMap<Integer,Employee> map = new HashMap<Integer, Employee>();\n\t\tMap<String, Employee> hashMap = new HashMap();\n\t\tMap<Employee, Integer> hashMap1 = new HashMap();\n\t\tfor (int i =1; i<=10; i++){\n\t\t\t\n\t\t\tmap.put(i, new Employee(i+3, \"Manish\"+(i+3)));\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tEmployee emp1 = new Employee(4, \"Manish3\");\n\t\t//Use of Contains\n\t\tSystem.out.println(map.containsValue(emp1)); \n\t\t\n\t\t//Key Set\n\t\tSystem.out.println(map.keySet());\n\t\t\n\t\t//retrieve entry set\n\t\tSystem.out.println(map.entrySet());\n\t\t\n\t\t//map.forEach(action);; TO DO- need to understand this method\n\t\t\n\n\t\t//Returns in sorted order when Key is natural (permitives or String or Enum)\n\t\thashMap.put(\"A\", new Employee(1, \"Manish\"));\n\t\thashMap.put(\"C\", new Employee(3, \"Gaurav\"));\n\t\thashMap.put(\"B\", new Employee(2, \"Vinay\"));\n\t\tSystem.out.println(hashMap);\n\t\t\n\t\t//maintains insertion order when key is Object type(dont have any natural order)\n\t\thashMap1.put(new Employee(1, \"Manish\"),1);\n\t\thashMap1.put(new Employee(3, \"Gaurav\"),3);\n\t\thashMap1.put(new Employee(2, \"Vinay\"),2);\n\t\tSystem.out.println(hashMap1);\n\t\tHashMap<Long, String> masterRoomPoolMapping = new HashMap<Long, String>();\n\t\tmasterRoomPoolMapping.put(new Long(123), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(124), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(125), \"Manish\");\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSet<Long> keySet = masterRoomPoolMapping.keySet();\n\t\tSet<Long> newKeySet = new HashSet<Long>();\n\t\tfor(Long key : keySet){\n\t\t\tnewKeySet.add(new Long(key));\n\t\t}\n\t\tSystem.out.println(\"newKeySet***************************************************\");\n\t\tif(newKeySet.contains(new Long(123)))\n\t\t\tnewKeySet.remove(new Long(123));\n\t\tfor(Long key : newKeySet){\n\t\t\tSystem.out.println(key);\n\t\t}\n\t\tSystem.out.println(\"keySet1***************************************************\");\n\t\tSet<Long> keySet1 = masterRoomPoolMapping.keySet();\n\t\tfor(Long key : keySet1){\n\t\t\tSystem.out.println(masterRoomPoolMapping.get(key));\n\t\t}\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSystem.out.println(masterRoomPoolMapping);\n\t}",
"@Test\n public void test12() {\n cashRegister.addPennies(99);\n cashRegister.addDimes(2);\n cashRegister.addDimes(3);\n cashRegister.addFives(10);\n cashRegister.addNickels(4);\n cashRegister.addOnes(1);\n cashRegister.addQuarters(1);\n cashRegister.addTens(5);\n Map<Integer, Integer> map = new TreeMap<Integer, Integer>();\n map.put(1000,5);\n map.put(500,10);\n map.put(100,1);\n map.put(25,1);\n map.put(10,5);\n map.put(5,4);\n map.put(1,99);\n\n assertEquals(map,cashRegister.getContents());\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n map1 = cashRegister.getContents();\n map1.put(0,1);\n assertEquals(map,cashRegister.getContents());\n }",
"private static <T extends AbstractApiIdentifiableDTO> Map<Long, List<T>> generateIdMapList(List<T> idList) {\n Map<Long, List<T>> results = new HashMap<>();\n\n for (T idSingle : idList) {\n Long sourceId = idSingle.getId();\n if (results.containsKey(sourceId)) {\n results.get(sourceId).add(idSingle);\n } else {\n // ID didn't exist so add a new list\n List<T> list = new ArrayList<>(1);\n list.add(idSingle);\n results.put(sourceId, list);\n }\n }\n\n return results;\n }",
"private static Map<Long, Set<XliffAlt>> getXliffAltMap(List<XliffAlt> alts)\n {\n // tuvId : Set<XliffAlt>\n Map<Long, Set<XliffAlt>> xlfAltMap = new HashMap<Long, Set<XliffAlt>>();\n\n for (XliffAlt alt : alts)\n {\n Set<XliffAlt> myAlts = xlfAltMap.get(alt.getTuvId());\n if (myAlts == null)\n {\n myAlts = new HashSet<XliffAlt>();\n myAlts.add(alt);\n xlfAltMap.put(alt.getTuvId(), myAlts);\n }\n else\n {\n myAlts.add(alt);\n xlfAltMap.put(alt.getTuvId(), myAlts);\n }\n }\n\n return xlfAltMap;\n }",
"@Test\n public void test10() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n cashRegister.addPennies(199);\n map1.put(1,199);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(2);\n map1.put(10,2);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(3);\n map1.put(10,5);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addFives(10);\n map1.put(500,10);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addNickels(4);\n map1.put(5,4);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addOnes(1);\n map1.put(100,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addQuarters(1);\n map1.put(25,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addTens(5);\n map1.put(1000,5);\n assertEquals(map1, cashRegister.getContents());\n }",
"Map getSPEXDataMap();",
"interface MapComp<K extends Comparable<K>, V> {\n\n // Add given key-value to this map\n MapComp<K, V> add(K k, V v);\n\n // Count the number of key-values in this map\n Integer count();\n\n // Look up the value associated with given key in this map (if it exists)\n Optional<V> lookup(K k);\n\n // Produce a set of key-values in this map\n Set<Pairof<K, V>> keyVals();\n\n // Produce a list of key-values in ascending sorted order\n Listof<Pairof<K, V>> sortedKeyVals();\n\n // Produce a set of keys in this map\n Set<K> keys();\n\n // Produce a set of keys in ascending sorted order\n Listof<K> sortedKeys();\n\n // Produce a list of values in this map (order is unspecified)\n Listof<V> vals();\n\n // Produce a list of values in the ascending sorted order\n // of their keys in this map\n // NOTE: list is not itself sorted\n Listof<V> sortedVals();\n\n // Is this map the same as m?\n // (Does it have the same keys mapping to the same values?)\n Boolean same(MapComp<K, V> m);\n\n // Remove any key-value with the given key from this map\n MapComp<K, V> remove(K k);\n\n // Remove all key-values with keys that satisfy given predicate\n MapComp<K, V> removeAll(Predicate<K> p);\n\n // Remove all key-values w/ key-values that satisfy given binary predicate\n MapComp<K, V> removeAllPairs(BiPredicate<K, V> p);\n\n // Join this map and given map (entries in this map take precedence)\n MapComp<K, V> join(MapComp<K, V> m);\n}",
"@SuppressWarnings(\"unused\")\n private static <T extends AbstractApiIdentifiableDTO> Map<Long, T> generateIdMap(List<T> idList) {\n Map<Long, T> results = new HashMap<>(idList.size());\n\n for (T idSingle : idList) {\n results.put(idSingle.getId(), idSingle);\n }\n\n return results;\n }",
"private LinkedHashMap<String, Type> scalarMappingODU() {\r\n\t\tLinkedHashMap<String, Type> scalarMapping = new LinkedHashMap<String, Type>();\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODUID, StandardBasicTypes.LONG); // 0\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITE_GROUP,\r\n\t\t\t\tStandardBasicTypes.STRING); // 1\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_CHILD,\r\n\t\t\t\tStandardBasicTypes.STRING); // 2\r\n\t\tscalarMapping.put(DaoConstants.MAP_NAME, StandardBasicTypes.STRING); // 3\r\n\t\tscalarMapping.put(DaoConstants.MAP_CENTRAL_ADDRESS,\r\n\t\t\t\tStandardBasicTypes.STRING); // 4\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_ID, StandardBasicTypes.LONG); // 5\r\n\t\tscalarMapping.put(DaoConstants.MAP_TYPE, StandardBasicTypes.STRING); // 6\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 7\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 8\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 9\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 10\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODU_SVG_PATH,\r\n\t\t\t\tStandardBasicTypes.STRING); // 11\r\n\t\tscalarMapping.put(DaoConstants.MAP_SEVERITY, StandardBasicTypes.STRING); // 12\r\n\t\tscalarMapping.put(DaoConstants.MAP_SLINKADD, StandardBasicTypes.STRING); // 13\r\n\t\tscalarMapping.put(DaoConstants.MAP_ALARM_CODE,\r\n\t\t\t\tStandardBasicTypes.STRING); // 14\r\n\t\tscalarMapping.put(DaoConstants.MAP_C2, StandardBasicTypes.DOUBLE); // 15\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Outdoor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Temp\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_1, StandardBasicTypes.LONG); // 16\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_1\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_2, StandardBasicTypes.LONG); // 17\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_2\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_3, StandardBasicTypes.LONG); // 18\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_3\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_4, StandardBasicTypes.LONG); // 19\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// PAC\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_5, StandardBasicTypes.LONG); // 20\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// EngineWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_6, StandardBasicTypes.LONG); // 21\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NOT_IN_USE_EnginOilChange\r\n\t\tscalarMapping.put(DaoConstants.MAP_G44, StandardBasicTypes.STRING); // 22\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// GenerationPower\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGID, StandardBasicTypes.LONG); // 23\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGNAME, StandardBasicTypes.STRING); // 24\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS1, StandardBasicTypes.DOUBLE); // 25\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS2, StandardBasicTypes.DOUBLE); // 26\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS3, StandardBasicTypes.DOUBLE); // 27\r\n\t\tscalarMapping.put(DaoConstants.MAP_PACHRS, StandardBasicTypes.DOUBLE); // 28\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPHRS, StandardBasicTypes.DOUBLE); // 29\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPOIL, StandardBasicTypes.DOUBLE); // 30\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITEPATH, StandardBasicTypes.STRING); // 31\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPANYNAME,\r\n\t\t\t\tStandardBasicTypes.STRING); // 32\r\n\t\tscalarMapping.put(DaoConstants.MAP_CASTATUS, StandardBasicTypes.STRING); // 33\r\n\t\tscalarMapping.put(DaoConstants.MAP_V23, StandardBasicTypes.STRING); // 34\r\n\t\t// Demand\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR1,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 35\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR2,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 36\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR3,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 37\r\n\t\t//add by shanf\r\n\t\tscalarMapping.put(DaoConstants.DEVICE_MODEL,\r\n\t\t\t\tStandardBasicTypes.STRING); // 38\r\n\r\n\t\treturn scalarMapping;\r\n\t}",
"private void processNameToObjectMap() {\r\n for (int i = 0; i < this.getObjectGroupCount(); i++) {\r\n ObjectGroup g = this.objectGroups.get(i);\r\n this.objectGroupNameToOffset.put(g.name, i);\r\n HashMap<String, Integer> nameToObjectMap = new HashMap<String, Integer>();\r\n for (int ib = 0; ib < this.getObjectCount(i); ib++) {\r\n nameToObjectMap.put(this.getObjectName(i, ib), ib);\r\n }\r\n g.setObjectNameMapping(nameToObjectMap);\r\n }\r\n }",
"XClass getMapKey();",
"public Hashtable getRemappedValues() throws Exception;",
"private static void testMap(final OurMap<Integer, String> map) {\n System.out.printf(\"%n%s%n\", map.getClass());\n assert map.size() == 0;\n assert !map.containsKey(117);\n assert !map.containsKey(-2);\n assert map.get(117) == null;\n assert map.put(117, \"A\") == null;\n assert map.containsKey(117);\n assert map.get(117).equals(\"A\");\n assert map.put(17, \"B\") == null;\n assert map.size() == 2;\n assert map.containsKey(17);\n assert map.get(117).equals(\"A\");\n assert map.get(17).equals(\"B\");\n assert map.put(117, \"C\").equals(\"A\");\n assert map.containsKey(117);\n assert map.get(117).equals(\"C\");\n assert map.size() == 2;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n assert map.remove(117).equals(\"C\");\n assert !map.containsKey(117);\n assert map.get(117) == null;\n assert map.size() == 1;\n assert map.putIfAbsent(17, \"D\").equals(\"B\");\n assert map.get(17).equals(\"B\");\n assert map.size() == 1;\n assert map.containsKey(17);\n assert map.putIfAbsent(217, \"E\") == null;\n assert map.get(217).equals(\"E\");\n assert map.size() == 2;\n assert map.containsKey(217);\n assert map.putIfAbsent(34, \"F\") == null;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n }",
"Map getIDPEXDataMap();",
"public static void main(String[] args) {\n HashMap<Integer, String> Hm = new HashMap<Integer, String>();\n Hm.put(0, \"USA\");\n Hm.put(1, \"UK\");\n Hm.put(2, \"India\");\n Hm.put(3, \"Maldives\");\n \n Set sn=Hm.entrySet();\n Iterator i= sn.iterator(); \n while(i.hasNext()) {\n Map.Entry mp=(Map.Entry)i.next();\n System.out.println(mp.getKey());\n System.out.println(mp.getValue());\n }\n \n\t}",
"int getClassIdXyPairsMapCount();",
"public HashMap<String, NeonValue> getMap();",
"public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, InstantiationException {\n\r\n Map<String, Shape> shapeMap = new HashMap<>();\r\n\r\n shapeMap.put(\"Triangle\", new SimpleTriangle(3, 5, 5));\r\n shapeMap.put(\"Circle\", new SimpleCircle(5));\r\n\r\n for (Map.Entry<String, Shape> entry : shapeMap.entrySet()) {\r\n System.out.println(\"Key - \" + entry.getKey() + \" Value \" + entry.getValue());\r\n }\r\n\r\n //Write a Java program to count the number of key-value (size) mappings in a map\r\n\r\n int size = shapeMap.size();\r\n System.out.println(size);\r\n\r\n //Write a Java program to copy all of the mappings from the specified map to another map.\r\n\r\n Map<String, Shape> shapeMap1 = new HashMap<>();\r\n shapeMap1.put(\"Square7\", new SimpleSquare(7));\r\n shapeMap1.put(\"Square9\", new SimpleSquare(9));\r\n\r\n shapeMap.putAll(shapeMap1);\r\n\r\n System.out.println(shapeMap);\r\n\r\n //Write a Java program to check whether a map contains key-value mappings (empty) or not.Try to use .clear()\r\n\r\n shapeMap1.clear();\r\n System.out.println(shapeMap1.isEmpty());\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified key.\r\n\r\n boolean what = shapeMap.containsKey(\"Square7\");\r\n System.out.println(what);\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified value.\r\n\r\n boolean whatValue = shapeMap.containsValue(new SimpleSquare(7));\r\n System.out.println(whatValue);\r\n\r\n //Write a Java program to create a set view of the mappings contained in a map.\r\n\r\n\r\n //Tree Set\r\n\r\n Set<Employee> treeSet = new TreeSet<>();\r\n treeSet.add(new Employee(17_000, \"J\"));\r\n treeSet.add(new Employee(20_000, \"K\"));\r\n\r\n System.out.println(treeSet);\r\n\r\n final EmployeeAgeComparator ageComparator = new EmployeeAgeComparator();\r\n Set<Employee> treeSetByAge = new TreeSet<>(ageComparator);\r\n treeSetByAge.add(new Employee(22_000, 35, \"L\"));\r\n treeSetByAge.add(new Employee(78_000, 19, \"J\"));\r\n treeSetByAge.add(new Employee(93_000, 55, \"P\"));\r\n\r\n System.out.println(treeSetByAge);\r\n\r\n final EmployeeSalaryComparator salaryComparator = new EmployeeSalaryComparator();\r\n Set<Employee> treeSetBySalary = new TreeSet<>(salaryComparator);\r\n treeSetBySalary.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetBySalary.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetBySalary.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetBySalary);\r\n\r\n System.out.println(\"==============================================\");\r\n\r\n Set<Employee> treeSetByName = new TreeSet<Employee>((o1, o2) -> o1.getName().compareTo(o2.getName()));\r\n\r\n treeSetByName.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetByName.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetByName.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetByName);\r\n\r\n Employee newEmployee = null;\r\n final Constructor<?>[] constructorsEmp = Employee.class.getConstructors();\r\n for (Constructor constructor : constructorsEmp) {\r\n System.out.println(constructor.getParameterCount());\r\n if (constructor.getParameterCount() == 2) {\r\n newEmployee = (Employee) constructor.newInstance(66_000, \"From Reflection\");\r\n }\r\n }\r\n if(newEmployee != null){\r\n System.out.println(newEmployee);\r\n }\r\n\r\n }",
"public abstract Set<Map.Entry<K, V>> a();",
"public static void main(String[] args) {\n\tMap <String, Integer>phones=new HashMap<>();\r\n\tphones.put(\"Mila\", 98232433);\r\n\tphones.put(\"Jenia\", 2834732);\r\n\tphones.put(\"Yerlan\", 77398274);\r\n\tphones.put(\"Mila\",1263584);\r\n\t//last one will override the first one\r\n\t\r\n\tIterator <String> iterator=phones.keySet().iterator();\r\n\twhile (iterator.hasNext()){\r\n\t\tString key=iterator.next();\r\n\t\tInteger value=phones.get(key);\r\n\t\tSystem.out.println(key+\" \"+value);\r\n\t}\r\n\t\r\n\t//store keys in Set\r\n\tSet<String> keys=phones.keySet();\r\n\tfor (String key : keys) {\r\n\t\tSystem.out.println(key);\r\n\t}\r\n\t//store values in Collection\r\n Collection <Integer> val=phones.values();\r\n for (Integer values : val) {\r\n \tSystem.out.println(values);\r\n\t\t\r\n\t}\r\n \r\n Set<Entry<String,Integer>> entry=phones.entrySet();\r\n for (Entry<String, Integer> entry2 : entry) {\r\n\t\t//System.out.println(entry2);\r\n\t\tSystem.out.println(entry2.getKey()+\" \"+entry2.getValue());\r\n\t}\r\n}",
"protected abstract Set method_1559();",
"public WeirdList map(IntUnaryFunction func) {\n return null; // REPLACE THIS LINE WITH THE RIGHT ANSWER.\n }",
"private List<EventInfo> map(List<EventLog> entries) {\n List<EventInfo> events = new ArrayList<>();\n for (EventLog entry : entries) {\n events.add(map(entry));\n }\n return events;\n }",
"private void initIDFMap(List<List<Map<String,List<Double>>>> tfMap){\n\t\tfor (int i = 0; i < tfMap.size(); i++) {\n\t\t\tList<Map<String,List<Double>>> gestureDocument = tfMap.get(i);\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String,List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet().iterator();\n\t\t\t\t while (it.hasNext()) {\n\t\t\t\t Map.Entry<String,Integer> pairs = (Map.Entry)it.next(); \n\t\t\t\t if(getTfIDFMapGlobal().containsKey(pairs.getKey()))\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), getTfIDFMapGlobal().get(pairs.getKey())+1);\n\t\t\t\t else\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), 1);\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}",
"public interface MapP2P<K, V> {\n\n /** Adds key and value in associative array */\n boolean put(K key, V value);\n\n /** Gets from associative array particular value which associated with received key */\n V get(K key);\n\n /** Removes from associative array particular value which associated with received key */\n V remove(K key);\n\n /** Adds in current map other collection which implements interface MapP2P */\n boolean addAll(MapP2P<K, V> mapP2P);\n\n /** Returns information informing whether the given key is in the collection */\n boolean containsKey(K key);\n\n /** Returns information informing whether the given value is in the collection */\n boolean containsValue(Object value);\n\n /** Returns amount element which stored in the associative array */\n int size();\n\n /** Removes all elements (key-value) from collection */\n void clear();\n\n /** Returns set of nodes which contains key-value */\n Set<Node<K, V>> entrySet();\n\n /** Returns information about whether there are elements on the current associative array */\n boolean isEmpty();\n\n /** Interface for Node that contains key and value */\n interface Node<K, V> {\n /** Returns the key of current node */\n K getKey();\n /** Returns the value of current node */\n V getValue();\n }\n\n /** Performs the given action for each node in this map */\n default void forEach(BiConsumer<? super K, ? super V> action) {\n Objects.requireNonNull(action);\n for (Node<K, V> node : entrySet()) {\n action.accept(node.getKey(), node.getValue());\n }\n }\n\n}",
"private void processLayerMap() {\r\n for (int l = 0; l < layers.size(); l++) {\r\n Layer layer = layers.get(l);\r\n this.layerNameToIDMap.put(layer.name, l);\r\n }\r\n }",
"private static HashSet<String> addElement(Map m, String key,int count) {\n\t\tIterator it = m.entrySet().iterator();\n\t\tHashSet<String> allParents=new HashSet<String>();\n\t\tHashSet<String> newNodeHS=new HashSet<String>();\n\t\tHashSet<String> receive=new HashSet<String>();\n\t\tString parent=\"\";\n\t\tif(readNodes.get(key)==null)\n\t\t{\n\t\t\tif(!(key.equals(root)))\n\t\t\t{\n\t\t\tallParents=(HashSet)m.get(key);\n\t\t\tIterator iter = allParents.iterator();\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tparent=(String)iter.next();\n\t\t\t\tcount++;\n\t\t\t\treceive=addElement(m,parent,count);\n\t\t\t\tString str=key+\"-\"+parent;\n\t\t\t\tIterator toRecieve = receive.iterator();\n\t\t\t\twhile(toRecieve.hasNext())\n\t\t\t\t{\n\t\t\t\t\tnewNodeHS.add((String)toRecieve.next());\n\t\t\t\t}\n\t\t\t\tnewNodeHS.add(str);\n\t\t\t\tcount--;\n\t\t\t}\n\t\t\t\tif(count==0)\n\t\t\t\t{\n\t\t\t\t\tIterator<HashSet> iternew = totalDAG.iterator();\n\t\t\t\t\tHashSet<HashSet> inProgressDAG=new HashSet<HashSet>(totalDAG); \n\t\t\t\t\twhile (iternew.hasNext()) {\n\t\t\t\t\t HashSet<String> tillCreatedDAG=iternew.next();\n\t\t\t\t\t HashSet<String> union=new HashSet<String>(newNodeHS);\n\t\t\t\t\t union.addAll(tillCreatedDAG);\n\t\t\t\t\t inProgressDAG.add(union);\n\t\t\t\t\t}\n\t\t\t\t\ttotalDAG.clear();\n\t\t\t\t\ttotalDAG=inProgressDAG;\n\t\t\t\t\ttotalDAG.add(newNodeHS);\n\t\t\t\t\treadNodes.put(key, newNodeHS);\n\t\t\t\t\tSystem.out.println(\"Size: \" +totalDAG.size()+\" Nodes: \"+(++totalCount));\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t\t\tcount--;\n\t\t\t\treturn newNodeHS;\t\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString str=root;\n\t\t\t\t\tnewNodeHS.add(str);\n\t\t\t\t\tcount--;\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (HashSet)readNodes.get(key);\n\t\t}\n\t}",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();",
"public static void main(String[] args) {\n String[] names= {\"Mehmet\", \"Asha\", \"Amina\", \"Omar\", \"Siyar\", \"Danny\"};\n \n Map<Integer, String> nameMap=new LinkedHashMap<>();\n \n int key=1;\n \n for(String name:names) {\n nameMap.put(key, name);\n key++;\n }\n System.out.println(nameMap);\n \n for(Map.Entry<Integer,String>entry:nameMap.entrySet()) {\n \t\tString mapValue=entry.getKey()+\" == \"+entry.getValue();\n \t\tSystem.out.println(mapValue);\n \t\t\n \t\t\n \t}\n \n Iterator<Entry<Integer, String>>it=nameMap.entrySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tMap.Entry entry=it.next();\n\t\t\tString valueFromMap=entry.getKey()+\" : \"+entry.getValue();\n\t\t\tSystem.out.println(valueFromMap);\n\t\t}\n\t\t\n\n }",
"public static void main(String[] args) {\n Map<String, Set<Integer>> ms = new HashMap<>(); \n Set<Integer> s1 = new HashSet<>(Arrays.asList(1,2,3));\n Set<Integer> s2 = new HashSet<>(Arrays.asList(4,5,6));\n Set<Integer> s3 = new HashSet<>(Arrays.asList(7,8,9));\n ms.put(\"one\", s1);\n ms.put(\"two\", s2);\n ms.put(\"three\", s3);\n System.out.println(ms); \n // ch07.collections.Ch0706InterfacesVsConcrete$1\n // {one=[1, 2, 3], two=[4, 5, 6], three=[7, 8, 9]}\n\n // this is how LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>>\n // can be initially initialized\n LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>> toc =\n new LinkedHashMap<>();\n System.out.println(toc); // just using toc to get rid of eclipse warning about not using it\n \n \n\n\n\n }",
"@Test\n public void test1(){\n Map map = us.selectAll(1, 1);\n System.out.println(map);\n }",
"private static void paixu(ArrayList<Integer> p1, Map<Integer, String> map) {\n\t\tCollections.sort(p1);\n\t\tfor (Integer integer : p1) {\n\t\t\tint key = integer;\n\t\t\tString card = map.get(key);\n\t\t\tSystem.out.print(card + \" \");\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\n\t\t//map.\n\t}",
"MAP createMAP();",
"private Set<String> getInfo(Map<String, Set<String>> info, String label) {\n\t\treturn (info.containsKey(label)) ? info.get(label)\n\t\t\t\t: new HashSet<String>();\n\t}",
"@Test\n public void test2 ()\n {\n MyMap m = new MyMap();\n m.put(\"a\", \"1\");\n m.put(\"b\", \"2\");\n m.put(\"a\", \"3\");\n assertEquals(2, m.size());\n assertEquals(\"3\", m.get(\"a\"));\n assertEquals(\"2\", m.get(\"b\"));\n assertNull(m.get(\"c\"));\n }",
"@SuppressWarnings(\"unchecked\")\n private static <T> Map<String, T> mapOf(Object... inputs) {\n Map<String, T> map = new HashMap<>();\n for (int i = 0; i < inputs.length; i += 2) {\n String key = (String) inputs[i];\n T value = (T) inputs[i + 1];\n map.put(key, value);\n }\n return map;\n }",
"private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }",
"static Set get_mapping(HashMap callee_to_caller, Node callee_n) {\n Set s = (Set)callee_to_caller.get(callee_n);\n if (s != null) return s;\n s = NodeSet.FACTORY.makeSet(); s.add(callee_n);\n return s;\n }",
"Map<Double, Element> getElements();",
"public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }",
"@Test\n public void test4 ()\n {\n MyMap m = new MyMap();\n int SIZE = 10000;\n \n // Add SIZE mappings\n for (int i = 0; i < SIZE; i++)\n {\n m.put(i+\"\", (i*17)+\"\");\n }\n \n // Add some of the keys again with new values.\n for (int i = 0; i < SIZE; i+=2)\n {\n m.put(i+\"\", (i*18)+\"\");\n }\n \n // Remove every third element.\n for (int i = 0; i < SIZE; i += 3)\n {\n m.remove(i+\"\");\n }\n \n // Remove some of them again. This should make no difference.\n for (int i = 0; i < SIZE; i += 6)\n {\n m.remove(i+\"\");\n }\n \n // Assert that the size is as expected\n assertEquals(SIZE - (int) Math.ceil(SIZE / 3.0), m.size());\n \n // Assert that membership is as expected\n for (int i = 0; i < SIZE; i++)\n {\n if (i%3 == 0)\n {\n assertNull(m.get(i+\"\"));\n }\n else if (i%2 == 0)\n {\n assertEquals((i*18)+\"\", m.get(i+\"\"));\n }\n else\n {\n \tassertEquals((i*17)+\"\", m.get(i+\"\"));\n }\n }\n }",
"void mo53966a(HashMap<String, ArrayList<C8514d>> hashMap);",
"@Override\r\n public ParaMap index(ParaMap inMap) throws Exception {\n return null;\r\n }",
"private void storeValues(int source,\n Map<VWBetw, Double> map,\n DiskBufferDriver output) throws DriverException {\n for (Entry<VWBetw, Double> e : map.entrySet()) {\n storeValue(source, e.getKey().getID(), e.getValue(), output);\n }\n }",
"private Map<String,MyTargetsBean> getALOrderVal(ArrayList<MyTargetsBean> alMyTargets){\n Map<String,MyTargetsBean> mapMyTargetBean=new HashMap<>();\n if(alMyTargets!=null && alMyTargets.size()>0){\n\n for(MyTargetsBean bean:alMyTargets)\n if(mapOrderValAch.containsKey(bean.getOrderMaterialGroupID())) {\n double mDoubMonthAchived = Double.parseDouble(bean.getMTDA()) + mapOrderValAch.get(bean.getOrderMaterialGroupID());\n mapOrderValAch.put(bean.getOrderMaterialGroupID(), mDoubMonthAchived);\n mapMyTargetBean.put(bean.getOrderMaterialGroupID(),bean);\n }else {\n double mDoubMonthAchived = Double.parseDouble(bean.getMTDA()) ;\n mapOrderValAch.put(bean.getOrderMaterialGroupID(), mDoubMonthAchived);\n mapMyTargetBean.put(bean.getOrderMaterialGroupID(),bean);\n }\n }\n\n\n return mapMyTargetBean;\n }",
"private Map<CollectionCacheableTestId, CollectionCacheableTestValue> findByIdsInternal(Collection<CollectionCacheableTestId> ids) {\n Map<CollectionCacheableTestId, CollectionCacheableTestValue> result = new HashMap<>();\n for (CollectionCacheableTestId id : ids) {\n CollectionCacheableTestValue value = myDbRepository.findById(id);\n // do not explicitly put null values into map\n if (value != null) {\n result.put(id, value);\n }\n }\n return result;\n }",
"private static void fillListFromMap(List<Integer> bucketContents, Map<Double, List<Integer>> m) {\r\n\t\tIterator<Double> iter = m.keySet().iterator();\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tDouble key = iter.next();\r\n\t\t\tbucketContents.addAll(m.get(key));\r\n\t\t}\r\n\t}",
"public abstract Map<K, V> a();",
"private static Map<String, String> getArgMap(String[] args) {\n \t\r\n Map<String,String> argMap = new HashMap<String,String>();\r\n for (int i = 0; i < args.length; i++) {\r\n \tlogger.info(\"arg[\"+i+\"]=\"+args[i]);\r\n String[] argArray = args[i].split(\"=\"); //$NON-NLS-1$\r\n\r\n if (argArray.length == 2) {\r\n argMap.put(argArray[0], argArray[1]);\r\n }\r\n }\r\n return argMap;\r\n }",
"private static void fillupmap(Map<String, Object> m) {\n\t\tRectangle r =new Rectangle(\"A\",2,3);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tr =new Rectangle(\"B\",4,1);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tCircle c =new Circle(\"C\",3);\r\n\t\tm.put(c.getCname(),c);\r\n\t\tc =new Circle(\"D\",4);\r\n\t\tm.put(c.getCname(),c);\r\n\t\t\r\n\t}",
"String getMapCode();",
"public static void main(String[] args) {\n Person.insertToPeopleMap(new Person(39105153322l,\"Romas\",\"Garkas\"));\n Person.insertToPeopleMap(new Person(38512013245l,\"Arnas\",\"Lionginas\"));\n Person.insertToPeopleMap(new Person(48603142299l,\"Maryte\",\"Melninkaite\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Dalia\",\"Morka\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Milda\",\"Morkiene\"));\n\n\n for (Map.Entry<Long, List<Person>> personEntry : Person.getPeople().entrySet()){\n for (Person person : personEntry.getValue()){\n System.out.println(\"A.K.: \" + person.getCitizenCode() + \" Vardas: \" + person.getName() + \" Pavarde: \" + person.getSurname());\n }\n }\n }",
"private static Map<String, Field> schemaToMap(Set<Field> schema){\r\n\t\tMap<String, Field> map = new LinkedHashMap<String, Field>(schema.size());\r\n\t\t\r\n\t\tfor(Field f: schema)\r\n\t\t\tmap.put(f.name, f);\r\n\t\t\r\n\t\treturn map;\r\n\t}",
"@Override\n\tpublic void getStat(Map<String, String> map) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, Integer> priceMap = new HashMap<>(); \n\t\tpriceMap.put(\"TV\", 500); priceMap.put(\"Phone\", 200); \n\t\tpriceMap.put(\"Car\", 20000); priceMap.put(\"Bike\", 6000); \n\t\tpriceMap.put(\"Furniture\", 700); \n\t\n\t\tSystem.out.println(\"price map: \" + priceMap); \n\t\t\n\t\tSet<String> keys = priceMap.keySet(); \n\t\tCollection<Integer> values = priceMap.values();\n\t\t\n\t\tSet<Entry<String, Integer>> entries = priceMap.entrySet(); \n\t\tSystem.out.println(\"keys of Map : \" + keys); \n\t\tSystem.out.println(\"values from Map :\" + values); \n\t\tSystem.out.println(\"entries from Map :\" + entries);\n\n\t\t//Output: price map: {Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500} keys of Map : [Car, Phone, Bike, Furniture, TV] values from Map :[20000, 200, 6000, 700, 500] entries from Map :[Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500]\n\n\t\t\t\t\n\t}",
"private final java.lang.String B(java.util.Map<java.lang.String, ? extends java.lang.Object> r11) {\n /*\n r10 = this;\n r11 = r11.entrySet();\n r11 = (java.lang.Iterable) r11;\n r0 = new java.util.ArrayList;\n r0.<init>();\n r0 = (java.util.Collection) r0;\n r11 = r11.iterator();\n L_0x0011:\n r1 = r11.hasNext();\n if (r1 == 0) goto L_0x004e;\n L_0x0017:\n r1 = r11.next();\n r2 = r1;\n r2 = (java.util.Map.Entry) r2;\n r3 = r2.getKey();\n r3 = (java.lang.CharSequence) r3;\n r3 = r3.length();\n r4 = 1;\n r5 = 0;\n if (r3 <= 0) goto L_0x002e;\n L_0x002c:\n r3 = 1;\n goto L_0x002f;\n L_0x002e:\n r3 = 0;\n L_0x002f:\n if (r3 == 0) goto L_0x0047;\n L_0x0031:\n r2 = r2.getValue();\n r2 = r2.toString();\n r2 = (java.lang.CharSequence) r2;\n r2 = r2.length();\n if (r2 <= 0) goto L_0x0043;\n L_0x0041:\n r2 = 1;\n goto L_0x0044;\n L_0x0043:\n r2 = 0;\n L_0x0044:\n if (r2 == 0) goto L_0x0047;\n L_0x0046:\n goto L_0x0048;\n L_0x0047:\n r4 = 0;\n L_0x0048:\n if (r4 == 0) goto L_0x0011;\n L_0x004a:\n r0.add(r1);\n goto L_0x0011;\n L_0x004e:\n r0 = (java.util.List) r0;\n r1 = r0;\n r1 = (java.lang.Iterable) r1;\n r11 = \"&\";\n r2 = r11;\n r2 = (java.lang.CharSequence) r2;\n r3 = 0;\n r4 = 0;\n r5 = 0;\n r6 = 0;\n r11 = com.iqoption.core.connect.http.Http$urlEncode$2.baR;\n r7 = r11;\n r7 = (kotlin.jvm.a.b) r7;\n r8 = 30;\n r9 = 0;\n r11 = kotlin.collections.u.a(r1, r2, r3, r4, r5, r6, r7, r8, r9);\n r11 = r10.ft(r11);\n return r11;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.core.connect.http.c.B(java.util.Map):java.lang.String\");\n }",
"public abstract void map(String key, String value) throws Exception;",
"private static Map<String, FeatureType> buildAvailableFeatureMap(List<FeatureType> features){\r\n\t\tMap<String, FeatureType> featureMap = new HashMap<String, FeatureType>();\r\n\t\tfor(FeatureType feature : features){\r\n\t\t\tfeatureMap.put(feature.getExternalId(), feature);\r\n\t\t}\r\n\t\treturn featureMap;\r\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, List<String>> map = new HashMap<>();\n\t\tList<String> list = new ArrayList<>();\n\t\tmap.put(\"key1\", list);\n\t\tmap.get(\"key1\").add(\"value1\");\n\t\tmap.get(\"key1\").add(\"value2\");\n\t\t\n\n\t\t//(map.get(\"key1\").get(0)).isEqualTo(\"value1\");\n\t\t//(map.get(\"key1\").get(1)).isEqualTo(\"value2\");\n\t\t\n\t\tMap<String, String> map1 = Stream.of(new String[][] {\n\t\t\t { \"Hello\", \"World\" }, \n\t\t\t { \"John\", \"Doe\" }, \n\t\t\t}).collect(Collectors.toMap(data -> data[0], data -> data[1])); \n\t\t//Notice here the data type of key and value of the Map is same.\n\t\t//In order to make it more generic letís take the array of Objects and perform the same operation:\n\t\tMap<String, Integer> map2 = Stream.of(new Object[][] { \n\t\t { \"data1\", 1 }, \n\t\t { \"data2\", 2 }, \n\t\t}).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\t\t//Here, we create a map of the key as String and value as an Integer.\n\t}",
"static void func1() {\n \t\n \tList<String> list = List.of(\"a\");\n \t\n \tSet<Long> set = Set.of(12L, 24L, 48L);\n \t\n \tMap<String, Integer> map = Map.of(\"a\", 1, \"b\", 2);\n \t\n \tSystem.out.println(list);\n \tSystem.out.println(set);\n \tSystem.out.println(map);\n }",
"private Map<String, String> solutionForCNSHIsFullCNCHHasOnlyOnePlace() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[2].getName());\r\n map.put(this.students[1].getName(), this.schools[2].getName());\r\n map.put(this.students[2].getName(), this.schools[1].getName());\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"Map <String,Integer> RepresentationBinaire(BasicSet A){\r\n\t\tMap<String,Integer> bit=new TreeMap<String,Integer>();\r\n\t\tVector<String> v=context.getAttributes();\t\t\r\n\t\tBasicSet attributes=new BasicSet();\r\n\t\tattributes.addAll(v);\r\n\r\n\t\tfor(String item: attributes )\r\n\t\t{\r\n\t\t\tbit.put(item,0);\t\t\r\n\t\t}\r\n\t\tfor(String item: attributes)\r\n\t\t{\t\t\r\n\t\t\tfor(String it: A){\t\r\n\t\t\t\tif(it.equals(item)){\r\n\t\t\t\t\tbit.put(item,1);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bit;\r\n\t}",
"public void buildMap()\n {\n for(int letterNum=0; letterNum < myText.length()-myNum; letterNum++) {\n String key = myText.substring(letterNum,letterNum+myNum);\n String nextLetter = String.valueOf(myText.charAt(letterNum + myNum));\n if (!map.containsKey(key)) {\n ArrayList<String> lettersArray = new ArrayList<String>();\n lettersArray.add(nextLetter);\n map.put(key,lettersArray);\n }else\n {\n map.get(key).add(nextLetter);\n }\n }\n }",
"@Test\n public void whenHaveListOfUsersThenMakeMapOfUsers() {\n HashMap<Integer, User> expect = new HashMap<>();\n User firstUser = new User(1, \"Vasya\", \"Murmansk\");\n User secondUser = new User(5, \"Vova\", \"Vologda\");\n expect.put(1, firstUser);\n expect.put(5, secondUser);\n List<User> list = new ArrayList<>();\n list.add(firstUser);\n list.add(secondUser);\n UserConvert userConvert = new UserConvert();\n assertThat(userConvert.process(list), is(expect));\n }",
"@Test\n public void testGetValue() throws Exception {\n\n Map<String, IMetaData<SampleMark>> name2MetaData;\n name2MetaData = factory.class2MetaDataByFullPath(Person.class);\n\n assertEquals(3, name2MetaData.size());\n\n for (Person p : persons) {\n\n Person.assertPerson(p,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|lastname\").getValue(p),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|weight\").getValue(p),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|age\").getValue(p));\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Driver.class);\n\n assertEquals(4, name2MetaData.size());\n\n for (Driver d : drivers) {\n\n Driver.assertDriver(d,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|lastname\").getValue(d),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|weight\").getValue(d),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|age\").getValue(d),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|hasDrivingLicense\").getValue(d));\n\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Car.class);\n\n assertEquals(10, name2MetaData.size());\n\n for (Car c : cars) {\n Driver.assertDriver(c.getDriver(),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|lastname\").getValue(c),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\").getValue(c),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|age\").getValue(c),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|hasDrivingLicense\").getValue(c));\n Driver.assertDriver((Driver) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|lastname\").getValue(c),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\").getValue(c),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|age\").getValue(c),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|hasDrivingLicense\").getValue(c));\n Engine.assertEngine(c.getEngine(),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\").getValue(c));\n Engine.assertEngine((Engine) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\").getValue(c));\n\n Oil.assertOil(c.getEngine().oil,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|vendorName\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|producentName\").getValue(c));\n Oil.assertOil((Oil) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|vendorName\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|producentName\").getValue(c));\n }\n\n }",
"public static void main(String[] args) {\n\t\tProduct proone=new Product();\r\n\t\tproone.setProdid(10001);\r\n\t\tproone.setProdname(\"lg\");\r\n\t\tproone.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct protwo=new Product();\r\n\t\tprotwo.setProdid(10008);\r\n\t\tprotwo.setProdname(\"lg\");\r\n\t\tprotwo.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct prothree=new Product();\r\n\t\tprothree.setProdid(10011);\r\n\t\tprothree.setProdname(\"lg\");\r\n\t\tprothree.setProdprice(1181.11);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n /* Map<Integer,String> myMap=new HashMap<>();\r\n myMap.put(1, \"abcd\");\r\n myMap.put(2,\"life\");\r\n myMap.put(3,\"veena\");\r\n */\r\n\t\t Map<Integer,Product> myMap=new HashMap<>();\r\n\t myMap.put(1, protwo);\r\n\t myMap.put(3,prothree);\r\n System.out.println(myMap);\r\n System.out.println(myMap.keySet());//give all keys\r\n System.out.println(myMap.get(2));\r\n System.out.println(myMap.values());//all values\r\n System.out.println(\"____________________for loop_=====================\");\r\n \r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(\"Keys are:\"+keys+\"Values \"+myMap.get(keys));\r\n }\r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(myMap.get(keys).getProdid());\r\n \t System.out.println(myMap.get(keys).getProdname());\r\n \t System.out.println(myMap.get(keys).getProdprice());\r\n \t \r\n }\r\n System.out.println(\"____________________Iterator=====================\");\r\n \r\n // Iterator it=myMap.iterator(); error becoz map is not part of collection but list nd set are part of collection\r\n //convert to set wid help of keyset...keyset will only convert keys entryset will convert evrythng\r\n \r\n Set myData=myMap.entrySet();\r\n Iterator it=myData.iterator();\r\n \r\n while(it.hasNext())\r\n {\r\n \t System.out.println(it.next());\r\n }\r\n \r\n System.out.println(\"============================\");\r\n //Collections.sort(myMap);\r\n \r\n // Set<Product> trgtset=new HashSet<>(myMap.values());\r\n Collection<Product> mySet=myMap.values(); \r\n //Set<Product> sett=new TreeSet<>(mySet);\r\n List<Product> myList=new LinkedList<>(mySet);\r\n Collections.sort(myList);\r\n \r\n /* for(Product prod:myList)\r\n {\r\n \t System.out.println(prod.getProdid());\r\n \t System.out.println(prod.getProdname());\r\n \t System.out.println(prod.getProdprice());\r\n }\r\n\r\n */\r\n Iterator it1=myData.iterator();\r\n \r\n while(it1.hasNext())\r\n {\r\n \t System.out.println(it1.next());\r\n }\r\n Map mp=new HashMap<>();\r\n mp.put(null,null);\r\n mp.put(1, null);\r\n mp.put(2, null);\r\n mp.put(null,null);\r\n System.out.println(mp);\r\n //is same above snippet written with map mp=new HashTable<>() it will giv nullpointer exception\r\n \r\n\t}",
"private void mapPrecincts() {\r\n\t\tMap<Integer, Precinct> allPrecincts = new HashMap<Integer, Precinct>();\r\n\t\tMap<Integer, Precinct> currPrecincts;\r\n\t\tfor (CongressionalDistrict district : districts.values()) {\r\n\t\t\tcurrPrecincts = district.getPrecincts(); // lazy loaded\r\n\t\t\tif (currPrecincts == null) {\r\n\t\t\t\tthrow new IllegalStateException();\r\n\t\t\t}\r\n\t\t\tallPrecincts.putAll(currPrecincts);\r\n\t\t\tfor (Precinct precinct : currPrecincts.values()) {\r\n\t\t\t\tprecinct.setConDistrict(district); // make sure the object is the same\r\n\t\t\t}\r\n\t\t}\r\n\t\tmapNeighborPrecincts(allPrecincts);\r\n\t\tstate.setPrecincts(allPrecincts); //allow for retrieving maps and data later\r\n\t}",
"HashMap <String, Command> getMap();",
"private static Map<String, Integer> getSourceMap() {\n\t\tList<Source> sources = SourceService.findAll();\n\t\tMap<String, Integer> sourceMap = new HashMap<String, Integer>();\n\t\t\n\t\tfor (Source source : sources) {\n\t\t\tsourceMap.put(source.getDomain(), source.getId());\n\t\t}\n\t\t\n\t\treturn sourceMap;\n\t}",
"private Map<String, String> solutionForCNSHIsFull() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[1].getName());\r\n map.put(this.students[1].getName(), this.schools[1].getName());\r\n map.put(this.students[2].getName(), this.schools[1].getName());\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"private Map<Integer, Integer> buildRenaming() {\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\n\t\tfor(int i = 0; i < this.dimension; i++){\n\t\t\tfor(int j = 0; j < this.dimension; j++)\n\t\t\t\tmap.put(board_p[i][j].var(), board[i][j].var());\n\t\t}\n\n\t\treturn map;\n\t}",
"public Object map(String key, Object input);",
"@Test\n public void test3() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n assertEquals(map1, cashRegister.getContents());\n }",
"protected SortedMap getSortedMap() {\n/* 65 */ return (SortedMap)this.map;\n/* */ }",
"@Test\n public void mapContains() {\n check(MAPCONT);\n query(MAPCONT.args(MAPNEW.args(), 1), false);\n query(MAPCONT.args(MAPENTRY.args(1, 2), 1), true);\n }"
] | [
"0.5949002",
"0.5820586",
"0.5645101",
"0.5637478",
"0.5539182",
"0.5455818",
"0.54280734",
"0.54169387",
"0.539714",
"0.5390419",
"0.5362793",
"0.5311873",
"0.53032565",
"0.5301217",
"0.52845186",
"0.5264148",
"0.5263294",
"0.52549326",
"0.5247456",
"0.5224857",
"0.5217127",
"0.5216162",
"0.5202731",
"0.51776195",
"0.5166023",
"0.5164531",
"0.51570016",
"0.5154836",
"0.5142552",
"0.5139961",
"0.5137125",
"0.5130147",
"0.51078594",
"0.51060045",
"0.5104529",
"0.5096302",
"0.5093292",
"0.50898325",
"0.5087522",
"0.5085821",
"0.5085005",
"0.507752",
"0.5077351",
"0.50744176",
"0.50741327",
"0.50697917",
"0.50554156",
"0.5048491",
"0.50451607",
"0.50388044",
"0.5038223",
"0.50374126",
"0.5032155",
"0.50318575",
"0.50300145",
"0.50286883",
"0.502861",
"0.5011374",
"0.500935",
"0.50052893",
"0.50042534",
"0.50041556",
"0.50012857",
"0.4990259",
"0.49884874",
"0.49715108",
"0.4971371",
"0.4956665",
"0.49517652",
"0.4951096",
"0.4948914",
"0.49456954",
"0.49453422",
"0.49442357",
"0.4936949",
"0.49363762",
"0.4926932",
"0.49182263",
"0.4915636",
"0.49054015",
"0.48984",
"0.48968723",
"0.4893947",
"0.48906988",
"0.48861048",
"0.48860058",
"0.48855287",
"0.48848066",
"0.48824066",
"0.4880053",
"0.48766714",
"0.4873673",
"0.48691383",
"0.4864855",
"0.4862611",
"0.4861792",
"0.48570535",
"0.4853276",
"0.48482046",
"0.48469225",
"0.48428202"
] | 0.0 | -1 |
TODO: Maybe solve this via Map | public WorkingNeuron getOutputNeuronFromName(String name) {
for (WorkingNeuron neuron : outputLayer) {
if (name.equals(neuron.getName())) {
return neuron;
}
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String[] map() throws TooFewNocNodesException;",
"String map( String principal );",
"private void getMapping() {\n double [][] chars = new double[CHAR_SET_SIZE][1];\n for (int i = 0; i < chars.length; i++) {\n chars[i][0] = i;\n }\n Matrix b = new Matrix(key).times(new Matrix(chars));\n map = b.getArray();\n }",
"Map getAll();",
"Map<Element, Map<Element, Element>> getOperationMap();",
"private void processTilesetMap() {\r\n for (int t = 0; t < this.getTileSetCount(); t++) {\r\n TileSet tileSet = this.getTileSet(t);\r\n this.tilesetNameToIDMap.put(tileSet.name, t);\r\n }\r\n }",
"ProcessOperation<Map<String, Object>> map();",
"MapType map(List<ReferenceOrderedDatum> rodData, char ref, LocusContext context);",
"private void mapValues() {\n\t\tmap.put(1, \"I\");\r\n\t\tmap.put(5, \"V\");\r\n\t\tmap.put(10, \"X\");\r\n\t\tmap.put(50, \"L\");\r\n\t\tmap.put(100, \"C\");\r\n\t\tmap.put(500, \"D\");\r\n\t\tmap.put(1000, \"M\");\r\n\t}",
"private Map<String,List<Invertedindex>> collecting() //\r\n {\r\n Map<String,List<Invertedindex>> maps = new TreeMap<>();\r\n for (Core pon:pondred){\r\n for(Map.Entry<String,Double> term:pon.allTerms.entrySet()){\r\n if (maps.containsKey(term.getKey())){\r\n List<Invertedindex> index = maps.get(term.getKey());\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }else {\r\n List<Invertedindex> index = new ArrayList<>();\r\n index.add(new Invertedindex(pon.m_cle,term.getValue(),pon.getBalise(term.getKey())));\r\n maps.put(term.getKey(), index);\r\n }\r\n if(cleFreq.containsKey(pon.m_cle))\r\n cleFreq.put(pon.m_cle,cleFreq.get(pon.m_cle)+term.getValue());\r\n else cleFreq.put(pon.m_cle,term.getValue());\r\n\r\n }\r\n }\r\n return maps;\r\n }",
"Map<String, String> mo14888a();",
"public abstract java.util.Map<java.lang.Double, java.util.List<java.lang.Integer>> pnlListMap();",
"abstract Map<String, Integer> mapOfNamesToSalary();",
"private static Map<String, String> createMapFromList(final List<String> all) {\n\t\tfinal Map<String, String> map = new ConcurrentHashMap<>();\n\n\t\tfor (final String documentElement : all) {\n\t\t\tif (documentElement != null) {\n\t\t\t\tmap.put(documentElement, documentElement);\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}",
"private static Map<String,List<Integer>> getProvisionIdMapStream(Map<String,List<Integer>> nameMapIdMap,Map<String,Integer> mapIdProbIdMap){\n return null;\n }",
"protected Map method_1552() {\n return super.method_1552();\n }",
"protected abstract Map<String, Object> _getMulti(Set<String> keys);",
"@Test\r\n\tvoid mapLMethod() {\r\n\t\tMap<String, List<TransactionBean>> postsPerType = transactions.stream()\r\n .collect(Collectors.groupingBy(TransactionBean::getValue));\r\n\t\tSystem.out.println(ToStringBuilder.reflectionToString(postsPerType, new MultilineRecursiveToStringStyle()));\r\n\r\n\t}",
"static void func2() {\n \t\n \tvar list = List.of(\"a\");\n \t\n \tvar set = Set.of(12L, 24L, 48L);\n \t\n \tvar map = Map.of(\"a\", 1, \"b\", 2);\n \t\n \tSystem.out.println(list);\n \tSystem.out.println(set);\n \tSystem.out.println(map);\n }",
"public void testEntrySetIteratorHasProperMappings() {\n return;\r\n }",
"protected abstract Map<String, Serializable> getEventKeyAndIdMap();",
"private <T extends Reference> void buildMap(Map<String, T> map, List<T> objects) {\n for (T candidateObject : objects) {\n String rid = candidateObject.getId();\n log.debug(\"...... caching RID: {}\", rid);\n map.put(rid, candidateObject);\n }\n }",
"abstract protected Map<String, T> lookup(List<String> values);",
"java.util.Map<java.lang.Integer, java.lang.Integer>\n getInfoMap();",
"private static List<Department> compute(Collection<Employee> employees) {\n Map<String, Employee> employeeMap = employees.stream().collect(Collectors.toMap(e -> e.getDeptName(), Function.identity(), (old, newOne) -> newOne));\n\n\n// Map<string, dept>\n// getEmp\n// get account\n// check slap\n// construct department\n// put department in List\n\n\nreturn null;\n\n }",
"private Set<String> getNames(Map<String, String> map) {\r\n\t\tSet<String> set = new HashSet<>();\r\n\t\t\r\n\t\tmap.forEach((k,v) -> set.add(k));\r\n\t\t\r\n\t\treturn Collections.unmodifiableSet(set);\r\n\t}",
"public static void main(String[] args) {\n\t\t\n\t\tMap<Integer,Employee> map = new HashMap<Integer, Employee>();\n\t\tMap<String, Employee> hashMap = new HashMap();\n\t\tMap<Employee, Integer> hashMap1 = new HashMap();\n\t\tfor (int i =1; i<=10; i++){\n\t\t\t\n\t\t\tmap.put(i, new Employee(i+3, \"Manish\"+(i+3)));\n\t\t}\n\t\tSystem.out.println(map);\n\t\t\n\t\tEmployee emp1 = new Employee(4, \"Manish3\");\n\t\t//Use of Contains\n\t\tSystem.out.println(map.containsValue(emp1)); \n\t\t\n\t\t//Key Set\n\t\tSystem.out.println(map.keySet());\n\t\t\n\t\t//retrieve entry set\n\t\tSystem.out.println(map.entrySet());\n\t\t\n\t\t//map.forEach(action);; TO DO- need to understand this method\n\t\t\n\n\t\t//Returns in sorted order when Key is natural (permitives or String or Enum)\n\t\thashMap.put(\"A\", new Employee(1, \"Manish\"));\n\t\thashMap.put(\"C\", new Employee(3, \"Gaurav\"));\n\t\thashMap.put(\"B\", new Employee(2, \"Vinay\"));\n\t\tSystem.out.println(hashMap);\n\t\t\n\t\t//maintains insertion order when key is Object type(dont have any natural order)\n\t\thashMap1.put(new Employee(1, \"Manish\"),1);\n\t\thashMap1.put(new Employee(3, \"Gaurav\"),3);\n\t\thashMap1.put(new Employee(2, \"Vinay\"),2);\n\t\tSystem.out.println(hashMap1);\n\t\tHashMap<Long, String> masterRoomPoolMapping = new HashMap<Long, String>();\n\t\tmasterRoomPoolMapping.put(new Long(123), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(124), \"Manish\");\n\t\tmasterRoomPoolMapping.put(new Long(125), \"Manish\");\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSet<Long> keySet = masterRoomPoolMapping.keySet();\n\t\tSet<Long> newKeySet = new HashSet<Long>();\n\t\tfor(Long key : keySet){\n\t\t\tnewKeySet.add(new Long(key));\n\t\t}\n\t\tSystem.out.println(\"newKeySet***************************************************\");\n\t\tif(newKeySet.contains(new Long(123)))\n\t\t\tnewKeySet.remove(new Long(123));\n\t\tfor(Long key : newKeySet){\n\t\t\tSystem.out.println(key);\n\t\t}\n\t\tSystem.out.println(\"keySet1***************************************************\");\n\t\tSet<Long> keySet1 = masterRoomPoolMapping.keySet();\n\t\tfor(Long key : keySet1){\n\t\t\tSystem.out.println(masterRoomPoolMapping.get(key));\n\t\t}\n\t\tSystem.out.println(\"***************************************************\");\n\t\tSystem.out.println(masterRoomPoolMapping);\n\t}",
"@Test\n public void test12() {\n cashRegister.addPennies(99);\n cashRegister.addDimes(2);\n cashRegister.addDimes(3);\n cashRegister.addFives(10);\n cashRegister.addNickels(4);\n cashRegister.addOnes(1);\n cashRegister.addQuarters(1);\n cashRegister.addTens(5);\n Map<Integer, Integer> map = new TreeMap<Integer, Integer>();\n map.put(1000,5);\n map.put(500,10);\n map.put(100,1);\n map.put(25,1);\n map.put(10,5);\n map.put(5,4);\n map.put(1,99);\n\n assertEquals(map,cashRegister.getContents());\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n map1 = cashRegister.getContents();\n map1.put(0,1);\n assertEquals(map,cashRegister.getContents());\n }",
"private static <T extends AbstractApiIdentifiableDTO> Map<Long, List<T>> generateIdMapList(List<T> idList) {\n Map<Long, List<T>> results = new HashMap<>();\n\n for (T idSingle : idList) {\n Long sourceId = idSingle.getId();\n if (results.containsKey(sourceId)) {\n results.get(sourceId).add(idSingle);\n } else {\n // ID didn't exist so add a new list\n List<T> list = new ArrayList<>(1);\n list.add(idSingle);\n results.put(sourceId, list);\n }\n }\n\n return results;\n }",
"private static Map<Long, Set<XliffAlt>> getXliffAltMap(List<XliffAlt> alts)\n {\n // tuvId : Set<XliffAlt>\n Map<Long, Set<XliffAlt>> xlfAltMap = new HashMap<Long, Set<XliffAlt>>();\n\n for (XliffAlt alt : alts)\n {\n Set<XliffAlt> myAlts = xlfAltMap.get(alt.getTuvId());\n if (myAlts == null)\n {\n myAlts = new HashSet<XliffAlt>();\n myAlts.add(alt);\n xlfAltMap.put(alt.getTuvId(), myAlts);\n }\n else\n {\n myAlts.add(alt);\n xlfAltMap.put(alt.getTuvId(), myAlts);\n }\n }\n\n return xlfAltMap;\n }",
"@Test\n public void test10() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n cashRegister.addPennies(199);\n map1.put(1,199);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(2);\n map1.put(10,2);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addDimes(3);\n map1.put(10,5);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addFives(10);\n map1.put(500,10);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addNickels(4);\n map1.put(5,4);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addOnes(1);\n map1.put(100,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addQuarters(1);\n map1.put(25,1);\n assertEquals(map1, cashRegister.getContents());\n cashRegister.addTens(5);\n map1.put(1000,5);\n assertEquals(map1, cashRegister.getContents());\n }",
"Map getSPEXDataMap();",
"interface MapComp<K extends Comparable<K>, V> {\n\n // Add given key-value to this map\n MapComp<K, V> add(K k, V v);\n\n // Count the number of key-values in this map\n Integer count();\n\n // Look up the value associated with given key in this map (if it exists)\n Optional<V> lookup(K k);\n\n // Produce a set of key-values in this map\n Set<Pairof<K, V>> keyVals();\n\n // Produce a list of key-values in ascending sorted order\n Listof<Pairof<K, V>> sortedKeyVals();\n\n // Produce a set of keys in this map\n Set<K> keys();\n\n // Produce a set of keys in ascending sorted order\n Listof<K> sortedKeys();\n\n // Produce a list of values in this map (order is unspecified)\n Listof<V> vals();\n\n // Produce a list of values in the ascending sorted order\n // of their keys in this map\n // NOTE: list is not itself sorted\n Listof<V> sortedVals();\n\n // Is this map the same as m?\n // (Does it have the same keys mapping to the same values?)\n Boolean same(MapComp<K, V> m);\n\n // Remove any key-value with the given key from this map\n MapComp<K, V> remove(K k);\n\n // Remove all key-values with keys that satisfy given predicate\n MapComp<K, V> removeAll(Predicate<K> p);\n\n // Remove all key-values w/ key-values that satisfy given binary predicate\n MapComp<K, V> removeAllPairs(BiPredicate<K, V> p);\n\n // Join this map and given map (entries in this map take precedence)\n MapComp<K, V> join(MapComp<K, V> m);\n}",
"@SuppressWarnings(\"unused\")\n private static <T extends AbstractApiIdentifiableDTO> Map<Long, T> generateIdMap(List<T> idList) {\n Map<Long, T> results = new HashMap<>(idList.size());\n\n for (T idSingle : idList) {\n results.put(idSingle.getId(), idSingle);\n }\n\n return results;\n }",
"private LinkedHashMap<String, Type> scalarMappingODU() {\r\n\t\tLinkedHashMap<String, Type> scalarMapping = new LinkedHashMap<String, Type>();\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODUID, StandardBasicTypes.LONG); // 0\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITE_GROUP,\r\n\t\t\t\tStandardBasicTypes.STRING); // 1\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_CHILD,\r\n\t\t\t\tStandardBasicTypes.STRING); // 2\r\n\t\tscalarMapping.put(DaoConstants.MAP_NAME, StandardBasicTypes.STRING); // 3\r\n\t\tscalarMapping.put(DaoConstants.MAP_CENTRAL_ADDRESS,\r\n\t\t\t\tStandardBasicTypes.STRING); // 4\r\n\t\tscalarMapping.put(DaoConstants.MAP_PARENT_ID, StandardBasicTypes.LONG); // 5\r\n\t\tscalarMapping.put(DaoConstants.MAP_TYPE, StandardBasicTypes.STRING); // 6\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 7\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMAXLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 8\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLATITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 9\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGMINLONGITUDE,\r\n\t\t\t\tStandardBasicTypes.DOUBLE); // 10\r\n\t\tscalarMapping.put(DaoConstants.MAP_ODU_SVG_PATH,\r\n\t\t\t\tStandardBasicTypes.STRING); // 11\r\n\t\tscalarMapping.put(DaoConstants.MAP_SEVERITY, StandardBasicTypes.STRING); // 12\r\n\t\tscalarMapping.put(DaoConstants.MAP_SLINKADD, StandardBasicTypes.STRING); // 13\r\n\t\tscalarMapping.put(DaoConstants.MAP_ALARM_CODE,\r\n\t\t\t\tStandardBasicTypes.STRING); // 14\r\n\t\tscalarMapping.put(DaoConstants.MAP_C2, StandardBasicTypes.DOUBLE); // 15\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Outdoor\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Temp\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_1, StandardBasicTypes.LONG); // 16\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_1\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_2, StandardBasicTypes.LONG); // 17\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_2\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_3, StandardBasicTypes.LONG); // 18\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs_3\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_4, StandardBasicTypes.LONG); // 19\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// PAC\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// CompressorWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_5, StandardBasicTypes.LONG); // 20\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// EngineWorkingHrs\r\n\t\tscalarMapping\r\n\t\t\t\t.put(DaoConstants.MAP_THRESHOLD_6, StandardBasicTypes.LONG); // 21\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// NOT_IN_USE_EnginOilChange\r\n\t\tscalarMapping.put(DaoConstants.MAP_G44, StandardBasicTypes.STRING); // 22\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// GenerationPower\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGID, StandardBasicTypes.LONG); // 23\r\n\t\tscalarMapping.put(DaoConstants.MAP_SVGNAME, StandardBasicTypes.STRING); // 24\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS1, StandardBasicTypes.DOUBLE); // 25\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS2, StandardBasicTypes.DOUBLE); // 26\r\n\t\tscalarMapping.put(DaoConstants.MAP_VRFHRS3, StandardBasicTypes.DOUBLE); // 27\r\n\t\tscalarMapping.put(DaoConstants.MAP_PACHRS, StandardBasicTypes.DOUBLE); // 28\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPHRS, StandardBasicTypes.DOUBLE); // 29\r\n\t\tscalarMapping.put(DaoConstants.MAP_GHPOIL, StandardBasicTypes.DOUBLE); // 30\r\n\t\tscalarMapping.put(DaoConstants.MAP_SITEPATH, StandardBasicTypes.STRING); // 31\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPANYNAME,\r\n\t\t\t\tStandardBasicTypes.STRING); // 32\r\n\t\tscalarMapping.put(DaoConstants.MAP_CASTATUS, StandardBasicTypes.STRING); // 33\r\n\t\tscalarMapping.put(DaoConstants.MAP_V23, StandardBasicTypes.STRING); // 34\r\n\t\t// Demand\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR1,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 35\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR2,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 36\r\n\t\tscalarMapping.put(DaoConstants.MAP_COMPRESSOR3,\r\n\t\t\t\tStandardBasicTypes.BOOLEAN); // 37\r\n\t\t//add by shanf\r\n\t\tscalarMapping.put(DaoConstants.DEVICE_MODEL,\r\n\t\t\t\tStandardBasicTypes.STRING); // 38\r\n\r\n\t\treturn scalarMapping;\r\n\t}",
"private void processNameToObjectMap() {\r\n for (int i = 0; i < this.getObjectGroupCount(); i++) {\r\n ObjectGroup g = this.objectGroups.get(i);\r\n this.objectGroupNameToOffset.put(g.name, i);\r\n HashMap<String, Integer> nameToObjectMap = new HashMap<String, Integer>();\r\n for (int ib = 0; ib < this.getObjectCount(i); ib++) {\r\n nameToObjectMap.put(this.getObjectName(i, ib), ib);\r\n }\r\n g.setObjectNameMapping(nameToObjectMap);\r\n }\r\n }",
"XClass getMapKey();",
"public Hashtable getRemappedValues() throws Exception;",
"private static void testMap(final OurMap<Integer, String> map) {\n System.out.printf(\"%n%s%n\", map.getClass());\n assert map.size() == 0;\n assert !map.containsKey(117);\n assert !map.containsKey(-2);\n assert map.get(117) == null;\n assert map.put(117, \"A\") == null;\n assert map.containsKey(117);\n assert map.get(117).equals(\"A\");\n assert map.put(17, \"B\") == null;\n assert map.size() == 2;\n assert map.containsKey(17);\n assert map.get(117).equals(\"A\");\n assert map.get(17).equals(\"B\");\n assert map.put(117, \"C\").equals(\"A\");\n assert map.containsKey(117);\n assert map.get(117).equals(\"C\");\n assert map.size() == 2;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n assert map.remove(117).equals(\"C\");\n assert !map.containsKey(117);\n assert map.get(117) == null;\n assert map.size() == 1;\n assert map.putIfAbsent(17, \"D\").equals(\"B\");\n assert map.get(17).equals(\"B\");\n assert map.size() == 1;\n assert map.containsKey(17);\n assert map.putIfAbsent(217, \"E\") == null;\n assert map.get(217).equals(\"E\");\n assert map.size() == 2;\n assert map.containsKey(217);\n assert map.putIfAbsent(34, \"F\") == null;\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v));\n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n map.reallocateBuckets();\n assert map.size() == 3;\n assert map.get(17).equals(\"B\") && map.containsKey(17);\n assert map.get(217).equals(\"E\") && map.containsKey(217);\n assert map.get(34).equals(\"F\") && map.containsKey(34);\n map.forEach((k, v) -> System.out.printf(\"%10d maps to %s%n\", k, v)); \n }",
"Map getIDPEXDataMap();",
"public static void main(String[] args) {\n HashMap<Integer, String> Hm = new HashMap<Integer, String>();\n Hm.put(0, \"USA\");\n Hm.put(1, \"UK\");\n Hm.put(2, \"India\");\n Hm.put(3, \"Maldives\");\n \n Set sn=Hm.entrySet();\n Iterator i= sn.iterator(); \n while(i.hasNext()) {\n Map.Entry mp=(Map.Entry)i.next();\n System.out.println(mp.getKey());\n System.out.println(mp.getValue());\n }\n \n\t}",
"int getClassIdXyPairsMapCount();",
"public HashMap<String, NeonValue> getMap();",
"public static void main(String[] args) throws IllegalAccessException, InvocationTargetException, InstantiationException {\n\r\n Map<String, Shape> shapeMap = new HashMap<>();\r\n\r\n shapeMap.put(\"Triangle\", new SimpleTriangle(3, 5, 5));\r\n shapeMap.put(\"Circle\", new SimpleCircle(5));\r\n\r\n for (Map.Entry<String, Shape> entry : shapeMap.entrySet()) {\r\n System.out.println(\"Key - \" + entry.getKey() + \" Value \" + entry.getValue());\r\n }\r\n\r\n //Write a Java program to count the number of key-value (size) mappings in a map\r\n\r\n int size = shapeMap.size();\r\n System.out.println(size);\r\n\r\n //Write a Java program to copy all of the mappings from the specified map to another map.\r\n\r\n Map<String, Shape> shapeMap1 = new HashMap<>();\r\n shapeMap1.put(\"Square7\", new SimpleSquare(7));\r\n shapeMap1.put(\"Square9\", new SimpleSquare(9));\r\n\r\n shapeMap.putAll(shapeMap1);\r\n\r\n System.out.println(shapeMap);\r\n\r\n //Write a Java program to check whether a map contains key-value mappings (empty) or not.Try to use .clear()\r\n\r\n shapeMap1.clear();\r\n System.out.println(shapeMap1.isEmpty());\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified key.\r\n\r\n boolean what = shapeMap.containsKey(\"Square7\");\r\n System.out.println(what);\r\n\r\n //Write a Java program to test if a map contains a mapping for the specified value.\r\n\r\n boolean whatValue = shapeMap.containsValue(new SimpleSquare(7));\r\n System.out.println(whatValue);\r\n\r\n //Write a Java program to create a set view of the mappings contained in a map.\r\n\r\n\r\n //Tree Set\r\n\r\n Set<Employee> treeSet = new TreeSet<>();\r\n treeSet.add(new Employee(17_000, \"J\"));\r\n treeSet.add(new Employee(20_000, \"K\"));\r\n\r\n System.out.println(treeSet);\r\n\r\n final EmployeeAgeComparator ageComparator = new EmployeeAgeComparator();\r\n Set<Employee> treeSetByAge = new TreeSet<>(ageComparator);\r\n treeSetByAge.add(new Employee(22_000, 35, \"L\"));\r\n treeSetByAge.add(new Employee(78_000, 19, \"J\"));\r\n treeSetByAge.add(new Employee(93_000, 55, \"P\"));\r\n\r\n System.out.println(treeSetByAge);\r\n\r\n final EmployeeSalaryComparator salaryComparator = new EmployeeSalaryComparator();\r\n Set<Employee> treeSetBySalary = new TreeSet<>(salaryComparator);\r\n treeSetBySalary.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetBySalary.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetBySalary.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetBySalary);\r\n\r\n System.out.println(\"==============================================\");\r\n\r\n Set<Employee> treeSetByName = new TreeSet<Employee>((o1, o2) -> o1.getName().compareTo(o2.getName()));\r\n\r\n treeSetByName.add(new Employee(98_120, 59, \"LA\"));\r\n treeSetByName.add(new Employee(92_000, 79, \"AA\"));\r\n treeSetByName.add(new Employee(18_100, 44, \"AC\"));\r\n\r\n System.out.println(treeSetByName);\r\n\r\n Employee newEmployee = null;\r\n final Constructor<?>[] constructorsEmp = Employee.class.getConstructors();\r\n for (Constructor constructor : constructorsEmp) {\r\n System.out.println(constructor.getParameterCount());\r\n if (constructor.getParameterCount() == 2) {\r\n newEmployee = (Employee) constructor.newInstance(66_000, \"From Reflection\");\r\n }\r\n }\r\n if(newEmployee != null){\r\n System.out.println(newEmployee);\r\n }\r\n\r\n }",
"public abstract Set<Map.Entry<K, V>> a();",
"public static void main(String[] args) {\n\tMap <String, Integer>phones=new HashMap<>();\r\n\tphones.put(\"Mila\", 98232433);\r\n\tphones.put(\"Jenia\", 2834732);\r\n\tphones.put(\"Yerlan\", 77398274);\r\n\tphones.put(\"Mila\",1263584);\r\n\t//last one will override the first one\r\n\t\r\n\tIterator <String> iterator=phones.keySet().iterator();\r\n\twhile (iterator.hasNext()){\r\n\t\tString key=iterator.next();\r\n\t\tInteger value=phones.get(key);\r\n\t\tSystem.out.println(key+\" \"+value);\r\n\t}\r\n\t\r\n\t//store keys in Set\r\n\tSet<String> keys=phones.keySet();\r\n\tfor (String key : keys) {\r\n\t\tSystem.out.println(key);\r\n\t}\r\n\t//store values in Collection\r\n Collection <Integer> val=phones.values();\r\n for (Integer values : val) {\r\n \tSystem.out.println(values);\r\n\t\t\r\n\t}\r\n \r\n Set<Entry<String,Integer>> entry=phones.entrySet();\r\n for (Entry<String, Integer> entry2 : entry) {\r\n\t\t//System.out.println(entry2);\r\n\t\tSystem.out.println(entry2.getKey()+\" \"+entry2.getValue());\r\n\t}\r\n}",
"protected abstract Set method_1559();",
"public WeirdList map(IntUnaryFunction func) {\n return null; // REPLACE THIS LINE WITH THE RIGHT ANSWER.\n }",
"private List<EventInfo> map(List<EventLog> entries) {\n List<EventInfo> events = new ArrayList<>();\n for (EventLog entry : entries) {\n events.add(map(entry));\n }\n return events;\n }",
"private void initIDFMap(List<List<Map<String,List<Double>>>> tfMap){\n\t\tfor (int i = 0; i < tfMap.size(); i++) {\n\t\t\tList<Map<String,List<Double>>> gestureDocument = tfMap.get(i);\n\t\t\tfor (int j = 0; j < gestureDocument.size(); j++) {\n\t\t\t\tMap<String,List<Double>> tempMap = gestureDocument.get(j);\n\t\t\t\tIterator<Entry<String, List<Double>>> it = tempMap.entrySet().iterator();\n\t\t\t\t while (it.hasNext()) {\n\t\t\t\t Map.Entry<String,Integer> pairs = (Map.Entry)it.next(); \n\t\t\t\t if(getTfIDFMapGlobal().containsKey(pairs.getKey()))\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), getTfIDFMapGlobal().get(pairs.getKey())+1);\n\t\t\t\t else\n\t\t\t\t \tgetTfIDFMapGlobal().put(pairs.getKey(), 1);\n\t\t\t\t }\n\t\t\t}\n\t\t}\n\t}",
"public interface MapP2P<K, V> {\n\n /** Adds key and value in associative array */\n boolean put(K key, V value);\n\n /** Gets from associative array particular value which associated with received key */\n V get(K key);\n\n /** Removes from associative array particular value which associated with received key */\n V remove(K key);\n\n /** Adds in current map other collection which implements interface MapP2P */\n boolean addAll(MapP2P<K, V> mapP2P);\n\n /** Returns information informing whether the given key is in the collection */\n boolean containsKey(K key);\n\n /** Returns information informing whether the given value is in the collection */\n boolean containsValue(Object value);\n\n /** Returns amount element which stored in the associative array */\n int size();\n\n /** Removes all elements (key-value) from collection */\n void clear();\n\n /** Returns set of nodes which contains key-value */\n Set<Node<K, V>> entrySet();\n\n /** Returns information about whether there are elements on the current associative array */\n boolean isEmpty();\n\n /** Interface for Node that contains key and value */\n interface Node<K, V> {\n /** Returns the key of current node */\n K getKey();\n /** Returns the value of current node */\n V getValue();\n }\n\n /** Performs the given action for each node in this map */\n default void forEach(BiConsumer<? super K, ? super V> action) {\n Objects.requireNonNull(action);\n for (Node<K, V> node : entrySet()) {\n action.accept(node.getKey(), node.getValue());\n }\n }\n\n}",
"private void processLayerMap() {\r\n for (int l = 0; l < layers.size(); l++) {\r\n Layer layer = layers.get(l);\r\n this.layerNameToIDMap.put(layer.name, l);\r\n }\r\n }",
"private static HashSet<String> addElement(Map m, String key,int count) {\n\t\tIterator it = m.entrySet().iterator();\n\t\tHashSet<String> allParents=new HashSet<String>();\n\t\tHashSet<String> newNodeHS=new HashSet<String>();\n\t\tHashSet<String> receive=new HashSet<String>();\n\t\tString parent=\"\";\n\t\tif(readNodes.get(key)==null)\n\t\t{\n\t\t\tif(!(key.equals(root)))\n\t\t\t{\n\t\t\tallParents=(HashSet)m.get(key);\n\t\t\tIterator iter = allParents.iterator();\n\t\t\twhile(iter.hasNext())\n\t\t\t{\n\t\t\t\tparent=(String)iter.next();\n\t\t\t\tcount++;\n\t\t\t\treceive=addElement(m,parent,count);\n\t\t\t\tString str=key+\"-\"+parent;\n\t\t\t\tIterator toRecieve = receive.iterator();\n\t\t\t\twhile(toRecieve.hasNext())\n\t\t\t\t{\n\t\t\t\t\tnewNodeHS.add((String)toRecieve.next());\n\t\t\t\t}\n\t\t\t\tnewNodeHS.add(str);\n\t\t\t\tcount--;\n\t\t\t}\n\t\t\t\tif(count==0)\n\t\t\t\t{\n\t\t\t\t\tIterator<HashSet> iternew = totalDAG.iterator();\n\t\t\t\t\tHashSet<HashSet> inProgressDAG=new HashSet<HashSet>(totalDAG); \n\t\t\t\t\twhile (iternew.hasNext()) {\n\t\t\t\t\t HashSet<String> tillCreatedDAG=iternew.next();\n\t\t\t\t\t HashSet<String> union=new HashSet<String>(newNodeHS);\n\t\t\t\t\t union.addAll(tillCreatedDAG);\n\t\t\t\t\t inProgressDAG.add(union);\n\t\t\t\t\t}\n\t\t\t\t\ttotalDAG.clear();\n\t\t\t\t\ttotalDAG=inProgressDAG;\n\t\t\t\t\ttotalDAG.add(newNodeHS);\n\t\t\t\t\treadNodes.put(key, newNodeHS);\n\t\t\t\t\tSystem.out.println(\"Size: \" +totalDAG.size()+\" Nodes: \"+(++totalCount));\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t\t\tcount--;\n\t\t\t\treturn newNodeHS;\t\n\t\t\t\t}\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tString str=root;\n\t\t\t\t\tnewNodeHS.add(str);\n\t\t\t\t\tcount--;\n\t\t\t\t\treturn newNodeHS;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (HashSet)readNodes.get(key);\n\t\t}\n\t}",
"public abstract java.util.Map<java.lang.String, java.lang.Integer> systemicEventIncidenceCountMap();",
"public static void main(String[] args) {\n String[] names= {\"Mehmet\", \"Asha\", \"Amina\", \"Omar\", \"Siyar\", \"Danny\"};\n \n Map<Integer, String> nameMap=new LinkedHashMap<>();\n \n int key=1;\n \n for(String name:names) {\n nameMap.put(key, name);\n key++;\n }\n System.out.println(nameMap);\n \n for(Map.Entry<Integer,String>entry:nameMap.entrySet()) {\n \t\tString mapValue=entry.getKey()+\" == \"+entry.getValue();\n \t\tSystem.out.println(mapValue);\n \t\t\n \t\t\n \t}\n \n Iterator<Entry<Integer, String>>it=nameMap.entrySet().iterator();\n\t\twhile(it.hasNext()) {\n\t\t\tMap.Entry entry=it.next();\n\t\t\tString valueFromMap=entry.getKey()+\" : \"+entry.getValue();\n\t\t\tSystem.out.println(valueFromMap);\n\t\t}\n\t\t\n\n }",
"public static void main(String[] args) {\n Map<String, Set<Integer>> ms = new HashMap<>(); \n Set<Integer> s1 = new HashSet<>(Arrays.asList(1,2,3));\n Set<Integer> s2 = new HashSet<>(Arrays.asList(4,5,6));\n Set<Integer> s3 = new HashSet<>(Arrays.asList(7,8,9));\n ms.put(\"one\", s1);\n ms.put(\"two\", s2);\n ms.put(\"three\", s3);\n System.out.println(ms); \n // ch07.collections.Ch0706InterfacesVsConcrete$1\n // {one=[1, 2, 3], two=[4, 5, 6], three=[7, 8, 9]}\n\n // this is how LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>>\n // can be initially initialized\n LinkedHashMap<Integer,Tuple2<String,LinkedHashMap<Double,String>>> toc =\n new LinkedHashMap<>();\n System.out.println(toc); // just using toc to get rid of eclipse warning about not using it\n \n \n\n\n\n }",
"@Test\n public void test1(){\n Map map = us.selectAll(1, 1);\n System.out.println(map);\n }",
"private static void paixu(ArrayList<Integer> p1, Map<Integer, String> map) {\n\t\tCollections.sort(p1);\n\t\tfor (Integer integer : p1) {\n\t\t\tint key = integer;\n\t\t\tString card = map.get(key);\n\t\t\tSystem.out.print(card + \" \");\n\t\t\t\n\t\t}\n\t\tSystem.out.println();\n\t\t//map.\n\t}",
"MAP createMAP();",
"private Set<String> getInfo(Map<String, Set<String>> info, String label) {\n\t\treturn (info.containsKey(label)) ? info.get(label)\n\t\t\t\t: new HashSet<String>();\n\t}",
"@Test\n public void test2 ()\n {\n MyMap m = new MyMap();\n m.put(\"a\", \"1\");\n m.put(\"b\", \"2\");\n m.put(\"a\", \"3\");\n assertEquals(2, m.size());\n assertEquals(\"3\", m.get(\"a\"));\n assertEquals(\"2\", m.get(\"b\"));\n assertNull(m.get(\"c\"));\n }",
"@SuppressWarnings(\"unchecked\")\n private static <T> Map<String, T> mapOf(Object... inputs) {\n Map<String, T> map = new HashMap<>();\n for (int i = 0; i < inputs.length; i += 2) {\n String key = (String) inputs[i];\n T value = (T) inputs[i + 1];\n map.put(key, value);\n }\n return map;\n }",
"private static Map<VOTableVersion,VersionDetail>\n createMap( VersionDetail[] vds ) {\n Map<VOTableVersion,VersionDetail> map =\n new LinkedHashMap<VOTableVersion,VersionDetail>();\n for ( int i = 0; i < vds.length; i++ ) {\n map.put( vds[ i ].version_, vds[ i ] );\n }\n return map;\n }",
"static Set get_mapping(HashMap callee_to_caller, Node callee_n) {\n Set s = (Set)callee_to_caller.get(callee_n);\n if (s != null) return s;\n s = NodeSet.FACTORY.makeSet(); s.add(callee_n);\n return s;\n }",
"Map<Double, Element> getElements();",
"public static void main(String args[]) \r\n {\n List<Integer> number = Arrays.asList(2,3,4,5); \r\n \r\n // demonstration of map method \r\n List<Integer> square = number.stream().map(x -> x*x). \r\n collect(Collectors.toList()); \r\n System.out.println(\"Square od number using map()\"+square); \r\n \r\n // create a list of String \r\n List<String> names = \r\n Arrays.asList(\"Reflection\",\"Collection\",\"Stream\"); \r\n \r\n // demonstration of filter method \r\n List<String> result = names.stream().filter(s->s.startsWith(\"S\")). \r\n collect(Collectors.toList()); \r\n System.out.println(result); \r\n \r\n // demonstration of sorted method \r\n List<String> show = \r\n names.stream().sorted().collect(Collectors.toList()); \r\n System.out.println(show); \r\n \r\n // create a list of integers \r\n List<Integer> numbers = Arrays.asList(2,3,4,5,2); \r\n \r\n // collect method returns a set \r\n Set<Integer> squareSet = \r\n numbers.stream().map(x->x*x).collect(Collectors.toSet()); \r\n System.out.println(squareSet); \r\n \r\n // demonstration of forEach method \r\n number.stream().map(x->x*x).forEach(y->System.out.println(y)); \r\n \r\n // demonstration of reduce method \r\n int even = \r\n number.stream().filter(x->x%2==0).reduce(0,(ans,i)-> ans+i); \r\n \r\n System.out.println(even); \r\n \r\n // Create a String with no repeated keys \r\n Stream<String[]> \r\n str = Stream \r\n .of(new String[][] { { \"GFG\", \"GeeksForGeeks\" }, \r\n { \"g\", \"geeks\" }, \r\n { \"G\", \"Geeks\" } }); \r\n\r\n // Convert the String to Map \r\n // using toMap() method \r\n Map<String, String> \r\n map = str.collect( \r\n Collectors.toMap(p -> p[0], p -> p[1])); \r\n\r\n // Print the returned Map \r\n System.out.println(\"Map:\" + map); \r\n }",
"@Test\n public void test4 ()\n {\n MyMap m = new MyMap();\n int SIZE = 10000;\n \n // Add SIZE mappings\n for (int i = 0; i < SIZE; i++)\n {\n m.put(i+\"\", (i*17)+\"\");\n }\n \n // Add some of the keys again with new values.\n for (int i = 0; i < SIZE; i+=2)\n {\n m.put(i+\"\", (i*18)+\"\");\n }\n \n // Remove every third element.\n for (int i = 0; i < SIZE; i += 3)\n {\n m.remove(i+\"\");\n }\n \n // Remove some of them again. This should make no difference.\n for (int i = 0; i < SIZE; i += 6)\n {\n m.remove(i+\"\");\n }\n \n // Assert that the size is as expected\n assertEquals(SIZE - (int) Math.ceil(SIZE / 3.0), m.size());\n \n // Assert that membership is as expected\n for (int i = 0; i < SIZE; i++)\n {\n if (i%3 == 0)\n {\n assertNull(m.get(i+\"\"));\n }\n else if (i%2 == 0)\n {\n assertEquals((i*18)+\"\", m.get(i+\"\"));\n }\n else\n {\n \tassertEquals((i*17)+\"\", m.get(i+\"\"));\n }\n }\n }",
"void mo53966a(HashMap<String, ArrayList<C8514d>> hashMap);",
"@Override\r\n public ParaMap index(ParaMap inMap) throws Exception {\n return null;\r\n }",
"private void storeValues(int source,\n Map<VWBetw, Double> map,\n DiskBufferDriver output) throws DriverException {\n for (Entry<VWBetw, Double> e : map.entrySet()) {\n storeValue(source, e.getKey().getID(), e.getValue(), output);\n }\n }",
"private Map<String,MyTargetsBean> getALOrderVal(ArrayList<MyTargetsBean> alMyTargets){\n Map<String,MyTargetsBean> mapMyTargetBean=new HashMap<>();\n if(alMyTargets!=null && alMyTargets.size()>0){\n\n for(MyTargetsBean bean:alMyTargets)\n if(mapOrderValAch.containsKey(bean.getOrderMaterialGroupID())) {\n double mDoubMonthAchived = Double.parseDouble(bean.getMTDA()) + mapOrderValAch.get(bean.getOrderMaterialGroupID());\n mapOrderValAch.put(bean.getOrderMaterialGroupID(), mDoubMonthAchived);\n mapMyTargetBean.put(bean.getOrderMaterialGroupID(),bean);\n }else {\n double mDoubMonthAchived = Double.parseDouble(bean.getMTDA()) ;\n mapOrderValAch.put(bean.getOrderMaterialGroupID(), mDoubMonthAchived);\n mapMyTargetBean.put(bean.getOrderMaterialGroupID(),bean);\n }\n }\n\n\n return mapMyTargetBean;\n }",
"private Map<CollectionCacheableTestId, CollectionCacheableTestValue> findByIdsInternal(Collection<CollectionCacheableTestId> ids) {\n Map<CollectionCacheableTestId, CollectionCacheableTestValue> result = new HashMap<>();\n for (CollectionCacheableTestId id : ids) {\n CollectionCacheableTestValue value = myDbRepository.findById(id);\n // do not explicitly put null values into map\n if (value != null) {\n result.put(id, value);\n }\n }\n return result;\n }",
"private static void fillListFromMap(List<Integer> bucketContents, Map<Double, List<Integer>> m) {\r\n\t\tIterator<Double> iter = m.keySet().iterator();\r\n\t\twhile (iter.hasNext()) {\r\n\t\t\tDouble key = iter.next();\r\n\t\t\tbucketContents.addAll(m.get(key));\r\n\t\t}\r\n\t}",
"public abstract Map<K, V> a();",
"private static Map<String, String> getArgMap(String[] args) {\n \t\r\n Map<String,String> argMap = new HashMap<String,String>();\r\n for (int i = 0; i < args.length; i++) {\r\n \tlogger.info(\"arg[\"+i+\"]=\"+args[i]);\r\n String[] argArray = args[i].split(\"=\"); //$NON-NLS-1$\r\n\r\n if (argArray.length == 2) {\r\n argMap.put(argArray[0], argArray[1]);\r\n }\r\n }\r\n return argMap;\r\n }",
"private static void fillupmap(Map<String, Object> m) {\n\t\tRectangle r =new Rectangle(\"A\",2,3);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tr =new Rectangle(\"B\",4,1);\r\n\t\tm.put(r.getRname(), r);\r\n\t\tCircle c =new Circle(\"C\",3);\r\n\t\tm.put(c.getCname(),c);\r\n\t\tc =new Circle(\"D\",4);\r\n\t\tm.put(c.getCname(),c);\r\n\t\t\r\n\t}",
"String getMapCode();",
"public static void main(String[] args) {\n Person.insertToPeopleMap(new Person(39105153322l,\"Romas\",\"Garkas\"));\n Person.insertToPeopleMap(new Person(38512013245l,\"Arnas\",\"Lionginas\"));\n Person.insertToPeopleMap(new Person(48603142299l,\"Maryte\",\"Melninkaite\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Dalia\",\"Morka\"));\n Person.insertToPeopleMap(new Person(49009103377l,\"Milda\",\"Morkiene\"));\n\n\n for (Map.Entry<Long, List<Person>> personEntry : Person.getPeople().entrySet()){\n for (Person person : personEntry.getValue()){\n System.out.println(\"A.K.: \" + person.getCitizenCode() + \" Vardas: \" + person.getName() + \" Pavarde: \" + person.getSurname());\n }\n }\n }",
"private static Map<String, Field> schemaToMap(Set<Field> schema){\r\n\t\tMap<String, Field> map = new LinkedHashMap<String, Field>(schema.size());\r\n\t\t\r\n\t\tfor(Field f: schema)\r\n\t\t\tmap.put(f.name, f);\r\n\t\t\r\n\t\treturn map;\r\n\t}",
"@Override\n\tpublic void getStat(Map<String, String> map) {\n\t\t\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, Integer> priceMap = new HashMap<>(); \n\t\tpriceMap.put(\"TV\", 500); priceMap.put(\"Phone\", 200); \n\t\tpriceMap.put(\"Car\", 20000); priceMap.put(\"Bike\", 6000); \n\t\tpriceMap.put(\"Furniture\", 700); \n\t\n\t\tSystem.out.println(\"price map: \" + priceMap); \n\t\t\n\t\tSet<String> keys = priceMap.keySet(); \n\t\tCollection<Integer> values = priceMap.values();\n\t\t\n\t\tSet<Entry<String, Integer>> entries = priceMap.entrySet(); \n\t\tSystem.out.println(\"keys of Map : \" + keys); \n\t\tSystem.out.println(\"values from Map :\" + values); \n\t\tSystem.out.println(\"entries from Map :\" + entries);\n\n\t\t//Output: price map: {Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500} keys of Map : [Car, Phone, Bike, Furniture, TV] values from Map :[20000, 200, 6000, 700, 500] entries from Map :[Car=20000, Phone=200, Bike=6000, Furniture=700, TV=500]\n\n\t\t\t\t\n\t}",
"private final java.lang.String B(java.util.Map<java.lang.String, ? extends java.lang.Object> r11) {\n /*\n r10 = this;\n r11 = r11.entrySet();\n r11 = (java.lang.Iterable) r11;\n r0 = new java.util.ArrayList;\n r0.<init>();\n r0 = (java.util.Collection) r0;\n r11 = r11.iterator();\n L_0x0011:\n r1 = r11.hasNext();\n if (r1 == 0) goto L_0x004e;\n L_0x0017:\n r1 = r11.next();\n r2 = r1;\n r2 = (java.util.Map.Entry) r2;\n r3 = r2.getKey();\n r3 = (java.lang.CharSequence) r3;\n r3 = r3.length();\n r4 = 1;\n r5 = 0;\n if (r3 <= 0) goto L_0x002e;\n L_0x002c:\n r3 = 1;\n goto L_0x002f;\n L_0x002e:\n r3 = 0;\n L_0x002f:\n if (r3 == 0) goto L_0x0047;\n L_0x0031:\n r2 = r2.getValue();\n r2 = r2.toString();\n r2 = (java.lang.CharSequence) r2;\n r2 = r2.length();\n if (r2 <= 0) goto L_0x0043;\n L_0x0041:\n r2 = 1;\n goto L_0x0044;\n L_0x0043:\n r2 = 0;\n L_0x0044:\n if (r2 == 0) goto L_0x0047;\n L_0x0046:\n goto L_0x0048;\n L_0x0047:\n r4 = 0;\n L_0x0048:\n if (r4 == 0) goto L_0x0011;\n L_0x004a:\n r0.add(r1);\n goto L_0x0011;\n L_0x004e:\n r0 = (java.util.List) r0;\n r1 = r0;\n r1 = (java.lang.Iterable) r1;\n r11 = \"&\";\n r2 = r11;\n r2 = (java.lang.CharSequence) r2;\n r3 = 0;\n r4 = 0;\n r5 = 0;\n r6 = 0;\n r11 = com.iqoption.core.connect.http.Http$urlEncode$2.baR;\n r7 = r11;\n r7 = (kotlin.jvm.a.b) r7;\n r8 = 30;\n r9 = 0;\n r11 = kotlin.collections.u.a(r1, r2, r3, r4, r5, r6, r7, r8, r9);\n r11 = r10.ft(r11);\n return r11;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.iqoption.core.connect.http.c.B(java.util.Map):java.lang.String\");\n }",
"public abstract void map(String key, String value) throws Exception;",
"private static Map<String, FeatureType> buildAvailableFeatureMap(List<FeatureType> features){\r\n\t\tMap<String, FeatureType> featureMap = new HashMap<String, FeatureType>();\r\n\t\tfor(FeatureType feature : features){\r\n\t\t\tfeatureMap.put(feature.getExternalId(), feature);\r\n\t\t}\r\n\t\treturn featureMap;\r\n\t}",
"public static void main(String[] args) {\n\t\tMap<String, List<String>> map = new HashMap<>();\n\t\tList<String> list = new ArrayList<>();\n\t\tmap.put(\"key1\", list);\n\t\tmap.get(\"key1\").add(\"value1\");\n\t\tmap.get(\"key1\").add(\"value2\");\n\t\t\n\n\t\t//(map.get(\"key1\").get(0)).isEqualTo(\"value1\");\n\t\t//(map.get(\"key1\").get(1)).isEqualTo(\"value2\");\n\t\t\n\t\tMap<String, String> map1 = Stream.of(new String[][] {\n\t\t\t { \"Hello\", \"World\" }, \n\t\t\t { \"John\", \"Doe\" }, \n\t\t\t}).collect(Collectors.toMap(data -> data[0], data -> data[1])); \n\t\t//Notice here the data type of key and value of the Map is same.\n\t\t//In order to make it more generic letís take the array of Objects and perform the same operation:\n\t\tMap<String, Integer> map2 = Stream.of(new Object[][] { \n\t\t { \"data1\", 1 }, \n\t\t { \"data2\", 2 }, \n\t\t}).collect(Collectors.toMap(data -> (String) data[0], data -> (Integer) data[1]));\n\t\t//Here, we create a map of the key as String and value as an Integer.\n\t}",
"static void func1() {\n \t\n \tList<String> list = List.of(\"a\");\n \t\n \tSet<Long> set = Set.of(12L, 24L, 48L);\n \t\n \tMap<String, Integer> map = Map.of(\"a\", 1, \"b\", 2);\n \t\n \tSystem.out.println(list);\n \tSystem.out.println(set);\n \tSystem.out.println(map);\n }",
"private Map<String, String> solutionForCNSHIsFullCNCHHasOnlyOnePlace() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[2].getName());\r\n map.put(this.students[1].getName(), this.schools[2].getName());\r\n map.put(this.students[2].getName(), this.schools[1].getName());\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"Map <String,Integer> RepresentationBinaire(BasicSet A){\r\n\t\tMap<String,Integer> bit=new TreeMap<String,Integer>();\r\n\t\tVector<String> v=context.getAttributes();\t\t\r\n\t\tBasicSet attributes=new BasicSet();\r\n\t\tattributes.addAll(v);\r\n\r\n\t\tfor(String item: attributes )\r\n\t\t{\r\n\t\t\tbit.put(item,0);\t\t\r\n\t\t}\r\n\t\tfor(String item: attributes)\r\n\t\t{\t\t\r\n\t\t\tfor(String it: A){\t\r\n\t\t\t\tif(it.equals(item)){\r\n\t\t\t\t\tbit.put(item,1);\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn bit;\r\n\t}",
"public void buildMap()\n {\n for(int letterNum=0; letterNum < myText.length()-myNum; letterNum++) {\n String key = myText.substring(letterNum,letterNum+myNum);\n String nextLetter = String.valueOf(myText.charAt(letterNum + myNum));\n if (!map.containsKey(key)) {\n ArrayList<String> lettersArray = new ArrayList<String>();\n lettersArray.add(nextLetter);\n map.put(key,lettersArray);\n }else\n {\n map.get(key).add(nextLetter);\n }\n }\n }",
"@Test\n public void whenHaveListOfUsersThenMakeMapOfUsers() {\n HashMap<Integer, User> expect = new HashMap<>();\n User firstUser = new User(1, \"Vasya\", \"Murmansk\");\n User secondUser = new User(5, \"Vova\", \"Vologda\");\n expect.put(1, firstUser);\n expect.put(5, secondUser);\n List<User> list = new ArrayList<>();\n list.add(firstUser);\n list.add(secondUser);\n UserConvert userConvert = new UserConvert();\n assertThat(userConvert.process(list), is(expect));\n }",
"@Test\n public void testGetValue() throws Exception {\n\n Map<String, IMetaData<SampleMark>> name2MetaData;\n name2MetaData = factory.class2MetaDataByFullPath(Person.class);\n\n assertEquals(3, name2MetaData.size());\n\n for (Person p : persons) {\n\n Person.assertPerson(p,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|lastname\").getValue(p),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|weight\").getValue(p),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Person|age\").getValue(p));\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Driver.class);\n\n assertEquals(4, name2MetaData.size());\n\n for (Driver d : drivers) {\n\n Driver.assertDriver(d,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|lastname\").getValue(d),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|weight\").getValue(d),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|age\").getValue(d),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Driver|hasDrivingLicense\").getValue(d));\n\n }\n\n name2MetaData = factory.class2MetaDataByFullPath(Car.class);\n\n assertEquals(10, name2MetaData.size());\n\n for (Car c : cars) {\n Driver.assertDriver(c.getDriver(),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|lastname\").getValue(c),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\").getValue(c),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|age\").getValue(c),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|hasDrivingLicense\").getValue(c));\n Driver.assertDriver((Driver) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|lastname\").getValue(c),\n (Float) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|weight\").getValue(c),\n (Integer) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|age\").getValue(c),\n (Boolean) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|driver|hasDrivingLicense\").getValue(c));\n Engine.assertEngine(c.getEngine(),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\").getValue(c));\n Engine.assertEngine((Engine) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|productName\").getValue(c));\n\n Oil.assertOil(c.getEngine().oil,\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|vendorName\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|producentName\").getValue(c));\n Oil.assertOil((Oil) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|vendorName\").getValue(c),\n (String) name2MetaData.get(\"pl.softech.reflection.SampleDataGenerator$Car|engine|oil|producentName\").getValue(c));\n }\n\n }",
"public static void main(String[] args) {\n\t\tProduct proone=new Product();\r\n\t\tproone.setProdid(10001);\r\n\t\tproone.setProdname(\"lg\");\r\n\t\tproone.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct protwo=new Product();\r\n\t\tprotwo.setProdid(10008);\r\n\t\tprotwo.setProdname(\"lg\");\r\n\t\tprotwo.setProdprice(1181.11);\r\n\t\t\r\n\t\tProduct prothree=new Product();\r\n\t\tprothree.setProdid(10011);\r\n\t\tprothree.setProdname(\"lg\");\r\n\t\tprothree.setProdprice(1181.11);\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n /* Map<Integer,String> myMap=new HashMap<>();\r\n myMap.put(1, \"abcd\");\r\n myMap.put(2,\"life\");\r\n myMap.put(3,\"veena\");\r\n */\r\n\t\t Map<Integer,Product> myMap=new HashMap<>();\r\n\t myMap.put(1, protwo);\r\n\t myMap.put(3,prothree);\r\n System.out.println(myMap);\r\n System.out.println(myMap.keySet());//give all keys\r\n System.out.println(myMap.get(2));\r\n System.out.println(myMap.values());//all values\r\n System.out.println(\"____________________for loop_=====================\");\r\n \r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(\"Keys are:\"+keys+\"Values \"+myMap.get(keys));\r\n }\r\n for(Integer keys:myMap.keySet())\r\n {\r\n \t System.out.println(myMap.get(keys).getProdid());\r\n \t System.out.println(myMap.get(keys).getProdname());\r\n \t System.out.println(myMap.get(keys).getProdprice());\r\n \t \r\n }\r\n System.out.println(\"____________________Iterator=====================\");\r\n \r\n // Iterator it=myMap.iterator(); error becoz map is not part of collection but list nd set are part of collection\r\n //convert to set wid help of keyset...keyset will only convert keys entryset will convert evrythng\r\n \r\n Set myData=myMap.entrySet();\r\n Iterator it=myData.iterator();\r\n \r\n while(it.hasNext())\r\n {\r\n \t System.out.println(it.next());\r\n }\r\n \r\n System.out.println(\"============================\");\r\n //Collections.sort(myMap);\r\n \r\n // Set<Product> trgtset=new HashSet<>(myMap.values());\r\n Collection<Product> mySet=myMap.values(); \r\n //Set<Product> sett=new TreeSet<>(mySet);\r\n List<Product> myList=new LinkedList<>(mySet);\r\n Collections.sort(myList);\r\n \r\n /* for(Product prod:myList)\r\n {\r\n \t System.out.println(prod.getProdid());\r\n \t System.out.println(prod.getProdname());\r\n \t System.out.println(prod.getProdprice());\r\n }\r\n\r\n */\r\n Iterator it1=myData.iterator();\r\n \r\n while(it1.hasNext())\r\n {\r\n \t System.out.println(it1.next());\r\n }\r\n Map mp=new HashMap<>();\r\n mp.put(null,null);\r\n mp.put(1, null);\r\n mp.put(2, null);\r\n mp.put(null,null);\r\n System.out.println(mp);\r\n //is same above snippet written with map mp=new HashTable<>() it will giv nullpointer exception\r\n \r\n\t}",
"private void mapPrecincts() {\r\n\t\tMap<Integer, Precinct> allPrecincts = new HashMap<Integer, Precinct>();\r\n\t\tMap<Integer, Precinct> currPrecincts;\r\n\t\tfor (CongressionalDistrict district : districts.values()) {\r\n\t\t\tcurrPrecincts = district.getPrecincts(); // lazy loaded\r\n\t\t\tif (currPrecincts == null) {\r\n\t\t\t\tthrow new IllegalStateException();\r\n\t\t\t}\r\n\t\t\tallPrecincts.putAll(currPrecincts);\r\n\t\t\tfor (Precinct precinct : currPrecincts.values()) {\r\n\t\t\t\tprecinct.setConDistrict(district); // make sure the object is the same\r\n\t\t\t}\r\n\t\t}\r\n\t\tmapNeighborPrecincts(allPrecincts);\r\n\t\tstate.setPrecincts(allPrecincts); //allow for retrieving maps and data later\r\n\t}",
"HashMap <String, Command> getMap();",
"private static Map<String, Integer> getSourceMap() {\n\t\tList<Source> sources = SourceService.findAll();\n\t\tMap<String, Integer> sourceMap = new HashMap<String, Integer>();\n\t\t\n\t\tfor (Source source : sources) {\n\t\t\tsourceMap.put(source.getDomain(), source.getId());\n\t\t}\n\t\t\n\t\treturn sourceMap;\n\t}",
"private Map<String, String> solutionForCNSHIsFull() {\r\n Map<String, String> map = new HashMap<>();\r\n map.put(this.students[0].getName(), this.schools[1].getName());\r\n map.put(this.students[1].getName(), this.schools[1].getName());\r\n map.put(this.students[2].getName(), this.schools[1].getName());\r\n map.put(this.students[3].getName(), this.schools[2].getName());\r\n return map;\r\n }",
"private Map<Integer, Integer> buildRenaming() {\n\t\tMap<Integer, Integer> map = new HashMap<>();\n\n\t\tfor(int i = 0; i < this.dimension; i++){\n\t\t\tfor(int j = 0; j < this.dimension; j++)\n\t\t\t\tmap.put(board_p[i][j].var(), board[i][j].var());\n\t\t}\n\n\t\treturn map;\n\t}",
"public Object map(String key, Object input);",
"@Test\n public void test3() {\n Map<Integer, Integer> map1 = new TreeMap<Integer, Integer>();\n assertEquals(map1, cashRegister.getContents());\n }",
"protected SortedMap getSortedMap() {\n/* 65 */ return (SortedMap)this.map;\n/* */ }",
"@Test\n public void mapContains() {\n check(MAPCONT);\n query(MAPCONT.args(MAPNEW.args(), 1), false);\n query(MAPCONT.args(MAPENTRY.args(1, 2), 1), true);\n }"
] | [
"0.5949002",
"0.5820586",
"0.5645101",
"0.5637478",
"0.5539182",
"0.5455818",
"0.54280734",
"0.54169387",
"0.539714",
"0.5390419",
"0.5362793",
"0.5311873",
"0.53032565",
"0.5301217",
"0.52845186",
"0.5264148",
"0.5263294",
"0.52549326",
"0.5247456",
"0.5224857",
"0.5217127",
"0.5216162",
"0.5202731",
"0.51776195",
"0.5166023",
"0.5164531",
"0.51570016",
"0.5154836",
"0.5142552",
"0.5139961",
"0.5137125",
"0.5130147",
"0.51078594",
"0.51060045",
"0.5104529",
"0.5096302",
"0.5093292",
"0.50898325",
"0.5087522",
"0.5085821",
"0.5085005",
"0.507752",
"0.5077351",
"0.50744176",
"0.50741327",
"0.50697917",
"0.50554156",
"0.5048491",
"0.50451607",
"0.50388044",
"0.5038223",
"0.50374126",
"0.5032155",
"0.50318575",
"0.50300145",
"0.50286883",
"0.502861",
"0.5011374",
"0.500935",
"0.50052893",
"0.50042534",
"0.50041556",
"0.50012857",
"0.4990259",
"0.49884874",
"0.49715108",
"0.4971371",
"0.4956665",
"0.49517652",
"0.4951096",
"0.4948914",
"0.49456954",
"0.49453422",
"0.49442357",
"0.4936949",
"0.49363762",
"0.4926932",
"0.49182263",
"0.4915636",
"0.49054015",
"0.48984",
"0.48968723",
"0.4893947",
"0.48906988",
"0.48861048",
"0.48860058",
"0.48855287",
"0.48848066",
"0.48824066",
"0.4880053",
"0.48766714",
"0.4873673",
"0.48691383",
"0.4864855",
"0.4862611",
"0.4861792",
"0.48570535",
"0.4853276",
"0.48482046",
"0.48469225",
"0.48428202"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void run() {
for (int i = 0; i < 1000000; i++) {
int[] a = Util.generateRandomArray(500, 200000);
int[] b = a.clone();
a = sort(a);
Arrays.sort(b);
for (int j = 0; j < b.length; j++) {
Util.Assert(a[j] == b[j], "shit");
}
}
System.out.println("Heap sort ok");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | public static void main(String[] args) {
int total = 0;
System.out.print(" Enter number of Tents ");
Scanner sc = new Scanner(System.in);
int tentSize = sc.nextInt();
int tentNumber = 0;
int[] refugeeCount = new int[tentSize];
for (int i = 0; i < refugeeCount.length; i++) {
tentNumber = tentNumber+1;
System.out.print("Enter the persons statying in tent "+ tentNumber +" is = ");
refugeeCount[i] = sc.nextInt();
total = total + refugeeCount[i];
}
System.out.println("The Ttal number of citizens present in the camp "+total);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
To change body of implemented methods use File | Settings | File Templates. | public void saveOperate(OperateBO operateBo) throws RollbackableException {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"@Override\n public void perish() {\n \n }",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n\tpublic void dosomething() {\n\t\t\n\t}",
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void method() {\n\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void verkaufen() {\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n\tpublic void doYouWantTo() {\n\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\tvoid methodabstract() {\n\t\t\n\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\r\n\t\t\tpublic void buscar() {\n\r\n\t\t\t}",
"@Override\n\tpublic void leti() \n\t{\n\t}",
"@Override\n\tpublic void myMethod() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\npublic int method() {\n\treturn 0;\r\n}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\n\tpublic void dosomething2() {\n\t\t\n\t}",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\r\n\tpublic void Method3() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void Method1() {\n\t\t\r\n\t}",
"@Override\n\tpublic void buscar() {\n\t\t\n\t}",
"public Methods() {\n // what is this doing? -PMC\n }",
"public void myPublicMethod() {\n\t\t\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void Method2() {\n\t\t\r\n\t}",
"@Override\n\tpublic void function() {\n\t\t\n\t}",
"@Override\r\n\tpublic void method1() {\n\t}",
"@Override\n\tpublic void alterar() {\n\t\t\n\t}",
"public void smell() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void method() {\n\t\tSystem.out.println(\"这是第三个实现\");\n\t}",
"@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}",
"@Override\r\n\tpublic void voar() {\n\t\t\r\n\t}",
"public final void mo51373a() {\n }",
"public void mo97908d() {\n }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void laught() {\n\r\n\t}",
"@Override\n\tpublic void name() {\n\t\t\n\t}",
"@Override\n\tpublic void name() {\n\t\t\n\t}",
"public void mo21825b() {\n }",
"@Override\n\tpublic void aaa() {\n\t\t\n\t}",
"@Override\n\tpublic void classroom() {\n\t\t\n\t}",
"@Override\n\tpublic void yürü() {\n\n\t}",
"public void method_202() {}",
"@Override\n\tpublic void type() {\n\t\t\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\r\n public void salir() {\n }",
"@Override\n\tpublic void jugar() {\n\t\t\n\t}",
"public void mo21793R() {\n }",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\r\n\tpublic void smthAbstr() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"@Override\n public void action() {\n }",
"public void mo55254a() {\n }",
"public void foo() {\r\n\t}",
"@Override\n\tpublic void e() {\n\n\t}",
"@Override\n\tpublic void some() {\n\t\t\n\t}",
"public void method(){}",
"@Override\n\t\t\t\tpublic void a() {\n\n\t\t\t\t}",
"@Override\n public void update() {\n }",
"void berechneFlaeche() {\n\t}",
"@Override\n\tpublic void modify() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\tpublic void action() {\n\t\t\r\n\t}",
"@Override\n\tpublic void view() {\n\t\t\n\t}",
"@Override\n\tpublic void name1() {\n\t\t\n\t}",
"@Override\n public void feedingHerb() {\n\n }",
"public void mo4359a() {\n }",
"public void m23075a() {\n }",
"@Override\n public void author()\n {\n }",
"public void mo21779D() {\n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"public void mo115190b() {\n }",
"@Override\r\n\tpublic void a() {\n\t\t\r\n\t}",
"public void mo21792Q() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }"
] | [
"0.74342245",
"0.7388708",
"0.73807424",
"0.7342543",
"0.733612",
"0.73274",
"0.73048407",
"0.73048407",
"0.7288761",
"0.7263298",
"0.72240573",
"0.72240573",
"0.7185279",
"0.7173534",
"0.71181035",
"0.71084964",
"0.70798004",
"0.7044164",
"0.7011181",
"0.6997047",
"0.6988354",
"0.6974695",
"0.6933389",
"0.69078255",
"0.68886364",
"0.6873616",
"0.6863273",
"0.6860139",
"0.6849512",
"0.6844424",
"0.6835018",
"0.6806309",
"0.680564",
"0.67972124",
"0.67971444",
"0.67901814",
"0.6783107",
"0.6742863",
"0.67092294",
"0.67045176",
"0.6691299",
"0.6672521",
"0.6667701",
"0.66439843",
"0.6641542",
"0.66354257",
"0.6634153",
"0.6631264",
"0.6629309",
"0.6623261",
"0.661811",
"0.6617406",
"0.6608999",
"0.6608808",
"0.6608808",
"0.66031474",
"0.6589945",
"0.6589945",
"0.6587139",
"0.6585568",
"0.6582855",
"0.658134",
"0.65806216",
"0.6572759",
"0.65513843",
"0.6551288",
"0.6547154",
"0.6547127",
"0.65428925",
"0.653221",
"0.6527863",
"0.65270823",
"0.65270823",
"0.65270823",
"0.65235084",
"0.6516452",
"0.6515151",
"0.65133286",
"0.65131664",
"0.6512005",
"0.6511146",
"0.65110445",
"0.6508677",
"0.65022266",
"0.6498299",
"0.6495718",
"0.6493608",
"0.64926344",
"0.6488336",
"0.64852387",
"0.6485153",
"0.64781404",
"0.64741564",
"0.647411",
"0.64622664",
"0.6460401",
"0.6455523",
"0.645338",
"0.645338",
"0.645338",
"0.645338"
] | 0.0 | -1 |
Processes requests for both HTTP GET and POST methods. | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
ServletConfig config = null;
Vector card_list = null;
try {
response.setContentType("text/html;charset=UTF-8");
ServletContext context;
String msg;
response.setContentType("text/html;charset=UTF-8");
List list;
try {
config = getServletConfig();
context = config.getServletContext();
Constants.loadJDBCConstants(context);
} catch (Exception e) {
Constants.logger.error(e);
}
try {
ServletInputStream in = request.getInputStream();
SAXParserExample example = new SAXParserExample();
int info;
StringBuffer sb = new StringBuffer();
while ((info = in.read()) != -1) {
char temp;
temp = (char) info;
sb.append(temp);
}
Constants.logger.info("-------------paid_punch---------------");
Constants.logger.info("XML File" + sb);
String xmldata = new String(sb);
xmldata = xmldata.trim();
InputSource iSource = new InputSource(new StringReader(xmldata));
example.parseDocument(iSource);
list = example.getData();
AccessRequest arz = (AccessRequest) list.get(0);
String reqtype = arz.getTxType();
if (reqtype.equalsIgnoreCase("SEARCHBYBUSINESSNAME-REQ")) {
Search_By_Busines_Name(list, response);
}
if (reqtype.equalsIgnoreCase("GETUSERPUCNHCARD-REQ")) {
Punch_Card_List(list, response);
}
if (reqtype.equalsIgnoreCase("MARKPUNCHUSED-REQ")) {
Mark_Punch_Card(list, response, request);
}
} catch (Exception e) {
Punch_Card_List_XML_Response(card_list, "01", "Failure", response);
Constants.logger.error(e);
} finally {
out.close();
}
} catch (Exception e) {
Punch_Card_List_XML_Response(card_list, "01", "Failure", response);
Constants.logger.error(e);
} finally {
out.close();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {\n final String method = req.getParameter(METHOD);\n if (GET.equals(method)) {\n doGet(req, resp);\n } else {\n resp.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);\n }\n }",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n // only POST should be used\n doPost(request, response);\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\n\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\n\t}",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tdoPost(req, resp);\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t\tdoGet(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tthis.doPost(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tprocessRequest(request, response);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tthis.doPost(req, resp);\n\t\t\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }"
] | [
"0.7004024",
"0.66585696",
"0.66031146",
"0.6510023",
"0.6447109",
"0.64421695",
"0.64405906",
"0.64321136",
"0.6428049",
"0.6424289",
"0.6424289",
"0.6419742",
"0.6419742",
"0.6419742",
"0.6418235",
"0.64143145",
"0.64143145",
"0.6400266",
"0.63939095",
"0.63939095",
"0.639271",
"0.63919044",
"0.63919044",
"0.63903785",
"0.63903785",
"0.63903785",
"0.63903785",
"0.63887113",
"0.63887113",
"0.6380285",
"0.63783026",
"0.63781637",
"0.637677",
"0.63761306",
"0.6370491",
"0.63626",
"0.63626",
"0.63614637",
"0.6355308",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896",
"0.63546896"
] | 0.0 | -1 |
Handles the HTTP GET method. | @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void doGet( )\n {\n \n }",
"@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}",
"@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metGet(request, response);\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}",
"public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }",
"public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}",
"@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}",
"public Result get(Get get) throws IOException;",
"@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }",
"@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}",
"@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }",
"@Override\npublic void get(String url) {\n\t\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}",
"@NonNull\n public String getAction() {\n return \"GET\";\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }",
"@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }",
"@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }",
"public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }",
"public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}",
"@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}",
"public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }",
"public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}",
"public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}",
"@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }",
"@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}",
"private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }",
"@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}",
"public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }",
"HttpGet getRequest(HttpServletRequest request, String address) throws IOException;",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}",
"protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }",
"@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}",
"@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}",
"private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}"
] | [
"0.7589609",
"0.71665615",
"0.71148175",
"0.705623",
"0.7030174",
"0.70291144",
"0.6995984",
"0.697576",
"0.68883485",
"0.6873811",
"0.6853569",
"0.6843572",
"0.6843572",
"0.6835363",
"0.6835363",
"0.6835363",
"0.68195957",
"0.6817864",
"0.6797789",
"0.67810035",
"0.6761234",
"0.6754993",
"0.6754993",
"0.67394847",
"0.6719924",
"0.6716244",
"0.67054695",
"0.67054695",
"0.67012346",
"0.6684415",
"0.6676695",
"0.6675696",
"0.6675696",
"0.66747975",
"0.66747975",
"0.6669016",
"0.66621476",
"0.66621476",
"0.66476154",
"0.66365504",
"0.6615004",
"0.66130257",
"0.6604073",
"0.6570195",
"0.6551141",
"0.65378064",
"0.6536579",
"0.65357745",
"0.64957607",
"0.64672184",
"0.6453189",
"0.6450501",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.6411481",
"0.64067316",
"0.6395873",
"0.6379907",
"0.63737476",
"0.636021",
"0.6356937",
"0.63410467",
"0.6309468",
"0.630619",
"0.630263",
"0.63014317",
"0.6283933",
"0.62738425",
"0.62680805",
"0.62585783",
"0.62553537",
"0.6249043",
"0.62457556",
"0.6239428",
"0.6239428",
"0.62376446",
"0.62359244",
"0.6215947",
"0.62125194",
"0.6207376",
"0.62067443",
"0.6204527",
"0.6200444",
"0.6199078",
"0.61876005",
"0.6182614",
"0.61762017",
"0.61755335",
"0.61716276",
"0.6170575",
"0.6170397",
"0.616901"
] | 0.0 | -1 |
Handles the HTTP POST method. | @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }",
"public void doPost( )\n {\n \n }",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public String post();",
"@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}",
"@Override\n public String getMethod() {\n return \"POST\";\n }",
"public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }",
"protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }",
"public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}",
"public void postData() {\n\n\t}",
"@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}",
"@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}",
"@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }",
"@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }",
"@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }",
"public abstract boolean handlePost(FORM form, BindException errors) throws Exception;",
"@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}",
"public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}",
"public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}",
"public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}",
"@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }",
"@Override\n\tvoid post() {\n\t\t\n\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }",
"protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}",
"public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}",
"@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}",
"@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }",
"@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}",
"@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}",
"private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }",
"@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }"
] | [
"0.73289514",
"0.71383566",
"0.7116213",
"0.7105215",
"0.7100045",
"0.70236707",
"0.7016248",
"0.6964149",
"0.6889435",
"0.6784954",
"0.67733276",
"0.67482096",
"0.66677034",
"0.6558593",
"0.65582114",
"0.6525548",
"0.652552",
"0.652552",
"0.652552",
"0.65229493",
"0.6520197",
"0.6515622",
"0.6513045",
"0.6512626",
"0.6492367",
"0.64817846",
"0.6477479",
"0.64725804",
"0.6472099",
"0.6469389",
"0.6456206",
"0.6452577",
"0.6452577",
"0.6452577",
"0.6450273",
"0.6450273",
"0.6438126",
"0.6437522",
"0.64339423",
"0.64253825",
"0.6422238",
"0.6420897",
"0.6420897",
"0.6420897",
"0.6407662",
"0.64041835",
"0.64041835",
"0.639631",
"0.6395677",
"0.6354875",
"0.63334197",
"0.6324263",
"0.62959254",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6288832",
"0.6280875",
"0.6272104",
"0.6272104",
"0.62711537",
"0.62616795",
"0.62544584",
"0.6251865",
"0.62274224",
"0.6214439",
"0.62137586",
"0.621211",
"0.620854",
"0.62023044",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61775357",
"0.61638993",
"0.61603814",
"0.6148914",
"0.61465937",
"0.61465937",
"0.614548",
"0.6141879",
"0.6136717",
"0.61313903",
"0.61300284",
"0.6124381",
"0.6118381",
"0.6118128",
"0.61063534",
"0.60992104",
"0.6098801",
"0.6096766"
] | 0.0 | -1 |
Returns a short description of the servlet. | @Override
public String getServletInfo() {
return "Short description";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getServletInfo()\n {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\n return \"Short description\";\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }",
"@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}",
"@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }",
"@Override\n public String getServletInfo() {\n return \"Short description\";\n }"
] | [
"0.87634975",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8732279",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8699131",
"0.8531295",
"0.8531295",
"0.85282224",
"0.85282224",
"0.85282224",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8527433",
"0.8516995",
"0.8512296",
"0.8511239",
"0.8510324",
"0.84964365"
] | 0.0 | -1 |
Instantiates a new register user dialog. | public RegisterUserDialog(Admin admin) {
this.admin = admin;
UserDialog dialog = new UserDialog(this);
setLayout(new FlowLayout());
pack();
// Set window location in middle of screen
dialog.setLocationRelativeTo(null);
// Display window
dialog.setVisible(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void register() {\n if (registerView.getFirstName().length() == 0 || registerView.getLastName().length() == 0 || registerView.getUsername().length() == 0 || registerView.getPassword().length() == 0) {\n IDialog invalidRegistrationDialog\n = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Fields must be non-empty!\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n } else {\n if (userController.registerUser(registerView.getFirstName(), registerView.getLastName(), registerView.getUsername(), registerView.getPassword()) != null) {\n mainFrame.setPanel(panelFactory.createPanel(PanelFactoryOptions.panelNames.MAIN_MENU));\n } else {\n IDialog invalidRegistrationDialog = dialogFactory.createDialog(DialogFactoryOptions.dialogNames.MESSAGE, new HashMap<String, Object>() {\n {\n put(\"message\", \"Unable to register: Username is already taken\");\n put(\"title\", \"Authentication Error\");\n put(\"messageType\", DialogFactoryOptions.dialogType.ERROR);\n }\n });\n\n invalidRegistrationDialog.run();\n }\n }\n }",
"public void register_user(View view) {\n CustomRestaurantTypeDialog customRestaurantTypeDialog = new CustomRestaurantTypeDialog();\n customRestaurantTypeDialog.show(getSupportFragmentManager(), \"testing\");\n }",
"private void RegisterUser(final User user) {\n AlertDialog.Builder builder;\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n builder = new AlertDialog.Builder(this, android.R.style.Theme_Material_Dialog_Alert);\n } else {\n builder = new AlertDialog.Builder(this);\n }\n\n View view = LayoutInflater.from(MainActivity.this).inflate(R.layout.alert_dialog_input,null);\n\n builder.setTitle(\"Faltan informacion requerida\")\n .setMessage(\"Completa los siguentes campos\")\n .setView(view);\n\n final EditText editTxtEmailDialog = view.findViewById(R.id.editTxtEmailAlertDialog);\n final EditText editTxtNicknameDialog = view.findViewById(R.id.editTxtNicknameAlertDialog);\n final EditText editTxtPasswordDialog = view.findViewById(R.id.editTxtPasswordAlertDialog);\n\n if(user.getEmail() != null)\n editTxtEmailDialog.setVisibility(View.GONE);\n\n builder.setPositiveButton(\"Registar\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n String email = user.getEmail() != null ? user.getEmail() : editTxtEmailDialog.getText().toString();\n String nickname = editTxtNicknameDialog.getText().toString();\n String password = editTxtPasswordDialog.getText().toString();\n if(!isValidateRegisterProvider(email,nickname,password))\n return;\n user.setEmail(email);\n user.setNickname(nickname);\n user.setPassword(password);\n\n\n\n //User aux = new User(user.getName(), user.getLastName(),nickname,email,password,\"\", user.getProvider());\n if(!Networking.isNetworkAvailable(MainActivity.this)) {\n Toast.makeText(MainActivity.this,\"No hay internet\",Toast.LENGTH_SHORT).show();\n return;\n }\n new Networking(MainActivity.this).execute(Networking.SIGNUP_PROVIDER, user,new NetCallback() {\n @Override\n public void onWorkFinish(Object... objects) {\n\n final User user_temp = (User) objects[0];\n if(user_temp.getId() != -1) {\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(MainActivity.this,\"Bienvenido\",Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(MainActivity.this, InitActivity.class);\n Grua grua = new Grua(\"\",\"\", \"\");\n grua.setId(-1);\n intent.putExtra(Register.JSON_USER, user_temp.toJSON());\n intent.putExtra(Register.JSON_GRUA,grua.toJSON());\n SharedUtil.setUserNickname(MainActivity.this,user_temp.getNickname());\n SharedUtil.setUserPassword(MainActivity.this, user_temp.getPassword());\n SharedUtil.setUserProvider(MainActivity.this, user_temp.getProvider());\n startActivity(intent);\n }\n });\n }\n\n }\n\n @Override\n public void onMessageThreadMain(Object data) {\n final String message = (String) data;\n runOnUiThread(new Runnable() {\n @Override\n public void run() {\n Toast.makeText(MainActivity.this, message, Toast.LENGTH_SHORT).show();\n }\n });\n\n }\n });\n\n }\n }).setNegativeButton(\"Cancelar\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n //... Remover instancia iniciar con ...\n Toast.makeText(MainActivity.this,\"Su registro se ha cancelado\", Toast.LENGTH_SHORT).show();\n }\n })\n .setIcon(android.R.drawable.ic_dialog_info)\n .show();\n\n }",
"private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }",
"public NewUser() {\n initComponents();\n }",
"public signup() {\n initComponents();\n }",
"public VentanaDialogRegister(ListadoUsuarios listadoUsuarios) {\n\t\tgetContentPane().setLayout(null);\n\t\t\n\t\tthis.listadoUsuarios = listadoUsuarios;\n\t\tJPanel panel = new JPanel();\n\t\tpanel.setBackground(new Color(0, 139, 139));\n\t\tpanel.setBounds(0, 0, 444, 271);\n\t\tgetContentPane().add(panel);\n\t\tpanel.setLayout(null);\n\t\t\n\t\ttxtContrasea = new JPasswordField();\n\t\ttxtContrasea.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtContrasea.setBounds(183, 114, 113, 23);\n\t\tpanel.add(txtContrasea);\n\t\ttxtContrasea.setColumns(10);\n\t\t\n\t\ttxtNombreDeUsuario = new JTextField();\n\t\ttxtNombreDeUsuario.setHorizontalAlignment(SwingConstants.CENTER);\n\t\ttxtNombreDeUsuario.setBounds(183, 73, 113, 30);\n\t\tpanel.add(txtNombreDeUsuario);\n\t\ttxtNombreDeUsuario.setColumns(10);\n\t\t\n\t\t\n\t\tJButton btnNewButton = new JButton(\"Registrar\");\n\t\t\n\t\tbtnNewButton.addActionListener(new ActionListener() {\n\t\t\tpublic void actionPerformed(ActionEvent arg0) {\n\t\t\t\t\t\n\t\t\t\t\tauxUsuario = listadoUsuarios.buscarUnUsuario(txtNombreDeUsuario.getText());\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(auxUsuario==null){\n\t\t\t\t\tauxUsuario= new Usuario();\n\t\t\t\t\tauxUsuario.setAdmin(false);\n\t\t\t\t\tauxUsuario.setNombreU(txtNombreDeUsuario.getText());\n\t\t\t\t\tauxUsuario.setClave(txtContrasea.getText());\n\t\t\t\t\tlistadoUsuarios.agregarUsuario(auxUsuario);\n\t\t\t\t\tJOptionPane.showMessageDialog(null,\"USUARIO REGISTRADO\");\n\t\t\t\t\tdispose();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tJOptionPane.showMessageDialog(null,\"ERROR! ESE NOMBRE DE USUARIO YA EXISTE\");\n\t\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tbtnNewButton.setBounds(172, 205, 124, 30);\n\t\tpanel.add(btnNewButton);\n\t\t\n\t\tJLabel lblNewLabel = new JLabel(\"REGISTRO DE USUARIOS\");\n\t\tlblNewLabel.setFont(new Font(\"Tahoma\", Font.BOLD, 14));\n\t\tlblNewLabel.setBounds(134, 11, 196, 37);\n\t\tpanel.add(lblNewLabel);\n\t\t\n\t\tJLabel lblNewLabel_1 = new JLabel(\"Nombre de Usuario:\");\n\t\tlblNewLabel_1.setFont(new Font(\"Trebuchet MS\", Font.BOLD, 14));\n\t\tlblNewLabel_1.setBounds(54, 76, 128, 23);\n\t\tpanel.add(lblNewLabel_1);\n\t\t\n\t\tJLabel lblNewLabel_1_1 = new JLabel(\"Clave:\");\n\t\tlblNewLabel_1_1.setFont(new Font(\"Trebuchet MS\", Font.BOLD, 14));\n\t\tlblNewLabel_1_1.setBounds(119, 113, 79, 23);\n\t\tpanel.add(lblNewLabel_1_1);\n\t}",
"public SignUp() {\n initComponents();\n }",
"public SignUp() {\n initComponents();\n }",
"public\n RegisterView()\n {\n super(ViewKeys.REGISTER);\n\n setAccount(null);\n setAccountChooser(new ElementComboBoxChooser(getAccounts()));\n setFilter(new TransactionFilter());\n setPanel(new Panel());\n setSearchWidget(new SearchWidget(createPopupMenu()));\n\n // Build panel.\n setFill(GridBagConstraints.BOTH);\n add(createToolsPanel(), 0, 0, 1, 1, 0, 0);\n add(getPanel(), 0, 1, 1, 1, 100, 100);\n\n getAccountChooser().setAllowInactiveAccounts(false);\n\n // Add listeners.\n getAccountChooser().addActionListener(new ActionHandler());\n getSearchWidget().addActionListener(new ActionHandler());\n }",
"public Signup() {\n initComponents();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n LayoutInflater inflater = getActivity().getLayoutInflater();\n\n\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(\"CREA USUARIO\")\n .setView(inflater.inflate(R.layout.register_dialog, null))\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n editUser = ((AlertDialog) dialog).findViewById(R.id.username);\n editPass = ((AlertDialog) dialog).findViewById(R.id.password);\n startConexion();\n }\n })\n .setNegativeButton(\"CANCEL\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // User cancelled the dialog\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"private void registerUser() {\n\n // Get register name\n EditText mRegisterNameField = (EditText) findViewById(R.id.register_name_field);\n String nickname = mRegisterNameField.getText().toString();\n\n // Get register email\n EditText mRegisterEmailField = (EditText) findViewById(R.id.register_email_field);\n String email = mRegisterEmailField.getText().toString();\n\n // Get register password\n EditText mRegisterPasswordField = (EditText) findViewById(R.id.register_password_field);\n String password = mRegisterPasswordField.getText().toString();\n\n AccountCredentials credentials = new AccountCredentials(email, password);\n credentials.setNickname(nickname);\n\n if (DataHolder.getInstance().isAnonymous()) {\n credentials.setOldUsername(DataHolder.getInstance().getUser().getUsername());\n }\n\n sendRegistrationRequest(credentials);\n }",
"public void dialogoAgregarUsuario() {\n vAgregarUsuario = new V_AgregarUsuario(new JFrame(), true);\n vAgregarUsuario.setVisible(true);\n }",
"public Sign_up() {\n initComponents();\n }",
"public void registerNewUser(View v) {\n Intent intent = new Intent(this, com.mms.memorizationgame.RegisterActivity.class);\n\n finish();\n startActivity(intent);\n }",
"public Person registerOwner() {\n registerOwnerButton.setOnAction(e -> {\n if (validatePersonData() == DataControl.SUCCESS) {\n String birthNo = birthNoField.getText();\n String firstName = firstNameField.getText();\n String lastName = lastNameField.getText();\n String telephoneNo = telephoneNoField.getText();\n String email = emailField.getText();\n String zipCode = zipCodeField.getText();\n String streetAddress = streetAddressField.getText();\n person = new Person(birthNo, firstName, lastName, telephoneNo,\n email, zipCode, streetAddress);\n MessageDialog.showMessageDialog(\"Registrert\",\n \"Du har nå registrert en person ny eier av bilen.\",\n MessageDialog.INFORMATION_ICON,\n MessageDialog.OK_OPTION);\n stage.close();\n } else {\n if (MessageDialog.showMessageDialog(\"Ugyldig\",\n \"Ugyldig informasjon. Ønsker du å gjøre om?\",\n MessageDialog.INFORMATION_ICON,\n MessageDialog.YES__NO_OPTION) ==\n MessageDialog.YES_OPTION) {\n // do nothing after closing dialog\n } else {\n stage.close();\n }\n }\n });\n stage.showAndWait();\n return person;\n }",
"public void onRegisterPressed(View v) {\n String username = ((EditText) findViewById(R.id.usernameNew)).getText().toString();\n String password = ((EditText) findViewById(R.id.passwordNew)).getText().toString();\n String checkPassword = ((EditText) findViewById(R.id.passwordNew2)).getText().toString();\n Register register = new Register(username, password, checkPassword);\n TextView passwordCheck = findViewById(R.id.passwordCheck);\n TextView errorUsername = findViewById(R.id.errorUsername);\n\n if(!register.assertPassword()) {\n passwordCheck.setVisibility(View.VISIBLE);\n } else {\n passwordCheck.setVisibility(View.GONE);\n }\n if (!register.assertUsername()) {\n errorUsername.setVisibility(View.VISIBLE);\n } else {\n errorUsername.setVisibility(View.GONE);\n }\n if(register.assertUsername() && register.assertPassword()) {\n User user = new User(username, password, (UserTypes)userTypeSpinner.getSelectedItem());\n\n Toast.makeText(this, \"Account Added\", Toast.LENGTH_SHORT).show();\n\n Persistence.getInstance().write(User.SAVE_FILE, getApplicationContext(), user);\n\n Intent mainIntent = new Intent(this, MainActivity.class);\n mainIntent.putExtra(\"EXTRA_USER_TYPE\", user.getAccountType());\n startActivity(mainIntent);\n\n finish();\n }\n }",
"public Successful_Registration() {\n initComponents();\n }",
"public Read_userregister() {\n initComponents();\n }",
"public Sign_Up() {\n initComponents();\n }",
"public void register() {\n int index = requestFromList(getUserTypes(), true);\n if (index == -1) {\n guestPresenter.returnToMainMenu();\n return;\n }\n UserManager.UserType type;\n if (index == 0) {\n type = UserManager.UserType.ATTENDEE;\n } else if (index == 1) {\n type = UserManager.UserType.ORGANIZER;\n } else {\n type = UserManager.UserType.SPEAKER;\n }\n String name = requestString(\"name\");\n char[] password = requestString(\"password\").toCharArray();\n boolean vip = false;\n if(type == UserManager.UserType.ATTENDEE) {\n vip = requestBoolean(\"vip\");\n }\n List<Object> list = guestManager.register(type, name, password, vip);\n int id = (int)list.get(0);\n updater.addCredentials((byte[])list.get(1), (byte[])list.get(2));\n updater.addUser(id, type, name, vip);\n guestPresenter.printSuccessRegistration(id);\n }",
"public void createFirebaseAccountsUI() {\n mAccountsFragment.startActivityForResult(\n AuthUI.getInstance()\n .createSignInIntentBuilder()\n .setAvailableProviders(providers)\n .build(),\n mAccountsFragment.RC_SIGN_IN);\n }",
"public adduser() {\n initComponents();\n }",
"public void RegisterUser() {\n try {\n reg = new Registration();\n reg.setFirstName(FName);\n reg.setLastName(LName);\n reg.setCompanyName(CompanyName);\n reg.setEmail(Email);\n reg.setMobile(mobile);\n ValidateRegistration validator = new ValidateRegistration();\n boolean legitmail = validator.validateEmail(reg);\n if ( legitmail == false ) {\n System.out.println(\"Not a legitimate Email\");\n FacesContext c = FacesContext.getCurrentInstance();\n FacesMessage m = new FacesMessage(\"Invalid Email\", \"The email provided is not correct\");\n c.addMessage(null, m);\n } else {\n FacesContext c = FacesContext.getCurrentInstance();\n c.getApplication().getNavigationHandler().handleNavigation(c, null, \"mainpage.xhtml\");\n }\n } catch (Exception ex) {\n System.out.println(ex.getMessage());\n }\n }",
"public RegisterForm() {\n initComponents();\n }",
"public RegisterForm() {\n initComponents();\n }",
"public RegisterForm() {\n initComponents();\n }",
"public Register() {\n user = new User();\n em = EMF.createEntityManager();\n valid = false;\n }",
"private void register_user() {\n\n\t\tHttpRegister post = new HttpRegister();\n\t\tpost.execute(Config.URL + \"/api/newuser\");\n\n\t}",
"public void onSignUpClick() {\n\t\tString uid = regview.getUsername();\n\t\tString pw = regview.getPassword();\n\t\tString na = regview.getName();\n\t\tString em = regview.getEmail();\n\t\tString text = \"\";\n\t\tif(uid.equals(\"\") || pw.equals(\"\") || na.equals(\"\")|| em.equals(\"\")){\n\t\t\ttext = \"Please fill out all fields!\";\n\t\t} else if(regview.findUser(uid)!=User.NULL_USER){\n\t\t\ttext = \"The username already exsit, please try another one!\";\n\t\t} else {\n\t\t\tregview.addUser(new User(uid,pw,na,em));\n\t\t\tregview.goLoginPage();\n\t\t}\n\t\tregview.setRegisterText(text);\n\t}",
"public AddUser() {\n initComponents();\n }",
"public AddUser() {\n initComponents();\n }",
"public AddUser() {\n initComponents();\n }",
"public LandingPage registerNewAccount(){\n\t\taction.WaitForWebElement(linkRegisterNewAccount)\n\t\t\t .Click(linkRegisterNewAccount);\n\t\treturn this;\n\t}",
"private void register() {\r\n if (mName.getText().length() == 0) {\r\n mName.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mEmail.getText().length() == 0) {\r\n mEmail.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() == 0) {\r\n mPassword.setError(\"please fill this field\");\r\n return;\r\n }\r\n if (mPassword.getText().length() < 6) {\r\n mPassword.setError(\"password must have at least 6 characters\");\r\n return;\r\n }\r\n\r\n\r\n final String email = mEmail.getText().toString();\r\n final String password = mPassword.getText().toString();\r\n final String name = mName.getText().toString();\r\n\r\n FirebaseAuth.getInstance().createUserWithEmailAndPassword(email, password).addOnCompleteListener(getActivity(), new OnCompleteListener<AuthResult>() {\r\n @Override\r\n public void onComplete(@NonNull Task<AuthResult> task) {\r\n if (!task.isSuccessful()) {\r\n Snackbar.make(view.findViewById(R.id.layout), \"sign up error\", Snackbar.LENGTH_SHORT).show();\r\n } else {\r\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\r\n\r\n //Saves the user's info in the database\r\n Map<String, Object> mNewUserMap = new HashMap<>();\r\n mNewUserMap.put(\"email\", email);\r\n mNewUserMap.put(\"name\", name);\r\n\r\n FirebaseDatabase.getInstance().getReference().child(\"users\").child(uid).updateChildren(mNewUserMap);\r\n }\r\n }\r\n });\r\n\r\n }",
"public SignUP() {\n initComponents();\n }",
"public UserDialog(JFrame parent){\n\t\t\tsuper(parent, \"New user\");\n\t\t\tadd(new JPanel(), BorderLayout.NORTH);\n\t\t\tadd(new UserDatapanel(),BorderLayout.CENTER);\n\t\t\tadd(getButtonPanel(),BorderLayout.SOUTH);\n\t\t\tsetSize(500,300);\n\t\t}",
"public AddUserView() {\n initComponents();\n }",
"public void RegisterClick(View view) {\n Intent intent = new Intent(this, RegisterActivity.class);\n startActivity(intent);\n Toast.makeText(getApplicationContext(), \"Register as a new user\", Toast.LENGTH_SHORT).show();\n }",
"public REGISTER_WINDOW() {\n initComponents();\n }",
"private void register() {\n Intent intent = new Intent(LoginActivity.this, RegisterActivity.class);\n startActivity(intent);\n }",
"@FXML\n\tpublic void createUser(ActionEvent event) {\n\t\tString empty = \"\";\n\t\tString name = txtUserNames.getText();\n\t\tString lastName = txtUserSurnames.getText();\n\t\tString id = txtUserId.getText();\n\t\tString username = txtUserUsername.getText();\n\t\tString password = PfUserPassword.getText();\n\n\t\tif (!name.equals(empty) && !lastName.equals(empty) && !id.equals(empty) && !username.equals(empty)\n\t\t\t\t&& !password.equals(empty)) {\n\t\t\tcreateSystemUser(name, lastName, id, username, password);\n\t\t\ttxtUserNames.setText(\"\");\n\t\t\ttxtUserSurnames.setText(\"\");\n\t\t\ttxtUserId.setText(\"\");\n\t\t\ttxtUserUsername.setText(\"\");\n\t\t\tPfUserPassword.setText(\"\");\n\t\t\t// labelUserMessage.setText(\"The user has been created\");\n\t\t} else if (name.equals(empty) && lastName.equals(empty) && id.equals(empty) && username.equals(empty)\n\t\t\t\t&& password.equals(empty)) {\n\t\t\tDialog<String> dialog = createDialog();\n\t\t\tdialog.setTitle(\"Error al guardar datos\");\n\t\t\tdialog.setContentText(\"Todos los campos de texto deben ser llenados\");\n\t\t\tdialog.show();\n\t\t}\n\t}",
"public static createNewUser newInstance() {\n createNewUser fragment = new createNewUser();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public RegisterView() {\r\n\r\n\t\tcontainer = getContentPane();\r\n\t\tcontainer.setLayout(new BorderLayout());\r\n\t\tpanelRegister = new JPanel(new GridLayout(8, 1));\r\n\t\tpanelButton = new JPanel(new GridLayout(1, 2));\r\n\t\ttextFieldUser = new JTextField();\r\n\t\tpasswordFieldPassword = new JPasswordField();\r\n\t\tpasswordFieldRePassword = new JPasswordField();\r\n\t\tcheckBoxIsFarmer = new JCheckBox();\r\n\t\tlabelUser = new JLabel(\"Username: \");\r\n\t\tlabelPassword = new JLabel(\"Password: \");\r\n\t\tlabelRePassword = new JLabel(\"Confirm Password: \");\r\n\t\tlabelIsFarmer = new JLabel(\"Farmer? (Yes/No)\");\r\n\r\n\t\tpanelRegister.add(labelUser);\r\n\t\tpanelRegister.add(textFieldUser);\r\n\t\tpanelRegister.add(labelPassword);\r\n\t\tpanelRegister.add(passwordFieldPassword);\r\n\t\tpanelRegister.add(labelRePassword);\r\n\t\tpanelRegister.add(passwordFieldRePassword);\r\n\t\tpanelRegister.add(labelIsFarmer);\r\n\t\tpanelRegister.add(checkBoxIsFarmer);\r\n\r\n\t\tpanelRegister.setBackground(Util.orange);\r\n\t\tpanelButton.setBackground(Util.orange);\r\n\t\t\r\n\t\tregisterCancelController = new RegisterCancelController();\r\n\t\t\r\n\t\tbuttonRegister = new JButton(\"Confirm Registration\");\r\n\t\tregisterController = new RegisterController();\r\n\t\tbuttonRegister.addActionListener(e -> registerController.startProcess(this));\r\n\t\tbuttonCancel = new JButton(\"Cancel\");\r\n\t\tregisterCancelController = new RegisterCancelController();\r\n\t\tbuttonCancel.addActionListener(e -> registerCancelController.startProcess(this));\r\n\t\t\r\n\t\tpanelButton.add(buttonRegister);\r\n\t\tpanelButton.add(buttonCancel);\r\n\r\n\r\n\r\n\t\tcontainer.add(panelRegister, BorderLayout.CENTER);\r\n\t\tcontainer.add(panelButton, BorderLayout.SOUTH);\r\n\t\tthis.setVisible(true);\r\n\t\tthis.setSize(500, 500);\r\n\t\tthis.setLocationRelativeTo(null);\r\n\t\tthis.setTitle(\"Register\");\r\n\t\tthis.setDefaultCloseOperation(EXIT_ON_CLOSE);\r\n\r\n\t}",
"private void initSignUpButton() {\n TextButton signUpButton = new TextButton(\"Sign up\", skin);\n signUpButton.setPosition(320, 125);\n signUpButton.addListener(new InputListener() {\n @Override\n public void touchUp(InputEvent event, float x, float y, int pointer, int button) {\n AuthService authService = new AuthService();\n RegistrationResponse response\n = authService.register(usernameField.getText(), passwordField.getText());\n switch (response) {\n case OCCUPIED_NAME:\n usernameTakenDialog();\n break;\n case SHORT_PASSWORD:\n passwordTooShortDialog();\n break;\n case SUCCESS:\n stateManager.setState(new LoginState(stateManager));\n break;\n default:\n }\n }\n\n @Override\n public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {\n System.out.println(\"pressed sign up\");\n return true;\n }\n });\n stage.addActor(signUpButton);\n }",
"public SignUpGUI() {\n initComponents();\n \n //Text fields for registration credentials\n this.getUsername.setBorder(BorderFactory.createTitledBorder(\"Username\"));\n this.getEmail.setBorder(BorderFactory.createTitledBorder(\"Email\"));\n this.getPhone.setBorder(BorderFactory.createTitledBorder(\"Phone (optional)\"));\n this.getPassword.setBorder(BorderFactory.createTitledBorder(\"Password\"));\n this.getConfirmPassword.setBorder(BorderFactory.createTitledBorder(\"Confirm Password\"));\n \n this.setVisible(true);\n }",
"public RegisterDialog(JFrame parent) {\n super(parent, true);\n initComponents();\n setResizable(false);\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View RegisterView = inflater.inflate(R.layout.fragment_register, container, false);\n\n mainActivity = (MainActivity) getActivity();\n mainActivity.setTitle(R.string.title_registration);\n\n\n txtRMail = RegisterView.findViewById(R.id.txtRMail);\n txtRFirstname = RegisterView.findViewById(R.id.txtRFirstname);\n txtRLastname = RegisterView.findViewById(R.id.txtRLastname);\n txtRPassword = RegisterView.findViewById(R.id.txtRPassword);\n txtRPassword2 = RegisterView.findViewById(R.id.txtRPassword2);\n\n btnRegisterUser = RegisterView.findViewById(R.id.btnRegisterUser);\n\n\n btnRegisterUser.setOnClickListener(this);\n\n\n return RegisterView;\n }",
"public void register(String form /* should be a Form from GUI */){\n String email = \"email\";\n String nome_completo = \"full_name\";\n Date data_nascimento = new Date(1996-10-21);\n String password = getMd5(\"password\");\n String nif = \"nif\";\n String morada = \"morada\";\n String telemovel = \"telemovel\";\n User user = new User(email);\n if (!user.exists()){\n user.setNome_completo(nome_completo);\n user.setData_nascimento(data_nascimento);\n user.setPassword(password);\n user.setNif(nif);\n user.setMorada(morada);\n user.setTelemovel(telemovel);\n user.setAdmin(FALSE);\n //System registers person\n //db.register(user)\n }\n }",
"@Override\n public void onClick(View v) {\n\n String name = fullname.getText().toString();\n String emailx = email.getText().toString();\n String password1 = password.getText().toString();\n String password2 = password_conf.getText().toString();\n progressDialog.setMessage(\"sign up your data\");\n showDialog();\n\n\n userdata = new UserData(name,emailx,password1,password2);\n Call<UserData> call = createUser.createUser(userdata);\n call.enqueue(new Callback<UserData>() {\n @Override\n public void onResponse(Call<UserData> call, Response<UserData> response) {\n if(response.isSuccessful()){\n Toast.makeText(RegisterActivity.this,\"Sign Up Success\",Toast.LENGTH_LONG).show();\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n finish();\n hideDialog();\n } else {\n Toast.makeText(getApplicationContext(),response.message(), Toast.LENGTH_LONG).show();\n hideDialog();\n }\n }\n\n @Override\n public void onFailure(Call<UserData> call, Throwable t) {\n Toast.makeText(getApplicationContext(), \"Error Connection\", Toast.LENGTH_LONG).show();\n hideDialog();\n }\n });\n }",
"public sign_up_page() {\n initComponents();\n }",
"public void registerUser(View view) {\n this.closeKeyboard();\n this.validator.validate();\n if (this.validator.hasNoErrors()) {\n User user = createUser();\n RealmUser registeredUser = registerUserDetails(user);\n //TODO register on server.\n if (registeredUser != null) {\n new MockUserRegistrationService().registerUser(user.getFirstName(), user.getLastName(), user.getEmail(), user.getInsuranceProvider(), user.getInsurancePlan());\n doOnRegistrationSuccess();\n }\n }\n }",
"public String register() {\r\n\t\tif (password.equals(passwordConfirm)) {\r\n\t\t\tUser newUser = new User(username, password);\r\n\t\t\t\r\n\t\t\tif (dataManager.addUser(newUser)) {\r\n\t\t\t\tFacesMessage message = new FacesMessage(\"User has been registered successfully.\");\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null, message);\r\n\t\t\t\tlogger.info(\"New user has been registered.\");\r\n\t\t\t\treturn \"login.xhtml\";\r\n\t\t\t\t\r\n\t\t\t}\t\t\t\r\n\t\t\tFacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \"A user with the same username already exists.\");\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"registration_form:username\", message);\t\t\t\r\n\t\t}\r\n\t\telse {\r\n\t\t\tFacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, \"\", \"Password confirmation is incorrect.\");\r\n\t\t\tFacesContext.getCurrentInstance().addMessage(\"registration_form:password_confirm\", message);\t\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public void displayRegisterForm(View v) {\n\n Intent intent = new Intent(getApplicationContext(), RegistrationScreenActivity.class);\n startActivityForResult(intent, NEW_USER_REGISTER);\n }",
"public Registration() {\n initComponents();\n managerpassword_label.setVisible(false);\n managerpassword_passfield.setVisible(false);\n \n }",
"public void register()\n {\n String n = nameProperty.getValue();\n if (n == null || n.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String p = passwordProperty.getValue();\n if (p == null || p.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String e = emailProperty.getValue();\n if (e == null || e.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String ph = phoneProperty.getValue();\n if (ph == null || ph.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (ph.length() != 8)\n {\n throw new IllegalArgumentException(\"Invalid phone number\");\n }\n try\n {\n Integer.parseInt(ph);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid phone number\", ex);\n }\n String t = titleProperty.getValue();\n if (t == null || t.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String a = authorProperty.getValue();\n if (a == null || a.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n String y = yearProperty.getValue();\n if (y == null || y.isEmpty())\n {\n throw new IllegalArgumentException(\"Field cannot be empty\");\n }\n if (y.length() != 4)\n {\n throw new IllegalArgumentException(\"Invalid year\");\n }\n try\n {\n Integer.parseInt(y);\n }\n catch (NumberFormatException ex)\n {\n throw new IllegalArgumentException(\"Invalid year\", ex);\n }\n\n try\n {\n\n model.registerUser(n, p, e, ph, t, a, y);\n\n }\n catch (Exception e1)\n {\n\n e1.printStackTrace();\n }\n\n }",
"private void SignUp(String email, String password) {\n if (TextUtils.isEmpty(email) || TextUtils.isEmpty(password) ) {\n\n }else {\n msignInDialog.setTitle(\"Creating New User\");\n msignInDialog.setMessage(\"Please wait while DevChat creates your new Account...\");\n msignInDialog.setCanceledOnTouchOutside(false);\n msignInDialog.show();\n mAuth.createUserWithEmailAndPassword(email, password)\n .addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if (task.isSuccessful()) {\n Toast.makeText(ActivityRegister.this, \"User Account Created!\", Toast.LENGTH_SHORT).show();\n createUser(et_username.getText().toString());\n msignInDialog.dismiss();\n Intent chatBoxIntent = new Intent(ActivityRegister.this, Chatbox_Activity.class);\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"values\", values);\n chatBoxIntent.putExtras(bundle);\n startActivity(chatBoxIntent);\n } else {\n msignInDialog.dismiss();\n Toast.makeText(ActivityRegister.this, \"Error Creating New User Account!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }\n }",
"public SignupAccountInfoAvatar() {\n super(\"SignupAvatar.AccountInfo\", BrowserConstants.DIALOGUE_BACKGROUND);\n this.profileConstraints = ProfileConstraints.getInstance();\n this.securityQuestionModel = new DefaultComboBoxModel();\n this.usernameReservations = new HashMap<String, UsernameReservation>();\n this.emailReservations = new HashMap<EMail, EMailReservation>();\n initSecurityQuestionModel();\n initComponents();\n addValidationListeners();\n initFocusListener();\n }",
"public void register(View v)\n {\n\n Intent loginPage = new Intent(RegisterPage.this, Login.class);\n loginPage.putExtra(\"username\",username.getText().toString());\n loginPage.putExtra(\"password\",password.getText().toString());\n loginPage.putExtra(\"firstname\",firstName.getText().toString());\n loginPage.putExtra(\"lastname\",lastName.getText().toString());\n startActivity(loginPage);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_register);\n\n //final Intent intent = getIntent();\n\n\n button.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n\n NavController navController = Navigation.findNavController(RegisterActivity.this, R.id.registerActivity);\n navController.navigate(R.id.loginFragment);\n\n user = new User(fname.toString(),lname.toString(),address.toString(),phone.toString(),availability.toString(),qualifications.toString(),services_offered.toString());\n\n }\n });\n\n\n }",
"public DialogRegistroUser(Login vl, boolean b) {\r\n\t\tsuper();\r\n\t\tinicializar();\r\n\t}",
"private void Register()\n {\n Intent registerIntent = new Intent (LoginActivity.this, RegisterActivity.class);\n startActivity(registerIntent);\n finish();\n }",
"public CreateAccount_GUI() {\n initComponents();\n }",
"@Override\r\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n \r\n LayoutInflater inflater = getActivity().getLayoutInflater();\r\n builder.setTitle(\"New Wallet\");\r\n \r\n\t final View view = inflater.inflate(R.layout.new_wallet_dialog, null);\r\n\t \r\n\t final EditText name = (EditText) view.findViewById(R.id.newWallet_text);\r\n\t \r\n builder.setPositiveButton(R.string.confirmRecord, new DialogInterface.OnClickListener() {\r\n \r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.comfirmPressed(name.getText().toString());\t\r\n \t\t}\r\n });\r\n builder.setNegativeButton(R.string.cancelRecord, new DialogInterface.OnClickListener() {\r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.cancelPressed();\r\n \t\t}\r\n \t});\r\n // Create the AlertDialog object and return it\r\n return builder.create();\r\n }",
"public Admin_SignUp() {\n initComponents();\n }",
"public void newuserclicked(View view) {\n Intent myuserIntent = new Intent(this, UserCreation.class);\n startActivity(myuserIntent);\n }",
"public String registration() {\n if (name != null) {\n int createdUsers = DBUtils.addUser(name, password, email);\n if (createdUsers > 0) {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/index?faces-redirect=true\";\n }\n }\n return \"/pages/register.xhtml?faces-redirect=true\";\n }",
"@Override\n public void onClick (View v)\n {\n if (v == register)\n {\n // Validate matching passwords.\n if (password.getText().toString().equals(rpassword.getText().toString()))\n {\n if (!genderSelected.equals(\"Select\"))\n {\n String AUTHORITY = getResources().getString(R.string.authority);\n Bundle extras = new Bundle();\n // pack bundle with user extras\n extras.putString(\"request_type\", \"0\");\n extras.putString(\"user\", user.getText().toString());\n extras.putString(\"password\", password.getText().toString());\n extras.putString(\"birthday\",\n datePicker.getYear() + \"-\" + (datePicker.getMonth() + 1) + \"-\" +\n datePicker.getDay());\n extras.putString(\"gender\", genderSelected);\n extras.putString(\"name\", name.getText().toString());\n // Attempt to create a sync account\n Account account = FriendFinder\n .createSyncAccount(this, user.getText().toString(),\n password.getText().toString());\n // Allow synchronization.\n ContentResolver.setSyncAutomatically(account, AUTHORITY, true);\n // Attempt to synchronize.\n extras.putBoolean(ContentResolver.SYNC_EXTRAS_EXPEDITED, true);\n extras.putBoolean(ContentResolver.SYNC_EXTRAS_FORCE, true);\n extras.putBoolean(ContentResolver.SYNC_EXTRAS_MANUAL, true);\n ContentResolver.requestSync(account, AUTHORITY, extras);\n spinnerDialog.show(getFragmentManager(), \"Registering User\");\n receiver = new RegistrationReceiver();\n IntentFilter intentFilter = new IntentFilter();\n intentFilter.addAction(\"registration\");\n registerReceiver(receiver, intentFilter);\n }\n else\n {\n Toast.makeText(this, \"Please select a gender.\", Toast.LENGTH_LONG).show();\n }\n }\n else\n {\n Toast.makeText(this, \"Passwords do not match.\", Toast.LENGTH_LONG).show();\n }\n }\n else if (v == date)\n {\n // display datepicker.\n datePicker.show(getFragmentManager(), \"Date Picker\");\n }\n }",
"private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }",
"public void register(View view) {\n if(radioGroup.getCheckedRadioButtonId() == -1){\n Snackbar.make(getCurrentFocus(),\"Please select one of the Options: Student or Professor\",Snackbar.LENGTH_LONG).show();\n return;\n }\n if (usn.getText().toString().trim().equals(\"\")){\n usn.setError(\"This field cannot be empty\");\n return;\n } else if (password.getText().toString().trim().equals(\"\")){\n password.setError(\"This field cannot be empty\");\n return;\n } else if(password.getText().toString().trim().length() < 8){\n password.setError(\"Password too short.\");\n return;\n } else if(confirmPassword.getText().toString().trim().equals(\"\")){\n confirmPassword.setError(\"This field cannot be empty\");\n return;\n } else if(!(password.getText().toString().trim()\n .equals(confirmPassword.getText().toString().trim()))){\n password.setError(\"Passwords do not match\");\n confirmPassword.setError(\"Passwords do not match\");\n return;\n }\n progressBar.setVisibility(View.VISIBLE);\n mAuth.signInAnonymously().addOnSuccessListener(authResult -> myRef.child(usn.getText().toString().trim()).addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n try {\n String username = dataSnapshot.child(\"emailId\").getValue().toString();\n String password = confirmPassword.getText().toString().trim();\n System.out.println(username);\n mAuth.createUserWithEmailAndPassword(username,password)\n .addOnCompleteListener(RegisterActivity.this,task -> {\n Log.d(\"TAG\",\"Created User:\"+task.isSuccessful());\n if(!task.isSuccessful()){\n Toast.makeText(RegisterActivity.this, \"Error occurred.\" +\n \" Could not create user. Please \" +\n \"check your internet connection\", Toast.LENGTH_LONG).show();\n return;\n }\n else {\n startActivity(new Intent(RegisterActivity.this,LoginActivity.class));\n finish();\n }\n });\n\n }catch (NullPointerException e){\n usn.setError(\"Invalid USN. Please check your input or contact\" +\n \" your department for help\");\n progressBar.setVisibility(View.INVISIBLE);\n }\n }\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n }))\n .addOnFailureListener(e -> {\n progressBar.setVisibility(View.INVISIBLE);\n Snackbar.make(view,\"Something went wrong.Please check if you have an internet connection or that the details\" +\n \"entered are valid\",Snackbar.LENGTH_LONG).show();\n });\n }",
"@Override\n\tpublic void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\n\t\trequestWindowFeature(Window.FEATURE_NO_TITLE);\n\t\tsetContentView(R.layout.regist);\n\n\t\tsignupbutton = (ImageView) findViewById(R.id.regist_okbutton);\n\t\tid = (EditText) findViewById(R.id.regist_userid);\n\t\tpassword = (EditText) findViewById(R.id.regist_userpassword);\n\t\tpasswordre = (EditText) findViewById(R.id.regist_userpasswordre);\n\t\temail = (EditText) findViewById(R.id.regist_useremail);\n\t\tuserProfile = (ImageView) findViewById(R.id.regist_userimage);\n\n\t\tpictureSelector = new PictureSelector(this, true);\n\t\timageSelectDialog = pictureSelector.createDialog();\n\t\tuserProfile.setOnClickListener(new OnClickListener() {\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\timageSelectDialog.show();\n\t\t\t}\n\t\t});\n\n\t\tsignupbutton.setOnClickListener(new Button.OnClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString idStr = id.getText().toString();\n\t\t\t\tString passStr = password.getText().toString();\n\t\t\t\tString passReStr = passwordre.getText().toString();\n\t\t\t\tString emailStr = email.getText().toString();\n\t\t\t\tif (idStr.equals(\"\") || passStr.equals(\"\")\n\t\t\t\t\t\t|| emailStr.equals(\"\") || passReStr.equals(\"\")) {\n\t\t\t\t\tToast.makeText(RegistActivity.this, \"모든 항목을 입력해 주십시오.\",\n\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (!passStr.equals(passReStr)) {\n\t\t\t\t\tToast.makeText(RegistActivity.this,\n\t\t\t\t\t\t\t\"비밀번호와 비밀번호 확인에 입력하신 비밀번호가 서로 다릅니다.\",\n\t\t\t\t\t\t\tToast.LENGTH_LONG).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tDataRequester.registerID(idStr, passStr, emailStr,\n\t\t\t\t\t\tpictureSelector.getFileName(), RegistActivity.this);\n\t\t\t}\n\t\t});\n\t}",
"RegisteredUserView(String username, String email, String name) {\n this.username = username;\n this.email = email;\n this.name = name;\n }",
"@Override\n\t\tpublic void onCreate(Bundle savedInstanceState) {\n\t\t\t\tsuper.onCreate(savedInstanceState);\n\t\t\t\tsetContentView(R.layout.screen_registration);\n\n\t\t\t\temailForm = (EditText) findViewById(R.id.regEmail);\n\t\t\t\tfirstNameForm = (EditText) findViewById(R.id.regFirstName);\n\t\t\t\tlastNameForm = (EditText) findViewById(R.id.regLastName);\n\t\t\t\tpasswordForm = (EditText) findViewById(R.id.regPass);\n\t\t\t\tpasscheckForm = (EditText) findViewById(R.id.regPassValid);\n\n\t\t\t\t// init validator & restreceiver\n\t\t\t\tvalidate = new Validator(this);\n\t\t//restReceiver = new RestReceiver(this);\n\n\t\t\t\t// get stringressources & prebuild message\n\t\t\t\tresources = getResources();\n\t\t\t\tmessageDialog = new Builder(this);\n\t\t\t\tprogressDialog = new ProgressDialog(this);\n\t\t\t\tprogressDialog.setMessage(resources.getString(R.string.registration_loading));\n\n\t\t\t\t// set focuslisteners for validation checks\n\t\t\t\temailForm.setOnFocusChangeListener(this);\n\t\t\t\tfirstNameForm.setOnFocusChangeListener(this);\n\t\t\t\tlastNameForm.setOnFocusChangeListener(this);\n\t\t\t\tpasswordForm.setOnFocusChangeListener(this);\n\t\t\t\tpasscheckForm.setOnFocusChangeListener(this);\n\n\t\t\t\tsubmitButton = (Button) findViewById(R.id.buttonRegister);\n\t\t\t\tsubmitButton.setOnClickListener(new View.OnClickListener() {\n\t\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\t\t\tprogressDialog.show();\n\n\t\t\t\t\t\t\t\tEmrUser registerUser = new EmrUser(emailForm.getText().toString(), passwordForm.getText().toString());\n\t\t\t\t\t\t\t\tregisterUser.setName(firstNameForm.getText().toString() + \" \" + lastNameForm.getText().toString());\n\n TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);\n registerUser.setMobileNumber(tm.getLine1Number());\n\n EmrLocation tmp = APPLICATION.getLastLocation();\n registerUser.setCurrentLocation(tmp.getLatitude(), tmp.getLongitude());\n\n //TODO determine based on region / geofencing\n String tmp_dispatcher_solution = \"aedbf693c6d454aca200f76b97d3895a\";\n registerUser.setActive_dispatcher(tmp_dispatcher_solution);\n\n ArrayList<String> nearby = new ArrayList<String>();\n nearby.add(tmp_dispatcher_solution);\n\n registerUser.setDispatcher(nearby);\n\n\t\t\t\t\t\t\t\tAPPLICATION.registration(registerUser);\n\t\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\t\t\tAPPLICATION.subscribeMQTT(CALLBACK_URL, this);\n\t\t}",
"public Dialog createAddPersonDialog(String title, String msg) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getMyAcitivty());\n builder.setTitle(title);\n builder.setMessage(msg);\n\n // Use an EditText view to get user input.\n final EditText input = new EditText(getMyAcitivty());\n input.setText(\"\");\n builder.setView(input);\n\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n String value = input.getText().toString();\n Log.d(TAG, \"user input: \" + value);\n inputDialogResult = value;\n launchTrainingActivity();\n// AlertDialog dg =\n// SelectServerAlertDialog.createDialog(\n// getContext(),\n// \"Pick a Server\",\n// getAllIps(),\n// launchTrainingActivityAction,\n// cancelAction,\n// true);\n// dg.show();\n }\n });\n builder.setNegativeButton(\"Cancel\", SelectServerAlertDialog.cancelAction);\n return builder.create();\n }",
"void createUser() throws SQLException {\n String name = regName.getText();\n String birthdate = regAge.getText();\n String username = regUserName.getText();\n String password = regPassword.getText();\n String query = \" insert into users (name, birthdate, username, password)\"\n + \" values (?, ?, ?, ?)\";\n\n DB.registerUser(name, birthdate, username, password, query);\n }",
"public CreateAccount() {\n initComponents();\n selectionall();\n }",
"@Override\n public void onClick(View v) {\n switch (v.getId())\n {\n case R.id.bRegister: //Register button clicked\n String username = etUsername.getText().toString();\n String email = etEmail.getText().toString();\n String password = etPassword.getText().toString();\n\n User user = new User(username, email, password);\n\n registerUser(user); //Calling the registration activity\n\n break;\n }\n }",
"@Override\n public void onCreate (Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.register);\n this.user = (EditText) findViewById(R.id.email);\n this.password = (EditText) findViewById(R.id.pass);\n this.rpassword = (EditText) findViewById(R.id.repeat_pass);\n this.name = (EditText) findViewById(R.id.name);\n\n spinnerDialog = new LoadingSpinnerDialog();\n receiver = null;\n // Create an ArrayAdapter using the string array and a default spinner layout\n ArrayAdapter<CharSequence> adapter = ArrayAdapter\n .createFromResource(this, R.array.genders, android.R.layout.simple_spinner_item);\n // Specify the layout to use when the list of choices appears\n adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);\n // Apply the adapter to the spinner\n this.datePicker = new DatePickerFragment();\n this.gender = (Spinner) findViewById(R.id.gender);\n gender.setAdapter(adapter);\n gender.setOnItemSelectedListener(this);\n genderSelected = \"Male\";\n\n this.register = (Button) findViewById(R.id.register);\n this.date = (Button) findViewById(R.id.date);\n this.register.setOnClickListener(this);\n this.date.setOnClickListener(this);\n }",
"private RegisterUser() {\n\n }",
"public SendChequeJFrame(EChequeRegistration registerdUser) { \n initComponents();\n eChequeRegisterdUser = registerdUser;\n }",
"public void Register() {\n Url url = new Url();\n User user = new User(fname.getText().toString(), lname.getText().toString(), username.getText().toString(), password.getText().toString());\n Call<Void> registerUser = url.createInstanceofRetrofit().addNewUser(user);\n registerUser.enqueue(new Callback<Void>() {\n @Override\n public void onResponse(Call<Void> call, Response<Void> response) {\n Toast.makeText(getActivity(), \"User Registered successfully\", Toast.LENGTH_SHORT).show();\n }\n\n @Override\n public void onFailure(Call<Void> call, Throwable t) {\n Toast.makeText(getActivity(), \"Error\" + t, Toast.LENGTH_SHORT).show();\n }\n });\n }",
"public void registerUser(RegisterForm form) throws DAOException;",
"private void newUser() {\n // TODO: Initial layout\n LayoutInflater layoutInflater = LayoutInflater.from(getActivity());\n View form = layoutInflater.inflate(R.layout.form_user, null);\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(getActivity());\n alertDialogBuilder.setTitle(\"Thêm tài khoản\");\n alertDialogBuilder.setView(form);\n\n // TODO: Add controls\n editTextPhone = form.findViewById(R.id.editTextPhoneOnUserForm);\n editTextUsername = form.findViewById(R.id.editTextUsernameOnUserForm);\n editTextPassword = form.findViewById(R.id.editTextPasswordOnUserForm);\n editTextPassword2 = form.findViewById(R.id.editTextPassword2OnUserForm);\n\n // TODO: Add events\n alertDialogBuilder.setPositiveButton(\"Lưu\", null);\n alertDialogBuilder.setNegativeButton(\"Hủy\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n final AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.setOnShowListener(new DialogInterface.OnShowListener() {\n @Override\n public void onShow(final DialogInterface dialog) {\n Button buttonSave = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);\n buttonSave.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n final User user = getUser();\n if (user != null) {\n tableUser.addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if (dataSnapshot.child((user.getId())).exists()) {\n Toast.makeText(getActivity(), \"Số điện thoại đã tồn tại, xin nhập số khác\", Toast.LENGTH_LONG).show();\n } else {\n tableUser.child(user.getId()).setValue(user);\n dialog.dismiss();\n Toast.makeText(getActivity(), \"Thêm thành công\", Toast.LENGTH_LONG).show();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n }\n });\n }\n }\n });\n }\n });\n alertDialog.show();\n }",
"public Register() {\n setTitle(\"Register\"); //sets its title name which appears on top the frame\n setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); //optional, what happens when the frame closes\n addWindowListener(new WindowAdapter() {\n public void windowClosing(WindowEvent e) {\n windowListener.handleClosing();\n }\n });\n\n setBounds(150, 150, 400, 200); //Explicitly defining the frame size and also frame location\n contentPane = new JPanel(); // Creating a new jpanel\n contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); // specifies added component's position within the panel\n setContentPane(contentPane); //Adding components to the Content Pane\n contentPane.setLayout(null); //sets the layout manager as null\n\n JLabel lblUsername = new JLabel(\"Username\"); // Creates a label with default value Username\n lblUsername.setBounds(91, 14, 66, 14); // sets the label size and location\n contentPane.add(lblUsername); // Adds the label to the content pane\n\n JLabel lblEmail = new JLabel(\"Email\"); // Creates a label with default value Email\n lblEmail.setBounds(91, 39, 66, 14); // sets the label size and location\n contentPane.add(lblEmail); // Adds the label to the content pane\n\n JLabel lblPassword = new JLabel(\"Password\"); // Creates a label with default value Password\n lblPassword.setBounds(91, 64, 66, 14); // sets the label size and location\n contentPane.add(lblPassword); // Adds the label to the content pane\n\n txtLogin = new JTextField(); // creates empty Login text field\n txtLogin.setBounds(179, 11, 120, 20); //Defines the text field size and location\n contentPane.add(txtLogin); // Adds the dreated email text field to the contentpane\n txtLogin.setColumns(10); // creates JTextField with default number of columns\n\n txtEmail = new JTextField();// creates empty email text field \n txtEmail.setBounds(179, 36, 120, 20); //Defines the text field size and location\n contentPane.add(txtEmail); // Adds the dreated email text field to the contentpane\n txtLogin.setColumns(10); // creates JTextField with default number of columns\n\n passwordField = new JPasswordField(); // create empty password field\n passwordField.setToolTipText(\"\"); // shows nothing when you hover curser over the password field\n passwordField.setBounds(179, 61, 120, 20); // Defines the password field size and location\n contentPane.add(passwordField); // Adds the password field to the Content Pane\n\n JLabel lblConfirmPassword = new JLabel(\"Confirm Password\"); // Creates a label with default value Confirm Password\n lblConfirmPassword.setBounds(65, 95, 108, 14); // sets the label size and location\n contentPane.add(lblConfirmPassword); // Adds the label to the content pane\n\n // add new user and password to txt file \n JButton btnSignUp = new JButton(\"Sign Up\"); // Creates Sign Up button and gives it default name Sign Up\n btnSignUp.addActionListener(new ActionListener() {//Adds onClick listener to the button\n public void actionPerformed(ActionEvent arg0) { // method called when the button is clicked\n\n FileWriter fw; // create variable for the FileWriter which writes to the file\n //catch for empty unfilled textfields\n if (!txtLogin.getText().isEmpty() || !passwordField.getText().isEmpty() || !confirmPasswordField.getText().isEmpty() || !txtEmail.getText().isEmpty()) {\n if (passwordField.getText().equals(confirmPasswordField.getText())) {\n Pattern p = Pattern.compile(\"^[_A-Za-z0-9-\\\\+]+(\\\\.[_A-Za-z0-9-]+)*@\"\n + \"[A-Za-z0-9-]+(\\\\.[A-Za-z0-9]+)*(\\\\.[A-Za-z]{2,})$\"); // Rejex which checks for a valid email address\n Matcher m = p.matcher(txtEmail.getText()); //Tries to match the input email to check whether it is a valid email coapturing all required aspects\n\n if (m.find()) { // when mathcer finds the email valid proceed below\n try {\n fw = new FileWriter(\"src//SandwichShop//users.txt\", true); // Assign the FileWriter fw to a file\n fw.write(txtLogin.getText() + \" \" + passwordField.getText() + \" \" + txtEmail.getText() + \" \\r\\n\"); // Write user details to the file\n fw.close(); //close the FileWriter\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n JOptionPane.showMessageDialog(null, \"Registration completed successfully!\");\n } else {\n JOptionPane.showMessageDialog(null, \"Enter correct E-mail, please.\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"\\\"Password\\\" field and \\\"Confirm Password\\\" field not match\");\n }\n } else {\n JOptionPane.showMessageDialog(null, \"One or more fields are empty!\");\n }\n }\n });\n btnSignUp.setBounds(16, 125, 350, 23); // set size and location of the Sign Up button\n contentPane.add(btnSignUp); // Add the button to the content pane\n\n confirmPasswordField = new JPasswordField(); // create confirmPassword field\n confirmPasswordField.setToolTipText(\"\"); // shows nothing when you hover curser over the password field\n confirmPasswordField.setBounds(179, 92, 120, 20); // set size and location of the password field\n contentPane.add(confirmPasswordField); // add the confirm password field to the content pane\n }",
"private void signup() {\n\t\tSignupFragment newFragment = new SignupFragment();\t\t\t\t\t\n\t\t\n\t\t// if the username doesn't exist, load the signup fragment\n\t\tFragmentTransaction transaction = getActivity().getSupportFragmentManager().beginTransaction();\n\n\t\t// Replace whatever is in the fragment_container view with this fragment,\n\t\t// and add the transaction to the back stack so the user can navigate back\n\t\ttransaction.replace(R.id.fragment_container, newFragment);\n\t\ttransaction.addToBackStack(null);\n\n\t\t// Commit the transaction\n\t\ttransaction.commit();\n\t}",
"public static RegisterIntraUserFragment newInstance() {\n RegisterIntraUserFragment f = new RegisterIntraUserFragment();\n Bundle b = new Bundle();\n //b.putInt(ARG_POSITION, position);\n f.setArguments(b);\n //f.setContactName(intraUserSubAppSession.getIntraUserModuleManager());\n return f;\n }",
"public RegisterUserBean() {\n this.account.setGender(Boolean.TRUE);\n this.roleID = 5;\n }",
"private void registerUser(){\n mAuth.createUserWithEmailAndPassword(correo, password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //mapa de valores\n Map<String, Object> map = new HashMap<>();\n map.put(\"name\",name);\n map.put(\"email\",correo);\n map.put(\"password\",password);\n map.put(\"birthday\",cumple);\n map.put(\"genre\",genre);\n map.put(\"size\",size);\n //obtenemos el id asignado por la firebase\n String id= mAuth.getCurrentUser().getUid();\n //pasamos el mapa de valores\n mDatabase.child(\"Users\").child(id).setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task2) {\n //validams que la tarea sea exitosa\n if(task2.isSuccessful()){\n startActivity(new Intent(DatosIniciales.this, MainActivity.class));\n //evitamos que vuelva a la pantalla con finsh cuando ya se ha registrado\n finish();\n }else{\n Toast.makeText(DatosIniciales.this, \"Algo fallo ups!!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }else{\n Toast.makeText(DatosIniciales.this, \"No pudimos completar su registro\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"private void registration() {\n\t\tif (ur_name.getText().length() > 0 && email.getText().length() > 0\r\n\t\t\t\t&& pass.getText().length() > 0\r\n\t\t\t\t&& re_pass.getText().length() > 0) {\r\n\t\t\tif (pass.getText().toString()\r\n\t\t\t\t\t.equalsIgnoreCase(re_pass.getText().toString())) {\r\n\t\t\t\tString postEntity = \"user_name=\" + ur_name.getText().toString()\r\n\t\t\t\t\t\t+ \"&email=\" + email.getText().toString() + \"&password=\"\r\n\t\t\t\t\t\t+ pass.getText().toString() + \"&gcm_id=\"\r\n\t\t\t\t\t\t+ GlobalDeclares.getGcmId();\r\n\t\t\t\tnew ServerUtilities(getApplicationContext(),\r\n\t\t\t\t\t\tGlobalDeclares.NEW_REGISTRATION, postEntity, delegate);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\t\"Password does not match!\", Toast.LENGTH_LONG).show();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\tToast.makeText(getApplicationContext(),\r\n\t\t\t\t\t\"You need to fill all the fields!\", Toast.LENGTH_LONG)\r\n\t\t\t\t\t.show();\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_register);\n\t\t\n//\t\tcontext = getApplicationContext();\n//\t\tdbHelper = new MyDBHelper(getApplicationContext());\n\t\tetUsername = (EditText) findViewById(R.id.username);\n\t\tetPassword = (EditText) findViewById(R.id.password);\n\t\tetPassword1 = (EditText) findViewById(R.id.password1);\n\t\tbtnRegister = (Button) findViewById(R.id.btnregister);\n\t\tbtnRegister.setOnClickListener(new OnClickListener() {\n\t\t\t\n\t\t\t@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tString username = etUsername.getText().toString();\n\t\t\t\tString pwd = etPassword.getText().toString();\n\t\t\t\tString pwd1 = etPassword1.getText().toString();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (TextUtils.isEmpty(etUsername.getText())) {\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Username cannot be empty!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(TextUtils.isEmpty(etPassword.getText()) || TextUtils.isEmpty(etPassword1.getText())){\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Password cannot be empty!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!pwd.equals(pwd1)){\n\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Password should be the same!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tUser user = new User(username, pwd);\n\t\t\t\t\n\t\t\t\tnew Register(user, RegisterActivity.this, new Register.SuccessCallBack() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onSuccess() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this,\"Sign up successfully!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\tstartActivity(new Intent(RegisterActivity.this, LoginActivity.class));\n\t\t\t\t\t}\n\t\t\t\t}, new Register.FailCallBack() {\n\t\t\t\t\t\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onFail() {\n\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\tToast.makeText(RegisterActivity.this, \"Username already exists!\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_signup);\r\n\r\n\t\t// ENETER BUTTON : Match both the password fields\r\n\t\tButton enterButton = (Button) findViewById(R.id.SignUp_ButtonEnter);\r\n\t\tenterButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tfinal EditText emailField = (EditText) findViewById(R.id.SignUp_EditTextEmail);\r\n\t\t\t\tString mail_ID = emailField.getText().toString();\r\n\t\t\t\t\r\n\t\t\t\tif (mail_ID.length() == 0) {\r\n\r\n\t\t\t\t\tAlertDialog.Builder alertDialog = new AlertDialog.Builder(\r\n\t\t\t\t\t\t\tSignUpActivity.this);\r\n\t\t\t\t\talertDialog.setTitle(\" User Alert !\");\r\n\t\t\t\t\talertDialog\r\n\t\t\t\t\t\t\t.setMessage(\"Please Enter Valid Username!!!\");\r\n\t\t\t\t\talertDialog.setPositiveButton(\"OK\",\r\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\tint id) {\r\n\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\talertDialog.show();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (scm.isConnected()) {\r\n\t\t\t\t\t((Button) findViewById(R.id.SignUp_ButtonEnter)).setEnabled(false);\r\n\t\t\t\t\tscm.CreateNewUser(mail_ID);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tAlertDialog.Builder alertDialog = new AlertDialog.Builder(\r\n\t\t\t\t\t\t\tSignUpActivity.this);\r\n\t\t\t\t\talertDialog.setTitle(\" User Alert !\");\r\n\t\t\t\t\talertDialog\r\n\t\t\t\t\t\t\t.setMessage(\"Sorry, Not connect to server yet.\");\r\n\t\t\t\t\talertDialog.setPositiveButton(\"OK\",\r\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\t\t\t\tpublic void onClick(DialogInterface dialog,\r\n\t\t\t\t\t\t\t\t\t\tint id) {\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\talertDialog.show();\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// CANCEL BUTTON : Finish the Current Activity\r\n\t\tButton cancelButton = (Button) findViewById(R.id.SignUp_ButtonCancel);\r\n\t\tcancelButton.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\tIntent intent = new Intent();\r\n\t\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n\t\t\t\tfinish();\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// TODO Auto-generated method stub\r\n\t}",
"@Override\n\t public Dialog onCreateDialog(Bundle savedInstanceState) {\n\t AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\t \n\t \n\t \n\t LayoutInflater inflater = getActivity().getLayoutInflater();\n\t \n\t final View inflator = inflater.inflate(R.layout.dialog_signin, null);\n\t \n\t \n\t \n\t builder.setView(inflator)\n\t \n\t \n\t .setPositiveButton(\"Set\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t \t EditText username = (EditText) inflator.findViewById(R.id.username);\n\t \t String str = username.getText().toString();\n\t System.out.println(str);\n\t mEditText.setText(str);\n\t }\n\t })\n\t .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t // User cancelled the dialog\n\t }\n\t });\n\t // Create the AlertDialog object and return it\n\t return builder.create();\n\t }",
"public RegisterPanel() {\n initComponents();\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n database = new DatabaseProcessor(this.getContext());\n view = inflater.inflate(R.layout.fragment_user_registration, container, false);\n txtusername = view.findViewById(R.id.txtusername);\n txtpassword = view.findViewById(R.id.txtpassword);\n btnregister = view.findViewById(R.id.btnRegister);\n FCMdatabase = FirebaseDatabase.getInstance().getReference(\"ResidentsLogin\");\n\n btnregister.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n// SharedPreferences preferences = getActivity().getSharedPreferences(\"userdata\", getActivity().MODE_PRIVATE);\n// SharedPreferences.Editor editor = preferences.edit();\n//\n// editor.putString(\"username\", txtusername.getText().toString());\n// editor.putString(\"password\", txtpassword.getText().toString());\n// editor.commit();\n// database.registerUser(txtusername.getText().toString(), txtpassword.getText().toString());\n\n String Id = FCMdatabase.push().getKey();\n residentUser user = new residentUser(Id.toString(), txtusername.getText().toString(), txtpassword.getText().toString(), \"\");\n FCMdatabase.child(Id).setValue(user);\n Toast.makeText(getContext(), \"user added successfully\", Toast.LENGTH_SHORT).show();\n }\n });\n return view;\n }",
"@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_register, null);\n\n // Guarda los view para obtener los datos ingresados por el usuario posteriormente\n mEditEmail = (EditText) view.findViewById(R.id.et_email);\n mEditFirstName = (EditText) view.findViewById(R.id.et_firstName);\n mEditLastName = (EditText) view.findViewById(R.id.et_lastName);\n mEditPassword = (EditText) view.findViewById(R.id.et_password);\n mEditPasswordConfirm = (EditText) view.findViewById(R.id.et_confirmPassword);\n\n // Obtiene el botón de register y le asigna un evento\n view.findViewById(R.id.register_button).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n attemptRegister();\n }\n });\n\n // Obtiene el botón de login y le asigna un evento\n view.findViewById(R.id.login_button).setOnClickListener(new View.OnClickListener() {\n\n @Override\n public void onClick(View v) {\n showLoginScreen();\n }\n });\n return view;\n }",
"private void usernameTakenDialog() {\n Dialog dialog = new Dialog(\"Username taken\", cloudSkin, \"dialog\") {\n public void result(Object obj) {\n System.out.println(\"result \" + obj);\n }\n };\n dialog.text(\"This username has already been taken, try a new one.\");\n dialog.button(\"OK\", true);\n dialog.show(stage);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_user_sign_up);\n register();\n onPressHideKeyboard(chooseName);\n onPressHideKeyboard(choosePw);\n onPressHideKeyboard(confirmPw);\n }",
"public AddUser(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n setTitle(\"Add User\");\n }",
"private void signUpEvt() {\n String emailRegex = \"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\\\"(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21\\\\x23-\\\\x5b\\\\x5d-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])*\\\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\\\x01-\\\\x08\\\\x0b\\\\x0c\\\\x0e-\\\\x1f\\\\x21-\\\\x5a\\\\x53-\\\\x7f]|\\\\\\\\[\\\\x01-\\\\x09\\\\x0b\\\\x0c\\\\x0e-\\\\x7f])+)\\\\])\";\n // Get User Details\n String fullname = this.view.getWelcomePanel().getSignUpPanel().getFullnameText().getText().trim();\n String email = this.view.getWelcomePanel().getSignUpPanel().getEmailText().getText().trim();\n String password = new String(this.view.getWelcomePanel().getSignUpPanel().getPasswordText().getPassword()).trim();\n\n if (!fullname.equals(\"\") && !email.equals(\"\") && !password.equals(\"\")) {\n if (email.matches(emailRegex)) {\n if (model.getSudokuDB().registerUser(fullname, email, password)) {\n view.getWelcomePanel().getCardLayoutManager().next(view.getWelcomePanel().getSlider());\n // Clear Fields\n view.getWelcomePanel().getSignUpPanel().clear();\n Object[] options = {\"OK\"};\n JOptionPane.showOptionDialog(this, \"Your registration was successful!\\n You can now sign in to your account.\", \"Successful Registration\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n } else {\n Object[] options = {\"Let me try again\"};\n JOptionPane.showOptionDialog(this, \"Your registration was unsuccessful!\\nBe sure not to create a duplicate account.\", \"Unsuccessful Registration\", JOptionPane.OK_OPTION, JOptionPane.ERROR_MESSAGE, null, options, null);\n }\n } else {\n // Email doesn't meet requirement\n Object[] options = {\"I will correct that\"};\n JOptionPane.showOptionDialog(this, \"You must provide a valid email address.\", \"Invalid Email Address\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n } else {\n // Empty Fields\n Object[] options = {\"Alright\"};\n JOptionPane.showOptionDialog(this, \"In order to register, all fields must be filled out.\", \"Empty Fields\", JOptionPane.OK_OPTION, JOptionPane.INFORMATION_MESSAGE, null, options, null);\n }\n }"
] | [
"0.7563506",
"0.7013281",
"0.67434895",
"0.67171204",
"0.6682857",
"0.6677901",
"0.66539884",
"0.6643458",
"0.6643458",
"0.6634497",
"0.6588261",
"0.6559797",
"0.65515095",
"0.6522124",
"0.6474111",
"0.6410833",
"0.64007133",
"0.63993776",
"0.63679034",
"0.63653797",
"0.634828",
"0.63444585",
"0.6325055",
"0.6322896",
"0.6314668",
"0.62559974",
"0.62559974",
"0.62559974",
"0.62517005",
"0.6243067",
"0.6237161",
"0.62298626",
"0.62298626",
"0.62298626",
"0.6226952",
"0.6223644",
"0.6210232",
"0.619752",
"0.6188139",
"0.6154694",
"0.6154424",
"0.611482",
"0.6110678",
"0.6109505",
"0.6103521",
"0.60816616",
"0.6070866",
"0.6062607",
"0.6058695",
"0.60462147",
"0.60440797",
"0.6037285",
"0.60325116",
"0.60236496",
"0.6019992",
"0.60024554",
"0.5999619",
"0.5983859",
"0.59834355",
"0.59797114",
"0.59673035",
"0.5963411",
"0.596194",
"0.596162",
"0.595393",
"0.5944914",
"0.5943817",
"0.5931342",
"0.5918741",
"0.590984",
"0.5905361",
"0.59051305",
"0.59032387",
"0.59030473",
"0.5901053",
"0.5899399",
"0.58920574",
"0.5890836",
"0.58896226",
"0.58813524",
"0.5874451",
"0.5867963",
"0.58678263",
"0.5863626",
"0.5861184",
"0.5851967",
"0.5846333",
"0.5844854",
"0.5836738",
"0.5811011",
"0.5809317",
"0.5807446",
"0.5806497",
"0.57970333",
"0.57942",
"0.5785196",
"0.57843953",
"0.5775996",
"0.57621455",
"0.575964"
] | 0.69036347 | 2 |
Instantiates a new user dialog. | public UserDialog(JFrame parent){
super(parent, "New user");
add(new JPanel(), BorderLayout.NORTH);
add(new UserDatapanel(),BorderLayout.CENTER);
add(getButtonPanel(),BorderLayout.SOUTH);
setSize(500,300);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Dialog() {\n\t}",
"public void dialogoAgregarUsuario() {\n vAgregarUsuario = new V_AgregarUsuario(new JFrame(), true);\n vAgregarUsuario.setVisible(true);\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),\n R.style.RedButtonAlertDialog);\n\n builder.setTitle(\"Add new profile\").setView(R.layout.dialog_add_player)\n .setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n EditText profileNameEditText =\n (EditText) getDialog().findViewById(R.id.add_player_edit_text);\n String name = profileNameEditText.getText().toString();\n DartLogDatabaseHelper dbHelper = new DartLogDatabaseHelper(getContext());\n dbHelper.addPlayer(name);\n getProfilesAdapter().updateDataSetFromDatabase();\n }\n })\n .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n LayoutInflater inflater = getActivity().getLayoutInflater();\n\n\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(\"CREA USUARIO\")\n .setView(inflater.inflate(R.layout.register_dialog, null))\n .setPositiveButton(\"OK\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n editUser = ((AlertDialog) dialog).findViewById(R.id.username);\n editPass = ((AlertDialog) dialog).findViewById(R.id.password);\n startConexion();\n }\n })\n .setNegativeButton(\"CANCEL\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // User cancelled the dialog\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"private void usernameTakenDialog() {\n Dialog dialog = new Dialog(\"Username taken\", cloudSkin, \"dialog\") {\n public void result(Object obj) {\n System.out.println(\"result \" + obj);\n }\n };\n dialog.text(\"This username has already been taken, try a new one.\");\n dialog.button(\"OK\", true);\n dialog.show(stage);\n }",
"@Override\n\t public Dialog onCreateDialog(Bundle savedInstanceState) {\n\t AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\t \n\t \n\t \n\t LayoutInflater inflater = getActivity().getLayoutInflater();\n\t \n\t final View inflator = inflater.inflate(R.layout.dialog_signin, null);\n\t \n\t \n\t \n\t builder.setView(inflator)\n\t \n\t \n\t .setPositiveButton(\"Set\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t \t EditText username = (EditText) inflator.findViewById(R.id.username);\n\t \t String str = username.getText().toString();\n\t System.out.println(str);\n\t mEditText.setText(str);\n\t }\n\t })\n\t .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n\t public void onClick(DialogInterface dialog, int id) {\n\t // User cancelled the dialog\n\t }\n\t });\n\t // Create the AlertDialog object and return it\n\t return builder.create();\n\t }",
"public StandardDialog() {\n super();\n init();\n }",
"private void showDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"User created successfully\");\n builder.setIcon(R.drawable.ic_shield);\n builder.setCancelable(true);\n builder.setPositiveButton(\n \"Continue\",\n new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n finish();\n }\n });\n AlertDialog alert11 = builder.create();\n alert11.show();\n Window window = alert11.getWindow();\n assert window != null;\n WindowManager.LayoutParams wlp = window.getAttributes();\n wlp.gravity = Gravity.CENTER;\n wlp.y = 270;\n wlp.flags &= ~WindowManager.LayoutParams.FLAG_DIM_BEHIND;\n window.setAttributes(wlp);\n }",
"public Dialog createAddPersonDialog(String title, String msg) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getMyAcitivty());\n builder.setTitle(title);\n builder.setMessage(msg);\n\n // Use an EditText view to get user input.\n final EditText input = new EditText(getMyAcitivty());\n input.setText(\"\");\n builder.setView(input);\n\n builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int whichButton) {\n String value = input.getText().toString();\n Log.d(TAG, \"user input: \" + value);\n inputDialogResult = value;\n launchTrainingActivity();\n// AlertDialog dg =\n// SelectServerAlertDialog.createDialog(\n// getContext(),\n// \"Pick a Server\",\n// getAllIps(),\n// launchTrainingActivityAction,\n// cancelAction,\n// true);\n// dg.show();\n }\n });\n builder.setNegativeButton(\"Cancel\", SelectServerAlertDialog.cancelAction);\n return builder.create();\n }",
"public void register_user(View view) {\n CustomRestaurantTypeDialog customRestaurantTypeDialog = new CustomRestaurantTypeDialog();\n customRestaurantTypeDialog.show(getSupportFragmentManager(), \"testing\");\n }",
"public NewUser() {\n initComponents();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(\"Done entering class?\")\n .setPositiveButton(\"yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n })\n .setNegativeButton(\"no\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Intent tmp = new Intent(getContext(), course_info.class);\n startActivity(tmp);\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"private void initDialog() {\n }",
"public void showUserDefinedInputCreateDialog() {\r\n FXMLLoader loader = fxmlLoaderService.getLoader(getClass().getResource(FXML_USER_DEFINED_INPUT_CREATE_DIALOG));\r\n\r\n Parent page;\r\n\r\n try {\r\n page = loader.load();\r\n } catch (IOException ex) {\r\n logger.warn(\"Failed to load: \" + FXML_USER_DEFINED_INPUT_CREATE_DIALOG, ex);\r\n\r\n return;\r\n }\r\n\r\n // set the stage\r\n Stage stage = new Stage();\r\n stage.setTitle(\"Create Custom Input\");\r\n stage.initModality(Modality.APPLICATION_MODAL);\r\n stage.centerOnScreen();\r\n stage.initOwner(mainStage);\r\n\r\n Scene scene = new Scene(page);\r\n scene.getStylesheets().add(getClass().getResource(STYLESHEET_DEFAULT).toExternalForm());\r\n\r\n stage.setScene(scene);\r\n\r\n // Set the item into the controller.\r\n UserDefinedInputCreateDialogController controller = loader.getController();\r\n controller.setStage(stage);\r\n\r\n stage.showAndWait();\r\n }",
"private void initDialog() {\n Window subWindow = new Window(\"Sub-window\");\n \n FormLayout nameLayout = new FormLayout();\n TextField code = new TextField(\"Code\");\n code.setPlaceholder(\"Code\");\n \n TextField description = new TextField(\"Description\");\n description.setPlaceholder(\"Description\");\n \n Button confirm = new Button(\"Save\");\n confirm.addClickListener(listener -> insertRole(code.getValue(), description.getValue()));\n\n nameLayout.addComponent(code);\n nameLayout.addComponent(description);\n nameLayout.addComponent(confirm);\n \n subWindow.setContent(nameLayout);\n \n // Center it in the browser window\n subWindow.center();\n\n // Open it in the UI\n UI.getCurrent().addWindow(subWindow);\n\t}",
"public abstract Dialog createDialog(DialogDescriptor descriptor);",
"public void newuserclicked(View view) {\n Intent myuserIntent = new Intent(this, UserCreation.class);\n startActivity(myuserIntent);\n }",
"private void createForumDialog() {\n AlertDialog.Builder dialog = new AlertDialog.Builder(Objects.requireNonNull(this),\n R.style.AlertDialogTheme);\n dialog.setTitle(R.string.add_new_forum_title);\n dialog.setMessage(R.string.add_new_forum_description);\n\n View newForumDialog = getLayoutInflater().inflate(R.layout.new_forum_dialog, null);\n dialog.setView(newForumDialog);\n\n AlertDialog alertDialog = dialog.create();\n setAddForumButtonListener(alertDialog, newForumDialog);\n\n alertDialog.show();\n }",
"@Override\r\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n \r\n LayoutInflater inflater = getActivity().getLayoutInflater();\r\n builder.setTitle(\"New Wallet\");\r\n \r\n\t final View view = inflater.inflate(R.layout.new_wallet_dialog, null);\r\n\t \r\n\t final EditText name = (EditText) view.findViewById(R.id.newWallet_text);\r\n\t \r\n builder.setPositiveButton(R.string.confirmRecord, new DialogInterface.OnClickListener() {\r\n \r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.comfirmPressed(name.getText().toString());\t\r\n \t\t}\r\n });\r\n builder.setNegativeButton(R.string.cancelRecord, new DialogInterface.OnClickListener() {\r\n \tpublic void onClick(DialogInterface dialog, int id) {\r\n \t\tlistener.cancelPressed();\r\n \t\t}\r\n \t});\r\n // Create the AlertDialog object and return it\r\n return builder.create();\r\n }",
"private void openCreateAccountDialog()\n {\n testDialog();\n\n }",
"public RegisterUserDialog(Admin admin) { \n\t\tthis.admin = admin;\n\t\tUserDialog dialog = new UserDialog(this);\n\t\tsetLayout(new FlowLayout()); \n\t\tpack();\n\t\t// Set window location in middle of screen\n\t\tdialog.setLocationRelativeTo(null);\n\t\t// Display window\n\t\tdialog.setVisible(true);\n\t }",
"private void openUserManagementWindow() {\r\n\t\tnew JFrameUser();\r\n\t}",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n builder.setTitle(\"Add Participant...\");\n builder.setMessage(\"Participant address:\");\n\n final EditText input = new EditText(getActivity());\n LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(\n LinearLayout.LayoutParams.MATCH_PARENT,\n LinearLayout.LayoutParams.MATCH_PARENT);\n input.setLayoutParams(lp);\n builder.setView(input); // uncomment this line\n\n\n builder.setPositiveButton(\"Add\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n mListener.onAddUserDialogAdd(input.getText().toString());\n }\n })\n .setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n mListener.onAddUserDialogCancel();\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n // Use the Builder class for convenient dialog construction\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(R.string.title_add_to_shopping);\n\n // initialize itemcreation\n m_createItemDlg = new CreateItemDialog(this);\n\n // create item selection\n builder.setView(createItemSelection());\n\n // set buttonss\n builder.setPositiveButton(R.string.button_add, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n if(m_callback != null) {\n m_callback.readAddToShoppingDlgAndUpdate();\n }\n }\n });\n builder.setNegativeButton(R.string.button_cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) { }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"public Dialog onCreateDialog(Bundle savedInstanceState){\n AlertDialog.Builder sample_builder = new AlertDialog.Builder(getActivity());\n sample_builder.setView(\"activity_main\");\n sample_builder.setMessage(\"This is a sample prompt. No new networks should be scanned while this prompt is up\");\n sample_builder.setCancelable(true);\n sample_builder.setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n listener.onDialogPositiveClick(StationFragment.this);\n }\n });\n sample_builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialogInterface, int i) {\n listener.onDialogNegativeClick(StationFragment.this);\n }\n });\n return sample_builder.create();\n\n }",
"private Dialogs () {\r\n\t}",
"public static createNewUser newInstance() {\n createNewUser fragment = new createNewUser();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public abstract void initDialog();",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n String mess = \"The user your trying to connect to does not have a name set\";\n if(getArguments().getBoolean(\"me\"))\n {\n mess = \"Someone tried to connect to you for a game but you dont have a name set\";\n }\n builder.setMessage(mess)\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // FIRE ZE MISSILES!\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"public static EditProfileDialogue newInstance(){\n EditProfileDialogue dialogue = new EditProfileDialogue();\n\n Log.d(TAG, \"newInstance: NO ARGUMENTS because we are creating new profile.\" );\n return dialogue;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(R.string.dialog_fire_missiles)\n .setPositiveButton(R.string.fire, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n }\n });\n return builder.create();\n }",
"void makeDialog()\n\t{\n\t\tfDialog = new ViewOptionsDialog(this.getTopLevelAncestor());\n\t}",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n setRetainInstance(true);\n\n Dialog dialog = new Dialog(getContext(), R.style.DialogTheme);\n dialog.setContentView(R.layout.add_student_feedback_dialog);\n\n return dialog;\n }",
"private void initDialog() {\n dialog = new Dialog(context);\n dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);\n dialog.setContentView(R.layout.dialog_custom_ok);\n }",
"@Override\n\tprotected Dialog onCreateDialog(int id) {\n\t\treturn buildDialog(MainActivity.this);\n\t\t\n\t}",
"public FiltroGirosDialog() {\n \n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = requireActivity().getLayoutInflater();\n final View view = inflater.inflate(R.layout.on_click_dialog, null);\n builder.setView(view);\n\n\n\n\n\n\n\n\n return builder.create();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n return mDialog;\n }",
"@Override\n\t\tpublic Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\t\treturn mDialog;\n\t\t}",
"public Dialog<String> createDialog() {\n\t\t// Creating a dialog\n\t\tDialog<String> dialog = new Dialog<String>();\n\n\t\tButtonType type = new ButtonType(\"Ok\", ButtonData.OK_DONE);\n\t\tdialog.getDialogPane().getButtonTypes().add(type);\n\t\treturn dialog;\n\t}",
"@Override\n\tprotected Dialog onCreateDialog(int id)\n\t{\n\t\tsuper.onCreateDialog(id);\n\t\treturn visitor.instantiateDialog(id);\n\t}",
"public DialogManager() {\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n return mDialog;\n }",
"public void addRelationshipDialog() { new RelationshipDialog(); }",
"protected abstract JDialog createDialog();",
"protected Dialog onCreateDialog(int id) {\n if (id == 1) {\n AlertDialog.Builder adb = new AlertDialog.Builder(this);\n // заголовок\n adb.setTitle(\"PIN Removed\");\n // сообщение\n adb.setMessage(\"There will be no PIN entry screen when Application starts up.\");\n // иконка\n adb.setIcon(android.R.drawable.ic_dialog_info);\n adb.setNeutralButton(\"Ok\", myClickListener);\n // создаем диалог\n return adb.create();\n }\n return super.onCreateDialog(id);\n }",
"@Override\n\t\tpublic final Dialog onCreateDialog(final Bundle savedInstanceState) {\n\t\t\tint title = getArguments().getInt(\"title\");\n\n\t\t\treturn new AlertDialog.Builder(getActivity())\n\t\t\t\t\t.setIcon(R.drawable.alert_dialog_icon)\n\t\t\t\t\t.setTitle(title)\n\t\t\t\t\t.setPositiveButton(R.string.alert_dialog_ok,\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\tfinal DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tfinal int whichButton) {\n\t\t\t\t\t\t\t\t\t((AddingActivity) getActivity())\n\t\t\t\t\t\t\t\t\t\t\t.doPositiveClick();\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t.setNegativeButton(R.string.alert_dialog_cancel,\n\t\t\t\t\t\t\tnew DialogInterface.OnClickListener() {\n\t\t\t\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\t\t\t\tfinal DialogInterface dialog,\n\t\t\t\t\t\t\t\t\t\tfinal int whichButton) {\n\t\t\t\t\t\t\t\t\t((AddingActivity) getActivity())\n\t\t\t\t\t\t\t\t\t\t\t.doNegativeClick();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}).create();\n\t\t}",
"public UserForm(){ }",
"@Override\n protected Dialog onCreateDialog(int id) {\n Dialog dialog = null;\n switch (id) {\n case CHOOSE_METHOD_DIALOG:\n return chooseActionContextMenu.createMenu(this.getString(R.string.choose_action_title));\n case ABOUT_DIALOG:\n dialog = createAboutDialog();\n break;\n default:\n dialog = null;\n break;\n }\n return dialog;\n }",
"@FXML\n private void openCreateUser(ActionEvent event) {\n CreateUserController createusercontroller = new CreateUserController();\n User user = createusercontroller.openCreateUser(event, roleTap);\n\n if (user != null) {\n userList.add(user);\n UsermanagementUtilities.setFeedback(event, user.getName().getFirstName()+LanguageHandler.getText(\"userCreated\"), true);\n } else {\n UsermanagementUtilities.setFeedback(event, LanguageHandler.getText(\"userNotCreated\"), false);\n\n }\n }",
"private void creatDialog() {\n \t mDialog=new ProgressDialog(this);\n \t mDialog.setTitle(\"\");\n \t mDialog.setMessage(\"正在加载请稍后\");\n \t mDialog.setIndeterminate(true);\n \t mDialog.setCancelable(true);\n \t mDialog.show();\n \n\t}",
"@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tprogress = UserCenterDialog.onCreateDialog(this);\r\n\t\tcontext = this;\r\n\t\tshellRW = new RWSharedPreferences(context, \"addInfo\");\r\n\t\tinitDialog(NoticeActivityGroup.LOTNO);\r\n\t}",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(getArguments().getString(\"title\"))\n .setMessage(getArguments().getString(\"message\"))\n .setCancelable(false)\n .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // FIRE ZE MISSILES!\n // call callback method\n // mListener.onInfoDialogOKClick(InfoDialog.this);\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"private Dialog recreateDialog() {\n final AlertDialog.Builder builder = new AlertDialog.Builder(OptionActivity.this);\n builder.setMessage(\"Do you want to change your profile?\")\n .setPositiveButton(\"Yah!\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Intent intent = new Intent(OptionActivity.this, amountscreen.class);\n startActivity(intent);\n }\n })\n .setNegativeButton(\"Nope\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"public Dialog(String text) {\n initComponents( text);\n }",
"private void initializeUserInput(final String operation) {\n\n mDialogUserInput = new Dialog(this);\n mDialogUserInput.getWindow().requestFeature(Window.FEATURE_NO_TITLE);\n LayoutInflater inflaterUser = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n mDialogUserInput.setContentView(inflaterUser.inflate(R.layout.dialog_user_input, null));\n mDialogUserInput.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));\n\n mEditTextUserInput = mDialogUserInput.findViewById(R.id.user_input_tv);\n mEditTextUserInputTitle = mDialogUserInput.findViewById(R.id.user_input_title_tv);\n TextView mTextViewOk = mDialogUserInput.findViewById(R.id.profile_ok);\n\n if (operation.equals(Constants.UPDATE_API)) {\n mEditTextUserInputTitle.setHint(getResources().getString(R.string.enter_title));\n } else if (operation.equals(Constants.CREATE_API)) {\n mEditTextUserInputTitle.setHint(getResources().getString(R.string.enter_extension));\n }\n\n if (operation.equals(Constants.UPDATE_API) || operation.equals(Constants.CREATE_API)) {\n mEditTextUserInputTitle.setVisibility(View.VISIBLE);\n } else {\n mEditTextUserInputTitle.setVisibility(View.GONE);\n }\n\n mTextViewOk.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n mDialogUserInput.dismiss();\n dialog.setMessage(\"Calling \" + operation + \" API.\");\n dialog.show();\n\n switch (operation) {\n case Constants.CREATE_API:\n if (!mEditTextUserInput.getText().toString().isEmpty() || !mEditTextUserInputTitle.getText().toString().isEmpty()) {\n\n Map<String, String> version = new HashMap<>();\n version.put(CreateVersionParams.CROPPING, CroppingParams.C_FIT);\n\n mPublitio.versions().createVersion(mEditTextUserInput.getText().toString(), mEditTextUserInputTitle.getText().toString(), version, new PublitioCallback<JsonObject>() {\n @Override\n public void success(JsonObject result) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(result.toString());\n dialog.dismiss();\n }\n\n @Override\n public void failure(String message) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(message);\n dialog.dismiss();\n }\n });\n } else {\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n Toast.makeText(VersionsActivity.this, R.string.extension_id, Toast.LENGTH_LONG).show();\n }\n break;\n\n case Constants.LIST_API:\n if (!mEditTextUserInput.getText().toString().isEmpty()) {\n\n Map<String, String> list = new HashMap<>();\n list.put(VersionsListParams.ORDER, OrderParams.NAME_ASC);\n\n mPublitio.versions().versionsList(mEditTextUserInput.getText().toString(), list, new PublitioCallback<JsonObject>() {\n @Override\n public void success(JsonObject result) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(result.toString());\n dialog.dismiss();\n }\n\n @Override\n public void failure(String message) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(message);\n dialog.dismiss();\n }\n });\n } else {\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n Toast.makeText(VersionsActivity.this, R.string.provide_id, Toast.LENGTH_LONG).show();\n }\n break;\n\n case Constants.SHOW_API:\n if (!mEditTextUserInput.getText().toString().isEmpty()) {\n\n mPublitio.versions().showVersion(mEditTextUserInput.getText().toString(), new PublitioCallback<JsonObject>() {\n @Override\n public void success(JsonObject result) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(result.toString());\n dialog.dismiss();\n }\n\n @Override\n public void failure(String message) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(message);\n dialog.dismiss();\n }\n });\n } else {\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n Toast.makeText(VersionsActivity.this, R.string.version_id, Toast.LENGTH_LONG).show();\n }\n break;\n\n case Constants.UPDATE_API:\n\n if (!mEditTextUserInput.getText().toString().isEmpty()) {\n mPublitio.versions().updateVersion(mEditTextUserInput.getText().toString(), new PublitioCallback<JsonObject>() {\n @Override\n public void success(JsonObject result) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(result.toString());\n dialog.dismiss();\n }\n\n @Override\n public void failure(String message) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(message);\n dialog.dismiss();\n }\n });\n } else {\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n Toast.makeText(VersionsActivity.this, R.string.version_id, Toast.LENGTH_LONG).show();\n }\n\n break;\n\n case Constants.DELETE_API:\n if (!mEditTextUserInput.getText().toString().isEmpty()) {\n mPublitio.versions().deleteVersion(mEditTextUserInput.getText().toString(), new PublitioCallback<JsonObject>() {\n @Override\n public void success(JsonObject result) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(result.toString());\n dialog.dismiss();\n }\n\n @Override\n public void failure(String message) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(message);\n dialog.dismiss();\n }\n });\n } else {\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n Toast.makeText(VersionsActivity.this, R.string.version_id, Toast.LENGTH_LONG).show();\n }\n\n break;\n\n case Constants.RECONVERT_API:\n\n if (!mEditTextUserInput.getText().toString().isEmpty()) {\n mPublitio.versions().reconvertVersion(mEditTextUserInput.getText().toString(), new PublitioCallback<JsonObject>() {\n @Override\n public void success(JsonObject result) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(result.toString());\n dialog.dismiss();\n }\n\n @Override\n public void failure(String message) {\n mTextViewResponse.setText(\"\");\n mTextViewResponse.setText(message);\n dialog.dismiss();\n }\n });\n } else {\n if (dialog.isShowing()) {\n dialog.dismiss();\n }\n Toast.makeText(VersionsActivity.this, R.string.version_id, Toast.LENGTH_LONG).show();\n }\n\n break;\n\n }\n }\n });\n\n mDialogUserInput.show();\n }",
"protected Dialog onCreateDialog (int id) {\n\t\tif (!this.hasWindowFocus())\r\n\t\t{\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdismissDialog (DIALOG_CREATE);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\r\n\t\t\t}\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tdismissDialog (DIALOG_SUBMIT);\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t\tAlertDialog.Builder bld = new AlertDialog.Builder(this);\r\n\t\tswitch (id){\r\n\t\tcase DIALOG_CREATE: \r\n\t\t{bld.setMessage(\"More than one call needs to be reported. Your most recent call is first.\").setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener()\r\n\t\t{\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\tdialog.dismiss();\r\n\t\t}\r\n\t\t}).setTitle(\"New Record\");\r\n\t\tbreak;\r\n\t\t}\r\n\t\tcase DIALOG_SUBMIT:\r\n\t\t{\r\n\t\t\tbld.setMessage(\"Please submit your previous call record now.\").setCancelable(false).setPositiveButton(\"OK\", new DialogInterface.OnClickListener()\r\n\t\t\t{\tpublic void onClick(DialogInterface dialog, int which) {\r\n\t\t\t\tdialog.dismiss();\r\n\t\t\t}\r\n\t\t\t}).setTitle(\"Older Record\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t}\r\n\t\treturn bld.create();\r\n\t}",
"private void createAndShowDialog(final String message, final String title) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity ());\n\n builder.setMessage(message);\n builder.setTitle(title);\n builder.create().show();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n setRetainInstance(true);\n\n Dialog dialog = new Dialog(getContext(), R.style.DialogTheme);\n dialog.setContentView(R.layout.add_sale_item_dialog);\n\n return dialog;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n filename = getArguments().getString(\"filename\");\n username = getArguments().getString(\"username\");\n workingDIR = getArguments().getString(\"workingDIR\");\n builder.setTitle(R.string.copy_move_file_select_options_title)\n .setItems(R.array.file__move_copy_dialog_options, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int which) {\n onSelect(which);\n }\n });\n return builder.create();\n }",
"public DialogPrompt(String title)\n {\n value = new PromptValueString(\"\",\"\");\n initUI(title,10);\n }",
"public static DialogBox getUserDialog(String text, Image img) {\n assert img != null : \"User profile image is null.\";\n var db = new DialogBox(text, img);\n return db;\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(this.m)\n .setPositiveButton(R.string.donesuccess, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // onFailure();\n onLoginFailed(m);\n }\n });\n return builder.create();\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(R.string.login_request)\n .setMessage(R.string.profile_setting_change_credentials)\n .setPositiveButton(R.string.login, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Log.d(TAG, \"positiveButtonClick\");\n EditPasswordActivity editPasswordActivity = (EditPasswordActivity) getActivity();\n if (editPasswordActivity != null) {\n editPasswordActivity.onDialogPositiveClick();\n }\n }\n })\n .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n Log.d(TAG, \"negativeButtonClick\");\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n builder.setMessage(msg)\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n return;\n }\n });\n\n Dialog dialog = builder.create();\n\n // Create the AlertDialog object and return it\n return dialog;\n }",
"@Override\r\n\tpublic Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n\r\n\t\t// Set up the layout inflater\r\n\t\tLayoutInflater inflater = getActivity().getLayoutInflater();\r\n\r\n\t\t// Set the title, message and layout of the dialog box\r\n\t\tbuilder.setView(inflater.inflate(R.layout.dialog_box_layout, null))\r\n\t\t\t\t.setTitle(R.string.dialog_title);\r\n\r\n\t\t// User accepts the thing in the dialog box\r\n\t\tbuilder.setPositiveButton(R.string.dialog_accpet,\r\n\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\r\n\t\t\t\t\t\tToast.makeText(getActivity(),\r\n\t\t\t\t\t\t\t\t\"Thank you for your kiss ^.^\",\r\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t// User cancels the thing in the dialog box\r\n\t\tbuilder.setNegativeButton(R.string.dialog_cancel,\r\n\t\t\t\tnew DialogInterface.OnClickListener() {\r\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int id) {\r\n\t\t\t\t\t\tToast.makeText(getActivity(), \"Refuse my kiss??? >.<\",\r\n\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\treturn builder.create(); // return the AlertDialog object\r\n\t}",
"protected void dialog() {\n TextInputDialog textInput = new TextInputDialog(\"\");\n textInput.setTitle(\"Text Input Dialog\");\n textInput.getDialogPane().setContentText(\"Nyt bord nr: \");\n textInput.showAndWait()\n .ifPresent(response -> {\n if (!response.isEmpty()) {\n newOrderbutton(response.toUpperCase());\n }\n });\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n String mess = \"They decliened your invitation\";\n if(getArguments().getBoolean(\"hostDeclined\"))\n {\n mess = \"They canceled their invitation\";\n }\n builder.setMessage(mess)\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // FIRE ZE MISSILES!\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(device.getName())\n \t\t.setTitle(R.string.bt_exchange_dialog_title)\n .setPositiveButton(R.string.bt_exchange_dialog_positive_btn, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n\n \t //Add BT Device Activity\n \t performBTKeyExchange(device);\n }\n })\n .setNegativeButton(R.string.bt_exchange_dialog_negative_btn, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // User cancelled the dialog\n \t dismiss();\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n protected Dialog onCreateDialog(int id) {\n switch (id) {\n // create a new TimePickerDialog with values you want to show\n case TIME_DIALOG_ID:\n return new TimePickerDialog(this, mTimeSetListener, mHour, mMinute, false);\n }\n return null;\n }",
"@SuppressLint(\"InflateParams\")\r\n\tprivate void showDialog() {\n\t\tLayoutInflater layoutInflater = LayoutInflater.from(getActivity());\r\n\t\tviewAddEmployee = layoutInflater\r\n\t\t\t\t.inflate(R.layout.activity_dialog, null);\r\n\t\teditText = (EditText) viewAddEmployee.findViewById(R.id.editText1);\r\n\t\ttv_phone = (TextView) viewAddEmployee.findViewById(R.id.tv_phone);\r\n\t\tbt_setting = (Button) viewAddEmployee.findViewById(R.id.bt_setting);\r\n\t\tbt_cancel = (Button) viewAddEmployee.findViewById(R.id.bt_cancel);\r\n\t\tString tel = SharePreferenceUtil.getInstance(\r\n\t\t\t\tgetActivity().getApplicationContext()).getUserTel();\r\n\t\ttv_phone.setText(StringUtils.getTelNum(tel));\r\n\r\n\t\tshowPop();\r\n\r\n\t\tbt_setting.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tString psd = SharePreferenceUtil.getInstance(\r\n\t\t\t\t\t\tgetActivity().getApplicationContext()).getUserPsd();\r\n\t\t\t\tString password = editText.getText().toString().trim();\r\n\t\t\t\tif (TextUtils.isEmpty(password)) {\r\n\t\t\t\t\tShowToast(\"密码不能为空!\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tif (password.equals(psd)) {\r\n\t\t\t\t\tavatorPop.dismiss();\r\n\t\t\t\t\tintentAction(getActivity(), GesturePsdActivity.class);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\tShowToast(\"输入密码错误!\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tbt_cancel.setOnClickListener(new OnClickListener() {\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\tavatorPop.dismiss();\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"@SuppressLint(\"InflateParams\")\n @Override @NonNull\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n LayoutInflater inflater = getActivity().getLayoutInflater();\n\n builder.setTitle(R.string.settings_manual_input_dialog_title)\n .setView(inflater.inflate(R.layout.dialog_settings_manual_input, null))\n .setPositiveButton(R.string.settings_manual_input_dialog_ok, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // Send the positive button event back to the host activity\n\n String tokenName = ((EditText) getDialog().findViewById(R.id.settings_manual_input_dialog_name)).getText().toString();\n String token = ((EditText) getDialog().findViewById(R.id.settings_manual_input_dialog_value)).getText().toString();\n String issuerUrl = ((EditText) getDialog().findViewById(R.id.settings_manual_input_dialog_url)).getText().toString();\n mListener.onSettingsManualInputDialogOkClick(tokenName, token, issuerUrl);\n }\n })\n .setNegativeButton(R.string.settings_manual_input_dialog_cancel, null);\n\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n // Get the layout inflater\n LayoutInflater inflater = getActivity().getLayoutInflater();\n \n // Inflate and set the layout for the dialog\n // Pass null as the parent view because its going in the dialog layout\n View view = inflater.inflate(R.layout.signin_dialog, null);\n view.findViewById(R.id.sign_in_button).setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n mHelper.beginUserInitiatedSignIn();\n SignInDialogFragment.this.dismiss();\n }\n });\n builder.setView(view);\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"@FXML\r\n\tvoid openCreateUser(ActionEvent event) {\r\n\t\tParent root = null;\r\n\t\tnewWindow = new Stage();\r\n\t\ttry {\r\n\t\t\troot = FXMLLoader.load(getClass().getResource(\"3.1-AddISUsersScreen.fxml\"));\r\n\t\t} catch (IOException e) {\r\n\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tISUsers = new Scene(root);\r\n\t\tnewWindow.setTitle(\"Create IS User\");\r\n\t\tnewWindow.setScene(ISUsers);\r\n\t\tnewWindow.setResizable(false);\r\n\t\tnewWindow.initOwner((Stage) ((Node) event.getSource()).getScene().getWindow());\r\n\t\tnewWindow.initModality(Modality.WINDOW_MODAL);\r\n\t\tnewWindow.show();\r\n\t}",
"public InfoDialog() {\r\n\t\tcreateContents();\r\n\t}",
"public AddUser(java.awt.Frame parent, boolean modal) {\n super(parent, modal);\n initComponents();\n setTitle(\"Add User\");\n }",
"public User_gui() {\n initComponents();\n }",
"public Human() {\n\n name = JOptionPane.showInputDialog(\"Enter The Name Of The Human: \") ;\n }",
"public AddUserView() {\n initComponents();\n }",
"void changeUser(){\n\t\tfinal FrameLayout fl = new FrameLayout(this);\n\n\t\tfinal EditText newUID = new EditText(this);\n\t\tfinal LinearLayout nameHolder = new LinearLayout(this);\n\t\tnameHolder.setOrientation(1);//Vertical\n//\t\tinputName.setGravity(Gravity.CENTER);\n//\t\tinputTitle.setGravity(Gravity.CENTER);\n\t\t//MAX 2 digits! HARDCODED\n\t\t//Limit them to a certain amount of digits\n\t\tInputFilter[] FilterArray = new InputFilter[1];\n\t\tFilterArray[0] = new InputFilter.LengthFilter(2);\n\t\tnewUID.setFilters(FilterArray);\n\t\t\n\t\tnameHolder.addView(newUID, new FrameLayout.LayoutParams(\n\t\t\t\tFrameLayout.LayoutParams.FILL_PARENT,\n\t\t\t\tFrameLayout.LayoutParams.WRAP_CONTENT));\n\t\t\n\t\tfl.addView(nameHolder, new FrameLayout.LayoutParams(\n\t\t\t\tFrameLayout.LayoutParams. FILL_PARENT,\n\t\t\t\tFrameLayout.LayoutParams.FILL_PARENT));\n\n\t\t// input.setText(\"Preset Text\");\n\t\tnewUID.setHint(\"NUMBER: 00-99\");\n\t\tnewUID.setInputType(InputType.TYPE_CLASS_NUMBER);\n\n\t\tAlertDialog newprojPopUp = new AlertDialog.Builder(this).create();\n\n\t\t//Show the keyboard automatically\n\t\tnewprojPopUp.setOnShowListener(new OnShowListener() {\n\n\t\t @Override\n\t\t public void onShow(DialogInterface dialog) {\n\t\t InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);\n\t\t imm.showSoftInput(newUID, InputMethodManager.SHOW_FORCED);\n\t\t }\n\t\t});\n\t\t\n\t\tnewprojPopUp.setView(fl);\n\n\t\tnewprojPopUp.setTitle(\"Enter your USER ID (00-99)\");\n\n\t\t// Create Button\n\t\tnewprojPopUp.setButton(\"Enter\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\n\t\t\t\t\tpublic void onClick(\n\t\t\t\t\t\t\tfinal DialogInterface dMAIN,\n\t\t\t\t\t\t\tint which) {\n\n\t\t\t\t\t\tuserID=Integer.parseInt(newUID.getText().toString().trim());\n\t\t\t\t\t\tuserButton.setText(\"USER: \"+userIDformatter.format(userID));\n\t\t\t\t\t\tToast.makeText(\n\t\t\t\t\t\t\t\tgetApplicationContext(),\n\t\t\t\t\t\t\t\t\"New User ID = \"+userID,\n\t\t\t\t\t\t\t\t1).show();\n\t\t\t\t\t\tmakeUser();\n\t\t\t\t\t\tloadUpAllPics();\n\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t// Cancel Button\n\t\tnewprojPopUp.setButton2(\"Cancel\",\n\t\t\t\tnew DialogInterface.OnClickListener() {\n\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void onClick(DialogInterface d,\n\t\t\t\t\t\t\tint which) {\n\n\t\t\t\t\t\t d.dismiss();\n\n\t\t\t\t\t}\n\n\t\t\t\t});\n\n\t\tnewprojPopUp.show();\n\t\tnewUID.requestFocus();\n\t\tnewprojPopUp\n\t\t\t\t.getWindow()\n\t\t\t\t.setSoftInputMode(\n\t\t\t\t\t\tWindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE);\n\n\n\t\t\n\t}",
"private ShowCreateAnswerPage() {\n this.service = UserService.retrieve();\n this.validator = Validator.retrieve();\n }",
"@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setMessage(\"Do you want to play a game with \"+getArguments().getString(\"name\")+\"?\")\n .setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n acceptGame(getContext());\n }\n })\n .setNegativeButton(\"No\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n declineGame(getContext());\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }",
"protected void Userselect(ActionEvent arg0) {\n\t\tUsersManageFrm umf=new UsersManageFrm();\n\t\tumf.setVisible(true);\n\t\tdesktopPane.add(umf);\n\t}",
"@Override\r\n\tpublic Dialog onCreateDialog(Bundle savedInstanceState) {\n\r\n\t\tAlertDialog.Builder builder = new Builder(this.getActivity());\r\n\t\tView view = LayoutInflater.from(getActivity()).inflate(\r\n\t\t\t\tR.layout.load_dialog, null);\r\n\r\n\t\tbuilder.setView(view);\r\n\t\tbuilder.setCancelable(false);\r\n\t\tdialog=builder.create();\r\n\t\treturn dialog;\r\n\t}",
"public adduser() {\n initComponents();\n }",
"protected Dialog onCreateDialog(int id) {\r\n switch(id) {\r\n case PROGRESS_DIALOG:\r\n progressDialog = new ProgressDialog(Suggestions.this);\r\n progressDialog.setMessage(\"Loading. Please wait.\");\r\n progressThread = new ProgressThread(handler);\r\n progressThread.start();\r\n return progressDialog;\r\n default:\r\n return null;\r\n }\r\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n\n //setting the message and the title of dialog\n builder.setTitle(R.string.dialog_title)\n .setMessage(R.string.dialog_message)\n .setPositiveButton(android.R.string.yes, (dialog, which) -> {\n getActivity().finish();\n })\n .setOnCancelListener(dialog -> getActivity().finish());\n\n //creating and returning the dialog\n return builder.create();\n }",
"private void createAndShowDialog(final String message, final String title) {\n final AlertDialog.Builder builder = new AlertDialog.Builder(this);\n\n builder.setMessage(message);\n builder.setTitle(title);\n builder.create().show();\n }",
"public AlertDialog createSimpleDialog() {\n AlertDialog.Builder builder = new AlertDialog.Builder(this);\n builder.setTitle(\"Code with love by\")\n .setMessage(\"Alvaro Velasco & Jose Alberto del Val\");\n return builder.create();\n }",
"public Dialog onCreateDialog(Bundle savedInstanceState) {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\r\n\t\tLayoutInflater inflater = getActivity().getLayoutInflater();\r\n\t\tView dialogView = inflater.inflate(R.layout.posted, null);\r\n\r\n\t\tbuilder.setTitle(\"Posted Message to:\");\r\n\t\tbuilder.setView(dialogView);\r\n\t\tfinal AlertDialog dialog = builder.show();\r\n\t\t//dialog.getWindow().setLayout(520, 525);\r\n\t\t\r\n\t\tTextView message = (TextView) dialog.findViewById(R.id.sites_posted);\r\n\t\tmessage.setText(sites);\r\n\r\n\t\tButton done = (Button) dialog.findViewById(R.id.done);\r\n\t\tdone.setOnClickListener(new OnClickListener(){\r\n\r\n\t\t\tpublic void onClick(View v) {\r\n\t\t\t\t// TODO open social media options\r\n\t\t\t\tdialog.cancel();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\r\n\t\treturn dialog;\r\n\t}",
"public FormMenuUser() {\n super(\"Form Menu User\");\n initComponents();\n }",
"public void openDialog(){\n DialogforTheboysHeroImage dialogforTheboysHeroImage = new DialogforTheboysHeroImage();\n dialogforTheboysHeroImage.show(getSupportFragmentManager(), \"Heros info\");\n }",
"public void crearDialogo() {\r\n final PantallaCompletaDialog a2 = PantallaCompletaDialog.a(getString(R.string.hubo_error), getString(R.string.no_hay_internet), getString(R.string.cerrar).toUpperCase(), R.drawable.ic_error);\r\n a2.f4589b = new a() {\r\n public void onClick(View view) {\r\n a2.dismiss();\r\n }\r\n };\r\n a2.show(getParentFragmentManager(), \"TAG\");\r\n }",
"@Override\r\n\t protected Dialog onCreateDialog(int id) {\n\t \r\n\t screenDialog = null;\r\n\t switch(id){\r\n\t case(ID_SCREENDIALOG):\r\n\t screenDialog = new Dialog(this);\r\n\t screenDialog.setContentView(R.layout.message);\r\n\t messageText=(EditText)screenDialog.findViewById(R.id.messagetext1);\r\n\t send=(Button)screenDialog.findViewById(R.id.button1);\r\n\t send.setOnClickListener(sendmessage);\r\n\t cancel=(Button)screenDialog.findViewById(R.id.button2);\r\n\t cancel.setOnClickListener(cancelmessage);\r\n\t }\r\n\t return screenDialog;\r\n\t }",
"private void newDialog() {\n\t\tAlertDialog.Builder builder = new AlertDialog.Builder(this);\n\t\tbuilder.setTitle(getString(R.string.addmark));\n\t\tfinal EditText input = new EditText(this);\n\t\tinput.setHint(getString(R.string.pleasemark));\n\t\tbuilder.setView(input);\n\t\tbuilder.setPositiveButton(getString(R.string.yes),\n\t\t\t\tnew OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tif (input.getText().toString().trim().length() > 0) {\n\t\t\t\t\t\t\taddTag(input.getText().toString());\n\t\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t\t\tToast.makeText(ArchermindReaderActivity.this,\n\t\t\t\t\t\t\t\t\tgetString(R.string.successaddmark),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tToast.makeText(ArchermindReaderActivity.this,\n\t\t\t\t\t\t\t\t\tgetString(R.string.pleasemark),\n\t\t\t\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t\t\t\t\tnewDialog();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tbuilder.setNegativeButton(getString(R.string.no),\n\t\t\t\tnew OnClickListener() {\n\t\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\t\tdialog.dismiss();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\tbuilder.show();\n\t}",
"public NewDialog() {\n\t\t\t// super((java.awt.Frame)null, \"New Document\");\n\t\t\tsuper(\"JFLAP 7.0\");\n\t\t\tgetContentPane().setLayout(new GridLayout(0, 1));\n\t\t\tinitMenu();\n\t\t\tinitComponents();\n\t\t\tsetResizable(false);\n\t\t\tpack();\n\t\t\tthis.setLocation(50, 50);\n\n\t\t\taddWindowListener(new WindowAdapter() {\n\t\t\t\t@Override\n\t\t\t\tpublic void windowClosing(final WindowEvent event) {\n\t\t\t\t\tif (Universe.numberOfFrames() > 0) {\n\t\t\t\t\t\tNewDialog.this.setVisible(false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tQuitAction.beginQuit();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}",
"@Override\n public void onClick(DialogInterface dialog, int id) {\n\n String chat = chat_field.getText().toString();\n\n\n LandingActivity current_activity = (LandingActivity)getActivity();\n if(current_activity != null){\n new Chat(chat, current_user.getUsername(), getActivity());\n }\n //Construct the new Object\n\n }",
"@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n LayoutInflater inflater = getActivity().getLayoutInflater();\n View rootView = inflater.inflate(R.layout.fragment_message_dialog, null);\n msg = rootView.findViewById(R.id.msg);\n submit = rootView.findViewById(R.id.msg_submit);\n final int code = getTargetRequestCode();\n builder.setView(rootView);\n builder.setTitle(\"Enter a message:\");\n\n submit.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View view) {\n\n sendResult(code);\n dismiss();\n\n\n }\n\n });\n\n return builder.create();\n }",
"private void startMealToDatabaseAlert() {\n AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);\n TextView dialogTitle = new TextView(this);\n int blackValue = Color.parseColor(\"#000000\");\n dialogTitle.setText(R.string.title_dialog_meal);\n dialogTitle.setGravity(Gravity.CENTER_HORIZONTAL);\n dialogTitle.setPadding(0, 30, 0, 0);\n dialogTitle.setTextSize(25);\n dialogTitle.setTextColor(blackValue);\n dialogBuilder.setCustomTitle(dialogTitle);\n View dialogView = getLayoutInflater().inflate(R.layout.dialog_add_meal, null);\n\n this.startEditTexts(dialogView);\n this.startLocationSpinner(dialogView);\n this.startAddPhotoButton(dialogView);\n this.startMealDialogButtonListeners(dialogBuilder);\n\n dialogBuilder.setView(dialogView);\n AlertDialog permission_dialog = dialogBuilder.create();\n permission_dialog.show();\n }",
"public void createFirebaseAccountsUI() {\n mAccountsFragment.startActivityForResult(\n AuthUI.getInstance()\n .createSignInIntentBuilder()\n .setAvailableProviders(providers)\n .build(),\n mAccountsFragment.RC_SIGN_IN);\n }"
] | [
"0.6592057",
"0.65801954",
"0.6572264",
"0.65363085",
"0.65345025",
"0.65298826",
"0.6467402",
"0.6465834",
"0.6455418",
"0.6437338",
"0.6428596",
"0.6361663",
"0.6342891",
"0.6342294",
"0.63306177",
"0.63204664",
"0.63020456",
"0.62887084",
"0.6280536",
"0.6262481",
"0.62428486",
"0.62269247",
"0.62185717",
"0.62183625",
"0.6209626",
"0.6196041",
"0.619545",
"0.61857045",
"0.61852217",
"0.6167967",
"0.615755",
"0.61427814",
"0.61402684",
"0.61383206",
"0.61351943",
"0.6129659",
"0.6122335",
"0.6102072",
"0.60921514",
"0.60638505",
"0.60583615",
"0.6055846",
"0.60318434",
"0.60293376",
"0.6024586",
"0.6015686",
"0.60102314",
"0.6008884",
"0.5995654",
"0.5985856",
"0.59803337",
"0.5963222",
"0.5960884",
"0.5946949",
"0.59450984",
"0.5943471",
"0.5939966",
"0.593848",
"0.59235615",
"0.59068584",
"0.5900563",
"0.58976305",
"0.5885626",
"0.5878937",
"0.58768016",
"0.58741915",
"0.58739996",
"0.5871802",
"0.58700544",
"0.58686095",
"0.5863455",
"0.58611673",
"0.5860983",
"0.58598465",
"0.5850957",
"0.58490133",
"0.58397037",
"0.5838909",
"0.5822863",
"0.5811968",
"0.58098143",
"0.5809394",
"0.5807822",
"0.5806032",
"0.5800557",
"0.5791881",
"0.5788172",
"0.57875085",
"0.5780037",
"0.5769368",
"0.5764465",
"0.5757854",
"0.57554454",
"0.57515556",
"0.5749937",
"0.5746733",
"0.57414496",
"0.5740634",
"0.57374394",
"0.573712"
] | 0.66789645 | 0 |
Instantiates a new user datapanel. | public UserDatapanel(){
setLayout(new GridLayout(8,1));
add(new JLabel("Username: ", JLabel.LEFT));
add(userIDfield);
add(new JLabel("User type: ", JLabel.LEFT));
add(userList);
add(new JLabel("Name: ", JLabel.LEFT));
add(usernameField);
add(new JLabel("Password: ", JLabel.LEFT));
add(passwordField);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"User()\n\t{\n\n\t}",
"public User() {\n this.id = 0;\n this.username = \"gfisher\";\n this.password = \"password\";\n this.email = \"email@gmail.com\";\n this.firstname = \"Gene\";\n this.lastname = \"Fisher\";\n this.type = new UserPermission(true, true, true, true);\n }",
"private Appuser newUser() {\n //TODO: get logged user from security context\n String createdBy = \"REST\";\n Appuser au = new Appuser();\n Userdetails ud = new Userdetails();\n boolean idOK = false;\n Long id = 0L;\n while (!idOK) {\n id = EntityIdGenerator.random();\n idOK = !userRepository.exists(id);\n }\n //notNull\n ud.setNotes(\"none\");\n au.setPasswdHash(\"*\");\n au.setCreatedBy(createdBy);\n au.setUserId(id);\n ud.setUserId(id);\n au.setUserdetails(ud);\n return au;\n }",
"public User createUser() {\n printer.println(\"Welcome! Enter you name and surname:\");\n printer.println(\"Name:\");\n String name = input.nextString();\n printer.println(\"Surname:\");\n String surname = input.nextString();\n return new User(name, surname);\n }",
"public User() {\n log.debug(\"Create a User object\");\n }",
"public NewUsers() {\n initComponents();\n currentTimeDate();\n }",
"public DbUser() {\r\n\t}",
"Utilizator createUser(String username, String password, String nume,\n\t\t\tString prenume, String tip, String aux);",
"public IUser CreateUser() {\n\t\tIUser iUser = null;\n\t\tswitch (db) {\n\t\tcase \"Mysql\":\n\t\t\tiUser = new MysqlUserImpl();\n\t\t\tbreak;\n\t\tcase \"Access\":\n\t\t\tiUser = new AccessUserImpl();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn iUser;\n\t}",
"public User() {\r\n \r\n }",
"public User() {\n this.firstName = \"Lorenzo\";\n this.lastName = \"Malferrari\";\n this.username = \"malfe.lore@gmail.com\";\n this.email = \"malfe.lore@gmail.com\";\n this.password = \"123456\";\n this.city = \"Bologna\";\n this.country = \"Italia\";\n this.gender = \"Maschio\";\n this.birthdate = new Date();\n this.age = 21;\n this.imgUser = 1;\n this.last_access = new Date();\n this.registration_date = new Date();\n }",
"public User() {\n\t\tsuper(AppEntityCodes.USER);\n\t}",
"public User() {\r\n\r\n\t}",
"public UserModel(){\n ID = 0; // The user's ID, largely used in conjuction with a database\n firstName = \"fname\"; //User's first name\n lastName = \"lname\"; // User's last name\n password= \"pass\"; ///User password\n username = \"testuser\"; //Valid email for user\n role = 0; //Whether the user is a typical user or administrator\n status = 0; //Whether the user is active or disabled\n }",
"public User() {\n uid= 0;\n username = \"\";\n password = \"\";\n role = \"user\";\n status = false;\n updatedTime = new Timestamp(0);\n }",
"public User() {\r\n\t}",
"User createUser();",
"public User() {}",
"public User() {}",
"public User() {}",
"public User() {\n }",
"public User() {\n\t\tsuper();\n\t}",
"public User() {\n\t\tsuper();\n\t}",
"public User() {\n\t\tsuper();\n\t}",
"public UserData() {\n }",
"public User() {\n\n\t}",
"public NewUser() {\n initComponents();\n }",
"public User() {\r\n }",
"public User(){}",
"public User(){}",
"public User(){}",
"public User(String _username, String _password, String _employeeType) {\n // TODO implement here\n username = _username;\n password = _password;\n employeeType = _employeeType;\n// String taskId = UUID.randomUUID().toString();\n }",
"public User() {\n\t}",
"public UserRecord(Integer idUser, String name, String surname, String title, LocalDateTime dateBirth, LocalDateTime dateCreate, LocalDateTime dateUpdate, LocalDateTime dateDelete, String govId, String username, String password, String email, String gender, String status) {\n super(User.USER);\n\n set(0, idUser);\n set(1, name);\n set(2, surname);\n set(3, title);\n set(4, dateBirth);\n set(5, dateCreate);\n set(6, dateUpdate);\n set(7, dateDelete);\n set(8, govId);\n set(9, username);\n set(10, password);\n set(11, email);\n set(12, gender);\n set(13, status);\n }",
"public User() {\n super();\n }",
"public User() {\n super();\n }",
"public User()\n\t{\n\t}",
"public void create() throws DuplicateException, InvalidUserDataException, \n NoSuchAlgorithmException, SQLException {\n\tUserDA.create(this);\n }",
"public User(int user_id, String full_name, String address, String postal_code, int mobile_no,\n String snow_zone, String garbage_day, String password){\n this.user_id = user_id;\n this.full_name = full_name;\n this.address = address;\n this.postal_code = postal_code;\n this.mobile_no = mobile_no;\n this.snow_zone = snow_zone;\n this.garbage_day = garbage_day;\n this.password = password;\n\n }",
"public User() { }",
"private void initUser() {\n\t}",
"public Users() {}",
"public User()\r\n\t{\r\n\t\tthis.userId = 0;\r\n\t\tthis.userName = \"\";\r\n\t\tthis.role = \"\";\r\n\t\tthis.firstName = \"\";\r\n\t\tthis.lastName = \"\";\r\n\t\tthis.emailAddress = \"\";\r\n\t\tthis.streetAddress = \"\";\r\n\t\tthis.city = \"\";\r\n\t\tthis.state = \"\";\r\n\t\tthis.zip = 0;\r\n\t\tthis.country = \"\";\r\n\t}",
"public User() throws InvalidUserDataException {\n this(DEFAULT_ID, DEFAULT_PASSWORD, DEFAULT_FIRST_NAME, \n DEFAULT_LAST_NAME, DEFAULT_EMAIL_ADDRESS, new Date(), \n new Date(), DEFAULT_TYPE, DEFAULT_ENABLED_STATUS);\n }",
"public CreateUser(int age, String name){ // constructor\n userAge = age;\n userName = name;\n }",
"public Usuario () {\r\n\t\t\r\n\t\t\r\n\t}",
"public void newUser(User user);",
"public static createNewUser newInstance() {\n createNewUser fragment = new createNewUser();\n Bundle args = new Bundle();\n fragment.setArguments(args);\n return fragment;\n }",
"public User()\n\t{\n\t\tfirstName = \"\";\n\t\tlastName = \"\";\n\t\tusername = \"\";\n\t\tpassword = \"\";\n\t}",
"public TUser() {\n this(\"t_user\", null);\n }",
"public UserData(String firstName, String lastName, String patronymic, String email, String phone, int userId) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.patronymic = patronymic;\n this.email = email;\n this.phone = phone;\n this.userId = userId;\n }",
"public LibrarianUser() {\n\t\tsuper();\n\t}",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n }",
"public User() {\n\n }",
"public User(){\n nomorAkun = 0;\n pin = 0;\n saldo = 0;\n }",
"public Usuario() {\r\n }",
"public Usuario() {\r\n }",
"public User() {\r\n this(\"\", \"\");\r\n }",
"public void createUser() {\n try {\n conn = dao.getConnection();\n\n ps = conn.prepareStatement(\"INSERT INTO Users(username, password) VALUES(?, ?)\");\n ps.setString(1, this.username);\n ps.setString(2, this.password);\n\n ps.execute();\n\n ps.close();\n conn.close();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }",
"public void createUser() throws ServletException, IOException {\n\t\tString fullname = request.getParameter(\"fullname\");\n\t\tString password = request.getParameter(\"password\");\n\t\tString email = request.getParameter(\"email\");\n\t\tUsers getUserByEmail = productDao.findUsersByEmail(email);\n\t\t\n\t\tif(getUserByEmail != null) {\n\t\t\tString errorMessage = \"we already have this email in database\";\n\t\t\trequest.setAttribute(\"message\", errorMessage);\n\t\t\t\n\t\t\tString messagePage = \"message.jsp\";\n\t\t\tRequestDispatcher requestDispatcher = request.getRequestDispatcher(messagePage);\n\t\t\trequestDispatcher.forward(request, response);\n\t\t}\n\t\t// create a new instance of users class;\n\t\telse {\n\t\t\tUsers user = new Users();\n\t\t\tuser.setPassword(password);\n\t\t\tuser.setFullName(fullname);\n\t\t\tuser.setEmail(email);\n\t\t\tproductDao.Create(user);\n\t\t\tlistAll(\"the user was created\");\n\t\t}\n\n\t\t\n\t}",
"public void createUser() {\r\n\t\tif(validateUser()) {\r\n\t\t\t\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"INSERT INTO t_user (nom,prenom,userName,pass,tel,type,status) values(?,?,?,?,?,?,?)\");\r\n\t\t\t\tps.setString(1, this.getNom());\r\n\t\t\t\tps.setString(2, this.getPrenom());\r\n\t\t\t\tps.setString(3, this.getUserName());\r\n\t\t\t\tps.setString(4, this.getPassword());\r\n\t\t\t\tps.setInt(5, Integer.parseInt(this.getTel().trim()));\r\n\t\t\t\tps.setString(6, this.getType());\r\n\t\t\t\tps.setBoolean(7, true);\r\n\t\t\t\tps.executeUpdate();\r\n\t\t\t\tnew Message().error(\"Fin d'ajout d'utilisateur\");\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\tnew Message().error(\"Echec d'ajout d'utilisateur\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closePrepareStatement(ps);\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"public static void createUser(String fname, String lname, String username, String password) {\n\t\tUser newUser = new User(fname, lname, username, password);\t\n\t}",
"public User(){\n this(null, null);\n }",
"private User() {}",
"public UserModel() throws IOException {\n userManager = new UserManager();\n }",
"Human_User createHuman_User();",
"public void createUser(User user) {\n\n\t}",
"public User(String un, String pw, String fn, String c, String g, Date dob, Date acsd){\n this.username = un;\n this.password = pw;\n this.fullName = fn;\n this.country = c;\n this.gender = g;\n this.dob = dob;\n this.accessDate = acsd;\n }",
"public User(Long id) {\n\t\tsuper(id, AppEntityCodes.USER);\n\t}",
"public User() {\n\t\tsuper(\"User\", models.DefaultSchema.DEFAULT_SCHEMA);\n\t}",
"public User(String username,\n String firstname,\n String lastname) {\n //create userId\n int newID = numOfObjects + 1;\n String userId = username + \"_\" + newID;\n\n this.userId = userId;\n this.username = username;\n this.firstname = firstname;\n this.lastname = lastname;\n this.calendarsOwned = new ArrayList<Calendar_>();\n this.eventsOwned = new ArrayList<Event>();\n\n //update object counter\n numOfObjects++;\n }",
"public AppUser() {\r\n\t\tsuper();\r\n\t}",
"public User(long id, String fistname, String secondname, String username, String password, String mail){\n this.id = id;\n this.firstname = fistname;\n this.secondname = secondname;\n this.username = username;\n this.password = password;\n this.email = mail;\n }",
"protected User() {}",
"protected User() {}",
"public User(){\n }",
"public UsuarioControlador() {\n }",
"public UserDAO() {\r\n\t\tsuper();\r\n\t\tthis.userStore.put(\"user\", new User(\"user\", \"user\"));\r\n\t}",
"public User(String n) { // constructor\r\n name = n;\r\n }",
"public User(String username, String password) {\n this.userID = UUID.randomUUID();\n this.username = username;\n this.password = password;\n this.isTechAgent = false;\n }",
"public String create() {\r\n\t\tuserService.create(userAdd);\r\n\t\tusers.setWrappedData(userService.list());\r\n\t\treturn \"create\";\r\n\t}",
"public User(){\n\n }",
"private void newUser(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\ttry {\n\t\t\tPrintWriter out = res.getWriter();\n\t\t\tString name = req.getParameter(Constants.NAME_USER);\n\t\t\tUserDB.introduceUser(name);\n\t\t\tlong id = UserDB.getUserId(name);\n\t\t\tUsuario u = new Usuario(name, Long.toString(id));\n\t\t\tout.print(gson.toJson(u));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tres.setStatus(HttpServletResponse.SC_BAD_REQUEST);\n\t\t}\n\t}",
"public User() {\n /**\n * default Cto'r\n */\n }",
"public User() {\n username = null;\n password = null;\n email = null;\n firstName = null;\n lastName = null;\n gender = null;\n personID = null;\n }",
"User(String userID, String password, String firstName, String lastName) {\n this.userID = userID;\n this.password = password;\n this.firstName = firstName;\n this.lastName = lastName;\n }",
"public User() {\n this.username = \"test\";\n }",
"public UserProfile() {}",
"private User() {\n }"
] | [
"0.735757",
"0.7279722",
"0.7274494",
"0.7264084",
"0.7161292",
"0.7082709",
"0.70719194",
"0.70588964",
"0.7057667",
"0.7034296",
"0.698252",
"0.6950774",
"0.69344527",
"0.6907704",
"0.6893579",
"0.68732035",
"0.68721753",
"0.6870571",
"0.6870571",
"0.6870571",
"0.68624943",
"0.6855912",
"0.6855912",
"0.6855912",
"0.6849529",
"0.68376195",
"0.68287116",
"0.6824082",
"0.6812944",
"0.6812944",
"0.6812944",
"0.68077147",
"0.6785169",
"0.6783015",
"0.67668796",
"0.67668796",
"0.6760494",
"0.6754462",
"0.67511237",
"0.6748372",
"0.6744925",
"0.6744029",
"0.67294437",
"0.6724449",
"0.67229164",
"0.6712405",
"0.6701492",
"0.6694396",
"0.6688689",
"0.6685833",
"0.66806173",
"0.6679767",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.6679366",
"0.66674685",
"0.66661",
"0.66543573",
"0.66543573",
"0.6651535",
"0.66457146",
"0.66446567",
"0.6642912",
"0.66363424",
"0.6618731",
"0.65975785",
"0.65945506",
"0.6590094",
"0.6586863",
"0.6585431",
"0.658471",
"0.65831906",
"0.6578832",
"0.65776354",
"0.6577457",
"0.6573311",
"0.6573311",
"0.65729904",
"0.6570068",
"0.6569384",
"0.6567103",
"0.6561298",
"0.6555074",
"0.6548499",
"0.6546955",
"0.65379494",
"0.6530567",
"0.65258193",
"0.65203977",
"0.65193576",
"0.6517608"
] | 0.0 | -1 |
Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks | @Override
public void render(int x, int y, float f) {
Pair<Integer, Integer> adjustedValueCoords = this.getAdjustedXYValue();
int grayBoxX = adjustedValueCoords.getKey();
int grayBoxY = adjustedValueCoords.getValue();
this.Tabs.x = adjustedValueCoords.getKey();
this.Tabs.y = adjustedValueCoords.getValue() - 21;
this.renderBackground();
// Draw the control background.
assert this.minecraft != null;
this.minecraft.getTextureManager().bindTexture(backgroundTextures);
this.blit(grayBoxX, grayBoxY, 0, 0, 256, 256);
for (Widget button : this.buttons) {
// Make all buttons invisible.
if (button != this.btnCancel && button != this.btnBuild) {
button.visible = false;
}
}
this.btnAddTorches.visible = false;
this.btnAddBed.visible = false;
this.btnAddChest.visible = false;
this.btnAddChestContents.visible = false;
this.btnAddCraftingTable.visible = false;
this.btnAddFurnace.visible = false;
this.btnAddMineShaft.visible = false;
// Update visibility on controls based on the selected tab.
if (this.getSelectedTab() == this.tabGeneral) {
this.btnHouseStyle.visible = true;
this.btnVisualize.visible = true;
} else if (this.getSelectedTab() == this.tabConfig) {
this.btnAddTorches.visible = this.serverConfiguration.addTorches;
this.btnAddBed.visible = this.serverConfiguration.addBed;
this.btnAddChest.visible = this.serverConfiguration.addChests;
this.btnAddChestContents.visible = this.allowItemsInChestAndFurnace && this.serverConfiguration.addChestContents;
this.btnAddCraftingTable.visible = this.serverConfiguration.addCraftingTable;
this.btnAddFurnace.visible = this.serverConfiguration.addFurnace;
this.btnAddMineShaft.visible = this.serverConfiguration.addMineshaft;
} else if (this.getSelectedTab() == this.tabBlockTypes) {
this.btnGlassColor.visible = this.houseConfiguration.houseStyle != HouseStyle.SNOWY
&& this.houseConfiguration.houseStyle != HouseStyle.DESERT;
}
// Draw the buttons, labels and tabs.
super.render(x, y, f);
// Draw the text here.
int color = Color.DARK_GRAY.getRGB();
// Draw the appropriate text based on the selected tab.
if (this.getSelectedTab() == this.tabGeneral) {
this.minecraft.fontRenderer.drawString(GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_STYLE), grayBoxX + 10, grayBoxY + 10, color);
this.minecraft.fontRenderer.drawSplitString(this.houseConfiguration.houseStyle.getHouseNotes(), grayBoxX + 147, grayBoxY + 10, 95, color);
this.minecraft.getTextureManager().bindTexture(this.houseConfiguration.houseStyle.getHousePicture());
GuiTabScreen.drawModalRectWithCustomSizedTexture(grayBoxX + 250, grayBoxY, 1,
this.houseConfiguration.houseStyle.getImageWidth(), this.houseConfiguration.houseStyle.getImageHeight(),
this.houseConfiguration.houseStyle.getImageWidth(), this.houseConfiguration.houseStyle.getImageHeight());
} else if (this.getSelectedTab() == this.tabBlockTypes) {
if (this.houseConfiguration.houseStyle == HouseConfiguration.HouseStyle.SNOWY
|| this.houseConfiguration.houseStyle == HouseConfiguration.HouseStyle.DESERT) {
} else {
// Column 1:
this.minecraft.fontRenderer.drawString(GuiLangKeys.translateString(GuiLangKeys.GUI_STRUCTURE_GLASS), grayBoxX + 10, grayBoxY + 10, color);
}
}
if (!CommonProxy.proxyConfiguration.serverConfiguration.enableStructurePreview) {
this.btnVisualize.visible = false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public final void drawScreen(int mouseX, int mouseY, float partialTicks) {\n\t\tif(behindScreen != null) {\n\t\t\tbehindScreen.drawScreen(-9999, -9999, partialTicks);\n\t\t}\n\t\t\n\t\t// ...\n\t\tinstance.setCurrentScreen(this, this.zLevel, this.fontRendererObj, this.itemRender);\n\t\tinstance.drawDefaultBackground();\n\t\t\n\t\t// Draw all components.\n\t\tfor(QADComponent component : components) {\n\t\t\tcomponent.draw(mouseX-component.getX(), mouseY-component.getY(), partialTicks, instance);\n\t\t}\n\t\t\n\t\tif(shouldDebugRender) {\n\t\t\tQADGuiScreenDebugRenderer.debugRender(this, components, instance, mouseX, mouseY, partialTicks);\n\t\t}\n\t\t\n\t\tdrawCustom(mouseX, mouseY, partialTicks, instance);\n\t\t\n\t\t// Check for tooltips, and draw them if necessary.\n\t\tfor(QADComponent component : components) {\n\t\t\tif(component.isPointInside(mouseX, mouseY)) {\n\t\t\t\tList<String> text = component.getTooltip(mouseX, mouseY);\n\t\t\t\t\n\t\t\t\tif(text != null) {\n\t\t\t\t\tint yPos = mouseY;\n\t\t\t\t\t\n\t\t\t\t\tif(text.get(0).equalsIgnoreCase(\"ylock\")) {\n\t\t\t\t\t\tint add = component instanceof QADRectangularComponent ? ((QADRectangularComponent) component).getHeight() : 20;\n\t\t\t\t\t\tyPos = component.getY()+add+fontRendererObj.FONT_HEIGHT*2;\n\t\t\t\t\t\ttext = text.subList(1, text.size()-1);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis.drawHoveringText(text, mouseX, yPos);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Debug: Draw cursor position marker.\n\t\tif(Boolean.TRUE.booleanValue() && Mouse.isInsideWindow()) {\n\t\t\tfinal int color = 0x1ACCEEFF;\n\t\t\tinstance.drawHorizontalLine(0, width, mouseY, color);\n\t\t\tinstance.drawVerticalLine(mouseX, -1, height, color);\n\t\t}\n\t\t\n }",
"@Override\n public void drawScreen(int mouseX, int mouseY, float partialTicks)\n {\n super.drawScreen(mouseX, mouseY, partialTicks);\n }",
"@SuppressWarnings(\"unchecked\")\n @Override\n public void drawScreen(int mouseX, int mouseY, float renderPartialTicks) {\n drawDefaultBackground();\n\n drawGuiContainerBackgroundLayer(renderPartialTicks, mouseX, mouseY);\n GL11.glDisable(GL12.GL_RESCALE_NORMAL);\n RenderHelper.disableStandardItemLighting();\n GL11.glDisable(GL11.GL_LIGHTING);\n GL11.glDisable(GL11.GL_DEPTH_TEST);\n\n // GuiScreen code start\n int k;\n for (k = 0; k < this.buttonList.size(); ++k) {\n ((GuiButton) this.buttonList.get(k)).drawButton(this.mc, mouseX, mouseY);\n }\n\n for (k = 0; k < this.labelList.size(); ++k) {\n ((GuiLabel) this.labelList.get(k)).drawLabel(this.mc, mouseX, mouseY);\n }\n // GuiScreen code end\n\n RenderHelper.enableGUIStandardItemLighting();\n GL11.glPushMatrix();\n GL11.glTranslatef((float) guiLeft, (float) guiTop, 0.0F);\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n GL11.glEnable(GL12.GL_RESCALE_NORMAL);\n OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 240 / 1.0F, (float) 240 / 1.0F);\n GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n\n this.theSlot = getHoveredSlot(mouseX, mouseY);\n\n drawSlots(inventorySlots.inventorySlots, (this.theSlot == null) ? -1 : this.theSlot.slotNumber);\n\n // Forge: Force lighting to be disabled as there are some issue where\n // lighting would\n // incorrectly be applied based on items that are in the inventory.\n GL11.glDisable(GL11.GL_LIGHTING);\n this.drawGuiContainerForegroundLayer(mouseX, mouseY);\n GL11.glEnable(GL11.GL_LIGHTING);\n\n InventoryPlayer inventoryplayer = this.mc.thePlayer.inventory;\n ItemStack itemstack = this.draggedStack == null ? inventoryplayer.getItemStack() : this.draggedStack;\n\n // Draw hold itemStack\n if (itemstack != null) {\n byte b0 = 8;\n int k1 = this.draggedStack == null ? 8 : 16;\n String format = null;\n\n if (this.draggedStack != null && this.isRightMouseClick) {\n itemstack = itemstack.copy();\n itemstack.stackSize = MathHelper.ceiling_float_int((float) itemstack.stackSize / 2.0F);\n } else if (this.dragSplitting && this.dragSplittingSlots.size() > 1) {\n itemstack = itemstack.copy();\n itemstack.stackSize = this.dragSplittingRemnant;\n\n if (itemstack.stackSize == 0) {\n format = \"\" + EnumChatFormatting.YELLOW + \"0\";\n }\n }\n\n this.drawItemStack(itemstack, mouseX - guiLeft - b0, mouseY - guiTop - k1, format);\n }\n\n if (this.returningStack != null) {\n float f1 = (float) (Minecraft.getSystemTime() - this.returningStackTime) / 100.0F;\n\n if (f1 >= 1.0F) {\n f1 = 1.0F;\n this.returningStack = null;\n }\n\n int k1 = this.returningStackDestSlot.xDisplayPosition - this.touchUpX;\n int j2 = this.returningStackDestSlot.yDisplayPosition - this.touchUpY;\n int l1 = this.touchUpX + (int) ((float) k1 * f1);\n int i2 = this.touchUpY + (int) ((float) j2 * f1);\n this.drawItemStack(this.returningStack, l1, i2, null);\n }\n\n GL11.glPopMatrix();\n\n // Render tooltips\n if (inventoryplayer.getItemStack() == null && this.theSlot != null && this.theSlot.getHasStack()) {\n ItemStack itemstack1 = this.theSlot.getStack();\n this.renderToolTip(itemstack1, mouseX, mouseY);\n }\n\n GL11.glEnable(GL11.GL_LIGHTING);\n GL11.glEnable(GL11.GL_DEPTH_TEST);\n RenderHelper.enableStandardItemLighting();\n }",
"@Override\n\tpublic void drawScreen(final int mouseX, final int mouseY, final float partialTicks)\n\t{\n\t\tdrawDefaultBackground();\n\t\tsuper.drawScreen(mouseX, mouseY, partialTicks);\n\t\trenderHoveredToolTip(mouseX, mouseY);\n\t}",
"@Override\n public void drawScreen(int mouseX, int mouseY, float partialTicks)\n {\n this.drawDefaultBackground();\n super.drawScreen(mouseX, mouseY, partialTicks);\n this.renderHoveredToolTip(mouseX, mouseY);\n }",
"@Override\n\tpublic void drawScreen(int mouseX, int mouseY, float partialTicks) {\n\t\t super.drawScreen(mouseX, mouseY, partialTicks);\n\t\t updateScreen();\n\t\t \n\t\t GuiScreen.drawRect(0, 0, 0 + fadeIn - fadeOut, this.height, Colorutils.rainbowEffect(index + x*20000000F, 1.0F).getRGB());\n\t\t // GuiButton.drawRect(left, top, right, bottom, color);\n\t\t this.scrollPanel.setDimensions(fadeIn * 3, this.height, fadeOut * 3, this.height);\n\t\t //this.scrollPanel.setDimensions(widthIn, heightIn, topIn, bottomIn);\n\t\t\t//this.drawRect(0, 65, 90 , 16, new Color(255, 255, 255).getRGB());\n\t\t\t//this.drawString(fontRendererObj, s1, 15, 15, -1);\n\t\t\t\n\t\t\t//this.buttonList.add(new GuiButton(191, 15, 15, \"Keystokes\"));\n\t\t \n\t\t // GuiCheckBox.drawRect(0, 65, 90, 16, new Color(0, 0, 0).getRGB());\n\t\t \n\t\t\t\n\t\t\t\n //this.drawRect(left, top, right, bottom, color);\n\t\t\t\n\t\t\t\n\tthis.scrollPanel.drawScreen(mouseX, mouseY, partialTicks);\n\t\t//this.drawCenteredString(this.fontRendererObj, \"Mod Options\", this.width / 2, 8, 16777215);\n\t\t\t\n\t\tsuper.drawScreen(mouseX, mouseY, partialTicks);\n\t}",
"public void drawScreen(int mouseX, int mouseY, float partialTicks)\r\n\t{\r\n\r\n\t\tGL11.glDisable(GL11.GL_ALPHA_TEST);\r\n\t\tGL11.glEnable(GL11.GL_ALPHA_TEST);\r\n\t\tTessellator tessellator = Tessellator.getInstance();\r\n\t\tBufferBuilder bufferbuilder = tessellator.getBuffer();\r\n\t\tMinecraft.getMinecraft().getTextureManager().bindTexture(getRandomTexture());\r\n\r\n\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tbufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX);\r\n\t\tbufferbuilder.pos(0.0D, (double)this.height, 0.0D).tex(0, (double) (1F + (float)mouseX)).endVertex();\r\n\t\tbufferbuilder.pos((double)this.width, (double)this.height, 0.0D).tex((double)1F, (double)(1F + (float)mouseX)).endVertex();\r\n\t\tbufferbuilder.pos((double)this.width, 0.0D, 0.0D).tex((double)1F , (double)mouseX).endVertex();\r\n\t\tbufferbuilder.pos(0, 0, 0).tex(0, mouseX).endVertex();\r\n\t\ttessellator.draw();\r\n\r\n\t\t//title textures + splash\r\n\t\tthis.mc.getTextureManager().bindTexture(MINECRAFT_TITLE_TEXTURES);\r\n\t\tGlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\r\n\t\tint j = this.width / 2 - 137;\r\n\t\tif ((double)this.minceraftRoll < 1.0E-4D)\r\n\t\t{\r\n\t\t\tthis.drawTexturedModalRect(j + 0, 30, 0, 0, 99, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 99, 30, 129, 0, 27, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 99 + 26, 30, 126, 0, 3, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 99 + 26 + 3, 30, 99, 0, 26, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 155, 30, 0, 45, 155, 44);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tthis.drawTexturedModalRect(j + 0, 30, 0, 0, 155, 44);\r\n\t\t\tthis.drawTexturedModalRect(j + 155, 30, 0, 45, 155, 44);\r\n\t\t}\r\n\t\tthis.mc.getTextureManager().bindTexture(field_194400_H);\r\n\t\tdrawModalRectWithCustomSizedTexture(j + 88, 67, 0.0F, 0.0F, 98, 14, 128.0F, 16.0F);\r\n\t\tGlStateManager.pushMatrix();\r\n\t\tGlStateManager.translate((float)(this.width / 2 + 90), 70.0F, 0.0F);\r\n\t\tGlStateManager.rotate(-20.0F, 0.0F, 0.0F, 1.0F);\r\n\t\tfloat f = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * ((float)Math.PI * 2F)) * 0.1F);\r\n\t\tf = f * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashText) + 32);\r\n\t\tGlStateManager.scale(f, f, f);\r\n\t\tthis.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, -256);\r\n\t\tGlStateManager.popMatrix();\r\n\t\t//End\r\n\r\n\t\tString s = \"Minecraft 1.12.2\";\r\n\r\n\t\tif (this.mc.isDemo())\r\n\t\t{\r\n\t\t\ts = s + \" Demo\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ts = s + (\"release\".equalsIgnoreCase(this.mc.getVersionType()) ? \"\" : \"/\" + this.mc.getVersionType());\r\n\t\t}\r\n\t\tthis.drawString(this.fontRenderer, \"Frame: \"+RandomTexture, this.width - this.fontRenderer.getStringWidth(\"Frame: \"+RandomTexture) - 2, this.height - 30, 16777215);\r\n\t\tthis.drawString(this.fontRenderer, \"Modified by Will0376\", this.width - this.fontRenderer.getStringWidth(\"Modified by Will0376\") - 2, this.height - 20, 16777215);\r\n\r\n\t\tList<String> brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true));\r\n\t\tList<String> brdlist = new ArrayList<>();\r\n\t\tfor(int i = 0;i < brandings.size();i++){\r\n\t\t\tif(brandings.get(i).contains(\"MCP\")){\r\n\t\t\t}\r\n\t\t\telse if(brandings.get(i).contains(\"Forge\")){\r\n\t\t\t\tbrdlist.add(\"Forge:\"+(brandings.get(i).split(\"Forge\")[1]));\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tbrdlist.add(brandings.get(i));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int brdline = 0; brdline < brdlist.size(); brdline++)\r\n\t\t{\r\n\t\t\tString brd = brdlist.get(brdline);\r\n\t\t\tif (!Strings.isNullOrEmpty(brd))\r\n\t\t\t{\r\n\t\t\t\tthis.drawString(this.fontRenderer, brd, 2, this.height - ( 10 + brdline * (this.fontRenderer.FONT_HEIGHT + 1)), 16777215);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.drawString(this.fontRenderer, \"Copyright Mojang AB. Do not distribute!\", this.widthCopyrightRest, this.height - 10, -1);\r\n\r\n\r\n\t\tsuper.drawScreen(mouseX, mouseY, partialTicks);\r\n\t}",
"public void drawScreen(int mouseX, int mouseY, float partialTicks) {\n\t\tGlStateManager.disableAlpha();\n\t\tthis.renderSkybox(mouseX, mouseY, partialTicks);\n\t\tGlStateManager.enableAlpha();\n\t\tTessellator var4 = Tessellator.getInstance();\n\t\tWorldRenderer var5 = var4.getWorldRenderer();\n\t\tshort var6 = 274;\n\n\t\t// Logo Width\n\t\tint var7 = this.width / 2 - var6 / 2;\n\n\t\t// Logo Height\n\t\tint var8 = (this.height / 2) - 30;\n\n\t\t// Color speed\n\t\tfloat colorspeed = 0.2f;\n\t\t// this.drawGradientRect(0, 0, this.width, this.height, -2130706433,\n\t\t// 16777215);\n\t\t// this.drawGradientRect(0, 0, this.width, this.height, 0,\n\t\t// Integer.MIN_VALUE);\n\t\tthis.mc.getTextureManager().bindTexture(minecraftTitleTextures);\n\n\t\tGlStateManager.color(logo_red, logo_green, logo_blue, 1.0F);\n\n\t\tif (logo_red > 1.0f) {\n\t\t\tlogo_ring = false;\n\t\t}\n\t\tif (logo_green > 1.0f) {\n\t\t\tlogo_ging = false;\n\t\t}\n\t\tif (logo_blue > 1.0f) {\n\t\t\tlogo_bing = false;\n\t\t}\n\t\tif (logo_red < 0.0f) {\n\t\t\tlogo_ring = true;\n\t\t}\n\t\tif (logo_green < 0.0f) {\n\t\t\tlogo_ging = true;\n\t\t}\n\t\tif (logo_blue < 0.0f) {\n\t\t\tlogo_bing = true;\n\t\t}\n\n\t\tif (logo_ring) {\n\t\t\tlogo_red += (colorspeed * 0.02f);\n\t\t} else {\n\t\t\tlogo_red -= (colorspeed * 0.1f);\n\t\t}\n\n\t\tif (logo_ging) {\n\t\t\tlogo_green += (colorspeed * 0.1f);\n\t\t} else {\n\t\t\tlogo_green -= (colorspeed * 0.06f);\n\t\t}\n\n\t\tif (logo_bing) {\n\t\t\tlogo_blue += (colorspeed * 0.3f);\n\t\t} else {\n\t\t\tlogo_blue -= (colorspeed * 0.02f);\n\t\t}\n\n\t\tif ((double) this.updateCounter < 1.0E-4D) {\n\t\t\tthis.drawTexturedModalRect(var7 + 0, var8 + 0, 0, 0, 99, 44);\n\t\t\tthis.drawTexturedModalRect(var7 + 99, var8 + 0, 129, 0, 27, 44);\n\t\t\tthis.drawTexturedModalRect(var7 + 99 + 26, var8 + 0, 126, 0, 3, 44);\n\t\t\tthis.drawTexturedModalRect(var7 + 99 + 26 + 3, var8 + 0, 99, 0, 26, 44);\n\t\t\tthis.drawTexturedModalRect(var7 + 155, var8 + 0, 0, 45, 155, 44);\n\t\t} else {\n\t\t\tthis.drawTexturedModalRect(var7 + 0, var8 + 0, 0, 0, 155, 44);\n\t\t\tthis.drawTexturedModalRect(var7 + 155, var8 + 0, 0, 45, 155, 44);\n\t\t}\n\n\t\tvar5.func_178991_c(-1);\n\t\tGlStateManager.pushMatrix();\n\t\tGlStateManager.translate((float) (this.width / 2 + 90), 70.0F, 0.0F);\n\n\t\tfloat var9 = 1.8F - MathHelper.abs(\n\t\t\t\tMathHelper.sin((float) (Minecraft.getSystemTime() % 1000L) / 1000.0F * (float) Math.PI * 2.0F) * 0.1F);\n\t\tvar9 = var9 * 100.0F / (float) (this.fontRendererObj.getStringWidth(this.splashText) + 10);\n\t\tGlStateManager.scale(var9 / 2, var9 / 2, var9 / 2);\n\n\t\tthis.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, 252);\n\t\tGlStateManager.popMatrix();\n\t\t\n\t\tString var10 = \"§7Minecraft 1.8 (Hacks: \" + this.mc.resilient.getColoredStatus() + \"§7)§r\";\n\t\tthis.drawString(this.fontRendererObj, var10, 2, this.height - 10, -1);\n\n\t\tString var11 = \"§b§nhttps://cloudchan.org/§r\";\n\t\tthis.drawString(this.fontRendererObj, var11, this.width - this.fontRendererObj.getStringWidth(var11) - 2,\n\t\t\t\tthis.height - 10, -1);\n\n\t\tString var12 = \"§5Founded by Notch§r\";\n\t\tthis.drawString(this.fontRendererObj, var12, 2, this.height - 20, -1);\n\n\t\tString var13 = \"§c§mMicrosoft(c)§r\";\n\t\tthis.drawString(this.fontRendererObj, var13, 2, this.height - 30, -1);\n\n\t\tGlStateManager.pushMatrix();\n\t\tGlStateManager.scale(1.8f, 2.4f, 1.0f);\n\t\tGlStateManager.translate(16.5f, 0.0f, 0.0f);\n\n\t\tint x = (this.width / 4);\n\t\tint y = (this.height / 4);\n\t\tthis.drawCenteredString(this.fontRendererObj,\n\t\t\t\t\"§2§l\" + this.mc.resilient.NAME + \" \" + this.mc.resilient.VERSION + \"§r\", x, y, -1);\n\n\t\tGlStateManager.popMatrix();\n\n\t\t// Draw top navbar\n\t\tdrawRect(0, 0, this.width, 25, 0x5000FFDD);\n\t\t\n\t\tsuper.drawScreen(mouseX, mouseY, partialTicks);\n\t}",
"public void drawScreen(int mouseX, int mouseY, float partialTicks) {\n/* 104 */ drawDefaultBackground();\n/* 105 */ drawCenteredString(this.fontRendererObj, I18n.format(\"selectServer.direct\", new Object[0]), this.width / 2, 20, 16777215);\n/* 106 */ drawString(this.fontRendererObj, I18n.format(\"addServer.enterIp\", new Object[0]), this.width / 2 - 100, 100, 10526880);\n/* 107 */ this.ipEdit.drawTextBox();\n/* 108 */ super.drawScreen(mouseX, mouseY, partialTicks);\n/* */ }",
"public void render(int mouseX, int mouseY, float partialTicks)\n {\n if (this.doesGuiPauseGame)\n {\n this.drawDefaultBackground();\n this.drawCenteredString(this.fontRenderer, I18n.format(\"multiplayer.downloadingStats\"), this.width / 2, this.height / 2, 16777215);\n this.drawCenteredString(this.fontRenderer, LOADING_STRINGS[(int)(Minecraft.func_71386_F() / 150L % (long)LOADING_STRINGS.length)], this.width / 2, this.height / 2 + this.fontRenderer.FONT_HEIGHT * 2, 16777215);\n }\n else\n {\n this.displaySlot.drawScreen(mouseX, mouseY, partialTicks);\n this.drawCenteredString(this.fontRenderer, this.screenTitle, this.width / 2, 20, 16777215);\n super.render(mouseX, mouseY, partialTicks);\n }\n }",
"public void drawScreen(int mouseX, int mouseY, float partialTicks)\n {\n this.drawDefaultBackground();\n this.drawCenteredString(this.fontRendererObj, this.reason, this.width / 2, this.height / 2 - this.field_175353_i / 2 - this.fontRendererObj.FONT_HEIGHT * 2, 11184810);\n int var4 = this.height / 2 - this.field_175353_i / 2;\n\n if (this.multilineMessage != null)\n {\n for (Iterator var5 = this.multilineMessage.iterator(); var5.hasNext(); var4 += this.fontRendererObj.FONT_HEIGHT)\n {\n String var6 = (String)var5.next();\n this.drawCenteredString(this.fontRendererObj, var6, this.width / 2, var4, 16777215);\n }\n }\n\n super.drawScreen(mouseX, mouseY, partialTicks);\n }",
"@Override\r\n\tpublic void drawScreen(int mouseX, int mouseY, float partialTicks) {\r\n\r\n\t\tif (_resolutionResolver == null) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tdrawBackground();\r\n\t\tdrawScrollBar();\r\n\t\tsuper.drawScreen(mouseX, mouseY, partialTicks);\r\n\t\t\r\n // This is needed in order to keep the strings and block icon\r\n // from rendering a shaded gray color\r\n RenderHelper.enableGUIStandardItemLighting();\r\n \r\n\t\tdrawWaypoints();\r\n\r\n\t // draw the tooltip if we one\r\n UltraTeleportWaypoint nwp = getMouseOverWaypoint(mouseX, mouseY);\r\n if (nwp != null) {\r\n ArrayList<String> list = new ArrayList<String>();\r\n list.add(nwp.getWaypointName());\r\n\r\n for (int k = 0; k < list.size(); ++k)\r\n {\r\n if (k == 0)\r\n {\r\n list.set(k, EnumChatFormatting.BLUE + (String)list.get(k));\r\n }\r\n else\r\n {\r\n list.set(k, EnumChatFormatting.GRAY + (String)list.get(k));\r\n }\r\n }\r\n\r\n drawToolTip(list, mouseX, mouseY, this.fontRendererObj);\r\n }\r\n\t}",
"public void render(float partialTicks){\r\n\t\tif(blocks.size() > 0 && enabled){\r\n\t\t\tfor(int i = 0; i < blocks.size();i++){\r\n\t\t\t\tblocks.get(i).draw(partialTicks);\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"public void drawScreen(int mouseX, int mouseY, float partialTicks) {\n/* 50 */ super.drawScreen(mouseX, mouseY, partialTicks);\n/* */ \n/* 52 */ if (this.hasActivePotionEffects)\n/* */ {\n/* 54 */ drawActivePotionEffects();\n/* */ }\n/* */ }",
"public void drawScreen(int mouseX, int mouseY, float par3)\n\t{\n\t\tthis.mouseX = mouseX;\n\t\tthis.mouseY = mouseY;\n\t\tthis.drawBackground();\n\t\tint scrollbarLeft = this.getScrollbarLeft();\n\t\tint scrollbarRight = scrollbarLeft + 6;\n\t\tint slotX;\n\t\tint slotY = -1;\n\t\tint clickedSlot;\n\t\tboolean scrollHover;\n\t\tboolean hoveringOver;\n\t\tint scrollBarHeight;\n\n\t\tscrollBarHeight = (int)((float)((this.height) * (this.height)) / (float)this.getContentHeight());\n\t\tif (scrollBarHeight < 32)\n\t\t{\n\t\t\tscrollBarHeight = 32;\n\t\t}\n\n\t\tif (scrollBarHeight > this.height)\n\t\t{\n\t\t\tscrollBarHeight = this.height;\n\t\t}\n//\t\tscrollbarHeight = 16;\n\n\t\tint scrollMax = this.height - scrollBarHeight;\n\n\t\tclickedSlot = -1;\n\t\thoveringOver = false;\n\t\tscrollHover = false;\n\n\t\t// is the mouse within our boundry?\n\t\tif (mouseX >= this.left && mouseX <= this.right && \n\t\t\t\tmouseY >= this.top && mouseY <= this.bottom)\n\t\t{\n\n\t\t\thoveringOver = true;\n\t\t\tif (mouseX >= scrollbarLeft && mouseX <= scrollbarRight)\n\t\t\t\tscrollHover = true;\n\n\t\t\t// was the mouse clicked? (button 0)\n\t\t\tif (Mouse.isButtonDown(0))\n\t\t\t{\n\n\n\t\t\t\t// did we click on a slot?\n\t\t\t\tif(mouseX >= this.left && mouseX < scrollbarLeft) {\n\t\t\t\t\tif(!this.scrolling) {\n\t\t\t\t\t\t// which slot is it?\n\t\t\t\t\t\tslotY = (mouseY - this.top) + (int)(this.amountScrolled * this.getAdjustedContentHeight()) - 4;\n\t\t\t\t\t\tclickedSlot = slotY / GuiSlotFriendFoe.slotHeight;\n\n\t\t\t\t\t\t// did the user just click on a slot twice\n\t\t\t\t\t\tif (clickedSlot >= 0 && slotY >= 0 && clickedSlot < this.getSize())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tboolean doubleClicked = clickedSlot == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L;\n\t\t\t\t\t\t\tthis.elementClicked(clickedSlot, doubleClicked);\n\t\t\t\t\t\t\tthis.selectedElement = clickedSlot;\n\t\t\t\t\t\t\tthis.lastClicked = Minecraft.getSystemTime();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.elementClicked(-1, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} \n\t\t\t\t// clicked within the scroll bar?\n\t\t\t\tif (mouseX >= scrollbarLeft && mouseX <= scrollbarRight)\n\t\t\t\t{\n\t\t\t\t\tthis.scrolling = true;\n\n\n\t\t\t\t\tthis.scrollBarTop = mouseY - this.top - scrollBarHeight / 2;\n\t\t\t\t\tif (this.scrollBarTop < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.scrollBarTop = 0;\n\t\t\t\t\t}\n\t\t\t\t\tif(this.scrollBarTop > scrollMax)\n\t\t\t\t\t\tthis.scrollBarTop = scrollMax;\n\n\t\t\t\t\tthis.amountScrolled = (float)this.scrollBarTop / (float)scrollMax;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthis.scrolling = false;\n\t\t\t}\n\n/*\n\t\t\t// did the wheel scroll\n\t\t\tint mouseWheel = Mouse.getEventDWheel();\n\n\t\t\tif (mouseWheel != 0)\n\t\t\t{\n\t\t\t\tif (mouseWheel > 0)\n\t\t\t\t{\n\t\t\t\t\tmouseWheel = -1;\n\t\t\t\t}\n\t\t\t\telse if (mouseWheel < 0)\n\t\t\t\t{\n\t\t\t\t\tmouseWheel = 1;\n\t\t\t\t}\n\n\t\t\t\tthis.amountScrolled += (float)(mouseWheel * 1.0F / this.getContentHeight());\n\t\t\t}\n*/\n\n\t\t}\n\n\n\t\t// draw the background\n\t\t//this.bindAmountScrolled();\n\t\tGL11.glDisable(GL11.GL_LIGHTING);\n\t\tGL11.glDisable(GL11.GL_FOG);\n\t\tTessellator tess = Tessellator.instance;\n\t\t\n\t\t// draw the title\n\t\tthis.parentGuiFF.drawCenteredString(this.mc.fontRenderer,this.title, this.left + this.width / 2, this.top - 10, 0x00FFFFFF);\n\n\t\tslotX = this.left;\n\t\tslotY = this.top + 4 - (int)(this.amountScrolled * this.getAdjustedContentHeight());\n\n\t\t// visible slots\n\t\tfor (int drawSlot = 0; drawSlot < this.getSize(); ++drawSlot)\n\t\t{\n\t\t\tint slotYTop = slotY + drawSlot * GuiSlotFriendFoe.slotHeight;\n\t\t\tint slotYBottom = GuiSlotFriendFoe.slotHeight - 4;\n\n\t\t\tif (\n\t\t\t\t\tslotYTop <= (this.bottom - GuiSlotFriendFoe.slotHeight) && \n\t\t\t\t\tslotYTop > this.top\n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\tif (this.showSelectionBox && this.isSelected(drawSlot))\n\t\t\t\t{\n\t\t\t\t\tint selectionBoxLeft = this.left;\n\t\t\t\t\tint selectionBoxRight = scrollbarLeft;\n\t\t\t\t\tGL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);\n\t\t\t\t\tGL11.glDisable(GL11.GL_TEXTURE_2D);\n\t\t\t\t\ttess.startDrawingQuads();\n\t\t\t\t\ttess.setColorOpaque_I(0x00008080);\n\t\t\t\t\tif(hoveringOver)\n\t\t\t\t\t\ttess.setColorOpaque_I(0x00FFFF00); // \n\t\t\t\t\ttess.addVertexWithUV((double)selectionBoxLeft , (double)(slotYTop + slotYBottom + 2), 0.0D, 0.0D, 1.0D);\n\t\t\t\t\ttess.addVertexWithUV((double)selectionBoxRight , (double)(slotYTop + slotYBottom + 2), 0.0D, 1.0D, 1.0D);\n\t\t\t\t\ttess.addVertexWithUV((double)selectionBoxRight , (double)(slotYTop - 2), 0.0D, 1.0D, 0.0D);\n\t\t\t\t\ttess.addVertexWithUV((double)selectionBoxLeft , (double)(slotYTop - 2), 0.0D, 0.0D, 0.0D);\n\t\t\t\t\ttess.setColorOpaque_I(0x00000000);\n\t\t\t\t\ttess.addVertexWithUV((double)(selectionBoxLeft + 1), (double)(slotYTop + slotYBottom + 1), 0.0D, 0.0D, 1.0D);\n\t\t\t\t\ttess.addVertexWithUV((double)(selectionBoxRight - 1), (double)(slotYTop + slotYBottom + 1), 0.0D, 1.0D, 1.0D);\n\t\t\t\t\ttess.addVertexWithUV((double)(selectionBoxRight - 1), (double)(slotYTop - 1), 0.0D, 1.0D, 0.0D);\n\t\t\t\t\ttess.addVertexWithUV((double)(selectionBoxLeft + 1), (double)(slotYTop - 1), 0.0D, 0.0D, 0.0D);\n\t\t\t\t\ttess.draw();\n\t\t\t\t\tGL11.glEnable(GL11.GL_TEXTURE_2D);\n\t\t\t\t}\n\n\t\t\t\tthis.drawSlot(drawSlot, slotX, slotYTop - 2, tess);\n\t\t\t}\n\t\t}\n\n\t\t// draw top and bottom edge gradients\n\t\tGL11.glDisable(GL11.GL_DEPTH_TEST);\n\t\tGL11.glEnable(GL11.GL_BLEND);\n\t\tGL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);\n\t\tGL11.glDisable(GL11.GL_ALPHA_TEST);\n\t\tGL11.glShadeModel(GL11.GL_SMOOTH);\n\t\tGL11.glDisable(GL11.GL_TEXTURE_2D);\n\n\t\t// draw scrollbar\n\n\t\tif (this.getAdjustedContentHeight() > 0)\n\t\t{\n\n\n\t\t\t// scrollbar back\n\t\t\ttess.startDrawingQuads();\n\t\t\ttess.setColorRGBA_I(0, 255);\n\t\t\ttess.addVertexWithUV((double)scrollbarLeft , (double)this.bottom, 0.0D, 0.0D, 1.0D);\n\t\t\ttess.addVertexWithUV((double)scrollbarRight, (double)this.bottom, 0.0D, 1.0D, 1.0D);\n\t\t\ttess.addVertexWithUV((double)scrollbarRight, (double)this.top, 0.0D, 1.0D, 0.0D);\n\t\t\ttess.addVertexWithUV((double)scrollbarLeft , (double)this.top, 0.0D, 0.0D, 0.0D);\n\t\t\ttess.draw();\n\t\t\t// scrollbar, derp\n\t\t\ttess.startDrawingQuads();\n\t\t\ttess.setColorRGBA_I(0x00808080, 255);\n\t\t\tif(scrollHover)\n\t\t\t\ttess.setColorRGBA_I(0x00808000, 255);\n\t\t\ttess.addVertexWithUV((double)scrollbarLeft , (double)(this.top + this.scrollBarTop + scrollBarHeight), 0.0D, 0.0D, 1.0D);\n\t\t\ttess.addVertexWithUV((double)scrollbarRight, (double)(this.top + this.scrollBarTop + scrollBarHeight), 0.0D, 1.0D, 1.0D);\n\t\t\ttess.addVertexWithUV((double)scrollbarRight, (double) this.top + this.scrollBarTop, 0.0D, 1.0D, 0.0D);\n\t\t\ttess.addVertexWithUV((double)scrollbarLeft , (double) this.top + this.scrollBarTop, 0.0D, 0.0D, 0.0D);\n\t\t\ttess.draw();\n\t\t\t// scrollbar highlight\n\t\t\ttess.startDrawingQuads();\n\t\t\ttess.setColorRGBA_I(0x00C0C0C0, 255);\n\t\t\tif(scrollHover)\n\t\t\t\ttess.setColorRGBA_I(0x00C0C000, 255);\n\t\t\ttess.addVertexWithUV((double)(scrollbarLeft ), (double)(this.top + this.scrollBarTop + scrollBarHeight - 1), 0.0D, 0.0D, 1.0D);\n\t\t\ttess.addVertexWithUV((double)(scrollbarRight - 1), (double)(this.top + this.scrollBarTop + scrollBarHeight - 1), 0.0D, 1.0D, 1.0D);\n\t\t\ttess.addVertexWithUV((double)(scrollbarRight - 1), (double) this.top + this.scrollBarTop, 0.0D, 1.0D, 0.0D);\n\t\t\ttess.addVertexWithUV((double)(scrollbarLeft ), (double) this.top + this.scrollBarTop, 0.0D, 0.0D, 0.0D);\n\t\t\ttess.draw();\n\t\t}\n\n\n\t\tGL11.glEnable(GL11.GL_TEXTURE_2D);\n\t\tGL11.glShadeModel(GL11.GL_FLAT);\n\t\tGL11.glEnable(GL11.GL_ALPHA_TEST);\n\t\tGL11.glDisable(GL11.GL_BLEND);\n\t}",
"public void drawComponent(Minecraft minecraft, int mouseX, int mouseY) {\n\n\t}",
"public void render(int mouseX, int mouseY, float partialTicks)\n {\n this.drawDefaultBackground();\n this.drawCenteredString(this.fontRenderer, I18n.format(\"selectWorld.edit.title\"), this.width / 2, 20, 16777215);\n this.drawString(this.fontRenderer, I18n.format(\"selectWorld.enterName\"), this.width / 2 - 100, 47, 10526880);\n this.nameEdit.func_146194_f();\n super.render(mouseX, mouseY, partialTicks);\n }",
"@Override\n public void drawScreen(int mouseX, int mouseY, float partialTicks)\n {\n this.drawDefaultBackground();\n this.propertyList.drawScreen(mouseX, mouseY, partialTicks);\n this.drawCenteredString(this.fontRendererObj, this.title, this.width / 2, 8, 16777215);\n if (this.titleLine2 != null)\n this.drawCenteredString(this.fontRendererObj, this.titleLine2, this.width / 2, 18, 16777215);\n \n this.btnUndoAll.enabled = this.propertyList.areAnyPropsEnabled(this.chkApplyGlobally.isChecked()) && this.propertyList.areAnyPropsChanged(this.chkApplyGlobally.isChecked());\n this.btnDefaultAll.enabled = this.propertyList.areAnyPropsEnabled(this.chkApplyGlobally.isChecked()) && !this.propertyList.areAllPropsDefault(this.chkApplyGlobally.isChecked());\n super.drawScreen(mouseX, mouseY, partialTicks);\n this.propertyList.drawScreenPost(mouseX, mouseY, partialTicks);\n if (this.checkBoxHoverChecker.checkHover(mouseX, mouseY))\n this.drawToolTip(Arrays.asList(new String[] { I18n.format(\"bspkrs.configgui.applyGlobally.tooltip\") }), mouseX, mouseY);\n }",
"void render(GraphicsContext gc, double xOffSet, double yOffSet);",
"public void drawScreen(int mouseX, int mouseY, float f)\r\n\t{\r\n\t\tsuper.drawScreen(mouseX, mouseY, f);\r\n\t\txSize_lo = mouseX - 75;\r\n\t\tySize_lo = mouseY;\r\n\t}",
"public void render(int x, int y, Screen screen) {\n }",
"public void drawButton(Minecraft mc, int mouseX, int mouseY, float partialTicks)\n {\n if (this.visible)\n {\n mc.getTextureManager().bindTexture(buttonTexture);\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n boolean flag = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;\n int i = 106;\n\n if (flag)\n {\n i += this.height;\n }\n\n this.drawTexturedModalRect(this.x, this.y, 0, i, this.width, this.height);\n }\n }",
"private void render() {\n\t\tBufferStrategy buffStrat = display.getCanvas().getBufferStrategy();\n\t\tif(buffStrat == null) {\n\t\t\tdisplay.getCanvas().createBufferStrategy(3); //We will have 3 buffered screens for the game\n\t\t\treturn;\n\t\t}\n\n\t\t//A bufferstrategy prevents flickering since it preloads elements onto the display.\n\t\t//A graphics object is a paintbrush style object\n\t\tGraphics g = buffStrat.getDrawGraphics();\n\t\t//Clear the screen\n\t\tg.clearRect(0, 0, width, height); //Clear for further rendering\n\t\t\n\t\tif(State.getState() !=null) {\n\t\t\tState.getState().render(g);\n\t\t}\n\t\t//Drawings to be done in this space\n\t\t\n\t\t\n\t\t\n\t\tbuffStrat.show();\n\t\tg.dispose();\n\t}",
"public void render(){\n //this block is pre-loading 2 frames in\n BufferStrategy bs = this.getBufferStrategy();\n if(bs == null){\n this.createBufferStrategy(2);\n return;\n }\n\n Graphics g = bs.getDrawGraphics();\n Graphics2D g2d = (Graphics2D) g;\n ///////////////////////////\n //Draw things below here!\n g.setColor(Color.white);\n g.fillRect(0, 0, 800, 800);\n\n g2d.translate(-camera.getX(), -camera.getY());\n\n g.setColor(Color.gray);\n g.fillRect(0, 0, 500, 500);\n //render all the objects\n handler.render(g);\n\n //g2d.translate(camera.getX(), camera.getY());\n //Draw things above here!\n ///////////////////////////\n g.dispose();\n bs.show();\n }",
"public void draw(){\n\t\tcomponent.draw();\r\n\t}",
"protected void render() {\n\t\tentities.render();\n\t\t// Render GUI\n\t\tentities.renderGUI();\n\n\t\t// Flips the page between the two buffers\n\t\ts.drawToGraphics((Graphics2D) Window.strategy.getDrawGraphics());\n\t\tWindow.strategy.show();\n\t}",
"@Override\n protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {\n }",
"protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {\n this.mc.getTextureManager().bindTexture(FURNACE_GUI_TEXTURES);\n int i = this.guiLeft;\n int j = this.guiTop;\n this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);\n\n int cookProgressScaled = this.getCookProgressScaled(17);\n this.drawTexturedModalRect(i + 79, j + 34+1, 176, 0, 24, cookProgressScaled);\n\n boolean isBurning = TileEntityCoalGrinder.isBurning(this.tileInventory);\n int burnTime = tileInventory.getField(0);\n int currentItemBurnTime = tileInventory.getField(1);\n\n ((BurnComponent)getComponent(0)).update(isBurning,burnTime,currentItemBurnTime);\n\n super.drawGuiContainerBackgroundLayer(partialTicks,mouseX,mouseY);\n }",
"@Override\n\tpublic void paintComponent(Graphics g) {\n\n\t\ttry {\n\t\t\tGraphics2D g2d = (Graphics2D) g;\n\n\t\t\tfloat w = this.getWidth();\n\t\t\tfloat h = this.getHeight();\n\n\t\t\tRenderingContext batch = new RenderingContext(g2d, w, h);\n\n\t\t\tif (!didInitCam) {\n\t\t\t\tcam = new OrthographicCamera(w, h);\n\n\t\t\t\tcam.zoomFor(world.getSize());\n\n\t\t\t\tdidInitCam = true;\n\t\t\t}\n\n\t\t\tcam.setViewportSize(w, h);\n\n\t\t\t// cam.update(); //Nothing in this function call.\n\t\t\tbatch.setProjectionMatrix(cam);\n\n\t\t\tif (world != null) {\n\t\t\t\tworld.render(batch);\n\t\t\t}\n\n\t\t\t// Render the grid.\n\t\t\tif (showGrid) {\n\t\t\t\tg2d.setStroke(new BasicStroke(1));\n\t\t\t\tg.setColor(new Color(1.0f, 1.0f, 1.0f, 0.5f));\n\t\t\t\tPoint2D.Float size = world.getSize();\n\t\t\t\t// draw Y lines\n\t\t\t\tfor (int i = 0; i <= size.y + .5f; i++) {\n\t\t\t\t\tbatch.drawLine(0, i, size.x, i);\n\t\t\t\t}\n\t\t\t\t// draw X lines\n\t\t\t\tfor (int j = 0; j <= size.x + .5f; j++) {\n\t\t\t\t\tbatch.drawLine(j, 0, j, size.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Render selection stuff.\n\t\t\trenderSelectedTiles(g2d, batch);\n\t\t\trenderSelectedEntities(g2d, batch);\n\t\t\tif (renderingTool != null)\n\t\t\t\trenderingTool.render(g2d, batch);\n\n\t\t} catch (ClassCastException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t}",
"public void render()\n\t{\n\t\t// Get or create the BufferStrategy to plan rendering\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the graphics that can be drawn to\n\t\tg = bs.getDrawGraphics();\n\t\t\n\t\t// Set the Graphics2D\n\t\tg2d = (Graphics2D)g;\n\t\t\n\t\t// Create a black rectangle to fill the canvas as a base background\n\t\tg.setColor(Color.black);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\tif (screenLoaded)\n\t\t{\n\t\t\t// Draw the static background\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawStaticBackground(g);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(game.getCamera().getxPos(), \n\t\t\t\t\t\t \t game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the background layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawBackground(g);\n\t\t\t\n\t\t\t// Render all of the Tiles\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesWorld())\n\t\t\t\tgame.getWorldHandler().renderTiles(g);\n\t\t\t\n\t\t\t// Render all of the GameObjects\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesGameObjects())\n\t\t\t\tgame.getObjectHandler().renderGameObjects(g);\n\t\t\t\n\t\t\t// Draw the foreground layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawForeground(g);\n\t\t\t\n\t\t\t// Draw the lighting\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesLighting())\n\t\t\tg.drawImage(game.getLightHandler().getLightmap(), -1500, -3100, null);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(-game.getCamera().getxPos(), \n\t\t\t\t\t\t \t -game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the gui layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawGui(g);\n\t\t\t\n\t\t\t// Draw the debug layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null\n\t\t\t\t&& game.getDebugScreen() != null\n\t\t\t\t&& game.isDebugShown())\n\t\t\t\tgame.getDebugScreen().showDebug(g);\n\t\t\t\n\t\t\t// Draw the loading \"curtain\" if the screen is still loading\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null &&\n\t\t\t\t!screenLoaded)\n\t\t\t{\n\t\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dispose of all graphics\n\t\t\tg.dispose();\n\t\t\t// Show all graphics prepared on the BufferStrategy\n\t\t\tbs.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tGraphics2D g2 = (Graphics2D)g;\n\t\t\tg2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\t\n\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Dispose of all graphics\n\t\tg.dispose();\n\t\t// Show all graphics prepared on the BufferStrategy\n\t\tbs.show();\n\t}",
"private void render() {\n\n\tbs=display.getCanvas().getBufferStrategy();\t\n\t\n\tif(bs==null) \n\t {\t\n\t\tdisplay.getCanvas().createBufferStrategy(3);\n\t\treturn ;\n\t }\n\t\n\tg=bs.getDrawGraphics();\n\n\t//Clear Screen\n\tg.clearRect(0, 0, width, height);\n\t\n\tif(State.getState()!=null )\n\t\tState.getState().render(g);\n\t\n\t//End Drawing!\n\tbs.show();\n\tg.dispose();\n\t\n\t}",
"public void startRendering() {\n if (!justRendered) {\n justRendered = true;\n \n if (Flags.wireFrame) p.render_wireFrame();\n else p.render();\n }\n }",
"public void render() {\n this.canvas.repaint();\n }",
"protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {\n\t\tsuper.drawGuiContainerBackgroundLayer(partialTicks, mouseX, mouseY);\n\n\t\tGlStateManager.color(1, 1, 1,1 );\n\t\tthis.mc.getTextureManager().bindTexture(getTexture());\n\t\tthis.drawTexturedModalRect(xBase, yBase, 0, 0, xSize, container.inventoryRows * 18 + 17);\n\t\tthis.drawTexturedModalRect(xBase, yBase + container.inventoryRows * 18 + 17, 0, 126, xSize, 96);\n\t}",
"void render(Graphics g);",
"void render(Graphics2D brush);",
"public void render () \n\t{ \n\t\trenderWorld(batch);\n\t\trenderGui(batch);\n\t}",
"private void render() {\n\t\tBufferStrategy bufferStrategy = getBufferStrategy(); //Create BufferStrategy object\n\n\t\t//If the Buffer Strategy doesn't exist, create one\n\t\tif(bufferStrategy == null) {\n\t\t\tcreateBufferStrategy(3); //Triple buffer\n\t\t\treturn; //Return\n\t\t}\n\n\t\tGraphics g = bufferStrategy.getDrawGraphics(); //Create Graphics object\n\t\tg.setColor(Color.black); //Set the colour of the object to black\n\t\tg.fillRect(0, 0, Game.WIDTH, Game.HEIGHT); //Fill the window\n\n\t\t//Start screen\n\t\tif(!startScreen.start && !player.dead && !player.win) {\n\t\t\tstartScreen.render(g); //Render the start screen\n\t\t\t//If the user presses enter\n\t\t\tif(enter) {\n\t\t\t\tstartScreen.start = true; //Game has started\n\t\t\t}\n\t\t}\n\n\t\t//Playing screen\n\t\tif(!player.dead && !player.win && startScreen.start) {\n\t\t\tlevel.render(g); //Render the level\n\t\t\tplayer.render(g); //Render the player to the graphics object\n\t\t\thp(g); //Render the hit points\n\t\t\tif(paused) {\n\t\t\t\tpauseScreen.render(g);\n\t\t\t}\n\t\t}\n\n\t\t//Dead screen\n\t\tif(player.dead){\n\t\t\tdeadScreen.render(g); //Render the dead screen\n\t\t}\n\n\t\t//Win screen\n\t\tif(player.win) {\n\t\t\twinScreen.render(g); //Render the win screen\n\t\t}\n\t\tg.dispose(); //Dispose of the object\n\t\tbufferStrategy.show(); //Show it\n\t}",
"public void render() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) { //if the buffer strategy doesnt get created, then you create it\n\t\t\tcreateBufferStrategy(3); //the number 3 means it creates triple buffering\n\t\t\treturn;\t\t\t\t\t//, so when you backup frame gets displayed (2) it will also have a backup\t\n\t\t}\n\t\t\n\t\t//apply data to the buffer \"bs\"\n\t\t//this is creating a link to graphics to drawing graphics to the screen.\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t/**\n\t\t * You input all of your graphics inbetween the g object and g.dispose();\n\t\t */\n\t\t//###################\n\t\t\n\t\tg.setColor(Color.BLACK);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\t//###################\n\t\tg.dispose(); //this dispose of all the graphics\n\t\tbs.show(); //this will make the next available buffer visible\n\t}",
"public abstract void render(Graphics2D graphics);",
"public void render (Graphics2D g);",
"public void render() {\n backGraphics.drawImage(background, backgroundX, backgroundY, null);\n\n GameObject.renderAll(backGraphics);\n\n //2. Call repaint\n repaint();\n }",
"public void render(Graphics graphics){\n mouseOverArea.render(gameContainer, graphics);\n }",
"@Override\n\tpublic void tick() {\n\t\trenderer.render(this);\n\t}",
"@Override\n protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)\n {\n GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);\n this.mc.getTextureManager().bindTexture(CHEST_GUI_TEXTURE);\n int i = (this.width - this.xSize) / 2;\n int j = (this.height - this.ySize) / 2;\n this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.inventoryRows * 18 + 17);\n this.drawTexturedModalRect(i, j + this.inventoryRows * 18 + 17, 0, 126, this.xSize, 96);\n }",
"private void render() {\n if (game.isEnded()) {\n if (endGui == null) {\n drawEndScreen();\n }\n\n return;\n }\n\n drawScore();\n drawSnake();\n drawFood();\n }",
"@Override\n public void doRender(float delta) {\n if(showWindow) {\n drawTexture(background.getTexture(), marginX, marginY, windowWidth, windowHeigth);\n batch.draw(cursor, origin.x + cursorOriginX + SIZE * cursorPosX, origin.y + cursorOriginY - SIZE * cursorPosY);\n\n\n int iX = 0;\n int iY = 0;\n for (Item item : OverworldScreen.manager.getPlayer().itemList) {\n item.render(cursorOriginX + iX * SIZE, cursorOriginY - iY*SIZE, origin, batch);\n iX++;\n if(iX > maxItemX){\n iX = 0;\n iY++;\n }\n }\n }\n\n\n }",
"public void Render(){\n //player rect\n glPushMatrix();\n glTranslatef(px, py, 0.0f);\n glBegin(GL_TRIANGLES);\n glColor3f(1.0f, 1.0f, 1.0f);\n glVertex2f(-sx, sy);\n glVertex2f(-sx, -sy);\n glVertex2f(sx, sy);\n glVertex2f(sx, sy);\n glVertex2f(-sx, -sy);\n glVertex2f(sx, -sy);\n glEnd();\n glPopMatrix();\n \n if(debug){\n glPushMatrix();\n glBegin(GL_LINES);\n glColor3f(0f, 1f, 0f);\n glVertex2f(px-sx, py+sy/2);\n glVertex2f(px+sx, py+sy/2);\n glColor3f(0f, 1f, 0f);\n glVertex2f(px-sx, py-sy/2);\n glVertex2f(px+sx, py-sy/2);\n glEnd();\n glPopMatrix();\n }\n \n }",
"public void render () {\n\t\tcam.update();\n\t\tbatch.setProjectionMatrix(cam.combined);\n\t\trenderBackground();\n\t\t/*shapeRender.setProjectionMatrix(cam.combined);\n\t\tshapeRender.begin(ShapeRenderer.ShapeType.Line);\n\t\tshapeRender.ellipse(world.trout.hitBox.x, world.trout.hitBox.y, world.trout.hitBox.width, world.trout.hitBox.height);\n\t\tshapeRender.circle(world.hook.circleBounds.x, world.hook.circleBounds.y, world.hook.circleBounds.radius);\n\t\tshapeRender.point(world.trout.position.x, world.trout.position.y, 0f);*/\n\t\trenderObjects();\n\t\t\n\t}",
"protected abstract void render(Graphics g);",
"public void render() {\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null) {\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t// get graphics object for drawing on canvas\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t// clear screen before drawing new objects to it\n\t\tg.setColor(style.getBackCol());\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t// use style from server to draw time information, only if we have\n\t\t// synced the time with the server.\n\t\tg.setColor(style.getTimeCol());\n\t\tif (tim.TIME_SYNCED) {\n\t\t\t// set font and font size, perhaps font can also be customizable in\n\t\t\t// the future?\n\t\t\tg.setFont(new Font(\"TimesRoman\", Font.PLAIN, style.getTimePoint()));\n\t\t\tFontMetrics metrics = g.getFontMetrics(new Font(\"TimesRoman\", Font.PLAIN, style.getTimePoint()));\n\t\t\t// get height to offset text by when drawing.\n\t\t\tint hgt = metrics.getHeight();\n\t\t\t// System.out.println(\"\" +style.getLeft() * WIDTH);\n\t\t\tg.drawString(tim.getTime(), (int) (style.getLeft() * WIDTH), (int) (style.getTop() * HEIGHT + hgt));\n\t\t}\n\t\t// clear graphics from memory and draw screen buffer\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"public abstract void render(Graphics g);",
"private void render() {\n final int numBuffers = 3;\n BufferStrategy bs = this.getBufferStrategy(); // starts value at null\n if (bs == null) {\n this.createBufferStrategy(numBuffers); // 3: buffer creations\n return;\n }\n Graphics g = bs.getDrawGraphics();\n\n g.setColor(Color.black); // stops flashing background\n g.fillRect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);\n\n handler.render(g);\n\n if (gameStart == GAME_STATE.Game) {\n hud.render(g);\n } else if (gameStart == GAME_STATE.Menu || gameStart == GAME_STATE.Help || gameStart == GAME_STATE.GameOver || gameStart == GAME_STATE.GameVictory) {\n menu.render(g);\n }\n\n g.dispose();\n bs.show();\n }",
"@Override\n\tpublic void paint(Graphics graphics) {\n\t\ttry {\n\t\t\t// calls default paint functions in parent object\n\t\t\tsuper.paintComponents(s.getDrawGraphics());\n\n\t\t\t// sets buffer panel to size of window\n\t\t\tbufferPanel.setBounds(0, 0, this.getWidth(), this.getHeight());\n\t\t\t// calls function to draw onto g\n\t\t\tGraphics2D g = (Graphics2D) s.getDrawGraphics();\n\t\t\tdrawJavaString(i_console);\n\t\t\tdrawJavaString(i_palette);\n\n\t\t\tif (i_console_docked) {\n\t\t\t\ti_console.setBounds(p_console.getBounds());\n\t\t\t}\n\t\t\tif (i_palette_docked) {\n\t\t\t\ti_palette.setBounds(p_palette.getBounds());\n\t\t\t}\n\n\t\t\tcontroller.showRects(g);\n\n\t\t\tif(!rightMenuClick){\n\t\t\t\tif(this.getExtendedState() == Frame.MAXIMIZED_BOTH){\n\t\t\t\t\tg.translate(i_palette.getBounds().x, i_palette.getBounds().y+45);\n\t\t\t\t\ti_palette.paintAll(g);\n\t\t\t\t\tg.translate(i_console.getBounds().x - i_palette.getBounds().x, i_console.getBounds().y - i_palette.getBounds().y);\n\t\t\t\t\ti_console.paintAll(g);\n\t\t\t\t\tController.fullscreen = true;\n\t\t\t\t}else{\n\t\t\t\t\tg.translate(i_palette.getBounds().x+5, i_palette.getBounds().y+51);\n\t\t\t\t\ti_palette.paintAll(g);\n\t\t\t\t\tg.translate(i_console.getBounds().x - i_palette.getBounds().x, i_console.getBounds().y - i_palette.getBounds().y);\n\t\t\t\t\ti_console.paintAll(g);\n\t\t\t\t\tController.fullscreen = false;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tcontroller.showBorders(g, 5, 51);\n\t\t\t}\n\n\t\t\ts.show();\n\t\t\tToolkit.getDefaultToolkit().sync();\n\t\t\tif (rectToBeRemoved != -1) {\n\t\t\t\tdelete(rectToBeRemoved);\n\t\t\t\tcontroller.getRects().remove(rectToBeRemoved);\n\t\t\t\trectToBeRemoved = -1;\n\t\t\t}\n\t\t\trepaint();\n\t\t} catch (Exception ex) {\n\t\t}\n\t}",
"public void Draw(Graphics2D g2d, Point mousePosition)\n {\n \n }",
"@Override\n\tpublic void render() {\n\t\tScreen.render();\n\t}",
"public void render(){\n\t\tBufferStrategy bs = frame.getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tframe.createBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\trenderGraphics(bs);\n\t}",
"private void render(){\n planeImage.draw(currPos.x,currPos.y, drawOps);\n }",
"public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"@SideOnly(Side.CLIENT)\n public abstract void render(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks);",
"public void DrawScreen() {\r\n DrawScreen(0, false, null);\r\n }",
"public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}",
"public synchronized void display() {\r\n\r\n\t\t// clear the screen and draw a yellow square\r\n\t\tgl.clear(GL.COLOR_BUFFER_BIT);\r\n\t\t// First rectangle\r\n\t\tgl.pushMatrix();\r\n\t\tgl.translate(-0.5, 0.0, 0.0);\r\n\t\tgl.rotate(spin, 0.0, 0.0, 1.0);\r\n\t\tgl.rect(-0.5, -0.5, 0.5, 0.5);\r\n\t\tgl.popMatrix();\r\n\t\t// Second rectangle\r\n\t\tgl.pushMatrix();\r\n\t\tgl.translate(0.5, 0.0, 0.0);\r\n\t\tgl.rotate(-spin, 0.0, 0.0, 1.0);\r\n\t\tgl.rect(-0.5, -0.5, 0.5, 0.5);\r\n\t\tgl.popMatrix();\r\n\t\tgl.flush(); // Make sure all commands have completed.\r\n\t\tgl.swap();\t // Swap the render buffer with the screen buffer\r\n\t}",
"@Override\n public void paintComponent(Graphics g) {\n super.paintComponent(g);\n render(g);\n }",
"public void update () {\n fill (175);\n rect(mouseX,mouseY,w,h);\n }",
"public void render() {\n\t\tscreen.background(255);\n\t\thandler.render();\n\t}",
"public void draw() {\n /* put graphical code here, runs repeatedly at defined framerate in setup, else default at 60fps: */\n if (renderingForce == false) {\n background(255); \n //imageMode(CORNERS);\n image(outputSplat, 0, 0);\n world.draw();\n checkChangeColor();\n }\n}",
"public void render(Screen screen) {\n\t\tscreen.renderInterface(x, y, width, height, button, clicked); //renders all 4 pieces of the 32x32 sprite. Modifying the x or y will change where the screen is centered.\n\t}",
"@Override\r\n\tpublic void render() {\r\n\r\n\t\tsb.setProjectionMatrix(cam.combined);\r\n\r\n\t\t// draw background\r\n\t\tbg.render(sb);\r\n\r\n\t\t// draw button\r\n\t\tlevel1.render(sb);\r\n\t\tlevel2.render(sb);\r\n\t\tlevel3.render(sb);\r\n\t\t\r\n\t\tif (gameMode == 1){\r\n\t\t\tplayer1press.render(sb);\r\n\t\t\tplayer2press.render(sb);\r\n\t\t}\r\n\t\telse \r\n\t\t\tplayerpress.render(sb);\r\n\t\t\r\n\t\t\r\n\t selectTheLevel.render(sb);\r\n\t\t\r\n\t\tmainMenuB.render(sb);\r\n\r\n\t\t// debug draw box2d\r\n\t\tif(debug) {\r\n\t\t\tcam.setToOrtho(false, Game.V_WIDTH / 100, Game.V_HEIGHT / 100);\r\n\t\t\tb2dRenderer.render(world, cam.combined);\r\n\t\t\tcam.setToOrtho(false, Game.V_WIDTH, Game.V_HEIGHT);\r\n\t\t}\r\n\r\n\t}",
"void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}",
"static void draw()\n {\n for (Viewport viewport : viewports)\n viewport.draw(renderers);\n }",
"protected void drawGUI() {\n batch.draw(background, 0, 0);\n }",
"@Override\n public void render() {\n sortEntities(Entity.getEntities());\n renderBackground();\n renderBattleState();\n if(selectedPc != null){\n MyGL2dRenderer.drawLabel(getSelectedPc().getCollisionBox().left - 4 * GameView.density() + cameraX,\n getSelectedPc().getCollisionBox().bottom - getSelectedPc().getCollisionBox().width() / 5 + cameraY,\n getSelectedPc().getCollisionBox().width() + 8 * GameView.density(),\n getSelectedPc().getCollisionBox().width() * 2 / 5,\n TextureData.selected_character_visual, 255);\n }\n if(!win){\n renderSpells();\n renderGold();\n }\n }",
"public void render(Graphics graphics) {\n double xOffScreen = camPos.getX() % Constants.TILE_SIZE;\n double yOffScreen = camPos.getY() % Constants.TILE_SIZE;\n\n int firstTileX = Math.max(0, Math.min(world.getXSize(), (int) (camPos.getX() - xOffScreen) / Constants.TILE_SIZE));\n int firstTileY = Math.max(0, Math.min(world.getYSize(), (int) (camPos.getY() - yOffScreen) / Constants.TILE_SIZE));\n\n int lastTileX = Math.min((int) (camPos.getX() + Constants.WINDOW_SIZE.getIntX() +\n (Constants.TILE_SIZE - (camPos.getX() % Constants.TILE_SIZE))) / Constants.TILE_SIZE, world.getXSize());\n int lastTileY = Math.min((int) (camPos.getY() + Constants.WINDOW_SIZE.getIntY() +\n (Constants.TILE_SIZE - (camPos.getY() % Constants.TILE_SIZE))) / Constants.TILE_SIZE, world.getYSize());\n\n computerLabels.clear();\n\n for (int x = firstTileX; x < lastTileX; x++) {\n for (int y = firstTileY; y < lastTileY; y++) {\n\n Tile tile = world.getTile(x, y).get();\n Image img;\n if (tile.type.spriteX < 0 || tile.type.spriteY < 0)\n img = TextureManager.imageMap.get(tile.type.name);\n else\n img = TextureManager.sprites.getSubImage(tile.type.spriteX, tile.type.spriteY);\n\n tile.type.renderer.render(img,\n (float) -camPos.getX() + x * Constants.TILE_SIZE,\n (float) -camPos.getY() + y * Constants.TILE_SIZE\n );\n\n // Add computer user label to render list if necessary\n if (tile.type == TileType.COMPUTER) {\n String user = ((TileMetadata.ComputerMetadata) tile.metadata).user;\n if (user != null)\n this.computerLabels.put(new Point(x * Constants.TILE_SIZE, y * Constants.TILE_SIZE), user);\n }\n }\n }\n\n // Render the computer labels over the tiles\n this.computerLabels.entrySet().forEach(pair -> {\n Point p = pair.getKey();\n String str = pair.getValue();\n float x = (float) p.getX() - (str.length() / 2 * 5), y = (float) p.getY() - Constants.TILE_SIZE / 2;\n graphics.setColor(new Color(0.17f, 0.17f, 0.19f, 0.9f));\n graphics.fillRect(x - 3, y - 2, graphics.getFont().getWidth(str) + 7, graphics.getFont().getHeight(str) + 5);\n graphics.setColor(Color.white);\n graphics.drawString(str, x, y);\n });\n\n /* //TODO: Move GUI code\n PlayerEntity player = GameClient.INSTANCE.player;\n\n // draw caffeine bar\n player.caffeineLevel = PlayerEntity.MAX_CAFFEINE / 2;\n graphics.setColor(Color.white);\n graphics.drawString(\"Caffeine\", 0, 30);\n graphics.setColor(Color.black);\n graphics.fillRect(10, 60, 40, PlayerEntity.MAX_CAFFEINE * 3);\n graphics.setColor(Color.green);\n graphics.fillRect(10, PlayerEntity.MAX_CAFFEINE * 3 - player.caffeineLevel * 3 + 60, 40, player.caffeineLevel * 3);\n\n // draw relaxation bar\n player.relaxationLevel = PlayerEntity.MAX_RELAXATION / 2;\n graphics.setColor(Color.white);\n graphics.drawString(\"Relaxation\", 75, 30);\n graphics.setColor(Color.black);\n graphics.fillRect(85, 60, 40, PlayerEntity.MAX_RELAXATION * 3);\n graphics.setColor(Color.blue);\n graphics.fillRect(85, PlayerEntity.MAX_RELAXATION * 3 - player.relaxationLevel * 3 + 60, 40, player.relaxationLevel * 3);\n\n graphics.setColor(Color.white);\n graphics.drawString(\"Score: 1010101\", 10, 100);*/\n }",
"public void renderAll()\n {\n \tthis.panel.rotateAngleX = -0.32f;\n this.lid.render(0.0625F);\n this.sideBox.render(0.0625F);\n this.box.render(0.0625F);\n this.panel.render(0.0625F);\n\n GL11.glDisable(GL11.GL_CULL_FACE);\n this.inner.render(0.0625F);\n GL11.glEnable(GL11.GL_CULL_FACE);\n \n this.innerStand.rotateAngleY = 0+rotateCentrifuge;\n this.innerStand.render(0.0625F);\n this.innerStand.rotateAngleY = 0.7854F+rotateCentrifuge;\n this.innerStand.render(0.0625F);\n }",
"public void paint(Graphics g)\n\t{\n\t\tg.drawString(mouse.mouse.toString(), 500, 20);\n\t\t\n\t\tg.setColor(Color.black);\n\t\tPosition.drawAxis(g, 1);\n\t\tg.drawString(\"FPS: \"+thread.Engine.fps,10,20);\n\t\tg.drawString(\"FPSSCR: \"+fpsscr,10,40);\n\t\t\n\t\tEngine.ball1.drawFill(g);\n\t\t//Engine.ball1.drawVelocity(g);\n\t\tEngine.ball2.draw(g);\n\t\t//Engine.ball2.drawVelocity(g);\n\t\tEngine.plane1.draw(g, 1000);\n\t\tEngine.plane2.draw(g, 1000);\n\t\tEngine.plane3.draw(g, 1000);\n\t\tEngine.plane4.draw(g, 1000);\n\t\t\n\t\tmouse.mouse.draw(g, 1);\n\t\t\n\t\tupdatefps();\n\t}",
"public void render()\n\t{\n\t\t//double buffering is cool\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(2);\n\t\t\tbs = getBufferStrategy();\n\t\t}\n\t\t\t\n\t\tGraphics2D g2 = (Graphics2D)bs.getDrawGraphics();\n\t\n\t\t\n\t\t\n\t\tif (true)\t\n\t\t{\n\t\t\tif (level != 0)\n\t\t\t{\n\t\t\t\tg2.setColor(Color.black);\n\t\t\t\tg2.fillRect(0, 0, width, height);\t\t\t\n\t\t\t}\n\t\t\tgameObjectHandler.render(g2,false);\n\t\t}\n\t\tif(currTransition != null)\n\t\t{\n\t\t\tcurrTransition.render(g2);\n\t\t\n\t\t}\n\t\t\n\t\t\n\t\tbs.show();\n\t\tg2.dispose();\n\t\n\t}",
"@Override\n public void drawScreen(int n, int n2) {\n void mouseY;\n void mouseX;\n super.drawScreen((int)mouseX, (int)mouseY);\n float[] hsb = Color.RGBtoHSB(this.setting.getValue().getRed(), this.setting.getValue().getGreen(), this.setting.getValue().getBlue(), null);\n Color color = Color.getHSBColor(hsb[0], Float.intBitsToFloat(Float.floatToIntBits(6.4887953f) ^ 0x7F4FA436), Float.intBitsToFloat(Float.floatToIntBits(4.629535f) ^ 0x7F142527));\n Gui.drawRect((int)this.getX(), (int)this.getY(), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 14), (int)new Color(40, 40, 40).getRGB());\n Gui.drawRect((int)(this.getX() + this.getWidth() - 12), (int)(this.getY() + 2), (int)(this.getX() + this.getWidth() - 2), (int)(this.getY() + 12), (int)this.setting.getValue().getRGB());\n RenderUtils.drawOutline(this.getX() + this.getWidth() - 12, this.getY() + 2, this.getX() + this.getWidth() - 2, this.getY() + 12, Float.intBitsToFloat(Float.floatToIntBits(2.7144578f) ^ 0x7F2DB9AD), new Color(20, 20, 20).getRGB());\n if (this.open) {\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 14), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 28), (int)new Color(40, 40, 40).getRGB());\n float i = Float.intBitsToFloat(Float.floatToIntBits(1.3378998E38f) ^ 0x7EC94E07);\n while (i + Float.intBitsToFloat(Float.floatToIntBits(13.8331995f) ^ 0x7EDD54C9) < Float.intBitsToFloat(Float.floatToIntBits(0.07128618f) ^ 0x7F51FE7D)) {\n RenderUtils.drawRecta((float)(this.getX() + 2) + i, this.getY() + 16, Float.intBitsToFloat(Float.floatToIntBits(7.249331f) ^ 0x7F67FA85), Float.intBitsToFloat(Float.floatToIntBits(1.7045807f) ^ 0x7EEA2FB3), Color.getHSBColor(i / Float.intBitsToFloat(Float.floatToIntBits(0.115068644f) ^ 0x7F2BA91C), Float.intBitsToFloat(Float.floatToIntBits(4.3161592f) ^ 0x7F0A1DFA), Float.intBitsToFloat(Float.floatToIntBits(21.075346f) ^ 0x7E289A4F)).getRGB());\n i += Float.intBitsToFloat(Float.floatToIntBits(3.807338f) ^ 0x7E95CD0B);\n }\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 16, this.getX() + 2 + this.getWidth() - 4, this.getY() + 27, Float.intBitsToFloat(Float.floatToIntBits(2.7503529f) ^ 0x7F3005C8), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.hueWidth, this.getY() + 16, Float.intBitsToFloat(Float.floatToIntBits(5.200255f) ^ 0x7F26687D), Float.intBitsToFloat(Float.floatToIntBits(1.2665411f) ^ 0x7E921E05), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 28), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 42), (int)new Color(40, 40, 40).getRGB());\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 29, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(0.19645536f) ^ 0x7F792B98), new Color(255, 255, 255), color, 255, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 29, this.getX() + 2 + this.getWidth() - 4, this.getY() + 40, Float.intBitsToFloat(Float.floatToIntBits(103.69628f) ^ 0x7DCF647F), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.satWidth, this.getY() + 29, Float.intBitsToFloat(Float.floatToIntBits(7.3489017f) ^ 0x7F6B2A34), Float.intBitsToFloat(Float.floatToIntBits(0.1948352f) ^ 0x7F7782E1), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 42), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 56), (int)new Color(40, 40, 40).getRGB());\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 42, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(1.5246161f) ^ 0x7EF3269F), new Color(0, 0, 0), color, 255, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 42, this.getX() + 2 + this.getWidth() - 4, this.getY() + 53, Float.intBitsToFloat(Float.floatToIntBits(3.7803736f) ^ 0x7F71F1A4), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.briWidth, this.getY() + 42, Float.intBitsToFloat(Float.floatToIntBits(8.346171f) ^ 0x7E8589EB), Float.intBitsToFloat(Float.floatToIntBits(0.08925866f) ^ 0x7C86CD3F), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 56), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 70), (int)new Color(40, 40, 40).getRGB());\n this.renderAlphaBG(this.getX() + 2, this.getY() + 55, this.alphaBG);\n RenderUtils.drawSidewaysGradient(this.getX() + 2, this.getY() + 55, this.getWidth() - 4, Float.intBitsToFloat(Float.floatToIntBits(0.13166903f) ^ 0x7F36D43F), new Color(0, 0, 0), color, 0, 255);\n RenderUtils.drawOutline(this.getX() + 2, this.getY() + 55, this.getX() + 2 + this.getWidth() - 4, this.getY() + 66, Float.intBitsToFloat(Float.floatToIntBits(19.69502f) ^ 0x7E9D8F67), new Color(0, 0, 0).getRGB());\n RenderUtils.drawRecta((float)(this.getX() + 2) + this.alphaWidth, this.getY() + 55, Float.intBitsToFloat(Float.floatToIntBits(6.702013f) ^ 0x7F5676E4), Float.intBitsToFloat(Float.floatToIntBits(0.13652846f) ^ 0x7F3BCE1E), new Color(255, 255, 255).getRGB());\n Gui.drawRect((int)this.getX(), (int)(this.getY() + 70), (int)(this.getX() + this.getWidth()), (int)(this.getY() + 84), (int)new Color(40, 40, 40).getRGB());\n Europa.FONT_MANAGER.drawString(\"Rainbow\", this.getX() + 3, (float)(this.getY() + 78) - Europa.FONT_MANAGER.getHeight() / Float.intBitsToFloat(Float.floatToIntBits(0.8730777f) ^ 0x7F5F8205), Color.WHITE);\n Gui.drawRect((int)(this.getX() + this.getWidth() - 12), (int)(this.getY() + 72), (int)(this.getX() + this.getWidth() - 2), (int)(this.getY() + 82), (int)new Color(30, 30, 30).getRGB());\n if (this.setting.getRainbow().booleanValue()) {\n RenderUtils.prepareGL();\n GL11.glShadeModel((int)7425);\n GL11.glEnable((int)2848);\n GL11.glLineWidth((float)Float.intBitsToFloat(Float.floatToIntBits(0.2713932f) ^ 0x7EAAF40D));\n GL11.glBegin((int)1);\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.015137452f) ^ 0x7F070313)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(1.1948546f) ^ 0x7CE7F0FF)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.36357376f) ^ 0x7DC52657)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8), (double)(this.getY() + 80));\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.015521388f) ^ 0x7F014D6B)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.01025841f) ^ 0x7F5712E4)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.10675689f) ^ 0x7EA5A35B)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8 + 4), (double)(this.getY() + 74));\n GL11.glEnd();\n GL11.glBegin((int)1);\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.009417259f) ^ 0x7F654AD9)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.07014828f) ^ 0x7EF0A9E7)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.013465701f) ^ 0x7F239F3E)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 8), (double)(this.getY() + 80));\n GL11.glColor3f((float)((float)ModuleColor.getActualColor().getRed() / Float.intBitsToFloat(Float.floatToIntBits(0.0155056f) ^ 0x7F010B33)), (float)((float)ModuleColor.getActualColor().getGreen() / Float.intBitsToFloat(Float.floatToIntBits(0.011914493f) ^ 0x7F3C3501)), (float)((float)ModuleColor.getActualColor().getBlue() / Float.intBitsToFloat(Float.floatToIntBits(0.012230922f) ^ 0x7F376434)));\n GL11.glVertex2d((double)(this.getX() + this.getWidth() - 10), (double)(this.getY() + 77));\n GL11.glEnd();\n RenderUtils.releaseGL();\n }\n }\n Gui.drawRect((int)(this.getX() - 1), (int)this.getY(), (int)this.getX(), (int)(this.getY() + 84), (int)new Color(30, 30, 30).getRGB());\n Gui.drawRect((int)(this.getX() + this.getWidth()), (int)this.getY(), (int)(this.getX() + this.getWidth() + 1), (int)(this.getY() + 84), (int)new Color(30, 30, 30).getRGB());\n Europa.FONT_MANAGER.drawString(this.setting.getName(), this.getX() + 3, this.getY() + 3, Color.WHITE);\n }",
"@Override\n\t\tpublic void renderButton(int mouseX, int mouseY){\n\t\t}",
"protected void renderMap(float mouseLocationX, float mouseLocationY)\n {\n float tileSize = zoom;\n\n //Calculate the number of tiles that can fit on screen\n int tiles_x = (int) Math.ceil(screenSizeX / tileSize) + 2;\n int tiles_y = (int) Math.ceil(screenSizeY / tileSize) + 2;\n\n //Offset tile position based on camera\n int center_x = (int) (cameraPosX - (zoom / 2f));\n int center_y = (int) (cameraPosY - (zoom / 2f));\n\n //Calculate the offset to make tiles render from the center\n int renderOffsetX = (tiles_x - 1) / 2;\n int renderOffsetY = (tiles_y - 1) / 2;\n\n //Get the position of the mouse based on screen size and tile scale\n float mouseScreenPosXScaled = mouseLocationX * screenSizeX / tileSize;\n float mouseScreenPosYScaled = mouseLocationY * screenSizeY / tileSize;\n\n //Get the position of the mouse relative to the map\n int mouseMapPosX = (int) Math.floor(center_x + mouseScreenPosXScaled);\n int mouseMapPosY = (int) Math.floor(center_y + mouseScreenPosYScaled);\n\n //Get the tile the mouse is currently over\n Tile tileUnderMouse = game.getWorld().getTile(mouseMapPosX, mouseMapPosY, cameraPosZ);\n\n //Render tiles\n for (int x = -renderOffsetX; x < renderOffsetX; x++)\n {\n for (int y = -renderOffsetY; y < renderOffsetY; y++)\n {\n int tile_x = x + center_x;\n int tile_y = y + center_y;\n Tile tile = game.getWorld().getTile(tile_x, tile_y, cameraPosZ);\n if (tile != Tiles.AIR)\n {\n TileRender.render(tile, x * tileSize, y * tileSize, zoom);\n }\n }\n }\n\n //Render entities\n for (Entity entity : game.getWorld().getEntities())\n {\n //Ensure the entity is on the floor we are rendering\n if (entity.zi() == cameraPosZ)\n {\n float tile_x = (entity.xf() - center_x) * tileSize;\n float tile_y = (entity.yf() - center_y) * tileSize;\n\n //Ensure the entity is in the camera view\n if (tile_x >= cameraBoundLeft && tile_x <= cameraBoundRight)\n {\n if (tile_y >= cameraBoundBottom && tile_y <= cameraBoundTop)\n {\n EntityRender.render(entity, tile_x, tile_y, 0, zoom);\n\n if (mouseMapPosX == entity.xi() && mouseMapPosY == entity.yi())\n {\n String s = entity.getDisplayName();\n fontRender.render(s, mouseLocationX * screenSizeX, mouseLocationY * screenSizeY, 0, 0, .5f * zoom);\n }\n }\n }\n }\n }\n\n float x = mouseMapPosX * tileSize;\n float y = mouseMapPosY * tileSize;\n\n //System.out.println(x + \" \" + y + \" \" + zoom + \" \" + tx + \" \" + ty + \" \" + tile);\n\n if (currentGuiComponetInUse != null)\n {\n target_render.render(x - center_x * tileSize, y - center_y * tileSize, 0, 0, zoom);\n }\n else\n {\n box_render.render(x - center_x * tileSize, y - center_y * tileSize, 0, 0, zoom);\n }\n\n if (!MouseInput.leftClick() && clickLeft)\n {\n clickLeft = false;\n doLeftClickAction(mouseMapPosX, mouseMapPosY, cameraPosZ, mouseLocationX, mouseLocationY);\n }\n\n if (!MouseInput.rightClick() && clickRight)\n {\n clickRight = false;\n doRightClickAction(mouseMapPosX, mouseMapPosY, cameraPosZ, mouseLocationX, mouseLocationY);\n }\n }",
"public void render(){\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif(bs == null){\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//Sets graphics in screen and clears them\n\t\tGraphics g = bs.getDrawGraphics();\n\t\tscreen.graphics(g);\n\t\tscreen.clear();\n\t\t\n\t\tGraphics2D graphics2d = (Graphics2D) g;\n\t\t\n\t\t//Adds antialiasing to text\n\t\tgraphics2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\n\t\tmanager.render(screen);\n\t\t\n\t\tfor(int i = 0; i < WIDTH*HEIGHT; i++){\n\t\t\tpixels[i] = screen.getPixels()[i];\n\t\t}\n\t\tg.drawImage(image, 0, 0, getWidth(), getHeight(), null);\n\t\t\n\t\t//Draw text from string buffer\n\t\tfor(StringObject so : screen.stringBuffer){\n\t\t\tString s = so.string;\n\t\t\tg.setColor(so.color);\n\t\t\tg.setFont(so.font);\n\t\t\tg.drawString(s, so.xp, so.yp);\n\t\t}\n\t\tscreen.stringBuffer.clear();\n\t\t\n\t\t//Draws pause graphics\n\t\tif(screen.pause && manager.getState() == 2){\n\t\t\tg.setColor(new Color((0xcc00aa & 0xff0000) >> 16, (0xcc00aa & 0xff00) >> 8, (0xcc00aa & 0xff), 255));\n\t\t\tg.fillRect(0, 290, screen.getWidth(), 170);\n\t\t\tg.setColor(new Color((0x222222 & 0xff0000) >> 16, (0x222222 & 0xff00) >> 8, (0x222222 & 0xff), 255));\n\t\t\tg.fillRect(0, 300, screen.getWidth(), 150);\n\t\t\t\n\t\t\tg.setColor(Color.WHITE);\n\t\t\tg.setFont(new Font(\"Audiowide\", Font.PLAIN, 90));\n\t\t\tg.drawString(\"PAUSED\", 330, 380);\n\t\t\tg.setFont(new Font(\"Audiowide\", Font.PLAIN, 30));\n\t\t\tg.drawString(\"Press Escape to Resume\", 340, 420);\n\t\t}\n\t\t\n\t\tg.dispose();\n\t\tbs.show();\n\t}",
"void render() {\n\t\tif (!dragLock)\n\t\t\tfucusLocks();\n\n\t\t// display help information\n\t\tString selected = isSelected ? \" [selected]\" : \"\";\n\t\tmyParent.text(id + selected, anchor.x + 10, anchor.y);\n\n\t\t// display points and lines with their colourings\n\t\tfor (int i = 0; i < amount; i++) {\n\n\t\t\tpoint[i].render();\n\n\t\t\tif (state == State.DRAG_AREA)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\n\t\t\tline[i].draw();\n\n\t\t}\n\n\t\t// display rotation ellipse in anchor position\n\t\tif (state == State.ROTATE && isSelected) {\n\t\t\tmyParent.noFill();\n\t\t\tif (!dragLock)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\t\t\telse\n\t\t\t\tmyParent.stroke(0, 255, 0);\n\t\t\tmyParent.ellipse(anchor.x, anchor.y, 15, 15);\n\t\t}\n\n\t\t// display drag area rectangle in anchor position\n\t\tif (state == State.DRAG_AREA) {\n\t\t\tmyParent.noFill();\n\t\t\tif (!dragLock)\n\t\t\t\tmyParent.stroke(255, 255, 0);\n\t\t\telse\n\t\t\t\tmyParent.stroke(0, 255, 0);\n\t\t\tmyParent.rect(anchor.x, anchor.y, 15, 15);\n\t\t}\n\n\t\t// display anchor point\n\t\tmyParent.rect(anchor.x, anchor.y, 5, 5);\n\n\t\t// display line centres\n\t\tmyParent.noFill();\n\t\tmyParent.stroke(150);\n\t\tmyParent.rectMode(PConstants.CENTER);\n\t\tmyParent.rect(X.x, X.y, 5, 5);\n\t\tmyParent.rect(Y.x, Y.y, 5, 5);\n\t\tmyParent.rect(Z.x, Z.y, 5, 5);\n\t\tmyParent.rect(Q.x, Q.y, 5, 5);\n\t}",
"private void render() {\n\t\tBufferStrategy bs = this.getBufferStrategy();\r\n\t\tif (bs == null) {\r\n\t\t\tcreateBufferStrategy(3);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t//Initiates Graphics class using bufferStrategy\r\n\t\tGraphics g = bs.getDrawGraphics();\r\n\t\t\r\n\t\t//displays img on screen\r\n\t\tg.drawImage(img, 0, 0, null);\r\n\t\t\r\n\t\tg.setColor(Color.CYAN);\r\n\t\tg.drawString(fps + \" FPS\", 10, 10);\r\n\t\tg.setFont(new Font(\"Arial\", 0, 45));\r\n\r\n\t\tg.dispose();//clears graphics\r\n\t\tbs.show();//shows graphics\r\n\t}",
"public void render() { image.drawFromTopLeft(getX(), getY()); }",
"@Override\n\tpublic void render(Graphics g, int x, int y) {\n\t\tg.setColor(Color.cyan);\n\t\tg.fillRect(x, y, this.getWidth(), this.getHeight());\n\t}",
"@Override\r\n\tpublic void render(Graphics g) {\n\t\tg.setColor(Color.yellow);\r\n\t\tg.fillRect((int) getX(), (int) getY(), 5, 10);\r\n\t}",
"private void updateAndRender(long deltaMillis) {\n currentState.update(deltaMillis / 1000f); \r\n //Double Buffering (reduce tearing)\r\n prepareGameImage();\r\n currentState.render(gameImage.getGraphics(), this.getWidth(), this.getHeight());\r\n renderGameImage(getGraphics());\r\n }",
"public void render (int left, int top, int right, int bottom) {\n \n if ((clientSite != AX_NO_CLIENT_SITE) || loaded) {\n synchronized (this) {\n messagesWaiting.add(new OleThreadRequest(RENDER,\n top, left, bottom, right));\n notify();\n }\n }\n }",
"@Override\n\tpublic void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) {\n\t\tfield_154330_a.render(p_73863_1_, p_73863_2_, p_73863_3_);\n\t}",
"public void render(PoseStack stack, int mouseX, int mouseY, float delta) {\n PoseStack entityRenderStack = RenderSystem.getModelViewStack();\n entityRenderStack.pushPose();\n stack.pushPose();\n\n zoomInScale += 0.25 * delta;\n zoomInScale = Mth.clamp(zoomInScale, 0, 1);\n entityRenderStack.scale(zoomInScale, zoomInScale, zoomInScale);\n stack.scale(zoomInScale, zoomInScale, 0);\n\n fill(stack, (int) (this.width / 2 - (312 * guiScale)), bgStartHeight, (int) (this.width / 2 + (312 * guiScale)), (int) (this.height / 2 + (256 * guiScale)), Colors.BACKGROUND_GRAY.getColor().getInt());\n RenderUtil.renderScaledText(stack, mc.font, new TranslatableComponent(\"osmium.cape_select\"), (int) (this.width / 2 + (180 * guiScale)), bgStartHeight + (10 * guiScale), Colors.WHITE.getColor().getInt(), (float) guiScale, true);\n\n List<Cape> pageCapes = capePages.get(currentPage.get());\n\n for(int i = 0; i < pageCapes.size(); i++) {\n Cape cape = pageCapes.get(i);\n\n if(CosmeticManager.playerCapes.get(mc.player.getStringUUID()) != null && CosmeticManager.playerCapes.get(mc.player.getStringUUID()).registryName.equals(cape.registryName)) {\n fill(stack, (int) (this.width / 2 + (100 * guiScale)), (int) (bgStartHeight + (40 + (i * 70)) * guiScale), (int) (this.width / 2 + (300 * guiScale)), (int) (bgStartHeight + (100 + (i * 70)) * guiScale), Colors.DARK_GRAY.getColor().getInt());\n }\n\n drawOutlinedBox(stack, (int) (this.width / 2 + (100 * guiScale)), (int) (bgStartHeight + (40 + (i * 70)) * guiScale), (int) (200 * guiScale), (int) (60 * guiScale), Colors.WHITE.getColor().getInt());\n stack.pushPose();\n RenderUtil.positionAccurateScale(stack, 0.5f, (int) (this.width / 2 + (70 * guiScale)), (int) (bgStartHeight + (40 + (i * 70) - 10) * guiScale), (int) (160 * guiScale), (int) (80 * guiScale));\n // something wacky going on here\n // view stack scaling is slightly off, so we have to change pos a bit\n RenderSystem.setShaderTexture(0, cape.getFrameTexture());\n blit(stack, (int) (this.width / 2 + (70 * guiScale)), (int) (bgStartHeight + (40 + (i * 70) - 10) * guiScale), 0, 0 , (int) (160 * guiScale), (int) (80 * guiScale), (int) (160 * guiScale), (int) (80 * guiScale));\n stack.popPose();\n\n // these coordinates are just insane\n RenderUtil.renderScaledText(stack, mc.font,\"Source: \" + cape.source, (int) (this.width / 2 + (200 * guiScale)), (int) (bgStartHeight + (40 + (i * 70) + 15) * guiScale), Colors.WHITE.getColor().getInt(), (float) guiScale, true);\n RenderUtil.renderScaledText(stack, mc.font, \"Animated: \" + cape.isAnimated, (int) (this.width / 2 + (200 * guiScale)), (int) (bgStartHeight + (40 + (i * 70) + 25) * guiScale), Colors.WHITE.getColor().getInt(), (float) guiScale, true);\n RenderUtil.renderScaledText(stack, mc.font, \"Creator: \" + cape.creator, (int) (this.width / 2 + (200 * guiScale)), (int) (bgStartHeight + (40 + (i * 70) + 35) * guiScale) , Colors.WHITE.getColor().getInt(), (float) guiScale, true);\n }\n\n RenderUtil.renderScaledText(stack, mc.font, currentPage.get() + 1 + \"/\" + capePages.size(), (int) (this.width / 2 + (200 * guiScale)), (int) (bgStartHeight + (475 * guiScale)), Colors.WHITE.getColor().getInt(), (float) guiScale, true);\n\n playerXRot -= 0.15 * delta;\n if(playerXRot <= -179.85) {\n playerXRot = 180;\n }\n\n // spent 2 hours fixing depth testing issues because I forgot to scale the ModelViewStack properly\n // please help\n renderEntityInInventory((int) (this.width / 2 - (150 * guiScale)), (int) (bgStartHeight + (300 * guiScale)), (int) (140 * guiScale), playerXRot, 0, mc.player);\n stack.popPose();\n entityRenderStack.popPose();\n super.render(stack, mouseX, mouseY, delta);\n }",
"@Override\r\n\tpublic Void call(){\r\n\t\tupdateProgress(0, 1);\r\n\t\trendering = true;\r\n\t\t\r\n\t\tlong startTime = System.currentTimeMillis();\r\n\t\t\r\n\t\tfor(int i = 0; i < numberOfThreads; i++){\r\n\t\t\tthreads[i] = new RenderThread(i * (WIDTH / numberOfThreads), (i + 1) * (WIDTH / numberOfThreads), this);\r\n\t\t}\r\n\t\t\r\n\t\twhile(rendering){\r\n\t\t\tint threadsRunning = numberOfThreads;\r\n\t\t\tfloat percentComplete = 0f;\r\n\r\n\t\t\tfor(RenderThread t : threads){\r\n\t\t\t\tif(!t.isRendering()){\r\n\t\t\t\t\tthreadsRunning -= 1;\r\n\t\t\t\t\tpercentComplete += 1f / numberOfThreads;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tfloat percent = t.getPercentComplete();\r\n\t\t\t\t\tpercentComplete += (percent / numberOfThreads);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tupdateProgress((double) (percentComplete), 1);\r\n\t\t\t\r\n\t\t\tif(threadsRunning == 0){\r\n\t\t\t\trendering = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tlong renderTime = System.currentTimeMillis() - startTime;\r\n\t\t\r\n\t\trendering = false;\r\n\t\t\r\n\t\tlong hours = TimeUnit.MILLISECONDS.toHours(renderTime);\r\n\t\trenderTime -= TimeUnit.HOURS.toMillis(hours);\r\n\t\tlong minutes = TimeUnit.MILLISECONDS.toMinutes(renderTime);\r\n\t\trenderTime -= TimeUnit.MINUTES.toMillis(minutes);\r\n\t\tlong seconds = TimeUnit.MILLISECONDS.toSeconds(renderTime);\r\n\t\t\r\n\t\tString time = String.format(\"Render Time: %d hours, %d minutes, %d seconds\", hours, minutes, seconds);\r\n\t\tToolkit.getDefaultToolkit().beep();\r\n\t\t\r\n\t\tSystem.out.println(time);\r\n\t\t\r\n\t\tdrawSet();\r\n\t\t\r\n\t\tif(autoSave){\r\n\t\t\tautoSave();\r\n\t\t}\r\n\t\t\r\n\t\tif(iterationChange){\r\n\t\t\tITERATIONS = changedIterations;\r\n\t\t\titerationChange = false;\r\n\t\t}\r\n\t\t\r\n\t\tif(zoomChange){\r\n\t\t\tZOOM = changedZoom;\r\n\t\t\tzoomChange = false;\r\n\t\t\tchangedZoom = null;\r\n\t\t}\r\n\t\t\r\n\t\tif(numberOfThreadsChanged){\r\n\t\t\tnumberOfThreads = changedNumberOfThreads;\r\n\t\t\tnumberOfThreadsChanged = false;\r\n\t\t\tchangedNumberOfThreads = 0;\r\n\t\t}\r\n\t\t\r\n\t\tif(xyChange){\r\n\t\t\txOffset = changedXOffset;\r\n\t\t\tyOffset = changedYOffset;\r\n\t\t\txyChange = false;\r\n\t\t\tchangedXOffset = null;\r\n\t\t\tchangedYOffset = null;\r\n\t\t}\r\n\t\t\r\n\t\tif(imageAspectChanged){\r\n\t\t\tWIDTH = newWIDTH;\r\n\t\t\tHEIGHT = newHEIGHT;\r\n\t\t\timageAspectChanged = false;\r\n\t\t\tnewWIDTH = 0;\r\n\t\t\tnewHEIGHT = 0;\r\n\t\t\timg = new WritableImage(WIDTH, HEIGHT);\r\n\t\t\trgbArray = new int[WIDTH * HEIGHT];\r\n\t\t\tsetMaxAndMins();\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}",
"public void paintComponent(Graphics page)\n {\n super.paintComponent(page);\n\n //set color, then draw a rectangle\n page.setColor(currentColor);\n\n page.drawRect(x1, y1, currentWidth, currentHeight);\n }",
"public void update() {\n MouseWrapper mouseWrapper = Engine.get().getMouseWrapper();\n bufferBuffer.clear();\n if (\n Engine.get().getEngineState() == Engine.EngineState.PLAY ||\n Engine.get().getEngineState() == Engine.EngineState.PAUSE\n ) {\n VectorD mousePos = new VectorD(\n mouseWrapper.getX(),\n mouseWrapper.getY()\n );\n VectorD difference = mousePos.diff(\n Engine.get().getGameState().getCursorFollow()\n );\n if (difference.length() > Constants.MOUSE_FOLLOW_CUTOFF) {\n difference =\n difference.multiplicate(Constants.MOUSE_FOLLOW_MULTIPLIER);\n }\n Engine\n .get()\n .getGameState()\n .setCursorFollow(\n Engine\n .get()\n .getGameState()\n .getCursorFollow()\n .sum(difference)\n );\n\n Entity player = EntityUtil.getPlayer(\n Engine.get().getEntityStream()\n );\n TransformationStorage playerPos = (TransformationStorage) player.getComponent(\n SpaxelComponent.TRANSFORMATION\n );\n\n Engine\n .get()\n .getGameState()\n .setScreenOffset(calculateScreenOffset(playerPos));\n }\n renderEntities();\n\n Engine.get().getCurrentUI().render(bufferBuffer);\n\n master.render(bufferBuffer);\n }",
"@Override\r\n \tpublic void render(GameContainer gc, Graphics g) throws SlickException \r\n \t{\r\n \t\ttry \r\n \t\t{\r\n \t\t\tThread.sleep(10);\r\n \t\t} \r\n \t\tcatch (InterruptedException e) \r\n \t\t{\r\n \t\t\te.printStackTrace();\r\n \t\t}\r\n \t\t\r\n \t\t// map rendering\r\n \t\ttheMap.render(0 + (int)camera.getX(), 0 + (int)camera.getY());\r\n \t\t\r\n \t\t// player rendering\r\n \t\tunitOne.getMovement().draw(unitOne.getX() + camera.getX(), unitOne.getY() + camera.getY());\r\n \t\tunitTwo.getMovement().draw(unitTwo.getX() + camera.getX(), unitTwo.getY() + camera.getY());\r\n \t\t\r\n \t\t// some indicators\r\n \t\tg.drawString(\"playerX = \" + (unitOne.getX() + camera.getX()), 600, 20);\r\n \t\tg.drawString(\"playerY = \" + (unitOne.getY() + camera.getY()), 600, 40);\r\n \t\tg.drawString(\"mouseX = \" + Mouse.getX(), 600, 60);\r\n \t\tg.drawString(\"mouseY = \" + (600 - Mouse.getY()), 600, 80);\r\n \t\tg.drawString(\"mouseTileX = \" + (int)Mouse.getX()/tileSize, 600, 100);\r\n \t\tg.drawString(\"mouseTileY = \" + (int)(600 - Mouse.getY())/tileSize, 600, 120);\r\n \t\tif (path != null) { g.drawString(\"Path length = \" + path.getLength(), 600, 160);}\r\n \t}",
"public void draw() {\r\n\t\tfor(int i=0; i<2; i++) {\r\n\t\t\trenderer[i].setView(camera[i]);\r\n\t\t\trenderer[i].render();\r\n\t\t}\r\n\t}",
"public void renderAll() {\n GameObjectManager.instance.renderAll(graphics);\n this.repaint();\n }",
"public void draw() {\n\t\tsuper.repaint();\n\t}",
"@Override\n public void render(float delta) {\n if(counter>1000) counter = 1;\n super.render(delta);\n myCamera.update();\n myCamera.setCamera(renderer, batch);\n batch.begin();\n backgroundSprite.draw(batch, calculateAlpha()/2);\n batch.end();\n drawCurve();\n drawFlights();\n drawFavouritesAndLegend();\n ab.render();\n clicked = false;\n counter++;\n }",
"private void render() {\n\t\t// clear the screen and depth buffer\n\t\tglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);\n\t\t\n\t\t// draws the background\n\t\tdrawScreen(sprite.get(\"background\"));\n\t\t\n\t\t// drawing player\n\t\tif (!stopDrawingPlayer)\n\t\t\tdrawEntity(player);\n\t\t// drawing bullets\n\t\tdrawListEntity(bullet);\n\t\t// drawing enemy bullets\n\t\tdrawListEntity(enemy_bullet);\n\t\t// drawing enemies\n\t\tdrawListEntity(enemy);\n\t\t// drawing powerups\n\t\tdrawListEntity(powerup);\n\t\t// drawing explosions\n\t\tdrawListEntity(explosion);\n\t\t\n\t\t// draw health\n\t\tdefaultFont.drawString(10, 10, \"Health: \" + player.getHP() + \"/1000\");\n\t\t// draw cash\n\t\tdefaultFont.drawString(10, 40, \"Cash: $\" + cash);\n\t\t// draw shop prompt\n\t\tdefaultFont.drawString(displayWidth - 280, displayHeight - 40, \"Press F to enter shop\");\n\t\t\n\t\tif (stopDrawingPlayer) {\n\t\t\t// draw Game Over\n\t\t\tgameOverFont.drawString(displayWidth / 2 - gameOverFont.getWidth(\"Game Over!\") / 2, displayHeight\n\t\t\t\t\t/ 2 - gameOverFont.getHeight(\"Game Over!\") / 2 - 50, \"Game Over!\");\n\t\t\t\n\t\t\t// draw the score\n\t\t\tscoreFont.drawString(displayWidth / 2 - scoreFont.getWidth(\"Score: \" + totalCash) / 2, displayHeight\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Game Over!\")\n\t\t\t\t\t/ 2\n\t\t\t\t\t+ scoreFont.getHeight(\"Score: \" + totalCash)\n\t\t\t\t\t/ 2 + 10 - 50, \"Score: \" + totalCash);\n\t\t}\n\t}",
"public void paintComponent(Graphics g){\n\n\n\n r.render(g);\n }",
"public void render() {\n int pixel = getPixelSize();\n for (int xx = x; xx<x+w; xx += pixel) {\n for (int yy = y; yy<y+h; yy += pixel) {\n Location next = getLocation(xx, yy);\n if (next != null) { // This way if a wall is spawned at the edge it's ok\n next.setColor(color(255,255,255));\n next.setType(LocationType.WALL);\n getGridCache().add(next);\n }\n }\n }\n }"
] | [
"0.80247617",
"0.79885286",
"0.74409103",
"0.7426286",
"0.7388293",
"0.7273621",
"0.72624266",
"0.72041726",
"0.70473534",
"0.69931364",
"0.6983887",
"0.69491017",
"0.6884136",
"0.68149173",
"0.6752667",
"0.6731934",
"0.66607064",
"0.6658666",
"0.6651511",
"0.6552343",
"0.6448592",
"0.63872725",
"0.6294024",
"0.62934",
"0.6284572",
"0.6233127",
"0.6227902",
"0.6208141",
"0.61936533",
"0.6168994",
"0.6120033",
"0.6101217",
"0.60933775",
"0.609253",
"0.60423553",
"0.60236883",
"0.60126305",
"0.6009154",
"0.60031545",
"0.5990101",
"0.597287",
"0.5941365",
"0.5938167",
"0.5934932",
"0.5933932",
"0.59286875",
"0.59230566",
"0.5916691",
"0.5914622",
"0.591344",
"0.59101427",
"0.5902956",
"0.5900415",
"0.587971",
"0.587894",
"0.5874686",
"0.58669436",
"0.5843059",
"0.5839635",
"0.5820653",
"0.58087444",
"0.5795874",
"0.5794888",
"0.57801133",
"0.5775441",
"0.57644504",
"0.5746765",
"0.57462007",
"0.57417744",
"0.57343066",
"0.57321393",
"0.57317",
"0.5714771",
"0.5713157",
"0.57120126",
"0.5711662",
"0.56821406",
"0.56782305",
"0.56722945",
"0.5670005",
"0.5667445",
"0.5664888",
"0.5658132",
"0.5655323",
"0.5627678",
"0.5625281",
"0.562094",
"0.5619885",
"0.5617897",
"0.5612197",
"0.5609385",
"0.5608289",
"0.5607772",
"0.56046486",
"0.5603668",
"0.5599177",
"0.55960643",
"0.55960476",
"0.55937916",
"0.55933106",
"0.5592765"
] | 0.0 | -1 |
Called by the controls from the buttonList when activated. (Mouse pressed for buttons) | private void actionPerformed(Button button) {
if (button == this.btnCancel || button == this.btnVisualize
|| button == this.btnBuild) {
this.houseConfiguration.addBed = this.serverConfiguration.addBed && this.btnAddBed.isChecked();
this.houseConfiguration.addChest = this.serverConfiguration.addChests && this.btnAddChest.isChecked();
this.houseConfiguration.addChestContents = this.allowItemsInChestAndFurnace && (this.serverConfiguration.addChestContents && this.btnAddChestContents.isChecked());
this.houseConfiguration.addCraftingTable = this.serverConfiguration.addCraftingTable && this.btnAddCraftingTable.isChecked();
this.houseConfiguration.addFurnace = this.serverConfiguration.addFurnace && this.btnAddFurnace.isChecked();
this.houseConfiguration.addMineShaft = this.serverConfiguration.addMineshaft && this.btnAddMineShaft.isChecked();
this.houseConfiguration.addTorches = this.serverConfiguration.addTorches && this.btnAddTorches.isChecked();
assert this.minecraft != null;
this.houseConfiguration.houseFacing = this.minecraft.player.getHorizontalFacing().getOpposite();
}
if (button == this.btnCancel) {
this.minecraft.displayGuiScreen(null);
} else if (button == this.btnBuild) {
Prefab.network.sendToServer(new StructureTagMessage(this.houseConfiguration.WriteToCompoundNBT(), EnumStructureConfiguration.StartHouse));
this.minecraft.displayGuiScreen(null);
} else if (button == this.btnHouseStyle) {
int id = this.houseConfiguration.houseStyle.getValue() + 1;
this.houseConfiguration.houseStyle = HouseConfiguration.HouseStyle.ValueOf(id);
// Skip the loft if it's not enabled.
if (this.houseConfiguration.houseStyle == HouseStyle.LOFT
&& !this.serverConfiguration.enableLoftHouse) {
id = this.houseConfiguration.houseStyle.getValue() + 1;
this.houseConfiguration.houseStyle = HouseConfiguration.HouseStyle.ValueOf(id);
}
this.btnHouseStyle.setMessage(this.houseConfiguration.houseStyle.getDisplayName());
// Set the default glass colors for this style.
if (this.houseConfiguration.houseStyle == HouseConfiguration.HouseStyle.HOBBIT) {
this.houseConfiguration.glassColor = DyeColor.GREEN;
this.btnGlassColor.setMessage(GuiLangKeys.translateDye(DyeColor.GREEN));
} else if (this.houseConfiguration.houseStyle == HouseConfiguration.HouseStyle.LOFT) {
this.houseConfiguration.glassColor = DyeColor.BLACK;
this.btnGlassColor.setMessage(GuiLangKeys.translateDye(DyeColor.BLACK));
} else if (this.houseConfiguration.houseStyle == HouseStyle.BASIC) {
this.houseConfiguration.glassColor = DyeColor.LIGHT_GRAY;
this.btnGlassColor.setMessage(GuiLangKeys.translateDye(DyeColor.LIGHT_GRAY));
} else if (this.houseConfiguration.houseStyle == HouseStyle.DESERT2) {
this.houseConfiguration.glassColor = DyeColor.RED;
this.btnGlassColor.setMessage(GuiLangKeys.translateDye(DyeColor.RED));
} else {
this.houseConfiguration.glassColor = DyeColor.CYAN;
this.btnGlassColor.setMessage(GuiLangKeys.translateDye(DyeColor.CYAN));
}
this.tabBlockTypes.visible = this.houseConfiguration.houseStyle != HouseStyle.DESERT
&& this.houseConfiguration.houseStyle != HouseStyle.SNOWY;
} else if (button == this.btnGlassColor) {
this.houseConfiguration.glassColor = DyeColor.byId(this.houseConfiguration.glassColor.getId() + 1);
this.btnGlassColor.setMessage(GuiLangKeys.translateDye(this.houseConfiguration.glassColor));
} else if (button == this.btnVisualize) {
StructureAlternateStart structure = StructureAlternateStart.CreateInstance(this.houseConfiguration.houseStyle.getStructureLocation(), StructureAlternateStart.class);
StructureRenderHandler.setStructure(structure, Direction.NORTH, this.houseConfiguration);
this.minecraft.displayGuiScreen(null);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void mousePressed()\r\n {\r\n //only activate the button is the mouse is over said button\r\n if (isMouseOver())\r\n {\r\n switch (type)\r\n {\r\n case \"tiger\":\r\n //add deer to array\r\n processing.listGUI.add(new Tiger(processing));\r\n //get out of the case statement\r\n break;\r\n case \"deer\":\r\n //add deer to array\r\n processing.listGUI.add(new Deer(processing));\r\n //get out of the case statement\r\n break;\r\n }\r\n }\r\n }",
"public void mousePressed(MouseEvent e) {\n mDown=true;\n int i=0;\n // Iterate through each button bounding box\n for(Rectangle r : buttonBounds) {\n // Check if the click point intersects with the rectangle's area\n if(r.contains(e.getPoint())) {\n // If it does, call the buttonCallback with the appropriate button display text\n buttonCallback(buttonNames.get(i));\n }\n i++;\n }\n }",
"private void pressed(MouseEvent e)\r\n {\n }",
"protected void mouseClicked(int par1, int par2, int par3)\n {\n if (this.buttonId >= 0)\n {\n \t// no setting minimap keybinds to mouse button. Can do so if wanted if I change ZanMinimap to not send every input to Keyboard for processing. Check if it's mouse first\n // this.options.setKeyBinding(this.buttonId, -100 + par3);\n // ((GuiButton)this.controlList.get(this.buttonId)).displayString = this.options.getOptionDisplayString(this.buttonId);\n this.buttonId = -1;\n // KeyBinding.resetKeyBindingArrayAndHash();\n }\n else\n {\n super.mouseClicked(par1, par2, par3);\n }\n }",
"@Override\n\tprotected void on_button_pressed(String button_name) {\n\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent me) {\r\n\t\tbuttonType = me.getButton();\r\n\t\tselect(me.getX(), me.getY());\r\n\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tImage img = new ImageIcon(this.getClass().getResource(\"/tbpSelected.png\")).getImage();\n\t\t\t\tbtnTriplebp.setIcon(new ImageIcon(img));\n\t\t\t\tuiInterceptor.addItem(3);\n\t\t\t\tbtnDoublebp.setEnabled(false);\n\t\t\t\tbtnBypass.setEnabled(false);\n\t\t\t\tbtnQuadbp.setEnabled(false);\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"private void button1MousePressed(MouseEvent e) {\n }",
"public void buttonPressed(){\r\n\t\tsetBorder(new BevelBorder(10));\r\n\t}",
"@Override\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\r\n\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\t\r\n\t\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t}",
"@Override\r\n public void mousePressed(MouseEvent e) {\n }",
"@Override\n\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t\t\t}",
"@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t}",
"@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {}",
"public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"public void mousePressed(MouseEvent e) {\n\t\t\t\t\n\t\t\t}",
"public void actionPerformed(ActionEvent e) {\n\t\t\t\tImage img = new ImageIcon(this.getClass().getResource(\"/bpSelected.png\")).getImage();\n\t\t\t\tbtnBypass.setIcon(new ImageIcon(img));\n\t\t\t\tuiInterceptor.addItem(1);\n\t\t\t\tbtnDoublebp.setEnabled(false);\n\t\t\t\tbtnTriplebp.setEnabled(false);\n\t\t\t\tbtnQuadbp.setEnabled(false);\n\t\t\t}",
"@Override\n public void mousePressed(MouseEvent e) {\n }",
"@Override\r\n public void mousePressed(MouseEvent e) {\n }",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\n\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\tpublic void mousePressed(MouseEvent arg0) {\n\t\t\t\t\n\t\t\t}",
"@Override\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}",
"@Override\n public void mousePressed(MouseEvent evt) {\n }",
"@Override\r\n public void mousePressed(MouseEvent e) {\r\n\r\n }",
"@Override\r\n public void mousePressed(MouseEvent e) {\r\n\r\n }",
"@Override\n public void mousePressed(MouseEvent e)\n {\n }",
"@Override\n public void mousePressed(MouseEvent e)\n {\n }",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t\t\r\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t\t\n\t\t\n\t}",
"@Override\r\n\t\t\tpublic void mousePressed(MouseEvent e) {\n\r\n\t\t\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t}",
"@Override\r\n\tpublic void mousePressed(MouseEvent e) {\n\t}",
"@Override\r\n\t\tpublic void mousePressed(MouseEvent e) {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}",
"@Override\n\tpublic void mousePressed(MouseEvent e) {\n\n\t}"
] | [
"0.7027484",
"0.69505936",
"0.6901503",
"0.6879382",
"0.6867347",
"0.6857721",
"0.6853821",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6811549",
"0.6806065",
"0.67931813",
"0.6792136",
"0.6792136",
"0.67857957",
"0.67857957",
"0.6780503",
"0.6757962",
"0.6757962",
"0.6757962",
"0.6757962",
"0.6757962",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6746192",
"0.6739039",
"0.67357016",
"0.6734334",
"0.6732775",
"0.6732775",
"0.6725748",
"0.6719192",
"0.6719192",
"0.67110676",
"0.6700663",
"0.6683189",
"0.6683037",
"0.6683037",
"0.6683037",
"0.6683037",
"0.6683037",
"0.6683037",
"0.66769624",
"0.66769624",
"0.66769624",
"0.666392",
"0.6647416",
"0.66420406",
"0.66420406",
"0.6637117",
"0.6637117",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66320586",
"0.66232675",
"0.6620592",
"0.66108733",
"0.66108733",
"0.6599712",
"0.6597235",
"0.6597235",
"0.6597235",
"0.6597235",
"0.6597235",
"0.6597235",
"0.6597235"
] | 0.0 | -1 |
Returns true if this GUI should pause the game when it is displayed in singleplayer | @Override
public boolean isPauseScreen() {
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public boolean doesGuiPauseGame()\r\n\t{\r\n\t\treturn false;\r\n\t}",
"public boolean doesGuiPauseGame() {\r\n\t\treturn false;\r\n\t}",
"public boolean doesGuiPauseGame()\n {\n return false;\n }",
"public boolean doesGuiPauseGame() {\n\t\treturn false;\n\t}",
"@Override\n public final boolean doesGuiPauseGame() {\n return shouldPauseGame;\n }",
"@Override\r\n\tpublic boolean doesGuiPauseGame() {\r\n\t\treturn false;\r\n\t}",
"public boolean doesGuiPauseGame()\n {\n return !this.doesGuiPauseGame;\n }",
"@Override\n\tpublic boolean doesGuiPauseGame() {\n\t\treturn super.doesGuiPauseGame();\n\t}",
"public boolean isPaused(){\r\n\t\tif (this.pauseGame(_p)){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\t\r\n\t}",
"private boolean canPauseGame() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n && gameStateManager.getState().equals(GameState.PLAY);\n }",
"void pauseGame() {\n myShouldPause = true;\n }",
"void pauseGame() {\n myShouldPause = true;\n }",
"public boolean pause() {\n try {\n controller.pause();\n return true;\n } catch (Exception e) {\n e.printStackTrace();\n }\n return false;\n }",
"boolean isPause();",
"public void isPaused() { \r\n myGamePaused = !myGamePaused; \r\n repaint(); \r\n }",
"public boolean isPaused() {\n synchronized (lockForPause) {\n return (pause == true);\n }\n }",
"public boolean shouldPause(){\n for(int i:pauses){\n if(stageNum == i){\n return true;\n }\n }\n return false;\n }",
"public void pauseGame() {\n paused = true;\r\n cam.zoom = worldWidth/screenWidth;\r\n boundCamera();\r\n topHud.setPauseButtonCanDraw(false);\r\n gameHud.setCanPress(false);\r\n\r\n playButton.setDrawable(!(win || lose));\r\n homeButton.setDrawable(true);\r\n restartButton.setDrawable(true);\r\n\r\n playButton.setCanPress(true);\r\n homeButton.setCanPress(true);\r\n restartButton.setCanPress(true);\r\n\r\n bindInput(pauseProcessors);\r\n\r\n timeGap = centralTimer - timer;\r\n }",
"public boolean isPaused();",
"@Override\r\n\tpublic boolean canPause() {\n\t\treturn true;\r\n\t}",
"public boolean pause();",
"public boolean pause();",
"public boolean getPause() {\r\n return pause;\r\n }",
"public void pauseToggle() {\r\n if(gameState == 1) {\r\n gameState = 0;\r\n }\r\n else gameState = 1;\r\n }",
"public void checkPaused()\n {\n paused = true;\n }",
"public boolean doPause() {\n return false;\n }",
"public synchronized boolean pause() {\n /*\n * check whether the simulation is running.\n * if yes, pause and return true to indicate that simulation was successfully paused.\n * else return false to indicate that the simulation is already paused\n * */\n if (!isPaused) {\n isPaused = true;\n if (log.isDebugEnabled()) {\n log.debug(\"Pause event simulation for uuid : \" + uuid);\n }\n return true;\n } else {\n return false;\n }\n }",
"protected abstract boolean pause();",
"public boolean isPaused() {\n return MotionViewer.this.isPaused();\n }",
"public boolean isPaused()\r\n\t{\r\n\t\treturn currentstate == TIMER_PAUSE;\r\n\t}",
"public boolean isPaused() {\n \t\treturn isPaused;\n \t}",
"public void togglePauseButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.TOGGLE_PAUSE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }",
"public boolean pauseGame(int p){\r\n\t\t_p = p;\r\n\t\tboolean isPaused = true;\r\n\t\tboolean notPaused = false;\r\n\t\tif (p % 2 !=0){\r\n\t\t\t_timer.stop();\r\n\t\t\t_pause.setVisible(true);\r\n\t\t\treturn isPaused;\r\n\t\t}else{\r\n\t\t\t_timer.start();\r\n\t\t\t_pause.setVisible(false);\r\n\t\t\treturn notPaused;\r\n\t\t}\r\n\t}",
"public void pause() {\n pause = true;\n }",
"void pauseGame() {\n myGamePause = true;\n }",
"public boolean getPauseControl()\n\t{\n\t\treturn getBooleanIOValue(\"PauseControl\", true);\n\t}",
"public boolean isPaused() {\r\n return this.paused;\r\n }",
"public boolean isPaused()\n\t{\n\t\treturn isPaused;\n\t}",
"public void switchToPause ()\n {\n timer.setPaused (true);\n questionLabel.setText (\"<html><br>You have paused the game!\"+\n \"<br>To continue, please press the pause button again!\"+\n \"<br>~^_^~</html>\");\n a.setVisible(false);\n b.setVisible(false);\n c.setVisible(false);\n d.setVisible(false);\n repaint ();\n revalidate ();\n }",
"public boolean isPaused() {\n return this.paused;\n }",
"public boolean isPaused() {\n return _isPaused;\n }",
"public boolean isPaused() {\r\n return DownloadWatchDog.this.stateMachine.isState(PAUSE_STATE);\r\n }",
"public void checkPause();",
"public static void pauseGame() {\r\n\t\tif(paused) {\r\n\t\t\tgui.restoreMenu();\r\n\t\t}else {\r\n\t\t\tgui.setMenu(new PauseMenu(), false);\r\n\t\t}\r\n\t\tpaused = !paused;//flip state\r\n\t}",
"public boolean isPaused() {\r\n return paused;\r\n }",
"public boolean isPaused() {\n return paused;\n }",
"public boolean getPlayPauseButton()\n\t{\n\t\treturn getBooleanIOValue(\"PlayPauseButton\", false);\n\t}",
"synchronized boolean isPaused(){\n\t\treturn paused;\n\t}",
"public void pause() {\n paused = true;\n }",
"public void pause() {\n paused = true;\n }",
"public synchronized boolean isPaused() {\n\t\treturn State.PAUSED.equals(state);\n\t}",
"public void pause() {\r\n fPause = true;\r\n }",
"public void pause()\n {\n paused = true;\n }",
"public boolean isPaused() {\n\t\tsynchronized(this) {\n\t\t\treturn paused;\n\t\t}\n\t}",
"public boolean isSinglePlayer() {\n\t\treturn false;\n\t}",
"public void showPauseButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.SHOW_PAUSE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }",
"public void pause() {\r\n\t\tSystem.out.println(\"Paused game\");\r\n\t\tthis.timeline.pause();\r\n\t\tisPaused = true;\r\n\t\tpauseMenu.setVisible(true);\r\n\t}",
"public void pauseGame(boolean state) {\r\n paused = state;\r\n }",
"synchronized void pause() {\n\t\tpaused = true;\n\t}",
"public static Boolean playBtn() { \n\t\tboolean startGame= false;\n\t\tdriver.findElement(By.xpath(\"//*[@id=\\\"secondepage\\\"]/center/button[1]\")).click();\n\t\tif (driver.getPageSource().contains(QandA.getQuestion(0))||driver.getPageSource().contains(QandA.getQuestion(1))||driver.getPageSource().contains(QandA.getQuestion(2))){\n\t\t\tstartGame=true;\n\t\t}\n\t\treturn startGame; \n\t}",
"@Override\n\tpublic void pause() \n\t{\n\t\tif (state_Game==GAME_READY) \n\t\t{\n\t\t\tstate_Game=GAME_PAUSED;\n\t\t}\n\t}",
"public boolean isRunning(){\n return !paused;\n }",
"public synchronized void pause() {\r\n\r\n\t\tpaused = true;\r\n\t}",
"public void pauseApp() {\n theIsRunning = false;\n }",
"protected static void pause() {\n\t\tif(curMIDI != null && playing) {\n\t\t\tmicroseconds = Player.pause();\n\t\t\tplaying = false;\n\t\t}\n\t\tif(sim != null){\n\t\t\tif(sim.isPlaying()){\n\t\t\t\tsim.pause();\n\t\t\t}\n\t\t}\n\t}",
"void checkPaused() {\n\t\twhile (paused) {\n\t\t\ttry {\n\t\t\t\tthis.sleep(sleepTime);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public synchronized boolean pause() {\n if (started && !stopped) {\n return pause.tryAcquire();\n }\n return false;\n }",
"@Override\n public boolean isRunning() {\n return !paused;\n }",
"public boolean isSwitchingPlayerOneTime()\n {\n boolean change = changePlayerOneTime != null;\n changePlayerOneTime = null;\n return change;\n }",
"public void setSinglePlayer(){\n isSinglePlayer = true;\n }",
"public synchronized boolean proceed() {\n if (started && !stopped && pause.availablePermits() == 0) {\n pause.release();\n return true;\n }\n return false;\n }",
"public void pause() {\n\t\t// TODO Auto-generated method stub\n\t}",
"public void pauseApp() {\n midletPaused = true;\n }",
"public void pauseApp() {\n midletPaused = true;\n }",
"public void pauseApp() {\n midletPaused = true;\n }",
"public void setPauseControl(java.lang.Boolean value)\n\t{\n\t\tsetDigitalOutput(\"PauseControl\", value);\n\t}",
"public void pause() {\n running = false;\n try {\n gameThread.join();\n } catch (InterruptedException e) {\n // Error\n }\n }",
"boolean getPausePreviewPref();",
"public void pause() {\n\t\tsynchronized(this) {\n\t\t\tpaused = true;\n\t\t}\n\t}",
"private void pause() { player.pause();}",
"public void setPaused(boolean yes){\n MotionViewer.this.setPaused(yes);\n }",
"private void togglePaused() {\n \t\tif (!isPaused) {\n \t\t\ttimeFirstPaused = System.nanoTime();\n \t\t} else {\n \t\t\t// Offset the time spent paused.\n \t\t\ttimeGameStarted += (System.nanoTime() - timeFirstPaused);\n \t\t}\n \t\tisPaused = !isPaused;\n \t}",
"public static boolean isTimingPaused() {\n return SimulatorJNI.isTimingPaused();\n }",
"public void pause() {\n running = false;\n }",
"public void hidePauseButton()\r\n {\r\n Message message = new Message();\r\n message.what = GUIManager.HIDE_PAUSE_BUTTON;\r\n mGUIManager.sendThreadSafeGUIMessage(message);\r\n }",
"private void btnPauseActionPerformed(java.awt.event.ActionEvent evt) {\n pause();\n }",
"synchronized void userPauseThreads() {\n myGamePause = true;\n pauseThreads();\n }",
"public void play() \n{\n s = !s; \n if (s == false)\n {\n //pausets = millis()/4;\n controlP5.getController(\"play\").setLabel(\"Play\");\n } else if (s == true)\n {\n //origint = origint + millis()/4 - pausets;\n controlP5.getController(\"play\").setLabel(\"Pause\");\n }\n}",
"public void pauseApp() {\n try {\n if (myCanvas != null) {\n setGoCommand();\n systemPauseThreads();\n }\n } catch (Exception e) {\n errorMsg(e);\n }\n }",
"public void pauseAndContinue(){\n if(gamePaused == true){ return; }\n gamePaused = true;\n timeRuunableThread.setPause(gamePaused);\n music.stopPlayingAudio(\"All\");\n jf_Pause = new JFrame(\"Game is paused\");\n jf_Pause.setSize(new Dimension(350, 120));\n jf_Pause.setLocation(400, 400);\n jf_Pause.setBackground(PauseColor);\n jf_Pause.setLayout(new GridLayout(2, 1));\n JLabel jl_Pause = new JLabel(\" Game is paused; click button or press ESC to continue.\");\n JPanel jp_Pause = new JPanel();\n JButton jb_Pause = new JButton(\"Continue\");\n jb_Pause.addActionListener(new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent actionEvent) {\n gamePaused = false;\n if(muteMusic == false){\n music.playAudio(\"LevelMusic\");\n }\n musicName = \"LevelMusic\";\n timeRuunableThread.setPause(gamePaused);\n jf_Pause.dispose();\n }\n });\n\n jb_Pause.addKeyListener(new KeyListener() {\n @Override\n public void keyTyped(KeyEvent keyEvent) { }\n\n @Override\n public void keyPressed(KeyEvent e) {\n if(e.getKeyCode() == KeyEvent.VK_ESCAPE){\n gamePaused = false;\n timeRuunableThread.setPause(gamePaused);\n jf_Pause.dispose();\n if(muteMusic == false){\n music.playAudio(musicName);\n }\n }\n }\n\n @Override\n public void keyReleased(KeyEvent keyEvent) { }\n });\n jp_Pause.add(jb_Pause);\n jf_Pause.add(jl_Pause);\n jf_Pause.add(jp_Pause);\n jf_Pause.addKeyListener(new KeyListener() {\n @Override\n public void keyTyped(KeyEvent e) {\n if(e.getKeyCode() == KeyEvent.VK_ESCAPE){\n gamePaused = false;\n timeRuunableThread.setPause(gamePaused);\n jf_Pause.dispose();\n }\n }\n\n @Override\n public void keyPressed(KeyEvent keyEvent) { }\n\n @Override\n public void keyReleased(KeyEvent keyEvent) { }\n });\n jf_Pause.setVisible(true);\n jf_Pause.setFocusable(false);\n }",
"private boolean canResumeGame() {\n\n return uiStateManager.getState().equals(GameUIState.WAVE_IN_PROGRESS)\n && isGamePaused();\n }",
"public void pause() {\r\n\t}",
"public void setPause(boolean pause) {\r\n this.pause = pause;\r\n }",
"@Override\n\tpublic boolean isGamePlayScreen () {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean canShow() {\r\n\t\treturn super.canShow() &&\r\n\t\t\t\t(getSpeakControl().isSpeaking() || getSpeakControl().isPaused());\r\n\t}",
"public void pause()\n {\n playing = false; // stop the update() method\n\n try {\n\n gameThread.join(); // Waiting for gameThread to finish\n\n } catch (InterruptedException e) {\n\n Log.e(\"error\", \"failed to stop the thread\");\n }\n }",
"void hasPausedPreview(boolean paused);",
"public boolean isPlayByPlayMenuSelected() {\n return playByPlayMenuSelected;\n }",
"private void pause()\r\n {\r\n player.pause();\r\n }",
"private void setUIStatePaused(){\n countdownLabel.setText(\"Paused\");\n play.setEnabled(true);\n pause.setEnabled(false);\n stop.setEnabled(true);\n }"
] | [
"0.82560456",
"0.82273597",
"0.82161814",
"0.8182903",
"0.8100699",
"0.80927444",
"0.8083055",
"0.80802333",
"0.7395155",
"0.73155284",
"0.7222914",
"0.7222914",
"0.7186003",
"0.7137058",
"0.7101534",
"0.70521516",
"0.7025445",
"0.70146173",
"0.6988937",
"0.69574827",
"0.6894365",
"0.6894365",
"0.68723524",
"0.6870706",
"0.6854426",
"0.6847752",
"0.6847454",
"0.6841195",
"0.681873",
"0.6809452",
"0.67956984",
"0.6794891",
"0.6793359",
"0.6781149",
"0.6775735",
"0.6760929",
"0.67607963",
"0.6746764",
"0.673297",
"0.6726261",
"0.672501",
"0.6701769",
"0.6700195",
"0.6681541",
"0.66517985",
"0.6644398",
"0.6642615",
"0.6630186",
"0.6620574",
"0.6620574",
"0.66078836",
"0.65850806",
"0.65776056",
"0.65775466",
"0.65657735",
"0.65543866",
"0.65290254",
"0.6505727",
"0.6500528",
"0.64734286",
"0.6470215",
"0.6466631",
"0.6458066",
"0.6408631",
"0.63784164",
"0.63491434",
"0.6345388",
"0.6335274",
"0.6334126",
"0.63278955",
"0.6301387",
"0.6270999",
"0.6266648",
"0.6266648",
"0.6266648",
"0.62648666",
"0.6262544",
"0.6257639",
"0.6237217",
"0.6232992",
"0.62266535",
"0.62187093",
"0.62085444",
"0.6200419",
"0.61794233",
"0.6168744",
"0.61587834",
"0.6151702",
"0.61401635",
"0.61399287",
"0.6135659",
"0.6122067",
"0.61149013",
"0.6108827",
"0.6103991",
"0.6102925",
"0.6101447",
"0.6084438",
"0.6082891",
"0.60712904"
] | 0.7309961 | 10 |
Get the upper left hand corner of the GUI box. | @Override
protected void Initialize() {
int grayBoxX = (this.width / 2) - 198;
int grayBoxY = (this.height / 2) - 83;
int color = Color.DARK_GRAY.getRGB();
this.serverConfiguration = Prefab.proxy.getServerConfiguration();
this.houseConfiguration = ClientEventHandler.playerConfig.getClientConfig("Starter House", HouseConfiguration.class);
this.houseConfiguration.pos = this.pos;
// Create the Controls.
// Column 1:
this.btnHouseStyle = new ExtendedButton(grayBoxX + 10, grayBoxY + 20, 90, 20, this.houseConfiguration.houseStyle.getDisplayName(), this::actionPerformed);
this.addButton(this.btnHouseStyle);
this.btnVisualize = new ExtendedButton(grayBoxX + 10, grayBoxY + 60, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_PREVIEW), this::actionPerformed);
this.addButton(this.btnVisualize);
int x = grayBoxX + 10;
int y = grayBoxY + 10;
int secondColumnY = y;
int secondColumnX = x + 137;
this.btnAddFurnace = new GuiCheckBox(secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_FURNACE), this.houseConfiguration.addFurnace, null);
this.btnAddFurnace.setFGColor(color);
this.btnAddFurnace.setWithShadow(false);
this.btnAddFurnace.visible = false;
this.addButton(this.btnAddFurnace);
if (this.serverConfiguration.addFurnace) {
secondColumnY += 15;
}
this.btnAddBed = new GuiCheckBox(secondColumnX, secondColumnY, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_BED), this.houseConfiguration.addBed, null);
this.btnAddBed.setFGColor(color);
this.btnAddBed.setWithShadow(false);
this.btnAddBed.visible = false;
this.addButton(this.btnAddBed);
if (this.serverConfiguration.addBed) {
secondColumnY += 15;
}
this.btnAddCraftingTable = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CRAFTING_TABLE), this.houseConfiguration.addCraftingTable, null);
this.btnAddCraftingTable.setFGColor(color);
this.btnAddCraftingTable.setWithShadow(false);
this.btnAddCraftingTable.visible = false;
this.addButton(this.btnAddCraftingTable);
if (this.serverConfiguration.addCraftingTable) {
y += 15;
}
this.btnAddTorches = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_TORCHES), this.houseConfiguration.addTorches, null);
this.btnAddTorches.setFGColor(color);
this.btnAddTorches.setWithShadow(false);
this.btnAddTorches.visible = false;
this.addButton(this.btnAddTorches);
if (this.serverConfiguration.addTorches) {
y += 15;
}
this.btnAddChest = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST), this.houseConfiguration.addChest, null);
this.btnAddChest.setFGColor(color);
this.btnAddChest.setWithShadow(false);
this.btnAddChest.visible = false;
this.addButton(this.btnAddChest);
if (this.serverConfiguration.addChests) {
y += 15;
}
this.btnAddMineShaft = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_BUILD_MINESHAFT), this.houseConfiguration.addMineShaft, null);
this.btnAddMineShaft.setFGColor(color);
this.btnAddMineShaft.setWithShadow(false);
this.btnAddMineShaft.visible = false;
this.addButton(this.btnAddMineShaft);
if (this.serverConfiguration.addMineshaft) {
y += 15;
}
this.btnAddChestContents = new GuiCheckBox(x, y, GuiLangKeys.translateString(GuiLangKeys.STARTER_HOUSE_ADD_CHEST_CONTENTS), this.houseConfiguration.addChestContents, null);
this.btnAddChestContents.setFGColor(color);
this.btnAddChestContents.setWithShadow(false);
this.btnAddChestContents.visible = false;
this.addButton(this.btnAddChestContents);
if (this.allowItemsInChestAndFurnace) {
y += 15;
}
this.btnGlassColor = new ExtendedButton(grayBoxX + 10, grayBoxY + 20, 90, 20, GuiLangKeys.translateDye(this.houseConfiguration.glassColor), this::actionPerformed);
this.addButton(this.btnGlassColor);
// Column 2:
// Column 3:
// Tabs:
this.tabGeneral = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_GENERAL), grayBoxX + 3, grayBoxY - 20);
this.Tabs.AddTab(this.tabGeneral);
this.tabConfig = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_CONFIG), grayBoxX + 54, grayBoxY - 20);
this.Tabs.AddTab(this.tabConfig);
this.tabBlockTypes = new GuiTab(this.Tabs, GuiLangKeys.translateString(GuiLangKeys.STARTER_TAB_BLOCK), grayBoxX + 105, grayBoxY - 20);
this.tabBlockTypes.setWidth(70);
this.Tabs.AddTab(this.tabBlockTypes);
// Create the done and cancel buttons.
this.btnBuild = new ExtendedButton(grayBoxX + 10, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_BUILD), this::actionPerformed);
this.addButton(this.btnBuild);
this.btnCancel = new ExtendedButton(grayBoxX + 147, grayBoxY + 136, 90, 20, GuiLangKeys.translateString(GuiLangKeys.GUI_BUTTON_CANCEL), this::actionPerformed);
this.addButton(this.btnCancel);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public Vector2f getUpperLeftCorner() {\n return upperLeftCorner;\n }",
"public Point getUpperLeft() {\n return this.upperLeft;\n }",
"Point3D getLeftUpperBackCorner();",
"public static Coordinates getTopRightCorner() {\n\t\treturn topRightCorner;\n\t}",
"public Point getupperRigth() {\n Point upperRigth = new Point(this.upperLeft.getX() + this.getWidth(), this.upperLeft.getY());\n return upperRigth;\n }",
"public Pixel topLeft() {\n if (this.up == null) {\n return null;\n }\n else {\n return this.up.left;\n }\n }",
"public Control getTopRight() {\n checkWidget();\n return topRight;\n }",
"public Point getCorner() {\r\n\t\treturn basePoly.getBounds().getLocation();\r\n\t}",
"public Box getBox() {\n\t//we compute the coordinates of the top left square \n\t//of the box by integer division\n\treturn new Box((rowIndex/3)*3, (colIndex/3)*3); \n }",
"public Coords getUpperLeft()\r\n {\r\n return new Coords(x, y);\r\n }",
"public final int getAbsoluteX() {\n assert (parent != null);\n if (parent == this) {\n return x;\n }\n if ((parent instanceof TWindow)\n && !(parent instanceof TMenu)\n && !(parent instanceof TDesktop)\n ) {\n // Widgets on a TWindow have (0,0) as their top-left, but this is\n // actually the TWindow's (1,1).\n return parent.getAbsoluteX() + x + 1;\n }\n return parent.getAbsoluteX() + x;\n }",
"private Point findTopLeftCornerPoint() {\n return new Point(origin.getX(), origin.getY() + width);\n }",
"public int getXLeftUpper() {\n return xLeftUpper;\n }",
"public Point getdownLeft() {\n Point downLeft = new Point(this.upperLeft.getX(), this.upperLeft.getY() + this.getHeight());\n return downLeft;\n }",
"public int getYLeftUpper() {\n return yLeftUpper;\n }",
"public Coords getUpperRight()\r\n {\r\n return new Coords(x + width, y);\r\n }",
"public FPointType calculateUpperLeft() {\n fRectBound = getBounds2D();\n FPointType fptUpperLeft = new FPointType(fRectBound.x, fRectBound.y);\n calculate(fptUpperLeft);\n \n rotateRadian = 0.0f;\n \n return fptUpperLeft;\n }",
"public int getTop(){\n\t\treturn platformHitbox.y;\n\t}",
"public Point getTopLeft() {\n return location.topLeft();\n }",
"public int getXTopRight() {\n return xTopRight;\n }",
"protected RectF getLeftHandleRect() {\n return mLeftHandle;\n }",
"public double getBoundingBoxTop() {\n return boundingBoxTop;\n }",
"public Point getLocationDialog(){\n try{\n return new Point( (int)this.getLocationOnScreen().getX() +(this.getWidth() /3), (int)this.getLocationOnScreen().getY()+this.menuBarData.getHeight());\n }catch(IllegalComponentStateException e){\n return new Point(100,100);\n }\n }",
"Point getTopXY();",
"public float getX()\n {\n return getBounds().left + positionAnchor.x;\n }",
"public BoardCoordinate getLeft() {\n return new BoardCoordinate(x-1, y);\n }",
"public Rectangle getBounds () {\r\n\tcheckWidget();\r\n\tPhArea_t area = new PhArea_t ();\r\n\tOS.PtWidgetArea (handle, area);\r\n\treturn new Rectangle (area.pos_x, area.pos_y, area.size_w, area.size_h);\r\n}",
"public Point2D getTopCenterPoint()\n {\n double x = mainVBox.getTranslateX() + (mainVBox.getWidth() / 2);\n double y = mainVBox.getTranslateY();\n return new Point2D(x, y);\n }",
"public float getUpperRightX()\n {\n return ((COSNumber)rectArray.get(2)).floatValue();\n }",
"public double getBoundingBoxLeft() {\n return boundingBoxLeft;\n }",
"double getLeftY();",
"BorderPane getRoot();",
"public Vector2f getBottomRightCorner() {\n return bottomRightCorner;\n }",
"public double getLeft() {\r\n\t\treturn -left.getRawAxis(1);\r\n\t}",
"public int getRight(){\n\t\treturn platformHitbox.x+width;\n\t}",
"public Rectangle getBounds() {\n\t\tRectangle Box = new Rectangle(x, y, 48, 48);\n\t\treturn Box;\n\t}",
"public int getAbsoluteX() {\r\n return getAbsoluteLeft() - getParent().getAbsoluteLeft();\r\n }",
"public Pixel topRight() {\n if (this.up == null) {\n return null;\n }\n else {\n return this.up.right;\n }\n }",
"public Point getCorner() {\n\t\treturn corner;\n\t}",
"public Coords getLowerRight()\r\n {\r\n return new Coords(x + width, y + height);\r\n }",
"public int getLeft(){\n\t\treturn platformHitbox.x;\n\t}",
"private Point findBottomRightCornerPoint() {\n return new Point(origin.getX() + width, origin.getY());\n }",
"public Coords getLowerLeft()\r\n {\r\n return new Coords(x, y + height);\r\n }",
"public Point getdownRigth() {\n Point downRigth = new Point(this.upperLeft.getX() + this.getWidth(), this.upperLeft.getY() + this.getHeight());\n return downRigth;\n }",
"public float getLowerLeftY()\n {\n return ((COSNumber)rectArray.get(1)).floatValue();\n }",
"public Point getOrigin() {\n checkWidget();\n if (content == null)\n return new Point(0, 0);\n Point location = content.getLocation();\n return new Point(-location.x, -location.y);\n }",
"public int getRIGHT_BORDER() {\n\t\treturn RIGHT_BORDER;\n\t}",
"public Label getTopboxTitleLabel() {\n\t\treturn topBoxLabel;\n\t}",
"public final int getAbsoluteY() {\n assert (parent != null);\n if (parent == this) {\n return y;\n }\n if ((parent instanceof TWindow)\n && !(parent instanceof TMenu)\n && !(parent instanceof TDesktop)\n ) {\n // Widgets on a TWindow have (0,0) as their top-left, but this is\n // actually the TWindow's (1,1).\n return parent.getAbsoluteY() + y + 1;\n }\n return parent.getAbsoluteY() + y;\n }",
"private Point middleLeft() {\n return this.topLeft.add(0, this.height / 2).asPoint();\n }",
"public static SuffixLattice getTop() {\n\t\treturn TOP;\n\t}",
"public int getTop() {\n return position[0] - (size - 1) / 2;\n }",
"private Point getUpper() {\n int upperX;\n int upperY;\n upperY = (int) (gameCanvas.getHeight() + mapOffsetY * 2);\n upperX = (int) (gameCanvas.getWidth() + mapOffsetX * 2);\n return new Point(upperX, upperY);\n }",
"Point3D getRightLowerFrontCorner();",
"@Nullable\n public Corner getCorner() {\n if (mImpl.hasCorner()) {\n return Corner.fromProto(mImpl.getCorner());\n } else {\n return null;\n }\n }",
"public int getXCenter() {\n return getXOrigin() + panelWidth/2;\n }",
"public static int getCenter() {\n\t\treturn Center;\n\t}",
"public Rect getRootViewRect() {\n return this.mRootViewRect;\n }",
"public Point2D getLeftCenterPoint()\n {\n double x = mainVBox.getTranslateX();\n double y = mainVBox.getTranslateY() + (mainVBox.getHeight() / 2);\n return new Point2D(x, y);\n }",
"public Component getCorner(String paramString) {\n/* 1171 */ boolean bool = getComponentOrientation().isLeftToRight();\n/* 1172 */ if (paramString.equals(\"LOWER_LEADING_CORNER\")) {\n/* 1173 */ paramString = bool ? \"LOWER_LEFT_CORNER\" : \"LOWER_RIGHT_CORNER\";\n/* 1174 */ } else if (paramString.equals(\"LOWER_TRAILING_CORNER\")) {\n/* 1175 */ paramString = bool ? \"LOWER_RIGHT_CORNER\" : \"LOWER_LEFT_CORNER\";\n/* 1176 */ } else if (paramString.equals(\"UPPER_LEADING_CORNER\")) {\n/* 1177 */ paramString = bool ? \"UPPER_LEFT_CORNER\" : \"UPPER_RIGHT_CORNER\";\n/* 1178 */ } else if (paramString.equals(\"UPPER_TRAILING_CORNER\")) {\n/* 1179 */ paramString = bool ? \"UPPER_RIGHT_CORNER\" : \"UPPER_LEFT_CORNER\";\n/* */ } \n/* 1181 */ if (paramString.equals(\"LOWER_LEFT_CORNER\")) {\n/* 1182 */ return this.lowerLeft;\n/* */ }\n/* 1184 */ if (paramString.equals(\"LOWER_RIGHT_CORNER\")) {\n/* 1185 */ return this.lowerRight;\n/* */ }\n/* 1187 */ if (paramString.equals(\"UPPER_LEFT_CORNER\")) {\n/* 1188 */ return this.upperLeft;\n/* */ }\n/* 1190 */ if (paramString.equals(\"UPPER_RIGHT_CORNER\")) {\n/* 1191 */ return this.upperRight;\n/* */ }\n/* */ \n/* 1194 */ return null;\n/* */ }",
"public Point topMiddle() {\n return this.topLeft.add(new Vector2D(getWidth() / 2, 0)).asPoint();\n }",
"public int getDOWN_BORDER() {\n\t\treturn DOWN_BORDER;\n\t}",
"public double getBorderCenterX()\n {\n return borderCenterX;\n }",
"public final Rectangle getBounds() {\n return label.getBounds();\n }",
"public Point getXUpper()\n {\n return (Point)xUpp.clone();\n }",
"public Rectangle getBoundsBigger() {\n return new Rectangle(x-32,y-32,128,128);\n }",
"public Ellipse getLeftButton() {\n return leftButton;\n }",
"public RMRect getBoundsInside() { return new RMRect(0, 0, getWidth(), getHeight()); }",
"int getBoundsX();",
"public int centerX() {\n return mRect.centerX();\n }",
"public sRectangle getSRectangleBound()\n {\n return form.getSRectangleBound();\n }",
"public VBox getBox() {\n return box;\n }",
"public double getCenterX()\n {\n return mainVBox.getTranslateX() + (mainVBox.getWidth() / 2);\n }",
"public Rectangle getBounds() {\n return new Rectangle((int) getX() - 20, (int) getY() - 20, 40, 40);\n }",
"public final int getCursorAbsoluteX() {\n return getAbsoluteX() + cursorX;\n }",
"public int getLeftX() {\n\t\treturn 0;\r\n\t}",
"@objid (\"1b87bc2e-5e33-11e2-b81d-002564c97630\")\n private Point getViewAreaSize() {\n final Point controlSize = new Point(0, 0);\n // this has to be done in the display thread to avoid\n // InvalidThreadAccessException.\n getViewer().getControl().getDisplay().syncExec(new Runnable() {\n @Override\n public void run() {\n final Control control = BackgroundEditPart.this.getViewer().getControl();\n Point p = control.getSize();\n controlSize.x = p.x;\n controlSize.y = p.y;\n \n if (control instanceof Scrollable) {\n Scrollable c = (Scrollable) control;\n ScrollBar b = c.getHorizontalBar();\n if (b != null /* && b.isVisible() */) {\n controlSize.y -= b.getSize().y;\n }\n b = c.getVerticalBar();\n if (b != null /* && b.isVisible() */) {\n controlSize.x -= b.getSize().x;\n }\n }\n }\n });\n return controlSize;\n }",
"public float getLeftRectF () { return atomSpriteBoundary.left; }",
"public Point getMinimumSize() {\n checkWidget();\n return parent.fixPoint( minimumWidth, minimumHeight );\n }",
"protected double getWindowLeftX() {\n\t\treturn this.m_windowLeftX;\n\t}",
"public double getLeftY() {\r\n\t\treturn adjustInput(driverLeft.getY());\r\n\t}",
"public int getHorSTY() {\r\n return horSTY;\r\n }",
"public int getTopY() {\n\t\treturn 0;\r\n\t}",
"public Rectangle getAWTRectangle() {\n\t\tRectangle r = null;\n\t\tif (width >= 0) {\n\t\t\tif (height >= 0) {\n\t\t\t\tr = new Rectangle(this.origin.getX0(), this.origin\n\t\t\t\t\t\t.getY0(), width, height);\n\t\t\t} else {\n\t\t\t\t// width >= 0 && height < 0\n\t\t\t\tr = new Rectangle(this.origin.getX0(), this.origin\n\t\t\t\t\t\t.getY0()\n\t\t\t\t\t\t+ height, width, -height);\n\t\t\t}\n\t\t} else {\n\t\t\tif (height >= 0) {\n\t\t\t\tr = new Rectangle(this.origin.getX0() + width, this.origin\n\t\t\t\t\t\t.getY0(), -width, height);\n\t\t\t} else {\n\t\t\t\t// width < 0 && height < 0\n\t\t\t\tr = new Rectangle(this.origin.getX0() + width, this.origin\n\t\t\t\t\t\t.getY0()\n\t\t\t\t\t\t+ height, -width, -height);\n\t\t\t}\n\t\t}\n\t\treturn r;\n\t}",
"@Override\n\tpublic Rectangle getBoundingBox() {\n\t\tRectangle rectangle = new Rectangle(this.image.getWidth(), this.image.getWidth());\n\t\trectangle.setLocation(this.position);\n\t\treturn rectangle;\n\t}",
"public final int centerY() {\n return (top + bottom) >> 1;\n }",
"public int getX() {\n return (int) center.getX();\n }",
"public int getX() {\r\n return (int) center.getX();\r\n }",
"public Vector2 getAbsolutePosition() {\n Vector2 screenPos = new Vector2(this.position.x, this.position.y);\n for(UIElement element = this.parent; element != null; element = element.parent) {\n screenPos.add(element.position);\n }\n return screenPos;\n }",
"public Point getLocalPosition() {\n return getLocalLowerLeft();\n }",
"public BoundingBox getBoundingBox ( ) {\n\t\t// TODO: backwards compatibility required\n\t\treturn invokeSafe ( \"getBoundingBox\" );\n\t}",
"public float getLowerLeftX()\n {\n return ((COSNumber)rectArray.get(0)).floatValue();\n }",
"public double getCornering() {\r\n return cornering;\r\n }",
"public Rectangle getBounds() {\n\t\t\treturn new Rectangle(x_pos, y_pos, getIconWidth(), getIconHeight());\n\t\t}",
"public Rectangle getBoundingBox() {\n\t\treturn getBounds();\n\t}",
"public JComponent getCornerComponent(int cornerIndex) {\r\n return null;\r\n }",
"Rectangle getBounds();",
"public Point getUpperPoint() {\n return upper;\n }",
"public RMRect getFrame() { return isRSS()? convertRectToShape(getBoundsInside(), _parent) : getBounds(); }",
"private int get_x() {\n return center_x;\n }",
"public GridBagPanel anchorEast()\n {\n myGBC.anchor = GridBagConstraints.EAST;\n return this;\n }"
] | [
"0.6903571",
"0.68990463",
"0.6582616",
"0.6457946",
"0.645793",
"0.6449909",
"0.64485985",
"0.62982756",
"0.62871027",
"0.62644005",
"0.62543434",
"0.6220584",
"0.61528504",
"0.609296",
"0.60849667",
"0.6056491",
"0.6018861",
"0.6011604",
"0.6006092",
"0.5992259",
"0.5991881",
"0.59772295",
"0.59354126",
"0.59221226",
"0.59205866",
"0.59082675",
"0.589148",
"0.58863544",
"0.58716774",
"0.5857735",
"0.5847006",
"0.5811687",
"0.58073574",
"0.580104",
"0.579303",
"0.5789608",
"0.5785528",
"0.5785058",
"0.57838774",
"0.57808524",
"0.57802033",
"0.5774943",
"0.5770518",
"0.57593066",
"0.5724922",
"0.57208246",
"0.57186586",
"0.5698615",
"0.5687157",
"0.56819063",
"0.5666447",
"0.56635505",
"0.566123",
"0.56510884",
"0.5649968",
"0.5645465",
"0.5644125",
"0.56373435",
"0.563189",
"0.56292",
"0.56264263",
"0.5614502",
"0.5583043",
"0.5581834",
"0.55744576",
"0.5562244",
"0.5560323",
"0.5547306",
"0.55467844",
"0.5541717",
"0.552817",
"0.5517664",
"0.55156857",
"0.55093724",
"0.55062",
"0.54928476",
"0.54925436",
"0.54856026",
"0.5481532",
"0.54741293",
"0.547173",
"0.5453162",
"0.5447946",
"0.5436387",
"0.5436381",
"0.54353726",
"0.5424989",
"0.5421157",
"0.54187334",
"0.541617",
"0.54109323",
"0.541023",
"0.54061",
"0.53891134",
"0.53869164",
"0.538626",
"0.5385608",
"0.538395",
"0.5382269",
"0.5371371",
"0.537092"
] | 0.0 | -1 |
Common interface for any service that is responsible for basic CRUD operations on a resource IApplicationUser is passed in explicitly in order to provide tenant / security context instead of fetching it from the ThreadLocal SecurityContext and risking picking up wrong tenant / user | public interface ICrudServiceV2<E, C, U, ID extends Serializable> {
/**
* Should be write transaction. Should throw EntityExistException if entity is already present
*
* @throws EntityExistsException if an object with the same unique data exists
*/
E add(IApplicationUser user, C createDto);
/**
* Should be a read-only transaction and idempotent.
*
* <p>Retrieves all objects the requesting user is authorized to view.
*/
List<E> getAll(IApplicationUser user);
/**
* Should be a read-only transaction and idempotent.
*
* <p>Retrieves the object corresponding to the particular id if it exists and the user is
* authorized to view the object
*/
Optional<E> getById(IApplicationUser user, ID id);
/**
* Should be a read-only transaction and idempotent.
*
* <p>Retrieves the object corresponding to the particular id and the user is authorized to view
* the object
*
* @throws EntityNotFoundException if the object doesn't exist
*/
E getExistingById(IApplicationUser user, ID id);
/**
* Should be write transaction.
*
* <p>Updates an object with the specified id with values from the specified update object
*
* @throws EntityNotFoundException if the object with the id doesn't exist
* @throws EntityExistsException if the unique update data collides with another existing object
*/
E update(IApplicationUser user, ID id, U updateDto);
/**
* Adds multiple new entities in one batch
*
* @throws EntityExistsException if any of the entities in the list exist in DB
*/
Set<E> addAll(IApplicationUser user, Collection<C> createDtos);
/** Deletes entity */
void delete(IApplicationUser user, E entity);
/** Deletes entity */
default void delete(IApplicationUser user, ID id) {
delete(user, getExistingById(user, id));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public interface UserService {\r\n\r\n\t/**\r\n\t * Returns the user account for the given username.\r\n\t *\r\n\t * @param username\r\n\t * \t\tusername\r\n\t *\r\n\t * @return user account or <code>null</code>\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic UserAccount findUserAccountByUsername(String username);\r\n\r\n\t/**\r\n\t * Returns the user account for the given primary key.\r\n\t *\r\n\t * @param uuid\r\n\t * \t\tprimary key as uuid\r\n\t *\r\n\t * @return user account or <code>null</code>\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic UserAccount findUserAccountByPrimaryKey(String uuid);\r\n\r\n\t/**\r\n\t * Checks if the given username is still available.\r\n\t *\r\n\t * @param username\r\n\t * \t\tusername to check\r\n\t *\r\n\t * @return <code>true</code> if that username is still available\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic boolean isUsernameAvailable(String username);\r\n\r\n\t/**\r\n\t * Creates a new user account.\r\n\t *\r\n\t * @return <code>true</code> if the account was created\r\n\t */\r\n\tpublic void createUserAccount(UserAccount account);\r\n\r\n\t/**\r\n\t * Update an existing user account.\r\n\t *\r\n\t * @return <code>true</code> if the account was updated\r\n\t */\r\n\t@PreAuthorize(\"hasRole('ROLE_USER')\")\r\n\tpublic void updateUserAccount(UserAccount account);\r\n\r\n}",
"public interface UserAuthorityService extends AbstractService<UserAuthority, Long> {\n\n void grantNormalAuth(Long userId);\n}",
"public interface IUserService extends UserDetailsService {\n Long signin(Account account);\n\n List<UserInformation> showUserDetails();\n\n Account changeApplicationVersion(String accountIdentifier, ApplicationVersion applicationVersion);\n\n Long removeAccount(String accountIdentifier);\n\n Long suspendAccount(String accountIdentifier);\n\n Long unsuspendAccount(String accountIdentifier);\n\n Long addIncomingInvoice(String accountIdentifier);\n\n Long removeIncomingInvoice(String accountIdentifier);\n\n Long changeAssignment(String accountIdentifier, boolean newAssignementValue);\n\n Account findAccount(String accountIdentifier);\n}",
"public interface UserAccountService {\n\n\tpublic final static String BEAN_ID = \"userAccountService\";\n\n\tpublic UserAccount findById(ServiceContext ctx, Long id) throws UserAccountNotFoundException;\n\n\tpublic List<UserAccount> findAll(ServiceContext ctx);\n\n\tpublic UserAccount save(ServiceContext ctx, UserAccount entity);\n\n\tpublic void delete(ServiceContext ctx, UserAccount entity);\n\n}",
"public interface UserService {\n\n void register(UserEntity userEntity);\n UserEntity findByUsername(String username);\n UserEntity findByEmail(String email);\n void editMyAccount(UserEntity newUserEntity, Principal principal);\n void editUser(UserEntity newUserEntity);\n void deleteMyAccount(String password, Principal principal);\n void deleteUser(String username, Principal principal);\n List<UserEntity> getAllUsers();\n String getRoleOfLoggedUser();\n boolean checkIfPasswordMatchWithLoggedUserPassword(String password);\n}",
"public UserContext getUserContext();",
"public interface UserService {\n User authorize(Login login) throws Exception;\n\n User findUser(UUID userApiKey);\n\n}",
"public interface UserService extends UserDetailsService {\n /**\n * Retrieves an user by its id.\n *\n * @param id cannot be null\n * @return\n */\n Optional<User> findUserById(Long id);\n\n /**\n * Retrieves an user by its username.\n *\n * @param username cannot be null\n * @return\n */\n Optional<User> findUserByUsername(String username);\n\n /**\n * Saves a given entity. Use the returned instance for further operations as the save operation might have changed the entity instance completely.\n *\n * @param user user\n * @return the saved user; will never be null.\n * @throws IllegalArgumentException in case the given advertisement is null.\n */\n User save(User user);\n\n /**\n * Return list of all users int the system.\n *\n * @return List of all users in the system\n */\n List<User> findAll();\n\n /**\n * Deletes a given user.\n *\n * @param user cannot be null\n */\n void delete(User user);\n\n /**\n * Deletes a given user.\n *\n * @param id cannot be null\n */\n void deleteById(Long id);\n}",
"public interface IUserAccountService {\n\n\t/**\n\t * The method is responsible for adding new user or registering new user\n\t * \n\t * @param transientUser\n\t * @return\n\t * @throws Exception\n\t */\n\tpublic Long addUser(User transientUser) throws Exception;\n\n\t/**\n\t * The method is responsible for updating existing user information\n\t * \n\t * @param detachedUser\n\t * @throws Exception\n\t */\n\tpublic void updateUser(User detachedUser) throws Exception;\n\n\t/**\n\t * The method is responsible for deleting existing user.\n\t * \n\t * @param userToDelete\n\t * @throws Exception\n\t */\n\tpublic void deleteUser(User userToDelete) throws Exception;\n\n\t/**\n\t * This method returns the user with username passed in parameter\n\t * \n\t * @param username\n\t * @return\n\t * @throws Exception\n\t */\n\tpublic User findByUserName(String username) throws Exception;\n\n\t/**\n\t * This method returns all the users of the system\n\t * @return\n\t */\n\tpublic List<User> findAll();\n\n}",
"public interface UserService {\n\n User getUser(Long id);\n}",
"public interface IUserService {\n\n void authenticate(AppUser user);\n\n void logout();\n\n boolean register (RegistrationModel registrationModel);\n\n}",
"public interface UserService {\n\n public User selectUser(long userId);\n}",
"public interface UserService extends UserDetailsService{\n\n\t/**\n\t * save method is used save record in user table\n\t * \n\t * @param userEntity.\n\t * @return UserEntity\n\t */\n public UserEntity save(UserEntity userEntity); \n\t\n /**\n * getByName method is used to retrieve userId from userName. \n * \n * @param userName\n * @return UUID\n */\n public UserQueryEntity getByName(String userName);\n \n}",
"public interface UserService{\n//public interface UserService extends UserDetailsService {\n\n public User getUserByName(String userName);\n\n public int saveUser(String username, String password, String role);\n}",
"public interface IUserService extends IService<User, Integer>, UserDetailsService {\n\n User findUserByUsername(String username);\n\n User findUserByEmail(String email);\n\n User createUser(User user) throws UsernameExistsException;\n\n}",
"public interface UserService {\n\n int createUser(String email, String password, UserRole userRole);\n\n User getUserById(int userId);\n\n User getUserByEmail(String email);\n\n boolean deleteUserById(int userId);\n}",
"public interface UserService extends UserDetailsService {\n\n\n\n}",
"public interface UserService {\n\n SysUser getUser(String username);\n\n BootstrapTable list(SearchVo search);\n\n ResultVo saveOrUpdate(SysUser user, BigDecimal roleId);\n\n SysUser getUserById(BigDecimal id);\n\n ResultVo delete(BigDecimal id);\n}",
"public interface UserService extends UserDetailsService {\n User findUserByLogin(String login);\n\n User findUserById(Long id);\n\n void registerUser(User newUser);\n}",
"public interface UserService {\r\n\r\n\t/**\r\n\t * Loads {@link User} specified by ID\r\n\t * @param id of user\r\n\t * @return {@link User} instance\r\n\t * @throws RuntimeException if user does not exist\r\n\t */\r\n\tUser loadUserById(Integer id);\r\n\r\n\t/**\r\n\t * Loads {@link User} specified by username\r\n\t * @param username of user\r\n\t * @return {@link User} instance\r\n\t * @throws RuntimeException if user does not exist or permission is denied\r\n\t */\r\n\tUser loadUserByUsername(String username);\r\n\r\n\t/**\r\n\t * Creates new user \r\n\t * @param userBuilder used to define user properties\r\n\t * @param notify determines whether notification email should be send\r\n\t * @return newly created {@link User}\r\n\t * @throws RuntimeException if user does not exist or permission is denied\r\n\t */\r\n\tUser createUser(UserBuilder userBuilder, boolean notify);\r\n\r\n\t/**\r\n\t * Updates user specified by ID and version\r\n\t * @param id of the user to update\r\n\t * @param version of the user to update\r\n\t * @param userBuilder used to define user properties to be updated\r\n\t * @throws RuntimeException if user does not exist or permission is denied \r\n\t */\r\n\tvoid updateUser(Integer id, Long version, UserBuilder userBuilder);\r\n\r\n\t/**\r\n\t * Deletes the user\r\n\t * @param id of the user to delete\r\n\t * @throws RuntimeException if user does not exist or permission is denied\r\n\t */\r\n\tvoid deleteUser(Integer id);\r\n\r\n\t/**\r\n\t * Updates user-domain association\r\n\t * @param userId of the user\r\n\t * @param domainId of the domain\r\n\t * @param roles {@link UserRole} to set.\r\n\t * @throws RuntimeException if user does not exist, domain does not exist or permission is denied\r\n\t */\r\n\tvoid updateDomainAssociation(Integer userId, Integer domainId, UserRole... roles);\r\n\r\n\t/**\r\n\t * Updates user-user group association\r\n\t * @param userId of the user\r\n\t * @param userGroups id's of the groups\r\n\t * @throws RuntimeException if user does not exist, user groups do not exist or permission is denied\r\n\t */\r\n\tvoid updateUserGroupAssociation(Integer userId, Integer... userGroups);\r\n\r\n\t/**\r\n\t * Creates an user request of desired type.\r\n\t * @param username username of the user the request is created for.\r\n\t * @param type Specifies the type of the request. Available types are: LOGIN_UNATTENDED, PASSWORD_SET, PASSWORD_RESET, UNLOCK_ACCOUNT, LOGIN\r\n\t * @return request_id and request_code of the created request. Example: 1544;RDQX1Qx9UokSf4n3KAVWgNClvrFUqncSZg7fK3gnVAfNIAOylN\r\n\t * @throws RuntimeException if user does not exist or permission is denied\r\n\t */\r\n\tString createUserRequest(String username, UserRequestType type);\r\n\r\n}",
"ApplicationUser getUser();",
"public interface IUserService {\n \n User queryUserById(long id);\n}",
"@Validated\npublic interface IJobApplicationService {\n JobApplication newApplication(@Valid @NotNull Long userId, @Valid @NotNull JobApplication jobApplication);\n\n JobApplication setCVtoJobApplication(@Valid @NotNull Long userId, @Valid @NotNull Long cvId, @Valid @NotNull Long id);\n\n JobApplication getApplication(@Valid Long userId, @Valid @NotNull Long id);\n\n @Secured(\"ROLE_ADMIN\")\n JobApplication getApplication(@Valid @NotNull Long id);\n\n JobApplication archiveApplication(@Valid @NotNull Long userId, @Valid @NotNull Long id, @Valid @NotNull JobApplicationStatus status);\n}",
"void setUser(final ApplicationUser user);",
"public void setUserContext(UserContext userContext);",
"public interface UserService {\r\n\t\r\n\tpublic UserProfileTo readUser(Long id);\r\n\r\n\tpublic UserProfileTo createUser(String login, String password, String email);\r\n}",
"public interface UserService {\n List<User> findAllUsers();\n\n AuthorizedUser saveUser(User user);\n}",
"public interface SecurityService extends UserDetailsService {\n\n @Override\n public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;\n}",
"public interface UserService {\n\n\t/**\n\t * This method is used to create a worker into the system.\n\t * \n\t * @author umamaheswarar\n\t * @param createEmployeeDTO\n\t * worker related information to create the worker\n\t * @return createEmployeeDTO worker information after creating the worker\n\t * into the system.\n\t * @throws ApplicationCustomException\n\t */\n\tpublic EmployeeDTO createEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to update a worker into the system.\n\t * \n\t * @author umamaheswarar\n\t * @param createEmployeeDTO\n\t * worker related information to create the worker\n\t * @return createEmployeeDTO worker information after creating the worker\n\t * into the system.\n\t * @throws ApplicationCustomException\n\t */\n\tpublic EmployeeDTO updateEmployee(final EmployeeDTO createEmployeeDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to get the user from system.\n\t * \n\t * @author umamaheswarar\n\t * @param username\n\t * username of the logged in user.\n\t * @return UserDTO user details.\n\t */\n\tpublic UserDTO getUserDetails(final String username);\n\n\t/**\n\t * This method is used to create a position into the system.\n\t * \n\t * @author umamaheswarar\n\t * @param positionDTO\n\t * position related information to create the position\n\t * @return positionDTO position information after creating into the system.\n\t * @throws ApplicationCustomException\n\t */\n\tpublic PositionDTO createJobPosition(final PositionDTO positionDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to update a position into the system.\n\t * \n\t * @author umamaheswarar\n\t * @param positionDTO\n\t * position related information to update the position\n\t * @return positionDTO position information after updating into the system.\n\t * @throws ApplicationCustomException\n\t */\n\tpublic PositionDTO updateJobPosition(final PositionDTO positionDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to manage the time off of the employees\n\t * \n\t * @author umamaheswarar\n\t * @param timeOffDTO\n\t * time off DTO object\n\t * @return TimeOffDTO time off details after saving the details\n\t */\n\tpublic TimeOffDTO manageTimeOff(final TimeOffDTO timeOffDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to change the employee job details\n\t * \n\t * @author umamaheswarar\n\t * @param jobChangeDTO\n\t * job change details\n\t * @return jobChangeDTO job change details after completion\n\t * @throws ApplicationCustomException\n\t * custom application message in case of any exception\n\t */\n\tpublic JobChangeDTO jobChange(final JobChangeDTO jobChangeDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to change the address details of the employee\n\t * \n\t * @author umamaheswarar\n\t * @param employeeAddressDTO\n\t * @return addressChangeEventId address change event id\n\t * @throws ApplicationCustomException\n\t * custom application exception message\n\t */\n\tpublic String changeContactDetails(final EmployeeAddressDTO employeeAddressDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to manage the payroll of the employees\n\t * \n\t * @author umamaheswarar\n\t * @param payrollDTO\n\t * payrollDTO object\n\t * @return payrollDTO payroll details after saving the details\n\t */\n\tpublic PayrollDTO managePayroll(final PayrollDTO payrollDTO) throws ApplicationCustomException;\n\n\t/**\n\t * This method is used to manage the payroll of the employees\n\t * \n\t * @author umamaheswarar\n\t * @param registerDTO\n\t */\n\tpublic boolean register(final RegisterDTO registerDTO)\n\t\t\tthrows ApplicationCustomException, HibernateException, SQLException;\n\n}",
"public interface UserService extends UserDetailsService {\n\n /**\n * 根据用户名查询用户\n *\n * @param username username\n * @return UserDetails\n * @throws UsernameNotFoundException UsernameNotFoundException\n */\n @Override\n UserDetails loadUserByUsername(String username) throws UsernameNotFoundException;\n}",
"public interface UserService{\n\n public UserAccount saveUser(UserAccount userAccount) throws UserNotExist;\n public UserAccount updateUser(UpdateDto updateDto) throws UserNotExist;\n public void deleteUser(DeleteDto deleteDto);\n\n public UserAccount findByEmail(String email);\n public UserAccount findByConfirmationToken(String confirmationToken);\n\n\n// public void logout();\n public void resendMail(ResendEmailDto resendEmailDto);\n public void resetPassword(UserAccount userAccount, HttpServletRequest request);\n}",
"protected ApplicationUser(){}",
"public interface UserService {\n\n\tpublic User create(User user);\n\t\n\tpublic Boolean findUser(String username, String password);\n\n\tpublic User findByID(String userId);\n\n}",
"public interface UserService {\n\n\t/**\n\t * Finds a user by email\n\t * \n\t * @param email\n\t * @return\n\t */\n\tUser find(String email);\n\n\t/**\n\t * Finds a user by email\n\t * \n\t * @param email\n\t * @return\n\t */\n\tList<User> addUsersToShowableList(UserListRequest userListRequest);\n\t\n\t/**\n\t * Finds a user by its id\n\t * \n\t * @param id\n\t * @return\n\t */\n\tUser find(long id);\n\n\t/**\n\t * \n\t * @param user\n\t */\n\tvoid save(User user, String token);\n\n\t/**\n\t * \n\t * @param user\n\t */\n\tvoid register(User user, String urlBase);\n\n\t/**\n\t * Load the number of user offering services\n\t * @return\n\t */\n\tInteger loadUserCount();\n\n\t/**\n\t * Validate if email already exists\n\t * @param email\n\t * \t\tThe email to validate\n\t */\n\tvoid validate(String email);\n\n\t/**\n\t * Send a activation email to user who register\n\t * @param email\n\t * @param activationLink\n\t * @param activationKey\n\t * @throws MailServicesErrorException\n\t */\n\tvoid sendActivationLinkEmail(User user, String activationLink, String activationKey)\n\t\t\tthrows MailServicesErrorException;\n\n\t/**\n\t * Activate an user that comes from email activation link\n\t * @param email\n\t * @param activationToken\n\t */\n\tvoid activateUser(String email, String activationToken);\n\n\t/**\n\t * Ends the user session by deleting its security access token\n\t * @param userTokenTokenContent\n\t * \t\tContent of user token to delete\n\t */\n\tvoid logout(String userTokenTokenContent);\n\n\t/**\n\t * filter users by specific request filter\n\t * @param request\n\t * @return\n\t */\n\tUserFilterResult find(UserFilterRequest request);\n}",
"public UserDetailsServiceImpl(ApplicationUserRepository applicationUserRepository) {\n this.applicationUserRepository = applicationUserRepository;\n }",
"public interface UserService {\n public User getUserById(int userId);\n public User selectUserByUsername(String username);\n}",
"public interface IApplicationUserSecurity {\n\n\n\n /**\n * Return the value associated with the column: dateCreated.\n\t * @return A Date object (this.dateCreated)\n\t */\n\tDate getDateCreated();\n\t\n\n \n /** \n * Set the value related to the column: dateCreated.\n\t * @param dateCreated the dateCreated value you wish to set\n\t */\n\tvoid setDateCreated(final Date dateCreated);\n\n /**\n * Return the value associated with the column: dateDisabled.\n\t * @return A Date object (this.dateDisabled)\n\t */\n\tDate getDateDisabled();\n\t\n\n \n /** \n * Set the value related to the column: dateDisabled.\n\t * @param dateDisabled the dateDisabled value you wish to set\n\t */\n\tvoid setDateDisabled(final Date dateDisabled);\n\n /**\n * Return the value associated with the column: dateUpdated.\n\t * @return A Date object (this.dateUpdated)\n\t */\n\tDate getDateUpdated();\n\t\n\n \n /** \n * Set the value related to the column: dateUpdated.\n\t * @param dateUpdated the dateUpdated value you wish to set\n\t */\n\tvoid setDateUpdated(final Date dateUpdated);\n\n /**\n * Return the value associated with the column: id.\n\t * @return A Long object (this.id)\n\t */\n\tLong getId();\n\t\n\n \n /** \n * Set the value related to the column: id.\n\t * @param id the id value you wish to set\n\t */\n\tvoid setId(final Long id);\n\n /**\n * Return the value associated with the column: role.\n\t * @return A SecurityRole object (this.role)\n\t */\n\tSecurityRole getRole();\n\t\n\n \n /** \n * Set the value related to the column: role.\n\t * @param role the role value you wish to set\n\t */\n\tvoid setRole(final SecurityRole role);\n\n /**\n * Return the value associated with the column: user.\n\t * @return A ApplicationUser object (this.user)\n\t */\n\tApplicationUser getUser();\n\t\n\n \n /** \n * Set the value related to the column: user.\n\t * @param user the user value you wish to set\n\t */\n\tvoid setUser(final ApplicationUser user);\n\n /**\n * Return the value associated with the column: userCreated.\n\t * @return A Long object (this.userCreated)\n\t */\n\tLong getUserCreated();\n\t\n\n \n /** \n * Set the value related to the column: userCreated.\n\t * @param userCreated the userCreated value you wish to set\n\t */\n\tvoid setUserCreated(final Long userCreated);\n\n /**\n * Return the value associated with the column: userUpdated.\n\t * @return A Long object (this.userUpdated)\n\t */\n\tLong getUserUpdated();\n\t\n\n \n /** \n * Set the value related to the column: userUpdated.\n\t * @param userUpdated the userUpdated value you wish to set\n\t */\n\tvoid setUserUpdated(final Long userUpdated);\n\n\t// end of interface\n}",
"public interface SysUserService {\n\n void saveUser(SysUser sysUser);\n\n void updateUser(SysUser sysUser);\n\n void deleteUser(String id);\n\n SysUser queryUserById(String id);\n\n List<SysUser> queryUserList(SysUser sysUser);\n\n PageInfo<SysUser> queryUserListPaged(SysUser user, Integer page, Integer pageSize);\n\n SysUser queryUserByIdCustom(String id);\n\n void saveUserTransactional(SysUser user);\n}",
"public interface CustomerService {\n \n\n public void createCustomer(CustomerDto customerDto);\n \n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public CustomerDto getCustomer(Long id) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public void updateCustomer(CustomerDto customer) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public void removeCustomer(CustomerDto customer) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public Collection<CustomerDto> findAllCustomer() throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\") \n public Collection<CustomerDto> searchCustomer(String name) throws DataAccessException;\n\n //@PreAuthorize(\"hasRole('ROLE_USER') or hasRole('ROLE_ADMIN')\")\n public CustomerDto findByUsername(String username);\n}",
"public interface UserService {\n\n public SysUser findByUserName();\n}",
"public interface UserService {\n\n /**\n * <p>\n * This Method is used to add a new User.\n * </p>\n *\n * @param user a User object with the email and password to be added.\n *\n * @return boolean a boolean value indicating the successful addition of\n * a new User.\n *\n * @throws ApplicationException A Custom Exception created for catching\n * exceptions that occur while retrieving an\n * user.\n */\n public Boolean addUser(User user) throws ApplicationException;\n\n /**\n * <p>\n * This Method is used to search a User Entry and return the User\n * object. It returns null if no match is found.\n * </p>\n *\n * @param email a String indicating the email of the user that is\n * to be searched an returned.\n *\n * @return user an User object is returned if a valid match is\n * found, else returns null.\n *\n * @throws ApplicationException A Custom Exception created for catching\n * exceptions that occur while retrieving an\n * user.\n */\n public User retrieveUserByEmail(String email) throws ApplicationException;\n\n}",
"public interface UserDetailsService {\n UserDetailsEntity findById(String userId);\n RetMsg changeTheme(String themeId, String username);\n RetMsg changePassword(String newPasswd, String userId, String oldPasswd);\n}",
"@Transactional(propagation = Propagation.REQUIRES_NEW)\npublic interface SecurityUserManager {\n\n String getLoggedInUsername();\n\n Tenancy getLoggedInTenancy();\n\n boolean isLoggedIn();\n\n boolean isLoggedInToTenancy();\n\n boolean isTenancyPresent(String context);\n\n boolean isRolePresent(String... roles);\n\n void setLoggedInTenancy(Long tenancyId) throws Exception;\n\n boolean hasAccessToTenancy(User user, Tenancy tenancy);\n}",
"public interface UserInfoService extends IService {\n String getUserId();\n String getUserToken();\n}",
"public interface UserService{\r\n \r\n\t/**\r\n\t * Creates the user\r\n\t * \r\n\t * @param dto\r\n\t * UserModel\r\n\t * @return User If user account exists\r\n\t * @throws UserExistsException\r\n\t * if user account doesn't exists\r\n\t */\r\n\tUser createUser(UserModel dto) throws UserExistsException;\r\n\r\n\t/**\r\n\t * Returns the User by user name.\r\n\t * \r\n\t * @param username\r\n\t * String\r\n\t */\r\n\tUser getUserByUsername(String username);\r\n\r\n\t/**\r\n\t * Changes the password.\r\n\t * \r\n\t * @param user\r\n\t * ChangePasswordModel\r\n\t * @param token\r\n\t * String\r\n\t * @return Returns true if the password change succeeded otherwise false\r\n\t * @throws InvalidTokenException\r\n\t */\r\n\tBoolean changePassword(ChangePasswordModel user, String token) throws InvalidTokenException;\r\n\r\n\t/**\r\n\t * Saves the login info to the repository.\r\n\t * \r\n\t * @param login\r\n\t * UserLogin\r\n\t * @return UserLogin\r\n\t */\r\n\tUserLogin recordLogin(UserLogin login);\r\n\r\n\t/**\r\n\t * Verifies the account is locked or not.\r\n\t * \r\n\t * @param username\r\n\t * String\r\n\t * @return Boolean\r\n\t */\r\n\tBoolean isAccountLocked(String username);\r\n\r\n\t/**\r\n\t * Saves the user, password and ContactOptIn.\r\n\t * \r\n\t * @param user User\r\n\t * @return User\r\n\t */\r\n\tUser saveUser(User user);\r\n\r\n\t/**\r\n\t * Creates the password reset token\r\n\t * \r\n\t * @param username\r\n\t * String\r\n\t * @return String Password reset token\r\n\t * @throws UserNotFoundException\r\n\t */\r\n\tString createPasswordResetToken(String username) throws UserNotFoundException;\r\n\r\n\t/**\r\n\t * Returns the Authorities based on user.\r\n\t * \r\n\t * @param user User\r\n\t * @return Authority information\r\n\t */\r\n\tSet<Authority> getAuthorities(User user);\r\n\r\n\t/**\r\n\t * Changes the password.\r\n\t * \r\n\t * @param user\r\n\t * UserModel\r\n\t * @return Boolean\r\n\t * \r\n\t * @throws UserNotFoundException\r\n\t */\r\n\tBoolean changePassword(UserModel user) throws UserNotFoundException;\r\n\r\n}",
"public interface IUserService {\n\n User registerNewUserAccount(UserDto accountDto) throws EmailExistsException;\n\n User getUser(String verificationToken);\n\n void saveRegisteredUser(User user);\n\n void createVerificationToken(User user, String token);\n\n VerificationToken getVerificationToken(String VerificationToken);\n}",
"public interface AIUserService {\n\n AIUser queryByUserId(Long userId);\n\n void deleteByUserId(Long userId);\n\n void updateUserInfo(AIUser aiUser);\n}",
"BaseUser createAdminUser(Application application);",
"public interface UserAwareController {\n default void changeUser(@NotNull UserHandle userHandle) {\n Intrinsics.checkParameterIsNotNull(userHandle, \"newUser\");\n }\n\n int getCurrentUserId();\n}",
"public interface BaseUserService\n extends UserDetailsService {\n}",
"public interface AuthenticationService {\n User getUserByAuthentication(Authentication authentication);\n}",
"public interface IUserDAO extends UserDetailsService {\n IUser findUser(String id);\n IUser findUserByEmail(String email);\n IUser createUser(IUser user);\n IUser updateUser(IUser user);\n}",
"public interface SecurityService {\n\n PasswordEncoder getPasswordEncoder();\n\n void createAdminUser(NewUser newUser);\n\n org.springframework.security.core.userdetails.User getCurrentUserFromCtx();\n\n User getCurrentUser();\n\n void createOfficeUser(NewOfficeUser newOfficeUser);\n\n void lockUser(User user);\n\n void unLockUser(User user);\n\n void changePassword(ChangePassword changePassword);\n\n boolean resetPassword(User user);\n\n boolean isLogged();\n\n\n}",
"public interface UserService {\n}",
"public interface UserService {\n}",
"public interface IAccountService {\n public TenantInfo getTenantInfo(String tenantAccount);\n public Map createUserInfo(TenantInfo tenant);\n public Map createUserDB(AdminUser adminUser,User user);\n public Map loginOfTenantInfo(TenantInfo tenant);\n public Map loginOfUser(User user);\n public Map getVerificationCode(Msg msg);\n\n}",
"public interface UserService {\n\n UserModel registerNewUserAccount(UserData accountDto) throws UserAlreadyExistException;\n\n void createVerificationTokenForUser(UserModel user, String token);\n}",
"public interface UserService extends AbstractService<User>{\n\n /**\n * 根据用户名和密码查询,校验用户\n * @param userName\n * @param password\n * @return\n */\n User checkUser(String userName, String password);\n}",
"@Service\npublic interface UserLoginUtil {\n\n public User getCurrentLogInUser();\n\n boolean userHaveRole(User currentUser, UserRole.Role admin);\n\n void addUserForClientWithRole(User user, UserRole.Role role) throws WrongInputDataException;\n\n void changePassForUser(User user, String password) throws WrongInputDataException;\n}",
"public interface UserService {\n\n public boolean register(User user);\n\n public boolean updatePassword(Integer userId, String userPassword);\n\n public boolean getUserInfo(Integer userId);\n\n}",
"public ApplicationUserService(ApplicationUserRespository applicationUserRepository) {\n this.applicationUserRepository = applicationUserRepository;\n }",
"public interface UserService {\n long addUser(User user);\n User getUserById(int id);\n long updateUserById(User user);\n}",
"@Test\n public void testAdminCanSeeOtherUserApplication() throws Exception {\n Set<Id> appIds = ImmutableSet.of(Id.valueOf(5000));\n User user = User.builder()\n .withId(Id.valueOf(5000))\n .withApplicationIds(appIds)\n .withRole(Role.ADMIN)\n .build();\n UserAwareQueryContext context = new UserAwareQueryContext(ApplicationSources.defaults(), \n ActiveAnnotations.standard(),\n Optional.of(user));\n UserAwareQuery<Application> query = UserAwareQuery.singleQuery(Id.valueOf(6000), context);\n UserAwareQueryResult<Application> result = executor.execute(query);\n assertFalse(result.isListResult());\n assertEquals(result.getOnlyResource().getId(), Id.valueOf(6000));\n }",
"public interface UserService {\n\n User createUser(User user);\n\n void changePassword(long userId, String newPassword);\n\n void correlationRoles(long userId, long... roleIds);\n\n void uncorrelationRoles(long userId, long... roleIds);\n\n User findByUserName(String username);\n\n Set<String> findRoles(String username);\n\n Set<String> findPermissions(String username);\n}",
"public interface UserService {\n\n\tpublic void save(UserEntity userEntity);\n\n\tpublic void saveBatch(HashMap<String, Object> map);\n\n\tpublic void delete(UserEntity userEntity);\n\n\tpublic void update(UserEntity userEntity);\n\n\tpublic void updatePic(UserEntity userEntity);\n\t\n\tpublic void updateRole(UserEntity userEntity);\n\n\tpublic List<UserEntity> findList(UserEntity userEntity);\n\n\t/* find user information to display */\n\tpublic List<UserParam> findUesrDetailInfo(UserEntity userEntity);\n\n\t/* find user information by name */\n\tpublic List<UserParam> findListForManagement(UserEntity userEntity);\n}",
"public interface UserService {\r\n\r\n User getUserById(Long id);\r\n User getUserNyName(String name);\r\n void saveUser(User user);\r\n}",
"public interface IUserInfoService {\n UserInfo getUserById(int userId);\n}",
"public interface UserService extends Service<User> {\n\n}",
"public interface UserService extends Service<User> {\n\n}",
"public interface UserService extends Service<User> {\n\n}",
"public interface UserService {\n\n /**\n * login user\n *\n * @param login user login\n * @param password user password\n * @return optional value of user if login is successful\n * @throws ServiceException if an error occurs while processing.\n */\n Optional<User> login(String login, String password) throws ServiceException;\n\n /**\n * register user\n *\n * @param login user login\n * @param password user password\n * @param passwordConfirmed password confirm\n * @return true if register successful, false, otherwise\n * @throws ServiceException if an error occurs while processing.\n */\n boolean register(String login, String password, String passwordConfirmed) throws ServiceException;\n\n /**\n * Finds user by id\n *\n * @param id user id\n * @return optional value of user.\n * @throws ServiceException if an error occurs while processing.\n */\n Optional<User> findUser(int id) throws ServiceException;\n\n /**\n * Finds user with cookies\n *\n * @param login user login\n * @param userHash user hash\n * @return optional value of user.\n * @throws ServiceException if an error occurs while processing.\n */\n Optional<User> findUserWithCookies(String login, String userHash) throws ServiceException;\n\n /**\n * update user\n *\n * @param user user entity\n * @return true if register successful, false, otherwise\n * @throws ServiceException if an error occurs while processing.\n */\n boolean updateUser(User user) throws ServiceException;\n\n /**\n * confirm email\n *\n * @param userId id of user\n * @param token for confirmation\n * @return optional value of user.\n * @throws ServiceException if an error occurs while processing.\n */\n Optional<User> confirmEmail(int userId, String token) throws ServiceException;\n\n /**\n * Finds all users\n *\n * @return list of users.\n * @throws ServiceException if an error occurs while processing.\n */\n List<User> findALlUsers() throws ServiceException;\n\n}",
"public interface IUserService {\n UserDTO registerNewUserAccount(UserBean accountBean) throws EmailExistsException;\n\n UserDTO getUser(String verificationToken);\n\n void saveRegisteredUser(UserDTO user);\n\n void deleteUser(UserDTO user);\n\n void createVerificationTokenForUser(UserDTO user, String token);\n\n VerificationTokenDTO getVerificationToken(String VerificationToken);\n\n VerificationTokenDTO generateNewVerificationToken(String token);\n\n void createPasswordResetTokenForUser(UserDTO user, String token);\n\n// UserDTO findUserByEmail(String email);\n\n PasswordResetTokenDTO getPasswordResetToken(String token);\n\n UserDTO getUserByPasswordResetToken(String token);\n\n UserDTO getUserByID(long id);\n\n void changeUserPassword(UserDTO user, String password);\n\n boolean checkIfValidOldPassword(UserDTO user, String password);\n}",
"@Contract\npublic interface UserService {\n Validation checkUser(UserBean user);\n\n Optional<User> getByCredentials(Credentials credentials);\n\n void createUser(UserBean user);\n}",
"public interface UserService {\n\n boolean authenticate(String name, String password); // Authenticates user login\n\n boolean addUser(UserModel user); // Adds a new user to the database\n\n UserModel findByName(String name); // Finds a user by name\n\n}",
"public interface SysUserService {\n public SysUserModel getByID(String id);\n}",
"public UserResource(UserService userService) {\n\t\tthis.userService = userService;\n\t\tsetupEndpoints();\n\t}",
"public interface UserService {\n\n User queryUserById(long id);\n\n User create(User user);\n\n int update(User user);\n\n int deleteById(long id);\n}",
"public interface UserService {\n\n /**\n * Create new user with registration\n */\n boolean registerUser(UserRegisterDTO userRegisterDTO);\n\n /**\n * Update user information\n */\n void updateUser(UserUpdateDto userUpdateDto, Long id) throws TimeTrackerException;\n\n /**\n * Get user information\n */\n Optional<User> userByIdSearch(Long id);\n\n /**\n * Get all users\n */\n Iterable<User> usersFind();\n\n /**\n * Add new user by administrator\n */\n void userAddByAdmin(AdminUserAddDTO adminUserAddDTO) throws RecordExistException;\n\n /**\n * Delete existing user by administrator\n */\n void deleteUserById(Long id);\n\n /**\n * Change existing user by administrator\n */\n void userChangeByAdmin(AdminUserDTO adminUserDTO) throws RecordExistException;\n}",
"public interface UserService extends DomainCRUDService<User, Integer> {\n\n /**\n * @param user user that going to register\n * @return true if for all user that is <b>not delete</b> and <b>have verified email</b>, no user has the same email as the parameter's user, else false\n */\n Boolean canRegister(User user);\n\n User getUserByEmail(String email);\n\n User register(User user);\n\n void verifyEmail(String token) throws ForbiddenException;\n}",
"public interface UserService {\n User findUserById(int id);\n User selectByName(String username);\n User selectByEmail(String email);\n int insrtUser(User user);\n int insertStatus(int id,int status);\n int insertHeader(int id,String headerUrl);\n int insertPassword(int id,String password);\n}",
"public interface UserService<T> {\n /**\n * Save optional.\n *\n * @param t the t\n * @return the optional\n */\n Optional<T> save(T t);\n\n /**\n * Update optional.\n *\n * @param t the t\n * @return the optional\n */\n Optional<T> update(T t);\n\n /**\n * Gets all.\n *\n * @return the all\n */\n Collection<T> getAll();\n\n /**\n * Gets by id.\n *\n * @param id the id\n * @return the by id\n */\n Optional<T> getById(Long id);\n\n /**\n * Delete.\n *\n * @param t the t\n */\n void delete(T t);\n\n /**\n * Delete all.\n */\n void deleteAll();\n\n /**\n * Delete by id.\n *\n * @param id the id\n */\n void deleteById(Long id);\n}",
"public interface UserService {\n\n User get(String email);\n void update(User user);\n void create(User user);\n}",
"public interface UserInfoService {\n\n public Account getAccount(Long userId);\n\n UserInfo getUserInfo(String userName, String password);\n\n UserInfo getUserInfo(String userName);\n\n void addUserInfo(UserInfo userInfo);\n\n void modifyUserInfo(UserInfo userInfo);\n\n void delUserInfo(UserInfo userInfo);\n\n boolean isContainUserInfo(String userName);\n\n Account getAccount(String username);\n\n UserInfo getLoginUser(HttpServletRequest request);\n\n UserInfo getLoginUser(String token);\n\n List<ProfileDto> getProfileDtoList();\n\n void auditUser(String userName);\n}",
"public UserResource()\n {\n backend_ = (Backend) getApplication().getContext().getAttributes()\n .get(\"backend\");\n }",
"public interface UserService {\n boolean checkCredentials(String login, String password);\n User add(String login, String password);\n}",
"public interface IUserService {\n\n String getUserName();\n\n}",
"@Local\npublic interface AdminService {\n /**\n * Creates a user of the system. The user is created with USER privileges.\n *\n * @param newUser the user to add.\n * @param token identifier of the session.\n * @throws AuthenticationException when the caller has not ADMIN permissions\n * @throws InvalidUserException when the user to add is not valid.\n */\n void createUser(User newUser, String token) throws AuthenticationException, InvalidUserException, UserAlreadyExistsException;\n\n /**\n * Deletes a user from the system.\n *\n * @param user the user that want to be deleted.\n * @param token identifier of the session.\n * @throws AuthenticationException when the caller has not ADMIN privileges.\n */\n void deleteUser(User user, String token) throws AuthenticationException;\n\n /**\n * Change the permissions of a user to a training. The permissions are: CREATE, READ.\n *\n * @param training the training.\n * @param user the user for whom the permissions will be changed.\n * @param permission the new permissions.\n * @param token the identifier of the session\n * @throws AuthenticationException when the caller has not ADMIN privileges.\n */\n void changePermissions(Training training, User user, Permission permission, String token) throws AuthenticationException;\n\n /**\n * CHange the privileges of a user to the system. Roles are: ADMINISTRATOR, TRAINER, USER.\n *\n * @param user the user for whom the role will be changed.\n * @param role the new role.\n * @param token the identifier of the session.\n * @throws AuthenticationException when the caller has not ADMIN privileges.\n */\n void changeRole(User user, Role role, String token) throws AuthenticationException;\n\n /**\n * Add a new Device to the system.\n *\n * @param device the device to be added.\n * @param token the identifier of the session.\n * @throws InvalidDeviceException when the device to add is not a valid one.\n * @throws AuthenticationException when the caller has not ADMIN privileges.\n * @throws DeviceAlreadyExistsException thrown when the device is already on the database.\n */\n void addDevice(Device device, String token) throws InvalidDeviceException, AuthenticationException,\n DeviceAlreadyExistsException;\n\n /**\n * Disable a device from the System. This happens when the device is broken.\n *\n * @param device the device to be disabled.\n * @param token the identifier of the session.\n * @throws AuthenticationException when the caller has not ADMIN privileges.\n */\n void disableDevice(Device device, String token) throws AuthenticationException;\n\n /**\n * Gets a User from the database by its username.\n *\n * @param name the username.\n * @return The User with the username specified.\n * @throws InvalidUserException when there is no user with the username specified.\n */\n User getUserByUsername(String name) throws InvalidUserException;\n\n /**\n * Modifies a Device that already exists on the system.\n *\n * @param device the device to be changes.\n * @param token the identifier of the session.\n * @throws InvalidDeviceException when the device to modify isn' on the database.\n * @throws AuthenticationException when the caller has no privileges to perform this action.\n */\n void modifyDevice(Device device, String token) throws InvalidDeviceException, AuthenticationException;\n\n /**\n * @return all the devices of the system. Doesn't need a token because only the admin can call the service.\n */\n List<Device> getAllDevices();\n\n /**\n * @param token the identifier of the session.\n * @return all the users from the system.\n * @throws AuthenticationException\n */\n List<User> getAllUsers(String token) throws AuthenticationException;\n}",
"public interface UserService{\n /**\n * Method to add user to the repository\n * @param userModel {@link AddUserModel} Details of the user to be added\n * @return {@link UserModel}\n * @throws BadRequestException Thrown when userName is null or empty\n */\n\tpublic UserModel addUser(AddUserModel userModel) throws BadRequestException;\n\t\n /**\n * Method to delete user from the repository\n * @param id Id of the user to be deleted\n * @throws BadRequestException Thrown when id is null or non-integer value\n */\n\tpublic void deleteUser(Integer id) throws BadRequestException;\n\t\n /**\n * Method to view details of a particular user\n * @param id of the user to be viewed\n * @return {@link UserModel} contains all the details of user \n * @throws BadRequestException Thrown when id is null or non-integer value\n */\n\tpublic UserModel viewUser(Integer id) throws BadRequestException;\n\t\n /**\n * Method to retrieve all the users from the repository\n * @return List of {@link UserModel}\n */\n\tpublic List<UserModel> viewAll();\n\t\n /**\n * Method to update the details of the user\n * @param userId Id of the user to be updated\n * @param user {@link UserModel} Details to be updated\n * @return {@link UserModel}\n * @throws BadRequestException Thrown when id is null or non-integer value\n */\n\tpublic UserModel updateUser(Integer userId,UserModel user) throws BadRequestException;\n\t\n\t/**\n\t * Method to add new user and update existing user\n\t * @param user Details of the user fetched from session\n\t * @return Id of the user who is added/updated\n\t */\n\tpublic Integer addOrUpdate(LoginResponse user);\n}",
"public interface CommonUserInfoService extends AbstractInterfaceService<UserInfo, Long> {\n \n public UserInfo getByScoinId(Long ScoinId) throws ScoinBusinessException;\n \n public Long scoinSSO(String accessToken) throws ScoinBusinessException;\n\n}",
"public interface AccountService {\n\tpublic Long getUserId(String name);\n\tpublic MessageSystem getMessageSystem();\n}",
"public interface IAtsUserService {\n\n IAtsUser getCurrentUser() throws OseeCoreException;\n\n String getCurrentUserId() throws OseeCoreException;\n\n IAtsUser getUserById(String userId) throws OseeCoreException;\n\n IAtsUser getUserByArtifactId(ArtifactId id);\n\n boolean isUserIdValid(String userId) throws OseeCoreException;\n\n boolean isUserNameValid(String name) throws OseeCoreException;\n\n IAtsUser getUserByName(String name) throws OseeCoreException;\n\n Collection<IAtsUser> getUsersByUserIds(Collection<String> userIds) throws OseeCoreException;\n\n boolean isAtsAdmin(IAtsUser user);\n\n List<IAtsUser> getUsers(Active active);\n\n List<IAtsUser> getUsersSortedByName(Active active);\n\n void reloadCache();\n\n void releaseUser();\n\n List<? extends IAtsUser> getUsers();\n\n List<? extends IAtsUser> getUsersFromDb();\n\n IAtsUser getUserByAccountId(Long accountId);\n\n}",
"public UserService getUserService() {\n return userService;\n }",
"public abstract User getUser();",
"public interface IUserService {\n User login(User user);\n\n void add(User user);\n\n void update(User user);\n\n void deleteById(String id);\n\n void batchDelete(String ids);\n\n User loadByUsername(String username);\n\n User loadByEmail(String email);\n\n User loadById(String id);\n\n List<User> list(User user, DataPage dp);\n\n Long total(User user);\n\n}",
"protected abstract IUser exchangeForActual(IAuthenticatedUser authenticatedUser);",
"public interface IUserService {\n User getUser(String login);\n}",
"public interface IUserService {\n public User findByUsername(String username);\n public void delete(String username);\n public User save(User user);\n public User update(User user);\n}",
"public interface SecurityService {\n\n /**\n * Try to authenticate an user\n *\n * @param credentials to authenticate.\n * @return LoggedUser instance associated with credentials\n * @throws IOException if error generating token\n */\n LoggedUser authenticate(@Valid AccountCredentials credentials) throws IOException;\n\n /**\n * Creates a new LoggedUser instance with the requested role\n *\n * @param roleId requested role id.\n * @return new LoggedUser instance\n * @throws IOException if error generating token\n */\n LoggedUser changeRole(String roleId) throws IOException;\n\n /**\n * Gets info from logged user (LoggedUser instance)\n *\n * @return LoggedUser instance\n */\n LoggedUser getLoggedUser();\n\n /**\n * Hashes a value\n *\n * @param value value to be hashed.\n * @return hashed value\n */\n String hashValue(String value);\n}",
"@Autowired\n public CustomUserDetailsService(UserService userService) {\n this.userService = userService;\n }",
"@Service\r\npublic interface UserService {\r\n\r\n int addUser(User user);\r\n}"
] | [
"0.6767495",
"0.6749865",
"0.6577231",
"0.6424677",
"0.63170516",
"0.62945485",
"0.6273915",
"0.62702525",
"0.62570757",
"0.6209054",
"0.61930543",
"0.618554",
"0.6177559",
"0.6167939",
"0.6163953",
"0.6160205",
"0.61531526",
"0.6120826",
"0.6082578",
"0.60824984",
"0.60686195",
"0.60111284",
"0.5989671",
"0.5983991",
"0.5979412",
"0.59778273",
"0.5976983",
"0.5975596",
"0.5958105",
"0.5955671",
"0.5948249",
"0.59284765",
"0.592729",
"0.5910553",
"0.58985406",
"0.589221",
"0.58848184",
"0.58789384",
"0.5877914",
"0.58679986",
"0.5865526",
"0.58590627",
"0.5856242",
"0.5853779",
"0.58501035",
"0.5845012",
"0.58386016",
"0.58369595",
"0.5828122",
"0.5817194",
"0.58148634",
"0.58134407",
"0.5804968",
"0.5795895",
"0.5795895",
"0.5794862",
"0.577694",
"0.5767387",
"0.57667387",
"0.57587796",
"0.5757363",
"0.5752236",
"0.5740235",
"0.573362",
"0.5726719",
"0.5723457",
"0.5719284",
"0.57169425",
"0.57169425",
"0.57169425",
"0.57129836",
"0.57108366",
"0.5704633",
"0.56998223",
"0.5695855",
"0.56895244",
"0.56875736",
"0.568665",
"0.567748",
"0.5672465",
"0.5669576",
"0.5664798",
"0.56515956",
"0.5650525",
"0.56499773",
"0.5646542",
"0.56459504",
"0.5645065",
"0.5642203",
"0.5635286",
"0.56296283",
"0.5627758",
"0.56256497",
"0.5615522",
"0.5612764",
"0.56109035",
"0.5610631",
"0.56093335",
"0.56080025",
"0.5605629"
] | 0.56836885 | 78 |
Should be write transaction. Should throw EntityExistException if entity is already present | E add(IApplicationUser user, C createDto); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public EntityAlreadyExistsException() {\n\t\tsuper(\"exception.entity.already.exists\");\n\t}",
"@ResponseStatus(value = HttpStatus.CONFLICT, reason = \"Another entity with the same identity exists\")\n @ExceptionHandler({DataIntegrityViolationException.class})\n public void handleAlreadyExists() {\n // just return empty 409\n logger.info(\"-----> Entity save operation failure\");\n }",
"@Override\n\tpublic T create(T entity) {\n\t\t//TODO al anotar un metodo como transaccional spring de encarga de la transaccion por lo que no hay que \n\t\t//abrir la transaccion ni hacer commit, se encarga spring. Es más si lo intentas da un error, no se \n\t\t//pueden crear transacciones en una transaccion conpartida\n\t\t//Not allowed to create transaction on shared EntityManager - use Spring transactions\n\t\t//em.getTransaction().begin();\n\t\t\n\t\tSystem.out.println(em.contains(entity));\n\t\tem.persist(entity);\n\t\tSystem.out.println(em.contains(entity));\n\t\t//em.getTransaction().commit();\n\t\t\n\t\t//Session session = (Session) em.getDelegate();\n\t\t//Transaction tx = session.beginTransaction();\n\t\t//session.saveOrUpdate(entity);\n\t\t//session.flush();\n\t\t//tx.commit();\n\t\treturn entity;\n\t}",
"public default void checkPersisted(Object entity) {\n\t\tif (!getEntityManager().contains(entity)) {\n\t\t\tthrow new ProgrammingException(\"Method requires a persisted entity, transient passed\");\n\t\t}\n\t}",
"@Override\n public boolean isAlreadyInDb () {\n try {\n load( idDevice );\n } catch ( EntityNotFoundException e ) {\n return false;\n }\n return true;\n }",
"public abstract boolean create(T entity) throws ServiceException;",
"T save(T entity) throws DataConcurrencyException, DataIntegrityViolationException;",
"public void testupdateAddress_EntityNotFoundException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n this.dao.updateAddress(address, false);\r\n fail(\"EntityNotFoundException expected\");\r\n } catch (EntityNotFoundException e) {\r\n //good\r\n }\r\n }",
"@Test\n @Transactional\n void createSectieWithExistingId() throws Exception {\n sectie.setId(1L);\n\n int databaseSizeBeforeCreate = sectieRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSectieMockMvc\n .perform(\n post(ENTITY_API_URL).with(csrf()).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(sectie))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Sectie in the database\n List<Sectie> sectieList = sectieRepository.findAll();\n assertThat(sectieList).hasSize(databaseSizeBeforeCreate);\n\n // Validate the Sectie in Elasticsearch\n verify(mockSectieSearchRepository, times(0)).save(sectie);\n }",
"private void checkIfTransactionDoesntExists(TransactionDto transactionDto) {\n Optional<Transaction> transactionO = transactionRepository.findById(transactionDto.getId());\n if (transactionO.isPresent()) {\n throw new BusinessLogicException(String.format(\"A transaction with the id '%s' already exists.\",\n transactionDto.getId()));\n }\n }",
"@Test(expected = EntityNotFoundException.class)\n public void test_update_NotFound1() throws Exception {\n User user1 = createUser(1, false);\n\n clearDB();\n\n user1.setUsername(\"new\");\n instance.update(user1);\n }",
"protected boolean checkExistence(E entity) throws DAOException {\n\t\tString existanceSQL = getEntityExistanceSQL(entity);\n\n\t\ttry (Connection connection = source.getConnection();\n\t\t\t\tStatement st = connection.createStatement();\n\t\t\t\tResultSet rs = st.executeQuery(existanceSQL)) {\n\n\t\t\treturn rs.next();\n\n\t\t} catch (SQLException cause) {\n\t\t\tthrow new DAOException(cause);\n\t\t}\n\t}",
"public void test_CreateContest_Failure2_EntityAlreadyExistsException()\r\n throws Exception {\r\n try {\r\n initContext();\r\n\r\n Contest contest = createContestForTest();\r\n\r\n beanUnderTest.createContest(contest);\r\n\r\n // Persist it again.\r\n beanUnderTest.createContest(contest);\r\n\r\n fail(\"EntityAlreadyExistsException is expected.\");\r\n } catch (EntityAlreadyExistsException e) {\r\n // success\r\n }\r\n }",
"@Test\n void createOrderItemWithExistingId() throws Exception {\n orderItem.setId(1L);\n\n int databaseSizeBeforeCreate = orderItemRepository.findAll().collectList().block().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n webTestClient\n .post()\n .uri(ENTITY_API_URL)\n .contentType(MediaType.APPLICATION_JSON)\n .bodyValue(TestUtil.convertObjectToJsonBytes(orderItem))\n .exchange()\n .expectStatus()\n .isBadRequest();\n\n // Validate the OrderItem in the database\n List<OrderItem> orderItemList = orderItemRepository.findAll().collectList().block();\n assertThat(orderItemList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test(expected = EntityNotFoundException.class)\n public void test_update_NotFound2() throws Exception {\n User user1 = createUser(1, true);\n\n user1.setUsername(\"new\");\n instance.update(user1);\n }",
"@Test\n void createAWithExistingId() throws Exception {\n a.setId(1L);\n\n int databaseSizeBeforeCreate = aRepository.findAll().collectList().block().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n webTestClient\n .post()\n .uri(ENTITY_API_URL)\n .contentType(MediaType.APPLICATION_JSON)\n .bodyValue(TestUtil.convertObjectToJsonBytes(a))\n .exchange()\n .expectStatus()\n .isBadRequest();\n\n // Validate the A in the database\n List<A> aList = aRepository.findAll().collectList().block();\n assertThat(aList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createEnseignerWithExistingId() throws Exception {\n enseigner.setId(1L);\n\n int databaseSizeBeforeCreate = enseignerRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restEnseignerMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(enseigner)))\n .andExpect(status().isBadRequest());\n\n // Validate the Enseigner in the database\n List<Enseigner> enseignerList = enseignerRepository.findAll();\n assertThat(enseignerList).hasSize(databaseSizeBeforeCreate);\n }",
"public void testupdateAddresses_EntityNotFoundException() throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.setCreationDate(new Date());\r\n address.setId(1);\r\n this.dao.updateAddresses(new Address[]{address}, false);\r\n fail(\"EntityNotFoundException expected\");\r\n } catch (EntityNotFoundException e) {\r\n //good\r\n }\r\n }",
"@Test\n @Transactional\n void createTipoObraWithExistingId() throws Exception {\n tipoObra.setId(1L);\n\n int databaseSizeBeforeCreate = tipoObraRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restTipoObraMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(tipoObra)))\n .andExpect(status().isBadRequest());\n\n // Validate the TipoObra in the database\n List<TipoObra> tipoObraList = tipoObraRepository.findAll();\n assertThat(tipoObraList).hasSize(databaseSizeBeforeCreate);\n }",
"@SuppressWarnings(\"unchecked\")\n @Override\n protected <T> T _persistOrMerge(T entity) {\n if (entity == null) {\n logger.debug(\"entity == null\");\n return null;\n }\n if (em().contains(entity)) {\n logger.debug(\"em().contains(entity), try to _merge\");\n return _merge(entity);\n }\n Serializable id = getMetadataUtil().getId(entity);\n if (id == null) {\n logger.debug(\"_persist(id == null)\");\n _persist(entity);\n return entity;\n }\n T prev = em().find((Class<T>) entity.getClass(), id);\n if (prev == null) {\n logger.debug(\"_persist(prev == null)\");\n _persist(entity);\n return entity;\n } else {\n logger.debug(\"_merge\");\n return _merge(entity);\n }\n }",
"private boolean requiresCreate( EntityInstanceImpl ei )\n {\n // Can't create an entity that wasn't created...\n if ( !ei.isCreated() )\n return false;\n\n // Skip deleted entities; they've been created then deleted so no need to save them.\n if ( ei.isDeleted() )\n return false;\n\n // Check to see if this EI has already been inserted into the DB.\n if ( ei.dbhCreated )\n return false;\n\n EntityDef entityDef = ei.getEntityDef();\n if ( entityDef.isDerivedPath() )\n return false;\n\n // Skip the entity if we don't allow creates.\n if ( ! entityDef.isCreate() )\n return false;\n\n DataRecord dataRecord = entityDef.getDataRecord();\n if ( dataRecord == null )\n return false;\n\n return true;\n }",
"public T save(T entity) throws Exception{\n\t\tentity = em.merge(entity);\n\t\treturn entity;\n\t}",
"public void create(DataSet dataSet) throws PreexistingEntityException, Exception {\n EntityManager em = null;\n try {\n em = getEntityManager();\n em.getTransaction().begin();\n em.persist(dataSet);\n em.getTransaction().commit();\n } catch (Exception ex) {\n if (findDataSet(dataSet.getWid()) != null) {\n throw new PreexistingEntityException(\"DataSet \" + dataSet + \" already exists.\", ex);\n }\n throw ex;\n } finally {\n if (em != null) {\n em.close();\n }\n }\n }",
"@Test\n @Transactional\n void createStudentWithExistingId() throws Exception {\n student.setId(1L);\n StudentDTO studentDTO = studentMapper.toDto(student);\n\n int databaseSizeBeforeCreate = studentRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restStudentMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(studentDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Student in the database\n List<Student> studentList = studentRepository.findAll();\n assertThat(studentList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createUserExtraWithExistingId() throws Exception {\n userExtra.setId(1L);\n\n int databaseSizeBeforeCreate = userExtraRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restUserExtraMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(userExtra)))\n .andExpect(status().isBadRequest());\n\n // Validate the UserExtra in the database\n List<UserExtra> userExtraList = userExtraRepository.findAll();\n assertThat(userExtraList).hasSize(databaseSizeBeforeCreate);\n\n // Validate the UserExtra in Elasticsearch\n verify(mockUserExtraSearchRepository, times(0)).save(userExtra);\n }",
"public void save() throws EntityPersistenceException {\n\n }",
"@Test\n @Transactional\n void createTerritorioWithExistingId() throws Exception {\n territorio.setId(1L);\n\n int databaseSizeBeforeCreate = territorioRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restTerritorioMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(territorio)))\n .andExpect(status().isBadRequest());\n\n // Validate the Territorio in the database\n List<Territorio> territorioList = territorioRepository.findAll();\n assertThat(territorioList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createInternacoesWithExistingId() throws Exception {\n internacoes.setId(1L);\n\n int databaseSizeBeforeCreate = internacoesRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restInternacoesMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(internacoes)))\n .andExpect(status().isBadRequest());\n\n // Validate the Internacoes in the database\n List<Internacoes> internacoesList = internacoesRepository.findAll();\n assertThat(internacoesList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createAcheteurWithExistingId() throws Exception {\n acheteur.setId(1L);\n AcheteurDTO acheteurDTO = acheteurMapper.toDto(acheteur);\n\n int databaseSizeBeforeCreate = acheteurRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restAcheteurMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(acheteurDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Acheteur in the database\n List<Acheteur> acheteurList = acheteurRepository.findAll();\n assertThat(acheteurList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createPrestamoWithExistingId() throws Exception {\n prestamo.setId(1L);\n PrestamoDTO prestamoDTO = prestamoMapper.toDto(prestamo);\n\n int databaseSizeBeforeCreate = prestamoRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restPrestamoMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(prestamoDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Prestamo in the database\n List<Prestamo> prestamoList = prestamoRepository.findAll();\n assertThat(prestamoList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test(expected=DuplicateKeyException.class)\n\t\tpublic void testSave3()\n\t\t{\n\n\t\t\tChObject cho = repoTest.get(\"68268301\");\n\n\t\t\trepoTest.save(cho);\t\t\t//add chObject to repo\n\t\t\trepoTest.save(cho);\t\t\t//add duplicate record (not allowed...should throw exception)\n\t\t}",
"@Override\r\n public void saveOrUpdateEntity(String entityName, DataStoreEntity dataStoreEntity) {\n\r\n }",
"@Test\n @Transactional\n void createSkillWithExistingId() throws Exception {\n skill.setId(1L);\n SkillDTO skillDTO = skillMapper.toDto(skill);\n\n int databaseSizeBeforeCreate = skillRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSkillMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(skillDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Skill in the database\n List<Skill> skillList = skillRepository.findAll();\n assertThat(skillList).hasSize(databaseSizeBeforeCreate);\n }",
"Document saveDocument(Document document) throws EntityExistsException;",
"@Override\r\n\tpublic T update(T entity) throws Exception {\n\t\ttry {\r\n\t\t\tthis.getcurrentSession().update(entity);\r\n\t\t\treturn entity;\r\n\t\t}catch (NonUniqueObjectException e) {\r\n\t\t\tthis.getcurrentSession().merge(entity);\r\n\t\t\treturn entity;\r\n\t\t} catch (DataAccessException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\tthrow new Exception(\"更新\" + entity.getClass().getName() + \"实例失败\", e);\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void exist() {\n\t\t\n\t}",
"@Override\n\tpublic void insert(UploadDF entity) {\n\t\tSession session = factory.openSession();\n\t\ttry{\n\t\t\tsession.beginTransaction();\n\t\t\tsession.save(entity);\n\t\t\tsession.getTransaction().commit();\n\t\t}catch(HibernateException exception){\n\t\t\tsession.getTransaction().rollback();\n\t\t\tthrow exception;\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t}",
"@Test\n @Transactional\n void createKpiWithExistingId() throws Exception {\n kpi.setId(1L);\n\n int databaseSizeBeforeCreate = kpiRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restKpiMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(kpi)))\n .andExpect(status().isBadRequest());\n\n // Validate the Kpi in the database\n List<Kpi> kpiList = kpiRepository.findAll();\n assertThat(kpiList).hasSize(databaseSizeBeforeCreate);\n }",
"public void commitEntity();",
"@Test\n @Transactional\n void createIndActivationWithExistingId() throws Exception {\n indActivation.setId(1L);\n IndActivationDTO indActivationDTO = indActivationMapper.toDto(indActivation);\n\n int databaseSizeBeforeCreate = indActivationRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restIndActivationMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(indActivationDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the IndActivation in the database\n List<IndActivation> indActivationList = indActivationRepository.findAll();\n assertThat(indActivationList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createIndContactCharWithExistingId() throws Exception {\n indContactChar.setId(1L);\n IndContactCharDTO indContactCharDTO = indContactCharMapper.toDto(indContactChar);\n\n int databaseSizeBeforeCreate = indContactCharRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restIndContactCharMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(indContactCharDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the IndContactChar in the database\n List<IndContactChar> indContactCharList = indContactCharRepository.findAll();\n assertThat(indContactCharList).hasSize(databaseSizeBeforeCreate);\n }",
"boolean hasEntity();",
"boolean hasEntity();",
"@Test\n @Transactional\n void createUserextraWithExistingId() throws Exception {\n userextra.setId(1L);\n\n int databaseSizeBeforeCreate = userextraRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restUserextraMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(userextra)))\n .andExpect(status().isBadRequest());\n\n // Validate the Userextra in the database\n List<Userextra> userextraList = userextraRepository.findAll();\n assertThat(userextraList).hasSize(databaseSizeBeforeCreate);\n }",
"@Override\n @Transactional(propagation = Propagation.REQUIRED)\n public void insertNewEntity(BaseEntity baseEntity) throws UnableToInsertException {\n try{\n // transaction = openTransaction(sessionFactory.getCurrentSession());\n entityDAO.insert(baseEntity);\n // transaction.commit();\n }\n catch(Exception ex){\n /* if(transaction != null)\n transaction.rollback();*/\n throw new UnableToInsertException(ex.getMessage());\n }\n }",
"@Test\n @Transactional\n void createCommonTableFieldWithExistingId() throws Exception {\n commonTableField.setId(1L);\n CommonTableFieldDTO commonTableFieldDTO = commonTableFieldMapper.toDto(commonTableField);\n\n int databaseSizeBeforeCreate = commonTableFieldRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restCommonTableFieldMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(commonTableFieldDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the CommonTableField in the database\n List<CommonTableField> commonTableFieldList = commonTableFieldRepository.findAll();\n assertThat(commonTableFieldList).hasSize(databaseSizeBeforeCreate);\n }",
"@Test\n @Transactional\n void createInvoiceWithExistingId() throws Exception {\n invoice.setId(1L);\n\n int databaseSizeBeforeCreate = invoiceRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restInvoiceMockMvc\n .perform(\n post(ENTITY_API_URL)\n .with(csrf())\n .contentType(MediaType.APPLICATION_JSON)\n .content(TestUtil.convertObjectToJsonBytes(invoice))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Invoice in the database\n List<Invoice> invoiceList = invoiceRepository.findAll();\n assertThat(invoiceList).hasSize(databaseSizeBeforeCreate);\n }",
"public abstract boolean create(T entity) throws SQLException;",
"@Test\n @Transactional\n void createQuestionsWithExistingId() throws Exception {\n questions.setId(1L);\n QuestionsDTO questionsDTO = questionsMapper.toDto(questions);\n\n int databaseSizeBeforeCreate = questionsRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restQuestionsMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(questionsDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Questions in the database\n List<Questions> questionsList = questionsRepository.findAll();\n assertThat(questionsList).hasSize(databaseSizeBeforeCreate);\n }",
"@Override\n\tpublic void importarExpediente(Expedientes exp) throws ExpedienteNoEncontradoException {\n\t\tem.merge(exp);//Si no estaba la crea y si estaba la va a actualizar\n\t\t\n\t}",
"@Override\n\tpublic boolean isExists(ConquestMoveEffect entity) {\n\t\treturn false;\n\t}",
"@Test\n public void saveSingleEntity() {\n repository.save(eddard);\n assertThat(operations\n .execute((RedisConnection connection) -> connection.exists((\"persons:\" + eddard.getId()).getBytes(CHARSET))))\n .isTrue();\n }",
"default E create(E entity)\n throws TechnicalException, ConflictException {\n return create(entity, null);\n }",
"public abstract boolean update(T entity) throws ServiceException;",
"public static boolean updateStuff(Entity entity){\n\t\tDatastoreService datastore = DatastoreServiceFactory.getDatastoreService();\n\t\tKey key = datastore.put(entity);\n\t\tif (key != null){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public EspecieEntity inserta(EspecieEntity entity){\r\n em.persist(entity);\r\n return entity;\r\n }",
"@Override\n public E insert(E entity) {\n LOG.info(\"[insert] Start: entity = \" + entity.getClass().getSimpleName());\n entityManager.persist(entity);\n LOG.info(\"[insert] End\");\n return entity;\n }",
"@Override\n @LogMethod\n public T create(T entity) throws InventoryException {\n \tInventoryHelper.checkNull(entity, \"entity\");\n repository.persist(entity);\n return repository.getByKey(entity.getId());\n }",
"@Override\r\n\tpublic boolean isExist() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean isExisting() {\n\t\treturn false;\r\n\t}",
"E create(E entity, RequestContext context)\n throws TechnicalException, ConflictException;",
"@Test\n public void testUpdateProductShouldThrowResourceExistsExceptionWhenNewNameExists() throws Exception {\n // Mock method\n when(productRepository.findOne(product.getId())).thenReturn(product);\n when(productRepository.existsByName(productRequest.getName())).thenReturn(true);\n\n testResponseData(RequestInfo.builder()\n .request(put(PRODUCT_DETAIL_ENDPOINT, product.getId()))\n .token(adminToken)\n .body(productRequest)\n .httpStatus(HttpStatus.CONFLICT)\n .build());\n }",
"protected abstract EntityBase createEntity() throws Exception;",
"@Test\n @Transactional\n void createDepartmentWithExistingId() throws Exception {\n department.setId(1L);\n DepartmentDTO departmentDTO = departmentMapper.toDto(department);\n\n int databaseSizeBeforeCreate = departmentRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restDepartmentMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(departmentDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Department in the database\n List<Department> departmentList = departmentRepository.findAll();\n assertThat(departmentList).hasSize(databaseSizeBeforeCreate);\n\n // Validate the Department in Elasticsearch\n verify(mockDepartmentSearchRepository, times(0)).save(department);\n }",
"public E saveUpdate(E entity){\n EntityTransaction transaction = entityManager.getTransaction();\n transaction.begin();\n E e = entityManager.merge(entity);\n transaction.commit();\n return e;\n }",
"@Test\n @Transactional\n void createSiegeLesionsWithExistingId() throws Exception {\n siegeLesions.setId(1L);\n SiegeLesionsDTO siegeLesionsDTO = siegeLesionsMapper.toDto(siegeLesions);\n\n int databaseSizeBeforeCreate = siegeLesionsRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restSiegeLesionsMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(siegeLesionsDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the SiegeLesions in the database\n List<SiegeLesions> siegeLesionsList = siegeLesionsRepository.findAll();\n assertThat(siegeLesionsList).hasSize(databaseSizeBeforeCreate);\n }",
"@Override\r\n\tpublic void save() throws AccessDeniedException, ItemExistsException,\r\n\t\t\tReferentialIntegrityException, ConstraintViolationException,\r\n\t\t\tInvalidItemStateException, VersionException, LockException,\r\n\t\t\tNoSuchNodeTypeException, RepositoryException {\n\t\t\r\n\t}",
"protected T createSimulatedExistingEntity() {\n final T entity = createNewEntity();\n entity.setId(IDUtil.randomPositiveLong());\n\n when(getDAO().findOne(entity.getId())).thenReturn(entity);\n return entity;\n }",
"@Override\r\n public void createNewEntity(String entityName) {\n\r\n }",
"public T insert(T entity) throws DataAccessException;",
"void createOrUpdate(T entity);",
"public void test_AddDocument_Failure1() throws Exception {\r\n try {\r\n initContext();\r\n\r\n Document document = createDocumentForTest();\r\n beanUnderTest.addDocument(document);\r\n beanUnderTest.addDocument(document);\r\n fail(\"EntityAlreadyExistsException is expected.\");\r\n } catch (EntityAlreadyExistsException e) {\r\n // success\r\n }\r\n }",
"@Test\n @Transactional\n void createDepartmentWithExistingId() throws Exception {\n department.setId(1L);\n DepartmentDTO departmentDTO = departmentMapper.toDto(department);\n\n int databaseSizeBeforeCreate = departmentRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restDepartmentMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(departmentDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Department in the database\n List<Department> departmentList = departmentRepository.findAll();\n assertThat(departmentList).hasSize(databaseSizeBeforeCreate);\n }",
"T insert(T entity) throws Exception;",
"@Test(expected = DataAcessException.class)\n\t public void testSaveExcep() throws DataAcessException{\n\t \tUsers user = BaseData.getUsers();\n\t\tdoThrow(RuntimeException.class).when(entityManager).persist(user);\n\t\tuserDao.save(user);\n\t }",
"@Test(expected = DataAcessException.class)\n\t public void testUpdateExcep() throws DataAcessException{\n\t\tUsers user = BaseData.getUsers();\n\t\twhen(entityManager.merge(user)).thenThrow(new RuntimeException());\n\t\tuserDao.update(user);\n\t }",
"@Override\n public String saveRecord(FacesContext facesContext, AbstractFacade ejb, AbstractEntity entity,\n String samePage) {\n \n Erid erid = (Erid) entity;\n if (isSameEridExist(ejb, erid)) {\n throwMessage(facesContext, \"DuplicateError\");\n return samePage;\n } else {\n ejb.create(erid);\n return GoToPage.main;\n } \n }",
"boolean hasInsertOrUpdate();",
"@Test\n @Transactional\n void createPropertiesWithExistingId() throws Exception {\n properties.setId(1L);\n PropertiesDTO propertiesDTO = propertiesMapper.toDto(properties);\n\n int databaseSizeBeforeCreate = propertiesRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restPropertiesMockMvc\n .perform(\n post(ENTITY_API_URL)\n .with(csrf())\n .contentType(MediaType.APPLICATION_JSON)\n .content(TestUtil.convertObjectToJsonBytes(propertiesDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Properties in the database\n List<Properties> propertiesList = propertiesRepository.findAll();\n assertThat(propertiesList).hasSize(databaseSizeBeforeCreate);\n\n // Validate the Properties in Elasticsearch\n verify(mockPropertiesSearchRepository, times(0)).save(properties);\n }",
"public void save(E entity){\n transaction.begin();\n entityManager.persist(entity);\n transaction.commit();\n }",
"@Test\n @Transactional\n void createProducerWithExistingId() throws Exception {\n producer.setId(1L);\n ProducerDTO producerDTO = producerMapper.toDto(producer);\n\n int databaseSizeBeforeCreate = producerRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restProducerMockMvc\n .perform(\n post(ENTITY_API_URL)\n .with(csrf())\n .contentType(MediaType.APPLICATION_JSON)\n .content(TestUtil.convertObjectToJsonBytes(producerDTO))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the Producer in the database\n List<Producer> producerList = producerRepository.findAll();\n assertThat(producerList).hasSize(databaseSizeBeforeCreate);\n }",
"void create(T entity) throws Exception;",
"@Test\n @Ignore\n public void testExists() throws Exception {\n System.out.println(\"exists\");\n Identifier identifier = null;\n IndexDaoImpl instance = null;\n boolean expResult = false;\n boolean result = instance.exists(identifier);\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }",
"@Override\n\tpublic boolean contains(Object entity) {\n\t\treturn false;\n\t}",
"public void testUpdateTrackStatusForNoEntity() throws Exception {\r\n TrackStatus entity = new TrackStatus();\r\n entity.setId(3);\r\n EasyMock.expect(em.find(entity.getClass(), 3l)).andReturn(null);\r\n EasyMock.replay(context, em);\r\n try {\r\n target.updateTrackStatus(entity);\r\n fail(\"EntityNotFoundException expected.\");\r\n } catch (EntityNotFoundException ex) {\r\n // success\r\n }\r\n }",
"Entity save(Entity entity);",
"@Transactional void add(E entity);",
"public void crearEntidad() throws EntidadNotFoundException {\r\n\t\tif (validarCampos(getNewEntidad())) {\r\n\t\t\tif (validarNomNitRepetidoEntidad(getNewEntidad())) {\r\n\t\t\t\tFacesContext.getCurrentInstance().addMessage(null,\r\n\t\t\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_WARN, \"Advertencia: \", \"Nombre, Nit o Prejifo ya existe en GIA\"));\r\n\t\t\t} else {\r\n\t\t\t\tif (entidadController.crearEntidad(getNewEntidad())) {\r\n\t\t\t\t\tmensajeGrow(\"Entidad Creada Satisfactoriamente\", getNewEntidad());\r\n\t\t\t\t\tRequestContext.getCurrentInstance().execute(\"PF('entCrearDialog').hide()\");\r\n\t\t\t\t\tsetNewEntidad(new EntidadDTO());\r\n\t\t\t\t\tresetCodigoBUA();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tmensajeGrow(\"Entidad No Fue Creada\", getNewEntidad());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tlistarEntidades();\r\n\t\t\t// newEntidad = new EntidadDTO();\r\n\t\t\t// fechaActual();\r\n\t\t}\r\n\r\n\t}",
"@Override\n\tpublic void update(UploadDF entity) {\n\t\tSession session = factory.openSession();\n\t\ttry{\n\t\t\tsession.beginTransaction();\n\t\t\tsession.update(entity);\n\t\t\tsession.getTransaction().commit();\n\t\t}catch(HibernateException exception){\n\t\t\tsession.getTransaction().rollback();\n\t\t\tthrow exception;\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t}",
"@Override\n\tpublic void persist(Object entity) {\n\t\t\n\t}",
"public EntityAlreadyExistsException(Object entityId, Class<?> entityType) {\n\t\tsuper(\"exception.entity.already.exists.with.id\", entityType.getSimpleName(), entityId);\n\t}",
"@Override\n public void addSong(Song song) throws DuplicateException {\n try {\n em.persist(song);\n } catch (Exception ex) {\n logger.log(Level.SEVERE, \"Cannot create a new song due to: {0}\", ex.getMessage());\n if (ex.getCause() instanceof ConstraintViolationException) {\n throw new DuplicateException();\n }\n throw ex;\n }\n }",
"T createOrUpdate(final T domain) throws RequiredValueException, NoEntityFoundException;",
"@Test\n @Transactional\n void createRestaurantWithExistingId() throws Exception {\n restaurant.setId(1L);\n RestaurantDTO restaurantDTO = restaurantMapper.toDto(restaurant);\n\n int databaseSizeBeforeCreate = restaurantRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restRestaurantMockMvc\n .perform(post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(restaurantDTO)))\n .andExpect(status().isBadRequest());\n\n // Validate the Restaurant in the database\n List<Restaurant> restaurantList = restaurantRepository.findAll();\n assertThat(restaurantList).hasSize(databaseSizeBeforeCreate);\n }",
"@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic ServiceResult exists(final Object obj){\n\t\tServiceResult result = new ServiceResult();\n\t\tObject temp;\n\t\ttry{\n\t\t\ttemp = dao.isExisted(obj);\n\t\t\tif (temp != null){\n\t\t\t\tresult.setResult(true);\n\t\t\t\tresult.setReturnObject(temp);\n\t\t\t} else {\n\t\t\t\tresult.setResult(false);\n\t\t\t}\n\t\t} catch (Exception e){\n\t\t\tresult.setResult(false);\n\t\t\tresult.setMessage(\"Error:\"+e);\n\t\t\tlog.error(\"Error checking if object is unique: \", e);\n\t\t}\n\t\treturn result;\n\t}",
"void add(E entity) throws ValidationException, RepositoryException;",
"@Test\n @Transactional\n void createLessonTimetableWithExistingId() throws Exception {\n lessonTimetable.setId(1L);\n\n int databaseSizeBeforeCreate = lessonTimetableRepository.findAll().size();\n\n // An entity with an existing ID cannot be created, so this API call must fail\n restLessonTimetableMockMvc\n .perform(\n post(ENTITY_API_URL).contentType(MediaType.APPLICATION_JSON).content(TestUtil.convertObjectToJsonBytes(lessonTimetable))\n )\n .andExpect(status().isBadRequest());\n\n // Validate the LessonTimetable in the database\n List<LessonTimetable> lessonTimetableList = lessonTimetableRepository.findAll();\n assertThat(lessonTimetableList).hasSize(databaseSizeBeforeCreate);\n }",
"WriteRequest insert(PiEntity entity);",
"@Test(expected = EntityNotFoundException.class)\n\tpublic void testDeleteEntityNotFoundException() {\n\t\t\n\t\tLong id = 4L;\n\t\tString cpr = \"271190-0000\";\n\t\tint kr = 100;\n\t\tString dato = \"01-01-2001\";\n\t\tString type = \"type2\";\n\n\t\tYdelse y = new Ydelse(id, cpr, kr, dato, type);\n\t\t\n\t\tdoReturn(null).when(entityManager).getReference(y.getClass(), y.getId());\n\t\t\n\t\tydelseService.delete(y.getClass(), id);\n\t}",
"public void saveOrUpdate(Transaction transaction) throws Exception;",
"@Test\r\n public void testFind() throws Exception {\r\n MonitoriaEntity entity = data.get(0);\r\n MonitoriaEntity nuevaEntity = persistence.find(entity.getId());\r\n Assert.assertNotNull(nuevaEntity);\r\n Assert.assertEquals(entity.getId(), nuevaEntity.getId());\r\n Assert.assertEquals(entity.getIdMonitor(), nuevaEntity.getIdMonitor());\r\n Assert.assertEquals(entity.getTipo(), nuevaEntity.getTipo());\r\n \r\n }"
] | [
"0.71481615",
"0.6897156",
"0.6868923",
"0.6425666",
"0.63411254",
"0.63188857",
"0.62871236",
"0.62451637",
"0.623026",
"0.6227759",
"0.62131524",
"0.621049",
"0.6161486",
"0.61558044",
"0.6137891",
"0.6130631",
"0.6104688",
"0.60907614",
"0.60851204",
"0.6082892",
"0.6069968",
"0.6051732",
"0.60489154",
"0.60335106",
"0.60308415",
"0.6004132",
"0.59997094",
"0.5993436",
"0.5979887",
"0.59608686",
"0.5938166",
"0.5937502",
"0.5934539",
"0.5926331",
"0.59222037",
"0.59136206",
"0.5903869",
"0.5891894",
"0.5891468",
"0.58594143",
"0.58517826",
"0.58509433",
"0.58509433",
"0.585018",
"0.5845219",
"0.5837026",
"0.58294654",
"0.5827336",
"0.58057505",
"0.5801692",
"0.57957965",
"0.5794768",
"0.57817733",
"0.5779563",
"0.57778037",
"0.5772895",
"0.57654035",
"0.5764081",
"0.57543045",
"0.5747967",
"0.5746494",
"0.5741824",
"0.57228553",
"0.57203984",
"0.5717616",
"0.5715519",
"0.5709656",
"0.57033753",
"0.57019514",
"0.5696704",
"0.5693582",
"0.5691283",
"0.56894654",
"0.56861633",
"0.5676265",
"0.5668281",
"0.56584156",
"0.5655157",
"0.5649064",
"0.5644238",
"0.56435573",
"0.5641096",
"0.56410956",
"0.5639287",
"0.5634484",
"0.5633211",
"0.5632376",
"0.5630369",
"0.56261444",
"0.56197226",
"0.5619202",
"0.561875",
"0.5611536",
"0.56027573",
"0.5599383",
"0.5596906",
"0.55958766",
"0.55882645",
"0.55796313",
"0.5576129",
"0.5575145"
] | 0.0 | -1 |
Should be a readonly transaction and idempotent. Retrieves all objects the requesting user is authorized to view. | List<E> getAll(IApplicationUser user); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n @Transactional(readOnly = true)\n public List<NominationDTO> findAll() {\n log.debug(\"Request to get all Nominations\");\n\n if(SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN))\n return _nomNominationRepository.findAll().stream()\n .map(_nominationMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n else\n return findAllNomsForTheCurrentUser();\n\n }",
"List<UserContentAccess> findContentAccess();",
"@RequestMapping(value = \"/rest/accesss\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Access> getAll() {\n log.debug(\"REST request to get all Accesss\");\n return accessRepository.findAll();\n }",
"public List<Client> findAll() throws DataAccessLayerException {\n try {\n Subject.doAs(LoginController.getLoginContext().getSubject(), new MyPrivilegedAction(\"CLIENT\", Permission.READ));\n return super.findAll(Client.class);\n } catch (AccessControlException e) {\n e.printStackTrace();\n }\n return new ArrayList<>();\n }",
"ArrayList<E> getAllObjects() throws DatabaseNotAccessibleException;",
"@RequestMapping(\"/alluser\")\n\t@ResponseBody\n\t@Secured({CommonConstants.ROLE_EMPLOYEE,CommonConstants.ROLE_ADMIN})\n\tpublic List<UserEntity> findAll() {\n\t\treturn this.service.findAll();\n\t}",
"@Transactional(readOnly = true)\n @PreAuthorize(\"hasRole('COMPANY_READER')\")\n public List<Company> getAll() {\n return companyRepository.findAll();\n }",
"@Override\r\n\tpublic List<Permission> queryAll() {\n\t\treturn permissionDao.queryAll();\r\n\t}",
"@RequestMapping(method = RequestMethod.GET)\n public final Iterable<Entry> list() {\n Iterable<Entry> result = SecurityUtils.actualUser().getEntries();\n if (result == null) {\n result = Collections.emptyList();\n }\n return result;\n }",
"List<ObjectType> getObjectTypes() throws AccessDeniedException;",
"@Override\n public List<RightsDTO> getAllRights() {\n return transactionHandler.execute((final Factory factory) -> RightsServiceLogic\n .getAllRights(factory.findService(UserRightRepository.class)));\n }",
"@GetMapping(path=\"/getall\")\r\n\tpublic @ResponseBody Iterable<MyClass> getAllAdmins() {\n\t\treturn classRepository.findAll();\r\n\t}",
"@PostFilter(\"hasPermission(filterObject, 'read') or hasPermission(filterObject, 'write') or hasPermission(filterObject, 'administration') or hasPermission(filterObject, 'delete')\")\n public List<File> getAll() {\n return fileRepository.findAll();\n }",
"@Override\r\n\tpublic List findAll() {\n\t\treturn usermaindao.findAll();\r\n\t}",
"@Transactional\r\n\t@Override\r\n\tpublic List<Authorities> list() {\r\n\t\tList<Authorities> list = null;\r\n\t\ttry {\r\n\t\t\tlist = new ArrayList<Authorities>();\r\n\t\t\tQuery<Authorities> query = sessionFactory.getCurrentSession().createQuery(\"from Authorities\");\r\n\t\t\tlist = query.getResultList();\r\n\t\t}catch(HibernateException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn list;\r\n\t}",
"Collection<Account> getAll();",
"@Transactional(readOnly = true)\n\t@Override\n\tpublic List<Object[]> getApplicants() {\n\t\treturn dao.getApplicants();\n\t}",
"@Override\n\tpublic List All() {\n\t\treturn new userDaoImpl().All();\n\t}",
"@Transactional(readOnly=true)\r\n\tpublic List<Owner> getAllOwner() throws SQLException\r\n\t{\r\n\t\treturn ownerDaoImpl.getAllOwner();\r\n\t}",
"@Override\n @Transactional(readOnly = true)\n public List<UserDashboardDTO> findAll() {\n log.debug(\"Request to get all UserDashboards\");\n List<UserDashboardDTO> result = userDashboardRepository.findAllWithEagerRelationships().stream()\n .map(userDashboardMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n\n return result;\n }",
"List<ObjectRelation> getObjectRelations(int otId) throws AccessDeniedException;",
"@Override\r\n\tpublic List<AccountDTO> getAllUser() {\n\t\treturn accountDao.getAll();\r\n\t}",
"@Transactional(readOnly = true)\n public List<AppUser> findAll() {\n log.debug(\"Request to get all AppUsers\");\n return appUserRepository.findAll();\n }",
"@Override\n public List<Item> viewAllItems() {\n // calls List<Item> itemRepo.findCatalog();\n return itemRepo.findCatalog();\n }",
"@Override\r\n\tpublic void viewAllAccountsAllUsers() {\n\t\tas.getAllAccountsAllUsers();\r\n\t}",
"@Override\n @Transactional(readOnly = true)\n public Page<Invoice> findAll(Pageable pageable) {\n log.debug(\"Request to get all Invoices\");\n if (SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)) {\n return invoiceRepository.findAll(pageable);\n } else {\n return invoiceRepository.findAllByOrderCustomerUserLogin(SecurityUtils.getCurrentUserLogin().get(), pageable);\n }\n }",
"@RequestMapping(method=RequestMethod.GET)\n\tpublic List<User> getAll() {\n\t\treturn repo.findAll();\n\t}",
"@Transactional(readOnly = true)\n public List<OrderItems> findAll() {\n log.debug(\"Request to get all OrderItems\");\n return orderItemsRepository.findAll();\n }",
"@Override\r\n\tpublic List<User> viewUsers() {\n\t\treturn user.viewUsers();\r\n\t}",
"@GetMapping(path=\"/all\")\n\tpublic @ResponseBody Iterable<Resource> getAllUsers() {\n\t\treturn resourceRepository.findAll();\n\t}",
"@PreAuthorize(\"#oauth2.hasAnyScope('read','write','read-write')\")\n\t@RequestMapping(method = GET)\n\tpublic Mono<ResponseEntity<List<Customer>>> allCustomers() {\n\n\t\treturn repo.findAll().collectList()\n\t\t\t.filter(customers -> customers.size() > 0)\n\t\t\t.map(customers -> ok(customers))\n\t\t\t.defaultIfEmpty(noContent().build());\n\t}",
"@PreAuthorize(\"hasAuthority('ADMIN')\")\n @GetMapping(\"/all\")\n public ResponseEntity<List<SecretaryModel>> getAllSecretaries() {\n return ResponseEntity.ok(secretaryService.getAllSecretaries());\n }",
"@RequestMapping(method = RequestMethod.GET, path = \"/\")\n @Secured({\"ROLE_DOCTOR\"})\n @ResponseStatus(HttpStatus.OK)\n public List<Result> fetchAllResults(Principal principal) {\n log.info(\"Fetching all results using user with Id [{}]\", principal.getName());\n return resultService.fetchAll();\n }",
"@RequestMapping(value = \"/\", method = RequestMethod.GET)\n\t@JsonView(Views.Admin.class)\n\t@Secured(\"ROLE_ADMIN\")\n\tpublic ResponseEntity<?> getAll() throws Exception {\n\t\ttry {\n\t\t\tlogger.info(\"Parent List -- FETCHED by: \" + authenticationFacade.getAuthentication().getName());\n\t\t\treturn new ResponseEntity<Iterable<?>>(parentRepository.findAll(), HttpStatus.OK);\n\t\t} catch (Exception e) {\n\t\t\treturn new ResponseEntity<RESTError>(new RESTError(2, \"Exception: \" + e.getMessage()),\n\t\t\t\t\tHttpStatus.INTERNAL_SERVER_ERROR);\n\t\t}\n\t}",
"@Override\r\n\tpublic Object getList() {\n\t\treturn userDao.getList();\r\n\t}",
"public ArrayList<User> getAllLoggedInUser() {\n ArrayList<User> allUsers = new ArrayList<>();\n Realm realm = (mRealm == null) ? Realm.getDefaultInstance() : mRealm;\n\n try {\n RealmResults<User> allUsersInRealm = realm.where(User.class).equalTo(\"IsLoggedIn\", true).findAll();\n List<User> retval = realm.copyFromRealm(new ArrayList<>(allUsersInRealm)); // convert user to unmanaged copy\n allUsers.addAll(retval);\n } catch (Exception ex) {\n // todo handle exception\n }\n\n if (mRealm == null)\n realm.close();\n\n return allUsers;\n }",
"@Transactional\n\t@Override\n\tpublic List<ApplicantModel> viewAllApplicants() {\n\t\treturn applicantRepo.findAll().stream().map(course -> parser.parse(course))\n\t\t\t\t.collect(Collectors.toList());\n\t}",
"public List getAllObjects() throws DataAccessException {\n\t\treturn mapper.getAllDepts();\n\t}",
"@Override\n\tpublic List<Map<String, Object>> readAll() {\n\t\treturn rolDao.readAll();\n\t}",
"public List<IPermissionOwner> getAllPermissionOwners();",
"@Override\n\tpublic List<User> getAllItem() {\n\t\treturn userRepository.findAll();\n\t}",
"@SuppressWarnings(\"unchecked\")\n @Transactional(readOnly = true, propagation = Propagation.REQUIRES_NEW, isolation = Isolation.READ_COMMITTED)\n public List<Reservations> getAll() {\n Session s = sessionFactory.getCurrentSession();\n Query hql = s.createQuery(\"From Reservations\");\n return hql.list();\n }",
"@Override\n public List<R> getAll() {\n return onFindForList(getSession().createCriteria(entityClass).list());\n }",
"@Override\n\tpublic Collection<Users> read() {\n\t\treturn userDAO.readAll();\n\t}",
"@Override\n\tpublic List<T> getAll() {\n\t\treturn getDao().findAll();\n\t}",
"public abstract List<Object> getAll();",
"@RequestMapping(value = \"/user\", method = RequestMethod.GET)\n @PreAuthorize(\"hasRole('ADMIN')\")\n public ResponseEntity<List<UserAccount>> listAllUsers() {\n List<UserAccount> users = userAccountDetailsService.findAllUsers();\n if (users.isEmpty()) {\n return new ResponseEntity<List<UserAccount>>(HttpStatus.NO_CONTENT);//You many decide to return HttpStatus.NOT_FOUND\n }\n return new ResponseEntity<List<UserAccount>>(users, HttpStatus.OK);\n }",
"public List<User> findAll() {\n return store.findAll();\n }",
"@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = {\"/api/\", \"/api\"}, method = RequestMethod.GET)\n \tpublic HttpEntity<String> getAll() {\n \t\treturn toJsonHttpEntity(agentManagerService.getAllVisibleAgentInfoFromDB());\n \t}",
"@Override\n\tpublic List<User> getAll() {\n\t\treturn userDao.getAll();\n\t}",
"@RequestMapping(method = RequestMethod.GET)\n\tpublic List<User> getAll() {\n\t\tList<User> users = dao.getAll();\n\t\treturn users;\n\t}",
"@Transactional(readOnly = true)\n public List<UserDto> findAll() {\n return userRepository.findAllWithEagerRelationships()\n .stream()\n .map(UserDto::new)\n .collect(Collectors.toList());\n }",
"Collection<User> getUsers() throws DataAccessException;",
"public List<User> listAll() throws Exception;",
"public List<User> getAll() {\n\t\treturn service.getAll();\n\t}",
"public List<Accessory> getAllAccessories() throws PersistenceException {\n return dao.findAll();\n }",
"@Override\r\n\tpublic List<User1> getAll() {\n\t\tSession session = sessionFactory.getCurrentSession();\r\n\t\tQuery query = session.createQuery(\"FROM User1\");\r\n\t\treturn query.list();\r\n\t}",
"public List getAll(){\n\t\tList<Person> personList = personRepository.getAll();\n\t\treturn personList;\n\t}",
"@GetMapping(\"/allusers\")\n\t@Secured({CommonConstants.ROLE_EMPLOYEE,CommonConstants.ROLE_ADMIN})\n\tpublic ResponseEntity<List<UserEntity>> fetchUsers(){\n\t\treturn new ResponseEntity<List<UserEntity>>(this.service.findAll(), HttpStatus.OK);\n\t}",
"@Override\n\tpublic ArrayList<User> findAll() {\n\t\t\n\t\treturn userDao.querydAll();\n\t}",
"@Transactional(readOnly = true)\n public Page<UserDTO> getAllManagedUsers(Pageable pageable) {\n log.debug(\"Request to get all Users\");\n return userRepository.findAllByLoginNot(pageable, Constants.ANONYMOUS_USER)\n .map(userMapper::userToUserDTO);\n }",
"@Override\n public List<User> findAll() {\n return dao.findAll();\n }",
"@RequestMapping(method = RequestMethod.GET)\r\n\t@ResponseBody\r\n\t@Transactional(readOnly = true)\r\n\tpublic Collection<Model> list() {\r\n\t\treturn getService().list();\r\n\t}",
"@RequestMapping(method = RequestMethod.GET, value = \"/user/getAll\")\n @ApiOperation(value = \"Getting all the products\")\n public Iterable<User> getAll(){\n return userService.getAll();\n }",
"public List<ModelObject> readAll();",
"public List<Permission> queryAllPermission() {\n\t\treturn permissionMapper.queryAllPermission();\n\t}",
"@RequestMapping(method = RequestMethod.GET, path = \"/allUsers\")\n\t\tpublic List<leaderBoard> getAllUsers(){\n\t\t\t logger.info(\"Entered into Controller Layer\");\n\t\t List<leaderBoard> results = leaderboardrepository.findAll();\n\t\t logger.info(\"Number of Records Fetched:\" + results.size());\n\t\t \n\t\t return results;\n\t\t //this works\n\t\t \n\t\t \n\t\t}",
"@Override\r\n\tpublic List<ViewApplyUserAdmin> applyuseradminSelectAll() {\n\t\treturn applyseradminDao.applyuseradminSelectAll();\r\n\t}",
"@Override\n @Transactional(readOnly = true)\n public List<PermisoDTO> findAll() {\n log.debug(\"Request to get all Permisos\");\n List<PermisoDTO> result = permisoRepository.findAll().stream()\n .map(permisoMapper::permisoToPermisoDTO)\n .collect(Collectors.toCollection(LinkedList::new));\n\n return result;\n }",
"@Override\r\n\tpublic List<User> getAll() {\n\t\treturn users;\r\n\t}",
"List<Permission> selectAll();",
"@RequestMapping(method = RequestMethod.GET)\n\t\tpublic ResponseEntity<Collection<Customer>> getAllUsers() {\n\t\t\treturn service.getAllCustomers();\n\t\t}",
"@Override\n\tpublic List<UsuariosEntity> findAll() {\n\t\treturn (List<UsuariosEntity>) iUsuarios.findAll();\n\t}",
"@Override\n\tpublic List<UsuariosEntity> findAdmin(){\n\t\treturn (List<UsuariosEntity>) iUsuarios.findAdmin();\n\t}",
"public UserSet getPublicUsers() {\n\t\t//users/public\n\t\treturn restTemplate.getForObject(this.embyUrl + \"/\" + EmbyUrlConstants.PUBLIC_USERS, UserSet.class);\n\t\t\n\t}",
"@SuppressWarnings(\"unchecked\")\n public Function<Session, List<User>> getAll() {\n return this.functionTransaction(\n session -> session.createQuery(\"from User\").list()\n );\n }",
"@Test\n\tvoid findAllNoWrite() {\n\t\tinitSpringSecurityContext(\"mlavoine\");\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, \"fdoe2\", newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(1, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(1, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(1, tableItem.getData().size());\n\n\t\t// Check the users\n\t\tAssertions.assertEquals(\"fdoe2\", tableItem.getData().get(0).getId());\n\t\tAssertions.assertFalse(tableItem.getData().get(0).isCanWrite());\n\n\t\t// Check the groups\n\t\tAssertions.assertEquals(1, tableItem.getData().get(0).getGroups().size());\n\t\tAssertions.assertEquals(\"Biz Agency\", tableItem.getData().get(0).getGroups().get(0).getName());\n\t\tAssertions.assertFalse(tableItem.getData().get(0).getGroups().get(0).isCanWrite());\n\t}",
"@Override\n\tpublic List<Dispositivo> getAll() {\n\t\treturn (List<Dispositivo>) dispositivoDao.findAll();\n\t}",
"@Override\r\n\tpublic List<User> getAllUser() {\n\t\tList<User> listStudents = new ArrayList<User>();\r\n\t\tlistStudents = userReposotory.findAll();\r\n\t\treturn listStudents;\r\n\t}",
"@Override\n @Transactional(readOnly = true)\n public List<OrganizerDTO> findAll() {\n log.debug(\"Request to get all Organizers\");\n return organizerRepository.findAll().stream()\n .map(organizerMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }",
"@GetMapping\n\t@Secured(Roles.ADMIN)\n\tpublic ResponseEntity<EmployeeCollectionDto> getAll() {\n\t\tLogStepIn();\n\n\t\tList<Employee> employeeList = employeeRepository.findAll();\n\t\tEmployeeCollectionDto employeeCollectionDto = new EmployeeCollectionDto();\n\n\t\tfor (Employee employee : employeeList) {\n\t\t\temployeeCollectionDto.collection.add(toDto(employee));\n\t\t}\n\n\t\treturn LogStepOut(ResponseEntity.ok(employeeCollectionDto));\n\t}",
"@Override\r\n\tpublic List<Admin> viewlogs() {\n\t\treturn user.viewlogs();\r\n\t}",
"@PreAuthorize(\"hasPermission('string', 'ALL', new org.jasig.portal.spring.security.evaluator.AuthorizableActivity('UP_PERMISSIONS', 'VIEW_PERMISSIONS'))\")\n @RequestMapping(value=\"/permissions/owners.json\", method = RequestMethod.GET)\n public ModelAndView getOwners(\n HttpServletRequest req, HttpServletResponse response)\n throws Exception {\n \n // get a list of all currently defined permission owners\n List<IPermissionOwner> owners = permissionOwnerDao.getAllPermissionOwners();\n \n ModelAndView mv = new ModelAndView();\n mv.addObject(\"owners\", owners);\n mv.setViewName(\"json\");\n \n return mv;\n }",
"@Override\n public ObservableList<User> getAllUsers() {\n return controller.getAllUsers();\n }",
"@Transactional(readOnly = true)\n\t@Override\n\tpublic List<T> findAll() {\n\t\treturn (List<T>) registroDao.findAll();\n\t}",
"@RequestMapping(value = \"/viewAllObjectLocationGas\", method = RequestMethod.GET)\n\tpublic List<ObjectLocationGas> viewAllObjectLocationGas() {\n\t\tAndroidDAO ad = new AndroidDAO();\n\t\tList<ObjectLocationGas> listObjLocationGas = ad.getAllObjectLocationGas();\n\t\treturn listObjLocationGas;\n\t}",
"@GetMapping(path=\"/all\")\n public @ResponseBody Iterable<CustomerOrder> getAllUsers() {\n return userRepository.findAll();\n }",
"@Override\n\tpublic ArrayList<User> getAll() {\n\t\treturn this.users;\n\t}",
"@Override\n\tpublic List<User> getAll() {\n\t\treturn null;\n\t}",
"@Override\n\tpublic List<User> getAll() {\n\t\treturn null;\n\t}",
"List<User> loadAll();",
"@Test\n\tvoid findAllNoRight() {\n\t\tinitSpringSecurityContext(\"any\");\n\n\t\tfinal TableItem<UserOrgVo> tableItem = resource.findAll(null, null, null, newUriInfoAsc(\"id\"));\n\t\tAssertions.assertEquals(0, tableItem.getRecordsTotal());\n\t\tAssertions.assertEquals(0, tableItem.getRecordsFiltered());\n\t\tAssertions.assertEquals(0, tableItem.getData().size());\n\t}",
"@RequestMapping(value = \"/all\")\n public List<Account> getAll(){\n return new ArrayList<>(accountHelper.getAllAccounts().values());\n }",
"@Override\r\n\tpublic List<PermissionBean> listAllPermission() {\n\t\treturn permissionDao.listAllPermission();\r\n\t}",
"@Override\n\tpublic List<UserModel> getAllList() throws Exception {\n\t\treturn sf.getCurrentSession().createQuery(\"from UserModel\").list();\n\n\t}",
"public static List<FoundObject> findAll() {\n\t\treturn getPersistence().findAll();\n\t}",
"public List<User> getAllUsers();",
"@GetMapping(path = \"/all\")\n\tpublic @ResponseBody Iterable<SFDC> getAllUsers() {\n\t\treturn sfdcRepository.findAll();\n\t}",
"@Transactional(readOnly = true)\n public List<Details> findAll() {\n log.debug(\"Request to get all Details\");\n return detailsRepository.findAll();\n }",
"@Override\r\n\tpublic List<AdminUser> selectAll() {\n\t\treturn adminUserMapper.selectAll();\r\n\t}"
] | [
"0.6507511",
"0.64439815",
"0.6372419",
"0.63713133",
"0.6356603",
"0.6340603",
"0.63308966",
"0.62775767",
"0.6238647",
"0.6197869",
"0.6182591",
"0.61672986",
"0.61672163",
"0.6148571",
"0.61458945",
"0.6121139",
"0.6107064",
"0.6105403",
"0.60855603",
"0.60829395",
"0.6075826",
"0.6072727",
"0.60627794",
"0.60382074",
"0.6034494",
"0.60267943",
"0.60251653",
"0.60220057",
"0.6011537",
"0.59963757",
"0.5978047",
"0.5965286",
"0.5964348",
"0.59615886",
"0.595134",
"0.59473985",
"0.593337",
"0.59135014",
"0.59058666",
"0.5900584",
"0.58966595",
"0.58897805",
"0.58895916",
"0.5883415",
"0.5866791",
"0.5865454",
"0.5862273",
"0.58474886",
"0.58435786",
"0.58434844",
"0.5838372",
"0.58377963",
"0.5835789",
"0.58357626",
"0.58285654",
"0.5825836",
"0.5825099",
"0.58239764",
"0.5821067",
"0.5818618",
"0.58023304",
"0.5792188",
"0.5787756",
"0.5787665",
"0.57873636",
"0.5785925",
"0.57856107",
"0.5784532",
"0.5782762",
"0.57801735",
"0.5779169",
"0.5765053",
"0.5764428",
"0.57631844",
"0.5762442",
"0.5756323",
"0.5753787",
"0.574457",
"0.57442415",
"0.5742782",
"0.573924",
"0.5734062",
"0.5729596",
"0.57257944",
"0.57214",
"0.5716799",
"0.57160974",
"0.57099986",
"0.5709479",
"0.5709479",
"0.57085",
"0.5707242",
"0.57065636",
"0.56986547",
"0.5694876",
"0.56927633",
"0.5688443",
"0.56873065",
"0.5685696",
"0.5683405"
] | 0.5797889 | 61 |
Should be a readonly transaction and idempotent. Retrieves the object corresponding to the particular id if it exists and the user is authorized to view the object | Optional<E> getById(IApplicationUser user, ID id); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public SideDishEntity find(Long id) throws ObjectNotFoundUserException {\n return null;\n }",
"@PostAuthorize(\"hasPermission(returnObject, 'read') or hasPermission(returnObject, 'administration') \")\n public File findById(long id) {\n Optional<File> file = fileRepository.findById(id);\n return file.orElse(null);\n }",
"@Override\n\tpublic T get(ID id) {\n\t\tOptional<T> obj = getDao().findById(id);\n\t\tif (obj.isPresent()) {\n\t\t\treturn obj.get();\n\t\t}\t\t\n\t\treturn null;\n\t}",
"@Override\n @Transactional(readOnly = true)\n public Optional<Invoice> findOne(Long id) {\n log.debug(\"Request to get Invoice : {}\", id);\n if (SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)) {\n return invoiceRepository.findById(id);\n } else {\n return invoiceRepository.findOneByIdAndOrderCustomerUserLogin(id, SecurityUtils.getCurrentUserLogin().get() );\n }\n }",
"E getObject(int ID) throws DatabaseObjectNotFoundException, DatabaseNotAccessibleException;",
"User get(Key id);",
"public abstract T findById(K id, Boolean isAdmin) throws ServiceException;",
"M getById(Serializable id) throws DataAccessException;",
"Corretor findOne(Long id);",
"public Object findUserById(long id) throws AccessException {\r\n if(userRepo.findById(id) == null) {\r\n throw new NoSuchElementException(\"No such user with \" + id + \" exist\");\r\n }\r\n\r\n BasicUserDetails authenticatedUser = (BasicUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n if(authenticatedUser.getId() != id)\r\n throw new AccessException(\"Cannot request user different than the authenticated user\");\r\n\r\n return userRepo.findById(id).getPrivateUser();\r\n }",
"public T get( final int id )\n\t{\n\t\treturn this.dao.findById( id ).get();\n\t}",
"@RequestMapping(method=RequestMethod.GET, value=\"{id}\")\n\tpublic User getUser(@PathVariable Long id) {\n\t\treturn RestPreconditions.checkFound(repo.findByUserId(id));\n\t}",
"@PostAuthorize(\"hasPermission(returnObject, 'READ')\")\n public File returnFileIfTheyCanRead(long id) {\n Optional<File> optionalFile = fileRepository.findById(id);\n return optionalFile.orElse(null);\n }",
"User getOne(long id) throws NotFoundException;",
"@Override\n public Optional<T> findById(ID id) {\n T entity = getSession().get(this.getPersistentClass(), id);\n return Optional.ofNullable(entity);\n }",
"UserDetails get(String id);",
"public New getObject(long id);",
"@Override\n\tpublic Owner findById(Long id) {\n\t\treturn ownerRepository.findById(id).orElse(null);\n\t}",
"@Transactional(readOnly = true)\n public Optional<Details> findOne(Long id) {\n log.debug(\"Request to get Details : {}\", id);\n return detailsRepository.findById(id);\n }",
"@Transactional(readOnly = true)\n\tpublic Optional<ResourceUserDTO> findOne(Long id) {\n\t\tlog.debug(\"Request to get ResourceUser : {}\", id);\n\t\treturn resourceUserRepository.findById(id)\n\t\t\t\t.map(resourceUserMapper::toDto);\n\t}",
"@Override\n public User findById(long id) {\n return dao.findById(id);\n }",
"@Override\n @SuppressWarnings(\"unchecked\")\n public T findById(ID id) {\n return (T) this.getSession().load(this.getPersistentClass(), id);\n }",
"@Transactional(readOnly = true)\n public ExtraUser findOne(Long id) {\n log.debug(\"Request to get ExtraUser : {}\", id);\n return extraUserRepository.findOne(id);\n }",
"public Client find(int id) throws DataAccessLayerException {\n try {\n Subject.doAs(LoginController.getLoginContext().getSubject(), new MyPrivilegedAction(\"CLIENT\", Permission.READ));\n return (Client) super.find(Client.class, id);\n } catch (AccessControlException e) {\n e.printStackTrace();\n }\n return null;\n }",
"@Override\n public T findById(ID id) {\n return crudRepository.findById(id).orElseThrow(\n () -> new ResourceNotFoundException(\"Can not find an entity with id: \" + id));\n }",
"@Override\n @LogMethod\n public T get(long id) throws InventoryException {\n \tInventoryHelper.checkPositive(id, \"id\");\n T entity = repository.getByKey(id);\n InventoryHelper.checkEntityExist(entity, id);\n return entity;\n }",
"T get(PK id);",
"@Override\r\n\tpublic Object findById(long id) {\n\t\treturn null;\r\n\t}",
"public User read(String id);",
"@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic <T> T getById(final Class<T> obj, final String id){\n\t\treturn dao.get(obj, id);\n\t}",
"@Override\r\n\t@Transactional(readOnly=true)\r\n\tpublic Orden findById(Long id) {\n\t\treturn ordenRepository.findById(id).orElse(null);\r\n\t}",
"public UserInformation findInformationById(int id);",
"Object get(ID id) throws Exception;",
"T get(ID id);",
"Accessprofile getById(Integer id);",
"@Transactional(readOnly = true)\n public Optional<InsuranceObjectDTO> findOne(Long id) {\n log.debug(\"Request to get InsuranceObject : {}\", id);\n return insuranceObjectRepository.findById(id)\n .map(insuranceObjectMapper::toDto);\n }",
"@PostAuthorize(\"hasPermission(returnObject, 'ADMINISTRATION')\")\n public File returnFileIfTheyCanAdmin(long id) {\n Optional<File> optionalFile = fileRepository.findById(id);\n return optionalFile.orElse(null);\n }",
"@Override\r\n\tpublic User getById(Integer id) {\n\t\treturn null;\r\n\t}",
"@Override\n\t@Transactional\n\tpublic T getById(Integer id) {\n\t\tif (id == null) {\n\t\t\treturn null;\n\t\t}\n\t\tObject result = hibernateTemplate.getSessionFactory().getCurrentSession()\n\t\t\t\t.createCriteria(getGenericClass())\n\t\t\t\t.add(Restrictions.idEq(id))\n\t\t\t\t.uniqueResult();\n\t\treturn initialize(checkType(result));\n\t}",
"@Override\r\n public Dorm findById(Integer id) {\n return userMapper.findById(id);\r\n }",
"@Override\n public boolean userCanAccess(int id) {\n return true;\n }",
"public <T>T getObject(Class<T> clazz, Serializable id) {\n T o = getHibernateTemplate().get(clazz, id);\n\n if (o == null) {\n throw new ObjectRetrievalFailureException(clazz, id);\n }\n\n return o;\n }",
"@Override\r\n\tpublic Botany show(int id) {\n\t\treturn dao.show(id);\r\n\t}",
"@Override\n\tpublic User getOne(Integer id) {\n\t\treturn userDao.getOne(id);\n\t}",
"@Transactional(readOnly = true)\n public Optional<ItemInstance> findOne(Long id) {\n log.debug(\"Request to get ItemInstance : {}\", id);\n return itemInstanceRepository.findById(id);\n }",
"public LogEntry getEntry(UUID id) throws DataAccessException, ObjectNotFoundException, UnAuthorizedException {\r\n LogEntry entry = dao.get(id);\r\n if (role.hasAccess(Resource.LOG, READ_ALL)\r\n || (role.hasAccess(Resource.LOG, READ_MINE))) {\r\n return entry;\r\n } else {\r\n throw new UnAuthorizedException();\r\n }\r\n }",
"T getById(Long id);",
"@Override\n public User getUserById(int id) {\n Session session = this.sessionFactory.getCurrentSession(); \n User u = (User) session.load(User.class, new Integer(id));\n logger.info(\"User loaded successfully, User details=\"+u);\n return u;\n }",
"@Transactional(readOnly = true)\n\t@Override\n\tpublic T findOne(Integer id) {\n\t\treturn (T) registroDao.findById(id).orElse(null);\n\t}",
"User loadUser(int id) throws DataAccessException;",
"@CheckForNull\n public DefaultIssueFilter findById(Long id, UserSession userSession) {\n verifyLoggedIn(userSession);\n // access_denied unless filter.shared || filter.owner?(current_user)\n \n IssueFilterDto issueFilterDto = issueFilterDao.selectById(id);\n if (issueFilterDto == null) {\n return null;\n }\n return issueFilterDto.toIssueFilter();\n }",
"@Override\n @Transactional(readOnly = true)\n public Optional<RfpUser> findOne(Long id) {\n log.debug(\"Request to get RfpUser : {}\", id);\n return rfpUserRepository.findById(id);\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic T get(Long id) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\treturn (T) session.get(target, id);\n\t}",
"public Optional<CheckingAcc> find(Long id){\n if (checkingAccRepository.findById(id).isPresent()){\n return checkingAccRepository.findById(id);\n } else {\n throw new ResponseStatusException(HttpStatus.NOT_FOUND, \"There is no account with the provided id\");\n }\n }",
"@Cacheable(value = DEMO_CACHE_NAME)\r\n\t@Override\r\n\tpublic User selectByPrimaryKey(Integer id) {\n\t\tSystem.err.println (\"没有走缓存!\" + id);\r\n\t\treturn userDao.selectByPrimaryKey(id);\r\n\t}",
"@Override\n\tpublic Editore getOneById(int id) {\n\t\treturn null;\n\t}",
"T getById(int id);",
"@Transactional(propagation = Propagation.MANDATORY)\n\tpublic default E getOne(K id) {\n\t\treturn getRepository().getOne(id);\n\t}",
"@Override\n @Transactional(readOnly = true)\n public Optional<Kontrachent> findOne(Long id) {\n log.debug(\"Request to get Kontrachent : {}\", id);\n return kontrachentRepository.findById(id);\n }",
"@Transactional(readOnly = true) \n public Administrator findOne(Long id) {\n log.debug(\"Request to get Administrator : {}\", id);\n Administrator administrator = administratorRepository.findOne(id);\n return administrator;\n }",
"@Transactional(readOnly = true)\n public Optional<AppUser> findOne(Long id) {\n log.debug(\"Request to get AppUser : {}\", id);\n return appUserRepository.findById(id);\n }",
"@Override\n @Transactional\n public Company getByID(long id) {\n\n\tCompany company = this.companyDAO.getByID(id);\n\n\t// Security check.\n\tif (!this.authHelper.isSuperAdmin()) {\n\t this.messageHelper.unauthorizedID(Company.OBJECT_NAME, company.getId());\n\t return new Company();\n\t}\n\n\t// Log then\n\t// return actual object.\n\tthis.messageHelper.nonAuditableIDNoAssoc(AuditAction.ACTION_GET, Company.OBJECT_NAME,\n\t\tcompany.getId());\n\treturn company;\n }",
"@Transactional(propagation = Propagation.NEVER)\n\tpublic User getById(int id) {\n\t\treturn userRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new HttpClientErrorException(HttpStatus.NOT_FOUND));\n\t}",
"T getById(ID id);",
"public Data findById(Object id);",
"@Transactional(readOnly = true)\n public HotelUser findOne(Long id) {\n log.debug(\"Request to get HotelUser : {}\", id);\n HotelUser hotelUser = hotelUserRepository.findOne(id);\n return hotelUser;\n }",
"public abstract T findOne(int id);",
"RequesterVO get(int id);",
"@Transactional(readOnly = true)\n public Ticket findOne(Long id) {\n log.debug(\"Request to get Ticket : {}\", id);\n Ticket ticket = ticketRepository.findOne(id);\n return ticket;\n }",
"public void retrieveAReadOnlyCustomerWithID(long id) {\r\n\t\tSystem.out.println(\"\\nRead Only Customer with id \" + id);\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tCustomer2 customer1 = em.find(Customer2.class, id);\r\n\t\tif(customer1 == null){\r\n\t\t\tSystem.out.println(\"\\nNo such customer with id: \" + id);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(customer1);\r\n\t\tcustomer1.setLastName(\"XXX\");\r\n\t\tSystem.out.println(customer1);\r\n\t\tSystem.out.println(\"Does persistent context have customer1? \" + em.contains(customer1));\r\n\t\t\r\n\t\t// Asagidaki satirlari actiginizda soyisim XXX olarak degistirilecektir.\r\n//\t\tEntityTransaction tx = em.getTransaction();\r\n//\t\ttx.begin();\r\n//\t\ttx.commit();\r\n\t\tem.close();\r\n\t\t\r\n\t\tEntityManager em2 = emf.createEntityManager();\r\n\t\tCustomer2 customer2 = em2.find(Customer2.class, id);\r\n\t\tSystem.out.println(customer2);\r\n\t\tem2.close();\t\t\r\n\t}",
"@Override\n\tpublic Object getObject(Class clazz, Integer id) {\n\t\tObject object = null;\n\t\tSession session = HibernateSessionFactory.getSession();\n\t\tTransaction ts = session.beginTransaction();\n\t\tobject = session.get(clazz, id);\n\t\tts.commit();\n\t\tsession.close();\n\t\treturn object;\n\t}",
"@CrossOrigin\r\n @RequestMapping(value = USER_DETAIL, method=RequestMethod.GET)\r\n public ResponseEntity<?> getUserDetail(@RequestParam(\"id\") String id) {\r\n\r\n \tcheckLogin();\r\n EmployeeVO emp = employeeService.getEmployeeDetailById(id);\r\n return new ResponseEntity<>(emp, HttpStatus.OK);\r\n }",
"E find(Id id) throws RepositoryException;",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn null;\r\n\t}",
"@SuppressWarnings(\"unchecked\")\r\n\t@Override\r\n\tpublic T findObjById(long id, Class<T> type) {\n\t\treturn (T) super.getSessionFactory().getCurrentSession().get(type,id);\r\n\t}",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn userDAO.findById(id);\r\n\t}",
"@Override\n\tpublic User find(int id) {\n\t\tSystem.out.println(\"OracleDao is find\");\n\t\treturn null;\n\t}",
"User getUser(Long id);",
"@Override\n public TechGalleryUser getUser(final Long id) throws NotFoundException {\n TechGalleryUser userEntity = userDao.findById(id);\n // if user is null, return a not found exception\n if (userEntity == null) {\n throw new NotFoundException(i18n.t(\"No user was found.\"));\n } else {\n return userEntity;\n }\n }",
"public User getUser(long id){\n User user = userRepository.findById(id);\n if (user != null){\n return user;\n } else throw new UserNotFoundException(\"User not found for user_id=\" + id);\n }",
"@Transactional(readOnly = true)\n\t@Override\n\tpublic Optional<Primaryuser> findById(Integer id) throws Exception {\n\t\treturn primaryRepository.findById(id);\n\t}",
"@Override\r\n\tpublic Account findById(int id) {\n\t\treturn daoref.findById(id);\r\n\t}",
"@Override\n public UserInfo findById(int id) {\n TypedQuery<UserInfo> query = entityManager.createNamedQuery(\"findUserById\", UserInfo.class);\n query.setParameter(\"id\", id);\n return query.getSingleResult();\n }",
"@Override\n\tpublic Optional<Dispositivo> getById(int id) {\n\t\treturn dispositivoDao.findById(id);\n\t}",
"T getById(PK id);",
"E getById(long id);",
"@PostAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(returnObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"returnObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"(hasRole('REVISIONER') AND returnObject.type.typeLabel == 'REVISIONER') OR \"\r\n \t\t\t+ \"returnObject.username == principal.username\")\r\n \tpublic SystemUserDTO read(Long id);",
"@Override\n\tpublic Contract get(String id) {\n\t\treturn contractDao.findOne(id);\n\t}",
"@SuppressWarnings(\"unchecked\")\n\tprotected <ID extends Serializable> T get(ID id) {\n\t\tT retValue = null;\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tretValue = (T) session.get(mClazz, id);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute get by id\");\n\t\t}\n\n\t\treturn retValue;\n\t}",
"T findById(final ID id) throws RequiredValueException, NoEntityFoundException;",
"@Override\r\n\tpublic SpUser findById(String id) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic LocalUser get(int id) {\n\t\treturn userDao.get(id);\r\n\t}",
"T get(Integer id);",
"@Override\n\tpublic ResponseEntity<?> findOne(Long id) {\n\t\treturn null;\n\t}",
"public T find(int id) {\n\t \treturn getEntityManager().find(getEntityClass(), id);\n\t }",
"public User findUserById(int id);",
"@Transactional(readOnly = true)\n public Optional<DiscordUserProfile> findOne(Long id) {\n log.debug(\"Request to get DiscordUserProfile : {}\", id);\n return discordUserProfileRepository.findById(id);\n }",
"@Override\n\tpublic Owner findById(Long id) {\n\t\treturn null;\n\t}",
"User getUserById(int id);",
"@Transactional\n public B get(UriInfo uriInfo, String uuid) {\n final AbstractEntityService<?, BE> entityService = getEntityService();\n final BE entity = entityService.getByUuid(uuid);\n if (entity == null) {\n throw entityNotFound(uuid);\n }\n if (!entityService.canViewOrEdit(entity)) {\n throw new AccessDeniedException(getString(\"error.entity.viewpriv\"));\n }\n return serialize(entity, null, true);\n }",
"public User findById(Long id){\n return userRepository.findOne(id);\n }"
] | [
"0.6865616",
"0.6834218",
"0.6807948",
"0.677502",
"0.6608074",
"0.653162",
"0.65113616",
"0.6486798",
"0.64731157",
"0.6447574",
"0.6430248",
"0.64244556",
"0.64048415",
"0.64026153",
"0.6383864",
"0.6380556",
"0.63396096",
"0.63334906",
"0.632532",
"0.63066566",
"0.63055533",
"0.630206",
"0.6299111",
"0.62961537",
"0.62897277",
"0.6284137",
"0.62831676",
"0.6276558",
"0.62704366",
"0.6261527",
"0.6257393",
"0.6253482",
"0.6252252",
"0.6250454",
"0.6229555",
"0.6215037",
"0.62116855",
"0.62077224",
"0.62030965",
"0.6199867",
"0.6198415",
"0.6192252",
"0.6191123",
"0.6185582",
"0.61854184",
"0.61799085",
"0.61716914",
"0.61687624",
"0.6168737",
"0.61621284",
"0.6158557",
"0.61577797",
"0.61533463",
"0.6152506",
"0.6147677",
"0.61475843",
"0.61373484",
"0.6134522",
"0.61262894",
"0.6124544",
"0.6122147",
"0.6121121",
"0.61171573",
"0.6116498",
"0.611516",
"0.6114653",
"0.61129415",
"0.6106588",
"0.6102567",
"0.6101841",
"0.60976595",
"0.6094611",
"0.60944533",
"0.6089714",
"0.608755",
"0.60871226",
"0.6082201",
"0.6076778",
"0.6072493",
"0.60722333",
"0.60715705",
"0.6070713",
"0.6056405",
"0.60563326",
"0.60561883",
"0.6045867",
"0.6039853",
"0.60336673",
"0.6027344",
"0.60233414",
"0.6022451",
"0.6020424",
"0.60180444",
"0.6015227",
"0.60117143",
"0.600898",
"0.6008408",
"0.6008034",
"0.60062",
"0.60056865",
"0.60045654"
] | 0.0 | -1 |
Should be a readonly transaction and idempotent. Retrieves the object corresponding to the particular id and the user is authorized to view the object | E getExistingById(IApplicationUser user, ID id); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@PostAuthorize(\"hasPermission(returnObject, 'read') or hasPermission(returnObject, 'administration') \")\n public File findById(long id) {\n Optional<File> file = fileRepository.findById(id);\n return file.orElse(null);\n }",
"@Override\n\tpublic T get(ID id) {\n\t\tOptional<T> obj = getDao().findById(id);\n\t\tif (obj.isPresent()) {\n\t\t\treturn obj.get();\n\t\t}\t\t\n\t\treturn null;\n\t}",
"@Override\n public SideDishEntity find(Long id) throws ObjectNotFoundUserException {\n return null;\n }",
"public T get( final int id )\n\t{\n\t\treturn this.dao.findById( id ).get();\n\t}",
"E getObject(int ID) throws DatabaseObjectNotFoundException, DatabaseNotAccessibleException;",
"public Object findUserById(long id) throws AccessException {\r\n if(userRepo.findById(id) == null) {\r\n throw new NoSuchElementException(\"No such user with \" + id + \" exist\");\r\n }\r\n\r\n BasicUserDetails authenticatedUser = (BasicUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n if(authenticatedUser.getId() != id)\r\n throw new AccessException(\"Cannot request user different than the authenticated user\");\r\n\r\n return userRepo.findById(id).getPrivateUser();\r\n }",
"M getById(Serializable id) throws DataAccessException;",
"@Override\n @Transactional(readOnly = true)\n public Optional<Invoice> findOne(Long id) {\n log.debug(\"Request to get Invoice : {}\", id);\n if (SecurityUtils.isCurrentUserInRole(AuthoritiesConstants.ADMIN)) {\n return invoiceRepository.findById(id);\n } else {\n return invoiceRepository.findOneByIdAndOrderCustomerUserLogin(id, SecurityUtils.getCurrentUserLogin().get() );\n }\n }",
"public New getObject(long id);",
"User get(Key id);",
"UserDetails get(String id);",
"@Override\r\n\tpublic Botany show(int id) {\n\t\treturn dao.show(id);\r\n\t}",
"public User read(String id);",
"@CrossOrigin\r\n @RequestMapping(value = USER_DETAIL, method=RequestMethod.GET)\r\n public ResponseEntity<?> getUserDetail(@RequestParam(\"id\") String id) {\r\n\r\n \tcheckLogin();\r\n EmployeeVO emp = employeeService.getEmployeeDetailById(id);\r\n return new ResponseEntity<>(emp, HttpStatus.OK);\r\n }",
"public Client find(int id) throws DataAccessLayerException {\n try {\n Subject.doAs(LoginController.getLoginContext().getSubject(), new MyPrivilegedAction(\"CLIENT\", Permission.READ));\n return (Client) super.find(Client.class, id);\n } catch (AccessControlException e) {\n e.printStackTrace();\n }\n return null;\n }",
"Accessprofile getById(Integer id);",
"RequesterVO get(int id);",
"@RequestMapping(method=RequestMethod.GET, value=\"{id}\")\n\tpublic User getUser(@PathVariable Long id) {\n\t\treturn RestPreconditions.checkFound(repo.findByUserId(id));\n\t}",
"@Override\n public boolean userCanAccess(int id) {\n return true;\n }",
"@Override\n @LogMethod\n public T get(long id) throws InventoryException {\n \tInventoryHelper.checkPositive(id, \"id\");\n T entity = repository.getByKey(id);\n InventoryHelper.checkEntityExist(entity, id);\n return entity;\n }",
"Corretor findOne(Long id);",
"public abstract T findById(K id, Boolean isAdmin) throws ServiceException;",
"@Transactional(propagation = Propagation.REQUIRED, readOnly = true)\n\tpublic <T> T getById(final Class<T> obj, final String id){\n\t\treturn dao.get(obj, id);\n\t}",
"@Override\n public User getUserById(int id) {\n Session session = this.sessionFactory.getCurrentSession(); \n User u = (User) session.load(User.class, new Integer(id));\n logger.info(\"User loaded successfully, User details=\"+u);\n return u;\n }",
"@Override\n public User findById(long id) {\n return dao.findById(id);\n }",
"public LogEntry getEntry(UUID id) throws DataAccessException, ObjectNotFoundException, UnAuthorizedException {\r\n LogEntry entry = dao.get(id);\r\n if (role.hasAccess(Resource.LOG, READ_ALL)\r\n || (role.hasAccess(Resource.LOG, READ_MINE))) {\r\n return entry;\r\n } else {\r\n throw new UnAuthorizedException();\r\n }\r\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic T get(Long id) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\t\n\t\treturn (T) session.get(target, id);\n\t}",
"public void retrieveAReadOnlyCustomerWithID(long id) {\r\n\t\tSystem.out.println(\"\\nRead Only Customer with id \" + id);\r\n\t\tEntityManager em = emf.createEntityManager();\r\n\t\tCustomer2 customer1 = em.find(Customer2.class, id);\r\n\t\tif(customer1 == null){\r\n\t\t\tSystem.out.println(\"\\nNo such customer with id: \" + id);\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tSystem.out.println(customer1);\r\n\t\tcustomer1.setLastName(\"XXX\");\r\n\t\tSystem.out.println(customer1);\r\n\t\tSystem.out.println(\"Does persistent context have customer1? \" + em.contains(customer1));\r\n\t\t\r\n\t\t// Asagidaki satirlari actiginizda soyisim XXX olarak degistirilecektir.\r\n//\t\tEntityTransaction tx = em.getTransaction();\r\n//\t\ttx.begin();\r\n//\t\ttx.commit();\r\n\t\tem.close();\r\n\t\t\r\n\t\tEntityManager em2 = emf.createEntityManager();\r\n\t\tCustomer2 customer2 = em2.find(Customer2.class, id);\r\n\t\tSystem.out.println(customer2);\r\n\t\tem2.close();\t\t\r\n\t}",
"Object get(ID id) throws Exception;",
"T get(PK id);",
"public T get(int id) {\n return this.session.get(this.type, id);\n }",
"T get(ID id);",
"@Transactional(readOnly = true)\n public ExtraUser findOne(Long id) {\n log.debug(\"Request to get ExtraUser : {}\", id);\n return extraUserRepository.findOne(id);\n }",
"@PostAuthorize(\"hasPermission(returnObject, 'READ')\")\n public File returnFileIfTheyCanRead(long id) {\n Optional<File> optionalFile = fileRepository.findById(id);\n return optionalFile.orElse(null);\n }",
"@Override\r\n\tpublic User getDocterById(int id) {\n\t\treturn docterMapper.selById(id);\r\n\t}",
"public UserInformation findInformationById(int id);",
"@Override\r\n public Dorm findById(Integer id) {\n return userMapper.findById(id);\r\n }",
"EpermissionDO selectByPrimaryKey(Long id);",
"User getUser(Long id);",
"@Override\n @SuppressWarnings(\"unchecked\")\n public T findById(ID id) {\n return (T) this.getSession().load(this.getPersistentClass(), id);\n }",
"T getById(Long id);",
"@Cacheable(value = DEMO_CACHE_NAME)\r\n\t@Override\r\n\tpublic User selectByPrimaryKey(Integer id) {\n\t\tSystem.err.println (\"没有走缓存!\" + id);\r\n\t\treturn userDao.selectByPrimaryKey(id);\r\n\t}",
"AccessModelEntity selectByPrimaryKey(String id);",
"@PostAuthorize(\"hasPermission(returnObject, 'ADMINISTRATION')\")\n public File returnFileIfTheyCanAdmin(long id) {\n Optional<File> optionalFile = fileRepository.findById(id);\n return optionalFile.orElse(null);\n }",
"@Transactional(readOnly = true) \n public Administrator findOne(Long id) {\n log.debug(\"Request to get Administrator : {}\", id);\n Administrator administrator = administratorRepository.findOne(id);\n return administrator;\n }",
"@Override\n @Transactional\n public Company getByID(long id) {\n\n\tCompany company = this.companyDAO.getByID(id);\n\n\t// Security check.\n\tif (!this.authHelper.isSuperAdmin()) {\n\t this.messageHelper.unauthorizedID(Company.OBJECT_NAME, company.getId());\n\t return new Company();\n\t}\n\n\t// Log then\n\t// return actual object.\n\tthis.messageHelper.nonAuditableIDNoAssoc(AuditAction.ACTION_GET, Company.OBJECT_NAME,\n\t\tcompany.getId());\n\treturn company;\n }",
"@Override\n\tpublic Contract get(String id) {\n\t\treturn contractDao.findOne(id);\n\t}",
"@Override\r\n\t@Transactional(readOnly=true)\r\n\tpublic Orden findById(Long id) {\n\t\treturn ordenRepository.findById(id).orElse(null);\r\n\t}",
"User getOne(long id) throws NotFoundException;",
"public <T>T getObject(Class<T> clazz, Serializable id) {\n T o = getHibernateTemplate().get(clazz, id);\n\n if (o == null) {\n throw new ObjectRetrievalFailureException(clazz, id);\n }\n\n return o;\n }",
"@Override\n\tpublic User getOne(Integer id) {\n\t\treturn userDao.getOne(id);\n\t}",
"Account getAccount(int id);",
"@GET\n\t@QueryParam(\"{id}\")\n\tpublic static KoeficientObject getValueKoeficientObjectById(@QueryParam(\"id\") int id) {\n\t\tEntityManagerFactory emfactory = GlobalVariableForSQL_DBase.getDBase();\n\t\tEntityManager entitymanager = GlobalVariableForSQL_DBase.getEntityManagerDBase(emfactory);\n\t\tentitymanager.getTransaction().begin();\n\t\tKoeficientObject metody = entitymanager.find(KoeficientObject.class, id);\n\n\t\tentitymanager.close();\n\t\temfactory.close();\n\n\t\treturn metody;\n\t}",
"@PostAuthorize(\"hasRole('ADMINISTRATOR') OR \"\r\n \t\t\t+ \"(hasRole('EMPLOYEE') AND \"\r\n \t\t\t+ \"(returnObject.type.typeLabel == 'CUSTOMERLEGAL' OR \"\r\n \t\t\t+ \"returnObject.type.typeLabel == 'CUSTOMERINDIVIDUAL')) OR \"\r\n \t\t\t+ \"(hasRole('REVISIONER') AND returnObject.type.typeLabel == 'REVISIONER') OR \"\r\n \t\t\t+ \"returnObject.username == principal.username\")\r\n \tpublic SystemUserDTO read(Long id);",
"AdminUser selectByPrimaryKey(Integer id);",
"AdminUser selectByPrimaryKey(Integer id);",
"@Override\n\tpublic Object getObject(Class clazz, Integer id) {\n\t\tObject object = null;\n\t\tSession session = HibernateSessionFactory.getSession();\n\t\tTransaction ts = session.beginTransaction();\n\t\tobject = session.get(clazz, id);\n\t\tts.commit();\n\t\tsession.close();\n\t\treturn object;\n\t}",
"@Override\n\tpublic Editore getOneById(int id) {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic LocalUser get(int id) {\n\t\treturn userDao.get(id);\r\n\t}",
"@Override\n @Transactional(readOnly = true)\n public UserDashboardDTO findOne(Long id) {\n log.debug(\"Request to get UserDashboard : {}\", id);\n UserDashboard userDashboard = userDashboardRepository.findOneWithEagerRelationships(id);\n UserDashboardDTO userDashboardDTO = userDashboardMapper.toDto(userDashboard);\n return userDashboardDTO;\n }",
"public SsoAuthDO query(Integer id) throws DataAccessException;",
"@Override\n\tpublic User getUser(int id) {\n\t\treturn userRepository.findById(id);\n\t}",
"T getById(int id);",
"public abstract Object get(String entityName, Serializable id);",
"User getUserById(int id);",
"public static void accessoriesstatuspage(Long id){\r\n\t\tAccount a = (Account) Cache.get(\"authUser\");\r\n\t\tif (a != null){\r\n\t\t\tOrderAccessories o = OrderAccessories.findById(id);\r\n\t\t\trender(o);\r\n\t\t}\r\n\t\telse\t\r\n\t\t\tDealerControllerMap.pleaselogin();\r\n\t}",
"T getById(ID id);",
"@SuppressWarnings(\"unchecked\")\n\tprotected <ID extends Serializable> T get(ID id) {\n\t\tT retValue = null;\n\t\tSession session = null;\n\t\ttry {\n\t\t\tsession = mDbHelper.beginTransaction();\n\t\t\tretValue = (T) session.get(mClazz, id);\n\t\t\tmDbHelper.endTransaction(session);\n\t\t} catch (Exception e) {\n\t\t\tmDbHelper.cancelTransaction(session);\n\t\t\tAppLogger.error(e, \"Failed to execute get by id\");\n\t\t}\n\n\t\treturn retValue;\n\t}",
"@Override\r\n\tpublic User getById(Integer id) {\n\t\treturn null;\r\n\t}",
"public User getUser(long id){\n User user = userRepository.findById(id);\n if (user != null){\n return user;\n } else throw new UserNotFoundException(\"User not found for user_id=\" + id);\n }",
"@Override\r\n\tpublic Libro read(int id) {\n\t\treturn libroRepository.findById(id).get();\r\n\t}",
"@Transactional\n public B get(UriInfo uriInfo, String uuid) {\n final AbstractEntityService<?, BE> entityService = getEntityService();\n final BE entity = entityService.getByUuid(uuid);\n if (entity == null) {\n throw entityNotFound(uuid);\n }\n if (!entityService.canViewOrEdit(entity)) {\n throw new AccessDeniedException(getString(\"error.entity.viewpriv\"));\n }\n return serialize(entity, null, true);\n }",
"User loadUser(int id) throws DataAccessException;",
"@Override\r\n\tpublic User getUserById(int id) {\n\t\treturn userMapper.selById(id);\r\n\t}",
"@Override\r\n\tpublic Account findById(int id) {\n\t\treturn daoref.findById(id);\r\n\t}",
"@Transactional\r\n\tpublic User getUserById(int id) {\n\t\treturn cuser.getUserById(id);\r\n\t}",
"@Override\n\tpublic Customer show(int id) {\n\t\t\n\t\tOptional<Customer> customerOpt = this.customerRepo.findById(id);\n\t\tif(customerOpt.isPresent()) {\n\t\t\tCustomer customer = customerOpt.get();\n\t\t\treturn customer;\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}",
"@Override\n\tpublic User findByUserid(Serializable id) {\n\t\treturn this.userDao.findById(id);\n\t}",
"E getById(long id);",
"@Override\n\tpublic Owner findById(Long id) {\n\t\treturn ownerRepository.findById(id).orElse(null);\n\t}",
"@Override\r\n public Visitors visfindById(Integer id) {\n return userMapper.visfindById(id);\r\n }",
"public User getUserById(Serializable id) {\n\t\treturn (User)this.userDao.getEntryById(id);\r\n\t}",
"@Override\r\n\tpublic User findById(int id) {\n\t\treturn userDAO.findById(id);\r\n\t}",
"public AirspaceObject getObject(int id)\n\t{\n\t\treturn idToObject.get(id);\n\t}",
"@Transactional(readOnly = true)\n public Optional<Details> findOne(Long id) {\n log.debug(\"Request to get Details : {}\", id);\n return detailsRepository.findById(id);\n }",
"@PreAuthorize(\"hasAuthority('ADMIN')\")\n @GetMapping(\"/{id}\")\n public ResponseEntity getUser(@PathVariable Long id) {\n return ok(userService.getUserById(id));\n }",
"@Transactional(readOnly = true)\n public Ticket findOne(Long id) {\n log.debug(\"Request to get Ticket : {}\", id);\n Ticket ticket = ticketRepository.findOne(id);\n return ticket;\n }",
"@Override\n\tpublic ResponseEntity<?> get(Long id) {\n\t\treturn ResponseEntity.ok(service.deposit.get(id));\n\t}",
"@Transactional(readOnly = true)\n\tpublic Optional<ResourceUserDTO> findOne(Long id) {\n\t\tlog.debug(\"Request to get ResourceUser : {}\", id);\n\t\treturn resourceUserRepository.findById(id)\n\t\t\t\t.map(resourceUserMapper::toDto);\n\t}",
"@Transactional(readOnly = true)\n public HotelUser findOne(Long id) {\n log.debug(\"Request to get HotelUser : {}\", id);\n HotelUser hotelUser = hotelUserRepository.findOne(id);\n return hotelUser;\n }",
"public Owner getOwnerInformation(int id){\n\t\tOwner owner = entityManager.find(Owner.class, id); //find Owner by primary key(int id)\n\t\treturn owner;\n\t}",
"public BankThing retrieve(String id);",
"@Override\n public UserInfo findById(int id) {\n TypedQuery<UserInfo> query = entityManager.createNamedQuery(\"findUserById\", UserInfo.class);\n query.setParameter(\"id\", id);\n return query.getSingleResult();\n }",
"@Override\n public T findById(ID id) {\n return crudRepository.findById(id).orElseThrow(\n () -> new ResourceNotFoundException(\"Can not find an entity with id: \" + id));\n }",
"@Override\n\tpublic User getUserById(int id) {\n\t\treturn userDao.getUserById(id);\n\t}",
"@Transactional(readOnly = true)\n public Optional<InsuranceObjectDTO> findOne(Long id) {\n log.debug(\"Request to get InsuranceObject : {}\", id);\n return insuranceObjectRepository.findById(id)\n .map(insuranceObjectMapper::toDto);\n }",
"@Override\n @Transactional(readOnly = true)\n public MantisApproverDTO findOne(Long id) {\n log.debug(\"Request to get MantisApprover : {}\", id);\n MantisApprover mantisApprover = mantisApproverRepository.findOne(id);\n return mantisApproverMapper.toDto(mantisApprover);\n }",
"@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = \"/api/{id}\", method = RequestMethod.GET)\n \tpublic HttpEntity<String> getOne(@PathVariable(\"id\") Long id) {\n \t\treturn toJsonHttpEntity(agentManagerService.getOne(id));\n \t}",
"@CheckForNull\n public DefaultIssueFilter findById(Long id, UserSession userSession) {\n verifyLoggedIn(userSession);\n // access_denied unless filter.shared || filter.owner?(current_user)\n \n IssueFilterDto issueFilterDto = issueFilterDao.selectById(id);\n if (issueFilterDto == null) {\n return null;\n }\n return issueFilterDto.toIssueFilter();\n }",
"public T get(int objectId) throws SQLException;",
"T getById(PK id);"
] | [
"0.68199635",
"0.6639157",
"0.6637379",
"0.66097176",
"0.66076094",
"0.65818393",
"0.65684813",
"0.6561587",
"0.6554531",
"0.65514314",
"0.6526014",
"0.64884245",
"0.6458469",
"0.64191973",
"0.64109623",
"0.6397175",
"0.63926864",
"0.63550454",
"0.63468635",
"0.6345355",
"0.6345333",
"0.6311273",
"0.63034594",
"0.62974",
"0.6291887",
"0.62902474",
"0.62874585",
"0.6286627",
"0.6265809",
"0.62595165",
"0.6247761",
"0.6236515",
"0.62352633",
"0.62331545",
"0.6224892",
"0.62165624",
"0.6215229",
"0.6205942",
"0.619221",
"0.6189306",
"0.6188366",
"0.6184205",
"0.61822844",
"0.6181243",
"0.6175546",
"0.61743844",
"0.61743706",
"0.6170892",
"0.6158555",
"0.6157328",
"0.6156422",
"0.6156215",
"0.61536837",
"0.61477894",
"0.6144178",
"0.6144178",
"0.61419326",
"0.61403793",
"0.61349076",
"0.61254716",
"0.6121915",
"0.61203986",
"0.61196065",
"0.61179364",
"0.6113716",
"0.6111595",
"0.6109889",
"0.61079526",
"0.61069274",
"0.61055106",
"0.6105297",
"0.6103262",
"0.60993737",
"0.60950243",
"0.6085716",
"0.60843414",
"0.60843164",
"0.6083729",
"0.6081684",
"0.60774565",
"0.60746175",
"0.6074284",
"0.6073174",
"0.60728645",
"0.60705435",
"0.6067579",
"0.60656464",
"0.6062502",
"0.6062414",
"0.6052752",
"0.60483277",
"0.6048106",
"0.60428804",
"0.60361683",
"0.6034165",
"0.6030975",
"0.6027466",
"0.60245425",
"0.60222614",
"0.60220146",
"0.60208005"
] | 0.0 | -1 |
Should be write transaction. Updates an object with the specified id with values from the specified update object | E update(IApplicationUser user, ID id, U updateDto); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n public void update(Object object, Object id) throws DAOException {\n\n }",
"public void doUpdate(T objectToUpdate) throws SQLException;",
"public void updateByObject()\r\n\t{\n\t}",
"@Override\r\n\tpublic void update(Object obj) throws DAOException {\n\r\n\t}",
"public WriteResult updateObject(String id, String name) {\n\t\treturn null;\n\t}",
"private void updateObject(Object object) {\n Connection connection = ConnectionPoll.getConnection();\n CRUDService crudService = new CRUDService(connection, object.getClass());\n\n try {\n crudService.update((SimpleORMInterface) object);\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n ConnectionPoll.releaseConnection(connection);\n\n try {\n connection.close();\n } catch (SQLException throwables) {\n throwables.printStackTrace();\n }\n }",
"public void update(TdiaryArticle obj) throws SQLException {\n\r\n\t}",
"void update(T objectToUpdate);",
"public void update(T obj) {\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tsession.update(obj);\n\t\t\n\t}",
"public void update(K id, Update<P> update);",
"void update(Serializable objectId);",
"void update(T obj) throws PersistException;",
"public void updateRecord(Record object);",
"@Override\n\tpublic void update(Unidade obj) {\n\n\t}",
"public void update(T obj) {\n\t\tSession session = this.sessionFactory.getCurrentSession();\n\t\tsession.update(obj);\n\t}",
"protected void update(Object object) {\n EntityManager em = getEntityManager();\n em.getTransaction().begin();\n try {\n em.merge(object);\n em.getTransaction().commit();\n } catch (Exception e) {\n LOG.error(\"Could not update Object\", e);\n em.getTransaction().rollback();\n } finally {\n em.close();\n }\n }",
"@Transactional(propagation = Propagation.REQUIRED)\n\tpublic ServiceResult update(final Object obj){\n\t\tServiceResult result = new ServiceResult();\n\n\t\ttry{\n\t\t\tdao.update(obj);\n\t\t\tlog.debug(\"Updating :\"+obj);\n\t\t\tresult.setResult(true);\n\t\t\tresult.setReturnObject(obj);\n\t\t} catch (Exception e){\n\t\t\tresult.setResult(false);\n\t\t\tresult.setMessage(\"Error:\"+e);\n\t\t\tlog.error(\"Error updating the object: \", e);\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn result;\n\t}",
"public <T> void update(final PersistableDataObject<T> obj) {\n txTemplate.execute(new TransactionCallbackWithoutResult() {\n @Override\n public void doInTransactionWithoutResult(TransactionStatus status) {\n getHibernateTemplate().update(obj);\n }\n });\n }",
"@Override\n\tpublic int update(Object obj) throws SQLException {\n\t\treturn 0;\n\t}",
"@Override\n\tpublic void update(Seller obj) {\n\t\tPreparedStatement pst = null;\n\t\ttry {\n\t\t\tpst = conn.prepareStatement(\n\t\t\t\t\t\"UPDATE seller\\r\\n\"+\n\t\t\t\t\t\"SET Name = ?, Email = ?, BirthDate = ?, BaseSalary = ?, DepartmentId = ?\\r\\n\" +\n\t\t\t\t\t\"WHERE Id = ?;\");\n\t\t\tpst.setString(1, obj.getName());\n\t\t\tpst.setString(2, obj.getEmail());\n\t\t\tpst.setDate(3, new java.sql.Date(obj.getBirthDate().getTime()));\n\t\t\tpst.setDouble(4, obj.getBaseSalary());\n\t\t\tpst.setInt(5, obj.getDepartment().getId());\n\t\t\tpst.setInt(6, obj.getId());\n\t\t\tpst.executeUpdate();\n\t\t}catch(SQLException e) {\n\t\t\tthrow new DbException(e.getMessage());\n\t\t}finally {\n\t\t\tDb.closeStatement(pst);\n\t\t}\n\t}",
"void update(Seller obj);",
"void update(Seller obj);",
"@Override\n\tpublic void update(Object object) {\n\t\tSession session = HibernateSessionFactory.getSession();\n\t\tTransaction ts = session.beginTransaction();\n\t\tsession.update(object);\n\t\tts.commit();\n\t\tsession.close();\n\t}",
"public boolean update(Object obj) throws Exception;",
"public M updateAndReturn(K id, Update<P> update);",
"public abstract void update(Object obj) ;",
"@Override\r\n protected void updateObject(SimpleBody object, Entity e) {\n }",
"@Override\r\n protected void updateObject(SimpleBody object, Entity e) {\n }",
"@Override\n\tpublic int update(OrderItem objectToUpdate) throws SQLException {\n\t\treturn 0;\n\t}",
"public void update(Object obj) throws HibException;",
"public void update(T object) throws SQLException;",
"@Override\r\n\tpublic Borne update(Borne obj) {\n\t\tStatement st =null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tst = this.connect.createStatement();\r\n\t\t\tString sql = \"UPDATE Borne SET idZone = '\"+obj.getZone().getId()+\"' WHERE id =\"+obj.getId();\r\n\t\t\tSystem.out.println(sql);\r\n\t\t\tst.executeUpdate(sql);\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn obj;\r\n\t}",
"@Override\r\n\tpublic void update(Object object) {\n\t\t\r\n\t}",
"public boolean update(ModelObject obj);",
"@Override\r\n\tpublic void update(Cidade obj) {\n\r\n\t}",
"public static <T> T update(T object)\n {\n return SqlClosure.sqlExecute(connection -> update(connection, object));\n }",
"@Transactional(isolation=Isolation.READ_COMMITTED, \n\t\t\tpropagation=Propagation.REQUIRED,\n\t\t\trollbackFor=Exception.class)\n\tpublic void update(Object object) {\n\t\tsessionFactory.getCurrentSession().saveOrUpdate(object);\n\t}",
"T update(T object);",
"public abstract Object update(String oid, Object obj)\n\t\t\tthrows OIDDoesNotExistException, ObjectNotSupportedException, LockNotAvailableException;",
"E update(ID id, E entity, RequestContext context);",
"protected void updateRecord() throws DAOException {\r\n\t\t// Prepara para actualizar\r\n\t\tobject.prepareToUpdate();\r\n\t\t// Actualiza objeto\r\n\t\tobjectDao.update(object);\r\n\t\t// Actualiza relaciones\r\n\t\tfor (Sedrelco relco : object.getRelcos()) {\r\n\t\t\tsedrelcoDao.update(relco);\r\n\t\t}\r\n\t}",
"public abstract <T> void update(String id, Map<String, Object> objectMap, Class<T> clazz);",
"void update(ObjectType object)\n throws GuacamoleException;",
"public void update(PaymentSummary object)\n throws SQLException {\n List params = fromObjectToBean(object).toList();\n params.add(object.getId());\n this.execute(new ParametricStatement[] {\n new ParametricStatement(updateSql, params)\n });\n }",
"public void update(RutaPk pk, Ruta dto) throws RutaDaoException;",
"public static void update(Object object) {\n\n\t\tfinal Session session = HibernateUtil.getSessionFactory().openSession();\n\t\tTransaction transaction = null;\n\n\t\ttry {\n\t\t\ttransaction = session.beginTransaction();\n\n\t\t\tsession.update(object);\n\t\t\ttransaction.commit();\n\t\t} catch (HibernateException e) {\n\t\t\tif (null != transaction) {\n\t\t\t\ttransaction.rollback();\n\t\t\t}\n\t\t\te.printStackTrace(); // todo: log to file instead\n\t\t} finally {\n\t\t\tsession.close();\n\t\t}\n\t}",
"@Override\n\tpublic void update(T obj) throws Exception {\n\t\t\n\t}",
"public Future<CtxModelObject> update(CtxModelObject identifier);",
"public void update(User obj) {\n\t\t\n\t}",
"public void update(InterfaceBean object) {\n\t\t\n\t}",
"default E update(ID id, E entity) {\n return update(id, entity, null);\n }",
"public void update(ItemsPk pk, Items dto) throws ItemsDaoException;",
"@PostMapping(\"/{id}\")\n\tpublic <T> void UpdateDocumentFields(@PathVariable ObjectId id, @RequestParam String updateKey, @RequestParam T updateValue) {\n\t\ttradeLedgerService.update(id, updateKey, updateValue);\n\t}",
"@Override\n\tpublic void update(Object entidade) {\n\t\t\n\t}",
"public CompletionStage<Result> updateItem(Long id) {\n MessageDispatcher jdbcDispatcher = AkkaDispatcher.jdbcDispatcher;\n\n JsonNode nItem = request().body().asJson();\n ItemEntity item = Json.fromJson( nItem , ItemEntity.class ) ;\n ItemEntity itemViejo = ItemEntity.FINDER.byId(id);\n return CompletableFuture.supplyAsync(\n ()->{\n if(itemViejo == null)\n {\n return itemViejo;\n }else\n { item.setId(id);\n item.update();\n return item;\n }\n }\n ).thenApply(\n itemEntity -> {\n if(itemEntity == null)\n {\n return notFound();\n }else\n {\n return ok(Json.toJson(itemEntity));\n }\n }\n\n );\n }",
"public boolean update(New object);",
"E update(E entity);",
"E update(E entity);",
"@Override\n\tpublic void update(Object o) {\n\n\t}",
"@Override\n\tpublic void update(Object o) {\n\n\t}",
"E update(E entiry);",
"protected PoxPayloadOut update(String csid,\r\n PoxPayloadIn theUpdate,\r\n ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx)\r\n throws Exception {\r\n DocumentHandler handler = createDocumentHandler(ctx);\r\n getRepositoryClient(ctx).update(ctx, csid, handler);\r\n return ctx.getOutput();\r\n }",
"@Override\n public void updateOne(int id, Booking itemToUpdate) {\n String sql = \"UPDATE bookings SET customer_phone_number = ? WHERE id = ?\";\n jdbc.update(sql, itemToUpdate.getCustomerPhoneNumber(), id);\n }",
"public void update(SgfensBancoPk pk, SgfensBanco dto) throws SgfensBancoDaoException;",
"@Override\n\tpublic boolean update(Item obj) {\n\t\ttry{\n\t\t\tString query=\"UPDATE items SET title = ?, start_date = ?, end_date = ?, type = ? WHERE id = ?\";\n\t\t\tPreparedStatement state = conn.prepareStatement(query,ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);\n\t\t\tstate.setString(1, obj.getTitle());\n\t\t\tstate.setDate(2, obj.getStartDate());\n\t\t\tstate.setDate(3, obj.getEndDate());\n\t\t\tstate.setInt(4, obj.getItemType().getIndex());\n\t\t\tstate.setInt(5, obj.getIndex());\n\t\t\t\n\t\t\t// Run the query\n\t\t\tstate.executeUpdate();\n\n\t\t\tstate.close();\n\t\t\t\n\t\t\t// Notify the Dispatcher on a suitable channel.\n\t\t\tthis.publish(EntityEnum.ITEM.getValue());\n\t\t\t\n\t\t\treturn true;\n\t\t} catch (SQLException e){\n\t\t\tJOptionPane jop = new JOptionPane();\n\t\t\tjop.showMessageDialog(null, e.getMessage(),\"PostgreSQLItemDao.update -- ERROR!\",JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t} catch (Exception e){\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}",
"void updateOfProductById(long id);",
"@Override\r\n\tpublic void update(Address obj, String mainItem, Address oldObj) {\r\n\t\tValidationReturn validation = validator.update(obj, mainItem);\r\n\t\t\r\n\t\tif (!validation.getStatus().equals(200)) {\r\n\t\t\tthrow new DBException(validation.toString());\r\n\t\t}\r\n\t\t\r\n\t\tDAOJDBC DAOJDBCModel = new DAOJDBC();\r\n\t\tString valuesToUpdate = \"\";\r\n\t\t\r\n\t\t\r\n\t\tif (!obj.getStreet().isEmpty() && !obj.getStreet().equals(\"\") && !obj.getStreet().equals(\"null\")) {\r\n\t\t\tvaluesToUpdate += (\"street='\" + obj.getStreet() + \"' \");\r\n\t\t}\r\n\t\t\r\n\t\tif (!obj.getDistrict().isEmpty() && !obj.getDistrict().equals(\"\") && !obj.getDistrict().equals(\"null\")) {\r\n\t\t\tvaluesToUpdate += (\"district='\" + obj.getDistrict() + \"' \");\r\n\t\t}\r\n\t\t\r\n\t\tif (obj.getNumber() > 0) {\r\n\t\t\tvaluesToUpdate += (\"number=\" + obj.getNumber() + \" \");\r\n\t\t}\r\n\t\t\r\n\t\tif (!obj.getNote().isEmpty() && !obj.getNote().equals(\"\") && !obj.getNote().equals(\"null\")) {\r\n\t\t\tvaluesToUpdate += (\"note='\" + obj.getNote() + \"' \");\r\n\t\t}\r\n\r\n\t\tDAOJDBCModel.singleCall(\"UPDATE address SET \" + valuesToUpdate + \"WHERE \" + mainItem + \r\n\t\t\t\t\"='\" + oldObj.getByString(mainItem) + \"';\");\r\n\t}",
"@Transactional(propagation=Propagation.REQUIRED,isolation =Isolation.REPEATABLE_READ, rollbackFor = Exception.class)\r\n public int update(Test obj) throws Exception {\r\n if(obj == null ){\r\n return 0;\r\n }\r\n List<Test> list = new ArrayList<Test>();\r\n list.add(obj);\r\n return this.update(list);\r\n }",
"@Override\n public void updateByPrimaryKey(ClientAuditTrailHolder oldObj_,\n ClientAuditTrailHolder newObj_) throws Exception\n {\n\n }",
"@Update(UPDATE_BY_ID)\n @Override\n int updateById(Object position);",
"@Override\n public void updateByPrimaryKeySelective(ClientAuditTrailHolder oldObj_,\n ClientAuditTrailHolder newObj_) throws Exception\n {\n\n }",
"boolean updateWorkByObject(Work work);",
"void updateUser(int id, UpdateUserDto updateUserDto);",
"int updateByPrimaryKey(Body record);",
"public abstract boolean update(T transientObject);",
"<T> void update(T persistentObject);",
"protected PoxPayloadOut update(String csid,\r\n MultipartInput theUpdate,\r\n ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx,\r\n DocumentHandler handler)\r\n throws Exception {\r\n getRepositoryClient(ctx).update(ctx, csid, handler);\r\n return ctx.getOutput();\r\n }",
"Item update(Item item);",
"public int update(DomainObject object) {\r\n int updateValue = -1;\r\n Session session = getSession();\r\n Transaction tx = null;\r\n try {\r\n if (object == null) {\r\n LOG.debug(MODULE + \" Null object could not update....RETURNING\");\r\n return updateValue;\r\n }\r\n tx = session.beginTransaction();\r\n session.update(object);\r\n tx.commit();\r\n updateValue = 1;\r\n } catch (RuntimeException e) {\r\n updateValue = -1;\r\n LOG.error(MODULE + \"Exception in update Method.\" + e, e);\r\n if (tx != null) {\r\n tx.rollback();\r\n }\r\n throw e;\r\n } finally {\r\n if (session.isOpen()) {\r\n session.close();\r\n }\r\n }\r\n return updateValue;\r\n }",
"void update(T transientObject);",
"D update(D dto);",
"T update(T entity);",
"T update(T entity);",
"@Override\n\tpublic int updateObject(Evaluate entity) {\n\t\treturn evaluateMapper.updateObject(entity);\n\t}",
"void update(Student entity);",
"public static <T> T updateObject(T object)\n {\n return new UpdateClosure<T>(object).execute();\n }",
"public Client update(Client object) throws DataNotFoundException {\n\t\treturn null;\r\n\t}",
"@Override\n\tpublic void update(Object dto) throws Exception {\n\t\tpropertyConfigMapper.updateByPrimaryKeySelective(dto);\n\t}",
"Weather update(Long id, WeatherInformation weatherInformation);",
"public void executeUpdate(Representation entity, T entry, AbstractUpdate updateObject) throws ResourceException {\r\n\r\n\t\tConnection c = null;\r\n\t\t// TODO it is inefficient to instantiate executor in all classes\r\n\t\tUpdateExecutor executor = new UpdateExecutor();\r\n\t\ttry {\r\n\t\t\tDBConnection dbc = new DBConnection(getContext());\r\n\t\t\tc = dbc.getConnection(30, true, 5);\r\n\r\n\t\t\texecutor.setConnection(c);\r\n\t\t\texecutor.open();\r\n\t\t\texecutor.process(updateObject);\r\n\r\n\t\t\tcustomizeEntry(entry, c);\r\n\r\n\t\t\tQueryURIReporter<T, Q> uriReporter = getURUReporter(getRequest());\r\n\t\t\tif (uriReporter != null) {\r\n\t\t\t\tgetResponse().setLocationRef(uriReporter.getURI(entry));\r\n\t\t\t\tgetResponse().setEntity(uriReporter.getURI(entry), MediaType.TEXT_HTML);\r\n\t\t\t}\r\n\t\t\tgetResponse().setStatus(Status.SUCCESS_OK);\r\n\t\t\tonUpdateSuccess();\r\n\t\t} catch (SQLException x) {\r\n\t\t\tContext.getCurrentLogger().severe(x.getMessage());\r\n\t\t\tgetResponse().setStatus(Status.CLIENT_ERROR_FORBIDDEN, x, x.getMessage());\r\n\t\t\tgetResponse().setEntity(null);\r\n\t\t} catch (ProcessorException x) {\r\n\t\t\tContext.getCurrentLogger().severe(x.getMessage());\r\n\t\t\tgetResponse().setStatus((x.getCause() instanceof SQLException) ? Status.CLIENT_ERROR_FORBIDDEN\r\n\t\t\t\t\t: Status.SERVER_ERROR_INTERNAL, x, x.getMessage());\r\n\t\t\tgetResponse().setEntity(null);\r\n\t\t} catch (Exception x) {\r\n\t\t\tContext.getCurrentLogger().severe(x.getMessage());\r\n\t\t\tgetResponse().setStatus(Status.SERVER_ERROR_INTERNAL, x, x.getMessage());\r\n\t\t\tgetResponse().setEntity(null);\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\texecutor.close();\r\n\t\t\t} catch (Exception x) {\r\n\t\t\t}\r\n\t\t\ttry {\r\n\t\t\t\tif (c != null)\r\n\t\t\t\t\tc.close();\r\n\t\t\t} catch (Exception x) {\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public Long updateById(Store t, long id) {\n return null;\n }",
"@Override\n\tpublic void saveORUpdate(T obj) throws Exception {\n\t\t\n\t}",
"public void update(DatiBancariPk pk, DatiBancari dto) throws DatiBancariDaoException;",
"public abstract Object update(String oid, Object obj, String lockKey)\n\t\t\tthrows OIDDoesNotExistException, ObjectNotSupportedException, InvalidLockException;",
"public int updateRecord(String sqlID, Object object)\r\n\t\t\tthrows DataAccessException {\n\t\treturn update(sqlID, object);\r\n\t}",
"@Override\r\n\tpublic Ngo update(Ngo obj) {\n\t\treturn null;\r\n\t}",
"@Override\r\n\tpublic void update(Connection con, Object obj) throws Exception {\n\t}",
"@Transactional\n\tpublic T update(T transientObject) {\n\t\treturn this.em.merge(transientObject);\n\t}",
"UpdateResponse upsert(UpdateRequest updateRequest) throws IOException;",
"T edit(long id, T obj);"
] | [
"0.7388655",
"0.7105341",
"0.7077422",
"0.6899674",
"0.687273",
"0.67315805",
"0.67180026",
"0.66927063",
"0.66777056",
"0.6662179",
"0.6652996",
"0.6650156",
"0.66317004",
"0.6591348",
"0.65892756",
"0.658631",
"0.6530305",
"0.65042573",
"0.64698225",
"0.64653385",
"0.64537376",
"0.64537376",
"0.64380556",
"0.64372075",
"0.64304984",
"0.6426248",
"0.64066434",
"0.64066434",
"0.63871324",
"0.6364527",
"0.63527626",
"0.63440067",
"0.63324",
"0.6321097",
"0.63181347",
"0.6308863",
"0.62855047",
"0.6277676",
"0.6265783",
"0.62611246",
"0.62552685",
"0.62453556",
"0.62342054",
"0.62274426",
"0.62225294",
"0.6217126",
"0.6211592",
"0.62063944",
"0.61935407",
"0.6188384",
"0.6187875",
"0.6174953",
"0.61738306",
"0.6167451",
"0.61558586",
"0.6120955",
"0.6120548",
"0.6120548",
"0.6076956",
"0.6076956",
"0.60747916",
"0.606749",
"0.6039151",
"0.60322815",
"0.60291296",
"0.6014204",
"0.601146",
"0.60043055",
"0.6001717",
"0.59993577",
"0.5983233",
"0.5975009",
"0.5971146",
"0.5960725",
"0.59606063",
"0.59570986",
"0.5954968",
"0.59535956",
"0.5953011",
"0.59396744",
"0.5924887",
"0.5920595",
"0.5920595",
"0.59063935",
"0.59011525",
"0.58980376",
"0.5877465",
"0.5874627",
"0.5874348",
"0.5870885",
"0.58702826",
"0.58681744",
"0.5859499",
"0.5859369",
"0.5857659",
"0.58558434",
"0.5852433",
"0.5849517",
"0.5847502",
"0.58447003"
] | 0.63985837 | 28 |
Adds multiple new entities in one batch | Set<E> addAll(IApplicationUser user, Collection<C> createDtos); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"WriteRequest insert(Iterable<? extends PiEntity> entities);",
"private void insertData() {\n for (int i = 0; i < 3; i++) {\n RecipeEntity books = factory.manufacturePojo(RecipeEntity.class);\n em.persist(books);\n data.add(books);\n }\n }",
"private void toBeAddedEntities()\n\t{\n\t\tif( entitiesToAdd.isEmpty() )\n\t\t{\n\t\t\treturn ;\n\t\t}\n\n\t\tfinal List<Event<?>> events = MalletList.<Event<?>>newList() ;\n\n\t\tfinal int size = entitiesToAdd.size() ;\n\t\tfor( int i = 0; i < size; ++i )\n\t\t{\n\t\t\tfinal Entity entity = entitiesToAdd.get( i ) ;\n\t\t\thookEntity( eventSystem, events, entity ) ;\n\t\t\tentities.add( entity ) ;\n\t\t}\n\t\tentitiesToAdd.clear() ;\n\t\t\n\t\tif( size > capacity )\n\t\t{\n\t\t\t// If the size of entitiesToAdd exceeds our capacity then \n\t\t\t// we want to resize the array - it's easy for an \n\t\t\t// array to expand, it's much harder to shrink it!\n\t\t\tentitiesToAdd = MalletList.<Entity>newList( capacity ) ;\n\t\t}\n\t}",
"@Override\n\tpublic void batchSave(Collection<UserOrder> entities) {\n\t\t\n\t}",
"private void insertData() {\n\n cliente = factory.manufacturePojo(ClienteEntity.class);\n em.persist(cliente);\n for (int i = 0; i < 3; i++) {\n FormaPagoEntity formaPagoEntity = factory.manufacturePojo(FormaPagoEntity.class);\n formaPagoEntity.setCliente(cliente);\n em.persist(formaPagoEntity);\n data.add(formaPagoEntity);\n }\n }",
"@Override\n public int bathSave(List<T> entitys) throws Exception {\n return mapper.insertList(entitys);\n }",
"@Override\n\tpublic void batchSave(Collection<UserOrderDetail> entities) {\n\t\t\n\t}",
"private void insertData() \n {\n for(int i = 0; i < 2; i++){\n RazaEntity razaEntity = factory.manufacturePojo(RazaEntity.class);\n em.persist(razaEntity);\n razaData.add(razaEntity);\n }\n for (int i = 0; i < 3; i++) {\n EspecieEntity especieEntity = factory.manufacturePojo(EspecieEntity.class);\n if(i == 0)\n {\n especieEntity.setRazas(razaData);\n }\n em.persist(especieEntity);\n especieData.add(especieEntity);\n }\n }",
"private void insertData() {\n \n for (int i = 0; i < 4; i++) {\n EmpleadoEntity entity = factory.manufacturePojo(EmpleadoEntity.class);\n entity.setSolicitudes(new ArrayList<>());\n entity.setPropuestas(new ArrayList<>());\n entity.setInvitaciones(new ArrayList<>());\n entity.setTipoEmpleado(TipoEmpleado.TRADUCTOR);\n if(i == 0)\n {\n SolicitudEntity solicitud = factory.manufacturePojo(SolicitudEntity.class);\n em.persist(solicitud);\n entity.getSolicitudes().add(solicitud);\n solicitud.setEmpleado(entity);\n solicitudesData.add(solicitud);\n }\n else if (i == 1)\n {\n InvitacionEntity invitacion = factory.manufacturePojo(InvitacionEntity.class);\n em.persist(invitacion);\n entity.getInvitaciones().add(invitacion); \n invitacion.setEmpleado(entity);\n invitacionesData.add(invitacion);\n }\n else if (i == 2){\n PropuestaEntity propuesta = factory.manufacturePojo(PropuestaEntity.class);\n em.persist(propuesta);\n entity.getPropuestas().add(propuesta);\n propuesta.setEmpleado(entity);\n propuestasData.add(propuesta);\n }\n em.persist(entity);\n data.add(entity);\n }\n }",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n VueltasConDemoraEnOficinaEntity entity = factory.manufacturePojo(VueltasConDemoraEnOficinaEntity.class);\n \n em.persist(entity);\n data.add(entity);\n }\n }",
"void addBatch() throws SQLException;",
"void insertBatch(List<Customer> customers);",
"void bulkInsertOrReplace (List<Consumption> entities);",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ViajeroEntity entity = factory.manufacturePojo(ViajeroEntity.class);\n\n em.persist(entity);\n data.add(entity);\n }\n }",
"private void insertData() {\n for (int i = 0; i < 3; i++) {\n PodamFactory factory = new PodamFactoryImpl();\n VisitaEntity entity = factory.manufacturePojo(VisitaEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n }",
"private void persistEntities(List<Entity> entities) {\n jdbcTemplate.batchUpdate(\n \"insert into entity (id, num, realm, shard, timestamp_range, type) \"\n + \"values (?, ?, ?, ?, ?::int8range, ?::entity_type)\",\n entities,\n entities.size(),\n (ps, entity) -> {\n ps.setLong(1, entity.getId());\n ps.setLong(2, entity.getNum());\n ps.setLong(3, entity.getRealm());\n ps.setLong(4, entity.getShard());\n ps.setString(5, PostgreSQLGuavaRangeType.INSTANCE.asString(entity.getTimestampRange()));\n ps.setString(6, entity.getType().toString());\n });\n\n jdbcTemplate.batchUpdate(\n \"insert into entity_history (id, num, realm, shard, timestamp_range, type) \"\n + \"values (?, ?, ?, ?, ?::int8range, ?::entity_type)\",\n entities,\n entities.size(),\n (ps, entity) -> {\n ps.setLong(1, entity.getId());\n ps.setLong(2, entity.getNum());\n ps.setLong(3, entity.getRealm());\n ps.setLong(4, entity.getShard());\n ps.setString(5, PostgreSQLGuavaRangeType.INSTANCE.asString(entity.getTimestampRange()));\n ps.setString(6, entity.getType().toString());\n });\n }",
"private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n MonitoriaEntity entity = factory.manufacturePojo(MonitoriaEntity.class);\r\n\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }",
"private void insertData() {\n \n for (int i = 0; i < 3; i++) {\n ClienteEntity editorial = factory.manufacturePojo(ClienteEntity.class);\n em.persist(editorial);\n ClienteData.add(editorial);\n }\n \n for (int i = 0; i < 3; i++) {\n ContratoPaseoEntity paseo = factory.manufacturePojo(ContratoPaseoEntity.class);\n em.persist(paseo);\n contratoPaseoData.add(paseo);\n }\n \n for (int i = 0; i < 3; i++) {\n ContratoHotelEntity editorial = factory.manufacturePojo(ContratoHotelEntity.class);\n em.persist(editorial);\n contratoHotelData.add(editorial);\n }\n \n for (int i = 0; i < 3; i++) {\n PerroEntity perro = factory.manufacturePojo(PerroEntity.class);\n //perro.setCliente(ClienteData.get(0));\n //perro.setEstadias((List<ContratoHotelEntity>) contratoHotelData.get(0));\n //perro.setPaseos((List<ContratoPaseoEntity>) contratoPaseoData.get(0));\n em.persist(perro);\n Perrodata.add(perro);\n }\n\n }",
"private void insertData() {\n\n for (int i = 0; i < 3; i++) {\n ProveedorEntity proveedor = factory.manufacturePojo(ProveedorEntity.class);\n BonoEntity entity = factory.manufacturePojo(BonoEntity.class);\n int noOfDays = 8;\n Date dateOfOrder = new Date();\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n Date date = calendar.getTime();\n entity.setExpira(date);\n noOfDays = 1;\n calendar = Calendar.getInstance();\n calendar.setTime(dateOfOrder);\n calendar.add(Calendar.DAY_OF_YEAR, noOfDays);\n date = calendar.getTime();\n entity.setAplicaDesde(date);\n entity.setProveedor(proveedor);\n em.persist(entity);\n ArrayList lista=new ArrayList<>();\n lista.add(entity);\n proveedor.setBonos(lista);\n em.persist(proveedor);\n pData.add(proveedor);\n data.add(entity); \n }\n }",
"public void addBatch(List<Map<String, String>> batchData);",
"public void add(Collection<T> entities) {\n\t\tnewEntities.addAll(entities);\n\t}",
"private void insertData() {\n PodamFactory factory = new PodamFactoryImpl();\n for (int i = 0; i < 3; i++) {\n ServicioEntity entity = factory.manufacturePojo(ServicioEntity.class);\n em.persist(entity);\n dataServicio.add(entity);\n }\n for (int i = 0; i < 3; i++) {\n QuejaEntity entity = factory.manufacturePojo(QuejaEntity.class);\n if (i == 0) {\n entity.setServicio(dataServicio.get(0));\n }\n em.persist(entity);\n data.add(entity);\n }\n }",
"public void addEntity(T... entities) {\r\n\t\tfor (T entity : entities) {\r\n\t\t\t// if entity name is not specified, set the fully qualified class name as the entity name\r\n\t\t\tentity.setEntityName(StringUtils.hasLength(entity.getEntityName()) ? entity.getEntityName() : entity.getClass().getName());\r\n\t\t\tthis.entitiesList.add(entity);\r\n\t\t}\t\t\r\n\t}",
"public void addBatch(List<Map<String, String>> batchData, String batchName);",
"void insertBatch(List<InspectionAgency> recordLst);",
"void addToBatch(String[] values) {\n if (values.length != 16) {\n logger.info(\"Incorrect format for insert query\");\n return;\n }\n\n try {\n batchPreparedStmt.clearParameters();\n DateFormat format = new SimpleDateFormat(\"yyyyMMdd/HHmm\");\n for (int i = 0, j = 1; i < values.length; ++i, ++j) {\n if (i == 1) {\n batchPreparedStmt.setTimestamp(j, new java.sql.Timestamp(format.parse(values[i]).getTime()));\n } else if (i == 0) {\n batchPreparedStmt.setString(j, values[i]);\n } else {\n batchPreparedStmt.setDouble(j, Double.parseDouble(values[i]));\n }\n }\n batchPreparedStmt.addBatch();\n currBatchSize--;\n if (currBatchSize <= 0) {\n this.commitBatch();\n }\n } catch (SQLException e) {\n logger.log(Level.WARNING, \"SQLException \", e.getMessage());\n } catch (ParseException e) {\n logger.log(Level.WARNING, \"ParseException \", e.getMessage());\n }\n }",
"public void addBatch() throws SQLException {\n statement.addBatch();\n }",
"int insertBatch(List<Basicinfo> list);",
"private void insertData() {\n compra = factory.manufacturePojo(CompraVentaEntity.class);\n compra.setId(1L);\n compra.setQuejasReclamos(new ArrayList<>());\n em.persist(compra);\n\n for (int i = 0; i < 3; i++) {\n QuejasReclamosEntity entity = factory.manufacturePojo(QuejasReclamosEntity.class);\n entity.setCompraVenta(compra);\n em.persist(entity);\n data.add(entity);\n compra.getQuejasReclamos().add(entity);\n }\n }",
"private void insertData() {\r\n \r\n TeatroEntity teatro = factory.manufacturePojo(TeatroEntity.class);\r\n em.persist(teatro);\r\n FuncionEntity funcion = factory.manufacturePojo(FuncionEntity.class);\r\n List<FuncionEntity> lista = new ArrayList();\r\n lista.add(funcion);\r\n em.persist(funcion);\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n sala.setFuncion(lista);\r\n em.persist(sala);\r\n data.add(sala);\r\n }\r\n for (int i = 0; i < 3; i++) \r\n {\r\n SalaEntity sala = factory.manufacturePojo(SalaEntity.class);\r\n sala.setTeatro(teatro);\r\n em.persist(sala);\r\n sfdata.add(sala);\r\n }\r\n \r\n }",
"default void create(Iterable<E> entities, RequestContext context)\n throws TechnicalException, ConflictException {\n entities.forEach(entity -> create(entity, context));\n }",
"private <T, Q extends Query> void executeInsertBatch(Collection<T> objectsToInsert, Function<? super T, ? extends Q> mapFunction) {\n\t\tList<Q> insertStatements = objectsToInsert.stream().map(mapFunction).collect(Collectors.toList());\n\t\tdslContext.batch(insertStatements).execute();\n\t}",
"public void bulkAdd(){\n employees.add(new Employee(23.0, 15000.0, \"Shayan\"));\n employees.add(new Employee(22.0, 60000.0, \"Rishabh\"));\n employees.add(new Employee(23.0, 45000.0, \"Ammar\"));\n employees.add(new Employee(25.0, 30000.0, \"Fahad\"));\n employees.add(new Employee(21.0, 50000.0, \"Ankur\"));\n }",
"private void insertData() \n {\n for (int i = 0; i < 3; i++) {\n TarjetaPrepagoEntity entity = factory.manufacturePojo(TarjetaPrepagoEntity.class);\n em.persist(entity);\n data.add(entity);\n }\n for(int i = 0; i < 3; i++)\n {\n PagoEntity pagos = factory.manufacturePojo(PagoEntity.class);\n em.persist(pagos);\n pagosData.add(pagos);\n\n }\n \n data.get(2).setSaldo(0.0);\n data.get(2).setPuntos(0.0);\n \n double valor = (Math.random()+1) *100;\n data.get(0).setSaldo(valor);\n data.get(0).setPuntos(valor); \n data.get(1).setSaldo(valor);\n data.get(1).setPuntos(valor);\n \n }",
"public void insert(List<T> entity) throws NoSQLException;",
"public void addBatch(String sql) throws SQLException {\n\r\n }",
"@Override\n public void insert(Iterator<Object[]> batch) {\n while (batch.hasNext()) {\n BoundStatement boundStatement = statement.bind(batch.next());\n ResultSetFuture future = session.executeAsync(boundStatement);\n Futures.addCallback(future, callback, executor);\n }\n }",
"Collection<E> save(Iterable<E> entities);",
"void saveAll(Collection<?> entities);",
"@Observable\n public AbstractBatchAction<T> addToSaveEntities(final T entity) {\n this.saveEntities.add(entity);\n return this;\n }",
"public int addBatch(List<User> users) {\n\t\treturn this.userDao.insertBatch(users);\r\n\t}",
"@Override\r\n\tpublic void batchPersist(final List<?> entityList) {\n\t\tif (CollectionUtils.isEmpty(entityList)) {\r\n\t\t\tlogger.debug(\"Persist list is empty, no entity has been persisted.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.getJpaTemplate().execute(new JpaCallback<Object>() {\r\n\t\t\t@Override\r\n\t\t\tpublic Object doInJpa(EntityManager em) throws PersistenceException {\r\n\t\t\t\tint max = entityList.size();\r\n\t\t\t\tfor (int i = 0; i < max; i++) {\r\n\t\t\t\t\tem.persist(entityList.get(i));\r\n\t\t\t\t\tif ((i != 0 && i % DEFAULT_BATCH_SIZE == 0) || i == max - 1) {\r\n\t\t\t\t\t\tem.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tlogger.debug(\"{} entities has been persisted.\", max);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}",
"@Insert(onConflict = OnConflictStrategy.IGNORE)\n void insertAllUsers(List<UsersEntity> usersEntity);",
"@Override\r\n\tpublic void addBatch(List<CardApply> list) {\n\t\tfor (CardApply cardApply : list) {\r\n\t\t\tcardApplyDao.save(cardApply);\r\n\t\t}\r\n\t}",
"@Test\n void add() {\n List<User> userList = Arrays.asList(\n new User(1L, \"star\", 20, \"123456\"),\n new User(2L, \"green\", 21, \"123456\"),\n new User(3L, \"red\", 22, \"123456\"),\n new User(4L, \"blue\", 23, \"123456\"),\n new User(5L, \"yellow\", 24, \"123456\"),\n new User(6L, \"black\", 26, \"123456\")\n );\n userRepository.saveAll(userList);\n }",
"@Override\n\tpublic String addBatch(List<Map<String, Object>> entityMap)\n\t\t\tthrows DataAccessException {\n\t\treturn null;\n\t}",
"@Override\n public <T extends IEntity> void persist(Iterable<T> entityIterable) {\n startCallContext(ConnectionReason.forUpdate);\n try {\n if (entityIterable.iterator().hasNext()) {\n for (T entity : entityIterable) {\n persist(tableModel(entity.getEntityMeta()), entity);\n }\n }\n } finally {\n endCallContext();\n }\n }",
"@Test\n void insertWithBatchSuccess() {\n\n User testUser = new User(\"tester\", \"password\", \"first name test\", \"last name test\", \"email@emailplace.com\", \"53589\", LocalDate.of(1980, 6, 16));\n Batch testBatch = new Batch(\"White Spotted Dog\", \"porter\", LocalDate.of(2019, 4, 1), LocalDate.of(2019, 4, 1), LocalDate.of(2019, 4, 1), LocalDate.of(2019, 4, 1), 1.055, 1.043);\n // this way each of the entities know about one another!\n testUser.addBatch(testBatch);\n // grab the id of the newly added user, use it to verify the new user was created\n int newId = genericDao.insert(testUser);\n\n User anotherTestUser = (User) genericDao.getById(newId);\n assertEquals(testUser, anotherTestUser);\n\n }",
"@Insert\n void insertAll(List<User> users);",
"Integer insertBatch(List<RolePermission> rolePermissions);",
"public abstract List<CustomerOrder> save(Iterable<CustomerOrder> entities);",
"int insertBatch(List<SystemRoleUserMapperMo> list);",
"private void addEntities(String[][] entityArray)\n\t{\n\t\tfor (int i = 0; i < entityArray.length; ++i)\n\t\t{\n\t\t\taddEntity(entityArray[i][0], Integer.parseInt(entityArray[i][1]));\n\t\t}\n\t}",
"@Override\n public void addBatch( String sql ) throws SQLException {\n throw new SQLException(\"tinySQL does not support addBatch.\");\n }",
"private void insertData() {\r\n PodamFactory factory = new PodamFactoryImpl();\r\n for (int i = 0; i < 3; i++) {\r\n UsuarioEntity entity = factory.manufacturePojo(UsuarioEntity.class);\r\n em.persist(entity);\r\n dataUsuario.add(entity);\r\n }\r\n for (int i = 0; i < 3; i++) {\r\n CarritoDeComprasEntity entity = factory.manufacturePojo(CarritoDeComprasEntity.class);\r\n if (i == 0 ){\r\n entity.setUsuario(dataUsuario.get(0));\r\n }\r\n em.persist(entity);\r\n data.add(entity);\r\n }\r\n }",
"@Insert\n long[] insertAll(Task... tasks);",
"protected void handleEntitiesIndividually() {\n\n\t\tfinal Set<Long> originalBatch = getUidsToLoad();\n\t\tfinal Set<Long> batchOfOne = new HashSet<Long>();\n\n\t\t/**\n\t\t * We replace the batch of all the uids with our own which we'll only put one uid at a time.\n\t\t */\n\t\tsetBatch(batchOfOne);\n\n\t\tLOG.info(\"Loading \" + originalBatch.size() + \" entities individually\");\n\n\t\tfor (final Long uid : originalBatch) {\n\n\t\t\ttry {\n\n\t\t\t\tbatchOfOne.clear();\n\t\t\t\tbatchOfOne.add(uid);\n\n\t\t\t\tfinal Collection<ENTITY> loadedEntity = loadBatch();\n\t\t\t\tgetPipelinePerformance().addCount(\"loader:entities_loaded_individually\", loadedEntity.size());\n\n\t\t\t\tfor (final ENTITY entity : loadedEntity) {\n\t\t\t\t\tgetNextStage().send(entity);\n\t\t\t\t\tgetPipelinePerformance().addCount(\"loader:entities_out\", 1);\n\n\t\t\t\t}\n\t\t\t} catch (final Exception e) {\n\t\t\t\tgetPipelinePerformance().addCount(\"loader:individual_entity_loading_failures\", 1);\n\n\t\t\t\tLOG.error(\"Could not load entity with uid \" + uid + \" for indexing, this entity will not be indexed. \", e);\n\t\t\t}\n\n\t\t}\n\n\t\t/** Put the original set of uids back. */\n\t\tsetBatch(originalBatch);\n\n\t}",
"@Override\n public void addAll(Collection<Event> events) {\n events.forEach(this::persist);\n }",
"public void saveAllEntities() {\n for (T entity : getEntities()) {\n if (entity.getId() < 0) {\n entity.setId(null);\n getService().save(entity);\n }\n else {\n getService().save(entity);\n }\n }\n for (T removedEntity : getRemovedEntities()) {\n getService().delete(removedEntity.getId());\n }\n setRemovedEntities(new ArrayList<T>());\n }",
"public void addToBatch(DecalBatch batch) {\n\t\tbatch.add(car);\n\t}",
"public <T> Collection<T> saveAll(Collection<T> entities);",
"@Disabled\r\n\t@Test\r\n\tvoid saveBatch ( ) {\r\n\r\n\t\tlogger.info( Utils.testHeader( ) ) ;\r\n\r\n\t\tvar testEmployees = IntStream.rangeClosed( 1, TEST_RECORD_COUNT )\r\n\t\t\t\t.mapToObj( EmpHelpers::buildRandomizeEmployee )\r\n\t\t\t\t.collect( Collectors.toList( ) ) ;\r\n\r\n\t\temployeeRepository.saveAll( testEmployees ) ;\r\n\r\n\t}",
"public List<Long> createOrUpdate(MigrationType type, List<DatabaseObject<?>> batch);",
"private void createBatch(String collectionName, HashMap<String, String> map, JSONArray deepEntity) {\n OfflinePost object = new OfflinePost();\n object.setCollectionName(collectionName);\n object.setMap(map);\n object.setDeepEntity(deepEntity);\n arrayList.add(object);\n for (OfflinePost offlinePost : arrayList) {\n //Log.e(\"Payload Batch\",\"\" + offlinePost.getMap());\n }\n for (int i = 0; i < arrayList.size(); i++) {\n OfflinePost obj = arrayList.get(i);\n //Log.e(\"Payload 2\",\"\" + obj.getMap());\n }\n }",
"default void create(Iterable<E> entities)\n throws TechnicalException, ConflictException {\n entities.forEach(this::create);\n }",
"public void addtorepository() {\n ClientModel widget = new ClientModel();\n widget.setAddress(\"123 Fake Street\");\n widget.setCurrentInvoice(10000);\n widget.setName(\"Widget Inc\");\n clientrepository.save(widget);\n //next client\n ClientModel foo = new ClientModel();\n foo.setAddress(\"456 Attorney Drive\");\n foo.setCurrentInvoice(20000);\n foo.setName(\"Foo LLP\");\n clientrepository.save(foo);\n //next client\n ClientModel bar = new ClientModel();\n bar.setAddress(\"111 Bar Street\");\n bar.setCurrentInvoice(30000);\n bar.setName(\"Bar and Food\");\n clientrepository.save(bar);\n //next client\n ClientModel dog = new ClientModel();\n dog.setAddress(\"222 Dog Drive\");\n dog.setCurrentInvoice(40000);\n dog.setName(\"Dog Food and Accessories\");\n clientrepository.save(dog);\n //next client\n ClientModel cat = new ClientModel();\n cat.setAddress(\"333 Cat Court\");\n cat.setCurrentInvoice(50000);\n cat.setName(\"Cat Food\");\n clientrepository.save(cat);\n //next client\n ClientModel hat = new ClientModel();\n hat.setAddress(\"444 Hat Drive\");\n hat.setCurrentInvoice(60000);\n hat.setName(\"The Hat Shop\");\n clientrepository.save(hat);\n //next client\n ClientModel hatB = new ClientModel();\n hatB.setAddress(\"445 Hat Drive\");\n hatB.setCurrentInvoice(60000);\n hatB.setName(\"The Hat Shop B\");\n clientrepository.save(hatB);\n //next client\n ClientModel hatC = new ClientModel();\n hatC.setAddress(\"446 Hat Drive\");\n hatC.setCurrentInvoice(60000);\n hatC.setName(\"The Hat Shop C\");\n clientrepository.save(hatC);\n //next client\n ClientModel hatD = new ClientModel();\n hatD.setAddress(\"446 Hat Drive\");\n hatD.setCurrentInvoice(60000);\n hatD.setName(\"The Hat Shop D\");\n clientrepository.save(hatD);\n //next client\n ClientModel hatE = new ClientModel();\n hatE.setAddress(\"447 Hat Drive\");\n hatE.setCurrentInvoice(60000);\n hatE.setName(\"The Hat Shop E\");\n clientrepository.save(hatE);\n //next client\n ClientModel hatF = new ClientModel();\n hatF.setAddress(\"448 Hat Drive\");\n hatF.setCurrentInvoice(60000);\n hatF.setName(\"The Hat Shop F\");\n clientrepository.save(hatF);\n }",
"@Override\n public void batchAdd(List<CmdbIpConfPoolEntity> data) {\n confPoolMapper.batchAdd(data);\n }",
"void batchInsert(@Param(\"serviceSegments\") List<ServiceSegmentModel> serviceSegments);",
"private void batchImport() {\r\n m_jdbcTemplate.batchUpdate(createInsertQuery(),\r\n new BatchPreparedStatementSetter() {\r\n public void setValues(\r\n PreparedStatement ps, int i)\r\n throws SQLException {\r\n int j = 1;\r\n for (String property : m_propertyNames) {\r\n Map params = (Map) m_batch.get(\r\n i);\r\n ps.setObject(j++, params.get(\r\n property));\r\n }\r\n }\r\n\r\n public int getBatchSize() {\r\n return m_batch.size();\r\n }\r\n });\r\n }",
"@Override\n\tpublic void add(Estado es) {\n\t\tEntityManager em = this.emf.createEntityManager();\n\t\ttry {\n\t\t\tem.persist(es);\n\t\t\tem.flush(); // este es un commit? \n\t\t\t\n\t\t} catch(Exception e) {\n\t\t\t\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t}",
"void addToBatch(String rows) {\n // split multiple rows into row\n String[] rowArray = rows.split(\"\\n\");\n // for each row, insert row to batch\n for (String row : rowArray) {\n String[] values = row.trim().split(\"\\\\s+\");\n if (values.length != 16) {\n values = row.trim().split(\",\");\n }\n addToBatch(values);\n }\n }",
"@Override\r\n\tpublic int insertBatch(List<ProfitUserDomain> list) {\n\t\treturn profitUserDAO.insertBatch(list);\r\n\t}",
"public void addBatch() throws SQLException {\n currentPreparedStatement.addBatch();\n }",
"@RequestMapping(value = \"/insertMultiple\", method = RequestMethod.POST)\n\tpublic ResponseEntity<List<RestResponse>> insertMultiple(@RequestBody List<Expense> list) {\n List<RestResponse> listResults=new ArrayList<>();\n System.out.println(list.size());\n\t list.stream().forEach(expense ->\n {\n listResults.add(expenseService.insertOne(expense));\n System.out.println(\"*** Amount : \"+expense.getAmount());\n });\n\n\t\treturn new ResponseEntity<List<RestResponse>>(listResults, HttpStatus.OK);\n\t }",
"public <T extends IDBEntities> void massSave(List<? extends IDBEntities> elements) {\n\t\tif (elements == null)\n\t\t\treturn;\n\t\tEntityManager em = getEM();\n\t\ttry {\n\t\t\tem.getTransaction().begin();\n\t\t\tfor (IDBEntities element : elements) {\n\t\t\t\tif (element != null) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif (element.getID() != null)\n\t\t\t\t\t\t\tem.merge(element);\n\t\t\t\t\t} catch (NullPointerException ex) {\n\t\t\t\t\t\tem.persist(element);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tem.getTransaction().commit();\n\t\t} catch (Exception ex) {\n\t\t\tem.getTransaction().rollback();\n\t\t} finally {\n\t\t\tem.close();\n\t\t}\n\t}",
"public int createMultipleRequests(Set _requests) throws RequestManagerException, PersistenceResourceAccessException;",
"@SuppressWarnings(\"resource\")\n @Explain(\"We close the statement later, this is just an intermediate\")\n protected void addBatch() throws SQLException {\n prepareStmt().addBatch();\n batchBacklog++;\n if (batchBacklog > batchBacklogLimit) {\n commit();\n }\n }",
"@Override\n\tpublic boolean insertBatch(List<Student> list) {\n\t\ttry {\n\t\t\tfor (Student s : list) {\n\t\t\t\tsDao.insert(s);\n\t\t\t}\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"int batchInsert(@Param(\"list\") List<Token1155InventoryWithBLOBs> list);",
"@Insert\n void insertAll(Measurement... measurements);",
"<T> void persist(T... entities);",
"private void addSomeItemsToDB () throws Exception {\n/*\n Position pos;\n Course course;\n Ingredient ing;\n\n PositionDAO posdao = new PositionDAO();\n CourseDAO coursedao = new CourseDAO();\n IngredientDAO ingdao = new IngredientDAO();\n\n ing = new Ingredient(\"Mozzarella\", 10,30);\n ingdao.insert(ing);\n\n // Salads, Desserts, Main course, Drinks\n pos = new Position(\"Pizza\");\n posdao.insert(pos);\n\n course = new Course(\"Salads\", \"Greek\", \"Cucumber\", \"Tomato\", \"Feta\");\n coursedao.insert(course);\n\n ing = new Ingredient(\"-\", 0,0);\n ingdao.insert(ing);\n */\n }",
"@POST\n\t@Path(\"/update\")\n\tpublic Uni<RestResponse<Object>> appendMultiple(HttpServerRequest request,\n\t\t\tList<Map<String, Object>> compactedEntities, @QueryParam(value = \"options\") String options,\n\t\t\t@QueryParam(\"localOnly\") boolean localOnly) {\n\t\tList<Uni<Tuple2<String, Object>>> unis = Lists.newArrayList();\n\t\tfor (Map<String, Object> compactedEntity : compactedEntities) {\n\t\t\tunis.add(HttpUtils.expandBody(request, compactedEntity, AppConstants.APPEND_REQUEST, ldService).onItem()\n\t\t\t\t\t.transform(i -> Tuple2.of((String) compactedEntity.get(\"id\"), (Object) i)).onFailure()\n\t\t\t\t\t.recoverWithItem(e -> Tuple2.of((String) compactedEntity.get(\"id\"), (Object) e)));\n\t\t}\n\t\treturn Uni.combine().all().unis(unis).collectFailures().combinedWith(list -> {\n\t\t\tList<NGSILDOperationResult> fails = Lists.newArrayList();\n\t\t\tList<Map<String, Object>> expandedEntities = Lists.newArrayList();\n\t\t\tList<Context> contexts = Lists.newArrayList();\n\t\t\tfor (Object obj : list) {\n\t\t\t\tTuple2<String, Object> tuple = (Tuple2<String, Object>) obj;\n\t\t\t\tString entityId = tuple.getItem1();\n\t\t\t\tObject obj2 = tuple.getItem2();\n\t\t\t\tif (obj2 instanceof Exception) {\n\t\t\t\t\tNGSILDOperationResult failureResults = new NGSILDOperationResult(AppConstants.APPEND_REQUEST,\n\t\t\t\t\t\t\tentityId);\n\t\t\t\t\tif (obj2 instanceof ResponseException) {\n\t\t\t\t\t\tfailureResults.addFailure((ResponseException) obj2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfailureResults.addFailure(\n\t\t\t\t\t\t\t\tnew ResponseException(ErrorType.InvalidRequest, ((Exception) obj2).getMessage()));\n\t\t\t\t\t}\n\t\t\t\t\tfails.add(failureResults);\n\t\t\t\t} else {\n\t\t\t\t\tTuple2<Context, Map<String, Object>> tuple2 = (Tuple2<Context, Map<String, Object>>) obj2;\n\t\t\t\t\texpandedEntities.add(tuple2.getItem2());\n\t\t\t\t\tcontexts.add(tuple2.getItem1());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Tuple3.of(fails, expandedEntities, contexts);\n\n\t\t}).onItem().transformToUni(tuple -> {\n\t\t\tList<NGSILDOperationResult> fails = tuple.getItem1();\n\t\t\tList<Map<String, Object>> expandedEntities = tuple.getItem2();\n\t\t\tList<Context> contexts = tuple.getItem3();\n\t\t\treturn entityService.appendBatch(HttpUtils.getTenant(request), expandedEntities, contexts, localOnly)\n\t\t\t\t\t.onItem().transform(opResults -> {\n\t\t\t\t\t\topResults.addAll(fails);\n\t\t\t\t\t\treturn HttpUtils.generateBatchResult(opResults);\n\t\t\t\t\t});\n\t\t}).onFailure().recoverWithItem(HttpUtils::handleControllerExceptions);\n\t}",
"void insertBatch(List<TABLE41> recordLst);",
"@Override\n @Transactional\n public void addBulkInsertsAfterExtraction() {\n List<ScrapBook> scrapBooks = new ArrayList<ScrapBook>();\n boolean jobDone = false;\n boolean pause = false;\n while (!jobDone) {\n pause = false;\n int lineCount = 0;\n while (!pause) {\n ++lineCount;\n if (lineCount % 30 == 0) {\n scrapBooks = springJdbcTemplateExtractor.getPaginationList(\"SELECT * FROM ScrapBook\", 1, 30);\n pause = true;\n }\n }\n //convert scrapbook to book and insert into db\n convertedToBookAndInsert(scrapBooks);\n // delete all inserted scrapbooks\n springJdbcTemplateExtractor.deleteCollection(scrapBooks);\n scrapBooks = null;\n if (0 == springJdbcTemplateExtractor.findTotalScrapBook()) {\n jobDone = true;\n }\n }\n }",
"@Override\n\tpublic <T> void insertMany(List<T> list) throws Exception {\n\t\t\n\t}",
"public void addFlights(List<Flight> newFlights) {\n\t\tSession session = connector.getSession();\n\t\tTransaction transaction = session.beginTransaction();\n\n\t\tfor (Flight flight : newFlights) {\n\t\t\tFlight targetFlight = session.get(Flight.class, flight.getFlightNum());\n\t\t\tif (targetFlight == null)\n\t\t\t\tsession.save(flight);\n\t\t}\n\t\ttransaction.commit();\n\t}",
"public void addEntity(Entity e)\r\n\t{\r\n\t\tentities.add(e);\r\n\t}",
"public void saveAll(Collection<Product> products);",
"@Test\n public void testMultiInsertData() throws Exception {\n String tenantId = \"5cab9a0c-b22e-4640-ac7e-7426dd9fea73\";\n List<Item> items = itemDao.getAllNotDeleteItems(tenantId);\n System.out.println(items.size());\n int pointsDataLimit = 1000;//限制条数\n int size = items.size();\n //判断是否有必要分批\n if (pointsDataLimit < size) {\n int part = size / pointsDataLimit;//分批数\n System.out.println(\"共有 : \" + size + \"条,!\" + \" 分为 :\" + part + \"批\");\n for (int i = 0; i < part; i++) {\n //1000条\n List<Item> listPage = items.subList(0, pointsDataLimit);\n String json = EsJsonUtils.generateMultiInsertItem(listPage);\n System.out.println(json);\n elasticSearchDao.bulkDealData(TENANT_ID + Constants.INDEX_SPLIT + Constants.ITEM,Constants.ITEM,json);\n //剔除\n items.subList(0, pointsDataLimit).clear();\n }\n if (!items.isEmpty()) {\n String json = EsJsonUtils.generateMultiInsertItem(items);\n System.out.println(json);\n elasticSearchDao.bulkDealData(TENANT_ID+ Constants.INDEX_SPLIT + Constants.ITEM,Constants.ITEM,json);\n }\n }\n }",
"public void testAddAddresses_BatchOperationException()\r\n throws Exception {\r\n try {\r\n Address address = this.getAddress();\r\n address.getCountry().setId(10);\r\n this.dao.addAddresses(new Address[]{this.getAddress(), address}, false);\r\n fail(\"BatchOperationException expected\");\r\n } catch (BatchOperationException e) {\r\n //good\r\n }\r\n }",
"@Override\n\tpublic int insert(List<BaseEntity> entities) throws DaoException {\n\t\treturn 0;\n\t}",
"public void flushEntityBuffer()\n\t{\n\t\tfor(Entity e : this.newEntityBuffer)\n\t\t{\n\t\t\tEntityEvent spawnEvent = e.fireEvent(new EntityEvent(Entity.EVENT_ID_SPAWN, e));\n\t\t\tif(spawnEvent.isCancelled())\n\t\t\t{\n\t\t\t\t//Don't spawn entity if event is cancelled\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.entities.add(e);\n\t\t\te.onSpawn(this);\n\t\t\tHandle<Entity> h = this.spatialHashGrid.add(e.getBoundingBox().offset(e.getX(), e.getY()), e);\n\t\t\te.setSpationHashGridHandle(h);\n\t\t}\n\t\tthis.newEntityBuffer.clear();\n\t}",
"int batchInsert(@Param(\"list\") List<UserShare5Min> list);",
"public void saveManyHistory() {\n Map<String, String> status = new HashMap<>();\n String userID = \"15\";\n List<User> allUsers = dumpDao.getAllUsers();\n Random random = new Random();\n for (int x = 0; x < 1000; x++) {\n System.out.println(\"Loop Counter : \" + x);\n userID = allUsers.get(random.nextInt(allUsers.size() - 1)).getId().toString();\n int numberOfHistory = random.nextInt(20);\n for (int y = 0; y < numberOfHistory + 1; y++) {\n System.out.println(\"\\nHistory Save\\n\");\n History history = new History();\n history.setUserId(userID);//will be set from service.\n history.setDate(DateUtil.getDate().toString());\n history.setLocation(DumpData.getLocation());\n history.setPatientDescription(DumpData.getPatientDescription());\n history.setRefferedBy(DumpData.getRefferedBy());\n history.setNote(DumpData.getNote());\n history.setUserId(userID);\n dao_history_i.save(history);\n System.out.println(history.getId());\n }//for\n }\n// bug : data are not being save\n// for (int x = 0; x < 100; x++) {\n// System.out.println(\"\\nHistory Save\\n\");\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// entityManager.persist(history);\n// System.out.println(history.getId());\n// }\n\n// bug : data are not being save\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// entityManager.persist(history);\n// System.out.println(history.getId());\n //working, insertion of history, just for one.\n// for (int x = 0; x < 10; x++) {\n// System.out.println(\"\\nHistory Save\\n\");\n// History history = new History();\n// history.setUserId(userID);//will be set from service.\n// history.setDate(DateUtil.getDate().toString());\n// history.setLocation(DumpData.getLocation());\n// history.setPatientDescription(DumpData.getPatientDescription());\n// history.setRefferedBy(DumpData.getRefferedBy());\n// history.setNote(DumpData.getNote());\n// history.setUserId(userID);\n// dao_history_i.save(history);\n// System.out.println(history.getId());\n// }//for\n }",
"@Override\n public void RegisterEntities(LinkedList<Entity> listToModify) {\n listToModify.add(test1);\n// listToModify.add(test2);\n }",
"private void performCreates()\n {\n // Create entities. We have to loop possibly many times to create the entities\n // because we have to set the FKs. It's\n // possible that the source for a FK is a FK from yet another EI. We don't\n // want to copy a FK until we know that the source for a FK has been\n // properly set. We also want to make sure we set the FK's for the EIs that\n // have been excluded/deleted before we copy FKs for the included/created.\n int debugCnt = 0; // We'll keep a counter in case we get an infinite loop.\n\n // creatingEntities will be true for as long as we think we need to create more entities.\n boolean creatingEntities = true;\n while ( creatingEntities )\n {\n // We'll hope that we're done creating entities after this iteration. If we\n // find we need to create more then we'll turn it back on.\n creatingEntities = false;\n\n if ( debugCnt++ > 100 )\n throw new ZeidonException(\"Internal error: too many times creating entities.\");\n\n for ( ViewImpl view : viewList )\n {\n ObjectInstance oi = view.getObjectInstance();\n\n for ( final EntityInstanceImpl ei : oi.getEntities() )\n {\n if ( ! requiresCreate( ei ) )\n continue;\n\n assert ! ei.getEntityDef().isDerivedPath();\n\n if ( ! createInstance( view, ei ) )\n creatingEntities = true; // We weren't able to create ei. Try again later.\n }\n }\n } // while creatingEntities...\n }",
"@Override\n public void save(Iterable<? extends LineEntity> entities) {\n\n }",
"@Override\n\tpublic void add(Entity entity) throws Exception {\n\t\tsuper.add(entity);\n\t\tProduct prod = (Product) entity;\n\n\t\tSQLiteStatement st = db\n\t\t\t\t.prepare(\"INSERT INTO products(sessionID, name, priceMin, priceMax, quantity, category)\"\n\t\t\t\t\t\t+\"VALUES (?, ?, ?, ?, ?, ?)\");\n\t\tst.bind(1, sessionId).bind(2, prod.getName()).bind(3, prod.getPriceMin())\n\t\t\t\t.bind(4, prod.getPriceMin()).bind(5, prod.getQuantity())\n\t\t\t\t.bind(6, prod.getCategory());\n\t\tst.step();\n\t\ttotalQuantity += prod.quantity;\n\t\tif (!categoryList.containsKey(prod.getCategory())) {\n\t\t\tcategoryList.put(prod.getCategory(), new ArrayList<Product>());\n\t\t}\n\t\tcategoryList.get(prod.getCategory()).add(prod);\n\t\tif (availableProducts.get(entity.getName())==null) {\n\t\t\tavailableProducts.put(entity.getName(), \" \");\n\t\t}\n\t}",
"@Override\r\n\tpublic void batchMerge(final List<?> entityList) {\n\t\tif (CollectionUtils.isEmpty(entityList)) {\r\n\t\t\tlogger.debug(\"Merge list is empty, no entity has been merged.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis.getJpaTemplate().execute(new JpaCallback<Object>() {\r\n\t\t\t@Override\r\n\t\t\tpublic Object doInJpa(EntityManager em) throws PersistenceException {\r\n\t\t\t\tint max = entityList.size();\r\n\t\t\t\tfor (int i = 0; i < max; i++) {\r\n\t\t\t\t\tem.merge(entityList.get(i));\r\n\t\t\t\t\tif ((i != 0 && i % DEFAULT_BATCH_SIZE == 0) || i == max - 1) {\r\n\t\t\t\t\t\tem.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tlogger.debug(\"{} entities has been merged.\", max);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}"
] | [
"0.68798405",
"0.6875404",
"0.6816557",
"0.6676578",
"0.6655949",
"0.66243106",
"0.6610591",
"0.6605805",
"0.65751374",
"0.65717554",
"0.6569559",
"0.6566555",
"0.6556758",
"0.65543276",
"0.6472217",
"0.6429159",
"0.64219224",
"0.6406015",
"0.63978446",
"0.633678",
"0.6297111",
"0.6241129",
"0.6239093",
"0.623398",
"0.6182325",
"0.6180199",
"0.61539906",
"0.61294293",
"0.61232007",
"0.6116875",
"0.6112561",
"0.61124647",
"0.61093116",
"0.60892737",
"0.60689867",
"0.60682636",
"0.6063626",
"0.6052371",
"0.60413635",
"0.60348403",
"0.6034611",
"0.6030789",
"0.6018861",
"0.6012479",
"0.60092074",
"0.5994592",
"0.5980145",
"0.5931079",
"0.5921247",
"0.59163237",
"0.59105504",
"0.59007066",
"0.58992904",
"0.58958733",
"0.58855987",
"0.58643067",
"0.5853679",
"0.58532137",
"0.58528167",
"0.58486724",
"0.584209",
"0.5816747",
"0.5814091",
"0.58111674",
"0.58095",
"0.5807369",
"0.5787364",
"0.5761894",
"0.57421654",
"0.5731879",
"0.57269365",
"0.57201",
"0.56856316",
"0.5681596",
"0.5659689",
"0.5650094",
"0.56409264",
"0.56380045",
"0.5629769",
"0.56275356",
"0.56250805",
"0.56224114",
"0.56197923",
"0.56160367",
"0.5615129",
"0.56134886",
"0.5605478",
"0.56044644",
"0.560351",
"0.5565913",
"0.55597",
"0.555667",
"0.55533946",
"0.55433524",
"0.5529505",
"0.5527393",
"0.55191165",
"0.5515027",
"0.5507465",
"0.54964143"
] | 0.5542327 | 94 |
Your holder should contain a member variable for any view that will be set as you render a row We also create a constructor that accepts the entire item row and does the view lookups to find each subview | public ViewHolder(View itemView) {
// Stores the itemView in a public final member variable that can be used
// to access the context from any ViewHolder instance.
super(itemView);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ViewHolder(View itemView) {\n super(itemView);\n imageView = itemView.findViewById(R.id.ivSomeImage);\n textView = itemView.findViewById(R.id.tvSomeText);\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n tvNature = (TextView)itemView.findViewById(R.id.item_name);\n tvAmountNature = (TextView)itemView.findViewById(R.id.item_amount);\n }",
"public MyHolder(View itemView) {\n super(itemView);\n item = itemView.findViewById(R.id.item);\n noofpices = itemView.findViewById(R.id.noofpices);\n cost = itemView.findViewById(R.id.cost);\n amount = itemView.findViewById(R.id.total);\n plus = itemView.findViewById(R.id.plus);\n// minus = (ImageButton)itemView.findViewById(R.id.minus);\n delete = itemView.findViewById(R.id.del);\n\n // id= (TextView)itemView.findViewById(R.id.id);\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n /* designation_txt = (TextView) itemView.findViewById(R.id.designation_txt);\n name_txt = (TextView) itemView.findViewById(R.id.name_txt);\n number_txt = (TextView) itemView.findViewById(R.id.number_txt);*/\n\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n\n listName = (TextView) itemView.findViewById(R.id.listName);\n remainingItems = (TextView) itemView.findViewById(R.id.remainingItems);\n listButtonLayout = (LinearLayout) itemView.findViewById(R.id.listButtonLayout);\n btnView = (Button) listButtonLayout.findViewById(R.id.btnEditList);\n btnDeleteList = (Button) listButtonLayout.findViewById(R.id.btnDeleteList);\n\n\n }",
"protected abstract ReadCell<DataType> createItemCell(LayoutInflater inflater, View convertView, ViewGroup parent);",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n EmpirePortrait= (ImageView) itemView.findViewById(R.id.EmpirePortrait);\n nameTextView = (TextView) itemView.findViewById(R.id.EmpireName);\n deleteButton = (ImageButton) itemView.findViewById(R.id.EmpireDelete);\n FlagView = (ImageView) itemView.findViewById(R.id.EmpireFlag);\n ViewButton = (Button) itemView.findViewById(R.id.viewButton);\n }",
"public ViewHolder(View itemView) {\n tvGrupo = (TextView) itemView.findViewById(R.id.tvGrupo);\n tvNCD = (TextView) itemView.findViewById(R.id.tvNCD);\n tvACD = (TextView) itemView.findViewById(R.id.tvACD);\n ivCD = (ImageView) itemView.findViewById(R.id.ivCD);\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.user_name);\n startTextView = (TextView) itemView.findViewById(R.id.start_date);\n }",
"public ItemHolder(@NonNull View itemView) {\n super(itemView);\n /*tvNombre=itemView.findViewById(R.id.tvNombre);\n tvCiudad=itemView.findViewById(R.id.etCiudad);\n btBorrar=itemView.findViewById(R.id.btBorrar);\n btEditar=itemView.findViewById(R.id.btEditar);\n cl = itemView.findViewById(R.id.cl);\n ivImagen = itemView.findViewById(R.id.ivImagen);*/\n }",
"public MapHolder(LayoutInflater inflater, ViewGroup parent) {\n super(inflater.inflate(R.layout.area_cell, parent, false));\n itemView.setOnClickListener(this);\n //sets the recycler views highet at runtime, divide that by the number of cells that can fit\n int size = parent.getMeasuredHeight() / GameData.ROW + 1;\n ViewGroup.LayoutParams lp = itemView.getLayoutParams();\n lp.width = size;\n lp.height = size;\n image1 = (ImageView)itemView.findViewById(R.id.imagetopleft);\n\n\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n\n tvMessageLeft = (TextView) itemView.findViewById(R.id.tvMessageLeft);\n tvMessageRight = (TextView) itemView.findViewById(R.id.tvMessageRight);\n ivUserIcon = (ImageView) itemView.findViewById(R.id.ivProfPicMessageList);\n // tvTime_stamp = (TextView) itemView.findViewById(R.id.tvTime);\n\n\n //llItemListTop = (LinearLayout) itemView.findViewById(R.id.llListItemTop);\n //llItemListMiddle = (LinearLayout) itemView.findViewById(R.id.llListItemMiddle);\n //llItemListBottom = (LinearLayout) itemView.findViewById(R.id.llListItemTop);\n\n\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n int position = getAdapterPosition();\n\n\n nameTextView = (TextView) itemView.findViewById(R.id.contact_name);\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n messageButton.setOnClickListener(new ButtonClick(this));\n itemView.setOnClickListener(this);\n\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n imageView1 = itemView.findViewById(R.id.item_health_center_first_photo);\n imageView2 = itemView.findViewById(R.id.item_health_center_second_photo);\n imageView3 = itemView.findViewById(R.id.item_health_center_third_photo);\n imageView4 = itemView.findViewById(R.id.item_health_center_forth_photo);\n }",
"public ViewHolder(View view) {\n super(view);\n mView = view;\n mIdView = (TextView) view.findViewById(R.id.item_number);\n mContentView = (TextView) view.findViewById(R.id.content);\n }",
"@Override\n public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n\n if (viewType == TYPE_ITEM) {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_row,parent,false); //Inflating the layout\n\n ViewHolder vhItem = new ViewHolder(v,viewType); //Creating ViewHolder and passing the object of type view\n\n return vhItem; // Returning the created object\n\n //inflate your layout and pass it to view holder\n\n } else if (viewType == TYPE_HEADER) {\n\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.header,parent,false); //Inflating the layout\n\n ViewHolder vhHeader = new ViewHolder(v,viewType); //Creating ViewHolder and passing the object of type view\n\n return vhHeader; //returning the object created\n\n\n }\n return null;\n\n }",
"private View initView(int position, View convertView, ViewGroup parent) {\n View row = convertView;\n if (row == null) {\n LayoutInflater inflater = ((Activity) context).getLayoutInflater();\n row = inflater.inflate(resourceId, parent, false);\n }\n Scenario record = getItem(position);\n if (record != null) {\n TextView scenarioId = (TextView) row.findViewById(R.id.rowScenarioId);\n TextView scenarioName = (TextView) row.findViewById(R.id.rowScenarioName);\n TextView scenarioFileName = (TextView) row.findViewById(R.id.rowScenarioFile);\n TextView scenarioMime = (TextView) row.findViewById(R.id.rowScenarioMime);\n\n if (scenarioId != null) {\n scenarioId.setText(Integer.toString(record.getScenarioId()));\n }\n if (scenarioName != null) {\n scenarioName.setText(record.getScenarioName());\n }\n if (scenarioFileName != null) {\n scenarioFileName.setText(record.getFileName());\n }\n if (scenarioMime != null) {\n scenarioMime.setText(record.getMimeType());\n }\n }\n return row;\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n nameTextView = (TextView) itemView.findViewById(R.id.torrent_name);\n movieImageView = (ImageView) itemView.findViewById(R.id.movie_image);\n }",
"public ViewHolder(@NonNull View itemView) {\n super(itemView);\n txvNombreMascotaDesparasitante = itemView.findViewById(R.id.txvNombreMascotaDesparasitante);\n txvNombreDesparasitante = itemView.findViewById(R.id.txvNombreDesparasitante);\n txvPesoDesparasitante = itemView.findViewById(R.id.txvPesoDesparasitante);\n txvFechaAplicacionDesparasitante = itemView.findViewById(R.id.txvFechaAplicacionDesparasitante);\n \n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n breweryImage = (ImageView) itemView.findViewById(R.id.brewery_image);\n breweryName = (TextView) itemView.findViewById(R.id.brewery_name);\n }",
"@Override\n // Call ViewHolder class and create the view\n public RecyclerViewAdapter.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {\n View view = LayoutInflater.from(viewGroup.getContext())\n .inflate(R.layout.list_row, viewGroup, false);\n\n // Pass the view created\n return new ViewHolder(view, context);\n }",
"@Override\n\t\tpublic View getView(int position, View convertView, ViewGroup parent) {\n\n\t\t\tLayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\tView view = inflater.inflate(R.layout.list_item_table_row_read, parent, false);\n\t\t\tSet<Entry<String, JsonElement>> set = mTableRows[position].getAsJsonObject().entrySet();\n\t\t\tLinearLayout layoutItem = (LinearLayout) view.findViewById(R.id.layoutItem);\n\t\t\t//Loop through each data item in the row and create a layout with the key and \n\t\t\t//value displayed in TextViews within it\n\t\t\tfor (Entry<String, JsonElement> entry : set) {\n\t\t\t\tLog.i(TAG, entry.getKey());\t\t\t\t\n\t\t\t\tRelativeLayout rowLayout = new RelativeLayout(mContext);\n\t\t\t\tRelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);\t\t\t\t\n\t\t\t\trowLayout.setLayoutParams(params);\t\t\t\t\n\t\t\t\tTextView lblKey = new TextView(mContext);\n\t\t\t\tlblKey.setText(entry.getKey());\t\t\t\t\n\t\t\t\tRelativeLayout.LayoutParams keyParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\t\tkeyParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT);\n\t\t\t\tkeyParams.leftMargin = 20;\n\t\t\t\tlblKey.setLayoutParams(keyParams);\t\t\t\t\n\t\t\t\tTextView lblValue = new TextView(mContext);\t\t\t\t\n\t\t\t\tRelativeLayout.LayoutParams valueParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);\n\t\t\t\tvalueParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);\n\t\t\t\tlblValue.setLayoutParams(valueParams);\n\t\t\t\t//Limit the amount of text we show so the UI isn't dirty\n\t\t\t\tInputFilter[] FilterArray = new InputFilter[1];\n\t\t\t\tFilterArray[0] = new InputFilter.LengthFilter(25);\n\t\t\t\tlblValue.setFilters(FilterArray);\n\t\t\t\tlblValue.setText(entry.getValue().getAsString());\n\t\t\t\tlblValue.setGravity(Gravity.RIGHT);\n\t\t\t\trowLayout.addView(lblKey);\n\t\t\t\trowLayout.addView(lblValue);\n\t\t\t\tlayoutItem.addView(rowLayout);\n\t\t\t}\t\t\t\n\t\t\treturn view;\n\t\t}",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_row, parent, false);\n\n return new ViewHolder(view);\n }",
"@Override\n public MyAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { //RECETA\n // create a new view\n LayoutInflater inflater = LayoutInflater.from (parent.getContext());\n View v = inflater.inflate(R.layout.row_layout, parent, false);\n // set the view's size, margins, paddings and layout parameters\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n ButterKnife.bind(this, itemView);\n\n }",
"public ViewHolder(View view) {\n super(view);\n ButterKnife.bind(this, view);\n\n\n launchesButton.setOnClickListener(v -> {\n Intent launches = new Intent(activity, LauncherLaunchActivity.class);\n launches.putExtra(\"launcherId\", items.get(getAdapterPosition()).getId());\n launches.putExtra(\"launcherName\", items.get(getAdapterPosition()).getName());\n activity.startActivity(launches);\n });\n infoButton.setOnClickListener(v -> openCustomTab(activity, mContext, items.get(getAdapterPosition()).getInfoUrl()));\n wikiButton.setOnClickListener(v -> openCustomTab(activity, mContext, items.get(getAdapterPosition()).getWikiUrl()));\n vehicleImage.setOnClickListener(v -> {\n Intent animateIntent = new Intent(activity, FullscreenImageActivity.class);\n animateIntent.putExtra(\"imageURL\", items.get(getAdapterPosition()).getImageUrl());\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {\n activity.startActivity(animateIntent, ActivityOptions.makeSceneTransitionAnimation(activity, vehicleImage, \"imageCover\").toBundle());\n } else {\n activity.startActivity(animateIntent);\n }\n });\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n // create a new view\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.tubewell_row, parent, false);\n\n final ViewHolder vh = new ViewHolder(v);\n v.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n mListner.onItemClick(v, vh.getPosition());\n }\n });\n\n return vh;\n }",
"@Override\r\n\t\tpublic View newView(Context arg0, Cursor arg1, ViewGroup arg2) {\n\t\t\t\t LayoutInflater inflater = LayoutInflater.from(arg2.getContext());\r\n\t\t\t View retView = inflater.inflate(R.layout.report_listitems, arg2, false);\r\n\t\t\t int j=i%2;\r\n\t\t\t retView.setBackgroundColor(colors[j]);\r\n\t\t\t i++;\r\n\t\t\t bindView(retView,arg0,arg1);\r\n\t\t\t return retView;\r\n\t\t\t \r\n\t\t}",
"public ViewHolder(View itemView) {\n super(itemView);\n hospname= itemView.findViewById(R.id.hospname);\n address= itemView.findViewById(R.id.hospaddress);\n rrr= itemView.findViewById(R.id.rrrtext);\n hospimage= itemView.findViewById(R.id.hospital_image);\n callambulance= itemView.findViewById(R.id.bookambulancebutton);\n getroom= itemView.findViewById(R.id.bookroombutton);\n /*price= itemView.findViewById(R.id.bedprice);\n cat= itemView.findViewById(R.id.bedcat);\n bedimage= itemView.findViewById(R.id.bedimage);*/\n\n\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n this.productName = itemView.findViewById(R.id.productName);\n// this.productDesc = itemView.findViewById(R.id.productDesc);\n// this.productPrice = itemView.findViewById(R.id.productPrice);\n// this.imageView = itemView.findViewById(R.id.productImage);\n itemView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n onClickListener.orderType(v, getAdapterPosition());\n }\n });\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n productDetails = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_product_details);\n price = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_MRP);\n sp = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_SP);\n //qty = (Spinner) itemView.findViewById(R.id.category_item_layout_for_view_product_qty);\n productImage = (ImageView) itemView.findViewById(R.id.category_item_layout_for_view_product_image);\n addToCart = (TextView) itemView.findViewById(R.id.category_item_layout_for_view_product_addToCart);\n }",
"@Override\n public view_holder onCreateViewHolder(ViewGroup parent, int viewType) {\n view_holder view = new view_holder(LayoutInflater.from(a).inflate(R.layout.cell,parent,false));\n\n return view;\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n if (mFromSearch) {\n mNameView = (TextView) itemView.findViewById(R.id.single_search_title);\n mTickerView = (TextView) itemView.findViewById(R.id.single_search_ticker);\n } else {\n mNameView = (TextView) itemView.findViewById(R.id.tv_name);\n mPriceView = (TextView) itemView.findViewById(R.id.tv_price);\n }\n itemView.setOnClickListener(this);\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n super(itemView);\n\n tvTitle = itemView.findViewById(R.id.tvTitle);\n tvBody = itemView.findViewById(R.id.tvDescription);\n tvDueDate = itemView.findViewById(R.id.tvDueDate);\n content = itemView.findViewById(R.id.cardViewToDo);\n details = itemView.findViewById(R.id.rlToDoDetails);\n ivDropDown = itemView.findViewById(R.id.ivDropDown);\n }",
"private void inflateViewForItem(Item item) {\n\n //Inflate Layout\n ItemCardBinding binding = ItemCardBinding.inflate(getLayoutInflater());\n\n //Bind Data\n binding.imageView.setImageBitmap(item.bitmap);\n binding.title.setText(item.label);\n binding.title.setBackgroundColor(item.color);\n\n //Add it to the list\n b.list.addView(binding.getRoot());\n }",
"@Override\n public View getView(int position, View ConvertView, ViewGroup parent){ ///position starts from zero,one and goes on, parent would be the layout we want to display all elements\n View row=ConvertView; //to optimize we inflate the item only first else we recycle the view using converterView\n if(row==null) {\n LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\n //**View of which we want to convert to java view object\n row = inflater.inflate(R.layout.single_row, parent, false);\n }\n //*****From row view we can access the view items and populate it data\n ImageView imageView = (ImageView)row.findViewById(R.id.imageView);\n TextView myDiscription=(TextView)row.findViewById(R.id.myDescription);\n TextView myTitle=(TextView)row.findViewById(R.id.mytitle);\n\n imageView.setImageResource(images[position]); //postion will incremented automaticlly as views will populate\n myDiscription.setText(description[position]);\n myTitle.setText(titles[position]);\n\n return row;\n }",
"@Override\n public ListViewCostumeAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,\n int viewType) {\n View view = mInflater.inflate(R.layout.row_item,\n parent, false);\n return new ViewHolder(view);\n }",
"protected View inflateRow(ViewHolder holder){\n View row = null;\n switch (type)\n {\n case TYPE_TEXT_USER:\n row = inflater.inflate(textUserRowResId, null);\n holder.readStatus = (ImageSwitcher) row.findViewById(R.id.read_status);\n holder.readStatus.setFactory(new ViewSwitcher.ViewFactory() {\n @Override\n public View makeView() {\n ImageView imageView = new ImageView(mActivity.getApplicationContext());\n imageView.setScaleType(ImageView.ScaleType.CENTER);\n return imageView;\n }\n });\n holder.readStatus.setInAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_in));\n holder.readStatus.setOutAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_out));\n holder.txtContent = (TextView) row.findViewById(R.id.txt_content);\n\n break;\n\n case TYPE_TEXT_FRIEND:\n\n row = inflater.inflate(textFriendRowResId, null);\n\n holder.txtContent = (TextView) row.findViewById(R.id.txt_content);\n\n break;\n\n case TYPE_IMAGE_USER:\n row = inflater.inflate(imageUserRowResId, null);\n holder.readStatus = (ImageSwitcher) row.findViewById(R.id.read_status);\n\n holder.readStatus.setFactory(new ViewSwitcher.ViewFactory() {\n @Override\n public View makeView() {\n ImageView imageView = new ImageView(mActivity.getApplicationContext());\n imageView.setScaleType(ImageView.ScaleType.CENTER);\n return imageView;\n }\n });\n holder.readStatus.setInAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_in));\n holder.readStatus.setOutAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_out));\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n\n break;\n\n case TYPE_IMAGE_FRIEND:\n row = inflater.inflate(imageFriendRowResId, null);\n\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n break;\n\n case TYPE_LOCATION_USER:\n row = inflater.inflate(locationUserResId, null);\n holder.readStatus = (ImageSwitcher) row.findViewById(R.id.read_status);\n holder.readStatus.setFactory(new ViewSwitcher.ViewFactory() {\n @Override\n public View makeView() {\n ImageView imageView = new ImageView(mActivity.getApplicationContext());\n imageView.setScaleType(ImageView.ScaleType.CENTER);\n return imageView;\n }\n });\n holder.readStatus.setInAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_in));\n holder.readStatus.setOutAnimation(AnimationUtils.loadAnimation(mActivity.getApplicationContext(),\n android.R.anim.fade_out));\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n\n break;\n\n case TYPE_LOCATION_FRIEND:\n row = inflater.inflate(locationFriendRowResId, null);\n\n holder.progressBar = (ProgressBar) row.findViewById(R.id.chat_sdk_progress_bar);\n holder.image = (ChatBubbleImageView) row.findViewById(R.id.chat_sdk_image);\n\n break;\n }\n\n return row;\n }",
"@Override\n\t\t\tpublic ViewHolder onCreateViewHolder(View itemView) {\n\t\t\t\treturn new MylisViewHoder(itemView);\n\t\t\t}",
"@Override\n public listAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n // create a new view\n LayoutInflater inflater = LayoutInflater.from(parent.getContext());\n View v = inflater.inflate(R.layout.row_layout, parent, false);\n // set the view's size, margins, paddings and layout parameters\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n\n View v = convertView;\n AirlinesBean airlinesBean = (AirlinesBean) getItem(position);\n\n int len = airlinesBean.getSize();\n\n ViewHold viewHold = null;\n if (v == null) {\n\n viewHold = new ViewHold();\n v = LayoutInflater.from(context).inflate(res, null);\n //第一次初始化的时候装进来\n viewHold.item_title = (TextView) v.findViewById(R.id.item_title);\n\n\n viewHold.tvExchange = (TextView) v.findViewById(R.id.tvExchange);\n\n\n viewHold.item_scroll = (CHTableScrollView) v.findViewById(R.id.item_scroll);\n\n viewHold.item_scroll_layout = (LinearLayout) v.findViewById(R.id.item_scroll_layout);\n\n viewHold.tvExchange.setOnClickListener(myClickListener);\n\n for (int c = 0; c < len; c++) {\n\n View linearLay = newView(R.layout.row_item_edit_view, airlinesBean.getCompanyId());\n\n TextView td = (TextView) linearLay.findViewById(R.id.ievEditView);\n\n td.setOnClickListener(clickListener);\n\n td.setTag(position + \"#\" + c);\n\n if (position + 1 == size) {\n\n td.setBackgroundResource(R.mipmap.icon_kuai_content_footer);\n } else {\n\n td.setBackgroundResource(R.mipmap.icon_kuai_content);\n }\n\n if (currentIndex == position) {\n\n if (x != -1) {\n\n if (x == c) {\n if (position + 1 == size) {\n td.setBackgroundResource(R.mipmap.icon_kuai_content_footer_check);\n\n } else {\n\n td.setBackgroundResource(R.mipmap.icon_kuai_content_check);\n }\n\n }\n\n }\n\n }\n\n viewHold.item_scroll_layout.addView(linearLay);\n }\n\n v.setTag(viewHold);\n\n addHViews(viewHold.item_scroll);\n\n } else {\n\n viewHold = (ViewHold) v.getTag();\n\n }\n\n viewHold.item_title.setText(airlinesBean.getCompanyName());\n\n viewHold.tvExchange.setTag(airlinesBean.getCompanyId());\n\n int childCount = viewHold.item_scroll_layout.getChildCount();\n\n for (int c = 0; c < childCount; c++) {\n\n View linearLay = viewHold.item_scroll_layout.getChildAt(c);\n\n TextView td = (TextView) linearLay.findViewById(R.id.ievEditView);\n\n td.setOnClickListener(clickListener);\n\n td.setTag(position + \"#\" + c);\n\n if (position + 1 == size) {\n\n td.setBackgroundResource(R.mipmap.icon_kuai_content_footer);\n } else {\n\n td.setBackgroundResource(R.mipmap.icon_kuai_content);\n }\n\n if (currentIndex == position) {\n\n if (x != -1) {\n\n if (x == c) {\n if (position + 1 == size) {\n td.setBackgroundResource(R.mipmap.icon_kuai_content_footer_check);\n\n } else {\n\n td.setBackgroundResource(R.mipmap.icon_kuai_content_check);\n }\n\n }\n\n }\n\n }\n\n }\n\n if (position + 1 == size) {\n\n viewHold.item_title.setBackgroundResource(R.mipmap.icon_kuai_name_footer);\n\n } else {\n viewHold.item_title.setBackgroundResource(R.mipmap.icon_kuai_name);\n\n }\n\n viewHold.item_title.setText(airlinesBean.getCompanyName());\n\n if (currentIndex == position) {\n\n viewHold.tvExchange.setBackgroundResource(R.mipmap.icon_kuai_duihuan_red);\n\n viewHold.tvExchange.setTextColor(getResources().getColor(R.color.white));\n\n } else {\n\n viewHold.tvExchange.setTextColor(getResources().getColor(R.color.integral_gray_afafaf));\n if (position + 1 == size) {\n\n\n viewHold.tvExchange.setBackgroundResource(R.mipmap.icon_kuai_duihuan_footer);\n\n } else {\n\n viewHold.tvExchange.setBackgroundResource(R.mipmap.icon_kuai_duihuan);\n\n }\n\n }\n\n return v;\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent,\n int viewType) {\n // create a new view\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.rowlayout, parent, false);\n // set the view's size, margins, paddings and layout parameters\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"public ViewHolder(View itemView, ItemClickListener listener) {\n super(itemView);\n this.listener = listener;\n\n layout = (LinearLayout) itemView.findViewById(R.id.oneAlbum_brief);\n imgAlbumCover = (ImageView) itemView.findViewById(R.id.draw_albumcover);\n tvArtist = (TextView) itemView.findViewById(R.id.tv_artistName);\n tvAlbum = (TextView) itemView.findViewById(R.id.tv_albumName);\n\n layout.setOnClickListener(this);\n // tvArtist.setOnClickListener(this);\n // tvAlbum.setOnClickListener(this);\n }",
"public ItemViewHolder(View itemView) {\n super(itemView);\n iv_image = (RoundedImageView)itemView.findViewById(R.id.item_photo);\n tv_title = (TextView)itemView.findViewById(R.id.item_title);\n tv_subtitle = (TextView)itemView.findViewById(R.id.item_subtitle);\n iv_image2 = (ImageView)itemView.findViewById(R.id.imageView1);\n }",
"public ViewHolder (View view){\n super(view);\n jView = view;\n //tvJoin = (TextView) view.findViewById(R.id.tvGroup);\n tvGroupTitle = view.findViewById(R.id.tvGroupTitle);\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n /*imgOverFlow = (ImageView) itemView.findViewById(R.id.overflow);*/\n bookThumbnail = (ImageView) itemView.findViewById(R.id.book_thumbnail);\n// bookAuthor= (TextView) itemView.findViewById(R.id.book_author);\n// bookTitle = (TextView) itemView.findViewById(R.id.book_title);\n }",
"@Override\n public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.rowlayout, parent, false);\n MyViewHolder vh = new MyViewHolder(v); // pass the view to View Holder\n return vh;\n }",
"@Override\n public TreatRecyclerAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,\n int viewType) {\n // create a new view\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.treat_item_row,\n parent, false);\n // set the view's size, margins, paddings and layout parameters\n //...\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"@Override\n public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_list, parent, false);\n MyViewHolder vh = new MyViewHolder(v); // pass the view to View Holder\n return vh;\n }",
"public Viewholder(@NonNull View itemView)\n {\n super(itemView);\n btnReadMore = itemView.findViewById(R.id.btn_read_more);\n sqView = itemView.findViewById(R.id.sqView);\n title = itemView.findViewById(R.id.textTitle);\n body = itemView.findViewById(R.id.textBody);\n }",
"public JobViewHolder(@NonNull View itemView) {\n super(itemView);\n\n Log.d(\"Testing\", \"JobViewHolder: \");\n mlogo = (ImageView) itemView.findViewById(R.id.job_logo);\n mBewerber_Kontakt = (TextView) itemView.findViewById(R.id.bewerber);\n mBundesland = (TextView) itemView.findViewById(R.id.bundesland);\n mEinsatzort = (TextView) itemView.findViewById(R.id.einsatzort);\n mStelle_Aktiv_bis = (TextView) itemView.findViewById(R.id.activbis);\n relativeLayout = itemView.findViewById(R.id.recycle_view);\n\n }",
"@Override\n public ListAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType)\n {\n // create a new view\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_row, parent, false);\n // set the view's size, margins, paddings and layout parameters\n\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"@Override\n\tpublic View getView(final int position, View row, ViewGroup parent) {\n\t\tif (row == null) {\n\t\t\tLayoutInflater inflater = context.getLayoutInflater();\n\t\t\trow = inflater.inflate(LayoutId, parent, false);\n\t\t}\n\n\t\treturn row;\n\t}",
"@Override\n\tpublic View newView(Context arg0, Cursor arg1, ViewGroup arg2) {\n\t\tView row = (View) inflater.inflate(R.layout.list_row, arg2, false);\n\t\treturn row;\n\t}",
"public void createViewItems(View v, final Member member) {\n TableLayout tableLayout = v.findViewById(R.id.member_information_table_layout);\n tableLayout.setGravity(Gravity.CENTER);\n /* Set the horizontal separating border. */\n tableLayout.addView(getBorderView());\n /* For phone */\n if((member.getIndividualPhone() == null || member.getIndividualPhone().isEmpty()) &&\n (member.getHouseholdPhone() == null || member.getHouseholdPhone().isEmpty())) {\n TextView noData = getNoDataTextView(getResources().getText(R.string.no_phone_number).toString());\n TableRow tableRow = getTableRow();\n tableRow.addView(noData);\n tableLayout.addView(tableRow);\n } else {\n /* Individual phone. */\n String phone = member.getIndividualPhone();\n if(phone != null && !phone.isEmpty()) {\n /* Phone number. */\n TextView individualPhoneView = getPhoneTextView(phone);\n /* SMS image button. */\n ImageButton individualPhoneImageButton = getPhoneImageButton(phone);\n /* Add all items to tablerow. */\n TableRow tableRow = getTableRow();\n tableRow.addView(individualPhoneView);\n tableRow.addView(individualPhoneImageButton);\n tableLayout.addView(tableRow, new TableLayout.LayoutParams(TableLayout.LayoutParams.MATCH_PARENT, TableLayout.LayoutParams.WRAP_CONTENT));\n /* Get underneath text. */\n TableRow underRow = getTableRow();\n underRow.addView(getIndividualHouseholdTextView(getResources().getText(R.string.list_display_options_individual).toString()));\n tableLayout.addView(underRow);\n }\n /* Home phone. */\n phone = member.getHouseholdPhone();\n if(phone != null && !phone.isEmpty()) {\n /* Phone number. */\n TextView homePhoneView = getPhoneTextView(phone);\n /* SMS image button. */\n ImageButton homePhoneImageButton = getPhoneImageButton(phone);\n /* Add all items to tablerow. */\n TableRow tableRow = getTableRow();\n tableRow.addView(homePhoneView);\n tableRow.addView(homePhoneImageButton);\n tableLayout.addView(tableRow);\n /* Get underneath text. */\n TableRow underRow = getTableRow();\n underRow.addView(getIndividualHouseholdTextView(getResources().getText(R.string.household).toString()));\n tableLayout.addView(underRow);\n }\n }\n /* For Email */\n /* Set the horizontal separating border. */\n tableLayout.addView(getBorderView());\n if((member.getIndividualEmail() == null || member.getIndividualEmail().isEmpty()) &&\n (member.getHouseholdEmail() == null || member.getHouseholdEmail().isEmpty())) {\n TextView noData = getNoDataTextView(getResources().getText(R.string.no_email_address).toString());\n TableRow tableRow = getTableRow();\n tableRow.addView(noData);\n tableLayout.addView(tableRow);\n } else {\n String email = member.getIndividualEmail();\n if(email != null && !email.isEmpty()) {\n /* Individual email text. */\n TextView individualEmailView = getEmailTextView(email);\n /* Under email text. */\n TextView individualTextView = getIndividualHouseholdTextView(getResources().getText(R.string.list_display_options_individual).toString());\n /* Add all items to tableRow. */\n TableRow tableRow = getTableRow();\n tableRow.addView(individualEmailView);\n tableLayout.addView(tableRow);\n TableRow underRow = getTableRow();\n underRow.addView(individualTextView);\n tableLayout.addView(underRow);\n }\n email = member.getHouseholdEmail();\n if(email != null && !email.isEmpty()) {\n /* Home email text. */\n TextView householdEmailView = getEmailTextView(email);\n /* Under email text. */\n TextView householdTextView = getIndividualHouseholdTextView(getResources().getText(R.string.household).toString());\n /* Add all items to tableRow. */\n TableRow tableRow = getTableRow();\n tableRow.addView(householdEmailView);\n TableRow underRow = getTableRow();\n underRow.addView(householdTextView);\n tableLayout.addView(underRow);\n }\n }\n /* Add address to the view. */\n tableLayout.addView(getBorderView());\n if(member.getStreetAddress() != null && member.getStreetAddress().length() > 0) {\n try {\n /* Get address and encode it. */\n final String strAddress = member.getStreetAddress();\n final String encodedAddress = URLEncoder.encode(strAddress, \"UTF-8\");\n TextView textView = getEmailTextView(member.getStreetAddress());\n textView.setPadding(45, 30, 0, 20);\n textView.setCompoundDrawablesWithIntrinsicBounds(R.drawable.marker_pin_blue, 0, 0, 0);\n Linkify.addLinks(textView, Linkify.MAP_ADDRESSES);\n /* Set the onclick listener. */\n textView.setMovementMethod(LinkMovementMethod.getInstance());\n textView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n initGoogleMap(encodedAddress);\n }\n });\n /* Add items to tablerow and then table. */\n TableRow tableRow = getTableRow();\n tableRow.addView(textView);\n tableLayout.addView(tableRow);\n } catch (Error | UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n } else {\n /* Add no address information. */\n TextView textView = getNoDataTextView(getResources().getText(R.string.no_address).toString());\n TableRow tableRow = getTableRow();\n tableRow.addView(textView);\n tableLayout.addView(tableRow);\n }\n }",
"public ViewHolder(View itemView) {\n // Stores the itemView in a public final member variable that can be used\n // to access the context from any ViewHolder instance.\n\n super(itemView);\n this.context = context;\n\n\n messageButton = (Button) itemView.findViewById(R.id.message_button);\n\n date_created=(TextView)itemView.findViewById(R.id.date_created);\n volume=(TextView)itemView.findViewById(R.id.volume);\n itemView.setOnClickListener(this);\n\n\n\n }",
"ViewHolder(View itemView) {\n super(itemView);\n // Initialize the views.\n titleTemaText = itemView.findViewById(R.id.titleDetail);\n userTemaText = itemView.findViewById(R.id.userDetail);\n cuerpoTemaText = itemView.findViewById(R.id.cuerpoTema);\n userRespuestaText = itemView.findViewById(R.id.usuarioRespuesta);\n cuerpoRespuestaText = itemView.findViewById(R.id.cuerpoRespuesta);\n ctgBackground = itemView.findViewById(R.id.ctgBackground);\n fondoRespuesta = itemView.findViewById(R.id.fondoRespuesta);\n }",
"public ViewHolder(@NonNull View view, Context ctx) {\n super(view);\n context = ctx;\n\n taskName = view.findViewById(R.id.item_name);\n taskDescription = itemView.findViewById(R.id.item_description);\n taskPriority = itemView.findViewById(R.id.item_priority);\n dateAdded = itemView.findViewById(R.id.item_date);\n\n editButton = itemView.findViewById(R.id.editButton);\n deleteButton = itemView.findViewById(R.id.deleteButton);\n\n editButton.setOnClickListener(this);\n deleteButton.setOnClickListener(this);\n\n }",
"@Override\n public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View view = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.item_row, null);\n\n MyViewHolder holder = new MyViewHolder(view);\n\n return holder;\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n Context context = parent.getContext();\n LayoutInflater inflater = LayoutInflater.from(context);\n // Inflate the custom layout -> use the xml file layouted for an Order row\n View searchResultsView = inflater.inflate(R.layout.result_row, parent, false);\n // Return a new holder instance\n return new ViewHolder(searchResultsView);\n }",
"private void renderer(int rv, ArrayList<ItemBox> list){\n recyclerView = findViewById(rv);\r\n recyclerView.setHasFixedSize(true);\r\n RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false);\r\n RecyclerView.Adapter adapter = new Itembox_Adapter(list, this, 1);\r\n recyclerView.setLayoutManager(layoutManager);\r\n recyclerView.setAdapter(adapter);\r\n }",
"public ViewHolder(View view){\n super(view);\n\n artImage = view.findViewById(R.id.thumbnail);\n title = view.findViewById(R.id.headline_title);\n byline = view.findViewById(R.id.byline);\n addDate = view.findViewById(R.id.date_added);\n subText = view.findViewById(R.id.sub_text);\n view.setOnClickListener(this);\n\n }",
"public ViewHolder(View view) {\n super(view);\n mView = view;\n mIdView = (TextView) view.findViewById(R.id.id);\n mContentView = (TextView) view.findViewById(R.id.content);\n mIconView = (ImageView) view.findViewById(R.id.browserIcon);\n }",
"@Override\n public CardAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,\n int viewType) {\n // create a new view\n View v = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.custom_row, parent, false);\n // set the view's size, margins, paddings and layout parameters\n context = parent.getContext();\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"@Override\n public CustomViewHolder onCreateViewHolder(ViewGroup parent, int type)\n {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_view, null, false);\n return new CustomViewHolder(view);\n }",
"ItemViewHolder(View itemView)\n {\n super(itemView);\n _cardView = (CardView)itemView.findViewById(R.id.exercise_cardView);\n _exerciseName = (TextView)itemView.findViewById(R.id.exercise_headingText);\n _reps = (TextView)itemView.findViewById(R.id.exercise_repsText);\n _image = (ImageView)itemView.findViewById(R.id.exercise_image);\n }",
"private void setupItemView(View view, NewCollectedItem item) {\n if (item != null) {\n TextView nameText = view.findViewById(R.id.collected_name);\n TextView heightText = view.findViewById(R.id.collected_height);\n TextView pointsText = view.findViewById(R.id.collected_points);\n TextView positionText = view.findViewById(R.id.collected_position);\n TextView dateText = view.findViewById(R.id.collected_date);\n\n nameText.setText(item.getName());\n heightText.setText(mContext.getResources().getString(R.string.height_display,\n UIUtils.IntegerConvert(item.getHeight())));\n positionText.setText(mContext.getResources().getString(R.string.position_display,\n item.getLongitude(), item.getLatitude()));\n pointsText.setText(mContext.getResources().getString(R.string.points_display,\n UIUtils.IntegerConvert(item.getPoints())));\n dateText.setText(mContext.getResources().getString(R.string.date_display,\n item.getDate()));\n\n if (item.isTopInCountry()) {\n view.findViewById(R.id.collected_trophy).setVisibility(View.VISIBLE);\n }\n else {\n view.findViewById(R.id.collected_trophy).setVisibility(View.INVISIBLE);\n }\n\n positionText.setVisibility(View.GONE);\n dateText.setVisibility(View.GONE);\n setCountryFlag(view, item.getCountry());\n }\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View view = LayoutInflater.inflate(R.layout.exam_row, parent, false);\n return new ViewHolder(view);\n }",
"@Override\n\tpublic IItemView createCell(Context context, ViewGroup root) {\n\t\treturn this.newCellFromXml(context, R.layout.dynamic_list_item, root);\n\t}",
"@Override\n public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType)\n {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.rowlayout, parent, false);\n // set the view's size, margins, paddings and layout parameters\n MyViewHolder vh = new MyViewHolder(v); // pass the view to View Holder\n return vh;\n }",
"public EntrepriseHolder(@NonNull View itemView) {\n super(itemView);\n nom = itemView.findViewById(R.id.afficheNom);\n adresse = itemView.findViewById(R.id.afficheAdresse);\n ville = itemView.findViewById(R.id.afficheVille);\n nature = itemView.findViewById(R.id.afficheNature);\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View item = LayoutInflater.from(parent.getContext()).inflate(R.layout.item, parent, false);\n// Pasar la vista (item.xml) al ViewHolder\n ViewHolder viewHolder = new ViewHolder(item);\n return viewHolder;\n }",
"PaperHolder(android.content.Context context, View itemView) {\n super(itemView);\n\n mPapersAuthors = (LinearLayout) itemView.findViewById(R.id.authors);\n mPaperTitle = (TextView) itemView.findViewById(R.id.title);\n mSubscriptionHolder = (GridLayout) itemView.findViewById(R.id.colors);\n\n mSubscriptionHolder.setColumnCount(4);\n mSubscriptionHolder.setRowCount(2);\n itemView.setOnClickListener(this);\n\n itemView.setOnLongClickListener(view -> {\n if (mParentFragment != null) {\n mPaperDialogFragment = new PaperDialogFragment().newInstance(mCardViewToInflate, mParentFragment, mPaper,\n mPapersPosition);\n\n mPaperDialogFragment.setTargetFragment(mParentFragment, 6);\n\n mPaperDialogFragment.show(mParentFragment.getFragmentManager(), \"dialog\");\n return true;\n }\n return true;\n });\n\n mContext = context;\n }",
"public View getView(int position, View convertView, ViewGroup parent) {\n\t\tRowView view;\n\t\tif (null == convertView) {\n\t\t\t// if there isn't one to recycle, init a new view\n\t\t\t// view = new TextView(this.mContext);\n\t\t\t// view = new Button(mContext);\n\t\t\t// view.setTextSize(18); // Properties where all views are the same\n\t\t\t// view = new ImageView(this.mContext);\n\t\t\t// view.setImageResource(R.drawable.ic_launcher);\n\t\t\tview = new RowView(this.mContext);\n\t\t} else {\n\t\t\t// use the recycled view (convert this view)\n\t\t\t// view = (TextView) convertView;\n\t\t\t// view = (Button) convertView;\n\t\t\t// view = (ImageView) convertView;\n\t\t\tview = (RowView) convertView;\n\t\t}\n\t\t// Properties where each view is different\n\t\t// view.setText(\" Row \" + position);\n\t\t// view.setTextColor(Color.rgb(position * 10, 255 - position * 10,\n\t\t// 200));\n\t\tview.setLeftText(\"\" + (position + 1) + \".\");\n\t\tview.setRightText(mNamesArray[position % 12]);\n\n\t\treturn view;\n\t}",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n RelativeLayout layout = (RelativeLayout) LayoutInflater.from(parent.getContext())\n .inflate(R.layout.inventory_cell, parent, false);\n ViewHolder vh = new ViewHolder(layout);\n return vh;\n }",
"private View getCustomView(int position, View convertView, ViewGroup parent) {\n\n /********** Inflate spinner_rows.xml file for each row ( Defined below ) ************/\n View row = inflater.inflate(R.layout.spinner_item_white, parent, false);\n\n TextView tv_item_name = (TextView) row.findViewById(R.id.tv_item_name);\n// ImageView iv_spinner_icon = (ImageView) row.findViewById(R.id.iv_spinner_icon);\n\n tv_item_name.setText(arrayList.get(position));\n// iv_spinner_icon.setImageResource(arrayIcons.getResourceId(position, -1));\n return row;\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Room r = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_room, parent, false);\n }\n // Lookup view for data population\n TextView nr = (TextView) convertView.findViewById(R.id.item_room_number);\n // Populate the data into the template view using the data object\n nr.setText(r.getId()+\"\");\n // Return the completed view to render on screen\n return convertView;\n }",
"public FoodHolder(@NonNull View itemView) {\n super(itemView);\n name = itemView.findViewById(R.id.textview_food_name);\n sugars = itemView.findViewById(R.id.textview_food_grams_sugar);\n foodType = itemView.findViewById(R.id.textview_food_foodtype);\n viewBackground = itemView.findViewById(R.id.layout_single_food_background);\n viewForeground = itemView.findViewById(R.id.layout_single_food_foreground);\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.row_job_list, parent, false);\n // set the view's size, margins, paddings and layout parameters\n ViewHolder vh = new ViewHolder(v);\n return vh;\n }",
"protected abstract View getResultItemView(final RepeatResultItem item);",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View rowView = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.shopping_list_row, parent, false);\n\n return new ViewHolder(rowView);\n }",
"public ViewHolder(View itemView) {\n super(itemView);\n\n mView = itemView;\n mUsernameTv = (TextView) mView.findViewById(R.id.usernameTv);\n mEmailTv = (TextView) mView.findViewById(R.id.emailTv);\n mFriendIv = (ImageView) mView.findViewById(R.id.friendIv);\n mYouTv = (TextView) mView.findViewById(R.id.youTv);\n\n mIsFriend = false;\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup arg0, int arg1) {\n\n return new ViewHolder(new TextView(RecyclerViewActivity.this)) {\n\n };\n }",
"@Override\n public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n LayoutInflater inflater = LayoutInflater.from(parent.getContext());\n View v = inflater.inflate(R.layout.mainactivity_list_row, parent, false);\n\n return new ViewHolder(v);\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Game game = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.row_game, parent, false);\n }\n // Lookup view for data population\n TextView gameName = (TextView) convertView.findViewById(R.id.gameName);\n TextView gameId = (TextView) convertView.findViewById(R.id.gameId);\n // Populate the data into the template view using the data object\n gameName.setText(game.name);\n gameId.setText(game.ID);\n // Return the completed view to render on screen\n return convertView;\n }",
"public ViewHolder(@NonNull View itemView) {\n super(itemView);\n ivProfileImage = itemView.findViewById(R.id.ivProfileImage);\n tvBody = itemView.findViewById(R.id.tvBody);\n tvScreenName = itemView.findViewById(R.id.tvScreenName);\n tvTimeAgo = itemView.findViewById(R.id.tvTimeAgo);\n ivMedia = itemView.findViewById(R.id.ivMedia);\n rlTweet = itemView.findViewById(R.id.rlTweet);\n btnReply = itemView.findViewById(R.id.btnReply);\n tvRetweets = itemView.findViewById(R.id.tvRetweets);\n tvFavorites = itemView.findViewById(R.id.tvFavorites);\n }",
"@Override\n public View getView(final int position, View convertView, ViewGroup parent) {\n final Holder holder=new Holder();\n\n\n\n AuctionBean users = list.get(position);\n convertView = inflater.inflate(R.layout.customelayout, null);\n\n holder.imgThumbnail = (ImageView) convertView.findViewById(R.id.imageview);\n holder.top_sr_no = (TextView) convertView.findViewById(R.id.textsrno);\n holder.bottom_sr_no = (TextView) convertView.findViewById(R.id.textbottom_srno);\n\n return convertView;\n }",
"public ViewHolder(@NonNull View itemView) {\n\n super(itemView);\n mView = itemView;\n\n //This views holds on activity - have actions -\n btn_blog_like = mView.findViewById(R.id.blog_like);\n blogCommentBtn = mView.findViewById(R.id.blog_comment_icon);\n\n }",
"public MyViewHolder(final View itemView) {\n super(itemView);\n\n\n title = (TextView) itemView.findViewById(R.id.title_play_list);\n thumbnail = (ImageView) itemView.findViewById(R.id.thumbnail_play_list);\n\n\n }",
"@Override\n public rViewHolder onCreateViewHolder(ViewGroup parent, int viewType)\n {\n View view = mInflater.inflate(R.layout.recycler_row, parent, false);\n return new rViewHolder(view);\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n Patient r = getItem(position);\n // Check if an existing view is being reused, otherwise inflate the view\n if (convertView == null) {\n convertView = LayoutInflater.from(getContext()).inflate(R.layout.item_room, parent, false);\n }\n // Lookup view for data population\n TextView nr = (TextView) convertView.findViewById(R.id.item_room_number);\n // Populate the data into the template view using the data object\n nr.setText(r.getName());\n // Return the completed view to render on screen\n return convertView;\n }",
"public ViewHolder(View view) {\n super(view);\n mView = view;\n mTextviewTeamNumber = (TextView) view.findViewById(R.id.textviewTeamNumber);\n mImageViewTeamLogo = (ImageView) view.findViewById(R.id.imageViewTeamLogo);\n mTextViewTeamName = (TextView) view.findViewById(R.id.textViewTeamName);\n mTextViewPlayedGameNumber = (TextView) view.findViewById(R.id.textViewPlayedGameNumber);\n mTextViewTotalPoint = (TextView) view.findViewById(R.id.textViewTotalPoint);\n }",
"@Override\n\tpublic View getView(int position, View childSec, ViewGroup parent) {\n\t\tHolder mHolder;\n\t\tLayoutInflater layoutInflater;\n\t\tif (childSec == null) {\n\t\t\tlayoutInflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n\t\t\tchildSec = layoutInflater.inflate(R.layout.listcell2, null);\n\t\t\tmHolder = new Holder();\n\t\t\tmHolder.txt_id2 = (TextView) childSec.findViewById(R.id.txt_id2);\n\t\t\tmHolder.txt_place = (TextView) childSec.findViewById(R.id.txt_place);\n\t\t\tmHolder.txt_time = (TextView) childSec.findViewById(R.id.txt_time);\n\t\t\tchildSec.setTag(mHolder);\n\t\t} else {\n\t\t\tmHolder = (Holder) childSec.getTag();\n\t\t}\n\t\tmHolder.txt_id2.setText(id.get(position));\n\t\tmHolder.txt_place.setText(place.get(position));\n\t\tmHolder.txt_time.setText(time.get(position));\n\n\t\treturn childSec;\n\t}",
"@Override\n\tpublic void viewItem() {\n\t\t\n\t}",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n return initView(position, convertView, parent);\n }",
"@Override\n public MyHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n View v = LayoutInflater.from(parent.getContext())\n .inflate(R.layout.rv_item,parent,false);\n return new MyHolder(v);\n }",
"@Override\r\n public View getView(int position, View convertView, ViewGroup parent) {\n GridItem item;\r\n if (convertView == null) {\r\n item = new GridItem(mContext);\r\n item.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,\r\n LayoutParams.FILL_PARENT));\r\n } else {\r\n item = (GridItem) convertView;\r\n }\r\n item.setImgResId(getItem(position).icon);\r\n item.setAppname(getItem(position).title);\r\n// item.setChecked(mSelectMap.get(position) == null ? false\r\n// : mSelectMap.get(position));\r\n item.setChecked(b[position]);\r\n mActionText.setText(formatString(checkedCount()));\r\n return item;\r\n }",
"@Override\n public View getView(int position, View convertView, ViewGroup parent) {\n View view = convertView;\n //se nao recebeu um layout para reutilizar deve inflar um\n if(view == null) {\n //um inflater transforma um layout em uma view\n LayoutInflater inflater = (LayoutInflater) context.getSystemService\n (Context.LAYOUT_INFLATER_SERVICE);\n view = inflater.inflate(R.layout.available_flight_adapter_row, parent, false);\n\n ImageView flightImage = (ImageView) view.findViewById(R.id.available_flight_image);\n TextView flightOrigin = (TextView) view.findViewById(R.id.available_flight_origin);\n TextView flightData = (TextView) view.findViewById(R.id.available_flight_data);\n TextView flightArrival = (TextView) view.findViewById(R.id.available_flight_arrival);\n TextView flightDescription = (TextView) view.findViewById(R.id.available_flight_description);\n //faz cache dos widgets instanciados na tag da view para reusar quando houver reciclagem\n view.setTag(new AvailableFlightsViewHolder(\n flightImage,\n flightOrigin,\n flightData,\n flightArrival,\n flightDescription\n ));\n }\n //usa os widgets cacheados na view reciclada\n AvailableFlightsViewHolder holder = (AvailableFlightsViewHolder) view.getTag();\n //carrega os novos valores\n Drawable drawable = Util.getDrawable(context, flightList[position].getImage());\n holder.getImage().setImageDrawable(drawable);\n holder.getOrigin().setText(flightList[position].getOrigin());\n holder.getData().setText(flightList[position].getName() +\": \"+ flightList[position].getCarrier());\n holder.getArrival().setText(flightList[position].getArrival());\n holder.getDescription().setText(flightList[position].getDescription());\n\n return view;\n }",
"private void createTileViews() {\n\t\tfor (short row = 0; row < gridSize; row++) {\n\t\t\tfor (short column = 0; column < gridSize; column++) {\n\t\t\t\tTileView tv = new TileView(context, row, column);\n\t\t\t\ttileViews.add(tv);\n\t\t\t\ttableRow.get(row).addView(tv);\n\t\t\t} // end column\n\t\t\tparentLayout.addView(tableRow.get(row));\n\t\t} // end row\n\n\t}",
"@Override\n\tpublic View getView(final int position, View convertView, ViewGroup parent) {\n\n\t\tView vi = convertView;\n\n\t\tViewHolder viewHolder;\n\n\t\tif (convertView == null) {\n /******\n * Inflate tabitem.xml file for each row ( Defined below )\n *******/\n vi = inflater.inflate(R.layout.create_docket_page_machine_one_row_item, parent, false);\n\n /******\n * View Holder Object to contain tabitem.xml file elements\n ******/\n viewHolder = new ViewHolder();\n viewHolder.machine_type = (TextView) vi.findViewById(R.id.machine_type);\n viewHolder.machine_name = (TextView) vi.findViewById(R.id.machine_name);\n viewHolder.machine_model = (TextView) vi.findViewById(R.id.machine_model);\n viewHolder.machine_sl_no = (TextView) vi.findViewById(R.id.machine_sl_no);\n viewHolder.sparePartsLayout = (LinearLayout) vi.findViewById(R.id.spare_parts_wrapper);\n viewHolder.mLinearSpareDetails = (LinearLayout) vi.findViewById(R.id.spare_parts_detail);\n viewHolder.addSpareParts = (ImageView) vi.findViewById(R.id.add_spare_parts);\n viewHolder.viewDocuments = (ImageView) vi.findViewById(R.id.view_documents);\n\n viewHolder.deleteMachine = (ImageView) vi.findViewById(R.id.delete_machine);\n viewHolder.pickingImage = (ImageView) vi.findViewById(R.id.add_pictures);\n viewHolder.workDone = (ImageView) vi.findViewById(R.id.work_done);\n viewHolder.create_docket_heading = (LinearLayout) vi.findViewById(R.id.create_docket_heading);\n if (docketMachineArray.size() > 0) {\n if (sparePartsArray.size() > 0\n ) {\n Log.e(\"TAG\", \"values >> \" + sparePartsArray.size());\n viewHolder.sparePartsLayout.setVisibility(View.VISIBLE);\n\n for (int j = 0; j < sparePartsArray.size(); j++) {\n /**\n * inflate items/ add items in linear layout instead of\n * listview\n */\n try {\n //Log.e(\"TAG\", \"s >> \" + sparePartsArray.get(j).getMachineId());\n Log.e(\"TAG\", \"sm >> \" + sparePartsArray.get(j).getMachineId());\n Log.e(\"TAG\", \"dm >> \" + docketMachineArray.get(position).getMachineId());\n\n if (sparePartsArray.get(j).getMachineId().equals(docketMachineArray.get(position).getMachineId())) {\n\n Log.e(\"TAG\", \"size of i >> \" + j);\n LayoutInflater inflater1 = null;\n inflater1 = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n View mLinearView = inflater1.inflate(R.layout.spare_parts_details_one_row_item, null);\n\n /**\n * getting id of row.xml\n */\n TextView spareId = (TextView) mLinearView.findViewById(R.id.spare_parts_id);\n TextView description = (TextView) mLinearView.findViewById(R.id.spare_description);\n TextView quantity = (TextView) mLinearView.findViewById(R.id.spare_quantity);\n TextView unitsales = (TextView) mLinearView.findViewById(R.id.spare_unit_sales);\n ImageView deleteSpareParts = (ImageView) mLinearView.findViewById(R.id.delete_spare_parts);\n /**\n * set item into row\n */\n String spareIdText = sparePartsArray.get(j).getSparePartsId();\n String descriptionText = sparePartsArray.get(j).getDescription();\n String quantityText = sparePartsArray.get(j).getQuantity();\n String unitsalesText = sparePartsArray.get(j).getUnitSales();\n\n spareId.setText(spareIdText);\n description.setText(descriptionText);\n quantity.setText(quantityText);\n unitsales.setText(unitsalesText);\n pos = j;\n\n deleteSpareParts.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n ((CreateDocketActivityPart2) activity).deleteSpareParts(pos);\n }\n });\n\n /**\n * add view in top linear\n */\n\n viewHolder.mLinearSpareDetails.addView(mLinearView);\n }\n } catch (Exception e) {\n Log.e(\"exceptionCase\", e.toString());\n }\n\n }\n\n } else {\n viewHolder.sparePartsLayout.setVisibility(View.GONE);\n // sparePartsArray.remove((sparePartsArray.size() - 1));\n }\n }\n\n\t\t\t/************ Set holder with LayoutInflater ************/\n\t\t\tvi.setTag(viewHolder);\n\t\t} else {\n viewHolder = (ViewHolder) vi.getTag();\n }\n\t//Log.e(\"pos\",pos+\"\");\n\t\tif (docketMachineArray.size() <= 0) {\n\t\t\tviewHolder.machine_type.setText(\"No Records Found\");\n\t\t\tviewHolder.machine_name.setVisibility(View.GONE);\n\t\t\tviewHolder.machine_model.setVisibility(View.GONE);\n\t\t\tviewHolder.machine_sl_no.setVisibility(View.GONE);\n\n\t\t\tviewHolder.addSpareParts.setVisibility(View.GONE);\n\t\t\tviewHolder.viewDocuments.setVisibility(View.GONE);\n\n\t\t\tviewHolder.deleteMachine.setVisibility(View.GONE);\n\t\t\tviewHolder.pickingImage.setVisibility(View.GONE);\n\t\t\tviewHolder.workDone.setVisibility(View.GONE);\n\n\t\t} else {\n /***** Get each Model object from Arraylist ********/\n tmpValues = null;\n\n tmpValues = docketMachineArray.get(position);\n\n /************ Set Model values in Holder elements ***********/\n\n viewHolder.machine_name.setVisibility(View.VISIBLE);\n viewHolder.machine_model.setVisibility(View.VISIBLE);\n viewHolder.machine_sl_no.setVisibility(View.VISIBLE);\n\n viewHolder.addSpareParts.setVisibility(View.VISIBLE);\n viewHolder.viewDocuments.setVisibility(View.VISIBLE);\n\n viewHolder.deleteMachine.setVisibility(View.VISIBLE);\n viewHolder.pickingImage.setVisibility(View.VISIBLE);\n viewHolder.workDone.setVisibility(View.VISIBLE);\n\n viewHolder.machine_type.setText(tmpValues.getMachineType());\n viewHolder.machine_name.setText(tmpValues.getMachineName());\n viewHolder.machine_model.setText(tmpValues.getMachineModel());\n viewHolder.machine_sl_no.setText(tmpValues.getMachineSlNo());\n\n Log.e(\"TAG\", \"job job detail id >> \" + tmpValues.getJobDetailId());\n\n if (db.getWorkDoneForJobBoolean(tmpValues.getJobDetailId())) {\n viewHolder.create_docket_heading.setBackgroundResource(R.color.colorNoWork);\n Log.e(\"TAG\", \"In Red\");\n } else {\n viewHolder.create_docket_heading.setBackgroundResource(R.color.colorWork);\n Log.e(\"TAG\", \"In Green\");\n }\n\n Log.e(\"TAG\", \"Size >> \" + sparePartsArray.size());\n\n Log.e(\"TAG\", \"Machine Id >> \" + tmpValues.getMachineId());\n\n viewHolder.addSpareParts.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View arg0) {\n // TODO Auto-generated method stub\n ((CreateDocketActivityPart2) activity).openPopUpForSpareParts(position);\n }\n });\n\n viewHolder.viewDocuments.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View arg0) {\n // TODO Auto-generated method stub\n ((CreateDocketActivityPart2) activity).openMachineDetails(position);\n }\n });\n\n viewHolder.deleteMachine.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n\n ((CreateDocketActivityPart2) activity).deleteMachineItem(position);\n }\n });\n\n viewHolder.pickingImage.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n\n ((CreateDocketActivityPart2) activity).openGalleryForPickingImage(position);\n }\n });\n\n viewHolder.workDone.setOnClickListener(new OnClickListener() {\n\n @Override\n public void onClick(View v) {\n // TODO Auto-generated method stub\n ((CreateDocketActivityPart2) activity).openPopUpForWorkDone(position);\n }\n });\n pos++;\n Log.e(\"item\",pos+\"\");\n\n //if (k == position){\n// if (sparePartsArray.size() > 0\n// ) {\n// Log.e(\"TAG\", \"values >> \" + sparePartsArray.get(0).getDescription());\n// viewHolder.sparePartsLayout.setVisibility(View.VISIBLE);\n//\n// for (int j = 0; j < sparePartsArray.size(); j++) {\n// /**\n// * inflate items/ add items in linear layout instead of\n// * listview\n// */\n// try {\n// //Log.e(\"TAG\", \"s >> \" + sparePartsArray.get(j).getMachineId());\n// Log.e(\"TAG\", \"sm >> \" + sparePartsArray.get(j).getMachineId());\n// Log.e(\"TAG\", \"dm >> \" + docketMachineArray.get(position).getMachineId());\n//\n// if (sparePartsArray.get(j).getMachineId().equals(docketMachineArray.get(position).getMachineId())) {\n//\n// Log.e(\"TAG\", \"size of i >> \" + j);\n// LayoutInflater inflater1 = null;\n// inflater1 = (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\n// View mLinearView = inflater1.inflate(R.layout.spare_parts_details_one_row_item, null);\n//\n// /**\n// * getting id of row.xml\n// */\n// TextView spareId = (TextView) mLinearView.findViewById(R.id.spare_parts_id);\n// TextView description = (TextView) mLinearView.findViewById(R.id.spare_description);\n// TextView quantity = (TextView) mLinearView.findViewById(R.id.spare_quantity);\n// TextView unitsales = (TextView) mLinearView.findViewById(R.id.spare_unit_sales);\n// ImageView deleteSpareParts = (ImageView) mLinearView.findViewById(R.id.delete_spare_parts);\n// /**\n// * set item into row\n// */\n// String spareIdText = sparePartsArray.get(j).getSparePartsId();\n// String descriptionText = sparePartsArray.get(j).getDescription();\n// String quantityText = sparePartsArray.get(j).getQuantity();\n// String unitsalesText = sparePartsArray.get(j).getUnitSales();\n//\n// spareId.setText(spareIdText);\n// description.setText(descriptionText);\n// quantity.setText(quantityText);\n// unitsales.setText(unitsalesText);\n// pos = j;\n//\n// deleteSpareParts.setOnClickListener(new OnClickListener() {\n//\n// @Override\n// public void onClick(View v) {\n// // TODO Auto-generated method stub\n// ((CreateDocketActivityPart2) activity).deleteSpareParts(pos);\n// }\n// });\n//\n// /**\n// * add view in top linear\n// */\n//\n// viewHolder.mLinearSpareDetails.addView(mLinearView);\n// }\n// } catch (Exception e) {\n// Log.e(\"exceptionCase\", e.toString());\n// }\n//\n// }\n//\n// } else {\n// viewHolder.sparePartsLayout.setVisibility(View.GONE);\n// // sparePartsArray.remove((sparePartsArray.size() - 1));\n// }\n // k++;\n // }\n\t\t\t//pos++;\n\n\t\t\tif (position % 2 == 1) {\n\t\t\t\tvi.setBackgroundColor(Color.parseColor(\"#f6f6f6\"));\n\t\t\t} else {\n\t\t\t\tvi.setBackgroundColor(Color.parseColor(\"#ffffff\"));\n\t\t\t}\n\t\t}\n\t\treturn vi;\n\t}"
] | [
"0.70915544",
"0.6941513",
"0.68235373",
"0.67883724",
"0.67834854",
"0.6767372",
"0.6720933",
"0.669092",
"0.6660669",
"0.66044927",
"0.6590654",
"0.6583078",
"0.65653074",
"0.6560743",
"0.651282",
"0.65036964",
"0.6493885",
"0.6480851",
"0.6447465",
"0.642153",
"0.6408075",
"0.6407493",
"0.63837916",
"0.63774484",
"0.6372947",
"0.63712573",
"0.63675123",
"0.6367075",
"0.63638467",
"0.6363661",
"0.6358827",
"0.63557",
"0.6348826",
"0.6343901",
"0.6325331",
"0.6311725",
"0.63078475",
"0.6301603",
"0.63003385",
"0.62956214",
"0.6295263",
"0.62543845",
"0.62490654",
"0.62475073",
"0.6225446",
"0.6222994",
"0.62213475",
"0.62150276",
"0.620878",
"0.6208275",
"0.62053734",
"0.61932164",
"0.61886054",
"0.6186758",
"0.61830723",
"0.6182186",
"0.6178224",
"0.6178153",
"0.6165735",
"0.6154255",
"0.6152422",
"0.6143643",
"0.6134049",
"0.6133537",
"0.6130455",
"0.6126106",
"0.61217713",
"0.6121371",
"0.6121093",
"0.610979",
"0.61034465",
"0.61005014",
"0.61002856",
"0.6096286",
"0.60898",
"0.6088226",
"0.6087541",
"0.60736036",
"0.60674894",
"0.6061781",
"0.6060255",
"0.60561025",
"0.6051325",
"0.60432845",
"0.6018104",
"0.6004198",
"0.5991632",
"0.59854186",
"0.5982931",
"0.59819853",
"0.59807765",
"0.5976074",
"0.59510726",
"0.59483933",
"0.5943047",
"0.5939307",
"0.5933914",
"0.5929384",
"0.5922021",
"0.59203327"
] | 0.6249638 | 42 |
1 = seen, 0 = not seen | public Conversation() {} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean hasCounter();",
"boolean seen(Graph.Vertex u) {\n\t\treturn getVertex(u).seen;\n\t}",
"public int check(){\r\n\r\n\treturn count ++;\r\n\t\r\n}",
"public boolean isSeen() {\n return seen;\n }",
"boolean hasN();",
"boolean hasN();",
"boolean hasUnknown1();",
"boolean hasUnknown1();",
"boolean hasUnknown1();",
"boolean hasUnknown1();",
"boolean hasUnknown1();",
"boolean hasUnknown1();",
"static int missingNumber(int[] nums) {\n int ret = 0;\n for(int i = 0; i < nums.length; i++) {\n ret ^= i;\n ret ^= nums[i];\n }\n return ret^=nums.length;\n }",
"static void findTwoMissingNumber(int a[]) {\n int miss1 = 0;\n int miss2;\n int miss1miss2 = 0;\n\n int size = a.length;\n for (int i = 0; i < size; i++) {\n miss1miss2 ^= ((i + 1) ^ a[i]);\n }\n\n miss1miss2 ^= (size + 1);\n miss1miss2 ^= (size + 2);\n\n int diff = miss1miss2 & (-miss1miss2);\n\n for (int i = 0; i < size; i++) {\n if (((i + 1) & diff) > 0)\n miss1 ^= (i + 1);\n\n if ((a[i] & diff) > 0)\n miss1 ^= a[i];\n }\n\n if (((size + 1) ^ diff) > 0)\n miss1 ^= (size + 1);\n\n if (((size + 2) ^ diff) > 0)\n miss1 ^= (size + 2);\n\n miss2 = miss1miss2 ^ miss1;\n\n System.out.println(miss1);\n System.out.println(miss2);\n }",
"int getNumberOfDetectedDuplicates();",
"boolean hasCount();",
"boolean isUnique();",
"boolean isCounting();",
"boolean hasUnknown2();",
"boolean hasUnknown2();",
"boolean hasUnknown2();",
"void checkRepeated() {\r\n Move check = listOfMoves.peek();\r\n if (map.containsKey(check)) {\r\n _repeated = true;\r\n _winner = map.get(check.from()).opponent();\r\n }\r\n _repeated = false;\r\n }",
"public boolean haveCount () ;",
"static int findOneMissingNumber(int a[]) {\n int number = 0;\n int size = a.length;\n for (int i = 0; i < size; i++)\n number ^= ((i + 1) ^ a[i]);\n number ^= (size + 1);\n return number;\n }",
"boolean isIsUnique();",
"private static void missRepeat1(int[] a) {\n\t\tint miss = -1;\n\t\tint repeat = -1;\n\t\tint[] b = new int[a.length];\n\t\t\n\t\tfor(int x : a) {\n\t\t\tif(b[x-1] != 0) {\n\t\t\t\trepeat = x;\n\t\t\t}\n\t\t\tb[x-1]++;\n\t\t}\n\t\t\n\t\tfor(int i=0; i<b.length; i++) {\n\t\t\tif(b[i]==0) {\n\t\t\t\tmiss = i+1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(repeat + \" \" + miss);\n\t}",
"boolean hasUnknown();",
"@Override\r\n\tpublic int dupMovieChk(Search search) throws Exception {\n\t\treturn 0;\r\n\t}",
"int getSeenInfoCount();",
"public boolean isUnique();",
"boolean hasS1();",
"public static int missingNumberBitManipulation(int[] nums) {\n if (nums == null || nums.length == 0) return -1;\n\n int missing = nums.length;\n for (int i = 0; i < nums.length; i++) {\n missing ^= i ^ nums[i];\n }\n return missing;\n }",
"private static void findMultipleMissing(int[] arr, int count) {\n int missingCount = count - arr.length;\n BitSet bitSet = new BitSet(count);\n\n for (int i : arr) {\n bitSet.set(i - 1);\n }\n\n int lastMissingIndex = 0;\n for (int i = 0; i < missingCount; i++) {\n lastMissingIndex = bitSet.nextClearBit(lastMissingIndex);\n System.out.println(++lastMissingIndex);\n }\n }",
"boolean hasSequenceNumber();",
"private boolean visited(int hashCode){\n \t\t//.add returns true if hashCode was added (meaning hashCode haven't been added before)\n \t\tif(visited.add(hashCode))\n \t\t\treturn false;\n \t\telse\n \t\t\treturn true;\n \t}",
"public boolean isRepeated()\n {\n return start != end;\n }",
"public static void detectDuplicateNumbersM1(int[] numbersToDetect){\n map = new HashMap<Integer,Integer>();\n logger.info(\"hashmap is created\");\n for (int j : numbersToDetect) {\n if (map.get(j) == null) {\n logger.info(j + \" is added map\");\n map.put(j, 1);\n } else {\n logger.info(j + \" detected second time\");\n System.out.println(\"duplicated number: \" + j);\n break;\n }\n }\n }",
"boolean repeatedPosition() {\r\n if (_repeated && _winner == BLACK) {\r\n System.out.println(\"* Black wins\");\r\n } else if (_repeated && _winner == WHITE) {\r\n System.out.println(\"* White wins\");\r\n }\r\n return _repeated;\r\n }",
"static int sockMerchant(int n, int[] ar) {\n int count = 0;\n HashSet<Integer> set = new HashSet<Integer>();\n // int sock = 0;\n for (int i = 0; i < ar.length-1; i++) {\n int sock = ar[i];\n // System.out.print(\" \"+sock+\" \");\n if (set.contains(sock)) {\n // block of code to be executed if set.contains(sock) is true\n // System.out.print(\" T \");\n set.remove(sock);\n count++; \n } else { \n // block of code to be executed if set.contains(sock) is false\n // System.out.print(\" F \");\n set.add(sock);\n } \n }\n return count;\n }",
"boolean hasStableIds();",
"public boolean isUnique(String s){\n // int[] visited = new int[256]; // O:256\n int[] visited = new int[8]; // int = 4 bytes = 32 bits, 8 ints = 32 bytes = 256 bits\n char[] array = s.toCharArray();\n for(char c:array){\n // for a value c in range of 0 - 256\n // it maps to the int at c/32 as index\n // it also maps the c%32 as the index of bits\n if(((visited[c/32] >>> (c%32)) & 1) != 0){\n // bit-tester of the k-th bits, k = c%32\n return false;\n }\n // bit-setter to 1 in the k-th bits\n visited[c/32] |= 1 << (c%32);\n }\n return true;\n }",
"public boolean seen( K key ) {\n return map.containsKey( key );\n }",
"public int isDuplicate(Member m) {\r\n\t\tfor(int i=0; i<ms.size();i++) {\r\n\t\t\tif(ms.get(i).getNumber().equals(m.getNumber())) {return i;}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"private boolean tryCounterExample(BDD reachableStates){\n\t\tBDD counterExample = reachableStates.andWith(buildEndGame());\n\t\t\n\t\treturn counterExample.satCount(this.dimension * this.dimension - 1) == 0 ? true : false;\n\t}",
"public void testFindDuplicates() {\r\n System.out.println(\"findDuplicates\");\r\n \r\n List<String> elements = new ArrayList<>();\r\n elements.add(\"foo\");\r\n elements.add(\"bar\");\r\n elements.add(\"abc\");\r\n elements.add(\"foo\");\r\n elements.add(\"cde\");\r\n elements.add(\"cde\");\r\n elements.add(\"efg\");\r\n elements.add(\"cde\");\r\n \r\n Set<String> expResult = new LinkedHashSet<>();\r\n expResult.add(\"foo\");\r\n \r\n LexicalChecker instance = new LexicalChecker();\r\n Set<String> result = instance.findDuplicates(elements);\r\n \r\n assertNotSame(expResult, result);\r\n \r\n expResult.add(\"cde\");\r\n assertEquals(expResult, result);\r\n }",
"public static void getNonRepeatedNumbres(int[] arr )\r\n\t{\n\t\tSet<Integer> set=find(arr);\t\r\n\t\t//If size of set >=1 then there are few integers which are Non Repeated \r\n\t\tif(set.size()>=1)\r\n\t\t{\r\n\t\t\t//Printing those every Integers in set \r\n\t\t\tSystem.out.println(\"Non Repeated Integers are=\");\r\n\t\t\tfor(Integer i:set)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//If set.size==0, Then there are no Integers Which are Non Repeated..............\r\n\t\telse\r\n\t\t{\r\n\t\t\tSystem.out.println(\"There are no repeated numbers in a given array\");\r\n\t\t}\r\n\t}",
"public static void getConsicutiveOnes(int[] arr) {\n int pointerVar;\n int i;\n int counter = 0;\n int oldCounter = 0;\n\n for (i = 0; i < arr.length; i++) {\n pointerVar = 0;\n while (pointerVar < arr.length) {\n if (arr[i] == 1 && arr[i] == arr[pointerVar]) {\n counter++;\n } else {\n counter = 0;\n }\n pointerVar++;\n }\n\n }\n System.out.println(\"Counter Value :Old counter\" + counter);\n\n }",
"public static void main(String[] args) {\n\t\tint a[] = {1,2,2,6,7,3,4,4,5,5,6,7};\n\t\t\n\t\t\n\t\tMap<Integer,Integer> map =new HashMap<Integer,Integer>();\n\t\t\n\t\tfor (Integer num :a) {\n\t\t\tInteger Count =map.get(num);\n\t\t\tif(Count==null) {\n\t\t\t\tmap.put(num, 1);\n\t\t\t}else {\n\t\t\t\tmap.put(num, ++Count);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tSet<Entry<Integer, Integer>> entryset =map.entrySet();\n\t\tArrayList<Integer> list =new ArrayList<Integer>();\n\t\tfor(Entry<Integer, Integer> entry :entryset) {\n\t\t\tif(entry.getValue()>1) {\n\t\t\t\tlist.add(entry.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(\"Duplicates are \" +list);\n\t\t\n\t\tSet<Entry<Integer, Integer>> entryset1 =map.entrySet();\n\t\tArrayList<Integer> nonduplist =new ArrayList<Integer>();\n\t\tfor(Entry<Integer, Integer> entry1 :entryset1) {\n\t\t\tif(entry1.getValue()==1) {\n\t\t\t\tnonduplist.add(entry1.getKey());\n\t\t\t\t}\n\t\t\t}\n\t\tSystem.out.println(\"Non Duplicates are \" +nonduplist);\n\t\t\n \n}",
"static void findDuplicates(int[] input)\n\t{\n\t\t\n\t\tint length= input.length;\n\t\t\n\t\tSystem.out.println(\"The length of the given array is = \"+length);\n\t\t\n\t\t\n\t\tint[] register= new int[input.length];\n\t\t\n\t\t\n\t\tfor(int i: input)\n\t\t{\n\t\t\tregister[i]=1;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"Missing numbers in the given array\");\n\t\t\n\t\tfor(int i=1; i<register.length; i++)\n\t\t{\n\t\t\tif(register[i]==0)\n\t\t\t\tSystem.out.println(i);\n\t\t}\n\t\tfor(int a: input)\n\t\t{\n\t\t\tSystem.out.print(a);\n\t\t}\n\t\t\n\t\tSystem.out.println(\"\");\n\t\t\n\t\tSystem.out.println(\"\");\n\t\tfor(int b: register)\n\t\t{\n\t\tSystem.out.print(b);\n\t\t\n\t\t}\n\t}",
"private static void findDuplicatesByHashTable(int[] arr) {\n\t\t\n\t\t\n\t\tHashMap<Integer, Integer> map = new HashMap<Integer, Integer>();\n\t\t\n\t\tfor(int i=0; i<arr.length ; i++)\n\t\t{\n\t\t\tif(!map.containsKey(arr[i]))\n\t\t\t{\n\t\t\t\tmap.put(arr[i], 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmap.put(arr[i], map.get(arr[i])+1);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor ( Map.Entry<Integer, Integer> entry : map.entrySet() )\n\t\t{\n\t\t\tif(entry.getValue() > 1 )\n\t\t\t{\n\t\t\t\tSystem.out.println(\" Duplicate is by HashTable \" + entry.getKey());\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}",
"private boolean method_263(int var1) {\n return (this.method_244() & 1L << var1) != 0L;\n }",
"int getMissingCount();",
"private static void findDuplicates(int[] arr){\n Map<Integer,Integer> map = new HashMap<>();\n for(int i=0;i<arr.length;++i){\n if(map.containsKey(arr[i])){\n System.out.println(arr[i]);\n }else{\n map.put(arr[i],1);\n }\n }\n }",
"public boolean containsDuplicate(int[] nums) {\r\n\t Set<Integer> set = new HashSet<Integer>();\r\n\t for(int i = 0; i < nums.length; i++) {\r\n\t if(set.contains(nums[i]))\r\n\t return true;\r\n\t else\r\n\t set.add(nums[i]);\r\n\t }\r\n\t return false;\r\n\t }",
"while (!found && index < valid.length)\n {\n if (valid[index] == number)\n found = true;\n else\n index++;\n }",
"boolean hasS2();",
"public boolean checkDuplicates() {\n\t\tboolean[] vals = new boolean[9];\n\t\tfor(int i = 0; i < 3; i++) {\n\t\t\tfor(int k = 0; k < 3; k++) {\n\t\t\t\tint num = this.getCellNum(i, k);\n\t\t\t\tif(num != 0) {\n\t\t\t\t\tif(!vals[num-1]) {\n\t\t\t\t\t\t//The number hasn't already been found\n\t\t\t\t\t\tvals[num-1] = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//A duplicate number was found\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"boolean hasUnknown12();",
"public static void findDups(int[] arr)\n {\n BitSet bs = new BitSet(32000);\n for(int i=0; i < bs.length(); i++)\n System.out.print(bs.get(i));\n\n for(int i = 0; i < arr.length; i++)\n {\n int num0 = arr[i] - 1;\n if(bs.get(num0))\n System.out.print(arr[i]);\n else\n bs.set(num0);\n }\n }",
"public int singleNumber(int[] nums) {\n\n HashMap<Integer, Integer> occurrences = new HashMap<>();\n\n\n for (int i : nums) {\n occurrences.put(i, occurrences.getOrDefault(i, 0) + 1);\n }\n\n for (Map.Entry<Integer, Integer> m : occurrences.entrySet()) {\n System.out.printf(\"%d occur %d time(s)\\n\", m.getKey(), m.getValue());\n if (m.getValue() == 1) {\n return m.getKey();\n }\n\n\n }\n\n return 0;\n\n\n }",
"private boolean sc(int i, long y) {\n return cas(i, tag[th()], y); // 1\n }",
"public static boolean allUnique2(String s ){\n\t\tint value = 0;\n\t\tchar[] chars = s.toCharArray();\n\t\tfor(char c : chars) \n\t\t{\t\n\t\t\tint i = c -'a';\n\t\t\tif(((1<<i+1)&value)>0)\n\t\t\t\treturn false;\n\t\t\tvalue = value | (1<<i+1);\n\t\t}\n\t\treturn true;\n\t}",
"boolean hasFreq();",
"public int findDuplicate(int[] nums) {\n if(nums == null || nums.length == 0) return 0;\n\n int slow = nums[0];\n int fast = nums[nums[0]];\n\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n while(slow != fast) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n}",
"int getUniqueNumbersCount();",
"@Override\n public int findMissingNumber(int[] nums) {\n if (nums == null || nums.length == 0) {\n return 0;\n }\n int n = nums.length;\n int xor = n;\n for (int i = n - 1; i > 0; i--) {\n xor ^= i;\n }\n for (int i = 0; i < n; i++) {\n xor ^= nums[i];\n }\n return xor;\n }",
"boolean hasNum1();",
"public void can_counter()\n {\n candidate_count=0;\n for (HashMap.Entry<String,Candidate> set : allCandidates.entrySet())\n {\n candidate_count++;\n }\n }",
"private boolean isFound(int remaingingMarbles) {\n\n return (Math.log(remaingingMarbles) / Math.log(2)) % 1 == 0 ;\n\n }",
"boolean hasUnknown6();",
"boolean hasUnknown6();",
"@Test\r\n\tpublic void test1() {\r\n\t\tint[] nums = {1,2,3,1,4};\r\n\t\tAssert.assertEquals(true, containsDuplicate(nums));\r\n\t}",
"private void setSeen(boolean value)\n\t{\n\t\tfor (int x = 0; x < width; x++)\n\t\t{\n\t\t\tfor (int y = 0; y < height; y++)\n\t\t\t{\n\t\t\t\ttiles[x][y].setSeen(value);\n\t\t\t}\n\t\t}\t\t\t\t\n\t}",
"boolean hasResMineID();",
"boolean hasFrequency();",
"boolean isVisited();",
"boolean isVisited();",
"boolean hasStartingHadithNo();",
"private boolean cknows(int i, int j) {\n String key = i + \",\" + j;\n if (this.cache.containsKey(key))\n return this.cache.get(key);\n Boolean ans = knows(i, j);\n this.cache.put(key, ans);\n return ans.booleanValue();\n }",
"public boolean getZeroFlag() {\n // PROGRAM 1: Student must complete this method\n // return value is a placeholder, student should replace with correct return\n int zero = 0; //integer to keep track of how many '1's are in the output array\n for (int i = 0; i < output.length; i++) {\n if (output[i]) { //when we come across a 1, add 1 to the zero integer.\n zero += 1;\n }\n }\n if (zero > 0) { //if the method caught any '1's, then the output binary number is not 0.\n zeroFlag = false;\n } else {\n zeroFlag = true; //otherwise, it is\n }\n return zeroFlag; //return the zeroFlag\n }",
"public static void findNumberOccurringOddTimes() {\n int arr[] = {1, 1, 2, 2, 3, 3, 3};\n int result = 0;\n for (int num : arr)\n result ^= num;\n System.out.println(\"Odd times occurring number : \" + result);\n }",
"boolean repOk() {\n Set<Node> visited = new HashSet<Node>();\n Node n = header;\n while (n != null) {\n if (!visited.add(n)) {\n return false;\n }\n n = n.next;\n }\n return true;\n }",
"public static void main(String[] args) {\n\t\tint a[] = {4,4,4,5,5,5,6,6,6,9};\n\t\t\n\t\tArrayList<Integer> ab = new ArrayList<Integer>();\n\t\t\n\t\tfor(int i=0; i<a.length; i++)\n\t\t{\n\t\t\tint k =0;\n\t\t\tif(!ab.contains(a[i]))\n\t\t\t{\n\t\t\t\tab.add(a[i]);\n\t\t\t\tk++;\n\t\t\t\tfor(int j=i+1; j<a.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif(a[i]==a[j])\n\t\t\t\t\t{\n\t\t\t\t\t\tk++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(a[i]);\n\t\t\t//System.out.println(k);\n\t\t\tif(k==1)\n\t\t\t\tSystem.out.println(a[i] +\" is unique number \");\n\t\t}\n\t\t\n\t}",
"private static boolean checkZero(int[] count) {\n\t\tfor (int i = 0; i < count.length; i++) {\n\t\t\tif (count[i] != 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"private void verifyIndicesIsPermutation()\n {\n boolean seen[] = new boolean[length];\n \n for( int i=0; i<length; i++ ){\n int ix = indices[i];\n \n if( ix<0 ){\n System.out.println( \"Error: Negative index: indices[\" + i + \"]=\" + ix );\n }\n else if( ix>=indices.length ){\n System.out.println( \"Error: Index out of range: indices[\" + i + \"]=\" + ix );\n }\n else if( seen[ix] ){\n System.out.println( \"Error: Duplicate index: indices[\" + i + \"]=\" + ix );\n }\n else {\n seen[ix] = true;\n }\n }\n }",
"public int missingNumber(int[] nums) {\n\n int result = 0;\n\n for (int i = 1; i <= nums.length; i++) {\n result = result ^ i;\n }\n\n for (int i = 0; i < nums.length; i++) {\n result = result ^ nums[i];\n }\n\n return result;\n }",
"Integer count();",
"Integer count();",
"public static boolean hasDups(int num[]) {\n\n //boolean value to trigger while loop, intially false, set to true when a duplicate is found\n boolean found = false;\n\n //int i initialized to 0\n int i = 0;\n\n/*\n //while loop to search through array \n while (found != true) {\n */\n //for loop to loop through array elements after the first one\n //compares the first array element to each successive one for a duplicate\n\n for (int k = 1; k < num.length - 1; k++) {\n\n if (num[i] == num[k]) { //if statement that checks the adjacent values until the end of the array\n\n found = true; //flag for found to be set to true which will end while loop and return result \n\n } //end if\n\n else if (num[i] != num[k]) { //if statement that checks if te adjacent values are not equal to ensure found is false, and continue while loop\n\n found = false; //flag for found to be set to false which will contineu while loop to search through array\n\n } //end else if \n i++; //increments i so it is 1 less than k to check adjacent values in the array\n } //end for\n\n //} //end while\n return found; //retun value\n }",
"private static int isSparseNumber(int num){\n int c= 0;\n while(num >0){\n if((num & 1) == 0){\n if(c >= 2){\n return 0;\n }\n c=0;\n }else {\n c += (num & 1);\n }\n num >>=1;\n\n }\n if(c >= 2){\n return 0;\n }\n return 1;\n }",
"public boolean hasResult()\n/* */ {\n/* 119 */ return this.result != RESULT_NONE;\n/* */ }",
"boolean hasIdentity();",
"public int countOfOnes() {\r\n\t\tbyte one = (byte) 1;\r\n\t\tint count = 0;\r\n\r\n\t\tfor (byte b : values) {\r\n\t\t\tif (b == one) {\r\n\t\t\t\tcount++;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn count;\r\n\t}",
"boolean hasHadithReferenceNo();",
"boolean hasSteamID();",
"protected int findDuplicate(int[] arr)\n\t{\n\n\t\tboolean visited[] = new boolean[arr.length + 1];\n\n\t\tfor (int value : arr) {\n\t\t\tif (visited[value]) {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t\tvisited[value] = true;\n\t\t}\n\t\treturn -1;\n\t}",
"boolean hasUknown();",
"boolean hasUnknown73();",
"static int sockMerchant(int n, int[] ar) {\n int count = 0;\n for (int i = 0; i < ar.length; i++) {\n if (ar[i] == 0) {\n continue;\n }\n for (int j = i + 1; j < ar.length; j++) {\n if (ar[j] == 0) {\n continue;\n }\n if (ar[i] == ar[j]) {\n ar[i] = 0;\n ar[j] = 0;\n count++;\n }\n }\n }\n return count;\n }",
"boolean hasHadithNo();",
"int count();"
] | [
"0.6063095",
"0.5997738",
"0.5982232",
"0.5946685",
"0.5809542",
"0.5809542",
"0.5798644",
"0.5798644",
"0.5798644",
"0.5798644",
"0.5798644",
"0.5798644",
"0.57941616",
"0.5766657",
"0.575748",
"0.5712405",
"0.5695836",
"0.568016",
"0.5663697",
"0.5663697",
"0.5663697",
"0.56524396",
"0.562058",
"0.56182504",
"0.5598447",
"0.55689424",
"0.5547613",
"0.550401",
"0.5489847",
"0.5451602",
"0.54212886",
"0.5392858",
"0.53913826",
"0.53910863",
"0.5376007",
"0.5364379",
"0.5363514",
"0.53589463",
"0.5358191",
"0.53372365",
"0.5334735",
"0.530639",
"0.53036493",
"0.53007704",
"0.5297256",
"0.5290498",
"0.5284523",
"0.5262044",
"0.52590543",
"0.5246699",
"0.52227485",
"0.5221752",
"0.52156407",
"0.5212069",
"0.5209288",
"0.51947075",
"0.5189317",
"0.518616",
"0.51770025",
"0.5174695",
"0.51668704",
"0.5157522",
"0.5148783",
"0.5146533",
"0.5145482",
"0.51405466",
"0.5136377",
"0.513475",
"0.5133297",
"0.51257163",
"0.51257163",
"0.51099634",
"0.51092964",
"0.5108964",
"0.5107395",
"0.51054156",
"0.51054156",
"0.51033473",
"0.5092924",
"0.50883913",
"0.50879955",
"0.508649",
"0.5085414",
"0.50825864",
"0.5082439",
"0.5071235",
"0.50650054",
"0.50650054",
"0.5064481",
"0.5060602",
"0.5058616",
"0.50541866",
"0.5053394",
"0.50527626",
"0.50504225",
"0.5045663",
"0.5045408",
"0.50449526",
"0.50415784",
"0.50337744",
"0.50333315"
] | 0.0 | -1 |
Find and Connect Views | private void findViews() {
// Buttons first
closeBtn = (ImageButton) findViewById( getApplication().getResources().getIdentifier("closeBtn", "id", getApplication().getPackageName()) );
shareBtn = (ImageButton) findViewById( getApplication().getResources().getIdentifier("shareBtn", "id", getApplication().getPackageName()) );
// Photo Container
photo = (ImageView) findViewById( getApplication().getResources().getIdentifier("photoView", "id", getApplication().getPackageName()) );
warning = this.getResources().getIdentifier("warning", "drawable", getApplication().getPackageName());
place = this.getResources().getIdentifier("no_media", "drawable", getApplication().getPackageName());
mAttacher = new PhotoViewAttacher(photo);
// Title TextView
//titleTxt = (TextView) findViewById( getApplication().getResources().getIdentifier("titleTxt", "id", getApplication().getPackageName()) );
progress = (ProgressBar) findViewById( getApplication().getResources().getIdentifier("progressBar", "id", getApplication().getPackageName()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void findViews() {\n serverView = findViewById(R.id.server_view);\n portView = findViewById(R.id.port_view);\n usernameView = findViewById(R.id.username_view);\n passwordView = findViewById(R.id.password_view);\n messageView = findViewById(R.id.message_view);\n uploadButtonView = findViewById(R.id.upload_button_view);\n }",
"private void loadViews(){\n\t}",
"@Override\n\tpublic void staticFindViewByView() {\n\t\t\n\t}",
"private void registerViews() {\n\t}",
"Views getViews();",
"private void addViews() {\n // Add self VideoView\n addSelfView(getVideoView(null));\n\n // Add remote VideoView(s)\n int maxIndex = getNumPeers();\n for (int i = 0; i < maxIndex; i++) {\n // Iterate over the remote Peers only (first Peer is self Peer)\n addRemoteView(getPeerId(i + 1));\n }\n }",
"private void findViews() {\n jurgen = (ImageView) findViewById(R.id.jurgen_view);\n jurgen.setTag(JURGEN_VIEW_TAG);\n joost = (ImageView) findViewById(R.id.joost_view);\n joost.setTag(JOOST_VIEW_TAG);\n nick = (ImageView) findViewById(R.id.nick_view);\n nick.setTag(NICK_VIEW_TAG);\n stijn = (ImageView) findViewById(R.id.stijn_view);\n stijn.setTag(STIJN_VIEW_TAG);\n }",
"private void findViews() {\n Button loginButton = findViewById(R.id.button_login);\n loginButton.setOnClickListener(this);\n usernameEditText = findViewById(R.id.edit_text_username);\n username = sharedPreferences.getString(Constants.SP_USERNAME_KEY, \"\");\n this.passwordEditText = findViewById(R.id.edit_text_password);\n this.coordinatorLayout = findViewById(R.id.coordinator_layout_login);\n checkBox = findViewById(R.id.checkbox_remember_user);\n checkBox.setOnClickListener(this);\n TextView textViewServerName = findViewById(R.id.text_view_login_server);\n textViewServerName.setText(getResources().getString(R.string.login_server_name, sharedPreferences.getString(Constants.SP_SERVER_NAME_KEY, \"\")));\n }",
"private void addViews() {\n\t}",
"private void initializeViews() {\n \n \t\tIViewReference[] views = PlatformUI.getWorkbench().getActiveWorkbenchWindow()\n \t\t\t\t.getActivePage().getViewReferences();\n \n\t\tIWorkbenchPart activeView = PlatformUI.getWorkbench().getActiveWorkbenchWindow()\n\t\t\t\t.getActivePage().getActivePart();\n\n \t\ttry {\n \t\t\tfor (IViewReference view : views) {\n\n\t\t\t\tPlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()\n\t\t\t\t\t\t.showView(view.getId());\n\t\t\t}\n\n\t\t\tif (activeView instanceof CaleydoRCPViewPart) {\n\t\t\t\t// Make sure that the active part will remain active\n \t\t\t\tPlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()\n\t\t\t\t\t\t.showView(((CaleydoRCPViewPart) activeView).getSite().getId());\n \t\t\t}\n \t\t}\n \t\tcatch (PartInitException e) {\n \t\t\tthrow new IllegalStateException();\n \t\t}\n \n \t}",
"private void findViews() {\n mListView = (ListView) mFragment.findViewById(R.id.line_friend_list);\n }",
"private void findAllViews(View view) {\n recyclerView = view.findViewById(R.id.news_recycler_view);\n emptyView = view.findViewById(R.id.empty_view);\n progressBar = view.findViewById(R.id.progress_bar);\n swipeRefreshLayout = view.findViewById(R.id.swipe_container);\n }",
"ViewMap<IBranchMapping> getView();",
"private void populateViewCollections() {\n\n\t}",
"private void connectToNewViews() {\n try {\n\n if (currentSocketTask.isDone()) {\n addNewView(currentSocketTask.get());\n\n // The previous task has been consumed, we can now submit a new task for waiting new views\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentSocketTask = threadPool.submit(socketAcceptor);\n }\n }\n }\n } catch (ExecutionException ex) {\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentSocketTask = threadPool.submit(socketAcceptor);\n }\n }\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n\n try {\n if (currentRMITask.isDone()) {\n addNewView(currentRMITask.get());\n\n // The previous task has been consumed, we can now submit a new task for waiting new views\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentRMITask = threadPool.submit(rmiAcceptor);\n }\n }\n }\n } catch (ExecutionException ex) {\n synchronized (threadPool) {\n if (!threadPool.isShutdown()) {\n currentRMITask = threadPool.submit(rmiAcceptor);\n }\n }\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }",
"@Override\r\n protected void findViews(View view) {\n logout = (TextView) view.findViewById(R.id.user_logout);\r\n update = (RelativeLayout) view.findViewById(R.id.settings_update);\r\n cleanCache = (RelativeLayout) view.findViewById(R.id.settings_cache);\r\n pushSwitch = (CheckBox) view.findViewById(R.id.settings_push_switch);\r\n feedback = (RelativeLayout) view.findViewById(R.id.settings_feedback);\r\n\r\n fragmentManager = getFragmentManager();\r\n }",
"private void setViews() {\n\n }",
"MateriliazedView getViews(int index);",
"private void initViews() {\n\n\t}",
"public void initViews(){\n }",
"private void findViews(View view) {\n alamat = (TextView)view.findViewById( R.id.alamat );\n telp = (TextView)view.findViewById( R.id.telp );\n email = (TextView)view.findViewById( R.id.email );\n }",
"private void initViews() {\n\n }",
"View getActiveView();",
"@Override\n\tpublic void findView() {\n\t\tinitUI();\n\t}",
"public abstract void initViews();",
"private void findViews() {\n // Buttons first\n closeBtn = (ImageButton) findViewById(getApplication().getResources().getIdentifier(\"closeBtn\", \"id\", getApplication().getPackageName()));\n shareBtn = (ImageButton) findViewById(getApplication().getResources().getIdentifier(\"shareBtn\", \"id\", getApplication().getPackageName()));\n\n //ProgressBar\n loadingBar = (ProgressBar) findViewById(getApplication().getResources().getIdentifier(\"loadingBar\", \"id\", getApplication().getPackageName()));\n // Image Container\n image = (TouchImageView) findViewById(getApplication().getResources().getIdentifier(\"imageView\", \"id\", getApplication().getPackageName()));\n \n\n // Title TextView\n titleTxt = (TextView) findViewById(getApplication().getResources().getIdentifier(\"titleTxt\", \"id\", getApplication().getPackageName()));\n }",
"private void inizialiteViews() {\n tvDirectionStore = findViewById(R.id.tvDirectionStore);\n tvNameOwner = findViewById(R.id.tvNameOwnerView);\n tvNameStore = findViewById(R.id.tvNameStoreView);\n tvPhonestore = findViewById(R.id.tvPhoneNumberOwner);\n editStore = findViewById(R.id.btnEditStore);\n imageViewStore = findViewById(R.id.imageStore);\n }",
"private void injectViews() {\n Field[] declaredFields = getClass().getDeclaredFields();\n for (Field declaredField : declaredFields) {\n if(declaredField.isAnnotationPresent(InjectView.class)) {\n declaredField.setAccessible(true);\n try {\n declaredField.set(this, findViewById(declaredField.getAnnotation(InjectView.class).value()));\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n }\n }\n }",
"protected abstract void initViews();",
"private void findViews(View view) {\n list = (RecyclerView)view.findViewById(R.id.listview);\n\n GridLayoutManager layoutManager = new GridLayoutManager(getActivity(), 2);\n\n list.setLayoutManager(layoutManager);\n list.setHasFixedSize(true);\n\n// imageView = (PhotoDraweeView) view.findViewById(R.id.imageView);\n// imageGallery = (RelativeLayout) view.findViewById(R.id.imageGallery);\n// imageGallery.setVisibility(View.GONE);\n }",
"private void processCreateView() throws HsqlException {\n\n String name = tokenizer.getName();\n HsqlName schemaname =\n session.getSchemaHsqlNameForWrite(tokenizer.getLongNameFirst());\n int logposition = tokenizer.getPartMarker();\n\n database.schemaManager.checkUserViewNotExists(session, name,\n schemaname.name);\n\n HsqlName viewHsqlName = database.nameManager.newHsqlName(name,\n tokenizer.wasQuotedIdentifier());\n\n viewHsqlName.schema = schemaname;\n\n HsqlName[] colList = null;\n\n if (tokenizer.isGetThis(Token.T_OPENBRACKET)) {\n try {\n HsqlArrayList list = Parser.getColumnNames(database, null,\n tokenizer, true);\n\n colList = new HsqlName[list.size()];\n colList = (HsqlName[]) list.toArray(colList);\n } catch (HsqlException e) {\n\n // fredt - a bug in 1.8.0.0 and previous versions causes view\n // definitions to script without double quotes around column names\n // in certain cases; the workaround here discards the column\n // names\n if (database.isStoredFileAccess()\n && session.isProcessingScript()) {\n while (true) {\n String token = tokenizer.getString();\n\n if (token.equals(Token.T_CLOSEBRACKET)\n || token.equals(\"\")) {\n break;\n }\n }\n } else {\n throw e;\n }\n }\n }\n\n tokenizer.getThis(Token.T_AS);\n tokenizer.setPartMarker();\n\n Parser parser = new Parser(session, database, tokenizer);\n int brackets = parser.parseOpenBracketsSelect();\n Select select;\n\n // accept ORDER BY or ORDRY BY with LIMIT - accept unions\n select = parser.parseSelect(brackets, true, false, true, true);\n\n if (select.sIntoTable != null) {\n throw (Trace.error(Trace.INVALID_IDENTIFIER, Token.INTO));\n }\n\n select.prepareResult(session);\n\n View view = new View(session, database, viewHsqlName,\n tokenizer.getLastPart(), colList);\n\n session.commit();\n database.schemaManager.linkTable(view);\n tokenizer.setPartMarker(logposition);\n }",
"@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void initViews() {\n\t\t\r\n\t}",
"StableView view();",
"private static void registerAllViews() {\n Aggregation latencyDistribution =\n Aggregation.Distribution.create(BucketBoundaries.create(Arrays.asList(0.0, 5.0, 10.0, 15.0, 20.0)));\n\n // Define the views\n List<TagKey> noKeys = new ArrayList<TagKey>();\n View[] views =\n new View[]{\n View.create(\n Name.create(\"ocjavaexporter/latency\"),\n \"The distribution of latencies\",\n M_LATENCY_MS,\n latencyDistribution,\n noKeys)\n };\n\n // Create the view manager\n ViewManager vmgr = Stats.getViewManager();\n\n // Then finally register the views\n for (View view : views) {\n vmgr.registerView(view);\n }\n }",
"private void addCardsToViews()\n\t{\n\t\taddCardsToCorkboardView();\n\t\t\n\t}",
"private void findViews() {\n tabLayout = (TabLayout) findViewById(R.id.tab_layout);\r\n viewPager = (ViewPager) findViewById(R.id.view_pager);\r\n }",
"public void findViews() {\n titleTextView = findViewById(R.id.song_title_text_view);\n artistTextView = findViewById(R.id.song_artist_text_view);\n albumCoverImg = findViewById(R.id.album_cover_img);\n albumTextView = findViewById(R.id.album_text_view);\n playButton = findViewById(R.id.play_button);\n nextButton = findViewById(R.id.next_button);\n backButton = findViewById(R.id.back_button);\n shuffleButton = findViewById(R.id.shuffle_button);\n repeatButton = findViewById(R.id.repeat_button);\n }",
"private void bindViews(View rootView) {\n searchView = rootView.findViewById(R.id.searchView);\n recyclerViewNewspaper = rootView.findViewById(R.id.recyclerView_newspaper);\n }",
"@Override\r\n\tprotected void initViews() {\n\t\t\r\n\t}",
"List<IViewRelation> getViewRelations();",
"private void findViews(View view) {\n btnContest = view.findViewById(R.id.btnContest);\n btnNormal = view.findViewById(R.id.btnNormal);\n llLike = view.findViewById(R.id.llLike);\n llComment = view.findViewById(R.id.llComment);\n llShare = view.findViewById(R.id.llShare);\n llBookmark = view.findViewById(R.id.llBookmark);\n videoView = view.findViewById(R.id.videoView);\n btnContest.setOnClickListener(this);\n btnNormal.setOnClickListener(this);\n llLike.setOnClickListener(this);\n llComment.setOnClickListener(this);\n llShare.setOnClickListener(this);\n llBookmark.setOnClickListener(this);\n tvVideoDescription = view.findViewById(R.id.tvVideoDescription);\n progressBar = view.findViewById(R.id.progressbar);\n String koDes = \"<font style=\\\"font-size:14px; color: #fff;\\\">이미지 설명 자리 표시 자 <span style=\\\"color:red;\\\">#해시 태그</span>는 다음과 같습니다. 비디오 설명 자리 표시 자. 해시 태그는 다음과 같습니다. 동영상 설명 <span style=\\\"color:red;\\\">#자리 표시 자</span>. <span style=\\\"color:red;\\\">#해시 태그</span>는 다음과 같습니다.</font>\";\n tvVideoDescription.setText(Html.fromHtml(koDes));\n\n findDialogView();\n }",
"private void setUpViews() {\n\n updateFooterCarInfo();\n updateFooterUsrInfo();\n\n\n setResultActionListener(new ResultActionListener() {\n @Override\n public void onResultAction(AppService.ActionType actionType) {\n if (ModelManager.getInstance().getGlobalInfo() != null) {\n GlobalInfo globalInfo = ModelManager.getInstance().getGlobalInfo();\n\n switch (actionType) {\n case CarInfo:\n updateFooterCarInfo();\n break;\n case UsrInfo:\n updateFooterUsrInfo();\n break;\n case Charger:\n updateChargeStationList();\n break;\n }\n }\n }\n });\n }",
"public void initViews() {\n View accountExists = activity.findViewById(R.id.button_register);\n Button buttonSubmitAuth = activity.findViewById(R.id.button_login);\n\n viewUsername = activity.findViewById(R.id.login_username);\n viewPassword = activity.findViewById(R.id.login_password);\n\n accountExists.setOnClickListener(view ->\n activity.setViewPagerCurrentItem(OnboardingActivity.Companion.getFRAGMENT_REGISTRATION()));\n\n buttonSubmitAuth.setOnClickListener(view -> authenticateUser());\n }",
"private List<String> getAllViewsDDL() {\n\t\tList<String> resultList = new ArrayList<String>();\n\t\tList<String> viewNameList = new ArrayList<String>();\n\t\tLinkedHashMap<String, String> viewQuerySpecMap = new LinkedHashMap<String, String>();\n\t\tConnection conn = null;\n\t\tStatement stmt = null;\n\t\tCUBRIDResultSetProxy rs = null;\n\n\t\tString sql;\n\t\tif (dbInfo.isSupportUserSchema()) {\n\t\t\tsql = \"SELECT c.class_name, c.owner_name, c.class_type\" + \" FROM db_class c, db_attribute a\"\n\t\t\t\t+ \" WHERE c.class_name=a.class_name AND c.is_system_class='NO'\"\n\t\t\t\t+ \" AND c.owner_name=a.owner_name\"\n\t\t\t\t+ \" AND c.class_type='VCLASS'\" + \" GROUP BY c.owner_name, c.class_name, c.class_type\"\n\t\t\t\t+ \" ORDER BY c.owner_name, c.class_type, c.class_name\";\n\t\t} else {\n\t\t\tsql = \"SELECT c.class_name, c.class_type\" + \" FROM db_class c, db_attribute a\"\n\t\t\t\t\t+ \" WHERE c.class_name=a.class_name AND c.is_system_class='NO'\"\n\t\t\t\t\t+ \" AND c.class_type='VCLASS'\" + \" GROUP BY c.class_name, c.class_type\"\n\t\t\t\t\t+ \" ORDER BY c.class_type, c.class_name\";\n\t\t}\n\n\t\t// [TOOLS-2425]Support shard broker\n\t\tsql = dbInfo.wrapShardQuery(sql);\n\t\ttry {\n\t\t\tconn = JDBCConnectionManager.getConnection(dbInfo, false);\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\tResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);\n\n\t\t\trs = (CUBRIDResultSetProxy) stmt.executeQuery(sql);\n\t\t\twhile (rs.next()) {\n\t\t\t\tif (dbInfo.isSupportUserSchema()) {\n\t\t\t\t\tString className = rs.getString(1);\n\t\t\t\t\tString ownerName = rs.getString(2);\n\t\t\t\t\tviewNameList.add(ownerName + \".\" + className);\n\t\t\t\t} else {\n\t\t\t\t\tString className = rs.getString(1);\n\t\t\t\t\tviewNameList.add(className);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"\", e);\n\t\t} finally {\n\t\t\tQueryUtil.freeQuery(stmt, rs);\n\t\t}\n\n\t\ttry {\n\t\t\tstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,\n\t\t\t\t\tResultSet.CONCUR_READ_ONLY, ResultSet.HOLD_CURSORS_OVER_COMMIT);\n\n\t\t\tfor (String viewName : viewNameList) {\n\t\t\t\tString querySpecSql;\n\t\t\t\tif (dbInfo.isSupportUserSchema()) {\n\t\t\t\t\tquerySpecSql = \"SELECT vclass_def FROM db_vclass WHERE CONCAT(owner_name, '.' , vclass_name)='\"\n\t\t\t\t\t\t+ viewName + \"'\";\n\t\t\t\t} else {\n\t\t\t\t\tquerySpecSql = \"SELECT vclass_def FROM db_vclass WHERE vclass_name='\"\n\t\t\t\t\t\t+ viewName + \"'\";\n\t\t\t\t}\n\n\t\t\t\t// [TOOLS-2425]Support shard broker\n\t\t\t\tquerySpecSql = dbInfo.wrapShardQuery(querySpecSql);\n\n\t\t\t\ttry {\n\t\t\t\t\trs = (CUBRIDResultSetProxy) stmt.executeQuery(querySpecSql);\n\t\t\t\t\tif (rs.next()) {\n\t\t\t\t\t\tviewQuerySpecMap.put(viewName, rs.getString(1));\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\tQueryUtil.freeQuery(rs);\n\t\t\t\t}\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\tLOGGER.error(\"\", e);\n\t\t} finally {\n\t\t\tQueryUtil.freeQuery(conn, stmt);\n\t\t}\n\n\t\tfor (Map.Entry<String, String> entry : viewQuerySpecMap.entrySet()) {\n\t\t\tSchemaInfo viewInfo = dbInfo.getSchemaInfo(entry.getKey());\n\t\t\tString ddl = getViewDDL(viewInfo, dbInfo, entry.getValue());\n\t\t\tresultList.add(ddl);\n\t\t}\n\n\t\treturn resultList;\n\t}",
"public void viewAccepted(View new_view) {\n this.view=new_view;\n log.trace(\"[Relayer \" + channel.getAddress() + \"] view: \" + new_view);\n\n Map<String,List<Address>> tmp=extract(new_view);\n Set<String> down=new HashSet<>(routes.keySet());\n Set<String> up=new HashSet<>();\n\n down.removeAll(tmp.keySet());\n\n routes.keySet().retainAll(tmp.keySet()); // remove all sites which are not in the view\n\n for(Map.Entry<String,List<Address>> entry: tmp.entrySet()) {\n String key=entry.getKey();\n List<Address> val=entry.getValue();\n\n List<Route> newRoutes;\n if(routes.containsKey(key))\n newRoutes=new ArrayList<>(routes.get(key));\n else {\n newRoutes=new ArrayList<>();\n if(up != null)\n up.add(key);\n }\n\n // Remove routes not in the view anymore:\n newRoutes.removeIf(route -> !val.contains(route.siteMaster()));\n\n // Add routes that aren't yet in the routing table:\n val.stream().filter(addr -> !contains(newRoutes, addr))\n .forEach(addr -> newRoutes.add(new Route(addr, channel, relay, log).stats(stats)));\n\n if(newRoutes.isEmpty()) {\n routes.remove(key);\n down.add(key);\n up.remove(key);\n }\n else\n routes.put(key, Collections.unmodifiableList(newRoutes));\n }\n if(!down.isEmpty())\n relay.sitesChange(true, down.toArray(new String[0]));\n if(!up.isEmpty())\n relay.sitesChange(false, up.toArray(new String[0]));\n }",
"private void openView(String viewToOpen)\n throws IOException, InterruptedException, URISyntaxException {\n Parent root = null;\n FXMLLoader loader = new FXMLLoader();\n loader.setLocation(getClass().getResource(viewToOpen + \"/\" + viewToOpen + \".fxml\"));\n root = loader.load();\n\n if (\"view0\".equals(viewToOpen)) {\n view0Controller = loader.getController();\n view0Controller.init(getVmFactory());\n }\n\n Scene s;\n s = new Scene(root);\n primaryStage.setScene(s);\n primaryStage.initStyle(StageStyle.UNDECORATED);\n primaryStage.initStyle(StageStyle.TRANSPARENT);\n primaryStage.show();\n\n // getcounter/iteratorvalue\n\n }",
"private void findView() {\n\t\tteacher = Teacher.getTeacher(this);\r\n\t\tsaoyisaonan = (ImageView) findViewById(R.id.saoyisaonan);\r\n\t\tsaoyisaonv = (ImageView) findViewById(R.id.saoyisaonv);\r\n\t\tif(teacher.isBoy()){\r\n\t\t\tsaoyisaonan.setVisibility(View.VISIBLE);\r\n\t\t}else{\r\n\t\t\tsaoyisaonv.setVisibility(View.VISIBLE);\r\n\t\t}\r\n\t\tclose = (ImageView) findViewById(R.id.close);\r\n\t\tclose.setOnClickListener(this);\r\n\t\tlogin = (ImageView) findViewById(R.id.login);\r\n\t\tlogin.setOnClickListener(this);\r\n\t\treg = (ImageView) findViewById(R.id.reg);\r\n\t\treg.setOnClickListener(this);\r\n\t}",
"void showSelectedAgentView();",
"public void showViewsIfAllConnectionsAreConnected() {\n\n // check if SignalR and MS SQL is connected\n if (!isSignalRConnected) {\n return;\n }\n if (!isMSSQLConnected) {\n return;\n }\n\n //show wiews - setScannerSection or setDeffectSection or setOverViewSection\n setScannerSection();\n\n }",
"protected void viewSetup() {\n\t\t// TODO Auto-generated method stub\n\n\t}",
"private void initViews() {\n View view = getView();\n if (view != null) {\n edtConfirmPassword = view.findViewById(R.id.edt_reg_confim_password);\n edtConfirmPassword.setTag(\"Confirm Password\");\n edtEmail = view.findViewById(R.id.edt_reg_email);\n edtEmail.setTag(\"Email\");\n edtPhone = view.findViewById(R.id.edt_reg_phone);\n edtPhone.setTag(\"Phone\");\n edtPassword = view.findViewById(R.id.edt_reg_password);\n edtPassword.setTag(\"Password\");\n tv_RegisterSignIn = view.findViewById(R.id.tv_register_sign_in);\n btn_reg_signup = view.findViewById(R.id.btn_reg_signup);\n edtUserName = view.findViewById(R.id.edt_reg_name);\n edtUserName.setTag(\"Name\");\n }\n }",
"protected abstract void setupMvpView();",
"private void getViews(View view) {\n listView = (com.baoyz.swipemenulistview.SwipeMenuListView)view.findViewById(R.id.detail_listview);\n accept = (Button)view.findViewById(R.id.change_quantity_button);\n totalPriceTextView = (TextView)view.findViewById(R.id.total_price_text_view);\n searchET = (EditText)view.findViewById(R.id.search_edit_text);\n clearTextButton = (Button)view.findViewById(R.id.clear_text_button);\n }",
"interface ViewCreator {\n /**\n * Creates a view\n * @param path\n * @param sql\n * @param sqlContext\n */\n void createView(List<String> path, String sql, List<String> sqlContext, NamespaceAttribute... attributes);\n\n /**\n * Updates a view\n * @param path\n * @param sql\n * @param sqlContext\n * @param attributes\n */\n void updateView(List<String> path, String sql, List<String> sqlContext, NamespaceAttribute... attributes);\n\n /**\n * Drops a view\n * @param path\n */\n void dropView(List<String> path);\n }",
"private void findViews() {\n tvPercentFirstPlace = findViewById(R.id.tvPercentFirstPlace);\n tvPercentSecondPlace = findViewById(R.id.tvPercentSecondPlace);\n tvPercentThirdPlace = findViewById(R.id.tvPercentThirdPlace);\n tvMainPrizeWon = findViewById(R.id.tvMainPrizeWon);\n tvMainPrizeWonText = findViewById(R.id.tvMainPrizeWonText);\n tvPrizeWonFirstPlace = findViewById(R.id.tvPrizeWonFirstPlace);\n tvPrizeWonSecondPlace = findViewById(R.id.tvPrizeWonSecondPlace);\n tvPrizeWonThirdPlace = findViewById(R.id.tvPrizeWonThirdPlace);\n tvPlatformFee = findViewById(R.id.tvPlatformFee);\n tvPrizeSum = findViewById(R.id.tvPrizeSum);\n tvPrizeSumText = findViewById(R.id.tvPrizeSumText);\n tvMainPrizeWon.setText(String.valueOf(mainPrize));\n btnChange = findViewById(R.id.btnChange);\n btnNext = findViewById(R.id.btnNext);\n }",
"protected void findAndCacheViews(View view) {\n\t SpeakerItemViews views = new SpeakerItemViews();\n\t views.headerView = view.findViewById(R.id.header);\n\t views.headerTextView = (TextView) view.findViewById(R.id.header_text);\n\t views.dividerView = view.findViewById(R.id.session_divider);\n\t views.nameView = (TextView) view.findViewById(R.id.speaker_name);\n\t views.companyView = (TextView) view.findViewById(R.id.speaker_company);\n\t views.starButton = (CheckBox) view.findViewById(R.id.star_button);\n\t view.setTag(views);\n\t }",
"@Override\n\tpublic Set<String> loadViews(String databaseName) throws SQLException {\n\t\tSet<String> tables=new HashSet<String>();\n\t\tString sql=\"select VIEW_NAME from user_views\";\n\t\tPreparedStatement preparedStatement= connection.prepareStatement(sql);\n\t\tResultSet resultSet=preparedStatement.executeQuery();\n\t\twhile(resultSet.next()) {\n\t\t String table=resultSet.getString(1).toUpperCase();\n\t\t tables.add(table);\n\t\t}\n\t\treturn tables;\n\t}",
"List<ViewDefinition> list();",
"private List<View> findViewsWithTag(View view, Object tag) {\n List<View> viewsWithTag = new ArrayList<>();\n if (view instanceof ViewGroup) {\n for (int i = 0; i < ((ViewGroup) view).getChildCount(); i++) {\n viewsWithTag.addAll(findViewsWithTag(((ViewGroup) view).getChildAt(i), tag));\n }\n }\n if (view.getTag() != null && view.getTag().equals(tag)) {\n viewsWithTag.add(view);\n }\n return viewsWithTag;\n }",
"public View getView(String viewName,String query, List<String> attributeNames,\n\t\t\tList<String> summaries, List<String> summaryNames, DBConnector connectionType) throws Exception {\n\t\tif(this.viewMap.containsKey(viewName)) return this.viewMap.get(viewName);\n\t\tView v = getSavedView(viewName);\n\t\tif(v != null) return v;\n\t\treturn createView(viewName,query,attributeNames, summaries, summaryNames,connectionType);\n\t}",
"private void updateQueryViews() {\n for (QueryView view : queryViews) {\n updateQueryView(view);\n }\n }",
"public ViewIdentificator getView() {\r\n return view;\r\n }",
"public interface ViewService {\n\n /**\n * Add the view that corresponds to the given program location.\n * @param loc program location to be added to the view\n * @return new addressSet for the added view\n */\n public AddressSetView addToView(ProgramLocation loc);\n\n /**\n * Get the current view.\n */\n public AddressSetView getCurrentView();\n}",
"private void bindViewsById(View view) {\n mViewPager = (ViewPager) view.findViewById(R.id.pager);\n mViewPager.setOffscreenPageLimit(1);\n mTabLayout = (TabLayout) view.findViewById(R.id.tab_layout);\n\n // mTvNoFavAvail = (TextView) view.findViewById(R.id.tv_no_fav_available);\n // mTvNoInternet = (TextView) view.findViewById(R.id.tv_no_internet_available);\n }",
"public void testSetViews() {\n }",
"View mo73990a(View view);",
"private Collection<View> selectViewsByType(Collection<View> views, String type) {\n\t\tArrayList<View> result = new ArrayList<View>();\n\t\tfor (View nextView : views) {\n\t\t\tif (type.equals(nextView.getType()) && isOwnView(nextView)) {\n\t\t\t\tresult.add(nextView);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}",
"private void findViews() {\n\n altura_et = findViewById(R.id.et_altura);\n altura_et.setText(String.valueOf(user.getAltura()));\n\n peso_et = findViewById(R.id.et_peso);\n peso_et.setText(String.valueOf(user.getPeso()));\n\n nombreUO_et = findViewById(R.id.et_uo);\n nombreUO_et.setText(user.getUserID());\n\n email_et = (EditText) findViewById(R.id.editTextEmail);\n email_et.setText(user.getCorreo().toString());\n\n nombre = findViewById(R.id.tv_nombre);\n nombre.setText(user.getNombre().concat(\" \").concat(user.getApellidos()));\n\n fecha = findViewById(R.id.textViewFechaNaci);\n fecha.setText(fecha.getText().toString().concat(\" \").concat(user.getNacimiento()));\n\n email_et.setEnabled(false);\n altura_et.setEnabled(false);\n peso_et.setEnabled(false);\n nombreUO_et.setEnabled(false);\n }",
"View createView();",
"public void execute(VirtualView virtualView){\n //method in virtualView\n }",
"private void bindViews() {\n\n xlv_postlist = (com.mrz.searchenginefortieba.view.XListView) findViewById(R.id.xlv_postlist);\n }",
"@Override\n public MateriliazedView getViews(int index) {\n return views_.get(index);\n }",
"@Override\n\tpublic View getView(String viewName) {\n\n\t\tint resourceID = context.getResources().getIdentifier(viewName, \"id\",\n\t\t\t\tcontext.getPackageName());\n\t\tviewObject = activity.findViewById(resourceID);\n\n\t\treturn viewObject;\n\t}",
"public void configure(T aView) { }",
"public PgViews() {\n this(\"pg_views\", null);\n }",
"private void setViews(){\n compositeDisposable.add(storyActivityViewModel.getModeObservable().subscribe(new Consumer<StoryActivityViewModel.MODE>() {\n @Override\n public void accept(StoryActivityViewModel.MODE mode) throws Exception {\n setDoneButton(mode);\n }\n }));\n\n compositeDisposable.add(storyActivityViewModel.getPhotosObservable().subscribe(new Consumer<List<Photo>>() {\n @Override\n public void accept(List<Photo> photos) throws Exception {\n setPhotoLinear(photos);\n }\n }));\n\n compositeDisposable.add(storyActivityViewModel.getUpdatedAtObservable().subscribe(new Consumer<Date>() {\n @Override\n public void accept(Date updatedAt) throws Exception {\n setUpdatedAt(updatedAt);\n }\n }));\n\n compositeDisposable.add(storyActivityViewModel.getTitleObservable().subscribe(new Consumer<String>() {\n @Override\n public void accept(String title) throws Exception {\n setTitle(title);\n }\n }));\n\n compositeDisposable.add(storyActivityViewModel.getBodyObservable().subscribe(new Consumer<String>() {\n @Override\n public void accept(String body) throws Exception {\n setBody(body);\n }\n }));\n\n compositeDisposable.add(RxView.clicks(done).subscribe(new Consumer<Object>() {\n @Override\n public void accept(Object o) throws Exception {\n storyDone();\n }\n }));\n\n compositeDisposable.add(RxView.clicks(closePhotoDetail).subscribe(new Consumer<Object>() {\n @Override\n public void accept(Object o) throws Exception {\n closePhotoDetail();\n }\n }));\n }",
"public void testCreateView()\n throws Exception\n {\n String sql = \"create schema s4\";\n stmt.execute(sql);\n\n sql = \"create view s4.v as select * from (values(0))\";\n runAndDiff(sql);\n }",
"private void initView() {\n\t\tsna_viewpager = (ViewPager) findViewById(R.id.sna_viewpager);\r\n\t\thost_bt = (Button) findViewById(R.id.host_bt);\r\n\t\tcomment_bt = (Button) findViewById(R.id.comment_bt);\r\n\t\tback_iv = (ImageView) findViewById(R.id.back_iv);\r\n\t\trelativeLayout_project = (RelativeLayout) findViewById(R.id.relativeLayout_project);\r\n\t\trelativeLayout_addr = (RelativeLayout) findViewById(R.id.relativeLayout_addr);\r\n\t\trelativeLayout_activity = (RelativeLayout) findViewById(R.id.relativeLayout_activity);\r\n\t\trelativeLayout_host = (RelativeLayout) findViewById(R.id.relativeLayout_host);\r\n\t\trelativeLayout_comment = (RelativeLayout) findViewById(R.id.relativeLayout_comment);\r\n\t\tll_point = (LinearLayout) findViewById(R.id.ll_point);\r\n\t\tstoyrName = (TextView) findViewById(R.id.stoyrName);\r\n\t\tstory_addr = (TextView) findViewById(R.id.story_addr);\r\n\t\t\r\n\t}",
"private void findViews() {\n\n FirstName = (EditText) findViewById(R.id.FirstName);\n LastName = (EditText) findViewById(R.id.LastName);\n CreditCard = (EditText) findViewById(R.id.CreditCard);\n EmailAddress = (EditText) findViewById(R.id.EmailAddress);\n PhoneNumber = (EditText) findViewById(R.id.PhoneNumber);\n ID = (EditText) findViewById(R.id.ID);\n Add = (Button) findViewById(R.id.Add);\n Password = (EditText) findViewById(R.id.Password);\n\n Add.setOnClickListener(this);\n }",
"@Override\n public java.util.List<MateriliazedView> getViewsList() {\n return views_;\n }",
"private void initViews() {\n\t\tet_area = (EditText) findViewById(R.id.et_area);\r\n\t\tbtn_search = (Button) findViewById(R.id.btn_search);\r\n\t\tll_main = (LinearLayout) findViewById(R.id.ll_main);\r\n\t}",
"public void setNextActivateView(OwView nextView_p) throws Exception\r\n {\n\r\n }",
"@Override\n\tpublic Collection<ViewInfo> getViews(String componentTypeId) {\n\t\tif (componentTypeId.equals(CollectionComponent.class.getName())) {\r\n\t\t\treturn Arrays.asList(new ViewInfo(\r\n\t\t\t\t\tMultiColView.class, bundle.getString(\"MultiColViewName\"), ViewType.OBJECT),\r\n\t\t\t\t\tnew ViewInfo(\r\n\t\t\t\t\t\t\tMultiColView.class, bundle.getString(\"MultiColViewName\"), ViewType.EMBEDDED));\r\n\t\t} else {\r\n\t\t\treturn Collections.emptyList();\r\n\t\t}\n\t}",
"public View[] getViews() {\n \t\tif (views != null)\n \t\t\treturn views;\n \n \t\tView tocview = new View(\"toc\", //$NON-NLS-1$\n \t\t\t\t\"\", //$NON-NLS-1$\n \t\t\t\tpreferences.getImagesDirectory() + \"/contents_view.gif\", 'C', !HelpPlugin.getTocManager().isTocLoaded(getLocale())); //$NON-NLS-1$\n \t\tView indexview = null;\n \t\tView searchview = new View(\"search\", //$NON-NLS-1$\n \t\t\t\t\"\", //$NON-NLS-1$\n \t\t\t\tpreferences.getImagesDirectory() + \"/search_results_view.gif\", 'R', false); //$NON-NLS-1$\n \t\tView linksview = null;\n \t\tView bookmarksview = null;\n \n \t\tif (preferences.isIndexView())\n \t\t\tindexview = new View(\"index\", //$NON-NLS-1$\n \t\t\t\t\t\"\", //$NON-NLS-1$\n\t\t\t\t\tpreferences.getImagesDirectory() + \"/index_view.gif\", 'I', !HelpPlugin.getIndexManager().isIndexLoaded(getLocale())); //$NON-NLS-1$\n \t\tif (preferences.isLinksView())\n \t\t\tlinksview = new View(\"links\", //$NON-NLS-1$\n \t\t\t\t\t\"\", //$NON-NLS-1$\n \t\t\t\t\tpreferences.getImagesDirectory() + \"/links_view.gif\", (char)0, false); //$NON-NLS-1$\n \t\tif (preferences.isBookmarksView())\n \t\t\tbookmarksview = new View(\"bookmarks\", //$NON-NLS-1$\n \t\t\t\t\t\"\", //$NON-NLS-1$\n \t\t\t\t\tpreferences.getImagesDirectory() + \"/bookmarks_view.gif\", (char)0, false); //$NON-NLS-1$\n \n \t\tArrayList viewList = new ArrayList();\n \t\tviewList.add(tocview);\n \t\tif (indexview != null) {\n \t\t\tviewList.add(indexview);\n \t\t}\n \t\tviewList.add(searchview);\n \t\tif (linksview != null) {\n \t\t\tviewList.add(linksview);\n \t\t}\n \t\tif (bookmarksview !=null) {\n \t\t\tviewList.add(bookmarksview);\n \t\t}\n \t\t\n \t\tviews = (View[]) viewList.toArray(new View[viewList.size()]);\n \t\treturn views;\n \t}",
"int getViewId();",
"@Override\r\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\r\n\t}",
"void view();",
"private Views() {\n }",
"@Override\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\n\t}",
"@Override\n\tpublic String getViewIdentifier() {\n\t\treturn ClassUtils.getUrl(this);\n\t}",
"protected abstract void initView();",
"private void initializeVetVisitsControllers() {\n trObtainAllVetVisits = VetVisitsControllersFactory.createTrObtainAllVetVisits();\n trNewVetVisit = VetVisitsControllersFactory.createTrNewVetVisit();\n trDeleteVetVisit = VetVisitsControllersFactory.createTrDeleteVetVisit();\n trUpdateVetVisit = VetVisitsControllersFactory.createTrUpdateVetVisit();\n }",
"private void setupViews(View view) {\n FragmentManager manager = getChildFragmentManager();\n sportsSpinner = (ColoredSpinnerFragment)\n manager.findFragmentById(R.id.sportsSpinnerFragment);\n\n logOut = view.findViewById(R.id.signout);\n\n logOut.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n FirebaseAuth.getInstance().signOut();\n }\n });\n backgroundPicture = view.findViewById(R.id.profile_background);\n usernameText = view.findViewById(R.id.userName);\n expText = view.findViewById(R.id.exp_search);\n followersText = view.findViewById(R.id.followers);\n tierText = view.findViewById(R.id.following);\n sportsmanshipBar = view.findViewById(R.id.ratingBar);\n profilePicture = view.findViewById(R.id.profilePic);\n badgeRecycler = view.findViewById(R.id.profileBadgeRecycler);\n }",
"ViewCreator get(String userName);",
"@Override\n protected void initViewSetup() {\n }",
"protected abstract void initializeView();",
"private void showSearchView(String viewName)\n {\n currentSearchView = viewName;\n CardLayout cLayout = (CardLayout) searchPaneWrapper.getLayout();\n cLayout.show(searchPaneWrapper, viewName);\n }",
"protected void prepareChildViews() {\n\n }",
"public interface RegisterView extends BaseView {\n void findViews();\n\n void setValues();\n\n void setListeners();\n\n void onSendVerificationClick();\n\n void onVerifyClick();\n}"
] | [
"0.67842054",
"0.6704719",
"0.66468245",
"0.6544347",
"0.6484831",
"0.64825004",
"0.6463925",
"0.6267072",
"0.626061",
"0.6256527",
"0.6237866",
"0.61877817",
"0.6169515",
"0.61136776",
"0.61124337",
"0.6063827",
"0.60368186",
"0.6006367",
"0.59895056",
"0.5898148",
"0.5897638",
"0.58927196",
"0.58651507",
"0.5864112",
"0.58459777",
"0.5845074",
"0.58286047",
"0.5814493",
"0.5796175",
"0.57928675",
"0.57822454",
"0.5773899",
"0.5773899",
"0.57684284",
"0.57590455",
"0.5748803",
"0.57481766",
"0.5744381",
"0.5736571",
"0.57303864",
"0.5707886",
"0.569392",
"0.565283",
"0.56190944",
"0.55773723",
"0.5556093",
"0.55428505",
"0.5524707",
"0.55118144",
"0.5504828",
"0.55004245",
"0.5498247",
"0.5469713",
"0.5465373",
"0.54597354",
"0.54546535",
"0.544216",
"0.5440956",
"0.5435655",
"0.541868",
"0.54135895",
"0.53739095",
"0.53520113",
"0.53435767",
"0.5339524",
"0.53392637",
"0.5329378",
"0.5321373",
"0.5319816",
"0.531904",
"0.5304721",
"0.5293684",
"0.5288022",
"0.5286522",
"0.5279738",
"0.52636504",
"0.5242037",
"0.524014",
"0.523102",
"0.5217722",
"0.521669",
"0.5215802",
"0.521503",
"0.5209889",
"0.52096844",
"0.5208919",
"0.5208667",
"0.52045304",
"0.52040684",
"0.52019674",
"0.52019674",
"0.5199626",
"0.519161",
"0.5188727",
"0.51874673",
"0.5185294",
"0.51815873",
"0.5181274",
"0.5180624",
"0.5178796"
] | 0.60391086 | 16 |
TODO Autogenerated method stub | @Override
public void onFailure(int arg0, Header[] arg1,
byte[] arg2, Throwable arg3) {
Toastshow(-1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onSuccess(int arg0, Header[] arg1,
byte[] arg2) {
InputStream inputStream = null;
progress.setProgress(0);
Log.i("binaryData:", "下載..........:" + arg2.length);
try {
inputStream = getInputStreamFromUrl(urlStr);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
String text;
int c = 0;
byte[] buffer = new byte[8 * 1024];
while ((c = inputStream.read(buffer)) != -1) {
bao.write(buffer, 0, c);
}
inputStream.close();
bao.close();
File resultFile = fileUtils.write2SDFromInput(path,fileName, new ByteArrayInputStream(bao.toByteArray()));
if (resultFile == null) {
Toastshow(-1);
return ;
}
Toastshow(0);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally {
try {
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @Override
public void onItemClick(AdapterView<?> arg0, View arg1, int position,
long arg3) {
objAllBeanlisting=arrayOfListing.get(position);
Constant.LISTING_H_IDD=objAllBeanlisting.getH_id();
PopUpAds.ShowInterstitialAds(Listing_Activity.this);
Intent intplay=new Intent(getApplicationContext(),ListingDetails_Activity.class);
startActivity(intplay);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
TODO Autogenerated method stub | @SuppressLint("NewApi") @Override
public void onFocusChange(View v, boolean hasFocus) {
if(!hasFocus) {
searchMenuItem.collapseActionView();
searchView.setQuery("", false);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
initialized the endpoint by creating the ServerSocketChannel and by initializing the server socket. | @Override
public void initEndpoint() throws IOException, InstantiationException {
SelectorThreadConfig.configure(this);
initFileCacheFactory();
initAlgorithm();
initPipeline();
initMonitoringLevel();
setName("SelectorThread-" + getPort());
try{
if (getInet() == null) {
setServerSocket(getServerSocketFactory().createSocket(getPort(),
getSsBackLog()));
} else {
setServerSocket(getServerSocketFactory().createSocket(getPort(),
getSsBackLog(), getInet()));
}
getServerSocket().setReuseAddress(true);
} catch (SocketException ex){
throw new BindException(ex.getMessage() + ": " + getPort());
}
getServerSocket().setSoTimeout(getServerTimeout());
initReadBlockingTask(getMinReadQueueLength());
setInitialized(true);
getLogger().log(Level.FINE,"Initializing Grizzly Blocking Mode");
// Since NIO is not used, rely on Coyote for buffering the response.
setBufferResponse(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void initChannel() {\n //or channelFactory\n bootstrap().channel(NioServerSocketChannel.class);\n }",
"private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }",
"private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}",
"@Override\r\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\tch.pipeline().addLast(\"tcpDecoder\", new MessageDecoder());\r\n\t\tch.pipeline().addLast(\"tcpHandler\", new TcpServerHandler(ac)); \r\n\t\t\r\n\t}",
"@Override\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\tch.pipeline().addLast(\"tcpDecoder\", new MessageDecoder());\n\t\tch.pipeline().addLast(\"tcpHandler\", new TcpServerHandler(ac)); \n\t\t\n\t}",
"@Override\r\n \tpublic void initialize() {\n \t\tThreadRenamingRunnable.setThreadNameDeterminer(ThreadNameDeterminer.CURRENT);\r\n \r\n \t\tInetSocketAddress address;\r\n \r\n \t\tif (m_host == null) {\r\n \t\t\taddress = new InetSocketAddress(m_port);\r\n \t\t} else {\r\n \t\t\taddress = new InetSocketAddress(m_host, m_port);\r\n \t\t}\r\n \r\n \t\tm_queue = new LinkedBlockingQueue<ChannelBuffer>(m_queueSize);\r\n \r\n \t\tExecutorService bossExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Boss-\" + address);\r\n \t\tExecutorService workerExecutor = Threads.forPool().getCachedThreadPool(\"Cat-TcpSocketReceiver-Worker\");\r\n \t\tChannelFactory factory = new NioServerSocketChannelFactory(bossExecutor, workerExecutor);\r\n \t\tServerBootstrap bootstrap = new ServerBootstrap(factory);\r\n \r\n \t\tbootstrap.setPipelineFactory(new ChannelPipelineFactory() {\r\n \t\t\tpublic ChannelPipeline getPipeline() {\r\n \t\t\t\treturn Channels.pipeline(new MyDecoder(), new MyHandler());\r\n \t\t\t}\r\n \t\t});\r\n \r\n \t\tbootstrap.setOption(\"child.tcpNoDelay\", true);\r\n \t\tbootstrap.setOption(\"child.keepAlive\", true);\r\n \t\tbootstrap.bind(address);\r\n \r\n \t\tm_logger.info(\"CAT server started at \" + address);\r\n \t\tm_factory = factory;\r\n \t}",
"@Override\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\tch.pipeline().addLast(new DisardServerHandle());\n\t}",
"private void init() {\n\n\t\tgroup = new NioEventLoopGroup();\n\t\ttry {\n\t\t\thandler = new MoocHandler();\n\t\t\tBootstrap b = new Bootstrap();\n\t\t\t\n\t\t\t\n\t\t\t//ManagementInitializer ci=new ManagementInitializer(false);\n\t\t\t\n\t\t\tMoocInitializer mi=new MoocInitializer(handler, false);\n\t\t\t\n\t\t\t\n\t\t\t//ManagemenetIntializer ci = new ManagemenetIntializer(handler, false);\n\t\t\t//b.group(group).channel(NioSocketChannel.class).handler(handler);\n\t\t\tb.group(group).channel(NioSocketChannel.class).handler(mi);\n\t\t\tb.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000);\n\t\t\tb.option(ChannelOption.TCP_NODELAY, true);\n\t\t\tb.option(ChannelOption.SO_KEEPALIVE, true);\n\n\t\t\t// Make the connection attempt.\n\t\t\tchannel = b.connect(host, port).syncUninterruptibly();\n\n\t\t\t// want to monitor the connection to the server s.t. if we loose the\n\t\t\t// connection, we can try to re-establish it.\n\t\t\tChannelClosedListener ccl = new ChannelClosedListener(this);\n\t\t\tchannel.channel().closeFuture().addListener(ccl);\n\t\t\tSystem.out.println(\" channle is \"+channel);\n\t\t} catch (Exception ex) {\n\t\t\tlogger.error(\"failed to initialize the client connection\", ex);\n\n\t\t}\n\n\t\t// start outbound message processor\n\t//\tworker = new OutboundWorker(this);\n\t//\tworker.start();\n\t}",
"@Override\n public void initChannel(final SocketChannel ch) throws Exception {\n log.info(\"Initializing channel\");\n Channels.add(ch);\n\n final ChannelPipeline pipeline = ch.pipeline();\n SslContext sslCtx = SslContextHelper.createServerSslContext(config);\n if (sslCtx != null) {\n pipeline.addLast(\"ssl\", sslCtx.newHandler(ch.alloc()));\n log.info(\"Done adding SSL Context handler to the pipeline.\");\n }\n pipeline.addLast(\"logHandler\", new LoggingHandler(LogLevel.INFO));\n pipeline.remove(\"logHandler\"); // Comment this line if you do want the log handler to be used.\n pipeline.addLast(\"app\", new EchoServerHandler()); // business logic handler.\n log.info(\"Done adding App handler to the pipeline.\");\n log.info(pipeline.toString());\n }",
"public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }",
"private void initServer() throws IOException {\r\n \t\tLogger.logMessage(\"Binding Server to \" + this.serverIpAddress + \":\" + this.serverPort);\r\n \r\n \t\tthis.isAlive = true;\r\n \t\tthis.serverSocket = new ServerSocket(this.serverPort, this.backLog, this.serverIpAddress);\r\n \t\tthis.dataLayer = DataLayerFactory.getDataLayer();\r\n \r\n \t\t// Generate the grouplist\r\n \t\tCollection<String> dbGroupList = this.dataLayer.getGroups();\r\n \r\n \t\tfor (String group : dbGroupList) {\r\n \t\t\tthis.groupList.addGroup(group);\r\n \t\t}\r\n \r\n \t\tLogger.logMessage(\"Server successfuly bound!\");\r\n \t}",
"public void setSocketChannel(SocketChannel socketChannel);",
"@Override\n\tpublic void initialize() {\n\t\ttransportManager = newServerTransportManager();\n\t\ttransportServer = newTransportServer();\n\t\tserverStateMachine = newTransportServerStateMachine();\n\n\t\tserverStateMachine.setServerTransportComponentFactory(this);\n\t\ttransportManager.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerTransportComponentFactory(this);\n\t\ttransportServer.setServerHostConfig(getServerHostConfig());\n\n\t\tsetInitialized(true);\n\t}",
"public void initialize() throws SocketException{\n defPortUsed = true;\n initializeReal(defPortNumber, defPacketSize);\n }",
"protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(\"FileServerHandler\", new FileServerHandler(transferFile));\n }",
"@Override\n protected void initChannel (SocketChannel ch) throws Exception {\n // can utilize channel to push message to different client since one channel correspond to one client\n System.out.println(\"client socket channel hashcode = \" + ch.hashCode());\n ch.pipeline().addLast(new NettyServerHandler());\n }",
"@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}",
"@Override\n protected void initChannel(NioSocketChannel nioSocketChannel) throws Exception {\n\n nioSocketChannel.pipeline().addLast(new LoginServerHandler());\n }",
"public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}",
"@Override\n protected void initChannel(NioSocketChannel nioSocketChannel) throws Exception {\n nioSocketChannel.pipeline().addLast(new FirstClientHandler());\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(new TimeServerHandler());\n }",
"@Override\n\t\t\t\t\tprotected void initChannel(SocketChannel ch)\n\t\t\t\t\t{\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldPrepender(2));\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldBasedFrameDecoder(0xFFFF, 0, 2));\n\t\t\t\t\t\tch.pipeline().addLast(new PacketCodec());\n\t\t\t\t\t\tch.pipeline().addLast(new ServerChannelHandler(instance));\n\t\t\t\t\t}",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n //4. Add ChannelHandler to intercept events and allow to react on them\n ch.pipeline().addLast(new ChannelHandlerAdapter() {\n @Override\n public void channelActive(ChannelHandlerContext ctx) throws Exception {\n //5. Write message to client and add ChannelFutureListener to close connection once message written\n ctx.write(buf.duplicate()).addListener(ChannelFutureListener.CLOSE);\n }\n });\n }",
"public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }",
"private UDPSender(final URI serverURI) {\n\t\tsuper(serverURI);\n\t\t\n\t\t\t\t\n\t\t//InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());\n\t\tchannelStateListener.addChannelStateAware(this);\n\t\tloggingHandler = new LoggingHandler(InternalLogLevel.ERROR, true);\t\t\n\t\tchannelFactory = new NioDatagramChannelFactory(workerPool);\n\t\tbstrap = new ConnectionlessBootstrap(channelFactory);\n\t\tbstrap.setPipelineFactory(this);\n\t\tbstrap.setOption(\"broadcast\", true);\n\t\tbstrap.setOption(\"localAddress\", new InetSocketAddress(0));\n\t\tbstrap.setOption(\"remoteAddress\", new InetSocketAddress(serverURI.getHost(), serverURI.getPort()));\n\t\tbstrap.setOption(\"receiveBufferSizePredictorFactory\", new FixedReceiveBufferSizePredictorFactory(2048));\n\t\t\n\t\tlisteningSocketAddress = new InetSocketAddress(\"0.0.0.0\", 0);\n\t\t//listeningSocketAddress = new InetSocketAddress(\"127.0.0.1\", 0);\n\t\t\t\n\t\t//senderChannel = (NioDatagramChannel) channelFactory.newChannel(getPipeline());\n\t\tsenderChannel = bstrap.bind();\n\t\tcloseGroup.add(senderChannel);\n\t\tlog(\"Listening on [\" + senderChannel.getLocalAddress()+ \"]\");\t\t\t\t\t\n\t\t\n\t\t\n//\t\tsenderChannel.bind().addListener(new ChannelFutureListener() {\n//\t\t\tpublic void operationComplete(ChannelFuture f) throws Exception {\n//\t\t\t\tif(f.isSuccess()) {\n//\t\t\t\t\tlog(\"Listening on [\" + f.getChannel().getLocalAddress()+ \"]\");\t\t\t\t\t\n//\t\t\t\t} else {\n//\t\t\t\t\tlog(\"Failed to start listener. Stack trace follows\");\n//\t\t\t\t\tf.getCause().printStackTrace(System.err);\n//\t\t\t\t\t\n//\t\t\t\t}\n//\t\t\t\t\n//\t\t\t}\n//\t\t});\n\t\tsenderChannel.getConfig().setBufferFactory(new DirectChannelBufferFactory());\n//\t\tsenderChannel.connect(socketAddress).addListener(new ChannelFutureListener() {\n//\t\t\t@Override\n//\t\t\tpublic void operationComplete(ChannelFuture future) throws Exception {\n//\t\t\t\tconnected.set(true);\t\n//\t\t\t\tsentryState.setState(SentryState.CALLBACK);\n//\t\t\t}\n//\t\t});\n\t\t\n\t\t\n\t\t//socketAddress = new InetSocketAddress(\"239.192.74.66\", 25826);\n\t\tsendHello();\n\t}",
"public void init(){\n\t\tmultiplexingClientServer = new MultiplexingClientServer(selectorCreator);\n\t}",
"@Override\r\n\tpublic void doStart() {\n\t\tbootstrap.group(this.bossEventLoopGroup, this.workerEventLoopGroup)\r\n\t\t\t\t .channel(NioServerSocketChannel.class)\r\n\t\t\t\t //允许在同一端口上启动同一服务器的多个实例,只要每个实例捆绑一个不同的本地IP地址即可\r\n .option(ChannelOption.SO_REUSEADDR, true)\r\n //用于构造服务端套接字ServerSocket对象,标识当服务器请求处理线程全满时,用于临时存放已完成三次握手的请求的队列的最大长度\r\n// .option(ChannelOption.SO_BACKLOG, 1024) // determining the number of connections queued\r\n\r\n //禁用Nagle算法,即数据包立即发送出去 (在TCP_NODELAY模式下,假设有3个小包要发送,第一个小包发出后,接下来的小包需要等待之前的小包被ack,在这期间小包会合并,直到接收到之前包的ack后才会发生)\r\n .childOption(ChannelOption.TCP_NODELAY, true)\r\n //开启TCP/IP协议实现的心跳机制\r\n .childOption(ChannelOption.SO_KEEPALIVE, true)\r\n .childHandler(newInitializerChannelHandler());\r\n\t\ttry {\r\n\t\t\tInetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(),getPort());\r\n\t\t\tchannelFuture = bootstrap.bind(getPort());\r\n//\t\t\tchannelFuture = bootstrap.bind(serverAddress).sync();\r\n\t\t\tLOGGER.info(\"connector {} started at port {},protocal is {}\",getName(),getPort(),getSchema());\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tLOGGER.error(\"error happen when connector {} starting\",getName());\r\n\t\t}\r\n\t}",
"private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }",
"@Override\n public void init(Address receiveAddress) {\n secretGenerator = new Random();\n this.receiveAddress = receiveAddress;\n // Create thread group and handler\n group = new NioEventLoopGroup();\n handler = new UDPConnectionHandler();\n // Initialize listening channel\n try {\n channel = new Bootstrap()\n .group(group)\n .channel(NioDatagramChannel.class)\n .option(ChannelOption.SO_BROADCAST, true)\n .handler(handler)\n .bind(receiveAddress.getPort()).syncUninterruptibly()\n .channel();\n } catch (Exception exception) {\n group.shutdownGracefully();\n throw new RuntimeException(\"Failed to create channel at \" + receiveAddress, exception);\n }\n System.out.println(\"Listening at \" + receiveAddress.toString());\n }",
"public void init(EndpointConfig arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void init(EndpointConfig arg0) {\n\t\t\n\t}",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTP decoder and encoder\n pipeline.addLast(\"logger\", new LoggingHandler());\n pipeline.addLast(new HttpServerCodec());\n pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));\n pipeline.addLast(new MockServerServerCodec(false));\n\n // add handlers\n pipeline.addLast(new HttpProxyHandler(logFilter, HttpProxy.this, securePort != null ? new InetSocketAddress(securePort) : null));\n }",
"public void InitSocket(String server, int port) throws IOException {\n socket = new Socket(server, port);\n outputStream = socket.getOutputStream();\n\n Thread receivingThread = new Thread() {\n @Override\n public void run() {\n try {\n \n BufferedReader reader = new BufferedReader(\n new InputStreamReader(socket.getInputStream()));\n String line;\n while ((line = reader.readLine()) != null)\n notifyObservers(line);\n } catch (IOException ex) {\n notifyObservers(ex);\n }\n }\n };\n receivingThread.start();\n }",
"@Override\r\n\tpublic void init(EndpointConfig arg0) {\n\t\t\r\n\t}",
"@Override\n public void initialize(URL location, ResourceBundle resources) {\n new Thread( ()-> {\n try {\n //Start the server\n ServerSocket serverSocket = new ServerSocket(8080);\n\n //show in terminal server has started\n System.out.println(\"Server Started: at \" + new Date() + \"\\n\");\n\n //main loop that will accept connections\n while (true) {\n //accept a new socket connection, this socket comes from client\n Socket clientSocket = serverSocket.accept();\n\n //thread that will handle what to do with new socket\n new Thread(new HandleAclient(clientSocket)).start();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }).start();\n\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add handler\n InetSocketAddress remoteSocketAddress = new InetSocketAddress(directRemoteHost, directRemotePort);\n pipeline.addLast(new DirectProxyUpstreamHandler(remoteSocketAddress, false, 1048576, new RequestInterceptor(remoteSocketAddress), \" -->\"));\n }",
"private void startConnection() throws IOException {\n bos = new BufferedOutputStream(socket.getOutputStream(), 65536);\n\n byte[] key = new byte[16];\n Random random = new Random();\n random.nextBytes(key);\n String base64Key = Base64.encodeBase64String(key);\n\n byte[] handshake = createHandshake(base64Key);\n bos.write(handshake);\n bos.flush();\n\n InputStream inputStream = socket.getInputStream();\n verifyServerHandshake(inputStream, base64Key);\n\n writerThread.start();\n\n notifyOnOpen();\n\n bis = new BufferedInputStream(socket.getInputStream(), 65536);\n read();\n }",
"public void InitSocket(String server, int port) throws IOException {\r\n socket = new Socket(server, port);\r\n outputStream = socket.getOutputStream();\r\n\r\n Thread receivingThread = new Thread() {\r\n @Override\r\n public void run() {\r\n try {\r\n BufferedReader reader = new BufferedReader(\r\n new InputStreamReader(socket.getInputStream()));\r\n String line;\r\n while ((line = reader.readLine()) != null) {\r\n notifyObservers(line);\r\n }\r\n } catch (IOException ex) {\r\n notifyObservers(ex);\r\n }\r\n }\r\n };\r\n receivingThread.start();\r\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS client -> proxy support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(\"ssl inbound\", new SslHandler(engine));\n\n // add handler\n InetSocketAddress remoteSocketAddress = new InetSocketAddress(directRemoteHost, directRemotePort);\n pipeline.addLast(new DirectProxyUpstreamHandler(remoteSocketAddress, true, 1048576, new RequestInterceptor(remoteSocketAddress), \" -->\"));\n\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(new SslHandler(engine));\n\n // add HTTP decoder and encoder\n pipeline.addLast(new HttpServerCodec());\n pipeline.addLast(new HttpObjectAggregator(Integer.MAX_VALUE));\n pipeline.addLast(new MockServerServerCodec(true));\n\n // add handlers\n pipeline.addLast(new HttpProxyHandler(logFilter, HttpProxy.this, securePort != null ? new InetSocketAddress(securePort) : null));\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add SOCKS decoder and encoder\n pipeline.addLast(new SocksInitRequestDecoder());\n pipeline.addLast(new SocksMessageEncoder());\n\n // add handlers\n pipeline.addLast(new SocksProxyHandler(port != null ? new InetSocketAddress(port) : null, false));\n }",
"private void initServerSock(int port) throws IOException {\n\tserver = new ServerSocket(port);\n\tserver.setReuseAddress(true);\n }",
"@Override\n public void initChannel(SocketChannel ch) throws Exception {\n ch.pipeline().addLast(new OutMessageHandler());\n\n }",
"public void init() {\n\t\ttry {\n\t\t\tthis.is = new ObjectInputStream(clientSocket.getInputStream());\n\t\t\tthis.os = new ObjectOutputStream(clientSocket.getOutputStream());\n\t\t\twhile (this.readCommand()) {}\n\t\t} \n\t\tcatch (IOException e) \n\t\t{\n\t\t\tSystem.out.println(\"XX. There was a problem with the Input/Output Communication:\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public ClientWorker(ServerSocketChannel serverChannel){\n this.serverChannel = serverChannel;\n }",
"void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}",
"public SocketServer() {\n \n super();\n start();\n\n }",
"public void init() {\r\n\t\ttry {\r\n\t\t\tmessages = new ConcurrentLinkedDeque<>();\r\n\t\t\tout = sock.getOutputStream();\r\n\t\t\tin = sock.getInputStream();\t\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tstartMessageThread();\r\n\t}",
"public Server() throws IOException{\n\t\tsuper();\n\t\tthis.serversocket = new java.net.ServerSocket(DEFAULTPORT);\n\t\tif (DEBUG){\n\t\t\tSystem.out.println(\"Server socket created:\" + this.serversocket.getLocalPort());\n\t\t\tclient_list.add(String.valueOf(this.serversocket.getLocalPort()));\n\t\t}\n\t}",
"@Override\n public void initialize(ServerConfiguration config) {\n }",
"private void setUpServerThread() {\n\t\ttry {\n\t\t\tthis.incomingMsgNodes = new TCPServerThread(0, this);\n\t\t\tThread thread = new Thread(incomingMsgNodes);\n\t\t\tthread.start();\n\t\t\tthis.myServerThreadPortNum = incomingMsgNodes.getPort();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage()\n\t\t\t\t\t+ \" Trouble creating Server Socket\");\n\t\t}\n\t}",
"public void initialize(BluetoothSocket socket) throws IOException {\n\t\tthis.socket = socket;\n\t\trfile = this.socket.getInputStream();\n\t\twfile = this.socket.getOutputStream();\n\t\t\n\t\tmessageSender.start();\n\t\tmessageReceiver.start();\n\t}",
"private static void startWebSocketServer() {\n\n Server webSocketServer = new Server();\n ServerConnector connector = new ServerConnector(webSocketServer);\n connector.setPort(PORT);\n webSocketServer.addConnector(connector);\n log.info(\"Connector added\");\n\n // Setup the basic application \"context\" for this application at \"/\"\n // This is also known as the handler tree (in jetty speak)\n ServletContextHandler webSocketContext = new ServletContextHandler(\n ServletContextHandler.SESSIONS);\n webSocketContext.setContextPath(\"/\");\n webSocketServer.setHandler(webSocketContext);\n log.info(\"Context handler set\");\n\n try {\n ServerContainer serverContainer = WebSocketServerContainerInitializer\n .configureContext(webSocketContext);\n log.info(\"Initialize javax.websocket layer\");\n\n serverContainer.addEndpoint(GreeterEndpoint.class);\n log.info(\"Endpoint added\");\n\n webSocketServer.start();\n log.info(\"Server started\");\n\n webSocketServer.join();\n log.info(\"Server joined\");\n\n } catch (Throwable t) {\n log.error(\"Error startWebSocketServer {0}\", t);\n }\n }",
"public void init() {\n configuration.init();\n \n //Connections connections = configuration.getBroker().getConnections(\"topic\");\n Connections connections = configuration.getBrokerPool().getBroker().getConnections(\"topic\");\n \n if (connections == null) {\n handleException(\"Couldn't find the connection factor: \" + \"topic\");\n }\n \n sensorCatalog = new SensorCatalog();\n clientCatalog = new ClientCatalog();\n \n nodeCatalog = new NodeCatalog();\n \n updateManager = new UpdateManager(configuration, sensorCatalog, this);\n updateManager.init();\n \n endpointAllocator = new EndpointAllocator(configuration, nodeCatalog);\n\n registry = new JCRRegistry(this);\n registry.init();\n\n // Initialize Public-End-Point\n if(!isPublicEndPointInit) {\n \tinitPublicEndpoint();\n }\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n NettyCodecAdapter adapter = new NettyCodecAdapter();\n\n ch.pipeline()\n .addLast(\"logging\", new LoggingHandler(LogLevel.INFO))//for debug\n .addLast(\"decoder\", adapter.getDecoder())\n// .addLast(\"http-aggregator\", new HttpObjectAggregator(65536))\n .addLast(\"encoder\", adapter.getEncoder())\n// .addLast(\"http-chunked\", new ChunkedWriteHandler())\n// .addLast(\"server-idle-handler\", new IdleStateHandler(0, 0, 60 * 1000, MILLISECONDS))\n .addLast(\"handler\", nettyServerHandler);\n }",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"@Activate\n public void activate(final BundleContext context) throws IOException\n {\n // set port, use default if not set\n int serverPort = DEFAULT_PORT;\n \n // set SSL flag, use default if not set\n boolean enableSsl = false;\n \n if (context.getProperty(PORT_PROP_KEY) != null)\n {\n serverPort = Integer.parseInt(context.getProperty(PORT_PROP_KEY));\n }\n \n if (context.getProperty(SSL_PROP_KEY) != null)\n {\n enableSsl = Boolean.parseBoolean(context.getProperty(SSL_PROP_KEY));\n }\n\n m_ServerSocket = m_ServerSocketFactory.createServerSocket(serverPort, enableSsl);\n\n m_Logging.info(\"Server socket listening on port %d for remote messages\", m_ServerSocket.getLocalPort());\n \n m_ServerSocketThread = new Thread(new Runnable()\n {\n @Override\n public void run()\n {\n //run until the socket is closed\n while (true)\n {\n try\n {\n final Socket socket = m_ServerSocket.accept(); // NOFORTIFY: unreleased resource:\n //resources are managed by the remote channel lookup\n m_Logging.info(\"Connection made from %s for remote interface\", \n socket.getRemoteSocketAddress());\n \n m_RemoteChannelLookup.newServerSocketChannel(socket);\n }\n catch (final IOException e)\n {\n if (m_ServerSocket.isClosed())\n {\n m_Logging.info(\"Server socket has been closed, will stop accepting connections\");\n return;\n }\n }\n }\n }\n });\n \n m_ServerSocketThread.setName(\"RemoteInterfaceServerSocket\");\n m_ServerSocketThread.start();\n }",
"@Before\n public void setUp() throws IOException {\n serverSocket = new ServerSocket(0, 1);\n }",
"public SSLServerSocketChannel(ServerSocketChannel channel,\n SSLContext context)\n {\n super(channel.provider());\n if (context == null)\n {\n throw new NullPointerException(\"SSLContext context\");\n }\n\n socketChannel = channel;\n sslContext = context;\n }",
"public Server() {\n\t\tinit(new Config());\n\t}",
"@Override\n @SuppressWarnings(\"CallToPrintStackTrace\")\n public void simpleInitApp() {\n \n\n try {\n System.out.println(\"Using port \" + port);\n // create the server by opening a port\n server = Network.createServer(port);\n server.start(); // start the server, so it starts using the port\n } catch (IOException ex) {\n ex.printStackTrace();\n destroy();\n this.stop();\n }\n System.out.println(\"Server started\");\n // create a separat thread for sending \"heartbeats\" every now and then\n new Thread(new NetWrite()).start();\n server.addMessageListener(new ServerListener(), ChangeVelocityMessage.class);\n // add a listener that reacts on incoming network packets\n \n }",
"public void connect (SocketAddress endpoint)\n throws IOException {\n if (state >= CONNECTED)\n throw new IOException (\"socket already connected\");\n if (state != BOUND)\n throw new IOException(\"socket has not been bound\");\n if (endpoint == null)\n throw new IllegalArgumentException();\n if (! (endpoint instanceof InetSocketAddress) )\n throw new IllegalStateException (\"\");\n InetSocketAddress remote = (InetSocketAddress) endpoint;\n remoteAddr = remote.getAddress();\n remotePort = remote.getPort();\n remoteHost = remote.getHostName();\n state = CONNECTED;\n }",
"public InitialValuesConnectionCenter() \n\t{\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\tSystem.err.println(\"IOException ServerConnectionCenter.\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"@Override\n\t\t\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\t\t\tch.pipeline().addLast(new ProtobufVarint32FrameDecoder());\n\t\t\t\tch.pipeline().addLast(new ProtobufDecoder(PersonMsg.Person.getDefaultInstance()));\n\t\t\t ch.pipeline().addLast(new ProtobufVarint32LengthFieldPrepender());\n\t\t\t ch.pipeline().addLast(new ProtobufEncoder());\n\t\t\t}",
"public ServerConnection()\n {\n //Initializing of the variables used in the constructor\n this.hostAddress = \"http://localhost\";\n this.port = 8882;\n }",
"public OOXXServer(){\n\t\ttry\n\t\t{\n\t\t\tserver = new ServerSocket(port);\n\t\t\t\n\t\t}\n\t\tcatch(java.io.IOException e)\n\t\t{\n\t\t}\n\t}",
"@Override\r\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\r\n\r\n if (isSSL) {\r\n SSLEngine engine = SecureSSLContextFactory.getServerContext().createSSLEngine();\r\n engine.setUseClientMode(false);\r\n pipeline.addLast(\"ssl\", new SslHandler(engine));\r\n }\r\n\r\n pipeline.addLast(\"decoder\", new HttpRequestDecoder());\r\n pipeline.addLast(\"encoder\", new HttpResponseEncoder());\r\n\r\n // Remove the following line if you don't want automatic content\r\n // compression.\r\n pipeline.addLast(\"deflater\", new HttpContentCompressor());\r\n \r\n pipeline.addLast( \"http-aggregator\", new HttpObjectAggregator( Integer.MAX_VALUE ) );\r\n\t\t\r\n pipeline.addLast(\"chunkedWriter\",new ChunkedWriteHandler());\r\n\r\n pipeline.addLast(\"handler\", receiveHandler);\r\n\t\t\r\n\t}",
"@Override\r\n\t\t\t\t\tpublic void initChannel(SocketChannel ch)throws Exception {\n\t\t\t\t ChannelPipeline pipeline = ch.pipeline();\r\n\t\t\t\t \r\n\t\t\t\t /**\r\n\t\t\t\t * http-request解码器\r\n\t\t\t\t * http服务器端对request解码\r\n\t\t\t\t */\r\n\t\t\t\t pipeline.addLast(\"decoder\", new HttpRequestDecoder());\r\n\t\t\t\t /**\r\n\t\t\t\t * http-response解码器\r\n\t\t\t\t * http服务器端对response编码\r\n\t\t\t\t */\r\n\t\t\t\t pipeline.addLast(\"encoder\", new HttpResponseEncoder());\r\n\t\t\t\t \r\n\t\t\t\t /**\r\n\t\t\t\t * 压缩\r\n\t\t\t\t * Compresses an HttpMessage and an HttpContent in gzip or deflate encoding\r\n\t\t\t\t * while respecting the \"Accept-Encoding\" header.\r\n\t\t\t\t * If there is no matching encoding, no compression is done.\r\n\t\t\t\t */\r\n\t\t\t\t //pipeline.addLast(\"deflater\", new HttpContentCompressor());\r\n\t\t\t\t /* pipeline.addLast(new LoggingDiyHandler(InternalLogLevel.INFO));\r\n\t\t\t\t \r\n\t\t\t\t pipeline.addLast(\"handler\", new HttpServerHandler());*/\r\n\t\t\t\t\t}",
"public MockSocket () {\n state = UNBOUND;\n }",
"public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }",
"private void initSocketWithHandlers() {\n\t\tfor(String key: eventHandlerMap.keySet()) {\n\t\t\tmSocket.on(key, eventHandlerMap.get(key));\n\t\t}\n\t}",
"public static void init() throws Exception {\n String host = \"localhost\";\n ConnectionFactory factory = new ConnectionFactory();\n factory.setHost(host);\n\n Connection connection = factory.newConnection();\n\n controllerChannel = connection.createChannel();\n controllerChannel.queueDeclare(\n CONTROLLER_QUEUE_NAME,\n true,\n false,\n true,\n null);\n }",
"public interface Server extends Endpoint, Resetable {\n\n /**\n * is bound.\n *\n * @return bound\n */\n boolean isBound();\n\n /**\n * get channels.\n *\n * @return channels\n */\n Collection<Channel> getChannels();\n\n /**\n * get channel.\n *\n * @param remoteAddress\n * @return channel\n */\n Channel getChannel(InetSocketAddress remoteAddress);\n\n}",
"public void initPublicEndpoint() {\n \t//TODO: Register the new Public End Point with in the Content Repository Node\n \tString uniqueId = UUID.randomUUID().toString();\n \t\n \tpublicEndPoint = new JMSEndpoint();\n \tpublicEndPoint.setAddress(uniqueId + \"/public\");\n \t\n \tpublicEndPoint.setProperties(configuration.getBrokerPool().getBroker().getConnections(\"topic\").getParameters());\n \n // save the public endpoint from the registry\n registry.createPublicEndpoint();\n \n publicSender = initPublicSender(new JMSSenderFactory().create(publicEndPoint));\n \t\n \tisPublicEndPointInit = true;\n }",
"public ServerConnecter() {\r\n\r\n\t}",
"public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }",
"private void init() throws IOException {\n m_sock = new Socket(InetAddress.getByAddress(m_address), VIDEO_TO_PC_PORT);\n m_sock.setSoTimeout(READ_TIMEOUT_MS);\n m_sockistream = m_sock.getInputStream();\n m_daistream = new DataInputStream(m_sockistream);\n m_initialized = true;\n }",
"private Channel connect(ChannelInitializer<SocketChannel> handler) {\n // Configure worker pools and buffer allocator\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n Bootstrap b = new Bootstrap();\n b.group(workerGroup);\n b.channel(NioSocketChannel.class);\n b.option(ChannelOption.SO_KEEPALIVE, true);\n // TODO(user): Evaluate use of pooled allocator\n b.option(ChannelOption.ALLOCATOR, UnpooledByteBufAllocator.DEFAULT);\n\n // Install the handler\n b.handler(handler);\n\n // Connect and wait for connection to be available\n ChannelFuture channelFuture = b.connect(host, port);\n try {\n // Wait for the connection\n channelFuture.get(5, TimeUnit.SECONDS);\n channel = channelFuture.channel();\n ChannelFuture closeFuture = channel.closeFuture();\n closeFuture.addListener(new WorkerCleanupListener(b.group()));\n return channel;\n } catch (TimeoutException te) {\n throw new IllegalStateException(\"Timeout waiting for connection to \" + host + \":\" + port, te);\n } catch (Throwable t) {\n throw new IllegalStateException(\"Error connecting to \" + host + \":\" + port, t);\n }\n }",
"public TCPMessengerServer() {\n initComponents();\n customInitComponents();\n listenForClient(); \n }",
"public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }",
"@Override\n public void initialize() {\n\n try {\n /* Bring up the API server */\n logger.info(\"loading API server\");\n apiServer.start();\n logger.info(\"API server started. Say Hello!\");\n /* Bring up the Dashboard server */\n logger.info(\"Loading Dashboard Server\");\n if (dashboardServer.isStopped()) { // it may have been started when Flux is run in COMBINED mode\n dashboardServer.start();\n }\n logger.info(\"Dashboard server has started. Say Hello!\");\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }",
"public Server() {\n\t\t\n\t\ttry {\n\t\t\tss= new ServerSocket(PORT);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace(); // Default\n\t\t}\n\t}",
"public Server() {\n\t\tsession = new WelcomeSession();\n\t\tmPort = DEFAULT_PORT;\n\t\texecutor = Executors.newCachedThreadPool();\n\t}",
"public UDPEchoServer() throws SocketException {\r\n super(DEFAULT_PORT);\r\n }",
"private void initSocket(String host, String port) throws IOException {\n\t\t// check the validity of the host name\n\t\tif (host == null || host.isEmpty()) throw new IllegalArgumentException(\"host == null || host.isEmpty()\");\n\t\t// check the validity of the port number\n\t\tint p = 0;\n\t\ttry {\n\t\t\tp = Integer.parseInt(port);\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(\"Illegal port argument\");\n\t\t}\n\t\tif (p <= 0) {\n\t\t\tthrow new IllegalArgumentException(\"Illegal port argument\");\n\t\t}\n\t\t// establish the network connection\n\t\ttry {\n\t\t\tthis.socket = new Socket(host, p);\n\t\t} catch (IOException e) {\n\t\t\tgetErrorManager().error(\"Failed to establish the network connection\", e,\n\t\t\t\tErrorManager.OPEN_FAILURE);\n\t\t\tthrow e;\n\t\t}\n\t\tsuper.internalSetOutputStream(new BufferedOutputStream(this.socket.getOutputStream()));\n\t}",
"@Before\n\tpublic void setUp() throws Exception {\n\t\tserverChannel = ServerSocketChannel.open();\n\t\tserverChannel.socket().bind(null, 0);\n\t\tportNumber = serverChannel.socket().getLocalPort();\n\t\t\n\t\t// Connect the client\n\t\tFuture<Boolean> result = service.submit(new Runnable() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tclient = new Client(\"bob\");\n\t\t\t\ttry {\n\t\t\t\t\tclient.Connect(\"localhost\", portNumber);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tfail(\"Failure during setup...\");\n\t\t\t\t}\n\t\t\t}\n\t\t}, Boolean.TRUE);\n\t\t\n\t\tchannel = serverChannel.accept();\n\t\t\n\t\t// Get the connection request\n\t\tConnectionRequest conRequest = (ConnectionRequest) this.getMessage(channel);\n\t\t\n\t\tthis.sendMessage(new RequestResponse(Status.SUCCESS), channel);\n\t\tresult.get();\n\t}",
"private void startServer(int port) throws IOException {\n System.out.println(\"Booting the server!\");\n\n // Open the server channel.\n serverSocketChannel = ServerSocketChannel.open();\n serverSocketChannel.bind(new InetSocketAddress(port));\n serverSocketChannel.configureBlocking(false);\n\n // Register the channel into the selector.\n selector = Selector.open();\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n }",
"public Server() throws IOException {\n try {\n this.serverSocket = new ServerSocket(this.port,100, InetAddress.getByName(host));\n } catch (UnknownHostException e) {\n System.out.println(\"Erreur lors de la construction du serveur (Hôte inconnu) - Server Constructor Error\");\n e.printStackTrace();\n } catch(IOException e) {\n e.printStackTrace();\n }\n }",
"public Peer start() throws IOException {\n\t\tboolean isBehindFirewallSet = false;\n\t\tif (behindFirewall == null) {\n\t\t\tbehindFirewall = false;\n\t\t} else {\n\t\t\tisBehindFirewallSet = true;\n\t\t}\n\n\t\tboolean isTcpPortSet = false;\n\t\tif (tcpPort == -1) {\n\t\t\ttcpPort = Ports.DEFAULT_PORT;\n\t\t} else {\n\t\t\tisTcpPortSet = true;\n\t\t}\n\t\t\n\t\tboolean isUdpPortSet = false;\n\t\tif (udpPort == -1) {\n\t\t\tudpPort = Ports.DEFAULT_PORT;\n\t\t} else {\n\t\t\tisUdpPortSet = true;\n\t\t}\n\t\t\n\t\tif (channelServerConfiguration == null) {\n\t\t\tchannelServerConfiguration = createDefaultChannelServerConfiguration();\n\t\t} \n\t\t\n\t\t//post config\n\t\tif(isBehindFirewallSet) {\n\t\t\tchannelServerConfiguration.behindFirewall(behindFirewall);\n\t\t}\n\t\tif(isTcpPortSet || isUdpPortSet) {\n\t\t\tchannelServerConfiguration.ports(new Ports(tcpPort, udpPort));\n\t\t}\n\t\t\n\t\tif(tcpPortForwarding == -1 && udpPortForwarding == -1) {\n\t\t\tchannelServerConfiguration.portsForwarding(new Ports());\n\t\t} else {\n\t\t\tchannelServerConfiguration.portsForwarding(new Ports(tcpPortForwarding, udpPortForwarding));\n\t\t}\n\t\t\n\t\tif (channelClientConfiguration == null) {\n\t\t\tchannelClientConfiguration = createDefaultChannelClientConfiguration();\n\t\t}\n\t\tif (keyPair == null) {\n\t\t\tkeyPair = EMPTY_KEY_PAIR;\n\t\t}\n\t\tif (p2pID == -1) {\n\t\t\tp2pID = 1;\n\t\t}\n\t\t\n\t\t\n\t\tif (bindings == null) {\n\t\t\tbindings = new Bindings();\n\t\t} else {\n\t\t\tchannelServerConfiguration.bindings(bindings);\n\t\t\tchannelClientConfiguration.bindings(bindings);\n\t\t}\n\t\tif (peerMap == null) {\n\t\t\tpeerMap = new PeerMap(new PeerMapConfiguration(peerId));\n\t\t}\n\n\t\tif (masterPeer == null && scheduledExecutorService == null) {\n\t\t\tscheduledExecutorService = Executors.newScheduledThreadPool(1);\n\t\t}\n\n\t\tif(sendBehavior == null) {\n\t\t\tsendBehavior = new DefaultSendBehavior();\n\t\t}\n\t\t\n\t\tfinal PeerCreator peerCreator;\n\t\tif (masterPeer != null) {\n\t\t\tpeerCreator = new PeerCreator(masterPeer.peerCreator(), peerId, keyPair);\n\t\t} else {\n\t\t\tpeerCreator = new PeerCreator(p2pID, peerId, keyPair, channelServerConfiguration,\n\t\t\t channelClientConfiguration, scheduledExecutorService, sendBehavior);\n\t\t}\n\n\t\tfinal Peer peer = new Peer(p2pID, peerId, peerCreator);\n\t\t//add shutdown hook to master peer\n\t\tif (masterPeer != null) {\n\t\t\tmasterPeer.addShutdownListener(new Shutdown() {\n\t\t\t\t@Override\n\t\t\t\tpublic BaseFuture shutdown() {\n\t\t\t\t\treturn peer.shutdown();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tPeerBean peerBean = peerCreator.peerBean();\n\t\t\n\t\tpeerBean.addPeerStatusListener(peerMap);\n\t\t\n\t\tConnectionBean connectionBean = peerCreator.connectionBean();\n\n\t\tpeerBean.peerMap(peerMap);\n\t\tpeerBean.keyPair(keyPair);\n\n\t\tif (bloomfilterFactory == null) {\n\t\t\tpeerBean.bloomfilterFactory(new DefaultBloomfilterFactory());\n\t\t}\n\n\t\tif (broadcastHandler == null) {\n\t\t\tbroadcastHandler = new StructuredBroadcastHandler();\n\t\t}\n\t\tbroadcastHandler.init(peer);\n\t\t\n\t\t// set/enable RPC\n\n\t\tif (isEnableHandShakeRPC()) {\n\t\t\tPingRPC pingRPC = new PingRPC(peerBean, connectionBean);\n\t\t\tpeer.pingRPC(pingRPC);\n\t\t}\n\t\t\n\t\tif (isEnableQuitRPC()) {\n\t\t\tQuitRPC quitRPC = new QuitRPC(peerBean, connectionBean);\n\t\t\tquitRPC.addPeerStatusListener(peerMap);\n\t\t\tpeer.quitRPC(quitRPC);\n\t\t}\n\n\t\tif (isEnableNeighborRPC()) {\n\t\t\tNeighborRPC neighborRPC = new NeighborRPC(peerBean, connectionBean);\n\t\t\tpeer.neighborRPC(neighborRPC);\n\t\t}\n\n\t\tif (isEnableDirectDataRPC()) {\n\t\t\tDirectDataRPC directDataRPC = new DirectDataRPC(peerBean, connectionBean);\n\t\t\tpeer.directDataRPC(directDataRPC);\n\t\t}\n\n\t\tif (isEnableBroadcast()) {\n\t\t\tBroadcastRPC broadcastRPC = new BroadcastRPC(peerBean, connectionBean, broadcastHandler);\n\t\t\tpeer.broadcastRPC(broadcastRPC);\n\t\t}\n\t\t\n\t\tif (isEnableRouting() && isEnableNeighborRPC()) {\n\t\t\tDistributedRouting routing = new DistributedRouting(peerBean, peer.neighborRPC());\n\t\t\tpeer.distributedRouting(routing);\n\t\t}\n\n\t\tif (maintenanceTask == null && isEnableMaintenance()) {\n\t\t\tmaintenanceTask = new MaintenanceTask();\n\t\t}\n\n\t\tif (maintenanceTask != null) {\n\t\t\tmaintenanceTask.init(peer, connectionBean.timer());\n\t\t\tmaintenanceTask.addMaintainable(peerMap);\n\t\t}\n\t\tpeerBean.maintenanceTask(maintenanceTask);\n\n\t\t\t\t\n\t\tfor (PeerInit peerInit : toInitialize) {\n\t\t\tpeerInit.init(peer);\n\t\t}\n\t\t\n\t\treturn peer;\n\t}",
"public HttpServerChannelInitializer(\n final ProxyAuthorizationManager authorizationManager, \n final ChannelGroup channelGroup, \n final ChainProxyManager chainProxyManager, \n final HandshakeHandlerFactory handshakeHandlerFactory,\n final RelayChannelInitializerFactory relayChannelInitializerFactory, \n final EventLoopGroup clientWorker) {\n \n this.handshakeHandlerFactory = handshakeHandlerFactory;\n this.relayChannelInitializerFactory = relayChannelInitializerFactory;\n this.clientWorker = clientWorker;\n \n log.debug(\"Creating server with handshake handler: {}\", \n handshakeHandlerFactory);\n this.authenticationManager = authorizationManager;\n this.channelGroup = channelGroup;\n this.chainProxyManager = chainProxyManager;\n //this.ksm = ksm;\n \n if (LittleProxyConfig.isUseJmx()) {\n setupJmx();\n }\n }",
"public NioDatagramChannel() {\n/* 116 */ this(newSocket(DEFAULT_SELECTOR_PROVIDER));\n/* */ }",
"@Override\n\tpublic boolean init()\n\t{\n\t\tentityMap = new EntityIDMap();\n\t\t\n\t\tServerBootstrap bootstrap = new ServerBootstrap();\n\t\tbootstrap.group(bossGroup, workerGroup)\n\t\t\t\t.channel(NioServerSocketChannel.class) // Channel type\n\t\t\t\t.childHandler(new ChannelInitializer<SocketChannel>() // Setup ChannelInitializer\n\t\t\t\t{\n\t\t\t\t\t@Override\n\t\t\t\t\tprotected void initChannel(SocketChannel ch)\n\t\t\t\t\t{\n\t\t\t\t\t\t// On client connect:\n\t\t\t\t\t\t// Send back client-id\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Client side:\n\t\t\t\t\t\t// Send back position of player\n\t\t\t\t\t\t// client id | pos x | pos y | pos z\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Server side:\n\t\t\t\t\t\t// Broadcast all player positions\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldPrepender(2));\n\t\t\t\t\t\tch.pipeline().addLast(new LengthFieldBasedFrameDecoder(0xFFFF, 0, 2));\n\t\t\t\t\t\tch.pipeline().addLast(new PacketCodec());\n\t\t\t\t\t\tch.pipeline().addLast(new ServerChannelHandler(instance));\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.option(ChannelOption.SO_BACKLOG, 128)\n\t\t\t\t.childOption(ChannelOption.SO_KEEPALIVE, true);\n\t\t\n\t\t// Bind & start accepting connections\n\t\ttry\n\t\t{\n\t\t\tChannelFuture f = bootstrap.bind(this.hostPort).sync();\n\t\t\tserverChannel = f.channel();\n\t\t}\n\t\tcatch (InterruptedException e)\n\t\t{\n\t\t\tSystem.err.println(\"Unable to bind to the requested port\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"@Override\n\tprotected void initInternal() throws LifecycleException {\n bootstrap = new ServerBootstrap();\n //初始化\n bootstrap.group(bossGroup, workGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>(){\n\n\t @Override\n\t protected void initChannel(SocketChannel ch) throws Exception {\n\t // TODO Auto-generated method stub\n\t //目前是每次new出来 由于4.0不允许加入加入一个ChannelHandler超过一次,除非它由@Sharable注解,或者每次new出来\n\t //ch.pipeline().addLast(\"idleChannelTester\", new IdleStateHandler(10, 5, 30));\n\t //ch.pipeline().addLast(\"keepaliveTimeoutHandler\", keepaliveTimeoutHandler);\n\t \t \n\t // server端接收到的是httpRequest,所以要使用HttpRequestDecoder进行解码\n\t ch.pipeline().addLast(\"http-encoder\", new HttpRequestDecoder()); \n\t //将解析出来的http报文的数据组装成为封装好的httpRequest对象 \n\t ch.pipeline().addLast(\"http-aggregator\", new HttpObjectAggregator(1024 * 1024));\n\t // server端发送的是httpResponse,所以要使用HttpResponseEncoder进行编码\n\t ch.pipeline().addLast(\"http-decoder\", new HttpResponseEncoder());\n\t //主要用于处理大数据流\n\t ch.pipeline().addLast(\"http-chunkedWriter\", new ChunkedWriteHandler()); \n\t //加强业务逻辑处理效率\n\t if(null == eventExecutor){\n\t \tch.pipeline().addLast(\"http-processor\",new HttpHandler()); \n\t }else {\n\t\t ch.pipeline().addLast(eventExecutor,\"http-processor\",new HttpHandler()); \n\t }\n\t \n\t /**\n\t // 这里只允许增加无状态允许共享的ChannelHandler,对于有状态的channelHandler需要重写\n\t // getPipelineFactory()方法\n\t for (Entry<String, ChannelHandler> channelHandler : channelHandlers.entrySet()) {\n\t ch.pipeline().addLast(channelHandler.getKey(), channelHandler.getValue());\n\t }\n\t \n\t **/\n\t }\n \n }) \n .option(ChannelOption.SO_BACKLOG, 1024000)\n .option(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.SO_REUSEADDR, true)\n .childOption(ChannelOption.TCP_NODELAY, true) //tcp\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\t}",
"private void initialize() throws IOException, ServletException, URISyntaxException {\n\n LOG.info(\"Initializing the internal Server\");\n Log.setLog(new Slf4jLog(Server.class.getName()));\n\n /*\n * Create and configure the server\n */\n this.server = new Server();\n this.serverConnector = new ServerConnector(server);\n this.serverConnector.setReuseAddress(Boolean.TRUE);\n\n LOG.info(\"Server configure ip = \" + DEFAULT_IP);\n LOG.info(\"Server configure port = \" + DEFAULT_PORT);\n\n this.serverConnector.setHost(DEFAULT_IP);\n this.serverConnector.setPort(DEFAULT_PORT);\n this.server.addConnector(serverConnector);\n\n /*\n * Setup the basic application \"context\" for this application at \"/iop-node\"\n */\n this.servletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);\n this.servletContextHandler.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n this.server.setHandler(servletContextHandler);\n\n /*\n * Initialize webapp layer\n */\n WebAppContext webAppContext = new WebAppContext();\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH);\n\n URL webPath = JettyEmbeddedAppServer.class.getClassLoader().getResource(\"web\");\n LOG.info(\"webPath = \" + webPath.getPath());\n\n webAppContext.setResourceBase(webPath.toString());\n webAppContext.setContextPath(JettyEmbeddedAppServer.DEFAULT_CONTEXT_PATH+\"/web\");\n webAppContext.addBean(new ServletContainerInitializersStarter(webAppContext), true);\n webAppContext.setWelcomeFiles(new String[]{\"index.html\"});\n webAppContext.addFilter(AdminRestApiSecurityFilter.class, \"/rest/api/v1/admin/*\", EnumSet.of(DispatcherType.REQUEST));\n webAppContext.setInitParameter(\"org.eclipse.jetty.servlet.Default.dirAllowed\", \"false\");\n servletContextHandler.setHandler(webAppContext);\n server.setHandler(webAppContext);\n\n /*\n * Initialize restful service layer\n */\n ServletHolder restfulServiceServletHolder = new ServletHolder(new HttpServlet30Dispatcher());\n restfulServiceServletHolder.setInitParameter(\"javax.ws.rs.Application\", JaxRsActivator.class.getName());\n restfulServiceServletHolder.setInitParameter(\"resteasy.use.builtin.providers\", \"true\");\n restfulServiceServletHolder.setAsyncSupported(Boolean.TRUE);\n webAppContext.addServlet(restfulServiceServletHolder, \"/rest/api/v1/*\");\n\n this.server.dump(System.err);\n\n }",
"public Server(){\n\t\ttry {\n\t\t\t// initialize the server socket with the specified port\n\t\t\tsetServerSocket(new ServerSocket(PORT));\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IO Exception while creating a server\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void run() {\n ServerSocketChannelFactory acceptorFactory = new OioServerSocketChannelFactory();\n ServerBootstrap server = new ServerBootstrap(acceptorFactory);\n\n // The pipelines string together handlers, we set a factory to create\n // pipelines( handlers ) to handle events.\n // For Netty is using the reactor pattern to react to data coming in\n // from the open connections.\n server.setPipelineFactory(new EchoServerPipelineFactory());\n\n server.bind(new InetSocketAddress(port));\n }",
"public AsyncServer(int port) throws IOException {\n serverChannel= AsynchronousServerSocketChannel.open();\n serverChannel.bind(new InetSocketAddress(port));\n log.debug(serverChannel.getLocalAddress().toString());\n InetSocketAddress address = (InetSocketAddress) serverChannel.getLocalAddress();\n this.port = address.getPort();\n log.debug(\"PORT:\" + this.port);\n log.debug(Integer.toString(port));\n results = ConcurrentHashMap.newKeySet();\n clientChannels = ConcurrentHashMap.newKeySet();\n }",
"public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }",
"@Override\n public void run() {\n eventLoopGroup = EPOLL ? new EpollEventLoopGroup() : new NioEventLoopGroup();\n try {\n System.out.println(startServerMsg);\n LOGGER.info(startServerMsg);\n new ServerBootstrap()\n .group(eventLoopGroup)\n .channel(EPOLL ? EpollServerSocketChannel.class : NioServerSocketChannel.class)\n .childOption(ChannelOption.TCP_NODELAY, true)\n .childOption(ChannelOption.SO_KEEPALIVE,true)\n .childOption(ChannelOption.RCVBUF_ALLOCATOR,new AdaptiveRecvByteBufAllocator(1024,16*1024,1024*1024))\n .childHandler(new ChannelInitializer() {\n @Override\n protected void initChannel(Channel ch) {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(\"decoder\", new Decoder());\n pipeline.addLast(\"handler\",new TcpServerHandler(viewModel));\n }\n })\n .bind(port).sync().channel().closeFuture().syncUninterruptibly();\n } catch (InterruptedException e) {\n LOGGER.error(\"Failed to start server : \",e);\n e.printStackTrace();\n } finally {\n System.out.println(ANSI_RED+\"Server shutting down.\"+ANSI_RESET);\n LOGGER.info(\"Server shutting down.\");\n eventLoopGroup.shutdownGracefully();\n\n }\n }"
] | [
"0.72335994",
"0.6983906",
"0.6911856",
"0.6817181",
"0.68101037",
"0.6792361",
"0.672329",
"0.6704047",
"0.667501",
"0.6662866",
"0.653557",
"0.65231293",
"0.65087867",
"0.64652795",
"0.64592993",
"0.64456695",
"0.6358914",
"0.63137525",
"0.6311118",
"0.6292821",
"0.62586606",
"0.6258101",
"0.62450063",
"0.6232082",
"0.6210385",
"0.61971015",
"0.61954284",
"0.6193731",
"0.61882377",
"0.6175311",
"0.61751974",
"0.61751974",
"0.61511105",
"0.61503744",
"0.6123398",
"0.61214554",
"0.6120611",
"0.61195797",
"0.6080946",
"0.60715073",
"0.6061605",
"0.60523933",
"0.6033981",
"0.60068506",
"0.6001958",
"0.5986121",
"0.5980361",
"0.59767854",
"0.5971184",
"0.59625703",
"0.5959927",
"0.59556335",
"0.5946019",
"0.59374493",
"0.5930196",
"0.5928559",
"0.59251994",
"0.59128296",
"0.5901297",
"0.58946526",
"0.58944434",
"0.58827627",
"0.5859678",
"0.5855167",
"0.5854061",
"0.58418226",
"0.58414495",
"0.58396935",
"0.5832908",
"0.58278644",
"0.581395",
"0.5806301",
"0.5801437",
"0.57951194",
"0.5792714",
"0.57919824",
"0.578806",
"0.576861",
"0.5748463",
"0.5744532",
"0.57417655",
"0.57345456",
"0.5730915",
"0.5726741",
"0.57262737",
"0.5720861",
"0.57104486",
"0.57091767",
"0.5708421",
"0.5691847",
"0.5685293",
"0.5683578",
"0.5678658",
"0.5663757",
"0.5649193",
"0.56121445",
"0.56113803",
"0.56102",
"0.5603077",
"0.5601191"
] | 0.6833655 | 3 |
Create a pool of ReadBlockingTask | private void initReadBlockingTask(int size){
for (int i=0; i < size; i++){
getReadTasks().offer(newReadBlockingTask(false));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ReadBlockingTask newReadBlockingTask(boolean initialize){\n \n ReadBlockingTask task = new ReadBlockingTask();\n task.setSelectorThread(this);\n task.setPipeline(getProcessorPipeline());\n \n task.setRecycle(isRecycleTasks());\n task.attachProcessor(newProcessorTask(initialize));\n task.setPipelineStatistic(getPipelineStat());\n task.setSecure(secure);\n \n return task;\n }",
"protected ReadBlockingTask getReadBlockingTask(Socket socket){\n ReadBlockingTask task = null;\n if (isRecycleTasks()) {\n task = (ReadBlockingTask)getReadTasks().poll();\n }\n \n if (task == null){\n task = newReadBlockingTask(false);\n } \n \n ProcessorTask processorTask = task.getProcessorTask(); \n processorTask.setSocket(socket);\n \n return task;\n }",
"protected abstract void createPool();",
"private static void useFixedSizePool(){\n ExecutorService executor = Executors.newFixedThreadPool(10);\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n IntStream.range(0, 20).boxed().forEach(i -> {\n executor.execute(() -> {\n sleepSeconds(10);\n System.out.println(Thread.currentThread().getName() + \"[\" + i + \"]\");\n });\n });\n sleepSeconds(1);\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n }",
"OMMPool getPool();",
"public Class getReadTask(SelectorThread selectorThread);",
"public List<CaptureTask> loadTaskToTaskPool(int poolSize) {\n\t\treturn null;\r\n\t}",
"private CollectTaskPool() {\n\t\tsuper();\n\t}",
"private static void threadPoolInit() {\n ExecutorService service = Executors.newCachedThreadPool();\n try {\n for (int i = 1; i <= 10; i++) {\n service.execute(() -> {\n System.out.println(Thread.currentThread().getName() + \" 办理业务...\");\n });\n try {\n TimeUnit.MILLISECONDS.sleep(1L);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n service.shutdown();\n }\n }",
"ActorThreadPool getThreadPool();",
"public interface FileParserPool<T> extends AutoCloseable {\n\n ListenableFuture<T> getManifest(\n BuckEventBus buckEventBus,\n Cell cell,\n Watchman watchman,\n Path parseFile,\n ListeningExecutorService executorService);\n}",
"private void startRead() {\n ExecutorService service = Executors.newFixedThreadPool(this.countReadThreads);\n while (!this.files.isEmpty() || !this.isWorkSearch()) {\n service.submit(this.threads.getReadThread());\n }\n service.shutdown();\n }",
"public BufferPool(int numPages) {\n // some code goes here\n this.pageNum = numPages;\n this.bufferedPages = new ConcurrentHashMap<PageId, Node>();\n currentTransactions = new ConcurrentHashMap<TransactionId, Long>();\n lockManager = new LockManager();\n }",
"public BlockingObjectPool(int size) {\n synchronized (pool) {\n range(0, size)\n .forEach(i -> pool.add(new Object()));\n }\n }",
"public synchronized List getBufferForReading() {\n// if some writer is writing, wait until no writer is writing \n while (readerNumber < 0) {\n try {\n this.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n// when readerNumber >= 0 \n readerNumber++;\n return buffer;\n }",
"Connection createConnection(ExecutorService pool);",
"public static void main(String[] args){ new ThreadPoolBlockingServer().processRequests(); }",
"public void collectAsync() throws IOException {\n rmiAcceptor = new RMIAcceptor(rmiPort);\n socketAcceptor = new SocketAcceptor(socketPort);\n // We prepare the task to get our first Future, it will then be overwritten once we get the promised result\n currentRMITask = threadPool.submit(rmiAcceptor);\n currentSocketTask = threadPool.submit(socketAcceptor);\n\n threadPool.execute(this::scheduledTask);\n }",
"private JedisPool getPool() {\n if (pool == null) {\n JedisPoolConfig config = new JedisPoolConfig();\n config.setMinIdle(poolMinIdle);\n config.setMaxIdle(poolMaxIdle);\n config.setMaxTotal(poolMaxTotal);\n pool = new JedisPool(config, host, port, (int) timeout);\n logger.debug(\"Creando jedisPool@ \" + host + \":\" + port + \". MinIdle/MaxIdle/MaxTotal: \" + poolMinIdle + \"/\" + poolMaxIdle + \"/\" + poolMaxTotal + \". Timeout: \" + timeout);\n }\n return pool;\n }",
"Task poll();",
"public static void main(String[] args) {\n ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(2, 2, 0, TimeUnit.NANOSECONDS, new ArrayBlockingQueue<>(10));\n threadPoolExecutor.execute(() -> {\n System.out.println(Thread.currentThread().getName() + \" Task A over!\");\n semaphore.release();\n });\n threadPoolExecutor.execute(() -> {\n System.out.println(Thread.currentThread().getName() + \" Task A over!\");\n semaphore.release();\n });\n\n try {\n semaphore.acquire(2);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n threadPoolExecutor.execute(() -> {\n System.out.println(Thread.currentThread().getName() + \" Task B over!\");\n semaphore.release();\n });\n threadPoolExecutor.execute(() -> {\n System.out.println(Thread.currentThread().getName() + \" Task B over!\");\n semaphore.release();\n });\n\n try {\n semaphore.acquire(2);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n System.out.println(\"all task over!\");\n threadPoolExecutor.shutdown();\n }",
"private BlocksPool() {\n this(DEFAULT_BLOCK_SIZE_BYTES);\n }",
"@Override\n\t\tpublic void run() {\n\t\t\tArrayBlockingQueue<ByteBuffer> cachedBuffers = null;\n\t\t\tScheduledFuture<?> futureP = null;\n\t\t\tScheduledFuture<?> futureA = null;\n\t\t\tScheduledFuture<?> futureB = null;\n\t\t\ttry {\n\t\t\t\tScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(1, new ThreadFactory() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic Thread newThread(@Nonnull Runnable r) {\n\t\t\t\t\t\tThread t = new Thread(THREAD_GROUP, r);\n\t\t\t\t\t\tt.setDaemon(true);\n\t\t\t\t\t\treturn t;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tByteBuffer b = ByteBuffer.wrap(genId);\n\t\t\t\tb.putInt(workerId);\n\t\t\t\tb.putLong(Long.reverse(System.nanoTime()) ^ System.currentTimeMillis());\n\t\t\t\tb.putInt(ThreadLocalFixedSeedRandom.current().nextInt());\n\t\t\t\tb.flip();\n\t\t\t\tb.get(genId);\n\n\t\t\t\t// tasks should be removed if the future is canceled\n\t\t\t\texecutor.setRemoveOnCancelPolicy(true);\n\n\t\t\t\t// make sure shutdown removes all pending tasks\n\t\t\t\texecutor.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);\n\t\t\t\texecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);\n\n\t\t\t\tcachedBuffers = new ArrayBlockingQueue<>(CACHED_BUFFERS);\n\t\t\t\tfor (int i = 0; i < CACHED_BUFFERS; i++) {\n\t\t\t\t\tByteBuffer buff = ByteBuffer.allocate(BUFFER_SIZE);\n\t\t\t\t\tif (rustMode) {\n\t\t\t\t\t\tbuff.order(ByteOrder.LITTLE_ENDIAN);\n\t\t\t\t\t}\n\t\t\t\t\tcachedBuffers.add(buff);\n\t\t\t\t}\n\n\t\t\t\tint personSize = personsGenerator.itemSize();\n\t\t\t\tint auctionSize = auctionsGenerator.itemSize();\n\t\t\t\tint bidSize = bidGenerator.itemSize();\n\n\t\t\t\tlong ratio = targetPartitionSize / TOTAL_EVENT_RATIO;\n\t\t\t\tlong personsToGenerate = (PERSON_EVENT_RATIO * ratio) / personSize;\n\t\t\t\tlong auctionsToGenerate = (AUCTION_EVENT_RATIO * ratio) / auctionSize;\n\t\t\t\tlong bidsToGenerate = (BID_EVENT_RATIO * ratio) / auctionSize;\n\t\t\t\tlong recordsToGenerate = personsToGenerate + auctionsToGenerate + bidsToGenerate;\n\n\t\t\t\tint itemsPerBufferPerson = (BUFFER_SIZE - METADATA_SIZE) / personSize;\n\t\t\t\tint itemsPerBufferAuction = (BUFFER_SIZE - METADATA_SIZE) / auctionSize;\n\t\t\t\tint itemsPerBufferBid = (BUFFER_SIZE - METADATA_SIZE) / bidSize;\n\n\t\t\t\tAtomicLong sharedCounterPerson = new AtomicLong();\n\t\t\t\tAtomicLong sharedCounterAuction = new AtomicLong();\n\t\t\t\tAtomicLong sharedCounterBid = new AtomicLong();\n\n\t\t\t\tstarter.countDown();\n\t\t\t\tfairStarter.await();\n\n\t\t\t\tThroughtputLogger personLogger = new ThroughtputLogger(sharedCounterPerson, csvDirectory, name, topicNamePerson + \"-\" + workerId, 5, personSize);\n\t\t\t\tfutureP = executor.scheduleAtFixedRate(personLogger, 5, 5, TimeUnit.SECONDS);\n\n\t\t\t\tThroughtputLogger auctionLogger = new ThroughtputLogger(sharedCounterAuction, csvDirectory, name, topicNameAuction + \"-\" + workerId,5, auctionSize);\n\t\t\t\tfutureA = executor.scheduleAtFixedRate(auctionLogger, 6, 5, TimeUnit.SECONDS);\n\n\t\t\t\tThroughtputLogger bidsLogger = new ThroughtputLogger(sharedCounterBid, csvDirectory, name, topicNameBid + \"-\" + workerId,5, bidSize);\n\t\t\t\tfutureB = executor.scheduleAtFixedRate(bidsLogger, 6, 5, TimeUnit.SECONDS);\n\n\t\t\t\tdouble startMs = System.currentTimeMillis();\n\t\t\t\tlong sentBytes = 0;\n\t\t\t\tThreadLocalFixedSeedRandom randomness = ThreadLocalFixedSeedRandom.current();\n\n\n\t\t\t\tlong desiredThroughputBytesPerSecondMax = desiredThroughputBytesPerSecond;\n\t\t\t\tlong desiredThroughputBytesPerSecondMin = varyingWorkload ? 1024 * 1024 : desiredThroughputBytesPerSecond; // 1 MB/s\n\t\t\t\tlong throughputDelta = varyingWorkload ? 512 * 1024 : 0;\n\t\t\t\tlong currentThroughput = desiredThroughputBytesPerSecondMin;\n\t\t\t\tlong throughputChangeTimestamp = 0;\n\n\t\t\t\tRateLimiter throughputThrottler = RateLimiter.create(currentThroughput, 5, TimeUnit.SECONDS);\n\t\t\t\tLOG.debug(\"Create throughputThrottler for {} -> << {} MB/sec : {} MB/sec >>\",\n\t\t\t\t\t\tworkerId, desiredThroughputBytesPerSecondMin / ONE_MEGABYTE, desiredThroughputBytesPerSecondMax / ONE_MEGABYTE);\n\t\t\t\tint chkP = personsGenerator.genChecksum();\n\t\t\t\tint chkA = auctionsGenerator.genChecksum();\n\t\t\t\tint chkB = bidGenerator.genChecksum();\n\t\t\t\tlong pendingPerson = (recordsToGenerate / TOTAL_EVENT_RATIO) * PERSON_EVENT_RATIO;\n\t\t\t\tlong pendingAuctions = (recordsToGenerate / TOTAL_EVENT_RATIO) * AUCTION_EVENT_RATIO;\n\t\t\t\tlong pendingBids = (recordsToGenerate / TOTAL_EVENT_RATIO) * BID_EVENT_RATIO;\n\t\t\t\tlong sentBytesDelta = 0;\n\t\t\t\tByteBuffer bufP = cachedBuffers.take();\n\t\t\t\tByteBuffer bufA = cachedBuffers.take();\n\t\t\t\tByteBuffer bufB = cachedBuffers.take();\n\t\t\t\tbufA.putInt(chkA);\n\t\t\t\tbufP.putInt(chkP);\n\t\t\t\tbufB.putInt(chkB);\n\t\t\t\tint itemsInThisBufferA = (int) Math.min(itemsPerBufferAuction, pendingAuctions);\n\t\t\t\tint itemsInThisBufferP = (int) Math.min(itemsPerBufferPerson, pendingPerson);\n\t\t\t\tint itemsInThisBufferB = (int) Math.min(itemsPerBufferBid, pendingBids);\n\t\t\t\tlong backlogPerson = pendingPerson - itemsInThisBufferP;\n\t\t\t\tlong backlogAuction = pendingAuctions - itemsInThisBufferA;\n\t\t\t\tlong backlogBid = pendingBids - itemsInThisBufferA;\n\t\t\t\tbufP.putInt(itemsInThisBufferP);\n\t\t\t\tbufP.putLong(backlogPerson);\n\t\t\t\tbufA.putInt(itemsInThisBufferA);\n\t\t\t\tbufA.putLong(backlogAuction);\n\t\t\t\tbufB.putInt(itemsInThisBufferB);\n\t\t\t\tbufB.putLong(backlogBid);\n\n\t\t\t\tlong sentPersons = 0;\n\t\t\t\tlong sentAuctions = 0;\n\t\t\t\tlong sentBids = 0;\n\t\t\t\tlong eventId = 0;\n\n\t\t\t\tfor (; eventId < recordsToGenerate; eventId++) {\n\n\t\t\t\t\tfinal long timestamp = System.currentTimeMillis();\n\n\t\t\t\t\tlong rem = eventId % TOTAL_EVENT_RATIO;\n\t\t\t\t\tif (rem < PERSON_EVENT_RATIO) {\n\t\t\t\t\t\tpersonsGenerator.writeItem(eventId, timestamp, randomness, bufP);\n\t\t\t\t\t\tpendingPerson--;\n\t\t\t\t\t\tif (bufP.remaining() < personSize) {\n\t\t\t\t\t\t\tbufP.position(bufP.position() + bufP.remaining());\n\t\t\t\t\t\t\tProducerRecord<byte[], ByteBuffer> kafkaRecord = new ProducerRecord<>(topicNamePerson, targetPartition, genId, bufP);\n\t\t\t\t\t\t\tkafkaProducerPersons.send(kafkaRecord, new InternalCallback(cachedBuffers, bufP, sharedCounterPerson, itemsInThisBufferP));\n\t\t\t\t\t\t\tsentPersons += itemsInThisBufferP;\n\t\t\t\t\t\t\tbufP = cachedBuffers.take();\n\t\t\t\t\t\t\tbufP.putInt(chkP);\n\t\t\t\t\t\t\titemsInThisBufferP = (int) Math.min(itemsPerBufferPerson, pendingPerson);\n\t\t\t\t\t\t\tbacklogPerson = pendingPerson - itemsInThisBufferP;\n\t\t\t\t\t\t\tbufP.putInt(itemsInThisBufferP);\n\t\t\t\t\t\t\tbufP.putLong(backlogPerson);\n\t\t\t\t\t\t\tsentBytes += BUFFER_SIZE;\n\t\t\t\t\t\t\tsentBytesDelta += BUFFER_SIZE;\n\t\t\t\t\t\t\tthroughputThrottler.acquire(BUFFER_SIZE);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (rem < (PERSON_EVENT_RATIO + AUCTION_EVENT_RATIO)) {\n\t\t\t\t\t\tauctionsGenerator.writeItem(eventId, timestamp, randomness, bufA);\n\t\t\t\t\t\tpendingAuctions--;\n\t\t\t\t\t\tif (bufA.remaining() < auctionSize) {\n\t\t\t\t\t\t\tbufA.position(bufA.position() + bufA.remaining());\n\t\t\t\t\t\t\tProducerRecord<byte[], ByteBuffer> kafkaRecord = new ProducerRecord<>(topicNameAuction, targetPartition, genId, bufA);\n\t\t\t\t\t\t\tkafkaProducerAuctions.send(kafkaRecord, new InternalCallback(cachedBuffers, bufA, sharedCounterAuction, itemsInThisBufferA));\n\t\t\t\t\t\t\tsentAuctions += itemsInThisBufferA;\n\t\t\t\t\t\t\tbufA = cachedBuffers.take();\n\t\t\t\t\t\t\tbufA.putInt(chkA);\n\t\t\t\t\t\t\titemsInThisBufferA = (int) Math.min(itemsPerBufferAuction, pendingAuctions);\n\t\t\t\t\t\t\tbacklogAuction = pendingAuctions - itemsInThisBufferA;\n\t\t\t\t\t\t\tbufA.putInt(itemsInThisBufferA);\n\t\t\t\t\t\t\tbufA.putLong(backlogAuction);\n\t\t\t\t\t\t\tsentBytes += BUFFER_SIZE;\n\t\t\t\t\t\t\tsentBytesDelta += BUFFER_SIZE;\n\t\t\t\t\t\t\tthroughputThrottler.acquire(BUFFER_SIZE);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbidGenerator.writeItem(eventId, timestamp, randomness, bufB);\n\t\t\t\t\t\tpendingBids--;\n\t\t\t\t\t\tif (bufB.remaining() < bidSize) {\n\t\t\t\t\t\t\tbufB.position(bufB.position() + bufB.remaining());\n\t\t\t\t\t\t\tProducerRecord<byte[], ByteBuffer> kafkaRecord = new ProducerRecord<>(topicNameBid, targetPartition, genId, bufB);\n\t\t\t\t\t\t\tkafkaProducerBids.send(kafkaRecord, new InternalCallback(cachedBuffers, bufB, sharedCounterBid, itemsInThisBufferB));\n\t\t\t\t\t\t\tsentBids += itemsInThisBufferB;\n\t\t\t\t\t\t\tbufB = cachedBuffers.take();\n\t\t\t\t\t\t\tbufB.putInt(chkB);\n\t\t\t\t\t\t\titemsInThisBufferB = (int) Math.min(itemsPerBufferBid, pendingBids);\n\t\t\t\t\t\t\tbacklogBid = pendingBids - itemsInThisBufferB;\n\t\t\t\t\t\t\tbufB.putInt(itemsInThisBufferB);\n\t\t\t\t\t\t\tbufB.putLong(backlogBid);\n\t\t\t\t\t\t\tsentBytes += BUFFER_SIZE;\n\t\t\t\t\t\t\tsentBytesDelta += BUFFER_SIZE;\n\t\t\t\t\t\t\tthroughputThrottler.acquire(BUFFER_SIZE);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n//\n\n\t\t\t\t\tif (sentBytesDelta > LOGGING_THRESHOLD) {\n\t\t\t\t\t\tLOG.info(\"{} has just sent {} MB to kafka in {} sec - rate limiter {} bytes/sec\",\n\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\tsentBytes / ONE_MEGABYTE,\n\t\t\t\t\t\t\t\t(timestamp - startMs) / 1_000,\n\t\t\t\t\t\t\t\tthroughputThrottler.getRate());\n\t\t\t\t\t\tsentBytesDelta = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ((timestamp - throughputChangeTimestamp) > 10_000) {\n\t\t\t\t\t\tcurrentThroughput += throughputDelta;\n\t\t\t\t\t\tif (currentThroughput > desiredThroughputBytesPerSecondMax) {\n\t\t\t\t\t\t\tthroughputDelta = -throughputDelta;\n\t\t\t\t\t\t} else if (currentThroughput < desiredThroughputBytesPerSecondMin) {\n\t\t\t\t\t\t\tcurrentThroughput = desiredThroughputBytesPerSecondMin;\n\t\t\t\t\t\t\tthroughputDelta = -throughputDelta;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthroughputThrottler.setRate(currentThroughput);\n\t\t\t\t\t\tthroughputChangeTimestamp = timestamp;\n\t\t\t\t\t\tLOG.debug(\"Throttler changed to {}\", currentThroughput);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\twhile (!sharedCounterPerson.compareAndSet(sentPersons, 0)) {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t}\n\t\t\t\twhile (!sharedCounterAuction.compareAndSet(sentAuctions, 0)) {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t}\n\t\t\t\twhile (!sharedCounterAuction.compareAndSet(sentBids, 0)) {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t}\n\t\t\t\tdouble end = System.currentTimeMillis();\n\t\t\t\tdouble diff = end - startMs;\n\t\t\t\tLOG.info(\"{} is finished after {} msec and {} GBs and {} items with an overall throughput of {}\",\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tdiff,\n\t\t\t\t\t\tsentBytes / ONE_GIGABYTE,\n\t\t\t\t\t\trecordsToGenerate,\n\t\t\t\t\t\t(sentBytes * 1_000.0) / (diff * ONE_GIGABYTE));\n\t\t\t} catch (Throwable error) {\n\t\t\t\tLOG.error(\"Error: {}\", error);\n\t\t\t} finally {\n\t\t\t\tif (cachedBuffers != null) {\n\t\t\t\t\tcachedBuffers.clear();\n\t\t\t\t}\n\t\t\t\tkafkaProducerAuctions.close();\n\t\t\t\tkafkaProducerPersons.close();\n\t\t\t\tkafkaProducerBids.close();\n\t\t\t\tcontroller.countDown();\n\t\t\t\tif (futureA != null) {\n\t\t\t\t\tfutureA.cancel(false);\n\t\t\t\t}\n\t\t\t\tif (futureP != null) {\n\t\t\t\t\tfutureP.cancel(false);\n\t\t\t\t}\n\t\t\t\tif (futureB != null) {\n\t\t\t\t\tfutureB.cancel(false);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"@Override\n\tpublic Object[] splitTasks() {\n\t\tif (tasks == null) {\n\t\t\tSystem.out.println(\"There are \"+taskNum +\" tasks, and handled by \"+clientsNum+\" clients\");\n\t\t}\t\t\n\t\ttasks = new SimpleTask[clientsNum];\n\t\ttq = taskNum / clientsNum;\n//\t\tbatchSize = tq;\n\t\tint left = taskNum - tq * clientsNum;\n\t\t\n\t\tfor (int i = 0; i < tasks.length; i++) {\n\t\t\tint l = 0;\n\t\t\tif (left >= i+1) {\n\t\t\t\tl = 1;\n\t\t\t}\n\t\t\tif (i == 0) {\n\t\t\t\ttasks[i] = new SimpleTask(1, tq + l, batchSize);\n\t\t\t} else {\n\t\t\t\ttasks[i] = new SimpleTask(\n\t\t\t\t\t\ttasks[i - 1].getEnd()+ 1, tasks[i - 1].getEnd() + tq + l, batchSize);\n\t\t\t}\t\t\t\n\t\t}\n//\t\tSystem.out.println(\"done .\"+clientsNum);\n\t\tthis.srvQ2QLSTM.getCfg().getQlSTMConfigurator().setMBSize(batchSize);\n\t\tthis.srvQ2QLSTM.getCfg().getAlSTMConfigurator().setMBSize(batchSize);\t\t\n\t\treturn tasks;\n\t}",
"private ConnectionPool() {\n connections = new LinkedBlockingQueue<>(DEFAULT_POOL_SIZE);\n this.init();\n }",
"protected ThreadPool getPool()\r\n {\r\n return threadPool_;\r\n }",
"private void initPool() throws SQLException {\n\t\tint POOL_SIZE = 90;\n\t\tthis.connectionPool = new LinkedBlockingQueue<>(POOL_SIZE);\n\t\tfor(int i = 0; i < POOL_SIZE; i++) {\n\t\t\tConnection con = DriverManager.getConnection(dburl, user, password);\n\t\t\tconnectionPool.offer(con);\n\t\t}\n\t}",
"@Override\n public void run() {\n new NdefReaderTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }",
"private void init(int threadCount, Type type) {\r\n //The backend starts to polling threads.\r\n mPoolThread=new Thread(){\r\n @Override\r\n public void run() {\r\n Looper.prepare();\r\n mPoolThreadHandler=new Handler(){\r\n @Override\r\n public void handleMessage(Message msg) {\r\n //take a thread from the thread pool and execute it.\r\n mThreadPool.execute(getTask());\r\n try {\r\n mSemaphoreThreadPool.acquire();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n };\r\n //if this thread is finished, release a signal to the handler.\r\n mSemaphorePoolThreadHandler.release();\r\n Looper.loop();\r\n }\r\n };\r\n mPoolThread.start();\r\n //Get the maximum available memory for our service.\r\n int maxMemory= (int) Runtime.getRuntime().maxMemory();\r\n int cacheMemory = maxMemory / 8;//8\r\n mLruCache=new LruCache<String, Bitmap>(cacheMemory){\r\n @Override\r\n protected int sizeOf(String key, Bitmap value) {\r\n return value.getRowBytes()*value.getHeight();\r\n }\r\n };\r\n mThreadPool= Executors.newFixedThreadPool(threadCount);\r\n mTaskQueue=new LinkedList<>();\r\n mType=type==null? Type.LIFO:type;\r\n mSemaphoreThreadPool=new Semaphore(threadCount);\r\n\r\n }",
"public ExternalThreadPool(NIOWorker nw, int size) {\n super(nw, size);\n\n // Prepare bash piper for bindings\n installDir = nw.getInstallDir();\n String workingDir = nw.getWorkingDir();\n piperScript = installDir + PIPER_SCRIPT_RELATIVE_PATH + PIPE_SCRIPT_NAME;\n\n // Prepare pipes (one per thread)\n writePipeFiles = new String[size];\n readPipeFiles = new String[size];\n for (int i = 0; i < size; ++i) {\n writePipeFiles[i] = workingDir + PIPE_FILE_BASENAME + UUID.randomUUID().hashCode();\n readPipeFiles[i] = workingDir + PIPE_FILE_BASENAME + UUID.randomUUID().hashCode();\n }\n\n // Prepare data pipes\n writeDataPipeFile = workingDir + PIPE_FILE_BASENAME + UUID.randomUUID().hashCode();\n readDataPipeFile = workingDir + PIPE_FILE_BASENAME + UUID.randomUUID().hashCode();\n\n if (LOGGER.isDebugEnabled()) {\n LOGGER.debug(\"PIPE Script: \" + piperScript);\n\n StringBuilder writes = new StringBuilder();\n writes.append(\"WRITE PIPE Files: \");\n for (int i = 0; i < writePipeFiles.length; ++i) {\n writes.append(writePipeFiles[i]).append(\" \");\n }\n writes.append(\"\\n\");\n LOGGER.debug(writes.toString());\n\n StringBuilder reads = new StringBuilder();\n reads.append(\"READ PIPE Files: \");\n for (int i = 0; i < readPipeFiles.length; ++i) {\n reads.append(readPipeFiles[i]).append(\" \");\n }\n reads.append(\"\\n\");\n LOGGER.debug(reads.toString());\n\n // Data pipes\n LOGGER.debug(\"WRITE DATA PIPE: \" + writeDataPipeFile);\n LOGGER.debug(\"READ DATA PIPE: \" + readDataPipeFile);\n }\n\n // Init main ProcessBuilder\n init();\n\n // Init TaskResultReader to retrieve task results (one per thread)\n taskResultReader = new TaskResultReader[size];\n for (int i = 0; i < size; ++i) {\n taskResultReader[i] = new TaskResultReader(readPipeFiles[i]);\n }\n\n // Add Shutdown Hook to ensure all sub-processes are closed\n LOGGER.debug(\"Add ExternalExecutor shutdown hook\");\n Runtime.getRuntime().addShutdownHook(new Ender(this));\n }",
"private void readConstantPool() throws IOException, ClassFormatException {\n constant_pool = new ConstantPool(dataInputStream);\n }",
"public BufferPool(String fileName, int numBuffers)\n throws IOException\n {\n BLOCK_SIZE = 4096;\n // create linked list of buffers, open file, create pointer tempArray\n this.pool = new LinkedList<Buffer>();\n this.buffArr = new Buffer[numBuffers];\n this.file = new RandomAccessFile(fileName, \"rw\");\n this.tempArray = new byte[BLOCK_SIZE];\n\n // initialize all the statistics to zero\n cacheHits = cacheMisses = diskReads = diskWrites = 0;\n\n Buffer newBuf;\n // initialize the appropriate number of buffers\n for (int i = 0; i < numBuffers; i++)\n {\n newBuf = new Buffer(tempArray, -1);\n pool.append(newBuf);\n buffArr[i] = newBuf;\n }\n }",
"@Test\r\n\tpublic void test()\r\n\t{\n\t\t\r\n\t\tThreadPoolManager.addPool(\"1,UD,12,12,30000,200000\");\r\n//\t\tThreadPoolManager.addPool(\"2,UD,12,12,30000,200000\");\r\n\r\n// ThreadPoolManager.init(params);\r\n// ThreadPoolManager.getPool(\"1\");\r\n\t\t\r\n//\t\tThread t = new Thread(this.testCreaterun());\r\n//\t\tBaseTask\r\n\t\tBaseTask b = this.testCreaterun();\r\n\t\tThreadPoolManager.submit(\"1\", b);\r\n\t\t\r\n\t\tSystemUtil.sleep(2000);\r\n\t\tThreadPoolManager.shutdownNow(\"1\");\r\n\t\t\r\n\t\tSystemUtil.sleep(2000);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tSystemUtil.sleepForever();\r\n\t}",
"default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }",
"public static void main(String[] args) {\n\t\tBlockingQueue queue = new LinkedBlockingQueue(4);\n\n\t\t// Thread factory below is used to create new threads\n\t\tThreadFactory thFactory = Executors.defaultThreadFactory();\n\n\t\t// Rejection handler in case the task get rejected\n\t\tRejectTaskHandler rth = new RejectTaskHandler();\n\t\t// ThreadPoolExecutor constructor to create its instance\n\t\t// public ThreadPoolExecutor(int corePoolSize,int maximumPoolSize,long\n\t\t// keepAliveTime,\n\t\t// TimeUnit unit,BlockingQueue workQueue ,ThreadFactory\n\t\t// threadFactory,RejectedExecutionHandler handler) ;\n\t\tThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 2, 10L, TimeUnit.MILLISECONDS, queue,\n\t\t\t\tthFactory, rth);\n\n\t\tfor (int i = 1; i <= 10; i++) {\n\t\t\tDataFileReader df = new DataFileReader(\"File \" + i);\n\t\t\tSystem.out.println(\"A new file has been added to read : \" + df.getFileName());\n\t\t\t// Submitting task to executor\n\t\t\tthreadPoolExecutor.execute(df);\n\t\t}\n\t\tthreadPoolExecutor.shutdown();\n\t}",
"public interface PoolPipe { \n\n /**\n * Put a runnable in the queue for execution. The semantics\n * of the queue is dependent on the current implementation. If the\n * pipe is closed this method throws an pipe closed exception.\n */\n \n public void put(Runnable run) throws InterruptedException, PipeClosedException;\n \n}",
"private static void threadPoolWithExecute() {\n\n Executor executor = Executors.newFixedThreadPool(3);\n IntStream.range(1, 10)\n .forEach((i) -> {\n executor.execute(() -> {\n System.out.println(\"started task for id - \"+i);\n try {\n if (i == 8) {\n Thread.sleep(4000);\n } else {\n Thread.sleep(1000);\n }\n System.out.println(\"In runnable task for id -\" + i);\n } catch (Exception e) {\n e.printStackTrace();\n }\n });\n });\n System.out.println(\"End of method .THis gets printed immdly since execute is not blocking call\");\n }",
"@Override\n protected DefaultProcessorTask newProcessorTask(boolean initialize){ \n ProcessorBlockingTask task = new ProcessorBlockingTask(initialize);\n configureProcessorTask(task);\n task.setMaxKeepAliveRequests(getMaxKeepAliveRequests());\n if (secure){\n task.setSSLImplementation(sslImplementation);\n }\n return task; \n }",
"@Test\n public void readTryLockShareTest() throws InterruptedException {\n final TestUse testUse = new TestUse();\n final CountDownLatch countDownLatch = new CountDownLatch(5);\n final List<Integer> result = new ArrayList<Integer>();\n for (int i = 0; i < 5; i++) {\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n Integer r = testUse.getCountInReadTryLock(2000);\n if(r!=null){\n result.add(r);\n }\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n countDownLatch.countDown();\n }\n }).start();\n }\n countDownLatch.await();\n Assert.assertEquals(5, result.size());\n }",
"private void initThreadPool(int numOfThreadsInPool, int[][] resultMat, Observer listener) {\n for(int i=0;i<numOfThreadsInPool; i++){\r\n PoolThread newPoolThread = new PoolThread(m_TaskQueue, resultMat);\r\n newPoolThread.AddResultMatListener(listener);\r\n m_Threads.add(newPoolThread);\r\n }\r\n // Start all Threads:\r\n for(PoolThread currThread: m_Threads){\r\n currThread.start();\r\n }\r\n }",
"int getPoolSize();",
"public BoneCP getPool() {\n return pool;\n }",
"@NotNull\n protected ReusablePool<AbstractReadablePacket> getPool() {\n return requireNonNull(ClassUtils.unsafeCast(getPacketType().getPool()));\n }",
"protected TaskFlow( ) { }",
"Read createRead();",
"int readNonBlocking(byte[] buffer, int offset, int length);",
"public Map createBuffer() {\n // Get the available processors, processors==threads is probably best?\n Runtime runtime = Runtime.getRuntime();\n int nProcessors = runtime.availableProcessors();\n int nThreads = 1; // nProcessors/2;\n compute();\n return serviceArea;\n }",
"public void initialize() {\n if (factory == null || poolName == null)\n throw new IllegalStateException(\"Factory and Name must be set before pool initialization!\");\n if (initialized)\n throw new IllegalStateException(\"Cannot initialize more than once!\");\n initialized = true;\n permits = new FIFOSemaphore(maxSize);\n factory.poolStarted(this);\n lastGC = System.currentTimeMillis();\n //fill pool to min size\n fillToMin();\n /*\n int max = maxSize <= 0 ? minSize : Math.min(minSize, maxSize);\n Collection cs = new LinkedList();\n for(int i=0; i<max; i++)\n {\n cs.add(getObject(null));\n }\n while (Iterator i = cs.iterator(); i.hasNext();)\n {\n releaseObject(i.next());\n } // end of while ()\n */\n collector.addPool(this);\n }",
"public void initializeIOBuffers(){\n for(int i=0; i<outputBuffer.length; i++){\n outputBuffer[i] = new LinkedBlockingQueue();\n inputBuffer[i] = new LinkedBlockingQueue();\n }\n }",
"public ListPool(int capacity) {\n pool = new ArrayBlockingQueue<>(capacity);\n }",
"public byte[] allocReadIOBuffer()\n/* */ {\n/* 146 */ _verifyAlloc(this._readIOBuffer);\n/* 147 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0);\n/* */ }",
"public void initialize() {\n\n\t\t// Initialize taskList\n\t\tthis.taskList = new LinkedList<Task>();\n\n\t\t// create a new thread for total size of pool\n\t\tfor (int i = 0; i < this.poolSize; ++i) {\n\t\t\tthreadPool.add(new WorkerThread(this));\n\t\t}\n\n\t\t// Start each thread in thread pool\n\t\tfor (WorkerThread t : threadPool) {\n\t\t\tnew Thread(t).start();\n\t\t}\n\n\t}",
"public ConstantPoolReader() {\n }",
"public static void main(String[] args)\n {\n Runnable r1 = new Task1();\n // Creates Thread task\n Task2 r2 = new Task2();\n ExecutorService pool = Executors.newFixedThreadPool(MAX_T);\n\n pool.execute(r1);\n r2.start();\n\n // pool shutdown\n pool.shutdown();\n }",
"public Server(){\n this.tasks = new LinkedBlockingQueue<Task>();\n this.waitingPeriod = new AtomicInteger();\n }",
"private Runnable scan() {\n Runnable t = null;\n int r = seed; // extract once to keep scan quiet\n StealingThread[] ws; // refreshed on outer loop\n int mask; // must be power 2 minus 1 and > 0\n outer:do {\n if ((ws = pool.threads) != null && (mask = ws.length - 1) > 0) {\n int idx = r;\n int probes = ~mask; // use random index while negative\n for (;;) {\n r = xorShift(r); // update random seed\n StealingThread v = ws[mask & idx];\n if (v == null || v.sp == v.base) {\n if (probes <= mask)\n idx = (probes++ < 0) ? r : (idx + 1);\n else\n break;\n }\n else if (!tryActivate() || (t = v.deqTask()) == null)\n continue outer; // restart on contention\n else\n break outer;\n }\n }\n } while (pool.hasNewSyncEvent(this)); // retry on pool events\n seed = r;\n return t;\n }",
"public ExecutorService createExecutor() {\n return getCamelContext().getExecutorServiceManager().newThreadPool(this, endpointName,\n 1, 5);\n }",
"void acquireReadLock() throws InterruptedException;",
"@Override\n public void run() {\n new NdefReaderTask().executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,tag);\n }",
"TaskFactory getTaskFactory();",
"public void doAllTasks() throws Exception {\n final GenericInitializer<E,T> initializer = config.getInitializer();\n final TaskFactory<E,T,GenericInitializer<E,T>> initTaskFac = config.getInitFactory();\n final ObjectCache<GenericInitializer<E,T>> initCache = new ObjectCache<>(2*threads,initializer);\n \n final long sT = System.currentTimeMillis();\n List<Task<T>> initTasks = comm.getInitialTasks(maxTasks,myID);\n final long mT = System.currentTimeMillis();\n initFetchTimeMS += mT-sT;\n initChunksGotten++;\n \n do{\n noInits = initTasks.size();\n if(noInits == 0){\n // nothing to be done, kinda weird.\n System.out.println(\"WARNING: No tasks gotten for threading backend \" + myID + \" continuing but wondering...\");\n break;\n }\n // kind of subptimal but we need to get the ID offset\n currIDStart = (int) initTasks.get(0).getDummyAnswer(myID).getResult().getID();\n \n if(DEBUG){System.out.println(\"DEBUG: Starting with ID \" + currIDStart + \" we have \" + initTasks.size() + \" tasks to init.\");}\n\n final long tOff = System.currentTimeMillis();\n doXXX(threads, initTaskFac, initCache, initTasks);\n final long tMid = System.currentTimeMillis();\n initWorkTimeMS += (tMid-tOff);\n \n final boolean doneYet = synchronizePools(true);\n if(!doneYet){\n initTasks = comm.getInitialTasks(maxTasks,myID);\n initChunksGotten++;\n } else {\n initTasks.clear(); // not strictly necessary, I think\n }\n final long tEnd = System.currentTimeMillis();\n initFetchTimeMS += (tEnd-tMid);\n \n } while(!initTasks.isEmpty());\n \n // merge pools, technically this should have happened before already. However, this does not hurt and synchronizes even further.\n synchronizePools(false);\n \n ISINIT = false;\n \n // then do globopt tasks (setup task factory and cachers)\n final GenericGlobalOptimization<E,T> globopt = config.getGlobalOptimization();\n final ObjectCache<GenericGlobalOptimization<E,T>> globCache = new ObjectCache<>(2*threads,globopt);\n TaskFactory<E,T,GenericGlobalOptimization<E,T>> globTasks = new GlobTaskFactory<>();\n\n while(!comm.isEverythingDone()){\n \n final long tOff = System.currentTimeMillis();\n doXXX(threads, globTasks, globCache, (int) currIDStart, (int) tasksGotten);\n final long tMid = System.currentTimeMillis();\n optWorkTimeMS += (tMid-tOff);\n \n final boolean done = synchronizePools(false);\n final long tEnd = System.currentTimeMillis();\n optFetchTimeMS += (tEnd-tMid);\n \n if(done) {break;}\n }\n }",
"@Test\n void test3() {\n ThreadPoolExecutor executor = new ThreadPoolExecutor(1,1,10L, TimeUnit.SECONDS,new LinkedBlockingDeque<>(2),new ThreadPoolExecutor.DiscardPolicy());\n for (int i = 0; i < 10; i++) {\n executor.execute(new Runnable() {\n @Override\n public void run() {\n System.out.println(Thread.currentThread().getName()+\"输出\");\n }\n });\n }\n }",
"private ExecutorService getDroneThreads() {\n\t\treturn droneThreads;\n\t}",
"long tryReadLock(long timeout) throws InterruptedException;",
"private TestAcceptFactory() {\n this._pool = new DirectExecutor();\n }",
"default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }",
"@Bean(name = \"process-response\")\n\tpublic Executor threadPoolTaskExecutor() {\n\t\tThreadPoolTaskExecutor x = new ThreadPoolTaskExecutor();\n\t\tx.setCorePoolSize(poolProcessResponseCorePoolSize);\n\t\tx.setMaxPoolSize(poolProcessResponseMaxPoolSize);\n\t\treturn x;\n\t}",
"int getExecutorCorePoolSize();",
"@Test(timeout = 5000)\n public void concurrentFunctions() {\n final String input = \"input\";\n\n final int size = 100;\n //since we start at index 0\n final int expected = size - 1;\n\n\n // QUESTION Using this thread blocks indefinitely. The execution of the Hystrix command\n // happens on the computation Thread if this is used\n\n // final Scheduler scheduler = Schedulers.threadPoolForComputation();\n\n //use the I/O scheduler to allow enough thread, otherwise our pool will be the same size as the # of cores\n\n\n //set our size equal\n// ConfigurationManager.getConfigInstance().setProperty( THREAD_POOL_SIZE, size );\n // ConfigurationManager.getConfigInstance().setProperty( THREAD_POOL_SIZE, 10 );\n\n //reject requests we have to queue\n// ConfigurationManager.getConfigInstance().setProperty( THREAD_POOL_QUEUE, -1 );\n\n //latch used to make each thread block to prove correctness\n final CountDownLatch latch = new CountDownLatch( size );\n\n\n //create our observable and execute it in the I/O pool since we'll be doing I/O operations\n\n /**\n * QUESTION: Should this use the computation scheduler since all operations (except the hystrix command) are\n * non blocking?\n */\n\n final Observable<String> observable = Observable.just( input ).observeOn( Schedulers.io() );\n\n\n Observable<Integer> thing = observable.flatMap( new Func1<String, Observable<Integer>>() {\n\n @Override\n public Observable<Integer> call( final String s ) {\n List<Observable<Integer>> functions = new ArrayList<Observable<Integer>>();\n\n logger.info( \"Creating new set of observables in thread {}\",\n Thread.currentThread().getName() );\n\n for ( int i = 0; i < size; i++ ) {\n\n\n final int index = i;\n\n // create a new observable and execute the function on it.\n // These should happen in parallel when a subscription occurs\n\n /**\n * QUESTION: Should this again be the process thread, not the I/O\n */\n Observable<String> newObservable = Observable.just( input ).subscribeOn( Schedulers.io() );\n\n Observable<Integer> transformed = newObservable.map( new Func1<String, Integer>() {\n\n @Override\n public Integer call( final String s ) {\n\n final String threadName = Thread.currentThread().getName();\n\n logger.info( \"Invoking parallel task in thread {}\", threadName );\n\n// /**\n// * Simulate a Hystrix command making a call to an external resource. Invokes\n// * the Hystrix command immediately as the function is invoked. This is currently\n// * how we have to call Cassandra.\n// *\n// * TODO This needs to be re-written and evaluated once this PR is released https://github.com/Netflix/Hystrix/pull/209\n// */\n// return new HystrixCommand<Integer>( GROUP_KEY ) {\n// @Override\n// protected Integer run() throws Exception {\n//\n// final String threadName = Thread.currentThread().getName();\n//\n// logger.info( \"Invoking hystrix task in thread {}\", threadName );\n\n\n\n\n latch.countDown();\n\n try {\n latch.await();\n }\n catch ( InterruptedException e ) {\n throw new RuntimeException( \"Interrupted\", e );\n }\n\n// assertTrue( isExecutedInThread() );\n//\n// return index;\n// }\n// }.execute();\n\n return index;\n }\n } );\n\n functions.add( transformed );\n }\n\n /**\n * Execute the functions above and zip the results together\n */\n Observable<Integer> zipped = Observable.zip( functions, new FuncN<Integer>() {\n\n @Override\n public Integer call( final Object... args ) {\n\n logger.info( \"Invoking zip in thread {}\", Thread.currentThread().getName() );\n\n assertEquals( size, args.length );\n\n for ( int i = 0; i < args.length; i++ ) {\n assertEquals( \"Indexes are returned in order\", i, args[i] );\n }\n\n //just return our string\n return ( Integer ) args[args.length - 1];\n }\n } );\n\n return zipped;\n }\n } );\n\n\n final Integer last = thing.toBlocking().last();\n\n\n assertEquals( expected, last.intValue() );\n\n\n }",
"private IOHandler(){\n download_queue = new ArrayList<>(); \n initialize();\n }",
"Task createTask();",
"Task createTask();",
"Task createTask();",
"@Override\n\tpublic TaskIterator createTaskIterator() {\n\t\treturn new TaskIterator(new HyperTask(cy));\n\t}",
"public DisruptorMux() {\r\n\r\n\t\t_executor = Executors.newFixedThreadPool(NUM_EVENT_PROCESSORS);\r\n\r\n\t\t_disruptor = new Disruptor<BundleEvent>(BundleEvent.EVENT_FACTORY,\r\n\t\t\t\t_executor, new SingleThreadedClaimStrategy(RING_SIZE),\r\n\t\t\t\tnew BlockingWaitStrategy());\r\n\r\n\t}",
"public ThreadPool getDefaultThreadPool();",
"private static void useCachedThreadPool() {\n ExecutorService executor = Executors.newCachedThreadPool();\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n\n executor.execute(() -> {\n System.out.println(\"==========\");\n });\n\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n\n IntStream.range(0, 100).boxed().forEach(i -> {\n executor.execute(() -> {\n sleepSeconds(10);\n System.out.println(Thread.currentThread().getName() + \"[\" + i + \"]\");\n });\n });\n sleepSeconds(1);\n System.out.println(((ThreadPoolExecutor) executor).getActiveCount());\n }",
"public ThreadPool( int totalPoolSize ) {\n\n\tpoolLocked = false;\n\n\ttry {\n\n\t initializePools( null, totalPoolSize );\n\n\t} catch( Exception exc ) {}\n\n }",
"protected StealingThread(StealingPool pool) throws IOException {\n if (pool == null) throw new NullPointerException();\n this.pool = pool;\n this.ioManager = new NioManager();\n // Note: poolIndex is set by pool during construction\n // Remaining initialization is deferred to onStart\n }",
"public Poolable get() throws Exception\n {\n // To make this class backwards compatible, it has to auto initialize if necessary\n if( !m_initialized )\n {\n initialize();\n }\n\n if( null == m_pool && null != m_controller )\n {\n final int increase = m_controller.grow();\n if( increase > 0 )\n {\n grow( increase );\n }\n }\n\n if( 0 > m_count )\n {\n m_count = -1;\n return (Poolable)m_factory.newInstance();\n }\n else if( 0 == m_count )\n {\n m_count--;\n return m_pool[ 0 ];\n }\n\n final Poolable poolable = m_pool[ m_count ];\n m_pool[ m_count ] = null;\n m_count--;\n return poolable;\n }",
"public void testNewFixedThreadPool1() {\n final ExecutorService e = Executors.newFixedThreadPool(2);\n try (PoolCleaner cleaner = cleaner(e)) {\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n e.execute(new NoOpRunnable());\n }\n }",
"public <T> ArrayBlockingQueue<T> create(int size){\n return new ArrayBlockingQueue<T>(size);\n }",
"int getExecutorPoolSize();",
"public static BoneCP getPool() throws Exception\n {\n if (_pool == null)\n {\n throw new Exception(\"The connection pool was not initialized!\");\n }\n\n return _pool;\n }",
"@Override\r\n\tpublic List<GridTask<LinPackResult>> split() {\r\n\t\tList<GridTask<LinPackResult>> list = new ArrayList<GridTask<LinPackResult>>();\r\n\t\tfor (int i=0; i < tasks; i++) {\r\n\t\t\tlist.add(new LinPackTask(cycles));\r\n\t\t}\r\n\t\t\r\n\t\tsw = new StopWatch();\r\n\t\t\r\n\t\tsw.start();\r\n\t\t\r\n\t\treturn list;\r\n\t}",
"private void requestData(String uri) {\n MyTask myTask = new MyTask();\n\n // Work parralial\n myTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, uri);\n }",
"public abstract List<T1> executeBlocking();",
"public BufferPool(int numPages) {\n // some code goes here\n this.numPages = numPages;\n this.bufferPool = new PageBufferPool(numPages);\n }",
"private Task createTask(StressTest test)\n\t{\n\t\treturn new ClientServerTask(test);\n\t}",
"protected abstract void createTasks();",
"public static void main (String[] args) {\n logger.info (\"Creating a executor...\");\n ExecutorService executorService = Executors.newFixedThreadPool (3);\n\n\n\n /*\n * Create a lock counter class.\n * */\n logger.info (\"Creating a lock counter class...\");\n ReadWriteCounter counter = new ReadWriteCounter ();\n\n\n\n /*\n * Submit a thread.\n * */\n logger.info (\"Create a read thread...\");\n Runnable readTask = () -> logger.debug (Thread.currentThread ().getName () +\n \" Read Task : \" + counter.getCount ());\n\n\n\n /*\n * Submit a thread.\n * */\n logger.info (\"Create a write thread...\");\n Runnable writeTask = () -> logger.debug (Thread.currentThread().getName() +\n \" Write Task : \" + counter.incrementAndGetCount ());\n\n\n\n /*\n * Submit a threads.\n * */\n logger.info (\"Submit a read threads...\");\n executorService.submit (readTask);\n executorService.submit (readTask);\n\n /*\n * Submit a thread.\n * */\n logger.info (\"Submit a write thread...\");\n executorService.submit (writeTask);\n\n /*\n * Submit a threads.\n * */\n logger.info (\"Submit a read threads...\");\n executorService.submit (readTask);\n executorService.submit (readTask);\n\n\n\n /*\n * Shutdown executor.\n * */\n logger.info (\"Shutdown the executor...\");\n executorService.shutdown ();\n }",
"private void startReadLoop() {\n\t\t\n\t\treadLoop=new Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t/*\n\t\t\t\t * According to the spec, we should be able to read an 8 character string,\n\t\t\t\t * which we turn into a number, and that number is the size of the next data\n\t\t\t\t * block. In all likelihood our buffer will be much bigger, but the whole point\n\t\t\t\t * of using the buffer is we don't have to care about the underlying sync between\n\t\t\t\t * what we have read, what the device has written etc. etc. \n\t\t\t\t */\n\t\t\t\twhile(keepGoing) {\n//\t\t\t\t\tif(pauseForCommand) {\n//\t\t\t\t\t\ttry {\n//\t\t\t\t\t\t\tThread.sleep(50);\t//Give a bit of time for something else...\n//\t\t\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tSystem.err.println(\"readLoop is paused\");\n//\t\t\t\t\t\tcontinue;\n//\t\t\t\t\t}\n\t\t\t\t\tDocument xmlDoc;\n\t\t\t\t\ttry {\n\t\t\t\t\t\txmlDoc = getNextBlock();\n\t\t\t\t\t\tif(xmlDoc.hasChildNodes()) {\n\t\t\t\t\t\t\tprocessChildren(xmlDoc);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tlog.info(\"Read loop finishing as keepGoing now false\");\n\t\t\t}\n\t\t};\n\t\treadLoop.setName(\"NKV550Reader\");\n\t\treadLoop.setPriority(Thread.MAX_PRIORITY);\n\t\treadLoop.start();\n\t}",
"public static void main(String[] args) throws InterruptedException {\n\t\tBlockingObjectPool blockingObjectPool = new BlockingObjectPool(5);\n\n\t\t// Producer thread\n\t\tnew Thread(() -> {\n\t\t\tint i = 0;\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tObject obj = new Object();\n\t\t\t\t\tblockingObjectPool.take(obj);\n\t\t\t\t\tSystem.out.println(\"Added :\" + obj);\n\t\t\t\t\tSystem.out.println(\"pool size :\" + blockingObjectPool.size());\n\t\t\t\t\t// System.out.println(\"Added : \" + i);\n\n\t\t\t\t\tThread.sleep(TimeUnit.SECONDS.toMillis(1));\n\t\t\t\t}\n\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}).start();\n\n\t\t// Consumer thread\n\t\tnew Thread(() -> {\n\t\t\ttry {\n\t\t\t\twhile (true) {\n\t\t\t\t\tObject poll = blockingObjectPool.get();\n\t\t\t\t\tSystem.out.println(\"Polled :\" + poll);\n\t\t\t\t\tSystem.out.println(\"pool size :\" + blockingObjectPool.size());\n\n\t\t\t\t\tThread.sleep(TimeUnit.SECONDS.toMillis(2));\n\t\t\t\t}\n\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}).start();\n\t}",
"@Override\r\n public void handleMessage(Message msg) {\n mThreadPool.execute(getTask());\r\n try {\r\n mSemaphoreThreadPool.acquire();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"public ReadThread() throws IOException {\n setName(\"TcpHarvester ReadThread\");\n setDaemon(true);\n }",
"protected final void spawn(Task<?>... task) {\n // Gets a list of tasks, make a forLoop, and add it the the queue of that specific task\n for (int i=0; i<task.length; i++){\n // We want the pool to add a given task.\n // pool.addTask(task[i], id); <- this function needs to increase aswell.\n myProcessor.getPool().addTask(task[i], myProcessor.getProcessorID());\n //\tSystem.out.println(\"Spawned \" + i + \" new tasks\");\n }\n }",
"public byte[] allocReadIOBuffer(int minSize)\n/* */ {\n/* 154 */ _verifyAlloc(this._readIOBuffer);\n/* 155 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0, minSize);\n/* */ }",
"protected synchronized ExecutorService getService() {\r\n if(service == null) {\r\n //System.out.println(\"creating an executor service with a threadpool of size \" + threadPoolSize);\r\n service = Executors.newFixedThreadPool(threadPoolSize, new ThreadFactory() {\r\n private int count = 0;\r\n \r\n public Thread newThread(Runnable r) {\r\n Thread t = new Thread(r, \"tile-pool-\" + count++);\r\n t.setPriority(Thread.MIN_PRIORITY);\r\n t.setDaemon(true);\r\n return t;\r\n }\r\n });\r\n }\r\n return service;\r\n }",
"public static void main(String[] args) {\n\t\tList<Future<String>> futureList = new ArrayList<Future<String>>();\r\n\r\n\t\t//collection of multiple tasks which we are supposed to give to thread pool to perform\r\n\t\tList<CallableDemo> taskList = new ArrayList<CallableDemo>();\r\n\t\t//adding multiple tasks to collection (tasks are created using 'Callable' Interface.\r\n\t\ttaskList.add(new CallableDemo(\"first\"));\r\n\t\ttaskList.add(new CallableDemo(\"second\"));\r\n\t\ttaskList.add(new CallableDemo(\"third\"));\r\n\t\ttaskList.add(new CallableDemo(\"fourth\"));\r\n\t\ttaskList.add(new CallableDemo(\"fifth\"));\r\n\t\ttaskList.add(new CallableDemo(\"sixth\"));\r\n\t\ttaskList.add(new CallableDemo(\"seventh\"));\r\n\r\n\t\t//creating a thread pool of size four\r\n\t\tExecutorService threadPool = Executors.newFixedThreadPool(4);\r\n\t\t\r\n\t\tfor (CallableDemo task : taskList) {\r\n\t\t\tfutureList.add(threadPool.submit(task));\r\n\t\t}\r\n threadPool.shutdown();\r\n\t\tfor (Future<String> future : futureList) {\r\n\t\t\ttry {\r\n//\t\t\t\t System.out.println(future.get());\r\n\t\t\t\tSystem.out.println(future.get(1L, TimeUnit.SECONDS));\r\n\t\t\t} catch (InterruptedException | ExecutionException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}catch (TimeoutException e) {\r\n\t\t\t\tSystem.out.println(\"Sorry already waited for result for 1 second , can't wait anymore...\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"public StealingPool getPool() {\n return pool;\n }"
] | [
"0.6957542",
"0.6387747",
"0.5861616",
"0.56495667",
"0.564719",
"0.5549003",
"0.55370677",
"0.5528828",
"0.5434687",
"0.5425265",
"0.5405735",
"0.53493947",
"0.5319289",
"0.5318763",
"0.5314224",
"0.53122103",
"0.5304262",
"0.5304033",
"0.529435",
"0.52781034",
"0.5246942",
"0.5231408",
"0.5227227",
"0.5218149",
"0.52163136",
"0.5214786",
"0.5201154",
"0.5197888",
"0.51866674",
"0.5149011",
"0.5144225",
"0.511635",
"0.50834256",
"0.5069842",
"0.5054759",
"0.5050829",
"0.5038091",
"0.5020227",
"0.5016904",
"0.50013536",
"0.49780655",
"0.4974944",
"0.49716482",
"0.49649495",
"0.49634612",
"0.4947478",
"0.49401197",
"0.49120745",
"0.49116743",
"0.49068424",
"0.49007076",
"0.48991966",
"0.48882556",
"0.48844144",
"0.48716918",
"0.48679596",
"0.4866213",
"0.4852458",
"0.48502868",
"0.484586",
"0.48351043",
"0.48315018",
"0.47996226",
"0.47988614",
"0.47973832",
"0.47971484",
"0.47850505",
"0.47799563",
"0.4769714",
"0.47690436",
"0.47556746",
"0.47556746",
"0.47556746",
"0.47464058",
"0.47462136",
"0.47414318",
"0.47403365",
"0.4738553",
"0.4733971",
"0.47328052",
"0.4729075",
"0.4725732",
"0.47241503",
"0.47157434",
"0.47151014",
"0.47131568",
"0.4707472",
"0.4707372",
"0.47066483",
"0.47042382",
"0.46980202",
"0.46963173",
"0.469195",
"0.4691783",
"0.46777022",
"0.46590024",
"0.46536702",
"0.46503147",
"0.46449384",
"0.46448424"
] | 0.7347832 | 0 |
Create a ReadBlockingTask instance used with blocking socket. | private ReadBlockingTask newReadBlockingTask(boolean initialize){
ReadBlockingTask task = new ReadBlockingTask();
task.setSelectorThread(this);
task.setPipeline(getProcessorPipeline());
task.setRecycle(isRecycleTasks());
task.attachProcessor(newProcessorTask(initialize));
task.setPipelineStatistic(getPipelineStat());
task.setSecure(secure);
return task;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected ReadBlockingTask getReadBlockingTask(Socket socket){\n ReadBlockingTask task = null;\n if (isRecycleTasks()) {\n task = (ReadBlockingTask)getReadTasks().poll();\n }\n \n if (task == null){\n task = newReadBlockingTask(false);\n } \n \n ProcessorTask processorTask = task.getProcessorTask(); \n processorTask.setSocket(socket);\n \n return task;\n }",
"private void initReadBlockingTask(int size){ \n for (int i=0; i < size; i++){\n getReadTasks().offer(newReadBlockingTask(false));\n }\n }",
"public ReadThread() throws IOException {\n setName(\"TcpHarvester ReadThread\");\n setDaemon(true);\n }",
"Read createRead();",
"public Class getReadTask(SelectorThread selectorThread);",
"protected NetworkEmulatorTransport createTcpTransport() {\n return new NetworkEmulatorTransport(\n Transport.bindAwait(\n TransportConfig.defaultConfig().transportFactory(new TcpTransportFactory())));\n }",
"int readNonBlocking(byte[] buffer, int offset, int length);",
"public interface SocketTask extends Task\n{\n\t/**\n\t * Method sets to object socketWrapper object to allow task to use this socket.\n\t * @param socket socket wrapper object.\n\t */\n\tpublic void setSocket(SocketWrapper socket);\n}",
"public Task getInstance(TargetTransportPort port, Command command)\n throws IllegalRequestException\n {\n switch (command.getCommandDescriptorBlock().getOperationCode())\n {\n case ModeSense6.OPERATION_CODE :\n case ModeSense10.OPERATION_CODE :\n return new ModeSenseTask(port, command, modePageRegistry, inquiryDataRegistry);\n case TestUnitReady.OPERATION_CODE :\n return new TestUnitReadyTask(port, command, modePageRegistry, inquiryDataRegistry);\n case Inquiry.OPERATION_CODE :\n return new InquiryTask(port, command, modePageRegistry, inquiryDataRegistry);\n }\n\n Class<? extends BufferedTask> taskClass =\n tasks.get(command.getCommandDescriptorBlock().getClass());\n\n if (taskClass != null)\n {\n try\n {\n return taskClass.newInstance().load(buffer, blockLength, port, command,\n modePageRegistry, inquiryDataRegistry);\n }\n catch (InstantiationException e)\n {\n throw new RuntimeException(\"Unable to instantiate class with default constructor\"\n + taskClass.getName(), e);\n }\n catch (IllegalAccessException e)\n {\n throw new RuntimeException(\"Unable to instantiate class with default constructor\"\n + taskClass.getName(), e);\n }\n }\n else\n {\n throw new InvalidCommandOperationCodeException();\n }\n }",
"Task createTask();",
"Task createTask();",
"Task createTask();",
"protected ReadCommand createReadHandler(SocketChannel theSocketChannel) {\n\t\tReadCommand retVal = ReadCommandFactorySelector.getFactory().createReadCommand(selectionManager, theSocketChannel);\r\n\t\tReadRequestCreated.newCase(this, retVal);\r\n\t\t\r\n\t\treturn retVal;\r\n\t}",
"default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }",
"protected TaskFlow( ) { }",
"SocketReader newSocketReader(SocketConnection connection);",
"@Override\n protected DefaultProcessorTask newProcessorTask(boolean initialize){ \n ProcessorBlockingTask task = new ProcessorBlockingTask(initialize);\n configureProcessorTask(task);\n task.setMaxKeepAliveRequests(getMaxKeepAliveRequests());\n if (secure){\n task.setSSLImplementation(sslImplementation);\n }\n return task; \n }",
"default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }",
"BlockFor createBlockFor();",
"@Override\n public Receive createReceive() {\n return receiveBuilder()\n .match(StartMessage.class, this::handle)\n .match(BatchMessage.class, this::handle)\n .match(Terminated.class, this::handle)\n .match(RegistrationMessage.class, this::handle)\n .match(Availability.class, this::handle)\n .match(Result.class, this::handle)\n .matchAny(object -> this.log().info(\"Received unknown message: \\\"{}\\\"\", object.toString()))\n .build();\n }",
"public Task() { }",
"@Override\n public void initEndpoint() throws IOException, InstantiationException {\n SelectorThreadConfig.configure(this);\n \n initFileCacheFactory();\n initAlgorithm();\n initPipeline();\n initMonitoringLevel();\n \n setName(\"SelectorThread-\" + getPort());\n \n try{\n if (getInet() == null) {\n setServerSocket(getServerSocketFactory().createSocket(getPort(),\n getSsBackLog()));\n } else {\n setServerSocket(getServerSocketFactory().createSocket(getPort(), \n getSsBackLog(), getInet()));\n }\n getServerSocket().setReuseAddress(true); \n } catch (SocketException ex){\n throw new BindException(ex.getMessage() + \": \" + getPort());\n }\n \n getServerSocket().setSoTimeout(getServerTimeout());\n initReadBlockingTask(getMinReadQueueLength());\n \n setInitialized(true); \n getLogger().log(Level.FINE,\"Initializing Grizzly Blocking Mode\"); \n // Since NIO is not used, rely on Coyote for buffering the response.\n setBufferResponse(true);\n }",
"public Task(){}",
"public Connector getConnector (Address farAddr, boolean blocking) \n throws IOException {\n if (blocking) {\n return new TlsConnector (\n new EndPoint(this, (IPAddress)farAddr));\n } else {\n //return new SchedulableTcpConnector (\n // new EndPoint(this, (IPAddress)farAddr));\n throw new UnsupportedOperationException();\n }\n }",
"private Task createTask(StressTest test)\n\t{\n\t\treturn new ClientServerTask(test);\n\t}",
"public Connection getConnection (Address nearAddr, Address farAddr,\n boolean blocking) throws IOException {\n if (blocking) {\n // XXX CAN THIS EVER BE USEFUL?\n // return new TlsConnection(this, \n // (TlsAddress)nearAddr, (TlsAddress)farAddr);\n /* STUB */\n return null;\n } else {\n // XXX NEED A CONSTRUCTOR THAT HANDLES ALREADY-CONNECTED\n // XXX SOCKET CHANNELS, for Connectors -- this is\n // XXX return new SchedulableTcpConnection(ServerSocket sChan)\n // XXX However, we don't have access to sChan, unless we allow\n // XXX an Object to be passed\n throw new UnsupportedOperationException();\n }\n }",
"public IllegalBlockingModeException() { }",
"public static RestTask obtainGetTask(String url)\n throws IOException {\n HttpURLConnection connection = createDefaultConnection(url);\n attachAuthentication(connection);\n connection.setDoInput(true);\n\n return new RestTask(connection);\n }",
"public byte[] allocReadIOBuffer()\n/* */ {\n/* 146 */ _verifyAlloc(this._readIOBuffer);\n/* 147 */ return this._readIOBuffer = this._bufferRecycler.allocByteBuffer(0);\n/* */ }",
"public NetData recieve() throws Exception\n {\n NetData nd;\n\n\n try {\n if(reader.ready())\n {\n nd = new NetData(reader.readLine());\n }\n else\n {\n return null;\n }\n }\n catch (IOException ex)\n {\n xError.Report(xError.READ_FROM_SOCKET);\n throw new Exception();\n }\n xMessenger.miniMessege(\"<<<\"+ nd.toString());\n return nd;\n }",
"public UDPClockReference()\n {\n try\n {\n socket = new DatagramSocket(REFERENCE_PORT);\n socket.setSoTimeout(TIMEOUT);\n }\n catch (SocketException e)\n {\n throw new RuntimeException(e);\n }\n }",
"public static MulticastSocket createReceiver() throws IOException {\n final MulticastSocket s = new MulticastSocket(PORT);\n // join the multicast group\n s.joinGroup(InetAddress.getByName(GROUP));\n // Now the socket is set up and we are ready to receive packets\n return s;\n }",
"public NioDatagramChannel() {\n/* 116 */ this(newSocket(DEFAULT_SELECTOR_PROVIDER));\n/* */ }",
"private void startReadLoop() {\n\t\t\n\t\treadLoop=new Thread() {\n\t\t\tpublic void run() {\n\t\t\t\t/*\n\t\t\t\t * According to the spec, we should be able to read an 8 character string,\n\t\t\t\t * which we turn into a number, and that number is the size of the next data\n\t\t\t\t * block. In all likelihood our buffer will be much bigger, but the whole point\n\t\t\t\t * of using the buffer is we don't have to care about the underlying sync between\n\t\t\t\t * what we have read, what the device has written etc. etc. \n\t\t\t\t */\n\t\t\t\twhile(keepGoing) {\n//\t\t\t\t\tif(pauseForCommand) {\n//\t\t\t\t\t\ttry {\n//\t\t\t\t\t\t\tThread.sleep(50);\t//Give a bit of time for something else...\n//\t\t\t\t\t\t} catch (InterruptedException e) {\n//\t\t\t\t\t\t\t// TODO Auto-generated catch block\n//\t\t\t\t\t\t\te.printStackTrace();\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\tSystem.err.println(\"readLoop is paused\");\n//\t\t\t\t\t\tcontinue;\n//\t\t\t\t\t}\n\t\t\t\t\tDocument xmlDoc;\n\t\t\t\t\ttry {\n\t\t\t\t\t\txmlDoc = getNextBlock();\n\t\t\t\t\t\tif(xmlDoc.hasChildNodes()) {\n\t\t\t\t\t\t\tprocessChildren(xmlDoc);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t} catch (SAXException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tlog.info(\"Read loop finishing as keepGoing now false\");\n\t\t\t}\n\t\t};\n\t\treadLoop.setName(\"NKV550Reader\");\n\t\treadLoop.setPriority(Thread.MAX_PRIORITY);\n\t\treadLoop.start();\n\t}",
"public Task() {\r\n }",
"@Nullable\n public static BLEResult createReadPhyTask(@NonNull BLEConnection bleConnection\n , long taskTimeout\n , long bleTimeout\n , @Nullable Bundle argument\n , boolean isBroadcast) {\n BLEResult bleResult = null;\n if (bleConnection.isConnected()) {\n BLESyncConnection bleSyncConnection = new BLESyncConnection();\n bleSyncConnection.mBLEConnection = bleConnection;\n bleResult = bleSyncConnection.createReadPhyTask(taskTimeout, bleTimeout, argument, isBroadcast);\n }\n return bleResult;\n }",
"public static NetFlowReader prepareReader(\n DataInputStream inputStream,\n int buffer,\n boolean ignoreCorruptFile) throws IOException {\n return new NetFlowReader(inputStream, buffer, ignoreCorruptFile);\n }",
"@Nullable\n public static BLEResult createReadCharacteristicTask(@NonNull BLEConnection bleConnection\n , @NonNull UUID serviceUUID\n , @Nullable Integer serviceInstanceId\n , @NonNull UUID characteristicUUID\n , @Nullable Integer characteristicInstanceId\n , long taskTimeout\n , long bleTimeout\n , @Nullable Bundle argument\n , boolean isBroadcast) {\n BLEResult bleResult = null;\n if (bleConnection.isConnected()) {\n BLESyncConnection bleSyncConnection = new BLESyncConnection();\n bleSyncConnection.mBLEConnection = bleConnection;\n bleResult = bleSyncConnection.createReadCharacteristicTask(serviceUUID, serviceInstanceId, characteristicUUID, characteristicInstanceId, taskTimeout, bleTimeout, argument, isBroadcast);\n }\n return bleResult;\n }",
"public Task() {\n }",
"public Socket createSocket()\n/* */ {\n/* 82 */ return new Socket();\n/* */ }",
"@Nullable\n public static BLEResult createReadDescriptorTask(@NonNull BLEConnection bleConnection\n , @NonNull UUID serviceUUID\n , @Nullable Integer serviceInstanceId\n , @NonNull UUID characteristicUUID\n , @Nullable Integer characteristicInstanceId\n , @NonNull UUID descriptorUUID\n , @Nullable Integer descriptorInstanceId\n , long taskTimeout\n , long bleTimeout\n , @Nullable Bundle argument\n , boolean isBroadcast) {\n BLEResult bleResult = null;\n if (bleConnection.isConnected()) {\n BLESyncConnection bleSyncConnection = new BLESyncConnection();\n bleSyncConnection.mBLEConnection = bleConnection;\n bleResult = bleSyncConnection.createReadDescriptorTask(serviceUUID, serviceInstanceId, characteristicUUID, characteristicInstanceId, descriptorUUID, descriptorInstanceId, taskTimeout, bleTimeout, argument, isBroadcast);\n }\n return bleResult;\n }",
"TaskFactory getTaskFactory();",
"Task poll();",
"public Task(){\n super();\n }",
"@Nullable\n public static BLEResult createReadRemoteRssiTask(@NonNull BLEConnection bleConnection\n , long taskTimeout\n , long bleTimeout\n , @Nullable Bundle argument\n , boolean isBroadcast) {\n BLEResult bleResult = null;\n if (bleConnection.isConnected()) {\n BLESyncConnection bleSyncConnection = new BLESyncConnection();\n bleSyncConnection.mBLEConnection = bleConnection;\n bleResult = bleSyncConnection.createReadRemoteRssiTask(taskTimeout, bleTimeout, argument, isBroadcast);\n }\n return bleResult;\n }",
"@Override\n\tpublic Receive createReceive() {\n\t\treturn receiveBuilder()\n\t\t\t\t.match(LargeMessage.class, this::handle)\n\t\t\t\t.match(byte[].class, this::handle)\n\t\t\t\t.match(BytesMessage.class, this::handle)\n\t\t\t\t.matchAny(object -> this.log().info(\"Received unknown message: \\\"{}\\\"\", object.toString()))\n\t\t\t\t.build();\n\t}",
"@Override\n\tpublic Receive createReceive() {\n\t\treturn receiveBuilder()\n\t\t\t\t.match(RequestTrackDevice.class, this::onTrackDevice)\n\t\t\t\t.match(Terminated.class, this::onTerminate)\n\t\t\t\t.match(RequestDeviceList.class, this::onDeviceList)\n\t\t\t\t.match(RequestAllTemperatures.class, this::onAllTemperatures)\n\t\t\t\t.build();\n\t}",
"@Override\n public Receive<Command> createReceive() {\n return newReceiveBuilder()\n .onMessageEquals(Start.INSTANCE, this::onStart) //Call onStart when Start.INSTANCE is received\n .onMessage(SendPrimesFound.class, this::onSendPrimesFound) //Call onSendPrimesFound when SendPrimesFound class is received\n .onMessage(SetNumbersToSearchAndNumberOfWorkers.class, this::onSetNumbersToSearchAndNumberOfWorkers) //Call onSetNumbersToSearchAndNumberOfWorkers when SetNumbersToSearchAndNumberOfWorkers is received\n .build();\n\n }",
"public Task() {\n\t}",
"public ControlWorker(Socket socket) {\n \n }",
"@Nullable\n\tfinal T blockingGet(long timeout, TimeUnit unit) {\n\t\tif (Schedulers.isInNonBlockingThread()) {\n\t\t\tthrow new IllegalStateException(\"block()/blockFirst()/blockLast() are blocking, which is not supported in thread \" + Thread.currentThread().getName());\n\t\t}\n\t\tif (getCount() != 0) {\n\t\t\ttry {\n\t\t\t\tif (!await(timeout, unit)) {\n\t\t\t\t\tdispose();\n\t\t\t\t\tthrow new IllegalStateException(\"Timeout on blocking read for \" + timeout + \" \" + unit);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (InterruptedException ex) {\n\t\t\t\tdispose();\n\t\t\t\tRuntimeException re = Exceptions.propagate(ex);\n\t\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\t\tre.addSuppressed(new Exception(\"#block has been interrupted\"));\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tthrow re;\n\t\t\t}\n\t\t}\n\n\t\tThrowable e = error;\n\t\tif (e != null) {\n\t\t\tRuntimeException re = Exceptions.propagate(e);\n\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\tre.addSuppressed(new Exception(\"#block terminated with an error\"));\n\t\t\tthrow re;\n\t\t}\n\t\treturn value;\n\t}",
"public TcpClient() {\n connector = new NioSocketConnector();\n connector.setHandler(this);\n connector.getFilterChain().addLast(\"codec\", \n new ProtocolCodecFilter(new TextLineCodecFactory(Charset.forName(\"UTF-8\")))); \n ConnectFuture connFuture = connector.connect(new InetSocketAddress(\"localhost\", TcpServer.PORT));\n connFuture.awaitUninterruptibly();\n session = connFuture.getSession();\n }",
"public SocketReadThread(AsynchronousSocketChannel ch, BlockingQueue<Message> messages, String name,\n\t\t\tKeyStore trustStore, SSLEngine engine) {\n\t\tthis.socketChannel = ch;\n\t\tthis.messages = messages;\n\t\tthis.name = name;\n\t\tthis.trustStore = trustStore;\n\t\tthis.engine = engine;\n\t}",
"private void openInputStream() throws IOException {\n InputStreamReader isReader = new InputStreamReader(this.sock.getInputStream());\n reader = new BufferedReader(isReader);\n }",
"public static Object createTaskObject(){\n try {\n\n return taskModel.make()\n .load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.WRAPPER)\n .getLoaded()\n .newInstance();\n\n\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n return null;\n }",
"public void startDiscoverability() throws IOException {\r\n pendingWrites = new HashMap<>();\r\n\r\n datagramChannel = DatagramChannel.open()\r\n .setOption(StandardSocketOptions.SO_REUSEADDR, true)\r\n .bind(this.findableAddress);\r\n datagramChannel.configureBlocking(false);\r\n\r\n selector = Selector.open();\r\n datagramChannel.register(this.selector, SelectionKey.OP_READ);\r\n\r\n findableServerThread = new Thread(new FindableServerRunnable());\r\n findableServerThread.start();\r\n }",
"public Task makeTask() {\n Task new_task = new Task();\n new_task.setAction(this);\n new_task.setDeadline(\n new Date(System.currentTimeMillis() + deadlineSeconds() * 1000L));\n\n return new_task;\n }",
"private Socket createClient()\n\t{\n\t\tSocket client = null;\n\t\ttry {\n\t\t\tclient = this.server.accept();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tinsertLogEntry(e.getMessage(), e.getStackTrace().toString());\n\t\t}\n\t\t\n\t\treturn client;\n\t}",
"public synchronized Message receive() \r\n\tthrows IOException, SocketTimeoutException {\r\n\t\tbyte[] buffer = new byte[576];\r\n\t\tMessage msg = null;\r\n\t\twhile (msg == null) {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.setSoTimeout(TIMEOUT);\r\n\t\t\t\tDatagramPacket response = new DatagramPacket(buffer,\r\n\t\t\t\t\t\tbuffer.length, this.socket.getInetAddress(),\r\n\t\t\t\t\t\tthis.socket.getLocalPort());\r\n\t\t\t\tsocket.receive(response);\r\n\t\t\t\tmsg = new Message(response.getData());\r\n\t\t\t\tmsg.setSender(response.getPort(), response.getAddress());\r\n\t\t\t} catch (MessageCorruptException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.sendConfirmation(msg.getSenderPort(), msg.getSenderHost());\r\n\r\n\t\tif (msg.getType().equals(\"%%start-fragments%%\"))\r\n\t\t\tmsg = receiveFragments();\r\n\r\n\t\treturn msg;\r\n\t}",
"BlockingConnection(Socket socket, CapabilitiesVMFactory capabilitiesVMFactory,\n Acceptor acceptor, MessagesSupportedVendorMessage supportedVendorMessage,\n MessageFactory messageFactory, NetworkManager networkManager,\n NetworkInstanceUtils networkInstanceUtils) {\n super(socket, capabilitiesVMFactory, supportedVendorMessage, networkManager, acceptor,\n networkInstanceUtils);\n this.socketsManager = null;\n this.messageFactory = messageFactory;\n }",
"public SftpDownloadTask() {\n\n\t}",
"public Socket awaitMessages(){\n Socket s = null;\n try { \n s = serverSocket.accept();\n\t } catch (IOException e) {\n System.out.println(\"Could not listen on port \" + portNumber);\n }\n return s;\n }",
"private NetFlowReader(\n DataInputStream inputStream,\n int buffer,\n boolean ignoreCorruptFile) throws IOException {\n in = inputStream;\n bufferLength = buffer;\n ignoreCorrupt = ignoreCorruptFile;\n byte[] metadata = null;\n WrappedByteBuf buf = null;\n\n try {\n metadata = new byte[METADATA_LENGTH];\n in.read(metadata, 0, METADATA_LENGTH);\n\n // Parse metadata, byte order does not really matter, so we go for big endian. Metadata contains\n // magic numbers to verify consistency of the NetFlow file, byte order encoded as either 1 or 2,\n // and stream version which affects header parsing (currently only 1 and 3 are supported).\n buf = WrappedByteBuf.init(metadata, ByteOrder.BIG_ENDIAN);\n short magic1 = buf.getUnsignedByte(0);\n short magic2 = buf.getUnsignedByte(1);\n short order = buf.getUnsignedByte(2);\n short stream = buf.getUnsignedByte(3);\n\n // Verify consistency of NetFlow file, also this ensures that we are at the beginning of the\n // input stream\n if (magic1 != HEADER_MAGIC1 || magic2 != HEADER_MAGIC2) {\n throw new IOException(\"Corrupt NetFlow file. Wrong magic number\");\n }\n\n // Resolve byte order, last case corresponds to incorrect reading from buffer\n if (order == HEADER_BIG_ENDIAN) {\n byteOrder = ByteOrder.BIG_ENDIAN;\n } else if (order == HEADER_LITTLE_ENDIAN) {\n byteOrder = ByteOrder.LITTLE_ENDIAN;\n } else {\n throw new IOException(\"Could not recognize byte order \" + order);\n }\n\n streamVersion = stream;\n\n // Check stream version\n ensureStreamVersion();\n\n // Read header\n header = getHeader();\n } catch (IOException err) {\n if (ignoreCorrupt) {\n // we subsume exception and log warning. Set header to null\n log.warn(\"Failed to initialize reader, ignoreCorruptFile=\" + ignoreCorrupt +\n \", error=\" + err);\n header = new CorruptNetFlowHeader();\n } else {\n throw err;\n }\n } finally {\n metadata = null;\n buf = null;\n }\n }",
"TaskDependency createTaskDependency();",
"public ServerTask(Socket sk)\r\n {\r\n this.sk=sk;\r\n }",
"public Acceptor getAcceptor (Address nearAddr, boolean blocking) \n throws IOException {\n if (blocking) {\n return new TlsAcceptor (new EndPoint(this, nearAddr));\n } else {\n //return new SchedulableTlsAcceptor (\n // new EndPoint(this, (IPAddress)nearAddr));\n throw new UnsupportedOperationException();\n }\n }",
"public InputStream createPullStream(String fname) throws IOException {\n\t\tSocket socket = null;\n\t\ttry {\n\t\t\tsocket = new Socket(host, port);\n\t\t\tInputStream in = socket.getInputStream();\n\t\t\tOutputStream out = socket.getOutputStream();\n\t\t\tDataOutputStream output = new DataOutputStream(socket.getOutputStream());\n\t\t\tProtocolSupport.send(\"host:transport:\" + serial, in, out);\n\n\t\t\tProtocolSupport.send(\"sync:\", in, out);\n\t\t\toutput.writeBytes(\"RECV\");\n\t\t\toutput.writeInt(Integer.reverseBytes(fname.length()));\n\t\t\toutput.writeBytes(fname);\n\t\t\toutput.flush();\n\t\t\treturn new PullStream(in);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\ttry {\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\tcatch (IOException e1) {\n\t\t\t}\n\t\t\tthrow e;\n\t\t}\n\t}",
"public static TCPSocketManager getSocketManager(String host, int port, int delay, boolean immediateFail, Layout<? extends Serializable> layout) {\n/* 99 */ if (Strings.isEmpty(host)) {\n/* 100 */ throw new IllegalArgumentException(\"A host name is required\");\n/* */ }\n/* 102 */ if (port <= 0) {\n/* 103 */ port = 4560;\n/* */ }\n/* 105 */ if (delay == 0) {\n/* 106 */ delay = 30000;\n/* */ }\n/* 108 */ return (TCPSocketManager)getManager(\"TCP:\" + host + \":\" + port, new FactoryData(host, port, delay, immediateFail, layout), FACTORY);\n/* */ }",
"private CloseableHttpAsyncClient createHttpClient() {\n RequestConfig.Builder requestConfigBuilder = RequestConfig.custom()\n .setConnectTimeout(Timeout.ofMilliseconds(DEFAULT_CONNECT_TIMEOUT_MILLIS))\n .setResponseTimeout(Timeout.ofMilliseconds(DEFAULT_RESPONSE_TIMEOUT_MILLIS));\n if (requestConfigCallback != null) {\n requestConfigBuilder = requestConfigCallback.customizeRequestConfig(requestConfigBuilder);\n }\n\n try {\n final TlsStrategy tlsStrategy = ClientTlsStrategyBuilder.create()\n .setSslContext(SSLContext.getDefault())\n // See https://issues.apache.org/jira/browse/HTTPCLIENT-2219\n .setTlsDetailsFactory(new Factory<SSLEngine, TlsDetails>() {\n @Override\n public TlsDetails create(final SSLEngine sslEngine) {\n return new TlsDetails(sslEngine.getSession(), sslEngine.getApplicationProtocol());\n }\n })\n .build();\n\n final PoolingAsyncClientConnectionManager connectionManager = PoolingAsyncClientConnectionManagerBuilder.create()\n .setMaxConnPerRoute(DEFAULT_MAX_CONN_PER_ROUTE)\n .setMaxConnTotal(DEFAULT_MAX_CONN_TOTAL)\n .setTlsStrategy(tlsStrategy)\n .build();\n\n HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClientBuilder.create()\n .setDefaultRequestConfig(requestConfigBuilder.build())\n .setConnectionManager(connectionManager)\n .setTargetAuthenticationStrategy(DefaultAuthenticationStrategy.INSTANCE)\n .disableAutomaticRetries();\n if (httpClientConfigCallback != null) {\n httpClientBuilder = httpClientConfigCallback.customizeHttpClient(httpClientBuilder);\n }\n\n final HttpAsyncClientBuilder finalBuilder = httpClientBuilder;\n return AccessController.doPrivileged((PrivilegedAction<CloseableHttpAsyncClient>) finalBuilder::build);\n } catch (NoSuchAlgorithmException e) {\n throw new IllegalStateException(\"could not create the default ssl context\", e);\n }\n }",
"public ReadThreadClient(NetworkUtil nu)//, int id , String address, BufferSize bz)\n {\n //this.id=id ;\n //this.address=address;\n //System.out.println(\"Server read cnstructor\");\n //this.map = map ;\n thread = new Thread(this);\n this.nu = nu ;\n //this.bz=bz ;\n\n thread.start();\n //System.out.println(\"Server read thread started\");\n }",
"@Override\n\tpublic Task fromBytes(byte[] byteArray) {\n\t\treturn null;\n\t}",
"private SingletonSyncBlock() {}",
"private void listen() {\n System.out.println(\"launch listen task\");\n listenTask = new AsyncTask<Void, String, IOException>() {\n @Override\n protected IOException doInBackground(Void... params) {\n try (BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {\n String line;\n while ((line = in.readLine()) != null) {\n System.out.println(\"receive \" + line);\n publishProgress(line);\n }\n } catch (SocketException e) {\n if (e.toString().equals(\"java.net.SocketException: Socket closed\")) {\n //that's what will happen when task.cancel() is called.\n System.out.println(\"listening is stopped as socket is closed\");\n return null;\n } else {\n e.printStackTrace();\n return e;\n }\n } catch (IOException e) {\n e.printStackTrace();\n return e;\n }\n return null;\n }\n\n @Override\n protected void onProgressUpdate(String... values) {\n handler.accept(new Message(MsgType.SERVER, values[0]));\n }\n\n @Override\n protected void onPostExecute(IOException e) {\n if (e == null) {\n handler.accept(new Message(MsgType.INFO, \"listening finished\"));\n } else {\n handler.accept(new Message(MsgType.ERROR,\n \"exception while listening\" + \"\\n\" + e.toString()));\n }\n }\n\n @Override\n protected void onCancelled() {\n super.onCancelled();\n }\n };\n //the listen task will last for a quite long time (blocking) and thus should run in a parallel pool.\n listenTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }",
"public MockSocket () {\n state = UNBOUND;\n }",
"public static ReceiveEthernetStrategy getInstance() {\n if (_receiveEthernetStrategy == null) {\n _receiveEthernetStrategy = new ReceiveEthernetStrategy();\n }\n return _receiveEthernetStrategy;\n }",
"@Override\n public SessionClient build() {\n Supplier<CompletableFuture<SessionClient>> proxyFactory = () -> CompletableFuture.completedFuture(\n new DefaultRaftSessionClient(\n primitiveName,\n primitiveType,\n serviceConfig,\n partitionId,\n DefaultRaftClient.this.protocol,\n selectorManager,\n sessionManager,\n readConsistency,\n communicationStrategy,\n threadContextFactory.createContext(),\n minTimeout,\n maxTimeout));\n\n SessionClient proxy;\n\n ThreadContext context = threadContextFactory.createContext();\n\n // If the recovery strategy is set to RECOVER, wrap the builder in a recovering proxy client.\n if (recoveryStrategy == Recovery.RECOVER) {\n proxy = new RecoveringSessionClient(\n clientId,\n partitionId,\n primitiveName,\n primitiveType,\n proxyFactory,\n context);\n } else {\n proxy = proxyFactory.get().join();\n }\n\n // If max retries is set, wrap the client in a retrying proxy client.\n if (maxRetries > 0) {\n proxy = new RetryingSessionClient(\n proxy,\n context,\n maxRetries,\n retryDelay);\n }\n return new BlockingAwareSessionClient(proxy, context);\n }",
"public XioClient newInstance( InetSocketAddress address);",
"public DatagramPacket readyPacket() throws IOException {\n\t\tbyte[] data = new byte[PACKET_SIZE];\n\t\tint bytesRead;\n\t\tboolean ready = false;\n\t\tDatagramPacket dp = null;\n\t\tif (!doneReading && (bytesRead = this.fp.read(data, 2, DATA_BUF)) > 0) {\n\t\t\tdata[0] = (byte) this.packetNumber; // set the packet number\n\t\t\tdata[1] = (byte) bytesRead; //send number of bytes read\n\t\t\tthis.totalBytesRead += bytesRead; // update for output info\n\t\t\tdp = new DatagramPacket(data, data.length, this.ia, receiverPort);\n\t\t\tready = true;\n\t\t} else {\n\t\t\tthis.doneReading = true;\n\t\t}\n\t\treturn dp;\n\t}",
"public NetMessage read() throws IOException\n \t{\n \t\treturn NetMessage.newNetMessage(new DataInputStream(din));\n \t}",
"private Future<Location> receiveClientRequest(){\n return executor.submit(new Callable<Location>(){\n public Location call(){\n Location clientLocation = null;\n try {\n MulticastSocket s = new MulticastSocket(PROTOCOL_GROUP_PORT);\n s.joinGroup(InetAddress.getByName(PROTOCOL_GROUP_ADDRESS));\n\n byte buf[] = new byte[2048];\n DatagramPacket pingPacket = new DatagramPacket(buf, buf.length);\n s.receive(pingPacket);\n\n clientLocation = deserialize(pingPacket.getData());\n\n System.out.println(\"[INFO] -----------------------------------------\\n\" +\n \"[INFO] Received location request...\");\n\n s.leaveGroup(InetAddress.getByName(PROTOCOL_GROUP_ADDRESS));\n s.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return clientLocation;\n }\n });\n }",
"public SocketChannelConfig setAutoRead(boolean autoRead)\r\n/* 326: */ {\r\n/* 327:316 */ super.setAutoRead(autoRead);\r\n/* 328:317 */ return this;\r\n/* 329: */ }",
"@Override\n protected TcpClient doInBackground(String... message) {\n tcpClient = new TcpClient(ip, Integer.valueOf(port));\n tcpClient.run();\n\n return null;\n }",
"private ByteList fread(RubyThread thread, int length) throws IOException, BadDescriptorException {\n Stream stream = openFile.getMainStreamSafe();\n int rest = length;\n waitReadable(stream);\n ByteList buf = blockingFRead(stream, thread, length);\n if (buf != null) {\n rest -= buf.length();\n }\n while (rest > 0) {\n waitReadable(stream);\n openFile.checkClosed(getRuntime());\n stream.clearerr();\n ByteList newBuffer = blockingFRead(stream, thread, rest);\n if (newBuffer == null) {\n // means EOF\n break;\n }\n int len = newBuffer.length();\n if (len == 0) {\n // TODO: warn?\n // rb_warning(\"nonblocking IO#read is obsolete; use IO#readpartial or IO#sysread\")\n continue;\n }\n if (buf == null) {\n buf = newBuffer;\n } else {\n buf.append(newBuffer);\n }\n rest -= len;\n }\n if (buf == null) {\n return ByteList.EMPTY_BYTELIST.dup();\n } else {\n return buf;\n }\n }",
"protected synchronized Socket getSocket(ImmutableEndpoint endpoint) throws TlcException {\r\n\t\tSocket socket = null;\r\n\t\ttry {\r\n\t\t\tTcpSocketKey socketKey = new TcpSocketKey(endpoint);\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"borrowing socket for \" + socketKey + \"/\"\r\n\t\t\t\t\t\t+ socketKey.hashCode());\r\n\t\t\t\tif (null != lastSocketKey) {\r\n\t\t\t\t\tlogger.debug(\"same as \" + lastSocketKey.hashCode() + \"? \"\r\n\t\t\t\t\t\t\t+ lastSocketKey.equals(socketKey));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsocket = (Socket) socketsPool.borrowObject(socketKey);\r\n\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"borrowed socket, \"\r\n\t\t\t\t\t\t+ (socket.isClosed() ? \"closed\" : \"open\") + \"; debt \"\r\n\t\t\t\t\t\t+ socketsPool.getNumActive());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tlogger.error(\"Connection Refused\");\r\n\r\n\t\t}\r\n\t\treturn socket;\r\n\t}",
"@Nullable\n\tfinal T blockingGet() {\n\t\tif (Schedulers.isInNonBlockingThread()) {\n\t\t\tthrow new IllegalStateException(\"block()/blockFirst()/blockLast() are blocking, which is not supported in thread \" + Thread.currentThread().getName());\n\t\t}\n\t\tif (getCount() != 0) {\n\t\t\ttry {\n\t\t\t\tawait();\n\t\t\t}\n\t\t\tcatch (InterruptedException ex) {\n\t\t\t\tdispose();\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tthrow Exceptions.propagate(ex);\n\t\t\t}\n\t\t}\n\n\t\tThrowable e = error;\n\t\tif (e != null) {\n\t\t\tRuntimeException re = Exceptions.propagate(e);\n\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\tre.addSuppressed(new Exception(\"#block terminated with an error\"));\n\t\t\tthrow re;\n\t\t}\n\t\treturn value;\n\t}",
"public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }",
"private BlocksPool() {\n this(DEFAULT_BLOCK_SIZE_BYTES);\n }",
"public Poolable get() throws Exception\n {\n // To make this class backwards compatible, it has to auto initialize if necessary\n if( !m_initialized )\n {\n initialize();\n }\n\n if( null == m_pool && null != m_controller )\n {\n final int increase = m_controller.grow();\n if( increase > 0 )\n {\n grow( increase );\n }\n }\n\n if( 0 > m_count )\n {\n m_count = -1;\n return (Poolable)m_factory.newInstance();\n }\n else if( 0 == m_count )\n {\n m_count--;\n return m_pool[ 0 ];\n }\n\n final Poolable poolable = m_pool[ m_count ];\n m_pool[ m_count ] = null;\n m_count--;\n return poolable;\n }",
"ITaskFactory<?> load(String classname);",
"private Socket newSocket() throws IOException {\n try {\n InetAddress hostAddress = InetAddress.getByName(publicAddress);\n return new Socket(hostAddress, AgentRemoteService.PORT);\n } catch (IOException e) {\n throw new IOException(\"Couldn't connect to publicAddress: \" + publicAddress + \":\" + AgentRemoteService.PORT, e);\n }\n }",
"public TcpControlBlock(IpAddress tcb_our_ip_addr){\n\t\tthis.tcb_our_ip_addr = tcb_our_ip_addr.getAddress();\n\t\tthis.tcb_seq = (int) Math.random();\n\t\tthis.tcb_state = ConnectionState.S_CLOSED;\n\t\ttcb_p_data = new Vector<ByteBuffer>();\n\t}",
"protected InputStream getInputStream() throws IOException\n {\n if (fd == null) {\n throw new IOException(\"socket not created\");\n }\n\n synchronized (this) {\n if (fis == null) {\n fis = new SocketInputStream();\n }\n\n return fis;\n }\n }",
"public StatDataFileReader createReaderInstance() throws IOException{\n return createReaderInstance(null);\n }",
"@Override\n\tpublic Task constructInstance(Robot robot) {\n\t\treturn null;\n\t}",
"Callable<E> getTask();",
"private ReadBlockRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {\n super(builder);\n }",
"long tryReadLock(long timeout) throws InterruptedException;",
"public Read(Person person) {\n\t\t// Use Task constructor.\n\t\tsuper(NAME, person, true, false, STRESS_MODIFIER, true, 5D);\n\n\t\tif (person.isInSettlement() || person.isInVehicle()) {\n\n\t\t\tboolean walkSite = false;\n\n\t\t\tint score = person.getPreference().getPreferenceScore(new ReadMeta());\n\t\t\tsuper.setDuration(5 + score);\n\t\t\t// Factor in a person's preference for the new stress modifier\n\t\t\tsuper.setStressModifier(score / 10D + STRESS_MODIFIER);\n\n\t\t\t// set the boolean to true so that it won't be done again today\n\t\t\t// person.getPreference().setTaskStatus(this, false);\n\n\t\t\tif (person.isInSettlement()) {\n\t\t\t\t// if gym is not available, go back to his quarters\n\t\t\t\tBuilding quarters = person.getQuarters();\n\t\t\t\tif (quarters != null) {\n\t\t\t\t\twalkToActivitySpotInBuilding(quarters, FunctionType.LIVING_ACCOMODATIONS, true);\n\t\t\t\t\twalkSite = true;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif (!walkSite) {\n\t\t\t\tif (person.isInVehicle()) {\n\t\t\t\t\t// If person is in rover, walk to passenger activity spot.\n\t\t\t\t\tif (person.getVehicle() instanceof Rover) {\n\t\t\t\t\t\twalkToPassengerActivitySpotInRover((Rover) person.getVehicle(), true);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Walk to random location.\n\t\t\t\t\twalkToRandomLocation(true);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tsetDescription(Msg.getString(\"Task.description.read\"));\n\n\t\t} else {\n\t\t\tendTask();\n\t\t}\n\n\t\t// Initialize phase\n\t\taddPhase(READING);\n\t\tsetPhase(READING);\n\t}",
"NetThread(){}",
"private static InputStream createStream(final TachyonFile file, final ReadType readType)\n throws IOException {\n return RemoteBlockInStreams.create(file, readType, 0);\n }"
] | [
"0.73837495",
"0.58018506",
"0.5556167",
"0.5522067",
"0.55140156",
"0.55084",
"0.54404074",
"0.53147143",
"0.51592773",
"0.50800294",
"0.50800294",
"0.50800294",
"0.507278",
"0.49929136",
"0.49759084",
"0.49604318",
"0.49223346",
"0.48945972",
"0.4882328",
"0.48781133",
"0.4869069",
"0.48669592",
"0.48002803",
"0.47893918",
"0.47818658",
"0.47627535",
"0.4759515",
"0.47395998",
"0.47335067",
"0.4719134",
"0.47092673",
"0.46827596",
"0.46775466",
"0.46691266",
"0.46545908",
"0.4650532",
"0.46425062",
"0.4636602",
"0.4635346",
"0.46285167",
"0.46274593",
"0.4625543",
"0.46121177",
"0.46118826",
"0.4609314",
"0.46049544",
"0.4600356",
"0.4591967",
"0.4585511",
"0.45813552",
"0.45790452",
"0.45717898",
"0.45649335",
"0.45625967",
"0.45437407",
"0.45347458",
"0.45192546",
"0.4514407",
"0.4510787",
"0.45023093",
"0.4489985",
"0.4481581",
"0.44794074",
"0.4471146",
"0.44655496",
"0.4447968",
"0.44434986",
"0.44404954",
"0.44305044",
"0.442372",
"0.44229135",
"0.44216275",
"0.4419685",
"0.43972772",
"0.4389545",
"0.43856326",
"0.43854728",
"0.43679637",
"0.4364942",
"0.43643624",
"0.43642944",
"0.4358269",
"0.43580776",
"0.43574116",
"0.43475989",
"0.43401387",
"0.43355426",
"0.43307683",
"0.4330556",
"0.4326733",
"0.43261582",
"0.43243742",
"0.4322402",
"0.43180478",
"0.43137923",
"0.43120235",
"0.43037605",
"0.42973304",
"0.42969543",
"0.42905608"
] | 0.7404573 | 0 |
Return a ReadBlockingTask from the pool. If the pool is empty, create a new instance. | protected ReadBlockingTask getReadBlockingTask(Socket socket){
ReadBlockingTask task = null;
if (isRecycleTasks()) {
task = (ReadBlockingTask)getReadTasks().poll();
}
if (task == null){
task = newReadBlockingTask(false);
}
ProcessorTask processorTask = task.getProcessorTask();
processorTask.setSocket(socket);
return task;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private ReadBlockingTask newReadBlockingTask(boolean initialize){\n \n ReadBlockingTask task = new ReadBlockingTask();\n task.setSelectorThread(this);\n task.setPipeline(getProcessorPipeline());\n \n task.setRecycle(isRecycleTasks());\n task.attachProcessor(newProcessorTask(initialize));\n task.setPipelineStatistic(getPipelineStat());\n task.setSecure(secure);\n \n return task;\n }",
"private JedisPool getPool() {\n if (pool == null) {\n JedisPoolConfig config = new JedisPoolConfig();\n config.setMinIdle(poolMinIdle);\n config.setMaxIdle(poolMaxIdle);\n config.setMaxTotal(poolMaxTotal);\n pool = new JedisPool(config, host, port, (int) timeout);\n logger.debug(\"Creando jedisPool@ \" + host + \":\" + port + \". MinIdle/MaxIdle/MaxTotal: \" + poolMinIdle + \"/\" + poolMaxIdle + \"/\" + poolMaxTotal + \". Timeout: \" + timeout);\n }\n return pool;\n }",
"public Poolable get() throws Exception\n {\n // To make this class backwards compatible, it has to auto initialize if necessary\n if( !m_initialized )\n {\n initialize();\n }\n\n if( null == m_pool && null != m_controller )\n {\n final int increase = m_controller.grow();\n if( increase > 0 )\n {\n grow( increase );\n }\n }\n\n if( 0 > m_count )\n {\n m_count = -1;\n return (Poolable)m_factory.newInstance();\n }\n else if( 0 == m_count )\n {\n m_count--;\n return m_pool[ 0 ];\n }\n\n final Poolable poolable = m_pool[ m_count ];\n m_pool[ m_count ] = null;\n m_count--;\n return poolable;\n }",
"@NotNull\n protected ReusablePool<AbstractReadablePacket> getPool() {\n return requireNonNull(ClassUtils.unsafeCast(getPacketType().getPool()));\n }",
"public static Message obtain() {\n// synchronized (sPoolSync) {\n// if (sPool != null) {\n// Message m = sPool;\n// sPool = m.next;\n// m.next = null;\n// sPoolSize--;\n// return m;\n// }\n// }\n return new Message();\n }",
"public Class getReadTask(SelectorThread selectorThread);",
"protected ThreadPool getPool()\r\n {\r\n return threadPool_;\r\n }",
"public synchronized Object get() throws InterruptedException {\n while (pool.isEmpty()) {\n wait();\n }\n Object result = pool.remove(0);\n notifyAll();\n return result;\n }",
"public Task getInstance(TargetTransportPort port, Command command)\n throws IllegalRequestException\n {\n switch (command.getCommandDescriptorBlock().getOperationCode())\n {\n case ModeSense6.OPERATION_CODE :\n case ModeSense10.OPERATION_CODE :\n return new ModeSenseTask(port, command, modePageRegistry, inquiryDataRegistry);\n case TestUnitReady.OPERATION_CODE :\n return new TestUnitReadyTask(port, command, modePageRegistry, inquiryDataRegistry);\n case Inquiry.OPERATION_CODE :\n return new InquiryTask(port, command, modePageRegistry, inquiryDataRegistry);\n }\n\n Class<? extends BufferedTask> taskClass =\n tasks.get(command.getCommandDescriptorBlock().getClass());\n\n if (taskClass != null)\n {\n try\n {\n return taskClass.newInstance().load(buffer, blockLength, port, command,\n modePageRegistry, inquiryDataRegistry);\n }\n catch (InstantiationException e)\n {\n throw new RuntimeException(\"Unable to instantiate class with default constructor\"\n + taskClass.getName(), e);\n }\n catch (IllegalAccessException e)\n {\n throw new RuntimeException(\"Unable to instantiate class with default constructor\"\n + taskClass.getName(), e);\n }\n }\n else\n {\n throw new InvalidCommandOperationCodeException();\n }\n }",
"public Jedis getResource() {\n\t\tif (jedisPool == null) {\n\t\t\tsynchronized (this) {\n\t\t\t\tif (jedisPool == null){\n\t\t\t\t\tjedisPool = new JedisPool(jedisPoolConfig, host, port);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn jedisPool.getResource();\n\t}",
"public BoneCP getPool() {\n return pool;\n }",
"OMMPool getPool();",
"private Runnable getTask() {\r\n if (mType== Type.FIFO){\r\n return mTaskQueue.removeFirst();\r\n }else if (mType== Type.LIFO){\r\n return mTaskQueue.removeLast();\r\n }\r\n return null;\r\n }",
"public synchronized T doCreate() throws PoolException {\n if (maxSize == INFINITE || inUse < maxSize) {\n T item = create();\n inUse++;\n return item;\n } else {\n throw new PoolException(\"pool at capacity: \" + inUse + \" item(s) checked out. \" + getStack().size() + \" items in getStack().\");\n }\n }",
"public Pooled<T> get() throws APIException {\n\t\tPooled<T> pt;\n\t\tsynchronized (list) {\n\t\t\tif (list.isEmpty()) {\n\t\t\t\tpt = null;\n\t\t\t} else {\n\t\t\t\tpt = list.removeLast();\n\t\t\t\t--count;\n\t\t\t\tcreator.reuse(pt.content);\n\t\t\t}\n\t\t}\n\t\tif (pt == null) {\n\t\t\tif (spares < max_range)\n\t\t\t\t++spares;\n\t\t\tpt = new Pooled<T>(creator.create(), this, LogTarget.NULL);\n\t\t} else {\n\t\t\tif (spares > 1)\n\t\t\t\t--spares;\n\t\t}\n\t\treturn pt;\n\t}",
"public static ConnectionPool getInstance() {\n if (!created.get()) {\n try {\n createLock.lock();\n if (instance == null) {\n instance = new ConnectionPool();\n created.set(true);\n }\n } finally {\n createLock.unlock();\n }\n }\n return instance;\n }",
"public synchronized T pop() throws PoolException {\n try {\n\n T item = getStack().poll();\n if (item == null || !isValid(item)) {\n trace(\"pop: creating new item\");\n return doCreate();\n }\n inUse++;\n trace(\"pop: in use = \" + inUse + \", created = \" + totalCreated);\n return item;\n } catch (IndexOutOfBoundsException x) { // pool is empty\n return doCreate();\n } catch (NoSuchElementException x) { // pool is empty\n return doCreate();\n }\n }",
"public static BoneCP getPool() throws Exception\n {\n if (_pool == null)\n {\n throw new Exception(\"The connection pool was not initialized!\");\n }\n\n return _pool;\n }",
"public List<CaptureTask> loadTaskToTaskPool(int poolSize) {\n\t\treturn null;\r\n\t}",
"public T getResource() throws ResourcePoolException{\n\t\tT resource = null;\n\t\tsynchronized(this.lock){\n\t\t\tint index=0;\n\t\t\t//true prove if have the resource which have not in use\n\t\t\t//current size > 0 prove the resource pool have the resource\n\t\t\tif(this.currentSize>0){\n\t\t\t\tfor(ResourceStatus<T> resourceStatus:this.resourcesStatus){\n\t\t\t\t\tif(resourceStatus!=null){\n\t\t\t\t\t\tif(!resourceStatus.isInUse()){\n\t\t\t\t\t\t\tresource=resourceStatus.getResource();\n\t\t\t\t\t\t\tresourceStatus.setInUse(true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(resource==null){\n\t\t\t\tif(this.currentSize<this.maxResources){\n\t\t\t\t\tfor(ResourceStatus<T> resourceStatus:this.resourcesStatus){\n\t\t\t\t\t\tif(resourceStatus==null){\n\t\t\t\t\t\t\tresource=this.resourceSource.getResource();\n\t\t\t\t\t\t\tif(resource!=null){\n\t\t\t\t\t\t\t\tResourceStatus<T> oneStatus=new ResourceStatus<T>();\n\t\t\t\t\t\t\t\toneStatus.setResource(resource);\n\t\t\t\t\t\t\t\toneStatus.setInUse(true);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tthis.resourcesStatus[index]=oneStatus;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tthis.currentSize++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tindex++;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tthrow new ResourcePoolException(\"The resource pool is max,current:\"+this.currentSize);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn resource;\n\t}",
"private synchronized Task takeTask() {\n while (true) {\n Task task = null;\n if (runningActions < maxConcurrentActions) {\n task = runnableActions.poll();\n }\n if (task == null) {\n task = runnableTasks.poll();\n }\n\n if (task != null) {\n runningTasks++;\n if (task.isAction()) {\n runningActions++;\n }\n return task;\n }\n\n if (isExhausted()) {\n return null;\n }\n\n try {\n wait();\n } catch (InterruptedException e) {\n throw new AssertionError();\n }\n }\n }",
"public ThreadPool getThreadPool(String threadpoolId) throws NoSuchThreadPoolException;",
"protected abstract void createPool();",
"private void initReadBlockingTask(int size){ \n for (int i=0; i < size; i++){\n getReadTasks().offer(newReadBlockingTask(false));\n }\n }",
"public StealingPool getPool() {\n return pool;\n }",
"public static ConnectionPool getInstance() {\n if (!createdInstance.get()) {\n try {\n lock.lock();\n\n if (instance == null) {\n instance = new ConnectionPool();\n createdInstance.set(true);\n\n LOGGER.log(Level.INFO, \"ConnectionPool instance created!\");\n }\n } finally {\n lock.unlock();\n }\n }\n\n return instance;\n }",
"static BlocksPool getInstance() {\n if (instance == null) {\n synchronized (BlocksPool.class) { // can be easily changed to lock-free\n if (instance == null) {\n instance = new BlocksPool();\n }\n }\n }\n return instance;\n }",
"public PooledConnection newInstance() {\n return new PooledConnection(pool);\n }",
"public abstract T create() throws PoolException;",
"public Pooled<T> get(LogTarget lt) throws APIException {\n\t\tPooled<T> pt;\n\t\tsynchronized (list) {\n\t\t\tif (list.isEmpty()) {\n\t\t\t\tpt = null;\n\t\t\t} else {\n\t\t\t\tpt = list.remove();\n\t\t\t\t--count;\n\t\t\t\tcreator.reuse(pt.content);\n\t\t\t}\n\t\t}\n\t\tif (pt == null) {\n\t\t\tif (spares < max_range)\n\t\t\t\t++spares;\n\t\t\tpt = new Pooled<T>(creator.create(), this, lt);\n\t\t\tlt.log(\"Pool created \", creator.toString());\n\t\t} else {\n\t\t\tif (spares > 1)\n\t\t\t\t--spares;\n\t\t}\n\t\treturn pt;\n\t}",
"public abstract int getFromPool(int x);",
"public ResourcePoolImpl() {\r\n this((ResourcePool) null);\r\n }",
"ActorThreadPool getThreadPool();",
"final Runnable peekTask() {\n Runnable[] q = queue;\n if (q == null)\n return null;\n int mask = q.length - 1;\n int i = base;\n return q[i & mask];\n }",
"final Runnable pollTask() {\n Runnable t = locallyDeqTask();\n if (t == null && (t = scan()) != null)\n ++stealCount;\n return t;\n }",
"Task poll();",
"public static Object createTaskObject(){\n try {\n\n return taskModel.make()\n .load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.WRAPPER)\n .getLoaded()\n .newInstance();\n\n\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n return null;\n }",
"@Override\n public FTPClient borrowObject()\n throws Exception {\n if (ftpBlockingQueue.size() == 0) {\n synchronized (FTPClient.class) {\n initPool(DEFAULT_POOL_SIZE);\n }\n }\n FTPClient client = ftpBlockingQueue.take();\n if (ObjectUtils.isEmpty(client)) {\n client = ftpClientFactory.create();\n // Put into the connection pool\n returnObject(client);\n // Verify that the object is valid\n } else if (!ftpClientFactory.validateObject(ftpClientFactory.wrap(client))) {\n // Process invalid objects\n invalidateObject(client);\n // Create a new object\n client = ftpClientFactory.create();\n // Put the new object into the connection pool\n returnObject(client);\n }\n return client;\n }",
"public static RestTask obtainGetTask(String url)\n throws IOException {\n HttpURLConnection connection = createDefaultConnection(url);\n attachAuthentication(connection);\n connection.setDoInput(true);\n\n return new RestTask(connection);\n }",
"@SuppressWarnings(\"unchecked\")\n\tprivate StaticBasicParserPool getParserPool() {\n\t\ttry {\n\t\t\tStaticBasicParserPool parserPool = new StaticBasicParserPool();\n\t\t\tparserPool.setBuilderFeatures(Collections.singletonMap(\"http://apache.org/xml/features/dom/defer-node-expansion\", false));\n\t\t\tparserPool.initialize();\n\t\t\treturn parserPool;\n\t\t} catch (XMLParserException e) {\n\t\t\tthrow new RuntimeException(\"Error while initilizing parse pool\", e);\n\t\t}\n\t}",
"Connection createConnection(ExecutorService pool);",
"final Runnable pollLocalTask() {\n return locallyDeqTask();\n }",
"final Runnable popTask() {\n int s = sp;\n while (s != base) {\n if (tryActivate()) {\n Runnable[] q = queue;\n int mask = q.length - 1;\n int i = (s - 1) & mask;\n Runnable t = q[i];\n if (t == null || !casSlotNull(q, i, t))\n break;\n storeSp(s - 1);\n return t;\n }\n }\n return null;\n }",
"protected ClassPool getClassPool() {\r\n return pool;\r\n }",
"public Mono<Pool> getPool(String poolName) throws WebClientResponseException {\n Object postBody = null;\n // verify the required parameter 'poolName' is set\n if (poolName == null) {\n throw new WebClientResponseException(\"Missing the required parameter 'poolName' when calling getPool\", HttpStatus.BAD_REQUEST.value(), HttpStatus.BAD_REQUEST.getReasonPhrase(), null, null, null);\n }\n // create path and map variables\n final Map<String, Object> pathParams = new HashMap<String, Object>();\n\n pathParams.put(\"pool_name\", poolName);\n\n final MultiValueMap<String, String> queryParams = new LinkedMultiValueMap<String, String>();\n final HttpHeaders headerParams = new HttpHeaders();\n final MultiValueMap<String, String> cookieParams = new LinkedMultiValueMap<String, String>();\n final MultiValueMap<String, Object> formParams = new LinkedMultiValueMap<String, Object>();\n\n final String[] localVarAccepts = { \n \"application/json\"\n };\n final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);\n final String[] localVarContentTypes = { };\n final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);\n\n String[] localVarAuthNames = new String[] { };\n\n ParameterizedTypeReference<Pool> localVarReturnType = new ParameterizedTypeReference<Pool>() {};\n return apiClient.invokeAPI(\"/pools/{pool_name}\", HttpMethod.GET, pathParams, queryParams, postBody, headerParams, cookieParams, formParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);\n }",
"public synchronized final Object readObject() {\n\t\tif (!inQueue.isEmpty())\n\t\t\treturn inQueue.dequeue();\n\t\telse return null;\n\t}",
"Callable<E> getTask();",
"@Nullable\n public Task getTask(int id) {\n Task output = null;\n\n // get a readable instance of the database\n SQLiteDatabase db = getReadableDatabase();\n if (db == null) return null;\n\n // run the query to get the matching task\n Cursor rawTask = db.rawQuery(\"SELECT * FROM Tasks WHERE id = ? ORDER BY due_date ASC;\", new String[]{String.valueOf(id)});\n\n // move the cursor to the first result, if one exists\n if (rawTask.moveToFirst()) {\n // convert the cursor to a task and assign it to our output\n output = new Task(rawTask);\n }\n\n // we're done with the cursor and database, so we can close them here\n rawTask.close();\n db.close();\n\n // return the (possibly null) output\n return output;\n }",
"private synchronized WorkerThread getThread() {\n\t\tfor (int i = 0; i < this.threadPool.size(); ++i) {\n\t\t\tif (this.threadPool.get(i).available()) {\n\t\t\t\tthis.threadPool.get(i).setAvailable(false);\n\t\t\t\treturn this.threadPool.get(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public static PoolInfoClient create() {\n return new PoolInfoClient();\n }",
"public ThreadPool getThreadPool(int numericIdForThreadpool) throws NoSuchThreadPoolException;",
"public Task getTask() {\n Long __key = this.TaskId;\n if (task__resolvedKey == null || !task__resolvedKey.equals(__key)) {\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n TaskDao targetDao = daoSession.getTaskDao();\n Task taskNew = targetDao.load(__key);\n synchronized (this) {\n task = taskNew;\n \ttask__resolvedKey = __key;\n }\n }\n return task;\n }",
"private Runnable scan() {\n Runnable t = null;\n int r = seed; // extract once to keep scan quiet\n StealingThread[] ws; // refreshed on outer loop\n int mask; // must be power 2 minus 1 and > 0\n outer:do {\n if ((ws = pool.threads) != null && (mask = ws.length - 1) > 0) {\n int idx = r;\n int probes = ~mask; // use random index while negative\n for (;;) {\n r = xorShift(r); // update random seed\n StealingThread v = ws[mask & idx];\n if (v == null || v.sp == v.base) {\n if (probes <= mask)\n idx = (probes++ < 0) ? r : (idx + 1);\n else\n break;\n }\n else if (!tryActivate() || (t = v.deqTask()) == null)\n continue outer; // restart on contention\n else\n break outer;\n }\n }\n } while (pool.hasNewSyncEvent(this)); // retry on pool events\n seed = r;\n return t;\n }",
"public T take() throws InterruptedException, IOException {\n lock.lock();\n try {\n T wrapper = this.dequeue();\n if (wrapper == null) {\n while ((wrapper = this.dequeue()) == null) {\n logger.debug(\"Waiting for take condition\");\n await();\n }\n }\n return wrapper;\n } finally {\n lock.unlock();\n }\n }",
"public static ObjectPool getInstance() {\n\t\tif (objectPoolInstance == null) { \n\t synchronized (ObjectPool.class) { \n\t if (objectPoolInstance == null) { \n\t \tobjectPoolInstance = new ObjectPool(); \n\t } \n\t }\n\t } \n\treturn objectPoolInstance; \n\t}",
"public ForkJoinPool getPool() {\n return pool;\n }",
"public Optional<Task> getATask() {\n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(List.of(MediaType.APPLICATION_JSON));\n\n ResponseEntity<Task> responseEntity = restTemplate.exchange(\n queueUrl + \"/getATask\",\n HttpMethod.GET,\n new HttpEntity<>(headers),\n Task.class);\n\n return Optional.ofNullable(responseEntity.getBody());\n }",
"public DisplayPoolItem poll() {\r\n\t\t\tmFragLock.lock();\r\n\t\t\t/*\r\n\t\t\t * Query contentPool for more Fragments, if current dPool's fragment\r\n\t\t\t * number is below threshold.\r\n\t\t\t */\r\n\t\t\t// if (mDispItems.size() <= threshold) {\r\n\t\t\t/*\r\n\t\t\t * WTF? JDK does not support constant time concatenation of linked\r\n\t\t\t * list???\r\n\t\t\t */\r\n\t\t\t// LinkedList<DisplayPoolItem> newList = cPool.getFragList();\r\n\t\t\t// for (DisplayPoolItem f2 : newList) {\r\n\t\t\t// mDispItems.add(f2);\r\n\t\t\t// }\r\n\t\t\t// }\r\n\r\n\t\t\tif (mDispItems.peek() == null) {\r\n\t\t\t\tmFragLock.unlock();\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\tDisplayPoolItem dItem = mDispItems.pollFirst(); // pop and remove\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the first element\r\n\r\n\t\t\tmFragLock.unlock();\r\n\r\n\t\t\treturn dItem;\r\n\t\t}",
"@Nullable\n\tfinal T blockingGet() {\n\t\tif (Schedulers.isInNonBlockingThread()) {\n\t\t\tthrow new IllegalStateException(\"block()/blockFirst()/blockLast() are blocking, which is not supported in thread \" + Thread.currentThread().getName());\n\t\t}\n\t\tif (getCount() != 0) {\n\t\t\ttry {\n\t\t\t\tawait();\n\t\t\t}\n\t\t\tcatch (InterruptedException ex) {\n\t\t\t\tdispose();\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tthrow Exceptions.propagate(ex);\n\t\t\t}\n\t\t}\n\n\t\tThrowable e = error;\n\t\tif (e != null) {\n\t\t\tRuntimeException re = Exceptions.propagate(e);\n\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\tre.addSuppressed(new Exception(\"#block terminated with an error\"));\n\t\t\tthrow re;\n\t\t}\n\t\treturn value;\n\t}",
"private void readConstantPool() throws IOException, ClassFormatException {\n constant_pool = new ConstantPool(dataInputStream);\n }",
"public interface Pool<T> extends LifeCycle {\n\n /**\n * Returns an instance from the pool. The call may be a blocking one or a\n * non-blocking one and that is determined by the internal implementation.\n * <p>\n * If the call is a blocking call, the call returns immediately with a valid\n * object if available, else the thread is made to wait until an object\n * becomes available. In case of a blocking call, it is advised that clients\n * react to {@link InterruptedException} which might be thrown when the\n * thread waits for an object to become available.\n * <p>\n * If the call is a non-blocking one, the call returns immediately\n * irrespective of whether an object is available or not. If any object is\n * available the call returns it else the call returns null.\n * <p>\n * The validity of the objects are determined using the Validator interface,\n * such that an object o is valid if Validator.isValid(o) == true\n *\n * @return T one of the pooled objects.\n */\n PooledObject<T> get();\n\n /**\n * Releases the object and puts it back to the pool.\n * <p>\n * The mechanism of putting the object back to the pool is generally\n * asynchronous, however future implementations might differ.\n *\n * @param t the object to return to the pool\n */\n\n void release(PooledObject<T> t);\n\n boolean isValid(PooledObject<T> t);\n\n int size();\n\n boolean isEmpty();\n\n int getCreatedObjectSize();\n\n /**\n * Represents the functionality to validate an object of the pool\n */\n interface Validator<T> {\n /**\n * Checks whether the object is valid.\n *\n * @param t the object to check.\n * @return true if the object is valid else false.\n */\n boolean isValid(PooledObject<T> t);\n\n }\n\n interface Dispose<T> {\n /**\n * Performs any cleanup activities before discarding the object. For\n * example before discarding database connection objects, the pool will\n * want to close the connections.\n *\n * @param t the object to cleanup\n */\n\n void destroy(PooledObject<T> t);\n }\n\n interface ObjectFactory<T> {\n\n /**\n * Returns a new instance of an object of type T.\n *\n * @return T an new instance of the object of type T\n */\n Promise.Completable<PooledObject<T>> createNew();\n }\n}",
"public Task getTask(Integer tid);",
"public Task getNext()\n {\n\treturn new Task(toDo.get(0));\n }",
"protected interface Pool<T> {\n /** Retrieves the give object from the pool if it is found, or null otherwise. */\n @Nullable\n T get(T input);\n\n /** Stores the given object into the pool. */\n void put(T input);\n\n /** Clears the pool. */\n void clear();\n\n /** Returns the size of the pool. */\n int size();\n }",
"public static ThreadPool getInstance()\r\n {\r\n if(instance == null)\r\n {\r\n instance = new ThreadPool();\r\n }\r\n return instance;\r\n }",
"protected synchronized ExecutorService getService() {\r\n if(service == null) {\r\n //System.out.println(\"creating an executor service with a threadpool of size \" + threadPoolSize);\r\n service = Executors.newFixedThreadPool(threadPoolSize, new ThreadFactory() {\r\n private int count = 0;\r\n \r\n public Thread newThread(Runnable r) {\r\n Thread t = new Thread(r, \"tile-pool-\" + count++);\r\n t.setPriority(Thread.MIN_PRIORITY);\r\n t.setDaemon(true);\r\n return t;\r\n }\r\n });\r\n }\r\n return service;\r\n }",
"@Nullable\n\tfinal T blockingGet(long timeout, TimeUnit unit) {\n\t\tif (Schedulers.isInNonBlockingThread()) {\n\t\t\tthrow new IllegalStateException(\"block()/blockFirst()/blockLast() are blocking, which is not supported in thread \" + Thread.currentThread().getName());\n\t\t}\n\t\tif (getCount() != 0) {\n\t\t\ttry {\n\t\t\t\tif (!await(timeout, unit)) {\n\t\t\t\t\tdispose();\n\t\t\t\t\tthrow new IllegalStateException(\"Timeout on blocking read for \" + timeout + \" \" + unit);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcatch (InterruptedException ex) {\n\t\t\t\tdispose();\n\t\t\t\tRuntimeException re = Exceptions.propagate(ex);\n\t\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\t\tre.addSuppressed(new Exception(\"#block has been interrupted\"));\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tthrow re;\n\t\t\t}\n\t\t}\n\n\t\tThrowable e = error;\n\t\tif (e != null) {\n\t\t\tRuntimeException re = Exceptions.propagate(e);\n\t\t\t//this is ok, as re is always a new non-singleton instance\n\t\t\tre.addSuppressed(new Exception(\"#block terminated with an error\"));\n\t\t\tthrow re;\n\t\t}\n\t\treturn value;\n\t}",
"public synchronized Object acquireObject()\n throws DBPoolException {\n try {\n // if the maximum amount of instances are in use\n // wait until an instance has been released back\n // to the pool or 20 seconds has passed\n long timediff = 0;\n while ( in_use.size() == getMaxInstances() && timediff < 20000 ) {\n Thread.sleep( 100 );\n timediff += 100;\n }\n // if no instance has been released within 20 seconds\n // or can newly be instantiated return null\n if ( timediff >= 20000 )\n return null;\n\n // if a none used is available from the pool\n if ( available.size() > 0 ) {\n\n // get/remove ojebct from the pool\n Object o = available.remove( available.size() - 1 );\n if ( ( (Connection) o ).isClosed() ) {\n startLifeTime.remove( o );\n o = acquireObject();\n }\n\n // add it to 'in use' container\n if ( !in_use.contains( o ) )\n in_use.add( o );\n\n // reset its start life time\n startLifeTime.put( o, new Long( System.currentTimeMillis() ) );\n // set the start of its usage\n startUsageTime.put( o, new Long( System.currentTimeMillis() ) );\n\n // return the object\n return o;\n\n }\n // else instatiate a new object\n // create a new class instance\n DriverManager.registerDriver( (Driver) Class.forName( driver ).newInstance() );\n\n Properties prop = (Properties) properties.clone();\n Object connection = DriverManager.getConnection( database, prop );\n\n existingInstances++;\n\n // add it to 'in use' container\n in_use.add( connection );\n // set the start of its life time\n startLifeTime.put( connection, new Long( System.currentTimeMillis() ) );\n // set the start of its usage\n startUsageTime.put( connection, new Long( System.currentTimeMillis() ) );\n // return the object\n return connection;\n } catch ( Exception e ) {\n e.printStackTrace();\n throw new DBPoolException( \"Error while acquiring connection: \" + e.getMessage(), e );\n }\n }",
"public com.google.common.util.concurrent.ListenableFuture<\n com.google.cloud.gkemulticloud.v1.AzureNodePool>\n getAzureNodePool(com.google.cloud.gkemulticloud.v1.GetAzureNodePoolRequest request) {\n return io.grpc.stub.ClientCalls.futureUnaryCall(\n getChannel().newCall(getGetAzureNodePoolMethod(), getCallOptions()), request);\n }",
"public static Connection getConnection() {\n\n if (concount<conns-1) {\n concount++;\n } else {\n concount=0;\n }\n return con_pool[concount];\n }",
"public synchronized Object get() {\n try {\n Object obj = queue.take().getElement();\n\n // set next offset\n delayOffset = System.currentTimeMillis();\n\n return obj;\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n return null;\n }",
"public com.google.cloud.gkemulticloud.v1.AzureNodePool getAzureNodePool(\n com.google.cloud.gkemulticloud.v1.GetAzureNodePoolRequest request) {\n return io.grpc.stub.ClientCalls.blockingUnaryCall(\n getChannel(), getGetAzureNodePoolMethod(), getCallOptions(), request);\n }",
"public final T get()\r\n/* 120: */ {\r\n/* 121:147 */ if (this.maxCapacityPerThread == 0) {\r\n/* 122:148 */ return newObject(NOOP_HANDLE);\r\n/* 123: */ }\r\n/* 124:150 */ Stack<T> stack = (Stack)this.threadLocal.get();\r\n/* 125:151 */ DefaultHandle<T> handle = stack.pop();\r\n/* 126:152 */ if (handle == null)\r\n/* 127: */ {\r\n/* 128:153 */ handle = stack.newHandle();\r\n/* 129:154 */ handle.value = newObject(handle);\r\n/* 130: */ }\r\n/* 131:156 */ return handle.value;\r\n/* 132: */ }",
"public Object get() {\n while(isLocked() ) {\n try {\n Thread.sleep(10);\n }\n catch(InterruptedException ie) {\n // do nothing\n }\n }\n \n Object retVal = getHead();\n LAST_READ_TIME = now();\n return retVal;\n }",
"public FreeClientPool getClientPool()\n\t{\n\t\treturn this.peer.getClientPool();\n\t}",
"@Nonnull\r\n\tpublic static <T> Observable<T> invokeAsync(\r\n\t\t\t@Nonnull final Callable<? extends T> call,\r\n\t\t\t@Nonnull final Scheduler pool) {\r\n\t\treturn new Observable<T>() {\r\n\t\t\t@Override\r\n\t\t\t@Nonnull \r\n\t\t\tpublic Closeable register(@Nonnull final Observer<? super T> observer) {\r\n\t\t\t\treturn pool.schedule(new Runnable() {\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tobserver.next(call.call());\r\n\t\t\t\t\t\t\tobserver.finish();\r\n\t\t\t\t\t\t} catch (Throwable ex) {\r\n\t\t\t\t\t\t\tobserver.error(ex);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\t}",
"public Connection getConnection() throws SQLException {\r\n if (poolState.get() != POOL_NORMAL) throw PoolCloseException;\r\n\r\n //0:try to get from threadLocal cache\r\n WeakReference<Borrower> ref = threadLocal.get();\r\n Borrower borrower = (ref != null) ? ref.get() : null;\r\n if (borrower != null) {\r\n PooledConnection pConn = borrower.lastUsedConn;\r\n if (pConn != null && pConn.state == CONNECTION_IDLE && ConnStUpd.compareAndSet(pConn, CONNECTION_IDLE, CONNECTION_USING)) {\r\n if (testOnBorrow(pConn)) return createProxyConnection(pConn, borrower);\r\n\r\n borrower.lastUsedConn = null;\r\n }\r\n } else {\r\n borrower = new Borrower();\r\n threadLocal.set(new WeakReference<Borrower>(borrower));\r\n }\r\n\r\n\r\n final long deadlineNanos = nanoTime() + defaultMaxWaitNanos;\r\n try {\r\n if (!borrowSemaphore.tryAcquire(this.defaultMaxWaitNanos, NANOSECONDS))\r\n throw RequestTimeoutException;\r\n } catch (InterruptedException e) {\r\n throw RequestInterruptException;\r\n }\r\n\r\n try {//borrowSemaphore acquired\r\n //1:try to search one from array\r\n PooledConnection pConn;\r\n PooledConnection[] tempArray = connArray;\r\n for (int i = 0, l = tempArray.length; i < l; i++) {\r\n pConn = tempArray[i];\r\n if (pConn.state == CONNECTION_IDLE && ConnStUpd.compareAndSet(pConn, CONNECTION_IDLE, CONNECTION_USING) && testOnBorrow(pConn))\r\n return createProxyConnection(pConn, borrower);\r\n }\r\n\r\n //2:try to create one directly\r\n if (connArray.length < poolMaxSize && (pConn = createPooledConn(CONNECTION_USING)) != null)\r\n return createProxyConnection(pConn, borrower);\r\n\r\n //3:try to get one transferred connection\r\n boolean failed = false;\r\n SQLException failedCause = null;\r\n Thread cThread = borrower.thread;\r\n borrower.state = BORROWER_NORMAL;\r\n waitQueue.offer(borrower);\r\n int spinSize = (waitQueue.peek() == borrower) ? maxTimedSpins : 0;\r\n\r\n do {\r\n Object state = borrower.state;\r\n if (state instanceof PooledConnection) {\r\n pConn = (PooledConnection) state;\r\n if (transferPolicy.tryCatch(pConn) && testOnBorrow(pConn)) {\r\n waitQueue.remove(borrower);\r\n return createProxyConnection(pConn, borrower);\r\n }\r\n } else if (state instanceof SQLException) {\r\n waitQueue.remove(borrower);\r\n throw (SQLException) state;\r\n }\r\n\r\n if (failed) {\r\n if (borrower.state == state)\r\n BwrStUpd.compareAndSet(borrower, state, failedCause);\r\n } else if (state instanceof PooledConnection) {\r\n borrower.state = BORROWER_NORMAL;\r\n yield();\r\n } else {//here:(state == BORROWER_NORMAL)\r\n long timeout = deadlineNanos - nanoTime();\r\n if (timeout > 0L) {\r\n if (spinSize > 0) {\r\n --spinSize;\r\n } else if (borrower.state == BORROWER_NORMAL && timeout > spinForTimeoutThreshold && BwrStUpd.compareAndSet(borrower, BORROWER_NORMAL, BORROWER_WAITING)) {\r\n parkNanos(timeout);\r\n if (cThread.isInterrupted()) {\r\n failed = true;\r\n failedCause = RequestInterruptException;\r\n }\r\n if (borrower.state == BORROWER_WAITING)\r\n BwrStUpd.compareAndSet(borrower, BORROWER_WAITING, failed ? failedCause : BORROWER_NORMAL);//reset to normal\r\n }\r\n } else {//timeout\r\n failed = true;\r\n failedCause = RequestTimeoutException;\r\n if (borrower.state == BORROWER_NORMAL)\r\n BwrStUpd.compareAndSet(borrower, state, failedCause);//set to fail\r\n }\r\n }//end (state == BORROWER_NORMAL)\r\n } while (true);//while\r\n } finally {\r\n borrowSemaphore.release();\r\n }\r\n }",
"public Object getObject(Object parameters) {\n if (objects == null)\n throw new IllegalStateException(\"Tried to use pool before it was Initialized or after it was ShutDown!\");\n\n Object result = factory.isUniqueRequest();\n if (result != null) // If this is identical to a previous request,\n return result; // return the same result. This is the 2.4 total hack to\n // share local connections within a managed tx.\n\n try {\n if (permits.attempt(blockingTimeout)) {\n ObjectRecord rec = null;\n synchronized (objects) {\n for (Iterator it = objects.values().iterator(); it.hasNext();) {\n rec = (ObjectRecord) it.next();\n if (null != rec && !rec.isInUse() && factory.checkValidObject(rec.getObject(), parameters)) {\n log.info(\"Handing out from pool object: \" + rec.getObject());\n try {\n rec.setInUse(true);\n } catch (ConcurrentModificationException e) {\n log.info(\"Conflict trying to set rec. in use flag:\" + rec.getObject());\n // That's OK, just go on and try another object\n continue;//shouldn't happen now.\n }\n break;\n }\n rec = null;//not found\n }\n }//synch on objects\n\n if (rec == null) {\n try {\n rec = createNewObject(parameters);\n } catch (Exception e) {\n log.error(\"Exception in creating new object for pool\", e);\n permits.release();\n throw e;\n }\n } // end of if ()\n if (rec == null) {\n permits.release();\n String message = \"Pool is broken, did not find or create an object\";\n log.error(message);\n throw new RuntimeException(message);\n } // end of if ()\n Object ob = rec.getObject();\n\n result = factory.prepareObject(ob);\n if (result != ob) rec.setClientObject(result);\n if (result instanceof PooledObject)\n ((PooledObject) result).addPoolEventListener(this);\n\n log.debug(\"Pool \" + this + \" gave out object: \" + result);\n return result;\n }//end of permits\n else {\n //we timed out\n throw new RuntimeException(\"No ManagedConnections Available!\");\n } // end of else\n }//try\n catch (RuntimeException e) {\n throw e;\n } // end of catch\n catch (InterruptedException ie) {\n log.info(\"Interrupted while requesting permit!\", new Exception(\"stacktrace\"));\n throw new RuntimeException(\"Interrupted while requesting permit!\");\n } // end of try-catch\n catch (Exception e) {\n log.info(\"problem getting connection from pool\", e);\n throw new RuntimeException(\"problem getting connection from pool \" + e.getMessage());\n } // end of catch\n }",
"public interface PoolFactory<T> {\n\t\n\t/**\n\t * Creates the.\n\t *\n\t * @return the t\n\t */\n\tpublic T create();\n}",
"MaximaProcess getProcess() {\r\n \t\trequestTimeHistory.add(System.currentTimeMillis());\r\n \r\n \t\t// Start a new one as we are going to take one...\r\n \t\tif (startupThrotle.availablePermits() > 0) {\r\n \t\t\tstartProcess();\r\n \t\t}\r\n \r\n \t\tMaximaProcess mp = null;\r\n \t\twhile (mp == null) {\r\n \t\t\ttry {\r\n \t\t\t\tmp = pool.take();\r\n \t\t\t} catch (InterruptedException e) {\r\n \t\t\t\t// If we failed to get one, wait a bit.\r\n \t\t\t\te.printStackTrace();\r\n \t\t\t\ttry {\r\n \t\t\t\t\tThread.sleep(3);\r\n \t\t\t\t} catch (InterruptedException ee) {\r\n \t\t\t\t\tee.printStackTrace();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\tusedPool.add(mp);\r\n \t\tmp.activate();\r\n \r\n \t\treturn mp;\r\n \t}",
"public Task getTask(final int id) {\n return tasks.get(id);\n }",
"public final T getResult() {\n try {\n try {\n ForkJoinPool.managedBlock(this);\n } catch (InterruptedException e) {\n }\n return self();\n }catch(Throwable t){\n throw new RuntimeException(t);\n }\n }",
"private DispatchTask next()\n {\n synchronized (m_lock)\n {\n while (null == m_runnable)\n {\n if (m_released)\n {\n return null;\n }\n\n try\n {\n m_lock.wait();\n } catch (InterruptedException e)\n {\n // Not needed\n }\n }\n\n return m_runnable;\n }\n }",
"Task createTask();",
"Task createTask();",
"Task createTask();",
"public <T> RunnableFuture<T> newTaskFor(Callable<T> callable) {\n return new PriorityFutureTask(callable);\n }",
"private Runnable pollSubmission() {\n StealingPool p = pool;\n while (p.hasQueuedSubmissions()) {\n Runnable t;\n if (tryActivate() && (t = p.pollSubmission()) != null)\n return t;\n }\n return null;\n }",
"public Task getTask(String stateName) throws ProcessManagerException {\r\n Task[] tasks = getTasks();\r\n for (int i = 0; i < tasks.length; i++) {\r\n if (tasks[i].getState().getName().equals(stateName)) {\r\n return tasks[i];\r\n }\r\n }\r\n return null;\r\n }",
"public Optional<PickingRequest> getTask() {\n return Optional.ofNullable(task);\n }",
"private CollectTaskPool() {\n\t\tsuper();\n\t}",
"Read createRead();",
"public ThreadPool getDefaultThreadPool();",
"static Pool newConstantPool() {\n return new ConstantPool();\n }",
"@Override\n public Block getBlock() {\n Block b = null;\n while (b == null) {\n boolean noMoreBlocks = blocks.isEmpty();\n if (!noMoreBlocks) {\n b = blocks.poll();\n }\n\n if (noMoreBlocks || b == null) {\n synchronized (BlocksPool.class) { // can be easily changed to lock-free\n if (blocks.isEmpty()) {\n alloc(newAllocBlocks);\n }\n }\n }\n }\n return b;\n }",
"public ConstantPoolReader() {\n }",
"private Object getTask(Runnable runnable)\r\n {\r\n Object innerTask = \r\n ObservableExecutors.getInnerTask(runnable, Object.class);\r\n if (innerTask != null)\r\n {\r\n return innerTask;\r\n }\r\n return runnable;\r\n }",
"ITaskFactory<?> load(String classname);",
"public SingleWorkerPoolExecutor() {\n this.worker = new Worker(taskQueue);\n\n // Nothing bad as worker is blocked by an emptiness of a task\n // queue. Adding to this task queue will be possible after worker pool\n // finishes construction\n worker.start();\n }",
"DispatchTask getTask()\n {\n synchronized (m_lock)\n {\n return m_runnable;\n }\n }"
] | [
"0.6645658",
"0.62344146",
"0.6154605",
"0.605004",
"0.58158475",
"0.57937217",
"0.57233495",
"0.5554303",
"0.5501885",
"0.5471133",
"0.54028004",
"0.53871405",
"0.5375825",
"0.535926",
"0.5332259",
"0.53267694",
"0.5324198",
"0.52967274",
"0.5286907",
"0.52568156",
"0.51773965",
"0.51739836",
"0.51651996",
"0.5162733",
"0.51622427",
"0.5156646",
"0.5156419",
"0.5131388",
"0.51265645",
"0.51157105",
"0.5100516",
"0.508561",
"0.50834674",
"0.50827456",
"0.50758874",
"0.50744903",
"0.50730807",
"0.5069417",
"0.5053027",
"0.504102",
"0.50343484",
"0.50084984",
"0.50006795",
"0.5000281",
"0.49921304",
"0.49863234",
"0.49670255",
"0.4953424",
"0.49477154",
"0.49445617",
"0.49231294",
"0.49123728",
"0.48990947",
"0.48857698",
"0.48803246",
"0.48434952",
"0.48378387",
"0.4831504",
"0.48174047",
"0.48101398",
"0.4788016",
"0.47872376",
"0.4781555",
"0.47810218",
"0.47804803",
"0.47796157",
"0.47685385",
"0.47635138",
"0.47557503",
"0.4747048",
"0.4746382",
"0.4732994",
"0.47328508",
"0.4728645",
"0.47247052",
"0.47177672",
"0.47086662",
"0.47075135",
"0.4693293",
"0.46586412",
"0.46554062",
"0.46533227",
"0.4649987",
"0.46464285",
"0.46464285",
"0.46464285",
"0.46355438",
"0.46352714",
"0.46282747",
"0.46274826",
"0.4618493",
"0.46108836",
"0.46033788",
"0.46009722",
"0.459854",
"0.45844167",
"0.45783317",
"0.4574129",
"0.45738643",
"0.4571044"
] | 0.7025225 | 0 |
Handle a blocking operation on the socket. | private void handleConnection(Socket socket) throws IOException{
if (isMonitoringEnabled()) {
getGlobalRequestProcessor().increaseCountOpenConnections();
getPipelineStat().incrementTotalAcceptCount();
}
getReadBlockingTask(socket).execute();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Socket call() throws InterruptedException;",
"void flushBlocking();",
"public abstract void handle(Socket socket);",
"public void blockingReceiveSenderSide() throws OOBException {\n \t}",
"@Override\r\n public void run() {\r\n byte[] buffer = new byte[1024];\r\n int bytes;\r\n int times = 0;\r\n\r\n while (!mStopped) {\r\n try {\r\n if (times == 0) {\r\n try {\r\n \t// Sometimes lag occurs. Therefore, from time to time\r\n \t// we just ignore a large chunk of data from input stream\r\n \t// in order to synchronize the communication.\r\n mInputStream.skip(1024000);\r\n } catch (Exception e) {}\r\n times = LAG_CUT_TIMEOUT;\r\n }\r\n times--;\r\n\r\n // Read from socket and send to the handler\r\n bytes = mInputStream.read(buffer);\r\n mReceiveHandler.receiveData(buffer, bytes);\r\n\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error receiving from the socket: \" + ioe.getMessage());\r\n mPeer.communicationErrorOccured();\r\n break;\r\n }\r\n }\r\n }",
"int readNonBlocking(byte[] buffer, int offset, int length);",
"public abstract boolean receive(byte[] buffer, int size, int timeout) throws InterruptedIOException;",
"public void run() {\n\t\tbyte[] out;\n\t\tshort[] in = new short[0];\n\t\tint read;\n\t\tint consumed;\n\t\t\n\t\ttry {\n\t\t\tconnect();\n\t\t\tin = new short[sock.getReceiveBufferSize()];\n\t\t} catch (Exception ex) {\n\t\t\t// TODO: Fire event to the model, so we can display something that lets the user know what happened.\n\t\t\tex.printStackTrace();\n\t\t\tdisconnect();\n\t\t}\n\t\t\n \t\twhile (sock != null && !sock.isClosed()) {\n\t\t\ttry {\n\t\t\t\tconsumed = 0;\n\t\t\t\t\n\t\t\t\t// Read up to in.length before we're invalid...\n\t\t\t\tinStream.mark(in.length);\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tread = inStream.read(in);\n\t\t\t\t} catch (IOException ioe) {\n\t\t\t\t\tread = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Truncate the read buffer, and process it.\n\t\t\t\tif (read > 0) {\n\t\t\t\t\tshort[] truncIn = new short[read];\n\t\t\t\t\tSystem.arraycopy(in, 0, truncIn, 0, read);\n\t\t\t\t\t\n\t\t\t\t\tconsumed = consumeIncoming(truncIn);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// reset the mark, and then consume the bytes we've \n\t\t\t\t// processed.\n\t\t\t\tinStream.reset();\n\t\t\t\tif (consumed > 0) {\n\t\t\t\t\tinStream.skip(consumed);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// Do I have data to write?\n\t\t\t\tout = outgoingBytes();\n\t\t\t\tif (out.length > 0) {\n\t\t\t\t\tsock.getOutputStream().write(out);\n\t\t\t\t\tsock.getOutputStream().flush();\n\t\t\t\t}\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t\tSystem.err.println(ex.toString());\n\t\t\t}\n\t\t\t// Play nice with thread schedulers.\n\t\t\tThread.yield();\n\t\t}\n\t}",
"private TimerTask socketListener()\r\n\t{\r\n\t\tString theMessage;\r\n\t\tif (theSocket != null)\r\n\t\t{\r\n\t\t\tif (theSocket.isReady())\r\n\t\t\t{\r\n\t\t\t\t// blocks execution\r\n\t\t\t\t// get theMessage\r\n\t\t\t\ttheMessage = theSocket.getMessage();\r\n\t\t\t\tif (theMessage == null)\r\n\t\t\t\t{\r\n\t\t\t\t\twriteLine(\"Our connection has ended!\", 0);\r\n\t\t\t\t\trunning = false;\r\n\t\t\t\t\t// if the message = null\r\n\t\t\t\t\t// the we need to check the socket again\r\n\t\t\t\t\t// just in case\r\n\t\t\t\t\t// close it nicely if we can\r\n\t\t\t\t\tif (theSocket != null)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\ttheSocket.close();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// otherwise just set it to null\r\n\t\t\t\t\t// set it to null regardless\r\n\t\t\t\t\ttheSocket = null;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// if the socket is OK\r\n\t\t\t\t\t// and the socket isReady\r\n\t\t\t\t\t// then display the input\r\n\t\t\t\t\twriteLine(theMessage, 2);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} // end if theSocket !=null\r\n\t\treturn null;\r\n\t}",
"private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }",
"public void run() {\n\t\ttry {\n\t\t\tServerSocket listenSocket = new ServerSocket(port);\n\t\t\twhile (true) {\n\t\t\t\tSocket socket = listenSocket.accept();\n\t\t\t\t\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t\toutput.flush();\n\t\t\t\tObjectInputStream input = new ObjectInputStream(socket.getInputStream());\n\t\t\t\t\n\t\t\t\tFSMessage message = FSMessage.readMessage(input);\n\t\t\t\t\n\t\t\t\tif (message.getType() == FSMessage.MESSAGE_SPREAD_REQ) {\n\t\t\t\t\t// Namenode wants to send a block to datanode.\n\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_SPREAD_REQ_ACK);\n\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\t\n\t\t\t\t\t// Open a new thread to receive the block.\n\t\t\t\t\tnew Thread(new BlockReceiver(socket.getInputStream(), message.getBlockID(), message.getLength(), message.getOffset())).start();\n\t\t\t\t} else if (message.getType() == FSMessage.MESSAGE_GETBLOCK_REQ) {\n\t\t\t\t\t// Clients wants to get a block with certain block ID.\n\t\t\t\t\tif (!blockMap.containsKey(message.getBlockID())) {\n\t\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_GETBLOCK_FAIL);\n\t\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t// Open a new thread to send the block.\n\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_GETBLOCK_REQ_ACK);\n\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\tnew Thread(new BlockSender(socket.getOutputStream(), message.getBlockID())).start();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"@Override\n public void run() {\n if (isV6())\n while (!interrupted()) {\n try {\n handleMessage(serverSocket.accept());\n } catch (SocketTimeoutException ignore) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n try {\n serverSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\n protected void handleConnection(final Socket sock) throws IOException {\n sock.setSoTimeout(1);\n sock.getInputStream().read();\n\n stopAcceptingConnections();\n }",
"@Override\n public void handle(NIOConnection conn, byte[] data) {\n this.data = data;\n countDownLatch.countDown();\n }",
"public void serve() throws IOException {\n int req = 0;\n while (req<maxreq) {\n //block intil a client connects\n final Socket socket = serversocket.accept();\n //create a new thread to handle the client\n\n Thread handler = new Thread(new Runnable() {\n public void run() {\n try {\n try {\n handle(socket);\n } finally {\n socket.close();\n }\n } catch (IOException ioe) {\n // this exception wouldn't terminate serve(),\n // since we're now on a different thread, but\n // we still need to handle it\n ioe.printStackTrace();\n }\n }\n });\n // start the thread\n handler.start();\n req++;\n }\n\n }",
"@Override\n\tpublic void run() {\n\t\tdispBlocks();\n\t\tsendData();\n\t}",
"public void run() {\n if (!connectFuture.isDone()) {\n connectFuture.cancel(true);\n return;\n }\n try {\n // send a message to the server\n ByteBuffer message = ByteBuffer.wrap(\"ping\".getBytes());\n // wait for the response\n System.out.println(\"Sending message to the server...\");\n int numberBytes = client.write(message).get();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (ExecutionException e) {\n e.printStackTrace();\n }\n }",
"public void run() {\n\t\tThread t = Thread.currentThread();\n\t\twhile (!t.isInterrupted()) {\n\t\t\ttry {\n\t\t\t\t//boolean status = process();\n\t\t\t\tMessage message = receive();\n\t\t\t\tif (t.isInterrupted())\n\t\t\t\t\treturn;\n\t\t\t\t//if (!status)\n\t\t\t\t//\treturn;\n\t\t\t\tif (socket == null)\n\t\t\t\t\treturn;\n\t\t\t\tThread.yield();\n\t\t\t} catch (Exception e) {\n\t\t\t\t//_monitor.log(e);\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Override\n protected void handleConnection(final Socket sock) throws IOException {\n sock.getInputStream().read();\n\n stopAcceptingConnections();\n }",
"@Override\n public void flush() throws IOException {\n FileDescriptor myFd = fd;\n if (myFd == null) throw new IOException(\"socket closed\");\n\n // Loop until the output buffer is empty.\n Int32Ref pending = new Int32Ref(0);\n while (true) {\n try {\n // See linux/net/unix/af_unix.c\n Os.ioctlInt(myFd, OsConstants.TIOCOUTQ, pending);\n } catch (ErrnoException e) {\n throw e.rethrowAsIOException();\n }\n\n if (pending.value <= 0) {\n // The output buffer is empty.\n break;\n }\n\n try {\n Thread.sleep(10);\n } catch (InterruptedException ie) {\n break;\n }\n }\n }",
"private native int waitUntilMessageAvailable0(int port, int handle)\n throws IOException;",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\ttry {\r\n\t\t\t\t\tif(socket!=null&&!socket.isClosed()){\r\n\t\t\t\t\t\tbOutputStream.write(sbyte, 0, sbyte.length);\r\n\t\t\t\t\t\tbOutputStream.flush();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}",
"public void run() {\n\t\t\twhile (true) {// 保持连接直到异常发生或套接字返回\n\t\t\t\ttry {\n\t\t\t\t\tif (serverSocket != null) {\n\t\t\t\t\t\tmTempSocket = serverSocket.accept(); // 如果一个连接同意\n\t\t\t\t\t}\n\t\t\t\t\t// If a connection was accepted\n\t\t\t\t\tif (mTempSocket != null) {\n\t\t\t\t\t\t// Do work to manage the connection (in a separate\n\t\t\t\t\t\t// thread)\n\t\t\t\t\t\tmanageConnectedSocket(); // 管理一个已经连接的RFCOMM通道在单独的线程。\n\t\t\t\t\t\tserverSocket.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public Socket awaitMessages(){\n Socket s = null;\n try { \n s = serverSocket.accept();\n\t } catch (IOException e) {\n System.out.println(\"Could not listen on port \" + portNumber);\n }\n return s;\n }",
"protected synchronized void receiveHighLevel() throws Exception{\n\t\treceivedMsg = conn.receiveALine( ); \n//\t\tprintln(\"received \" + receivedMsg);\n\t\twhile( receivedMsg == null ){ //this means that the connection works in raw mode\n\t\t\t//System.out.println(\"ConnInputReceiver waiting ... \" + conn );\n\t\t\tmemo();\n \t\t\twait();\n \t\t\t//System.out.println(\"ConnInputReceiver resuming ... \" + conn );\n\t\t\treceivedMsg = conn.receiveALine( ); \n\t\t}\t\n\t\tunmemo();\t\n\t}",
"public void acceptedSocket(long socketId) {}",
"public abstract void handleCurrentConnection(Socket socket) throws IOException;",
"protected int waitUntilMessageAvailable00(int handle) \n throws IOException {\n return waitUntilMessageAvailable0(m_iport, handle);\n }",
"protected abstract void processConnection(Socket socket);",
"private static void completedReceive(long handle, long byteCount) {\n Log.w(LogDomain.NETWORK, \"C4Socket.completedReceive() handle -> \" + handle);\n }",
"@Override\n public void completed(Integer result, AsynchronousSocketChannel channel ) {\n }",
"@Override\n public void run() {\n handleClientRequest();\n }",
"public void run() {\n try {\n DataInputStream in = new DataInputStream(new BufferedInputStream(s.getInputStream()));\n try {\n byte op = (byte) in.read();\n if (op == OP_WRITE_BLOCK) {\n writeBlock(in);\n } else if (op == OP_READ_BLOCK || op == OP_READSKIP_BLOCK ||\n op == OP_READ_RANGE_BLOCK) {\n readBlock(in, op);\n } else {\n while (op >= 0) {\n System.out.println(\"Faulty op: \" + op);\n op = (byte) in.read();\n }\n throw new IOException(\"Unknown opcode for incoming data stream\");\n }\n } finally {\n in.close();\n }\n } catch (IOException ie) {\n LOG.warn(\"DataXCeiver\", ie);\n } finally {\n try {\n xceiverCount.decr();\n LOG.debug(\"Number of active connections is: \"+xceiverCount);\n s.close();\n } catch (IOException ie2) {\n }\n }\n }",
"@Override\r\n\tpublic void run() {\n\t\tbyte[] buffer = new byte[YapttaConstants.Network.DEFAULT_PACKET_BUFFER_SIZE];\r\n\t\tDatagramPacket packet = new DatagramPacket(buffer, buffer.length);\r\n\t\t\r\n\t\t// Loop until we're disconnected/stopped/etc\r\n\t\twhile(!haltRequested && socket != null && socket.isBound() && !socket.isClosed())\r\n\t\t{\r\n\t\t\ttry {\r\n\t\t\t\t// Block the socket until data is received\r\n\t\t\t\tsocket.receive(packet);\r\n\t\t\t\t\r\n\t\t\t\t// Deserialize the data\r\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(packet.getData(), 0, packet.getLength());\r\n\t\t\t\tObjectInputStream ois = new ObjectInputStream(bais);\r\n\t\t\t\tAbstractMessage am = (AbstractMessage) ois.readObject();\r\n\t\t\t\t\r\n\t\t\t\t// Save who the sender was\r\n\t\t\t\tam.setSender(packet.getAddress());\r\n\t\t\t\t\r\n\t\t\t\t// Call the data received handler as appropriate\r\n\t\t\t\tif(callback != null) callback.messageReceived(am);\r\n\t\t\t\t\r\n\t\t\t\t// Clean-up\r\n\t\t\t\tois.close();\r\n\t\t\t\tbais.close();\r\n\t\t\t\t\r\n\t\t\t\t// ... then do it again!\r\n\t\t\t\t\r\n\t\t\t} catch (SocketTimeoutException e) {\r\n\t\t\t\t// just try to roll with the error (but at least log it)... it's likely due to\r\n\t\t\t\t// disconnection and will end the thread when it checks the condition of the loop\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\t// if something other than timeout occurred, give more info\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public synchronized void bufferMessage() throws Exception\r\n {\r\n\r\n System.out.println(\"BUFFER: Message from future round received. Buffering message.\");\r\n // Wait until node moves to next round.\r\n wait();\r\n\r\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\twhile (socket != null && !socket.isClosed()) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tbInputStream.read(rbyte);\r\n\t\t\t\t\t\tMessage msg = new Message();\r\n\t\t\t\t\t\tmsg.what = 1;\r\n\t\t\t\t\t\tmsg.obj = rbyte;\r\n\t\t\t\t\t\treHandler.sendMessage(msg);\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t}",
"public void run() {\n try {\n while (!socket.isClosed()) {\n Message message = socket.receiveMessage();\n if (message != null) {\n logger.info(\"Received: \" + message);\n socket.sendMessage(message);\n logger.info(\"Sent: \" + message);\n } else {\n // Close socket if no messages were received.\n // NOTE: This is a simplifying assumption that no messages means the client has been shutdown\n // and the application lifecyle has come to an end. Otherwise a shutdown message should be\n // detected and handled accordingly.\n socket.close();\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n executorService.shutdown();\n }",
"@DISPID(2) //= 0x2. The runtime will prefer the VTID if present\r\n @VTID(8)\r\n int nonBlockingIO();",
"private void receive() throws IOException {\n byte[] lengthBuffer = new byte[4];\n dataInput.readFully(lengthBuffer);\n int length = Utilities.getIntFromByte(lengthBuffer, 0);\n pipedOutputStream.write(Utilities.getBytes(length));\n\n //now read the data indicated by length and write it to buffer\n byte[] buffer = new byte[length];\n dataInput.readFully(buffer);\n pipedOutputStream.write(buffer);\n pipedOutputStream.flush();\n clientBlocker();\n }",
"private void handleBlockOk(BlockOk ok) throws AppiaEventException {\n \t\t//Get the necessary arguments\n \t\tList<VsClient> allMyClients = VsClientManagement.getClientstAttachedTo(listenAddress);\n \n \t\t//Enter flush mode\n \t\tflushMode = true;\n \t\tSystem.out.println(\"Received a BlockOk ( a normal one )\");\n \n \t\t//Lock clientsViewManagement here with a lock\n \t\tacquireClientsViewUpdateLock(); //So no new clients/servers can join the group\n \n \t\t//Clean the update controls I have received\n \t\tUpdateManager.cleanUpdateViews();\n \n \t\t//Send to all client in all groups a blockOk request\n \t\t//I ask if I have some client in that group\n \n \t\t//If I have at least one client to shut\n \t\tif(allMyClients.size() >= 1){\n \t\t\t//I will store the block ok event\n \t\t\tpendingBlockOk = ok;\n \t\t\tSystem.out.println(\"I have a pending blockOk to send. Wait for client to shut upo\");\n \n \t\t\t//And for each client, i'll ask them to shut up\n \t\t\tfor (VsClient client : allMyClients){\n \t\t\t\tVsGroup group = VsClientManagement.getVsGroup(client.getGroup().id);\n \t\t\t\tShutUpStubEvent shutUpEvent = new ShutUpStubEvent(client.getGroup().id);\n \t\t\t\tsendStubEvent(shutUpEvent, group);\n \t\t\t}\n \t\t}\n \n \t\t//If I have no clients to warn\n \t\telse{\n \t\t\t//I may send right way the block OK\n \t\t\tok.go();\n \t\t\tSystem.out.println(\"I have no clients, sending blockOk\");\n \t\t}\n \t}",
"private void blockingRead(InputStream istream, byte[] buf, int requestedBytes) throws\n IOException {\n int offset = 0;\n while (offset < requestedBytes) {\n int read = istream.read(buf, offset, requestedBytes - offset);\n\n if (read < 0) {\n throw new IOException(\"Connection interrupted\");\n }\n\n offset += read;\n }\n }",
"@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tInputStream inputStream = mSocket.getInputStream();\n\t\t\tint leng;\n\t\t\tbyte[] buffer = new byte[1024];\n\t\t\tByteArrayBuffer[] data = {new ByteArrayBuffer(1024 * 32)};\n\t\t\twhile((leng = inputStream.read(buffer)) != -1 && mConected)\n\t\t\t{\n\t\t\t\tif(mConected)\n\t\t\t\t{\n\t\t\t\t\tdata[0].append(buffer, data[0].length(), leng);\n\t\t\t\t\tprocessMessage(data);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.e(TAG, \"Cannot set InputStream\\nNetwork error\");\n\t\t\tevent.connectionLost();\n\t\t} catch (ProtocolException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tevent.connectionLost();\n\t\t}\n\t}",
"final public void run() {\n connectionEstablished();\n\n // The message from the server\n int msg;\n\n // Loop waiting for data\n\n try {\n // messageTimer.schedule(new TimerTask() {\n // @Override\n // public void run() {\n // try {\n // sendFromMessageQueue();\n // } catch (IOException e) {}\n // }\n // }, 0, 100);\n while (!readyToStop) {\n // Get data from Server and send it to the handler\n // The thread waits indefinitely at the following\n // statement until something is received from the server\n\n try { // added in version 2.31\n\n // String cur = input.readLine();\n // handleBig5String(cur + \"\\n\");\n readByte();\n\n } catch (RuntimeException ex) { // thrown by handleMessageFromServer\n\n connectionException(ex);\n }\n }\n } catch (Exception exception) {\n if (!readyToStop) {\n try {\n closeAll();\n } catch (Exception ex) {\n }\n\n clientReader = null;\n connectionException(exception);\n }\n } finally {\n\n clientReader = null;\n connectionClosed(); // moved here in version 2.31\n }\n }",
"private void doRead() throws IOException {\n\t\t\tvar res = sc.read(bb);\n\n\t\t\tif ( res == -1 ) {\n\t\t\t\tlogger.info(\"Connection closed with the client.\");\n\t\t\t\tclosed = true;\n\t\t\t}\n\n\t\t\tupdateInterestOps();\n\t\t}",
"private void run() throws InterruptedException, IOException {\n endpoint.getWcEvents().take();\n\n //process received data\n processRecv();\n\n for (int i=0; i < 1000000; i++) {\n //change data in remote memory\n writeData(i);\n\n //wait for writing remote memory to complete\n endpoint.getWcEvents().take();\n }\n System.out.println(\"ClientWrite::finished!\");\n }",
"public void run() {\n\t\t\twhile (running || !messages_to_send.isEmpty()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tsend();\r\n\t\t\t\t\tread();\r\n\t\t\t\t\tThread.sleep(100);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tbluetooth_show_message(\"Error! Sending or Reading failed. Reason: \" + e);\r\n\t\t\t\t\tcancel();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch(IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}",
"public void run(){\r\n DataInputStream dis = null;\r\n try{\r\n dis = new DataInputStream(socket.getInputStream());\r\n while(true){\r\n String command = dis.readUTF();\r\n if(command.startsWith(\"/\")){\r\n if(command.length() > 1) listener.receivedCommand(this, command.substring(1));\r\n }\r\n else{\r\n int size = dis.readInt();\r\n if(size > limit){\r\n cleanup(false);\r\n break;\r\n }\r\n byte[] buffer = new byte[size];\r\n dis.readFully(buffer, 0, size);\r\n listener.receivedFile(this, command, buffer);\r\n }\r\n }\r\n }\r\n catch(SocketException e){ e.printStackTrace(); }\r\n catch(EOFException e){ e.printStackTrace(); }\r\n catch(IOException ioe){ ioe.printStackTrace(); }\r\n finally{ cleanup(); }\r\n \r\n if(dis != null){\r\n try{ dis.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dis = null;\r\n }\r\n }",
"protected void safeRun() throws Exception\n\t{\n\t\t//Note that continuous handling has begun.\n\t\tsynchronized (this) { this.running = true; }\n\t\t\n\t\t//Acquire listening socket.\n\t\tServerSocket ss = new ServerSocket(this.listeningAddress().getPort(), 10, this.listeningAddress().getAddress());\n\t\t\n\t\t//While this thread has permission to run...\n\t\t//(this.running)\n\t\t//Call terminate() to revoke permission and halt.\n\t\twhile (this.isRunning())\n\t\t{\n\t\t\t//Listen on the socket...\n\t\t\tSocket s = ss.accept();\n\t\t\t\n\t\t\t//Prepare an array of bytes into which\n\t\t\t//\tto load the incoming packet.\n\t\t\tbyte[] b = new byte[512];\n\t\t\t\n\t\t\t//Read the incoming packet into byte[] b.\n\t\t\t//Store b.length as int r.\n\t\t\tint r = s.getInputStream().read(b);\n\t\t\t\n\t\t\t// [scaffold]\n\t\t\t//System.out.println(b[0] + \" \" + b[1] + \" \" + b[2] + \" \" + b[3]);\n\t\t\t\n\t\t\t//If the packet was actually read (it has\n\t\t\t//\tlength), handle it.\n\t\t\tif (r > 0)\n\t\t\t\tthis.handle(s, b, r);\n\t\t}\n\t\t\n\t\t//Upon revocation of listening permission (signified\n\t\t//\tby boolean this.running = false) close the listening\n\t\t//\tport and conclude execution.\n\t\tss.close();\n\t}",
"protected abstract void receive() throws IOException;",
"@Override\n public void run() {\n try {\n boolean busy = true;\n while (busy) {\n AbstractBasicMessage msg = readMsg();\n if (msg != null) {\n busy = msg.operate(this.persistor, this.pushServer);\n }\n }\n } catch (IOException e) {\n // Treat an IOException as a termination of the message\n // exchange, and let this message-processing thread die.\n\n // CODE VON DOZENTEN...\n } catch (OperationNotSupportedException ex) {\n System.out.println(\"Error while reading incoming message\");\n ex.printStackTrace();\n }\n }",
"private static void server() throws IOException {\n\t\tServerSocket serverSocket = new ServerSocket(10999);\n\t\t//listener, waiting connection\n\t\tSocket socket = serverSocket.accept();//block\n\t\t//input --> receive / output --> send\n\t\tInputStream inputStream = socket.getInputStream();\n\t\tOutputStream outputStream = socket.getOutputStream();\n\t\t//byte array (stream)\n\t\tbyte[] b = new byte[1024];\n\t\t//read/receive\n\t\tinputStream.read(b);\n\t\t//\n\t\tString resp = client(b);\n\t\t//\n\t\toutputStream.write(resp.getBytes());\n\t\t//closing\n\t\tsocket.close();\n\t\t//close server\n\t\tserverSocket.close();\n\t}",
"@Override\n public void run() {\n try {\n\n byte[] data = new byte[TcpClient.BUFFER_SIZE * 2];\n\n while(!Rebroadcaster.INSTANCE.isHalted()) {\n int len = is.read(data, 0, data.length);\n os.write(data, 0, len);\n os.flush();\n }\n } catch (IOException ex) {\n LOGGER.log(Level.SEVERE, null, ex);\n }\n }",
"public synchronized void block() {\n\t\tsetBlocked(true);\n\t}",
"protected boolean runProtocol()\n throws IOException\n {\n SSLEngine engine = f_engine;\n ByteBuffer[] aBuffEmpty = s_aBuffEmpty;\n final Object oRead = f_aBuffSingleInbound;\n final Object oWrite = f_aBuffSingleOutbound;\n\n while (true)\n {\n switch (engine.getHandshakeStatus())\n {\n case NEED_TASK:\n m_fHandshaking = true;\n final Runnable runnable = engine.getDelegatedTask();\n if (runnable == null)\n {\n synchronized (oWrite)\n {\n if (m_cJobsPending > 0)\n {\n // we are waiting on jobs to finish, ignore\n // the socket state until the job(s) complete\n boolean fWrite = f_buffEncOut.hasRemaining();\n delayProtocol(\n /*nInterest*/ fWrite ? SelectionKey.OP_WRITE : 0,\n /*nExclude*/ fWrite ? 0 : SelectionKey.OP_WRITE,\n /*nReady*/ SelectionKey.OP_READ | SelectionKey.OP_WRITE);\n }\n }\n return true;\n }\n else\n {\n Runnable task = new Runnable()\n {\n public void run()\n {\n try\n {\n runnable.run();\n }\n finally\n {\n synchronized (oWrite)\n {\n --m_cJobsPending;\n continueProtocol();\n }\n }\n }\n };\n\n synchronized (oWrite)\n {\n ++m_cJobsPending;\n }\n\n try\n {\n getSocketProvider().getDependencies().getExecutor()\n .execute(task);\n task = null;\n }\n catch (RejectedExecutionException e) {}\n finally\n {\n if (task != null)\n {\n task.run();\n }\n }\n }\n break;\n\n case NEED_WRAP:\n m_fHandshaking = true;\n synchronized (oWrite)\n {\n int cbEncrypted = encrypt(aBuffEmpty, 0, 0);\n int cbWritten = writeEncrypted();\n // COH-18648:\n // Check to see if we encrypted or wrote anything. We care\n // about this case as in TLS 1.3, half-closes are supported which means\n // the inbound channel can be closed, we can, however, still technically write.\n // If we didn't encrypt or write anything, then treat this situation\n // the same as if there was still encrypted data. If the engine signals\n // that it still needs to wrap, then return to release any locks and allow\n // the channel state to stabilize.\n //\n if (f_buffEncOut.hasRemaining() ||\n /* see comment COH-18648 */ (cbEncrypted == 0 && cbWritten == 0))\n {\n delayProtocol(\n /*nInterest*/ SelectionKey.OP_WRITE,\n /*nExclude*/ 0,\n /*nReady*/ SelectionKey.OP_READ);\n\n if (engine.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NEED_WRAP)\n {\n return true;\n }\n // else; all engine data encrypted but still not written; continue with next phase in \"parallel\"\n }\n }\n break;\n\n case NEED_UNWRAP:\n m_fHandshaking = true;\n\n int cbRead;\n int cbFill;\n synchronized (oRead)\n {\n synchronized (oWrite)\n {\n cbRead = readEncrypted();\n cbFill = fillClearBuffer();\n\n if (cbRead == 0 && cbFill == 0)\n {\n boolean fWrite = f_buffEncOut.hasRemaining();\n delayProtocol(\n /*nInterest*/ SelectionKey.OP_READ | (fWrite ? SelectionKey.OP_WRITE : 0),\n /*nExclude*/ fWrite ? 0 : SelectionKey.OP_WRITE,\n /*nReady*/ SelectionKey.OP_WRITE);\n return true;\n }\n else\n {\n if (f_buffClearIn.hasRemaining() || f_buffEncIn.hasRemaining())\n {\n // COH-21678 - there is more data available for read\n markKeysReadable(true);\n }\n }\n }\n }\n\n if (cbRead == -1)\n {\n // must occur outside of synchronization\n onEndOfStream();\n return false;\n }\n break;\n\n case NOT_HANDSHAKING:\n case FINISHED:\n if (m_fHandshaking) // optimistic read\n {\n synchronized (oWrite)\n {\n endProtocol();\n m_fHandshaking = false;\n }\n }\n return true;\n }\n }\n }",
"@Override\n public void completed(IoFuture<AsynchronousSocketChannel, Void> result)\n {\n try {\n try {\n AsynchronousSocketChannel newChannel = result.getNow();\n logger.log(Level.FINER, \"Accepted {0}\", newChannel);\n \n handler.newConnection(newChannel, descriptor);\n \n // Resume accepting connections\n acceptFuture = acceptor.accept(this);\n \n } catch (ExecutionException e) {\n throw (e.getCause() == null) ? e : e.getCause();\n }\n } catch (CancellationException e) { \n logger.logThrow(Level.FINE, e, \"acceptor cancelled\"); \n //ignore\n } catch (Throwable e) {\n SocketAddress addr = null;\n try {\n addr = acceptor.getLocalAddress();\n } catch (IOException ioe) {\n // ignore\n }\n logger.logThrow(\n \t\t Level.SEVERE, e, \"acceptor error on {0}\", addr);\n \n // TBD: take other actions, such as restarting acceptor?\n }\n \t}",
"default int readNonBlocking(byte[] buffer) {\n return readNonBlocking(buffer, 0, buffer.length);\n }",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tlong startingtime = System.currentTimeMillis();\n\t\t\t\t\t\t\t\t\t\t\tlong endingtime = startingtime + 3*1000; // 60 seconds * 1000 ms/sec\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\twhile(true)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(cancelsent==1 || System.currentTimeMillis() > endingtime)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(cancelsent!=1){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcancellingThread.interrupt();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecSocket.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"closing\", \"socket closed\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}",
"synchronized SocketState asyncPostProcess() throws IOException {\n if (state == AsyncState.COMPLETE_PENDING) {\n clearNonBlockingListeners();\n updateState(AsyncState.COMPLETING);\n return SocketState.ASYNC_END;\n } else if (state == AsyncState.DISPATCH_PENDING) {\n clearNonBlockingListeners();\n updateState(AsyncState.DISPATCHING);\n return SocketState.ASYNC_END;\n } else if (state == AsyncState.STARTING || state == AsyncState.READ_WRITE_OP) {\n updateState(AsyncState.STARTED);\n return SocketState.LONG;\n } else if (state == AsyncState.MUST_COMPLETE || state == AsyncState.COMPLETING) {\n if (processor.getErrorState().isIoAllowed() && processor.flushBufferedWrite()) {\n return SocketState.LONG;\n }\n asyncCtxt.fireOnComplete();\n updateState(AsyncState.DISPATCHED);\n asyncCtxt.decrementInProgressAsyncCount();\n return SocketState.ASYNC_END;\n } else if (state == AsyncState.MUST_DISPATCH) {\n updateState(AsyncState.DISPATCHING);\n return SocketState.ASYNC_END;\n } else if (state == AsyncState.DISPATCHING) {\n if (processor.getErrorState().isIoAllowed() && processor.flushBufferedWrite()) {\n return SocketState.LONG;\n }\n updateState(AsyncState.DISPATCHED);\n asyncCtxt.decrementInProgressAsyncCount();\n return SocketState.ASYNC_END;\n } else if (state == AsyncState.STARTED) {\n // This can occur if an async listener does a dispatch to an async\n // servlet during onTimeout\n return SocketState.LONG;\n } else {\n throw new IllegalStateException(\n sm.getString(\"asyncStateMachine.invalidAsyncState\", \"asyncPostProcess()\", state));\n }\n }",
"public interface SocketPrepared extends ListeningChannelErrorHandler {\n\n /**\n * Called after pre-read determines the channel is of sync and the channel\n * is configured non-blocking and unregistered from the async executor.\n *\n * @param preReadData the pre-read data\n * @param socket the blocking socket for further operation\n */\n void onPrepared(ByteBuffer preReadData, Socket socket);\n\n}",
"boolean handle(ByteBuf data) throws Exception;",
"boolean handle(ByteBuf data) throws Exception;",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tsuper.run();\n\t\t\t\ttry {\n\t\t\t\t\tinputStream = new DataInputStream(mSocket.getInputStream());// 2.23此处报空。崩\n\t\t\t\t\t// --使能常连接探测\n\t\t\t\t\tmSocket.setKeepAlive(true);\n\t\t\t\t\t// --设置心跳时间\n\t\t\t\t\tmSocket.setSoTimeout(1500);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\twhile (!interrupted()) {\n\t\t\t\t\tint ret = 0;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tret = inputStream.read(recvBuf);\n\t\t\t\t\t\tif (ret > 0 && udpSocket != null) {\n\t\t\t\t\t\t\tDEBUG(\"recvlen:\" + ret);\n\n\t\t\t\t\t\t\t// --将接收到的TCP数据发送给UDP\n\n\t\t\t\t\t\t\tDatagramPacket packet = new DatagramPacket(recvBuf, 0, ret, address, iDstPort);\n\t\t\t\t\t\t\tudpSocket.send(packet);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (SocketTimeoutException e) {// 2.18甘\n\t\t\t\t\t\tDEBUG(\"read timeout!\");\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tDEBUG(\"=== IOException ===\");\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t// --断开链路\n\t\t\t\t\t\tstopTask();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\t\tRecieveSocketOfClient(SocketForClient);\r\n\t\t\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\t\t\t// TODO: handle exception\r\n\t\t\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}",
"void receive(String watcher) throws ProtocolExecutionException;",
"@Override\n public void run() {\n mBluetoothAdapter.cancelDiscovery();\n try {\n // Connect to the remote device through the socket. This call blocks\n // until it succeeds or throws an exception.\n mmSocket.connect();\n } catch (IOException connectException) {\n cancel();\n return;\n }\n\n onSocketObtained(mmSocket);\n }",
"private void sendReceiveRes(){\n\t}",
"protected void mainTask() {\n\ttry {\n\t socket = serverSocket.accept();\t\n\t spawnConnectionThread(socket);\n\t} catch (IOException e) {\n\t return;\n\t}\n }",
"private void listen() {\n System.out.println(\"launch listen task\");\n listenTask = new AsyncTask<Void, String, IOException>() {\n @Override\n protected IOException doInBackground(Void... params) {\n try (BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {\n String line;\n while ((line = in.readLine()) != null) {\n System.out.println(\"receive \" + line);\n publishProgress(line);\n }\n } catch (SocketException e) {\n if (e.toString().equals(\"java.net.SocketException: Socket closed\")) {\n //that's what will happen when task.cancel() is called.\n System.out.println(\"listening is stopped as socket is closed\");\n return null;\n } else {\n e.printStackTrace();\n return e;\n }\n } catch (IOException e) {\n e.printStackTrace();\n return e;\n }\n return null;\n }\n\n @Override\n protected void onProgressUpdate(String... values) {\n handler.accept(new Message(MsgType.SERVER, values[0]));\n }\n\n @Override\n protected void onPostExecute(IOException e) {\n if (e == null) {\n handler.accept(new Message(MsgType.INFO, \"listening finished\"));\n } else {\n handler.accept(new Message(MsgType.ERROR,\n \"exception while listening\" + \"\\n\" + e.toString()));\n }\n }\n\n @Override\n protected void onCancelled() {\n super.onCancelled();\n }\n };\n //the listen task will last for a quite long time (blocking) and thus should run in a parallel pool.\n listenTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }",
"public void receiveData() throws IOException;",
"public void run(){\n\t\t\t\tsynchronized (socket) {\n\t\t\t\t\tsocket.close();\n\t\t\t\t}\n\t\t\t}",
"@Override\n public void run() {\n if (socket != null) {\n byte b0 = get_sendbyte0();\n byte b1 = get_sendbyte1();\n Log.e(\"handler\", String.valueOf(b0) + String.valueOf(b1));\n if (outputStream == null) {\n try {\n outputStream = socket.getOutputStream();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n try {\n outputStream.write(new byte[]{(byte) 1, b0, b1, (byte) 1}); /*1, b0, b1, 1*/\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n\n }",
"private void driveSimulation() {\n\n //process all data packets currently in the socket from the host\n //set timeout to 0 -- no need to wait on packets\n processDataPackets(0);\n \n}",
"public void handleMessage(Message message, Socket socket) throws IOException, HandlingException;",
"public void acceptTimeout();",
"@Override\n public void run() {\n send();\n }",
"public void acceptSocket(AsynchronousSocketChannel arg0) {\n\r\n\t\tnew TCPClient(arg0);\r\n\t}",
"@Override\r\n\tpublic void run() {\r\n\t\ttry {\r\n\t\t\tthis.inputStream = socket.getInputStream();\r\n\t\t\tthis.outputStream = socket.getOutputStream();\r\n\t\t\t// Get the peer that is asking me for fragments.\r\n\t\t\tpeerState = torrentClient.getPeerStateList().getByAddress(\r\n\t\t\t\t\tsocket.getInetAddress().getHostAddress(), socket.getPort());\r\n\t\t\t// read handhake\r\n\t\t\tbyte[] received = new byte[68];\r\n\t\t\tinputStream.read(received);\r\n\t\t\t//Parse the handshake received\r\n\t\t\tHandsake handshakeMessage = Handsake\r\n\t\t\t\t\t.parseStringToHandsake(new String(received));\r\n\t\t\t// validate hash\r\n\t\t\tString torrentHash = new String(torrentClient.getMetainf()\r\n\t\t\t\t\t.getInfo().getInfoHash());\r\n\t\t\t//if the received handshake is correct send my handshake\r\n\t\t\tif (Handsake.isValidHandsakeForBitTorrentProtocol(handshakeMessage,\r\n\t\t\t\t\ttorrentHash)) {\r\n\t\t\t\t// send handshake\r\n\t\t\t\tHandsake handShakeToSend = new Handsake(torrentHash,\r\n\t\t\t\t\t\tthis.torrentClient.getPeerId());\r\n\t\t\t\tthis.outputStream.write(handShakeToSend.getBytes());\r\n\t\t\t\t// enviar bitfield\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.sendBitfield();\r\n\t\t\t\t\t// leer\r\n\t\t\t\t\tPeerProtocolMessage message = this.readNormalMessage();\r\n\t\t\t\t\t// Check if I have received an interested message\r\n\t\t\t\t\tif (message.getType().equals(\r\n\t\t\t\t\t\t\tPeerProtocolMessage.Type.INTERESTED)) {\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tpeerState = torrentClient.getPeerStateList()\r\n\t\t\t\t\t\t\t\t\t.getByAddress(\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getInetAddress()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getHostAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getPort());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setPeer_interested(true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// send unchoke to the peer\r\n\t\t\t\t\t\tthis.outputStream.write(new UnChokeMsg().getBytes());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setAm_choking(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Continue receiveing messages if the message type is Keep_alive, Request or Have.\r\n\t\t\t\t\t\tboolean continueReading = true;\r\n\t\t\t\t\t\twhile (continueReading) {\r\n\t\t\t\t\t\t\tmessage = this.readNormalMessage();\r\n\t\t\t\t\t\t\tcontinueReading = processMessage(message);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// if I have not received interested send unchoke\r\n\t\t\t\t\t\tthis.outputStream.write(new ChokeMsg().getBytes());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// close connection\r\n\t\t\tthis.inputStream.close();\r\n\t\t\tthis.outputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Sending thread closed\");\r\n\t\t\te.printStackTrace();\r\n\t\t\ttry {\r\n\t\t\t\tthis.inputStream.close();\r\n\t\t\t\tthis.outputStream.close();\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n\tpublic void run() {\n\n\t\tbyte[] buffer = new byte[BUFFER_SIZE]; \n try { \n while (true) { \n int bytesRead = mInputStream.read(buffer); \n if (bytesRead == -1) \n break; // End of stream is reached --> exit 스트림의 끝에 도달\n \n Filter filter = new Filter(buffer, 0, bytesRead);\n mOutputStream.write(buffer, 0, bytesRead);\n mOutputStream.flush(); \n \n } \n } catch (IOException e) { \n // Read/write failed --> connection is broken \n \t// 쓰기/읽기 실패 --> 연결 끊기\n \tmParent.connectionBroken(); \n } \n \n // Notify parent thread that the connection is broken \n // 부모스레드에게 연결 끊기 전달\n mParent.connectionBroken(); \n }",
"public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock, ChannelPromise promise) {\n/* */ try {\n/* 582 */ return block(multicastAddress, \n/* */ \n/* 584 */ NetworkInterface.getByInetAddress(localAddress().getAddress()), sourceToBlock, promise);\n/* */ }\n/* 586 */ catch (SocketException e) {\n/* 587 */ promise.setFailure(e);\n/* */ \n/* 589 */ return (ChannelFuture)promise;\n/* */ } \n/* */ }",
"synchronized void processAndHandOff(int readCount) {\n readProcess(readCount);\n //Read processing done. Now the server is ready to send a message to the client.\n state = SENDING;\n }",
"public void run() {\n readFromClient();\n }",
"public void run() {\n try {\n socketIn = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n socketOut = new ObjectOutputStream(socket.getOutputStream());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n readFromClient();\n pingToClient();\n }",
"public void awaitConnection(){\n System.out.println(\"Waiting for connection from client\");\n\n try {\n socket = server.accept();\n System.out.println(\"Client Connected!\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"public interface UsbCommunicationInterface extends Runnable\n{\n byte get();\n\n void send(byte data) throws IOException;\n\n void cancel();\n}",
"default int readBlocking(byte[] buffer) {\n return readBlocking(buffer, 0, buffer.length);\n }",
"public void task() {\n try {\n Socket peerSocket = listeningSocket.accept(); // waits here until something tries to connect\n if (peerSocket != null) { addPeer(peerSocket); }\n } catch (IOException e) {\n throw new RuntimeException(\"Error accepting client connection\", e);\n }\n }",
"@Override\n public boolean block() {\n return false;\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tsocket.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}",
"public void onEvent(TCPReceiverThread receiverThread, Event event) throws IOException;",
"public void blockUntilUp() {\n while (server == null || !server.isServing()) {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n // ignore\n }\n }\n }",
"@Override\r\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\treMsg = withClient.getInputStream();\r\n\t\t\t\t\t\tbyte[] reBuffer = new byte[500];\r\n\t\t\t\t\t\treMsg.read(reBuffer);\r\n\t\t\t\t\t\tString msg = new String(reBuffer);\r\n\t\t\t\t\t\tmsg = msg.trim();\r\n\t\t\t\t\t\tif (msg.indexOf(\"/bye\") == 0) {\r\n\t\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tAnalysis.ckMsg(mySin, msg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t\tendCat();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}",
"public boolean isBlocking ( ) {\n\t\treturn extract ( handle -> handle.isBlocking ( ) );\n\t}",
"@Override\n public synchronized byte[] receive(int length) throws SocketException {\n byte[] data = new byte[length];\n \n try {\n connectionSocket = serverSocket.accept();\n connectionSocket.getInputStream().read(data, 0, length);\n } catch (IOException ex) {\n Logger.getLogger(TCPServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return data;\n }",
"public ChannelFuture block(InetAddress multicastAddress, InetAddress sourceToBlock) {\n/* 571 */ return block(multicastAddress, sourceToBlock, newPromise());\n/* */ }",
"public abstract void run(Data data, Socket socket);",
"@Override\n\tpublic void run() {\n\t\n\t\tboolean finMsg = false;\n\n \n \n\t\ttry {\n\t\t\t\n\t\t DataInputStream is = new DataInputStream(socket.getInputStream());\n DataOutputStream os = new DataOutputStream(socket.getOutputStream()); \n\t\t\t\n\t\t\twhile (!finMsg) {\n\t\t\t\t\n\t\t\tString[] client_Msg = is.readUTF().split(\" \");\n\t\t\t\t\n\t\t\tswitch (client_Msg[1]) {\n\t\t\t\n\t\t\t\tcase \"REG\":\n\t\t\t\t\thandleRegister(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"RDY\":\n\t\t\t\t\thandleReady(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"MOV\":\n\t\t\t\t\thandleMove(client_Msg, os);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\tcase \"FIN\":\n\t\t\t\t\tsocket.close();\n\t\t\t\t\tfinMsg=true;\n\t\t\t\t\tbreak;\n\t\t\t \n\t\t\t\n\t\t\t\t}\n\t\t\n\t\t \n\t\t\t}\n\t\t\t\t\n\t\t}catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}",
"public void run() {\r\n String request = \"\";\r\n\r\n try {\r\n /**\r\n * The ClientConnectionHandler constantly waits for requests from the client. Requests are the initial message\r\n * that the client sends. This initial message determines how the server receives the messages that come after\r\n * it (if there are any).\r\n */\r\n while (isOpen) {\r\n request = readMessage();\r\n processRequest(request);\r\n }\r\n clientSocket.close();\r\n System.out.println(\"Client #\" + clientNumber + \" has closed\");\r\n } catch (Exception e) {}\r\n }",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tcancelsent=0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"About to get out\",\"before sending kickmeout\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(dos!=null)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(ispeak==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ispeak=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(\"kick_me_out_speaking\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"Kick me\",\"KICKED SPEAKING\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(\"kick_me_out_waiting\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(TestConnection.macid);\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"Kick me\",\"KICKED WAITING\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tcancelsent=1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\trecSocket.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"closing\", \"socket closed\");\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}",
"public void run() {\r\n Thread.currentThread().setContextClassLoader(m_loader);\r\n try {\r\n m_socket.setTcpNoDelay(true);\r\n m_socket.setSoTimeout(m_timeout);\r\n m_in = new ObjectInputStream(m_socket.getInputStream());\r\n m_out = new ObjectOutputStream(m_socket.getOutputStream());\r\n } catch (IOException e) {\r\n throw new WrappedRuntimeException(e);\r\n }\r\n while (m_running) {\r\n try {\r\n switch (m_in.read()) {\r\n case Command.CREATE:\r\n handleCreateCommand();\r\n break;\r\n case Command.INVOKE:\r\n handleInvocationCommand();\r\n break;\r\n case Command.CLOSE:\r\n m_running = false;\r\n break;\r\n default:\r\n break;\r\n }\r\n } catch (Exception e) {\r\n close();\r\n throw new WrappedRuntimeException(e);\r\n }\r\n }\r\n close();\r\n }",
"public void receiveResult(SocketRequestHandle<Identifier> cancellable,\n P2PSocket<Identifier> sock) {\n try {\n final ByteBuffer writeMe = ByteBuffer.wrap(localIdStrategy.getLocalIdentifierBytes());\n new P2PSocketReceiver<Identifier>() {\n public void receiveSelectResult(P2PSocket<Identifier> socket,\n boolean canRead, boolean canWrite) throws IOException {\n if (socket.write(writeMe) < 0) {\n deliverSocketToMe.receiveException(ret, new ClosedChannelException(\"Socket closed.\"));\n return;\n }\n if (writeMe.hasRemaining()) {\n socket.register(false, true, this);\n return;\n }\n // done\n deliverSocketToMe.receiveResult(ret, new SocketWrapperSocket<Identifier, Identifier>(socket.getIdentifier(),socket,logger,errorHandler,socket.getOptions()));\n }\n public void receiveException(P2PSocket<Identifier> socket,\n Exception ioe) {\n deliverSocketToMe.receiveException(ret, ioe);\n }\n }.receiveSelectResult(sock, false, true);\n } catch (IOException ioe) {\n deliverSocketToMe.receiveException(ret, ioe);\n }\n }"
] | [
"0.6354326",
"0.60085136",
"0.5993693",
"0.5881908",
"0.5840793",
"0.581787",
"0.577175",
"0.57649314",
"0.57406926",
"0.5712461",
"0.56940955",
"0.56828535",
"0.5657888",
"0.56283265",
"0.5615011",
"0.5537146",
"0.5534428",
"0.5528892",
"0.5488045",
"0.54605925",
"0.5437507",
"0.54368293",
"0.5434707",
"0.5412086",
"0.5387156",
"0.5375769",
"0.5375489",
"0.53726315",
"0.53598285",
"0.5357077",
"0.5354246",
"0.53336173",
"0.5325272",
"0.5297915",
"0.5292466",
"0.52872396",
"0.52803165",
"0.52751684",
"0.5272564",
"0.526849",
"0.526689",
"0.52627695",
"0.52613294",
"0.5256847",
"0.5252148",
"0.52482283",
"0.52393264",
"0.52364266",
"0.52303106",
"0.5225383",
"0.5221079",
"0.52168214",
"0.5213333",
"0.52056193",
"0.5200877",
"0.5200325",
"0.5199849",
"0.5199529",
"0.5195922",
"0.51907384",
"0.51907384",
"0.5180103",
"0.5178282",
"0.5167304",
"0.51654947",
"0.51651794",
"0.51649636",
"0.51589596",
"0.51579034",
"0.51552665",
"0.51531553",
"0.5147161",
"0.51430464",
"0.51325595",
"0.5123465",
"0.5117009",
"0.5116154",
"0.5109629",
"0.5107467",
"0.5079825",
"0.5066079",
"0.5065452",
"0.5063199",
"0.5061047",
"0.50501984",
"0.5049374",
"0.504684",
"0.5040455",
"0.5039822",
"0.5032015",
"0.5028697",
"0.5019798",
"0.50153255",
"0.5014583",
"0.5012361",
"0.5011293",
"0.50098413",
"0.50070965",
"0.50026655",
"0.5001476"
] | 0.520295 | 54 |
Start the Acceptor Thread and wait for incoming connection, in a non blocking mode. | @Override
public void startEndpoint() throws IOException, InstantiationException {
setRunning(true);
rampUpProcessorTask();
registerComponents();
startPipelines();
startListener();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void startListening()\n {\n if (outstanding_accept != null || open_connection != null) {\n return;\n }\n \n outstanding_accept = new AcceptThread(bt_adapter, handler);\n outstanding_accept.start();\n }",
"public void startListening() {\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread: \" + mAcceptThread);\n }\n\n // Start the AcceptThread which listens for incoming connection requests\n if (mAcceptThread == null) {\n mAcceptThread = new AcceptThread(mContext, mHandler, services, this);\n }\n\n if (Util.isDebugBuild()) {\n Log.d(TAG, \"mAcceptThread.isAlive(): \" + mAcceptThread.isAlive());\n }\n\n if (!mAcceptThread.isAlive()) {\n mAcceptThread.start();\n }\n }",
"public void startListeningForConnection() {\n startInsecureListeningThread();\n }",
"public synchronized void start() {\n if (D) Log.d(TAG, \"start\");\n\n // Cancel any thread attempting to make a connection\n if (mConnectThread != null) {mConnectThread.cancel(); mConnectThread = null;}\n\n // Cancel any thread currently running a connection\n if (mConnectedThread != null) {mConnectedThread.cancel(); mConnectedThread = null;}\n\n setState(STATE_LISTEN);\n }",
"public void onStart() {\n\t\tnew Thread() {\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\tinitConnection();\n\t\t\t\treceive();\n\t\t\t}\n\t\t}.start();\n\t}",
"@Override\r\n\tpublic void start() {\n\t\tscavenger.start();\r\n\t\tnew Thread() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\twhile (!serverSocket.isClosed()) {\r\n\t\t\t\t\tSocket socket = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsocket = serverSocket.accept();\r\n\t\t\t\t\t\tscavenger.addSocket(socket);\r\n\t\t\t\t\t\tnew SynchronousSocketThread(socket).start();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\t}",
"public void onStart() {\n\t new Thread() {\n\t @Override public void run() {\n\t receive();\n\t }\n\t }.start();\n\t }",
"public void startThread(){\n String message = \"Connecting to RescueNet...Please Wait\";\n showProgressDialog(message);\n connectionThread = new ConnectionThread(mwifiAdmin, handlerMain);\n connectionThread.start();\n }",
"void startConnectionReader()\n {\n if (! synchronousMode)\n {\n connectionReader.start();\n }\n }",
"private void beginAcceptClients() throws Exception {\r\n \t\tClientAcceptThread acceptClientsThread = new ClientAcceptThread(this.serverSocket, this);\r\n \t\tacceptClientsThread.start();\r\n \r\n \t\tLogger.logMessage(\"ClientAcceptThread started\");\r\n \t}",
"public synchronized void startConnection ()\r\n\t{\r\n \t\tsynchronized (this)\r\n \t\t{\r\n \t\t\tif (_roboCOM!=null) return;\r\n\t\t\t\r\n\t\t\tuitoken++;\r\n\t\t\t_roboCOM = new TCPClient (MsgQueue,cm,uitoken);\r\n\r\n\t\t\t// debug parameters\r\n\t\t\t_roboCOM.msgHello=\"Start Connection ACCE\";\r\n\t\t\t\t\t\t\t\r\n\t \t \tnew Thread (_roboCOM).start();\r\n \t\t}\r\n\t}",
"public synchronized void start() throws Exception {\r\n\t\twhile (true) {\r\n\t\t\tterminal.println(\"Waiting for contact\");\r\n\t\t\tsendQueue();\r\n\t\t\tthis.wait();\r\n\t\t}\r\n\t}",
"public void startInbound();",
"private void startInThread() {\n final Client fthis = this;\n if (in != null && in.isAlive()) in.interrupt();\n in = new Thread(() -> {\n while (true) {\n if (client.isClosed()) break;\n try {\n InputStream inFromServer = client.getInputStream();\n if (inFromServer.available() > 0) {\n String l = (char) inFromServer.read() + \"\";\n while (!l.endsWith(\"\\r\")) {\n l += (char) inFromServer.read() + \"\";\n }\n l = l.replace(\"\\r\", \"\");\n runPacketEvent(new ClientPacketEvent(fthis, PacketType.CLIENT_RECEIVE, l));\n }\n } catch (Exception e) {\n e.printStackTrace();\n break;\n }\n }\n });\n in.start();\n }",
"private void resumeListening() {\n Thread listener = new Thread() {\n @Override\n public void run() {\n try {\n mListenerSocket = new ServerSocket();\n mListenerSocket.setReuseAddress(true);\n mListenerSocket.bind(new InetSocketAddress(LOCAL_PORT));\n while (true) {\n Socket connSocket = mListenerSocket.accept();\n Scanner sc = new Scanner(connSocket.getInputStream());\n String encMsg = sc.nextLine();\n connSocket.close();\n sc.close();\n Message msg = mHandler.obtainMessage();\n msg.obj = encMsg;\n mHandler.sendMessage(msg);\n }\n } catch (IOException e) {\n Log.d(\"LANConnection\", \"Stopping listener thread due to error\", e);\n }\n }\n };\n listener.start();\n }",
"public void start() {\n\t\tcheckIsDisposed();\n\n\t\tif (isStarted)\n\t\t\treturn;\n\n\t\tqueueThread.start();\n\t\tisStarted = true;\n\t}",
"@SuppressWarnings(\"static-access\")\r\n\t\t@Override\r\n\t\tpublic void run() {\r\n\t\t\tsetName(C_THREAD);\r\n\t\t\tif(controller == MultiController.TCP) {\r\n\t\t\t\tnetworkHandling = new NetworkHandling(tcpHandler);\r\n\t\t\t\tnetworkHandling.establishConnection();\r\n\t\t\t\t\r\n\t\t\t\ttry { \r\n\t\t\t\t\t//Wait until the lock is released - wait for connection\r\n\t\t\t\t\tnetworkHandling.lock.acquire(); \r\n\t\t\t\t} catch (InterruptedException e) { }\r\n\t\t\r\n\t\t\t\tfinished(networkHandling.isConnected());\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(controller == MultiController.BLUETOOTH) {\r\n\t\t\t\tbluetoothHandling = new BluetoothHandling(getApplicationContext(),bluetoothHandler);\r\n\t\t\t\tbluetoothHandling.start();\r\n\t\t\t\t\r\n\t\t\t\tIntent intent = new Intent(getApplicationContext(),DeviceListActivity.class);\r\n\t\t\t\tstartActivityForResult(intent, BluetoothHandler.REQUEST_ADDRESS);\r\n\t\t\t\t\r\n\t\t\t\tfinReq = true;\r\n\t\t\t\t\r\n\t\t\t\ttry {\r\n\t\t\t\t\t//Wait until the lock is released - wait for connection\r\n\t\t\t\t\tbluetoothHandling.lock.acquire();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tfinished(bluetoothHandling.getState() == BluetoothHandling.STATE_CONNECTED);\r\n\t\t\t}\r\n\t\t}",
"@Override\r\n\tpublic void run() {\r\n\t\t\r\n\t\tLog.d(TAG, \"begin ConnectedThread job\");\r\n\t\t\r\n\t\t// Receive buffer\r\n\t\tbyte[] buffer = new byte[256];\r\n\t\t// Amount of bytes read from InputStream\r\n\t\tint length = 0;\r\n\t\t\r\n\t\twhile(running){\r\n\t\t\t\r\n\t\t\ttry{\r\n\t\t\t\t\r\n\t\t\t\t// Read available bytes from InputStream\r\n\t\t\t\tlength = oInStream.read(buffer);\r\n\t\t\t\t\t\t\r\n\t\t\t\t// Report the obtained bytes to the ConnectedListener\r\n\t\t\t\tif(oListener != null){\r\n\t\t\t\t\toListener.onReceive(buffer, length);\r\n\t\t\t\t}\r\n\t\t\t}catch(IOException e){\r\n\t\t\t\t\r\n\t\t\t\tLog.e(TAG, \"disconnected\", e);\r\n\t\t\t\t\r\n\t\t\t\t// Stop job\r\n\t\t\t\trunning = false;\r\n\t\t\t\t\r\n\t\t\t\t// Report this connection lose to the ConnectedListener \r\n\t\t\t\tif(oListener != null){\r\n\t\t\t\t\toListener.onDisconnect();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public void run() {\n mBluetoothAdapter.cancelDiscovery();\n try {\n // Connect to the remote device through the socket. This call blocks\n // until it succeeds or throws an exception.\n mmSocket.connect();\n } catch (IOException connectException) {\n cancel();\n return;\n }\n\n onSocketObtained(mmSocket);\n }",
"@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tif (needAutoConnect(addr)) {\n\t\t\t\t\t\tmBleApi.connect(addr);\n\t\t\t\t\t}\n\t\t\t\t}",
"public void run() {\n // Initial connect request comes in\n Request request = getRequest();\n\n if (request == null) {\n closeConnection();\n return;\n }\n\n if (request.getConnectRequest() == null) {\n closeConnection();\n System.err.println(\"Received invalid initial request from Remote Client.\");\n return;\n }\n\n ObjectFactory objectFactory = new ObjectFactory();\n Response responseWrapper = objectFactory.createResponse();\n responseWrapper.setId(request.getId());\n responseWrapper.setSuccess(true);\n responseWrapper.setConnectResponse(objectFactory.createConnectResponse());\n responseWrapper.getConnectResponse().setId(id);\n\n // Return connect response with our (statistically) unique ID.\n if (!sendMessage(responseWrapper)) {\n closeConnection();\n System.err.println(\"Unable to respond to connect Request from remote Client.\");\n return;\n }\n\n // register our thread with the server\n Server.register(id, this);\n\n // have handler manage the protocol until it decides it is done.\n while ((request = getRequest()) != null) {\n\n Response response = handler.process(this, request);\n\n if (response == null) {\n continue;\n }\n\n if (!sendMessage(response)) {\n break;\n }\n }\n\n // client is done so thread can be de-registered\n if (handler instanceof IShutdownHandler) {\n ((IShutdownHandler) handler).logout(Server.getState(id));\n }\n Server.unregister(id);\n\n // close communication to client.\n closeConnection();\n }",
"public synchronized void start() {\n\t\tif(! alive) {\n\t\t\talive = true;\n\t\t\tthread.start();\n\t\t}\n\t}",
"public void readyToReceive()\n { ua.printLog(\"WAITING FOR INCOMING CALL\");\n if (!ua.ua_profile.audio && !ua.ua_profile.video) ua.printLog(\"ONLY SIGNALING, NO MEDIA\"); \n //ua.listen();\n changeStatus(UA_IDLE);\n printOut(\"digit the callee's URL to make a call or press 'enter' to exit\");\n }",
"@Override\n protected void startListener(){\n Socket socket = null;\n while (isRunning()){\n socket = acceptSocket();\n if (socket == null) {\n continue;\n }\n \n try {\n handleConnection(socket);\n } catch (Throwable ex) {\n getLogger().log(Level.FINE, \n \"selectorThread.handleConnectionException\",\n ex);\n try {\n socket.close(); \n } catch (IOException ioe){\n // Do nothing\n }\n continue;\n }\n } \n }",
"private void ccListenerStarter(){\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\t//spin off new ccListener\n\t\t\t\t\n\t\t\t\tThread listenerThread = new Thread(\n\t\t\t\t\t\tnew ClientCommunicatorListener(\n\t\t\t\t\t\t\t\tccSocket.getInputStream(), db, this));\n\t\t\t\t\n\t\t\t\tlistenerThread.start();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"private void startThread() {\n\t\tif(receivethread != null && receivethread.isAlive())\n\t\t\treceivethread.interrupt();\n\n\t\t// Close datagram socket If still open\n\t\tif(udpsocket != null && udpsocket.isClosed() == false)\n\t\t\tudpsocket.close();\n\n\t\t// Open datagram socket\n\t\ttry {\n\t\t\tudpsocket = new DatagramSocket();\n\t\t\tudpsocket.setReceiveBufferSize(1024 * 1024);\n\t\t\tudpsocket.setSoTimeout(15000);\n\t\t} catch (SocketException e) {\n\t\t\tudpsocket.close();\n\t\t\te.printStackTrace();\n\t\t\treturn;\n\t\t}\n\n\t\t// Start Receive Thread\n\t\treceivethread = new ReceiveThread(this.udpsocket, callback);\n\t\treceivethread.start();\n\t}",
"public void run() {\n\t\t\tbtAdapter.cancelDiscovery();\n\n\t\t\ttry {\n\t\t\t\t// Connect the device through the socket. This will block\n\t\t\t\t// until it succeeds or throws an exception\n\t\t\t\tmmSocket.connect();\n\t\t\t} catch (IOException connectException) {\n\t\t\t\t// Unable to connect; close the socket and get out\n\t\t\t\ttry {\n\t\t\t\t\tmmSocket.close();\n\t\t\t\t} catch (IOException closeException) { }\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Do work to manage the connection (in a separate thread)\n\t\t\tmHandler.obtainMessage(SUCCESS_CONNECT, mmSocket).sendToTarget();\n\t\t\tisConnected = true;\n\t\t\tConnectedThread connectedThread = new ConnectedThread((BluetoothSocket) mmSocket);\n\n\t\t}",
"public void startConnectThread(String ipAddr) {\n \t\tThread thread = new Thread(new Connection(ipAddr));\n \t\tthread.start();\n \t\tthreads.add(thread);\n \t}",
"public void run() {\n mBluetooth.cancelDiscovery();\n\n try {\n // Connect the device through the socket. This will block\n // until it succeeds or throws an exception\n mmSocket.connect();\n } catch (IOException connectException) {\n // Unable to connect; close the socket and get out\n try {\n mmSocket.close();\n } catch (IOException closeException) { }\n return;\n }\n\n // Do work to manage the connection (in a separate thread)\n connectedSocket(mmSocket);\n }",
"public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"private void waitOnReceive() throws IOException {\n while (inStream.available() == 0) {\n try {\n Thread.sleep(1);\n } catch (InterruptedException _) {\n }\n }\n }",
"private void createAndStartConnectionThread() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n boolean success = webSocketConnection.createAndConnectTCPSocket();\n if (success) {\n webSocketConnection.startConnection();\n }\n } catch (Exception e) {\n synchronized (globalLock) {\n if (isRunning) {\n webSocketConnection.closeInternal();\n\n onException(e);\n\n if (e instanceof IOException && automaticReconnection) {\n createAndStartReconnectionThread();\n }\n }\n }\n }\n }\n }).start();\n }",
"public void run() {\t\r\n\ttry {\r\n\t System.out.println(\"Creating input pipe\");\r\n\t // create the input pipe\r\n\t pipeIn = pipeSvc.createInputPipe(pipeAdv,this);\r\n\t} \r\n\tcatch (Exception e) {\r\n\t System.out.println(\"Error creating input pipe.\");\r\n\t return;\r\n\t}\r\n\tif (pipeIn == null) {\r\n\t System.out.println(\"Error: cannot open InputPipe\");\r\n\t System.exit(-1);\r\n\t}\r\n\tSystem.out.println(\"Listener waiting for messages...\");\r\n\ttry {\r\n\t Thread.sleep(Integer.MAX_VALUE);\r\n\t} catch (Exception e) {\r\n\t System.out.println(\"Program interrupted\");\r\n\t}\r\n }",
"public void start() {\n LOG.entering(CLASS_NAME, \"start\");\n if (state.compareAndSet(STOPPING, STARTED)) {\n // Keep same thread running if STOPPING\n }\n else if (state.compareAndSet(STOPPED, STARTED)) {\n new Thread(this, \"XoaEventProcessor\").start();\n }\n }",
"public void run() {\n\t\t\twhile (true) {// 保持连接直到异常发生或套接字返回\n\t\t\t\ttry {\n\t\t\t\t\tif (serverSocket != null) {\n\t\t\t\t\t\tmTempSocket = serverSocket.accept(); // 如果一个连接同意\n\t\t\t\t\t}\n\t\t\t\t\t// If a connection was accepted\n\t\t\t\t\tif (mTempSocket != null) {\n\t\t\t\t\t\t// Do work to manage the connection (in a separate\n\t\t\t\t\t\t// thread)\n\t\t\t\t\t\tmanageConnectedSocket(); // 管理一个已经连接的RFCOMM通道在单独的线程。\n\t\t\t\t\t\tserverSocket.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public static void startChatServer() {\n\t\tbyte[] buffer = new byte[1024];\n\t\tStreamConnectionNotifier cn = null;\n\t\ttry {\n\t\t\tLocalDevice local = LocalDevice.getLocalDevice();\n\t\t\tlocal.setDiscoverable(DiscoveryAgent.GIAC);\n\t\t\tcn = (StreamConnectionNotifier) Connector.open(INSECURE_URL);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tOutputThread t = null;\n\t\t\tStreamConnection sock = null;\n\t\t\tInputStream is = null;\n\t\t\tOutputStream os = null;\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting connection:\");\n\t\t\t\tsock = cn.acceptAndOpen();\n\t\t\t\tSystem.out.println(\"accept!: \" + Charset.defaultCharset());\n\t\t\t\tis = sock.openInputStream();\n\t\t\t\tos = sock.openOutputStream();\n\n\t\t\t\tt = new OutputThread(os);\n\t\t\t\tt.start();\n\n\t\t\t\twhile (t.isAlive()) {\n\t\t\t\t\t//TODO: use timeout read?\n\t\t\t\t\tint len = is.read(buffer);\n\t\t\t\t\t// printAsHex(buffer, len);\n\t\t\t\t\tif (len > 0) {\n\t\t\t\t\t\tSystem.out.println(\"received message(\" + len + \"): \" + new String(buffer, 0, len));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//TODO: check connection is live or not,\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tt.interrupt();\n\t\t\t\tt = null;\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t\tcn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private synchronized void doConnect() {\n try {\n String host = agent.getHost();\n int port = agent.getPort();\n log.fine(\"Connecting to server \" + host + ':' + port);\n socket = new Socket(host, port);\n input = socket.getInputStream();\n output = new OutputStreamWriter(socket.getOutputStream());\n disconnected = false;\n new Thread(this).start();\n\n // Automatically login! -> give an auth to the agent...\n TACMessage msg = new TACMessage(\"auth\");\n msg.setParameter(\"userName\", agent.getUser());\n msg.setParameter(\"userPW\", agent.getPassword());\n msg.setMessageReceiver(agent);\n sendMessage(msg);\n\n } catch (Exception e) {\n disconnected = true;\n log.log(Level.SEVERE, \"connection to server failed:\", e);\n socket = null;\n }\n }",
"private void acceptConnection() throws Exception {\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \"TcpConnectionListener.acceptConnection()\");\n\n Socket sock = proxyService.getServerSocket().accept();\n String inaddr = sock.getInetAddress().getHostAddress();\n\n connectionCount++;\n\n if (logger.isLoggable(BasicLevel.INFO))\n logger.log(BasicLevel.INFO, \" -> accept connection from \" + inaddr);\n\n try {\n sock.setTcpNoDelay(true);\n\n // Fix bug when the client doesn't use the right protocol (e.g. Telnet)\n // and blocks this listener.\n sock.setSoTimeout(timeout);\n\n InputStream is = sock.getInputStream();\n NetOutputStream nos = new NetOutputStream(sock);\n\n byte[] magic = StreamUtil.readByteArrayFrom(is, 8);\n for (int i = 0; i < 5; i++) {\n if (magic.length == i || magic[i] != MetaData.joramMagic[i] && magic[i] > 0) {\n String errorMsg = \"Bad magic number. Client is not compatible with JORAM.\";\n protocolErrorCount++;\n throw new IllegalAccessException(errorMsg);\n }\n }\n if (magic[7] != MetaData.joramMagic[7]) {\n if (magic[7] > 0 && MetaData.joramMagic[7] > 0) {\n String errorMsg = \"Bad protocol version number \" + magic[7] + \" != \" + MetaData.joramMagic[7];\n protocolErrorCount++;\n throw new IllegalAccessException(errorMsg);\n }\n \n logger.log(BasicLevel.WARN,\n \"Wildcard protocol version number: from stream = \" + magic[7] + \", from MetaData = \" + MetaData.joramMagic[7]);\n }\n\n //read the ack mode(noAckedQueue)\n boolean noAckedQueue = StreamUtil.readBooleanFrom(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read noAckedQueue = \" + noAckedQueue);\n if (noAckedQueue)\n TcpProxyService.createExecutors();\n \n long dt = Math.abs(StreamUtil.readLongFrom(is) - System.currentTimeMillis());\n if (dt > clockSynchroThreshold)\n logger.log(BasicLevel.WARN, \" -> bad clock synchronization between client and server: \" + dt);\n StreamUtil.writeTo(dt, nos);\n\n Identity identity = Identity.read(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read identity = \" + identity);\n\n int key = StreamUtil.readIntFrom(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read key = \" + key);\n\n int heartBeat = 0;\n if (key == -1) {\n heartBeat = StreamUtil.readIntFrom(is);\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> read heartBeat = \" + heartBeat);\n }\n \n if (logger.isLoggable(BasicLevel.INFO))\n logger.log(BasicLevel.INFO, \" -> open connection \" + identity + \"/\" + key + \" - \" + heartBeat);\n \n GetProxyIdNot gpin = new GetProxyIdNot(identity, inaddr);\n AgentId proxyId;\n try {\n gpin.invoke(AdminTopic.getDefault());\n proxyId = gpin.getProxyId();\n } catch (Exception exc) {\n if (logger.isLoggable(BasicLevel.WARN))\n logger.log(BasicLevel.WARN, \" -> login failed\", exc);\n failedLoginCount++;\n StreamUtil.writeTo(1, nos);\n StreamUtil.writeTo(exc.getMessage(), nos);\n nos.send();\n return;\n }\n\n if (logger.isLoggable(BasicLevel.DEBUG))\n logger.log(BasicLevel.DEBUG, \" -> open connection, proxyId=\" + proxyId);\n \n IOControl ioctrl;\n ReliableConnectionContext ctx;\n if (key == -1) {\n OpenConnectionNot ocn = new OpenConnectionNot(Type.RELIABLE, heartBeat, noAckedQueue);\n ocn.invoke(proxyId);\n StreamUtil.writeTo(0, nos);\n ctx = (ReliableConnectionContext) ocn.getConnectionContext();\n key = ctx.getKey();\n StreamUtil.writeTo(key, nos);\n nos.send();\n ioctrl = new IOControl(sock);\n } else {\n GetConnectionNot gcn = new GetConnectionNot(key);\n try {\n gcn.invoke(proxyId);\n } catch (Exception exc) {\n if (logger.isLoggable(BasicLevel.WARN))\n logger.log(BasicLevel.WARN, \"TcpConnectionListener: reconnection failed\", exc);\n StreamUtil.writeTo(1, nos);\n StreamUtil.writeTo(exc.getMessage(), nos);\n nos.send();\n return;\n }\n ctx = (ReliableConnectionContext) gcn.getConnectionContext();\n StreamUtil.writeTo(0, nos);\n nos.send();\n ioctrl = new IOControl(sock, ctx.getInputCounter());\n\n // Close the remaining connection if it exists\n TcpConnection tcpConnection = proxyService.getConnection(proxyId, key);\n if (tcpConnection != null) {\n tcpConnection.close();\n }\n }\n\n // Reset the timeout in order to enable the server to indefinitely\n // wait for requests.\n sock.setSoTimeout(0);\n\n TcpConnection tcpConnection = new TcpConnection(ioctrl, ctx, proxyId, proxyService, identity);\n tcpConnection.start();\n } catch (IllegalAccessException exc) {\n if (logger.isLoggable(BasicLevel.ERROR))\n logger.log(BasicLevel.ERROR, \"TcpConnectionListener: close connection\", exc);\n sock.close();\n throw exc;\n } catch (IOException exc) {\n if (logger.isLoggable(BasicLevel.WARN))\n logger.log(BasicLevel.WARN, \"TcpConnectionListener: close socket\", exc);\n sock.close();\n throw exc;\n }\n }",
"public void run() {\n try {\n // accepts the connection request.\n SelectableChannel peerHandle = this._handle.accept();\n if (peerHandle != null) {\n // now, create a service handler object to serve the\n // the client.\n ServiceHandler handler =\n this._factory.createServiceHandler(\n this._reactor,\n peerHandle);\n if (handler != null)\n // give the service handler object a chance to initialize itself.\n handler.open();\n }\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n }\n }",
"public static void start() {\n enableIncomingMessages(true);\n }",
"public void acceptClient() {\n if (mBluetoothAdapter.getScanMode() != BluetoothAdapter.SCAN_MODE_CONNECTABLE_DISCOVERABLE) {\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\n discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, DISCOVERABLE_DURATION);\n mContext.startActivity(discoverableIntent);\n }\n\n stop();\n\n mAcceptThread = new AcceptThread();\n mAcceptThread.start();\n }",
"public void start() {\n\t\tif (serverStarted.get()) {\n\t\t\tthrow new IllegalStateException(\"Server already started. \" + toString());\n\t\t}\n\t\tCallable<Boolean> task;\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port);\n\t\t\tserverSocket.setSoTimeout(soTimeout);\n\t\t\tport = serverSocket.getLocalPort();\n\t\t\tnotifyListener(\"Server started. \" + toString());\n\t\t\tserverStarted.set(true);\n\t\t\ttask = new Callable<Boolean>() {\n\t\n\t\t\t\tpublic Boolean call() {\n\t\t\t\t\tnotifyListener(\"Starting server thread. \" + toString());\n\t\t\t\t\tstopFlag.set(false);\n\t\t\t\t\twhile (!stopFlag.get()) {\n\t\t\t\t\t\tSocket connection = null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnection = serverSocket.accept();\n\t\t\t\t\t\t\tnotifyListener(\"Connection accepted on port. \" + toString());\n\t\t\t\t\t\t\tconnection.close();\n\t\t\t\t\t\t\tnotifyListener(\"Connection closed on port. \" + toString());\n\t\t\t\t\t\t\tpingCounter.incrementAndGet();\n\t\t\t\t\t\t} catch (SocketTimeoutException e) {\n\t\t\t\t\t\t\tnotifyListener(\"Server accept timed out. Retrying. \" + toString());\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tnotifyListener(\"Server accept caused exception [message=\" + e.getMessage() + \"]. Retrying. \" + toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnotifyListener(\"Server socket closed. \" + toString());\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (IOException e) {\n\t\t\tstopFlag.set(true);\n\t\t\tthrow new IllegalStateException(\"Unable to open socket on port. \" + toString(), e);\n\t\t}\n\t\tserverActivity = scheduler.submit(task);\n\t\tnotifyListener(\"Waiting for server to fully complete start. \" + toString());\n\t\tfor (;;) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(100);\n\t\t\t\tif (isStarted()) {\n\t\t\t\t\tnotifyListener(\"Server started. \" + toString());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (InterruptedException e) {\n\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic void run() {\n\t boolean listen = true;\r\n\t while (listen) {\r\n\t\ttry {\r\n\t\t Socket socket = listeningSocket.accept();\r\n\t\t Thread ConnThread = new Thread (new Connection (socket, pid));\r\n\t\t ConnThread.start();\r\n\t\t connThreads.add(ConnThread);\r\n\t\t \r\n\t\t} catch (SocketException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t listen = false;\r\n\t\t} catch (Exception e) {\r\n\t\t System.err.println(\"Random exception\");\r\n\t\t}\r\n\t }\r\n\t}",
"public void start() {\n\t\tconnection.start((sender, message) -> message.accept(new Visitor(sender)));\n\t\tloadData();\n\t}",
"private void start() {\n windowForCommunication.append(\"Awaiting client connection...\" + \"\\n\");\n\n //check if client is connected, if yes, add the following text to the chat window, then enable communication\n if (clientSocket.isConnected()) {\n windowForCommunication.append(\"Connection is established. Type 'stopconnection' to stop connection\" + \"\\n\");\n textField.setEditable(true);\n }\n\n //Begin communication, end if \"stopconnection\" is typed by Server/Client. If it is, call closeStreams method.\n try {\n String userInput;\n\n while((userInput = input.readLine()) != null) {\n if(userInput.contains(\"stopconnection\")){\n closeStreams();\n break;\n }\n\n displayMessage(userInput + \"\\n\");\n\n }\n }\n catch(IOException e) {\n e.printStackTrace();\n }\n }",
"public void task() {\n try {\n Socket peerSocket = listeningSocket.accept(); // waits here until something tries to connect\n if (peerSocket != null) { addPeer(peerSocket); }\n } catch (IOException e) {\n throw new RuntimeException(\"Error accepting client connection\", e);\n }\n }",
"private void startConnection() throws IOException {\n bos = new BufferedOutputStream(socket.getOutputStream(), 65536);\n\n byte[] key = new byte[16];\n Random random = new Random();\n random.nextBytes(key);\n String base64Key = Base64.encodeBase64String(key);\n\n byte[] handshake = createHandshake(base64Key);\n bos.write(handshake);\n bos.flush();\n\n InputStream inputStream = socket.getInputStream();\n verifyServerHandshake(inputStream, base64Key);\n\n writerThread.start();\n\n notifyOnOpen();\n\n bis = new BufferedInputStream(socket.getInputStream(), 65536);\n read();\n }",
"public void connect() {\n\n if (reader == null) {\n reader = new ReadFromGo(this);\n readerThread = new Thread(reader);\n readerThread.start();\n } else {\n System.out.println(\"stopGoProcess()\");\n if (readerThread != null) {\n reader.stop();\n readerThread.interrupt();\n reader = new ReadFromGo(this);\n readerThread = new Thread(reader);\n readerThread.start();\n System.out.println(\"Thread interrupted and started\");\n }\n }\n }",
"public void start()\r\n {\r\n if (_keepGoing) return;\r\n\r\n _keepGoing = true;\r\n\r\n Thread thread = new Thread(this);\r\n thread.start();\r\n }",
"public void start() throws Exception {\n if (m_runner == null) {\n m_serverSocket = m_ftpConfig.getSocketFactory().createServerSocket(); \n m_runner = new Thread(this);\n m_runner.start();\n System.out.println(\"Server ready :: Apache FTP Server\");\n m_log.info(\"------- Apache FTP Server started ------\");\n }\n }",
"public void ListenThread() \n {\n Thread t = new Thread(new IncomingReader(writer, reader));\n t.start();\n \n }",
"public synchronized void start() {\n\t\tif (running)\n\t\t\treturn;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\t\trunning = true;\n\t}",
"public void start() {\n if (Log.isLoggingEnabled())\n log.log(\"Start deadlock detection protocol\");\n }",
"public synchronized void listen() {\n// synchronized (this) {\n try {\n String input;\n if ((input = in.readLine()) != null) {\n parseCommand(input);\n }\n } catch (IOException ex) {\n Logger.getLogger(ClientIO.class.getName()).log(Level.SEVERE, null, ex);\n }\n// }\n }",
"public synchronized boolean start(){\n \n\t\t/**\n\t\t * CONNECT TO SERVER\n\t\t */\n\t\tboolean connection = connectToServer(oml_server);\n \n\t\t/**\n\t\t * CREATE THE HEADER\n\t\t */\n\t\tcreate_head();\n \n\t\t/**\n\t\t * SEND THE HEADER\n\t\t */\n\t\tboolean injection = inject_head();\n\t\t\n\t\tif( connection && injection ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"private void makeBackgroundConnection() {\n connectionPending = true;\n try {\n Thread connectThread = new Thread(this);\n connectThread.start();\n } catch (OutOfMemoryError oome) {\n // Give up on new connection\n }\n }",
"private void makeBackgroundConnection() {\n connectionPending = true;\n try {\n Thread connectThread = new Thread(this);\n connectThread.start();\n } catch (OutOfMemoryError oome) {\n // Give up on new connection\n }\n }",
"public void run() {\n\n // Attempt to connect and exit the thread if it failed\n try {\n connect();\n sendToReadHandler(\"CONNECTED\");\n } catch (Exception e) {\n Log.e(TAG, \"Failed to connect!\", e);\n sendToReadHandler(\"CONNECTION FAILED\");\n disconnect();\n return;\n }\n\n // Loop continuously, reading data, until thread.interrupt() is called\n while (!this.isInterrupted()) {\n\n // Make sure things haven't gone wrong\n if ((inStream == null) || (outStream == null)) {\n Log.e(TAG, \"Lost bluetooth connection!\");\n break;\n }\n\n // Read data and add it to the buffer\n String s = read();\n if (s.length() > 0)\n rx_buffer += s;\n\n // Look for complete messages\n parseMessages();\n }\n\n // If thread is interrupted, close connections\n disconnect();\n sendToReadHandler(\"DISCONNECTED\");\n }",
"public void iniciarDealer() {\n\t\tThread dealer = new Thread(this);\n\t\tdealer.start();\n\t}",
"public void run() {\n\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"准备。。。\");\n\t\t\t\t\ttry {\n\t\t\t\t\t\tp.await();//等待\n\t\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"已接受。。。\");\n\t\t\t\t\t\tThread.sleep((long)(Math.random()*10000));\n\t\t\t\t\t\tSystem.out.println(Thread.currentThread().getName()+\"完成。。。\");\n\t\t\t\t\t\ts.countDown();//三次后为0 释放主线程中的等待\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}",
"public void Connect() {\n run = new Thread(\"Connect\") {\n @Override\n public void run() {\n running = true;\n try {\n server = new ServerSocket(9080);\n waitingForConnection();\n } catch (IOException ex) {\n Logger.getLogger(Dashboard.class\n .getName()).log(Level.SEVERE, null, ex);\n }\n }\n };\n run.start();\n }",
"private void runServer() {\n while(true) {\n // This is a blocking call and waits until a new client is connected.\n Socket clientSocket = waitForClientConnection();\n handleClientInNewThread(clientSocket);\n } \n }",
"public void start() {\n gateway.openConnection();\n }",
"public void start() {\n\t\tai = new Thread(this);\n\t\tai.start();\n\t}",
"public void start(Peer p) {\n P = p;\n if (t == null) {\n t = new Thread(this, \"Accept-\" + P.id);\n t.start();\n }\n }",
"protected void mainTask() {\n\ttry {\n\t socket = serverSocket.accept();\t\n\t spawnConnectionThread(socket);\n\t} catch (IOException e) {\n\t return;\n\t}\n }",
"@Override\n public void run() {\n handleClientRequest();\n }",
"public void listen() {\n\t\tthread(\"NetworkClientInput\", () -> {\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tString str = in.readLine();\n\t\t\t\t\t\n\t\t\t\t\tif (str == null)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(\"[CLIENT] Received: \" + str);\n\t\t\t\t\ttry {\n\t\t\t\t\t\thandle(str);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.err.println(\"[Client] Error handling input\");\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"[Client] Disconnected.\");\n\t\t\t\t\tconnected = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tconnected = false;\n\t\t\texecutor.shutdown();\n\t\t\tsocket.close();\n\t\t});\n\t}",
"public void accept()\n { ua.accept();\n changeStatus(UA_ONCALL);\n if (ua_profile.hangup_time>0) automaticHangup(ua_profile.hangup_time); \n printOut(\"press 'enter' to hangup\"); \n }",
"public synchronized void start() {\n if (!this.isRunning) {\n isRunning = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public void run() {\n Log.d(\"bluetooth\", \"entrou na thread bluetoothconnect\");\n while (true) {\n try {if(mmServerSocket != null)\n socket = mmServerSocket.accept();\n\n\n } catch (IOException e) {\n break;\n }\n // If a connection was accepted\n if (socket != null) {\n // Do work to manage the connection (in a separate thread)\n //Server server = new Server(socket);\n Log.d(\"bluetooth\", \"socket não está mais null oba\");\n\n if(socket.isConnected()){\n tts.speak(\"Device connected\");\n\n }\n // Server server = new Server(socket);\n //server.initialize(handler);\n //mmServerSocket.close();\n\n\n break;\n }\n }\n }",
"public synchronized void start() {\r\n\t\tthread = new Thread(this);\r\n\t\tthread.start();\r\n\t\tisRunning = true;\r\n\t }",
"public void StartListening()\n\t{\n\t\tif (true == mbHasAccelerometer && false == mbListening)\n\t\t{\n\t\t\tmbListening = true;\n\t\t\t\n\t\t\tfinal AccelerometerNativeInterface accelerometerNI = this;\n\t\t\tRunnable task = new Runnable()\n\t\t\t{ \n\t\t\t\t@Override public void run() \n\t\t\t\t{\n\t\t\t\t\tSensorManager sensorManager = (SensorManager)CSApplication.get().getActivityContext().getSystemService(Activity.SENSOR_SERVICE);\n\t\t\t\t\tsensorManager.registerListener(accelerometerNI, sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_GAME);\t\n\t\t\t\t}\n\t\t\t};\n\t\t\tCSApplication.get().scheduleUIThreadTask(task);\n\t\t};\n\t}",
"@Override\n\tpublic void run() {\n\t\tthis.originateAction = new OriginateAction();\n\t\tthis.originateAction.setChannel(this.destination); // SIP/1083484/01703846797\n\t\tthis.originateAction.setContext(EPursuit.properties.getProperty(\"context\"));\n\t\tthis.originateAction.setExten(this.agi.getExtension());\n\t\tthis.originateAction.setPriority(new Integer(1));\n\t\t// TODO: Which timeout to use? Occurs sometimes when the phone is down\n\t\t// or never receives an event (for some reason)\n\t\tthis.originateAction.setTimeout(new Long(EPursuit.properties.getProperty(\"callTime\"))+new Long(EPursuit.properties.getProperty(\"dialTime\")));\n\t\tthis.originateAction.setAsync(true);\n\n\t\t// make initial call\n\t\tthis.makeCall();\n\t}",
"public void run() {\n IConnectionManager conManager = m_ftpConfig.getConnectionManager();\n while (m_runner != null) {\n try {\n \n // closed - return\n if(m_serverSocket == null) {\n return;\n }\n \n // accept new connection .. if suspended \n // close immediately.\n Socket soc = m_serverSocket.accept();\n if(m_suspended) {\n try {\n soc.close();\n }\n catch(Exception ex) {\n }\n continue;\n }\n \n IConnection connection = new RequestHandler(m_ftpConfig, soc);\n conManager.newConnection(connection);\n }\n catch (Exception ex) {\n return;\n }\n }\n }",
"public void start() {\n\n\t\tisRunning = true;\n\t\tthread = new Thread(this);\n\t\tthread.start();\n\n\t}",
"public void start() {\n if (!started) {\n thread = new Thread(this);\n thread.start();\n started = true;\n }\n }",
"@Override\n public void run()\n {\n log(\"STARTED\");\n\n try\n {\n FileInputStream keystoreStream = new FileInputStream(keystoreFile);\n KeyStore keyStore = KeyStore.getInstance(\"JKS\");\n keyStore.load(keystoreStream, keystorePassword.toCharArray());\n CloseableUtil.close(keystoreStream);\n\n KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());\n kmf.init(keyStore, keystorePassword.toCharArray());\n\n TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());\n tmf.init(keyStore);\n\n SSLContext sslContext = SSLContext.getInstance(\"TLS\");\n sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());\n\n SSLServerSocketFactory ssf = sslContext.getServerSocketFactory();\n sslServer = (SSLServerSocket) ssf.createServerSocket(PORT);\n }\n catch (Exception e)\n {\n log(\"Exception caught. Message: \" + e.getMessage());\n }\n\n // Start a new thread for handling a client that connects\n try\n {\n log(\"Accepting new client connections...\");\n while (!isInterrupted())\n {\n SSLSocket connection = (SSLSocket) sslServer.accept();\n log(\"A new client connected: \" + connection.getInetAddress());\n new CAClientConnection(connection, callback, keystorePassword).start();\n }\n }\n catch (Exception e)\n {\n if (!e.getMessage().equals(\"socket closed\"))\n {\n log(\"Exception caught. Message: \" + e.getMessage());\n e.printStackTrace();\n }\n }\n }",
"private void startServer() throws IOException {\n while (true) {\n System.out.println(\"[1] Waiting for connection...\");\n\n client = server.accept();\n System.out.println(\"[2] Connection accepted from: \" + client.getInetAddress());\n\n in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n out = new PrintStream(client.getOutputStream(), true);\n\n while (!in.ready()) ;\n\n String line = in.readLine();\n ManageConnections connection = new ManageConnectionsFactory().getConnection(line);\n\n connection.goConnect(client, in, out);\n }\n }",
"@Override\n\tpublic void run() {\n\t\tSocket connect_port = null;\n\t\twhile (true) {\t\t\t\n\t\t\ttry {\n\t\t\t\tconnect_port = this.listen_port.accept();\n\t\t\t\tRequest req = new Request(connect_port);\n\t\t\t\tthis.pool.submit(req);\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void startRunning(){\r\n\t\ttry{\r\n\t\t\twhile( true ){\r\n\t\t\t\tserver = new ServerSocket(PORT);\r\n\t\t\t\ttry{\r\n\t\t\t\t\twaitForClient(1);\r\n\t\t\t\t\twaitForClient(2);\r\n\t\t\t\t\tnew ServerThread(connectionClient1, connectionClient2, this).start();\r\n\t\t\t\t}\r\n\t\t\t\tcatch( EOFException e ){\r\n\t\t\t\t\tshowMessage(\"\\nServer ended the connection\");\r\n\t\t\t\t}\r\n\t\t\t\tfinally {\r\n\t\t\t\t\tserver.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch( IOException e ){\r\n\t\t}\r\n\t}",
"private synchronized void start()\n\t{\n\t\tregisterReceiver(\n\t\t\t\tmConnectivityReceiver,\n\t\t\t\tnew IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION )\n\t\t);\n\n\t\ttry\n\t\t{\n\t\t\t// Show notification in status bar\n\t\t\tshowNotification();\n\t\t} catch ( Exception e ) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public void startCasterThread () throws IllegalStateException\n {\n System.out.println (\"Start Mailserver on port \" + port);\n if (ntripCaster != null)\n throw new IllegalStateException (\"NTRIP caster is already running.\");\n\n ntripCasterRunning = false;\n\n ntripCaster = new NtripCasterThread ();\n ntripCaster.start ();\n\n // Now we wait for the NTRIP caster to open its socket.\n int cycles = 100;\n while (!ntripCasterRunning && --cycles > 0) {\n try { Thread.sleep (50); } catch (Exception e) {}\n Thread.yield ();\n }\n\n if (cycles == 0)\n throw new IllegalStateException (\"Can not launch NTRIP caster.\");\n }",
"@Override\n public void run()\n {\n while (true)\n {\n try\n {\n final Socket socket = m_ServerSocket.accept(); // NOFORTIFY: unreleased resource:\n //resources are managed by the remote channel lookup\n m_Logging.info(\"Connection made from %s for remote interface\", \n socket.getRemoteSocketAddress());\n \n m_RemoteChannelLookup.newServerSocketChannel(socket);\n }\n catch (final IOException e)\n {\n if (m_ServerSocket.isClosed())\n {\n m_Logging.info(\"Server socket has been closed, will stop accepting connections\");\n return;\n }\n }\n }\n }",
"@Override\n\tpublic void run() {\n\t\tLog.i(\"here\",\"listener\");\n\t\twhile(true){\n\t\t\t\n\t\t\ttry {\n\t\t\t\tif((cs=s.accept())!=null)new Thread(new Worker(context,cs)).start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t}\n }",
"@Override\n\tpublic void run() {\n\t\tif (FrameworkHandler.DEBUG_MODE){\n\t\t\tString strType = \"\";\n\t\t\tif (type == RULE_CONNECTION) strType = \"New RemoteRule Listener\";\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(strType + \" LISTENING on port: \" + listeningSocket.getLocalPort());\n\t\t}\n\t\ttry {\n\t\t\twhile (running) {\n\t\t\t\tSocket newSocket = listeningSocket.accept();\n\t\t\t\t\n\t\t\t\tif (FrameworkHandler.DEBUG_MODE)\n\t\t\t\t\tSystem.out.println(\"New request obtained on \" + newSocket.getPort() + \"|\" + newSocket.getLocalPort());\n\t\t\t\t\n\t\t\t\tcreateNewConnection(newSocket);\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tFrameworkHandler.exceptionLog(FrameworkHandler.LOG_ERROR, this, e);\n\t\t}\n\t}",
"public synchronized void start() {\n if (!running) {\n running = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"public synchronized void start() {\n if (!running) {\n running = true;\n thread = new Thread(this);\n thread.start();\n }\n }",
"@Override\n public void startThread() {\n Log.d(TAG, \"Starting \" + getName() + \" thread!\");\n if (!started)\n start();\n running = enabled;\n doStartAction();\n }",
"public void start() throws BluetoothStateException {\n\t\tDeviceDiscoverer.getInstance().startInquiry(DiscoveryAgent.GIAC, this);\n\t}",
"public void start() {\n retainQueue();\n mRequestHandle = mRequestQueue.queueRequest(mUrl, \"GET\", null, this, null, 0);\n }",
"@Override\n public void run() {\n P.print(\"Listening on port \"+P.port+\", waiting for incomming connection...\");\n try {\n ServerSocket serverSocket = new ServerSocket(P.port);\n while (P.choke_thread_running) { //read input forever.\n Receive receive_thread = new Receive();\n Socket s = serverSocket.accept();\n String addr = s.getInetAddress().toString();\n int p = s.getPort();\n int i;\n for(i = 0;i<P.peer_ip.length;i++){\n if(addr.equals(P.peer_ip[i])){\n P.sockets[i] = s;\n P.tcp_out_stream[i] = new ObjectOutputStream(s.getOutputStream());\n break;\n }\n }\n receive_thread.start(P,s,P.peer_id[--i]);\n P.print(\"Accepted incomming connection: ip = \"+addr.substring(1)+\", port = \"+p);\n }\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }",
"public void startListening();",
"private void listen() {\n\t\tString message;\n\t\twhile(true){\n\t\t\ttry {\n\t\t\t\tmessage = input.readLine();\n\t\t\t\tif (message == null) continue;\n\n\t\t\t\tif(message.equals(\"disconnect\")){\n\t\t\t\t\tThread t = new Thread(this::disconnect);\n\t\t\t\t\tt.start();\n\t\t\t\t\treturn;\n\t\t\t\t} else if(message.contains(\"PUSH\")) {\n\t\t\t\t\tparseMessage(message);\n\t\t\t\t} else if (message.equals(\"pong\")){\n\t\t\t\t\tponged = true;\n\t\t\t\t} else if(!validResponse) {\n\t\t\t\t\tsynchronized (this) {\n\t\t\t\t\t\tresponse = message;\n\t\t\t\t\t\tvalidResponse = true;\n\t\t\t\t\t\tnotifyAll();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} catch (IOException e) {\n\t\t\t\tThread t = new Thread(this::disconnect);\n\t\t\t\tt.start();\n\t\t\t\ttry {\n\t\t\t\t\tt.join();\n\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\tresponse = null;\n\t\t\t\t\tvalidResponse = true;\n\t\t\t\t\tnotifyAll();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void run() {\n this.running.set(true);\n Socket socket = null;\n // if flag is set to listen, keep listening for client connection request and keep accepting connections\n while (this.running.get()) {\n try {\n if (connectionCount.get() < Constants.MAX_CLIENT_CONNECTIONS) {\n socket = serverSocket.accept();\n socket.setSoTimeout(30000); // timeout set to 30,000 ms\n socket.setKeepAlive(true);\n log.info(\"Connection Accepted: Local Add {} Remote Add {}\", socket.getLocalAddress(),\n socket.getRemoteSocketAddress());\n // add the connected socket to the list\n socketList.add(socket);\n // Pass the socket to the RequestHandler thread for processing\n IncomingMessageHandler messageHandler = new IncomingMessageHandler(socket, logWriter, fileWriterQueue,\n periodicReportingService, orderShutdown);\n messageHandler.start();\n connectionCount.getAndIncrement();// increment connection count\n log.debug(\"Current number of connections {}\", connectionCount.get());\n } else {\n if(maxConnWarnCount < 4) {\n log.warn(\"Reached maximum connection limit {}; Stopping to accept more client connections\"\n , connectionCount.get());\n maxConnWarnCount++;\n }\n }\n } catch (IOException e) {\n log.error(\"Error in accepting connections\", e);\n if (e instanceof SocketException) {\n log.error(\"SocketException for remote connection\");\n }\n }\n }\n }",
"@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)\n public void run() {\n\n mBluetoothAdapter.cancelDiscovery();\n Log.i(\"Client\", \"trying to connect to server\");\n try {\n mSocket.connect();\n Log.i(\"Client\", \"connected\");\n\n isConnected = mSocket.isConnected();\n\n } catch (IOException connectException) {\n Log.i(\"Client\", \"fail io connect\");\n isConnected = false;\n\n try {\n mSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return;\n }\n //manageConnectedSocket(mSocket);\n if (isConnected()) {\n mTransferThread = new TransferThread(mSocket);\n mTransferThread.start();\n }else{\n makeToast(\"Please try connecting again\",Toast.LENGTH_LONG);\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tgotoConnectActivity();\n\t\t\t}",
"public void startReceiving() {\n\t\tHandlerThread handlerThread = new HandlerThread(\n\t\t\t\t\"DataExportationReceiverThread\");\n\t\thandlerThread.start();\n\t\tcallerContext.registerReceiver(this, new IntentFilter(\n\t\t\t\tDataExportationService.BROADCAST_ACTION), null, new Handler(\n\t\t\t\thandlerThread.getLooper()));\n\t}",
"public void startListener(){\n new Thread(() -> this.run()).start();\n }",
"public void startConnection(){\n EditText editText = (EditText) findViewById(R.id.ipAddress);\n final String ipAddress = editText.getText().toString();\n new Thread(new Runnable() {\n public void run() {\n try {\n System.out.println(ipAddress);\n Socket client = new Socket(ipAddress, 5000);\n System.out.println(\"connected\");\n OutputStream outToServer = client.getOutputStream();\n DataOutputStream out = new DataOutputStream(outToServer);\n EditText userNameText = (EditText) findViewById(R.id.UserName);\n final String userName = userNameText.getText().toString();\n out.writeUTF(userName);\n InputStream inFromServer = client.getInputStream();\n BufferedReader in = new BufferedReader(new InputStreamReader(inFromServer));\n SocketSingleton.setSocket(client);\n while (!in.ready()) {\n String readline = in.readLine();\n System.out.println(readline);\n if (\"success\".equals(readline)){\n Intent intent = new Intent(ConnectToComputer.this, RemoteActivity.class);\n startActivity(intent);\n } else {\n System.out.println(in.readLine());\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }).start();\n }"
] | [
"0.68751717",
"0.6781187",
"0.67492193",
"0.63325346",
"0.62676334",
"0.61923456",
"0.618097",
"0.6005441",
"0.59469354",
"0.5890078",
"0.5840878",
"0.5792018",
"0.5786389",
"0.5687796",
"0.5672202",
"0.5635118",
"0.56221753",
"0.5613316",
"0.56086224",
"0.56083995",
"0.5595572",
"0.5583478",
"0.55819863",
"0.5559251",
"0.5546612",
"0.55464745",
"0.5533514",
"0.5512406",
"0.55070794",
"0.5482241",
"0.5478865",
"0.5476941",
"0.5464811",
"0.545708",
"0.5453306",
"0.54293025",
"0.5428276",
"0.5418304",
"0.5404836",
"0.5404172",
"0.53988236",
"0.5395533",
"0.5391058",
"0.53893006",
"0.53815264",
"0.5361019",
"0.535926",
"0.53588235",
"0.5331378",
"0.53274256",
"0.5320971",
"0.5315753",
"0.5312515",
"0.5291803",
"0.5291604",
"0.52818954",
"0.5278014",
"0.5278014",
"0.52748275",
"0.527218",
"0.52613235",
"0.526112",
"0.5251776",
"0.52439654",
"0.52420425",
"0.52301884",
"0.5226773",
"0.52236086",
"0.52220327",
"0.5215121",
"0.5214202",
"0.52123004",
"0.5204545",
"0.52000105",
"0.5197524",
"0.5196898",
"0.51892084",
"0.518219",
"0.5179048",
"0.5172043",
"0.51693714",
"0.5168206",
"0.5168077",
"0.5161484",
"0.5161104",
"0.51548135",
"0.5149431",
"0.5144437",
"0.5144437",
"0.51275975",
"0.51269996",
"0.5126676",
"0.51265615",
"0.5119999",
"0.5119803",
"0.51160145",
"0.5114971",
"0.5109774",
"0.5105275",
"0.51041615",
"0.5101991"
] | 0.0 | -1 |
Stop a blocking server Socket | @Override
public void stopEndpoint() {
if (!isRunning()) {
return;
}
setRunning(false);
try {
try{
if ( getServerSocket() != null ) {
getServerSocket().close();
}
} catch (Throwable t){
getLogger().log(Level.SEVERE,
"selectorThread.closeSocketException", t);
}
unregisterComponents();
clearTasks();
} catch (Throwable t) {
getLogger().log(Level.SEVERE,"selectorThread.stopException", t);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void stopServer() {\n\t\tthis.running=false;\t\t\t\t\t\t\t//the loop of the thread fails\n\t\ttry {\n\t\t\tthis.socket.close();\t\t\t\t\t//closes the socket\n\t\t}catch (Exception e) {\n\t\t\tSystem.out.println(\"TCPServer : Socket non fermé\");\n\t\t}\n\t}",
"public void stopServer() throws IOException {\r\n b = false;\r\n serverSocket.close();\r\n }",
"public void stop() {\n\t\ttry {\n\t\t\tif (serverSocket != null)\n\t\t\t\tserverSocket.close();\n\t\t} catch (IOException ioe) {\n\t\t\t// shouldn't happen\n\t\t}\n\t}",
"public void stop() {\n tcpServer.stopServer();\n ThreadExecutor.shutdownClient(this.getClass().getName());\n }",
"protected void stop() {\n keepGoing = false;\n try {\n new Socket(\"localhost\", port);\n }\n catch(Exception e) {\n e.printStackTrace();\n }\n }",
"public void stop() {\n while (currentState.get() == ServerConstants.SERVER_STATUS_STARTING) {\r\n try {\r\n Thread.sleep(500);\r\n } catch (InterruptedException e) {\r\n // Ignore.\r\n }\r\n }\r\n\r\n if (currentState.compareAndSet(ServerConstants.SERVER_STATUS_STARTED, ServerConstants.SERVER_STATUS_OFF)) {\r\n try {\r\n bossGroup.shutdownGracefully();\r\n workerGroup.shutdownGracefully();\r\n connectionPool.shutdownAll();\r\n\r\n failedTimes.set(0);\r\n\r\n logger.info(\"Netty server stopped\");\r\n } catch (Exception ex) {\r\n logger.warn(\"Failed to stop netty server (port={}), exception:\", port, ex);\r\n }\r\n }\r\n }",
"public void stop() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tif (socket != null) {\n\t\t\t\tsocket.close();\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"Socket closed.\");\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-1);\n\t\n\t\t}\n\t}",
"public void stop() {\n\t\tstopFlag.set(true);\n\t\tif (serverStarted.get()) {\n\t\t\tnotifyListener(\"About to stop server. \" + toString());\n\t\t\ttry {\n\t\t\t\tserverActivity.get();\n\t\t\t\tserverSocket.close();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tnotifyListener(\"Interrupted whilst waiting for the server start to finish. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (ExecutionException e) {\n\t\t\t\tnotifyListener(\"Server start caused exception. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t} catch (IOException e) {\n\t\t\t\tnotifyListener(\"Unable to close cleanly the server socket. [message=\" + e.getMessage() + \"]\" + toString());\n\t\t\t}\n\t\t\tserverStarted.set(false);\n\t\t} else {\n\t\t\tnotifyListener(\"Server already stopped. \" + toString());\n\t\t}\n\t}",
"protected void stop() {\n keepGoing = false;\n // connect to myself as Client to exit\n try {\n new Socket(\"localhost\", port);\n } catch(Exception e) {\n // exception handling\n }\n }",
"public void stop() throws IOException {\n kv_out.println_debug(\"Try to stop the handler\");\n isRunning = false;\n serverSocket.close();\n }",
"public void stopClient() {\r\n\r\n // send message that we are closing the connection\r\n mRun = false;\r\n\r\n if (mBufferOut != null) {\r\n mBufferOut.flush();\r\n mBufferOut.close();\r\n }\r\n\r\n try {\r\n if (mBufferIn != null) {\r\n mBufferIn.close();\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.d(TAG, \"error closing input buffer: \" + e.getMessage());\r\n }\r\n\r\n try {\r\n if (socket != null) {\r\n socket.close();\r\n Log.i(TAG, \"Socket closed in stopClient\");\r\n }\r\n }\r\n catch (IOException e) {\r\n Log.e(TAG, \"error closing socket: \" + e.getMessage());\r\n }\r\n\r\n mMessageListener = null;\r\n mBufferIn = null;\r\n mBufferOut = null;\r\n mServerMessage = null;\r\n }",
"public void closeSocket () \n {\n try {\n // close the open server socket\n server.close();\n // send it a message to make it stop waiting immediately\n // (not really necessary)\n /*Socket s = new Socket(\"localhost\", thisPort);\n OutputStream os = s.getOutputStream();\n os.write((byte)0);\n os.close();\n s.close();*/\n } catch(Exception ex) { \n LOG.warn(\"Exception while shutting down \"+ this.getClass(), ex);\n }\n \n server = null;\n }",
"public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }",
"private void stopServer() {\n\t\tlogger.trace(\"stopServer() is called\");\n\n\t\tif (socketListeningTask != null){\n\t\t\tsocketListeningTask.stopServer();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t//Sleep time is needed to prevent connection counter being reset too soon before socketListeningTask.stopServer() is completed. Sleep time may need to be increased if not enough.\n\t\t\t\tThread.sleep(200);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tSystem.err.println(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t\tlogger.error(\"thread sleep method of KKServerGUI is being interrupted.\");\n\t\t\t}\n\t\t\t\n\t\t\tConnectionCounter.resetConnectionCounter();\n\t\t\tsocketListeningTask = null;\n\t\t\tserverStatusLabel.setText(serverStopped);\n\t\t\ttotalClientConectionLabel.setText(\"Client connections: 0\");\n\n\t\t\tstartServerToolBarButton.setEnabled(true);\n\t\t\tstopServerToolBarButton.setEnabled(false);\n\n\t\t\tconnectionCheckingTask.stopCheckingConnection();\n\t\t}\n\t}",
"public void stop() {\n System.err.println(\"Server will stop\");\n server.stop(0);\n }",
"public synchronized void disconnect()\r\n\t\t{\r\n\t\tif (state == RUNNING)\r\n\t\t stop();\r\n\t\tif (state == CLOSING_DOWN)\r\n\t\t {\r\n // Close the server socket\t\t \r\n try {\r\n \t\tserverSocket.close();\r\n \t}\r\n catch (IOException e)\r\n {\r\n }\r\n \r\n \t\t// flag the server as stopped\r\n \t\tstate = STOPPED;\r\n\t\t }\r\n\t\t}",
"@Override\n public void stop() {\n try {\n serverSocket.close();\n }\n catch (IOException e) {\n getExceptionHandler().receivedException(e);\n }\n\n // Close all open connections.\n synchronized (listConnections) {\n for (TcpConnectionHandler tch : listConnections)\n tch.kill();\n listConnections.clear();\n }\n\n // Now close the executor service.\n executorService.shutdown();\n try {\n executorService.awaitTermination(3, TimeUnit.SECONDS);\n }\n catch (InterruptedException e) {\n getExceptionHandler().receivedException(e);\n }\n }",
"public void cancel() {\r\n mStopped = true;\r\n try {\r\n mSocket.close();\r\n } catch (IOException ioe) {\r\n Log.e(Common.TAG, \"Error closing the socket: \" + ioe.getMessage());\r\n }\r\n }",
"public void serverStop() {\n\t\tJOptionPane.showMessageDialog(dlg, \"与服务器失去连接\");\n\t\tserver = null;\n\t\tconnectAction.setEnabled(false);\n\t\t\n\t}",
"public void stop() {\n server.stop();\n }",
"public void cancel() {\n try {\n\n mServerSocket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void stopServer() {\n stop();\n }",
"public void stop() {\n \n // first interrupt the server engine thread\n if (m_runner != null) {\n m_runner.interrupt();\n }\n\n // close server socket\n if (m_serverSocket != null) {\n try {\n m_serverSocket.close();\n }\n catch(IOException ex){\n }\n m_serverSocket = null;\n } \n \n // release server resources\n if (m_ftpConfig != null) {\n m_ftpConfig.dispose();\n m_ftpConfig = null;\n }\n\n // wait for the runner thread to terminate\n if( (m_runner != null) && m_runner.isAlive() ) {\n try {\n m_runner.join();\n }\n catch(InterruptedException ex) {\n }\n m_runner = null;\n }\n }",
"private void stopClient() {\n\n run = false;\n\n if (bufferOut != null) {\n bufferOut.flush();\n bufferOut.close();\n }\n\n messageListener = null;\n bufferIn = null;\n bufferOut = null;\n serverMessage = null;\n }",
"public void stop() throws IOException, InterruptedException\n\t{\n\t\t// Set the terminating signal. 11/25/2014, Bing Li\n\t\tTerminateSignal.SIGNAL().setTerminated();\n\t\t// Close the socket for the server. 08/10/2014, Bing Li\n\t\tthis.socket.close();\n\t\t\n\t\t// Stop all of the threads that listen to clients' connecting to the server. 08/10/2014, Bing Li\n\t\tfor (Runner<MyServerListener, MyServerListenerDisposer> runner : this.listenerRunnerList)\n\t\t{\n\t\t\trunner.stop();\n\t\t}\n\n\t\t// Shutdown the IO registry. 11/07/2014, Bing Li\n\t\tMyServerIORegistry.REGISTRY().dispose();\n\t\t\n\t\t// Shut down the client pool. 09/17/2014, Bing Li\n\t\tClientPool.SERVER().dispose();\n\t}",
"public void stopCommunicationServer() {\n\t\t\tthis.running = false;\n\t\t}",
"public static void stopServer() {\n try {\n clientListener.stopListener();\n server.close();\n connectionList.clear();\n } catch (IOException ex) {\n System.err.println(\"Error closing server: \\\"\" + ex.getMessage() + \"\\\"\");\n }\n System.out.println(\"SERVER SHUT DOWN\");\n }",
"public void stopListening() {\n new Thread(new Runnable() {\n @Override\n public void run() {\n synchronized (ConnectionServer.this) {\n if (mAcceptThread != null) {\n mAcceptThread.cancel();\n mAcceptThread = null;\n }\n }\n }\n }).start();\n }",
"public void stopClient() {\n if (sendToSocket != null) {\n try {\n sendToSocket.flush();\n sendToSocket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n readFromSocket = null;\n sendToSocket = null;\n }",
"public void kill() {\n this.server.stop();\n }",
"public void stopServer() {\r\n\t\tserverRunning = false;\r\n\t}",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) { }\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) { }\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException ignored) { }\n }",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tmmServerSocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}",
"public void Stop(){\r\n\t\trunning = false;\r\n\t\thelp.print(\"Closing server, waiting for workers to complete\");\r\n\t}",
"public void Stop() throws IOException {\n DisposeServer();\n }",
"public void stop() {\n if (server != null) {\n server.shutdown();\n }\n }",
"@Override\n public void stop() {\n try {\n socket.close();\n } catch (IOException e) {\n getExceptionHandler().receivedException(e);\n }\n\n // Now close the executor service.\n\n }",
"public void sendStop(){\n if (isNetworkGame()){\n sender.println(\"stop\");\n sender.flush();\n }\n }",
"public void stopServer() throws IOException {\n\t\tlistenThread.interrupt();\n\t\tlistenSocket.close();\n\t\tfor(TestInstance t: testInstances) t.abortTest();\n\t}",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) { }\n }",
"public void halt() {\n closeSocket(sock1);\n closeSocket(sock2);\n }",
"public void stopInbound();",
"private void stopServer() {\n\t\ttry {\n//\t\t\tserver.shutdown();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}",
"public void cancel() {\n stopThread = true;\n\t\ttry {\n\t\t\tmmSocket.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public void stop () {\n if (server != null)\n server.shutDown ();\n server = null;\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n mmServerSocket=null;\n } catch (IOException e) { }\n }",
"public void cancel(){\r\n\t\t\r\n\t\ttry{\t\t\t\r\n\t\t\t// Stop the runnable job\r\n\t\t\trunning = false;\r\n\t\t\tjoin(1000);\r\n\t\t\t\r\n\t\t\t// Close socket\r\n\t\t\toSocket.close();\r\n\t\t\t\r\n\t\t}catch(InterruptedException e1){\r\n\t\t\tLog.e(TAG, \"terminating tread failed\", e1);\r\n\t\t}catch (IOException e2) {\r\n\t\t\tLog.e(TAG, \"cancel(), closing socket failed\", e2);\r\n\t\t}\t\r\n\t}",
"public void stop() {\n\t\tgetLogger().debug(\"Waiting 5 seconds for EVCC to process response and close TCP/TLS connection ...\");\n\t\ttry {\n Thread.sleep(5000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\t\t\n\t\tif (!isStopAlreadyInitiated()) {\n\t\t\tgetLogger().debug(\"Closing connection to client ...\");\n\t\t\tsetStopAlreadyInitiated(true);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tgetInStream().close();\n\t\t\t\tgetOutStream().close();\n\t\t\t\t\n\t\t\t\tif (getTcpClientSocket() != null) {\n\t\t\t\t\tgetTcpClientSocket().close();\n\t\t\t\t} else if (getTlsClientSocket() != null) {\n\t\t\t\t\tgetTlsClientSocket().close();\n\t\t\t\t} else {\n\t\t\t\t\tgetLogger().error(\"Neither TCP nor TLS client socket could be closed\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tThread.currentThread().interrupt();\n\t\t\t\tgetLogger().debug(\"Connection to client closed\");\n\t\t\t} catch (IOException e) {\n\t\t\t\tgetLogger().error(\"Error occurred while trying to close socket to client\", e);\n\t\t\t} \n\t\t}\n\t}",
"public void shutdown() {\n try {\n \t\n \tserverSocket.close();\n \t\n } catch (Exception e) {\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) {\n Log.e(\"TEST\", \"Could not close the connect socket\", e);\n }\n\n }",
"public synchronized void stop() {\r\n\t\t//TODO read why stop is deprecated http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html\r\n\t\tif (udplistener != null) {\r\n\t\t\tudplistener.datagramSocket.close();\r\n\t\t\tudpthread.stop();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (tcplistener != null) {\r\n\t\t\t\ttcplistener.serverSocket.close();\r\n\t\t\t\ttcpthread.stop();\r\n\t\t\t}\r\n\t\t} catch (IOException e) {e.printStackTrace();}\t\t\r\n\t}",
"public void stopListening() {\n try {\n mListenerSocket.close();\n } catch (IOException e) {\n // just log\n Log.e(\"LanConnection\",\"Error closing listener socket at \" + LOCAL_PORT, e);\n }\n }",
"public void stopLocalServer() {\n \t\tif (thread != null) {\n \t\t\tthread.stopProcess();\n \t\t\tthread.interrupt();\n \t\t\tthread = null;\n \t\t\tSystem.out.println(addeMcservl + \" was stopped\");\n \t\t} else {\n \t\t\tSystem.out.println(addeMcservl + \" is not running\");\n \t\t}\n \t}",
"public void stopNetwork();",
"public void stopConnection() throws IOException {\n in.close();\n out.close();\n clientSocket.close();\n }",
"public void terminate () {\n active = false;\n try { server_socket.close (); } catch (IOException e) {}\n yield ();\n }",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) {\n showToast(\"Could not close the server socket.\");\n }\n }",
"private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public void stopDiscoverability() {\r\n this.findableServerThread.interrupt();\r\n }",
"private void stop() {\n if (client != null) {\n this.client.close();\n }\n }",
"public void close(){\n\t\tlog.debug(\"[SC] Close called\", 5);\n\t\tif(socket!=null){\n\t\t\tlog.debug(\"[SC] Closing socket\", 4);\n\t\t\ttry {\n\t\t\t\tThread.sleep(10);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t//Silly impatient thread\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tout.close();\n\t\t\t\tin.close();\n\t\t\t\tsocket.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t//we're going to close it anyway\n\t\t\t}\n\t\t\tsocket = null;\n\t\t\trun = false;\n\t\t}\n\t}",
"public void stop() {\n try {\n getXMPPServer().stop();\n }\n catch (Exception e) {\n Log.error(e.getMessage(), e);\n }\n sleep();\n }",
"public void stopSending ();",
"public void shutdown() {\n\t\tserver.stop(0);\n\t}",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t//pass\r\n\t\t\t}\r\n\t\t}",
"public void stopListening();",
"private void disconnect()\r\n\t{\r\n\t\tif (theSocket != null)\r\n\t\t{\r\n\t\t\ttheSocket.transmit(\"Disconnecting\");\r\n\t\t\twriteLine(\"Disconnecting...\", 0);\r\n\t\t\twriteLine(\"Closing socket\", 0);\r\n\t\t\ttheSocket.close();\r\n\t\t\ttheSocket = null;\r\n\t\t}\r\n\t\tif (theSocket == null)\r\n\t\t{\r\n\t\t\twriteLine(\"The Socket is null\", 0);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twriteLine(\"We have now disconnected\", 0);\r\n\t\t}\r\n\t\trunning = false;\r\n\t}",
"public void cancel() {\n try {\n mmServerSocket.close();\n } catch (IOException e) {\n Log.e(TAG, \"Could not close the connect socket\", e);\n }\n }",
"public synchronized void shutdown() {\n server.stop();\n }",
"private void stopServer() {\n if (mBluetoothGattServer == null) return;\n\n mBluetoothGattServer.close();\n }",
"public void cancel() {\r\n\t\t\ttry {\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}",
"public void cancel() {\n try {\n mSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void close() throws IOException {\n if (!serverSocket.isClosed()) {\n log.info(\"Closing listener on {}\", serverSocket.getLocalSocketAddress());\n runningThread.interrupt();\n serverSocket.close();\n }\n }",
"@Deactivate\n public void deactivate()\n {\n try\n {\n m_ServerSocket.close();\n }\n catch (final Exception e)\n {\n m_Logging.error(e, \"Unable to close server socket\");\n }\n \n try\n {\n m_ServerSocketThread.join(THREAD_JOIN_TIMEOUT);\n }\n catch (final InterruptedException e)\n { \n m_Logging.info(\"Server socket interrupted while joining thread\");\n }\n }",
"public void cancel() {\n try {\n bluetoothServerSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"public void shutDown()\n {\n stunStack.removeSocket(serverAddress);\n messageSequence.removeAllElements();\n localSocket.close();\n }",
"public void cancel() throws IOException {\n if (v) Log.d(TAG, \"cancel() thread server\");\n\n // Use iterator to\n Iterator iterator = arrayThreadClients.iterator();\n while (iterator.hasNext()) {\n ThreadClient threadClient = (ThreadClient) iterator.next();\n // Stop all threads client\n if (v) Log.d(TAG, \"STOP thread \" + threadClient.getNameThread());\n threadClient.interrupt();\n }\n\n // Clear the array of threads\n arrayThreadClients.clear();\n\n // Close the server socket to throw an exception and thus stop the server thread\n serverSocket.close();\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic void stopUDPTask() {\r\n // Interrupt the thread so it unblocks any blocking call\r\n \tif (UDPServerThread.isInterrupted()) {\r\n \t\tif (!this.udpSocket.isClosed()){\r\n \t\t\tthis.udpSocket.close();\r\n \t\t}\r\n \t\tldt= LocalDateTime.now();\r\n \t\tstateLogTime.add(ldt.toString());\r\n \t\tstateLogEvent.add(\"Server stopped\");\r\n\t\t\tsaveFiles(1);\r\n \t\tSystem.out.println(\"Server : isInterrupted \");\r\n \t\tsetChanged();\r\n \t \tnotifyObservers(isRunning);\r\n \t\t}\r\n \t\r\n \telse {\r\n \t\tisRunning= false;\r\n \t\tUDPServerThread.interrupt();\r\n \t\ttimer.cancel();\r\n \t\t//if (SimpleTimer.isRunning()) SimpleTimer.stop();\r\n \t}\r\n \t\r\n // Wait until the thread exits\r\n try {\r\n \t //System.out.println(\"Server : Before Join \");\r\n \t UDPServerThread.join(2000);\r\n \t System.out.println(\"Server : Stopped successfully\");\r\n \t //System.out.println(\"Server : After Join \");\r\n } catch (InterruptedException ex) {\r\n // Unexpected interruption\r\n \t System.out.println(\"Error : \" + ex);\r\n \t ex.printStackTrace();\r\n \t System.exit(1);\r\n }\r\n }",
"public Future<MockServerClient> stopAsync() {\n return stop(true);\n }",
"public void stop() throws InterruptedException {\n if (server != null) {\n server.shutdown().awaitTermination(Constants.DEFAULT_SERVER_TIMEOUT, TimeUnit.SECONDS);\n }\n }",
"protected void stopThread() {\n\t\t_running = false;\n\t\t\n\t\tfor (ClientHandler client : _connectedClients) {\n\t\t\tif (client != null && client.isAlive()) {\n\t\t\t\tclient.stopThread();\n\t\t\t\ttry {\n\t\t\t\t\tclient.join();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tSystem.out.println(\"Client listener: Error while stopping client.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static void stopServer()\n {\n keepRunning = false;\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Stop server!\");\n }",
"@ReactMethod\n public void stop() {\n ChirpError error = chirpConnect.stop();\n if (error.getCode() > 0) {\n onError(context, error.getMessage());\n } else {\n isStarted = false;\n }\n }",
"public void shutDownServer(boolean countdown) throws IOException {\r\n \t\tthis.isAlive = false;\r\n \r\n \t\tif (countdown) {\r\n \t\t\ttry {\r\n \t\t\t\tint totalSecondsToWait = 10000;\r\n \t\t\t\tint decrease = 1000;\r\n \r\n \t\t\t\twhile (totalSecondsToWait > 0) {\r\n \t\t\t\t\tthis.serverSendMessageToAllUsers(\"Server will be shut down in \" + totalSecondsToWait / 1000 + \" seconds...\");\r\n \t\t\t\t\tThread.sleep(decrease);\r\n \t\t\t\t\ttotalSecondsToWait -= decrease;\r\n \t\t\t\t}\r\n \t\t\t} catch (Exception ex) {\r\n \r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\t// Close streams and connections to all clients\r\n \t\tfor (RoMClient client : this.clients.getClients()) {\r\n \t\t\tclient.getOutputStream().close();\r\n \t\t\tclient.getInputStream().close();\r\n \t\t\tclient.getSocket().close();\r\n \t\t}\r\n \r\n \t\t// Close server socket\r\n \t\tthis.serverSocket.close();\r\n \t}",
"public synchronized static void stopWork() {\r\n if (!stopping_work) {\r\n stopping_work = true;\r\n SlaveJvm.sendMessageToMaster(SocketMessage.STOP_NEW_IO);\r\n }\r\n }",
"protected final void disconnect() {\n\t\trunning = false;\n\t\ttry {\n\t\t\tif (out != null)\n\t\t\t\tout.close();\n\t\t\tif (in != null)\n\t\t\t\tin.close();\n\t\t\tsocket.close();\n\t\t} catch (IOException e) {e.printStackTrace();}\n\t}",
"void stop() throws IOException;",
"public void\n stop() throws IOException;",
"public void closeServer()\n\t{\n\t\t//System.out.println(\"*********Beginning Close Operations*********\");\n\n\t\ttry {\n\t\t\t//System.out.println(\"***********Closing client socket*************\");\n\t\t\tthis.closeClientConnection();\n\t\t\tstringFile.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\tisRunning = false;\n\t\t//System.out.println(\"Ending server....\");\n\t}",
"public void notifyServerStop(String msg);",
"synchronized public boolean stop() {\n if (standalone && zkServerMain != null) {\n zkServerMain.doShutdown();\n }\n if (!standalone && quorumPeer != null) {\n quorumPeer.doShutdown();\n }\n boolean ret = waitForServerDown(\"0.0.0.0\", config.getClientPortAddress()\n .getPort(), 5000);\n quorumPeer = null;\n zkServerMain = null;\n return ret;\n }",
"public void stop() {}",
"public synchronized void shutdown() {\n // mark this as no longer running\n active = false;\n\n // close the socket\n try {\n if (socketNode != null) {\n socketNode.close();\n socketNode = null;\n }\n } catch (Exception e) {\n getLogger().info(\"Excpetion closing socket\", e);\n // ignore for now\n }\n\n // stop the connector\n if (connector != null) {\n connector.interrupted = true;\n connector = null; // allow gc\n }\n if (advertiseViaMulticastDNS) {\n zeroConf.unadvertise();\n }\n }",
"@Override\n public void close() throws IOException\n {\n debug(\"Dispose remote console server.\");\n // this method tries its best and as a least resort uses thread interruption\n synchronized(this) {\n try {\n // try to break server.accept in order to force queue reading on thread\n Socket socket = new Socket();\n socket.connect(new InetSocketAddress(port), 500);\n socket.close();\n }\n catch(IOException e) {\n error(e);\n }\n\n queue.clear();\n queue.offer(SHUTDOWN);\n\n try {\n wait(SHUTDOWN_TIMEOUT);\n }\n catch(InterruptedException unused) {\n thread.interrupt();\n }\n }\n }",
"public void stopClient() {\n\n Log.d(TAG, \"Client is stopping...\");\n\n isRuning = false;\n\n if (null != sendBuffer) {\n sendBuffer.flush();\n sendBuffer.close();\n }\n\n messageListener = null;\n receiveBuffer = null;\n sendBuffer = null;\n lastReceivedCommand = null;\n }",
"void stop(long timeout);",
"private void disconnectFromServer() {\n\t\ttry {\n\t\t\tsocket.close();\n\t\t}\n\t\tcatch(IOException e) {\n\t\t\tSystem.out.println(\"CLIENT: Cannot disconnect from server\");\n\t\t}\n\t}",
"public void stop() throws InterruptedException {\n if (server != null) {\n server.shutdown().awaitTermination(30, TimeUnit.SECONDS);\n }\n }"
] | [
"0.81005925",
"0.758738",
"0.757424",
"0.74346423",
"0.74051625",
"0.7306407",
"0.7274481",
"0.72620755",
"0.72136724",
"0.71822655",
"0.7148603",
"0.71317655",
"0.71266246",
"0.71116924",
"0.70876306",
"0.70796216",
"0.7020113",
"0.70065796",
"0.6989178",
"0.6969629",
"0.69586045",
"0.69527566",
"0.689545",
"0.687526",
"0.6859054",
"0.68576646",
"0.6846211",
"0.684328",
"0.6835193",
"0.6828881",
"0.68177587",
"0.68161625",
"0.68161625",
"0.68043345",
"0.6802236",
"0.679146",
"0.6789725",
"0.67705745",
"0.674738",
"0.67326605",
"0.67320865",
"0.6729876",
"0.6688004",
"0.6673538",
"0.6670962",
"0.6667968",
"0.66531825",
"0.66313636",
"0.65679127",
"0.6565871",
"0.6565069",
"0.65592116",
"0.6553895",
"0.6510826",
"0.65090567",
"0.65071183",
"0.6506156",
"0.6492212",
"0.6478403",
"0.6452883",
"0.64526796",
"0.64510983",
"0.6441908",
"0.6435071",
"0.6431966",
"0.64232904",
"0.64134264",
"0.64053565",
"0.64045274",
"0.63876325",
"0.63848126",
"0.6371873",
"0.63627255",
"0.63617927",
"0.63525254",
"0.6344754",
"0.63291526",
"0.63219947",
"0.6318499",
"0.6313923",
"0.6299412",
"0.62947196",
"0.62928873",
"0.6274596",
"0.6256743",
"0.62461686",
"0.6244076",
"0.62427187",
"0.62216574",
"0.6220216",
"0.6217659",
"0.6213548",
"0.6204358",
"0.6203584",
"0.61889195",
"0.6188288",
"0.61865324",
"0.61815715",
"0.6178607",
"0.6174526"
] | 0.67436844 | 39 |
Start a blocking server Socket | @Override
protected void startListener(){
Socket socket = null;
while (isRunning()){
socket = acceptSocket();
if (socket == null) {
continue;
}
try {
handleConnection(socket);
} catch (Throwable ex) {
getLogger().log(Level.FINE,
"selectorThread.handleConnectionException",
ex);
try {
socket.close();
} catch (IOException ioe){
// Do nothing
}
continue;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void start() {\n\t\tscavenger.start();\r\n\t\tnew Thread() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\twhile (!serverSocket.isClosed()) {\r\n\t\t\t\t\tSocket socket = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsocket = serverSocket.accept();\r\n\t\t\t\t\t\tscavenger.addSocket(socket);\r\n\t\t\t\t\t\tnew SynchronousSocketThread(socket).start();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\t}",
"public void start() {\n\t\tif (serverStarted.get()) {\n\t\t\tthrow new IllegalStateException(\"Server already started. \" + toString());\n\t\t}\n\t\tCallable<Boolean> task;\n\t\ttry {\n\t\t\tserverSocket = new ServerSocket(port);\n\t\t\tserverSocket.setSoTimeout(soTimeout);\n\t\t\tport = serverSocket.getLocalPort();\n\t\t\tnotifyListener(\"Server started. \" + toString());\n\t\t\tserverStarted.set(true);\n\t\t\ttask = new Callable<Boolean>() {\n\t\n\t\t\t\tpublic Boolean call() {\n\t\t\t\t\tnotifyListener(\"Starting server thread. \" + toString());\n\t\t\t\t\tstopFlag.set(false);\n\t\t\t\t\twhile (!stopFlag.get()) {\n\t\t\t\t\t\tSocket connection = null;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnection = serverSocket.accept();\n\t\t\t\t\t\t\tnotifyListener(\"Connection accepted on port. \" + toString());\n\t\t\t\t\t\t\tconnection.close();\n\t\t\t\t\t\t\tnotifyListener(\"Connection closed on port. \" + toString());\n\t\t\t\t\t\t\tpingCounter.incrementAndGet();\n\t\t\t\t\t\t} catch (SocketTimeoutException e) {\n\t\t\t\t\t\t\tnotifyListener(\"Server accept timed out. Retrying. \" + toString());\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\tnotifyListener(\"Server accept caused exception [message=\" + e.getMessage() + \"]. Retrying. \" + toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tnotifyListener(\"Server socket closed. \" + toString());\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t};\n\t\t} catch (IOException e) {\n\t\t\tstopFlag.set(true);\n\t\t\tthrow new IllegalStateException(\"Unable to open socket on port. \" + toString(), e);\n\t\t}\n\t\tserverActivity = scheduler.submit(task);\n\t\tnotifyListener(\"Waiting for server to fully complete start. \" + toString());\n\t\tfor (;;) {\n\t\t\ttry {\n\t\t\t\tThread.sleep(100);\n\t\t\t\tif (isStarted()) {\n\t\t\t\t\tnotifyListener(\"Server started. \" + toString());\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} catch (InterruptedException e) {\n\n\t\t\t}\n\t\t}\n\t}",
"private void startNonBlockingListen() throws Exception {\n nioServer = new NioServer(null,8880);\n serverThread = (new Thread(nioServer));\n serverThread.setName(\"Server Thread\");\n serverThread.setDaemon(true);\n serverThread.start();\n }",
"public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}",
"public void startServer(){\r\n try {\r\n\r\n while(true){\r\n\r\n s = sc.accept();\r\n new ServerThread(s).start();\r\n }\r\n }\r\n catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n finally {\r\n try {\r\n sc.close();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n }",
"public void start() {\n\t\t\n\t\ttry {\n\t\t\tmainSocket = new DatagramSocket(PORT_NUMBER);\n\t\t}\n\t\tcatch(SocketException ex) {\n\t\t\tex.printStackTrace();\n\t\t}\n\t\t\n\t\t//Lambda expression to shorten the run method\n\t\tThread serverThread = new Thread( () -> {\n\t\t\tlisten();\n\t\t});\n\t\t\n\t\tserverThread.start();\n\t}",
"public void start()\r\n\t\t{\r\n\t\tDebug.assert(serverSocket != null, \"(Server/123)\");\r\n\r\n \t// flag the server as running\r\n \tstate = RUNNING;\r\n\r\n // Loop while still listening, accepting new connections from the server socket\r\n while (state == RUNNING)\r\n \t{\r\n // Get a connection from the server socket\r\n\t\t\tSocket socket = null;\r\n\t\t\ttry {\r\n socket = serverSocket.accept();\r\n \tif (state == RUNNING) \r\n \t createLogin(socket);\r\n }\r\n \r\n // The socket timeout allows us to check if the server has been shut down.\r\n // In this case the state will not be RUNNING and the loop will end.\r\n\t\t catch ( InterruptedIOException e )\r\n\t\t \t{\r\n\t\t \t// timeout happened\r\n\t\t \t}\r\n\t\t \r\n\t\t // This shouldn't happen...\r\n \t catch ( IOException e )\r\n \t \t{\r\n log(\"Server: Error creating Socket\");\r\n \t \tDebug.printStackTrace(e);\r\n \t }\r\n\t }\r\n\t \r\n\t // We've finished, clean up\r\n disconnect();\r\n\t\t}",
"private void runServer() {\n while(true) {\n // This is a blocking call and waits until a new client is connected.\n Socket clientSocket = waitForClientConnection();\n handleClientInNewThread(clientSocket);\n } \n }",
"public static void startServer() throws IOException {\n ServerSocket serverSocket = new ServerSocket(port_number);\n\n System.out.println(\"Server Up\");\n System.out.println(\"Port number: \" + port_number);\n\n Thread loop = loopClients(serverSocket);\n loop.start();\n\n while (running) {\n try {\n Thread.sleep(1000l);\n\n } catch (Exception e) {\n\n }\n }\n\n loop.stop();\n removeAllClients();\n }",
"public void start()\n {\n isRunning = true;\n try\n {\n //metoden opretter en ny socket for serveren på den valgte port\n ServerSocket serverSocket = new ServerSocket(port);\n //mens serveren kører venter den på en client\n while (isRunning)\n {\n serverDisplay(\"Serveren venter på clienter på port: \" + port);\n //accepterer clienten på socketen\n Socket socket = serverSocket.accept();\n\n if (!isRunning)\n {\n break;\n }\n // laver en ny thread til clienten med socketen der er blevet accepteret\n HandleClientThread handleClientThread = new HandleClientThread(socket);\n\n // her blever tråden tilføjet til arryet af clienter\n clientThreadArrayList.add(handleClientThread);\n // Starer handleclient tråden som håndtere clienter\n handleClientThread.start();\n }\n try\n {\n //Her lukker serveren socketen\n serverSocket.close();\n for (int i = 0; i < clientThreadArrayList.size() ; i++)\n {\n HandleClientThread hct = clientThreadArrayList.get(i);\n try\n {\n hct.inputStream.close();\n hct.outputStream.close();\n hct.socket.close();\n }\n catch (IOException e)\n {\n System.out.println(\"Uknowen command \" + e);\n }\n }\n }\n catch (Exception e)\n {\n serverDisplay(\"Kunne ikke lukke serveren og clienterne pga. \" + e);\n }\n }\n catch (IOException e)\n {\n String message = dateFormat.format(new Date()) + \"Fejl på ny server socket\" + e + \"\\n\";\n serverDisplay(message);\n }\n }",
"public void startClientServer() {\n try {\n this.server_socket = new ServerSocket( port );\n this.start();\n } catch (IOException e ) {\n System.err.println( \"Failure: Socket couldn't OPEN! -> \" + e );\n } finally {\n System.out.println( \"Success: Server socket is now Listening on port \" + port + \"...\" );\n }\n }",
"@Override\r\n\tpublic void start(Socket socket){}",
"public void start() throws IOException {\n ThreadExecutor.registerClient(this.getClass().getName());\n tcpServer.startServer();\n }",
"public void start(){\r\n\t\tLog.out(\"Start Service...listening on \" + port, 5);\r\n\t\ttry{\r\n\t\t\t//set up\r\n\t\t\tssocket = new ServerSocket(port);\r\n\t\t}catch(Exception e){\r\n\t\t\tLog.out(\"Can't open the port\", 5);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\ttry{\r\n\t\t\twhile(isRun){\r\n\t\t\t\t//accept socket request,but only one.\r\n\t\t\t\tSocket socket = ssocket.accept();\r\n\t\t\t\tLog.out(\"Got a socket from \"+socket.getLocalAddress(), 5);\r\n\t\t\t\t//if no client now\r\n\t\t\t\tif(clientSocket == null){\r\n\t\t\t\t\tLog.out(\"Handle as client.\", 4);\r\n\t\t\t\t\tclientSocket = socket;\r\n\t\t\t\t\tnew Thread(new ServiceReciever(this, socket)).start();\r\n\t\t\t\t\t\r\n\t\t\t\t}else{\r\n\t\t\t\t\tLog.out(\"The server is already in use,refuse the request.\",2);\r\n\t\t\t\t\tnew DataOutputStream(socket.getOutputStream()).writeInt(SOCKET_REFUSE);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}catch(Exception e){\r\n\t\t\tLog.out(\"There are something wrong when get the socket.\", 5);\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}",
"public void startServer() throws Exception\n {\n\t\t\tString SERVERPORT = \"ServerPort\";\n\t\t\tint serverport = Integer.parseInt(ConfigurationManager.getConfig(SERVERPORT));\n\t\t\t\n \n Srvrsckt=new ServerSocket ( serverport );\n while ( true )\n {\n Sckt =Srvrsckt.accept();\n new Thread ( new ConnectionHandler ( Sckt ) ).start();\n }\n \n \n\n\n }",
"private void startServer() throws IOException {\n while (true) {\n System.out.println(\"[1] Waiting for connection...\");\n\n client = server.accept();\n System.out.println(\"[2] Connection accepted from: \" + client.getInetAddress());\n\n in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n out = new PrintStream(client.getOutputStream(), true);\n\n while (!in.ready()) ;\n\n String line = in.readLine();\n ManageConnections connection = new ManageConnectionsFactory().getConnection(line);\n\n connection.goConnect(client, in, out);\n }\n }",
"private void startListen() {\n try {\n listeningSocket = new ServerSocket(listeningPort);\n } catch (IOException e) {\n throw new RuntimeException(\"Cannot open listeningPort \" + listeningPort, e);\n }\n }",
"public void creatSocket() {\n\n try {\n\n server = new ServerSocket(PORT);\n\n mExecutorService = Executors.newCachedThreadPool();\n\n while (true) {\n\n Socket client = server.accept();\n\n mExecutorService.execute(new SockectService(client));\n\n Log.d(TAG, \"Creating Socket\" );\n\n }\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }",
"public SocketServer() {\n \n super();\n start();\n\n }",
"public void startServer() {\n\r\n try {\r\n echoServer = new ServerSocket(port);\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n // Whenever a connection is received, start a new thread to process the connection\r\n // and wait for the next connection.\r\n while (true) {\r\n try {\r\n clientSocket = echoServer.accept();\r\n numConnections++;\r\n ServerConnection oneconnection = new ServerConnection(clientSocket, numConnections, this);\r\n new Thread(oneconnection).start();\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }\r\n\r\n }",
"public void startRunning(){\r\n\t\ttry{\r\n\t\t\twhile( true ){\r\n\t\t\t\tserver = new ServerSocket(PORT);\r\n\t\t\t\ttry{\r\n\t\t\t\t\twaitForClient(1);\r\n\t\t\t\t\twaitForClient(2);\r\n\t\t\t\t\tnew ServerThread(connectionClient1, connectionClient2, this).start();\r\n\t\t\t\t}\r\n\t\t\t\tcatch( EOFException e ){\r\n\t\t\t\t\tshowMessage(\"\\nServer ended the connection\");\r\n\t\t\t\t}\r\n\t\t\t\tfinally {\r\n\t\t\t\t\tserver.close();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch( IOException e ){\r\n\t\t}\r\n\t}",
"private void listen() {\n\t\ttry {\n\t\t\tServerSocket servSocket = new ServerSocket(PORT);\n\t\t\tSocket clientSocket;\n\t\t\twhile(true) {\n\t\t\t\tclientSocket = servSocket.accept();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error - Could not open connection\");\n\t\t}\n\t\t\n\t}",
"public void serve() throws IOException {\n int req = 0;\n while (req<maxreq) {\n //block intil a client connects\n final Socket socket = serversocket.accept();\n //create a new thread to handle the client\n\n Thread handler = new Thread(new Runnable() {\n public void run() {\n try {\n try {\n handle(socket);\n } finally {\n socket.close();\n }\n } catch (IOException ioe) {\n // this exception wouldn't terminate serve(),\n // since we're now on a different thread, but\n // we still need to handle it\n ioe.printStackTrace();\n }\n }\n });\n // start the thread\n handler.start();\n req++;\n }\n\n }",
"public void run() {\n\t\ttry {\n\t\t\tServerSocket listenSocket = new ServerSocket(port);\n\t\t\twhile (true) {\n\t\t\t\tSocket socket = listenSocket.accept();\n\t\t\t\t\n\t\t\t\tObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream());\n\t\t\t\toutput.flush();\n\t\t\t\tObjectInputStream input = new ObjectInputStream(socket.getInputStream());\n\t\t\t\t\n\t\t\t\tFSMessage message = FSMessage.readMessage(input);\n\t\t\t\t\n\t\t\t\tif (message.getType() == FSMessage.MESSAGE_SPREAD_REQ) {\n\t\t\t\t\t// Namenode wants to send a block to datanode.\n\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_SPREAD_REQ_ACK);\n\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\t\n\t\t\t\t\t// Open a new thread to receive the block.\n\t\t\t\t\tnew Thread(new BlockReceiver(socket.getInputStream(), message.getBlockID(), message.getLength(), message.getOffset())).start();\n\t\t\t\t} else if (message.getType() == FSMessage.MESSAGE_GETBLOCK_REQ) {\n\t\t\t\t\t// Clients wants to get a block with certain block ID.\n\t\t\t\t\tif (!blockMap.containsKey(message.getBlockID())) {\n\t\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_GETBLOCK_FAIL);\n\t\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t// Open a new thread to send the block.\n\t\t\t\t\tFSMessage ack = new FSMessage(FSMessage.MESSAGE_GETBLOCK_REQ_ACK);\n\t\t\t\t\toutput.writeObject(ack);\n\t\t\t\t\tnew Thread(new BlockSender(socket.getOutputStream(), message.getBlockID())).start();\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}",
"public static void main(String[] args) throws Throwable {\n ServerSocket server = new ServerSocket();\n server.bind(new InetSocketAddress(3000));\n System.out.println(\"Blocking Socket : listening for new Request\");\n while (true) { // <1>\n Socket socket = server.accept();\n //each incomming request(socket request) allocate in a separate thread\n new Thread(clientHandler(socket)).start();\n }\n }",
"public void start() {\n\n // server 환경설정\n EventLoopGroup bossGroup = new NioEventLoopGroup(bossCount);\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n\n try {\n\n ServerBootstrap b = new ServerBootstrap();\n b.group(bossGroup, workerGroup)\n .channel(NioServerSocketChannel.class)\n .childHandler(new ChannelInitializer<SocketChannel>() {\n @Override\n public void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n pipeline.addLast(new StringDecoder(CharsetUtil.UTF_8));\n pipeline.addLast(new StringEncoder(CharsetUtil.UTF_8));\n pipeline.addLast(new LoggingHandler(LogLevel.INFO));\n pipeline.addLast(SERVICE_HANDLER);\n }\n })\n .option(ChannelOption.SO_BACKLOG, backLog)\n .childOption(ChannelOption.SO_KEEPALIVE, true);\n\n ChannelFuture channelFuture = b.bind(tcpPort).sync();\n channelFuture.channel().closeFuture().sync();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n bossGroup.shutdownGracefully();\n workerGroup.shutdownGracefully();\n }\n\n }",
"public void start() {\n System.err.println(\"Server will listen on \" + server.getAddress());\n server.start();\n }",
"public void startServer() throws IOException {\n log.info(\"Starting server in port {}\", port);\n try {\n serverSocket = new ServerSocket(port);\n this.start();\n log.info(\"Started server. Server listening in port {}\", port);\n } catch (IOException e) {\n log.error(\"Error starting the server socket\", e);\n throw e;\n }\n }",
"public void startListener() throws IOException {\n\t\tthis.listener = new ServerSocket(this.port);\n\n Runnable serverThread = new Runnable() {\n @Override\n public void run() {\n try {\n System.out.println(\"Waiting for clients to connect...\");\n\n while (true) {\n \t// Wait for connections\n Socket newSocket = listener.accept();\n\n // Init new peer and add it to our list\n PeerCommunicator newCommunication = new PeerCommunicator(id, \"\", newSocket);\n activePeers.add(newCommunication);\n\n // Span new thread\n Thread clientThread = new Thread(new ReceivedConnection(newCommunication, fm));\n clientThread.start();\n }\n } catch (Exception e) {\n System.err.println(\"Unable to process incoming client\");\n e.printStackTrace();\n }\n }\n };\n\n // Start it up\n (new Thread(serverThread)).start();\n\n // Once everything's good, mark server as running\n //this.status = Status.RUNNING;\n\t}",
"private static void server() throws IOException {\n\t\tServerSocket serverSocket = new ServerSocket(10999);\n\t\t//listener, waiting connection\n\t\tSocket socket = serverSocket.accept();//block\n\t\t//input --> receive / output --> send\n\t\tInputStream inputStream = socket.getInputStream();\n\t\tOutputStream outputStream = socket.getOutputStream();\n\t\t//byte array (stream)\n\t\tbyte[] b = new byte[1024];\n\t\t//read/receive\n\t\tinputStream.read(b);\n\t\t//\n\t\tString resp = client(b);\n\t\t//\n\t\toutputStream.write(resp.getBytes());\n\t\t//closing\n\t\tsocket.close();\n\t\t//close server\n\t\tserverSocket.close();\n\t}",
"@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tTcpThreadList tcpThreadList = new TcpThreadList();\n\t\t\ttcpThreadList.start();\n\t\t\tserverSocket = new ServerSocket(tcp_port);\n\t\t\twhile(true) {\n\t\t\t\ttry {\n\t\t\t\t\tSocket recvSocket = serverSocket.accept();\n\t\t\t\t\tTcpThreadServer tcpThreadServer = new TcpThreadServer(recvSocket); \n\t\t\t\t\tlogger.debug(\"accept a tcp socket\");\n\t\t\t\t\ttcpThreadServer.start(); \n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} \n\t\t\t}\n\t\t} catch (IOException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} finally {\n\t\t\tif(serverSocket!=null) { \n\t\t\t\ttry {\n\t\t\t\t\tserverSocket.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t} //socket关闭\n\t\t\t}\n\t\t\tflag = false; //标记Server结束\n\t\t}\n\t}",
"private static void startServer() {\n new Thread() {\n public void run() {\n Server server = new Server();\n server.startUDP();\n }\n }.start();\n }",
"private void startServer(){\n clients = new ArrayList<ClientThread>();\n ServerSocket ClientSocket = null;\n try {\n ClientSocket = new ServerSocket(ClientPort);\n ClientSocketConnection(ClientSocket);\n } catch (IOException e){\n e.printStackTrace();\n System.exit(1);\n }\n }",
"public static void startChatServer() {\n\t\tbyte[] buffer = new byte[1024];\n\t\tStreamConnectionNotifier cn = null;\n\t\ttry {\n\t\t\tLocalDevice local = LocalDevice.getLocalDevice();\n\t\t\tlocal.setDiscoverable(DiscoveryAgent.GIAC);\n\t\t\tcn = (StreamConnectionNotifier) Connector.open(INSECURE_URL);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\twhile (true) {\n\t\t\tOutputThread t = null;\n\t\t\tStreamConnection sock = null;\n\t\t\tInputStream is = null;\n\t\t\tOutputStream os = null;\n\t\t\ttry {\n\t\t\t\tSystem.out.println(\"accepting connection:\");\n\t\t\t\tsock = cn.acceptAndOpen();\n\t\t\t\tSystem.out.println(\"accept!: \" + Charset.defaultCharset());\n\t\t\t\tis = sock.openInputStream();\n\t\t\t\tos = sock.openOutputStream();\n\n\t\t\t\tt = new OutputThread(os);\n\t\t\t\tt.start();\n\n\t\t\t\twhile (t.isAlive()) {\n\t\t\t\t\t//TODO: use timeout read?\n\t\t\t\t\tint len = is.read(buffer);\n\t\t\t\t\t// printAsHex(buffer, len);\n\t\t\t\t\tif (len > 0) {\n\t\t\t\t\t\tSystem.out.println(\"received message(\" + len + \"): \" + new String(buffer, 0, len));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//TODO: check connection is live or not,\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} finally {\n\t\t\t\tt.interrupt();\n\t\t\t\tt = null;\n\t\t\t\ttry {\n\t\t\t\t\tsock.close();\n\t\t\t\t\tcn.close();\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t//\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public Socket awaitMessages(){\n Socket s = null;\n try { \n s = serverSocket.accept();\n\t } catch (IOException e) {\n System.out.println(\"Could not listen on port \" + portNumber);\n }\n return s;\n }",
"private static void createServerSocket() throws SocketTimeoutException, IOException, SocketTimeoutException {\r\n serverSocket.setSoTimeout(10000);\r\n socket = serverSocket.accept();\r\n System.out.println(\"Server: connection to: \" + socket.getInetAddress());\r\n }",
"public void start()\n throws IOException, StunException\n {\n localSocket = new IceUdpSocketWrapper(\n new SafeCloseDatagramSocket(serverAddress));\n\n stunStack.addSocket(localSocket);\n stunStack.addRequestListener(serverAddress, this);\n\n }",
"private void runServer()\n {\n int port = Integer.parseInt(properties.getProperty(\"port\"));\n String ip = properties.getProperty(\"serverIp\");\n \n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Server started. Listening on: {0}, bound to: {1}\", new Object[]{port, ip});\n try\n {\n serverSocket = new ServerSocket();\n serverSocket.bind(new InetSocketAddress(ip, port));\n do\n {\n Socket socket = serverSocket.accept(); //Important Blocking call\n Logger.getLogger(ChatServer.class.getName()).log(Level.INFO, \"Connected to a client. Waiting for username...\");\n ClientHandler ch = new ClientHandler(socket, this);\n clientList.add(ch);\n ch.start();\n } while (keepRunning);\n } catch (IOException ex)\n {\n Logger.getLogger(ChatServer.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public int start() throws IOException{\n\t\tClientThread listenerThread = new ClientThread(this);\n\t\tlistenerSock = listenerThread.initSocket();\n\t\tint newPort = listenerSock.getLocalPort();\n\t\tclientPort = newPort;\n\t\tt = new Thread(listenerThread);\n\t\tt.start();\n\t\tsock = new Socket(serverIP, port);\n\t\treturn newPort;\n\t}",
"public void startServer() throws IOException{\n\t\t\n\t\tlistenThread = Thread.currentThread();\n\t\twhile(!listenThread.isInterrupted())\n\t\t{\n\t\t\tSocket clientSocket = null;\n\t\t\ttry {\n\t\t\t\tclientSocket = listenSocket.accept();\n\t\t\t\tConnectionHandler connectionHandler = new ConnectionHandler(clientSocket);\n\t\t\t\tTestInstance testInstance = new TestInstance(connectionHandler, dataHandler, outputServer);\n\t\t\t\ttestInstances.add(testInstance);\n\t\t\t\tnew Thread(testInstance).start();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"public void startServer()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t}\r\n\t\tcatch (IOException e1)\r\n\t\t{\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Waiting for client connection.\");\r\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\tSocket socket = serverSocket.accept();\r\n\t\t\tSystem.out.println(\"Client connects.\");\r\n\r\n\t\t\tObjectInputStream ois = null;\r\n\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\tois = new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));\r\n\t\t\t\tObject o = ois.readObject();\r\n\t\t\t\tif (!(o instanceof Message))\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception(\"Received information is not message. Skip.\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmessage = (Message) o;\r\n\t\t\t\tSystem.out.println(\"Message received: \" + message);\r\n\t\t\t}\r\n\t\t\tcatch (IOException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch (ClassNotFoundException e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tcatch (Exception e)\r\n\t\t\t{\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tfinally\r\n\t\t\t{\r\n\t\t\t\tCloseUtil.closeAll(ois, socket, serverSocket);\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}",
"public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }",
"protected void mainTask() {\n\ttry {\n\t socket = serverSocket.accept();\t\n\t spawnConnectionThread(socket);\n\t} catch (IOException e) {\n\t return;\n\t}\n }",
"public void start() {\n threadPoolExecutor.setCorePoolSize(configurations.threadPoolSize());\n new Thread(this::startServer).start();\n }",
"private void startConnection() throws IOException {\n bos = new BufferedOutputStream(socket.getOutputStream(), 65536);\n\n byte[] key = new byte[16];\n Random random = new Random();\n random.nextBytes(key);\n String base64Key = Base64.encodeBase64String(key);\n\n byte[] handshake = createHandshake(base64Key);\n bos.write(handshake);\n bos.flush();\n\n InputStream inputStream = socket.getInputStream();\n verifyServerHandshake(inputStream, base64Key);\n\n writerThread.start();\n\n notifyOnOpen();\n\n bis = new BufferedInputStream(socket.getInputStream(), 65536);\n read();\n }",
"public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }",
"public synchronized void start() {\n\t\trunning=true;\n\t\tnew Thread(this).start();\n\t\t\n\t\tif(JOptionPane.showConfirmDialog(this, \"Do you want to run the server\")==0){\n\t\t\tsocketServer = new GameServer(this);\n\t\t\tsocketServer.start();\n\t\t\t\n\t\t}\n\t\tsocketClient=new GameClient(this, \"localhost\");\n\t\tsocketClient.start();\n\t}",
"@Override\n public void start() throws IOException\n {\n try\n {\n InetSocketAddress address = new InetSocketAddress(config.getHost(), config.getPort());\n sock = new Socket();\n sock.setSoTimeout(config.getReadTimeout());\n sock.connect(address, config.getReadTimeout());\n out = new ObjectOutputStream(new BufferedOutputStream(sock.getOutputStream()));\n out.flush();\n in = new ObjectInputStream(new BufferedInputStream(sock.getInputStream()));\n }\n catch (ConnectException ce)\n {\n log.info(\"Unable to connect to TCP socket on interface \" + config.getHost() + \" and port \" + config.getPort());\n throw ce;\n }\n }",
"public void listen() throws Exception {\n if (serverSocket != null) {\n try {\n serverSocket.setSoTimeout(0);\n } catch (SocketException sx) {\n sx.printStackTrace();\n }\n }\n }",
"public void startServer() {\n server.start();\n }",
"public void startListening() {\n\twhile (true) {\n\t try {\n\t\tSocket s = socket.accept();\n\n\t\tnew TCPSessionClient(s, this.clients);\n\t } // end of try\n\n\t catch (IOException e) {\n\t\te.printStackTrace();\n\t } // end of catch\n\t} // end of while\n }",
"@Override\n public void run() {\n try {\n registerWithServer();\n initServerSock(mPort);\n listenForConnection();\n\t} catch (IOException e) {\n Logger.getLogger(Server.class.getName()).log(Level.SEVERE, null, e);\n setTextToDisplay(\"run(): \" + e.getMessage());\n setConnectedStatus(false);\n\t}\n }",
"public void start() throws IOException {\n ServerSocket socket = new ServerSocket(80);\n while (!exec.isShutdown()) {\n try {\n final Socket conn = socket.accept();\n exec.execute(new Runnable() {\n @Override\n public void run() {\n handleRequest(conn);\n }\n });\n } catch (RejectedExecutionException e) {\n if (!exec.isShutdown()) {\n System.out.println(\"task submission rejected\" + e);\n }\n\n }\n\n }\n }",
"private void start(String[] args){\n\t\tServerSocket listenSocket;\n\n\t\ttry {\n\t\t\tlistenSocket = new ServerSocket(Integer.parseInt(args[0])); //port\n\t\t\tSystem.out.println(\"Server ready...\");\n\t\t\twhile (true) {\n\t\t\t\tSocket clientSocket = listenSocket.accept();\n\t\t\t\tSystem.out.println(\"Connexion from:\" + clientSocket.getInetAddress());\n\t\t\t\tClientThread ct = new ClientThread(this,clientSocket);\n\t\t\t\tct.start();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println(\"Error in EchoServer:\" + e);\n\t\t}\n\t}",
"private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}",
"public void runServer()\n\t{\n\t\taddText(\"Server started at \" + LocalDateTime.now());\n\t\t\n\t\tint cnt = 0;\n\t\twhile(true)\n\t\t{\n\t\t\ttry {\n\t\t\t\t// Accept a request\n\t\t\t\taddText(\"Server is waiting for connection....\");\n\t\t\t\tSocket client = server.accept();\n\t\t\t\tConnectionThread connect = new ConnectionThread(client);\n\t\t\t\t\n\t\t\t\t// Show message\n\t\t\t\taddText(\"Server is connect!\");\n\t\t\t\taddText(\"Player\" + cnt + \"'s IP address is\" + client.getInetAddress());\n\t\t\t\tcnt++;\n\t\t\t\t\n\t\t\t\t// Add to List\n\t\t\t\tconnectionPool.add(connect);\n\t\t\t\t\n\t\t\t\t// If at least two players, Start the game\n\t\t\t\taddText(\"Pool has \" + connectionPool.size() + \" connection\");\n\t\t\t\tif(connectionPool.size() >= 2)\n\t\t\t\t\tclientStart();\n\t\t\t\t\n\t\t\t\t// Start connectionThread\n\t\t\t\tconnect.start();\n\t\t\t\t\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}",
"@Override\r\n\tpublic void doStart() {\n\t\tbootstrap.group(this.bossEventLoopGroup, this.workerEventLoopGroup)\r\n\t\t\t\t .channel(NioServerSocketChannel.class)\r\n\t\t\t\t //允许在同一端口上启动同一服务器的多个实例,只要每个实例捆绑一个不同的本地IP地址即可\r\n .option(ChannelOption.SO_REUSEADDR, true)\r\n //用于构造服务端套接字ServerSocket对象,标识当服务器请求处理线程全满时,用于临时存放已完成三次握手的请求的队列的最大长度\r\n// .option(ChannelOption.SO_BACKLOG, 1024) // determining the number of connections queued\r\n\r\n //禁用Nagle算法,即数据包立即发送出去 (在TCP_NODELAY模式下,假设有3个小包要发送,第一个小包发出后,接下来的小包需要等待之前的小包被ack,在这期间小包会合并,直到接收到之前包的ack后才会发生)\r\n .childOption(ChannelOption.TCP_NODELAY, true)\r\n //开启TCP/IP协议实现的心跳机制\r\n .childOption(ChannelOption.SO_KEEPALIVE, true)\r\n .childHandler(newInitializerChannelHandler());\r\n\t\ttry {\r\n\t\t\tInetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLoopbackAddress(),getPort());\r\n\t\t\tchannelFuture = bootstrap.bind(getPort());\r\n//\t\t\tchannelFuture = bootstrap.bind(serverAddress).sync();\r\n\t\t\tLOGGER.info(\"connector {} started at port {},protocal is {}\",getName(),getPort(),getSchema());\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tLOGGER.error(\"error happen when connector {} starting\",getName());\r\n\t\t}\r\n\t}",
"public void runServer() throws IOException {\n runServer(0);\n }",
"@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}",
"public void runServer() throws IOException {\n\t\twhile (true) {\n\t\t\tSocket client = server.accept();\n\t\t\t// pass in protocol as argument so that there is only one protocol for\n\t\t\t// the entire server\n\t\t\tservice.submit(new PollClientHandler(client, poll));\n\t\t}\n\t}",
"public void start() throws IOException {\n super.start();\n\n try {\n socket = new Socket(getIP(), getPort());\n input = new DataInputStream(socket.getInputStream());\n output = new DataOutputStream(socket.getOutputStream());\n }\n catch(Exception e) {\n System.out.println(\"The port \" + getPort() + \" is currently already in use.\");\n }\n }",
"@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n public Future<Void> start() throws InterruptedException {\n if (serverConfig.getBossAcceptRate() > 0 && serverConfig.getBossAcceptCapacity() > 0) {\n logger.info(\"rate limiting incoming connections: capacity={}, rate={}\", serverConfig.getBossAcceptCapacity(), serverConfig.getBossAcceptRate());\n RateLimiter rateLimit = RateLimiters.tokenBucket(\n serverConfig.getBossAcceptCapacity(), \n serverConfig.getBossAcceptRate()\n ).build();\n\n serverBootstrap = new ServerBootstrap(rateLimit);\n } else {\n serverBootstrap = new ServerBootstrap();\n }\n\n serverBootstrap.group(bossGroup, workerGroup);\n serverBootstrap.channel(eventLoopProvider.getServerSocketChannelClass());\n\n for (Map.Entry<ChannelOption<?>, Object> e : parentChannelOptions.entrySet()) {\n serverBootstrap.option((ChannelOption) e.getKey(), e.getValue());\n }\n\n for (Map.Entry<ChannelOption<?>, Object> e : childChannelOptions.entrySet()) {\n serverBootstrap.childOption((ChannelOption) e.getKey(), e.getValue());\n }\n\n serverBootstrap.childHandler(channelInitializer);\n\n beforeBind();\n channel = serverBootstrap.bind(serverConfig.getTcpPort()).sync().channel();\n logger.info(\"Listening at {}{}:{}\", isTlsServer() ? \"https://\" : \"http://\", serverConfig.getBindAddress(), serverConfig.getTcpPort());\n return channel.closeFuture();\n }",
"private static ServerSocket startServer(int port) {\n if (port != 0) {\n ServerSocket serverSocket;\n try {\n serverSocket = new ServerSocket(port);\n System.out.println(\"Server listening, port: \" + port + \".\");\n System.out.println(\"Waiting for connection... \");\n return serverSocket;\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n return null;\n }",
"private static void startServer(){\n try{\n MMServer server=new MMServer(50000);\n }catch (IOException ioe){\n System.exit(0);\n }\n \n }",
"public void run() {\n try {\n serverSocket = new ServerSocket(60000);\n while (true) {\n Socket clientSocket = serverSocket.accept();\n (new ServerReq(clientSocket, s3, \"dsproject.test\")).start();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\n public void run()\n {\n while (true)\n {\n try\n {\n final Socket socket = m_ServerSocket.accept(); // NOFORTIFY: unreleased resource:\n //resources are managed by the remote channel lookup\n m_Logging.info(\"Connection made from %s for remote interface\", \n socket.getRemoteSocketAddress());\n \n m_RemoteChannelLookup.newServerSocketChannel(socket);\n }\n catch (final IOException e)\n {\n if (m_ServerSocket.isClosed())\n {\n m_Logging.info(\"Server socket has been closed, will stop accepting connections\");\n return;\n }\n }\n }\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\twhile (true) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tSocket socket = serverSocket.accept();\n\t\t\t\t\t\tclients.add(new Client(socket));\n\t\t\t\t\t\tSystem.out.println(\"[클라이언트 접속] \" + socket.getRemoteSocketAddress() + \": \"\n\t\t\t\t\t\t\t\t+ Thread.currentThread().getName());\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t// TODO: handle exception\n\t\t\t\t\t\tif (!serverSocket.isClosed()) {\n\t\t\t\t\t\t\tstopServer();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"private void runServer() {\n while(true) {\n try {\n SSLSocket socket = (SSLSocket)listener.accept();\n\n this.establishClient(socket);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }",
"public void startListeningForConnection() {\n startInsecureListeningThread();\n }",
"private void startServer(int port) throws IOException {\n System.out.println(\"Booting the server!\");\n\n // Open the server channel.\n serverSocketChannel = ServerSocketChannel.open();\n serverSocketChannel.bind(new InetSocketAddress(port));\n serverSocketChannel.configureBlocking(false);\n\n // Register the channel into the selector.\n selector = Selector.open();\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n }",
"public void startServer() throws Exception {\n \t\ttry {\n \t\t\t// Instruct the robot to begin now\n\t \tout.write(RBCConstants.ROBOT_BEGIN);\n\t \tout.flush();\n\n\t\t\t// Now go into the infinite loop to do communications, return when server stopped or interrupted\n\t\t startListening(in, out);\n\n\t\t // All done, close the connection\n\t\t closeEverything();\n\t\t rb.showRobotDisconnected();\n\t } catch (InterruptedIOException e) {\n\t \tcloseEverything();\n\t \trb.showRobotDisconnected();\n \t\t} catch (IOException e) {\n\t\t rb.updateStatusBar(\"Unable to Start Robot\", Color.black);\n\t\t System.out.println(\"Unable to Start Robot\");\n\t\t\tcloseEverything();\n\t\t\trb.showRobotDisconnected();\n \t\t}\n }",
"public void startRunning(){\n\t\ttry{\n\t\t\tserver = new ServerSocket(6789, 100);\n\t\t\t//int Port Number int 100 connections max (backlog / queue link)\n\t\t\twhile(true){\n\t\t\t\ttry{\n\t\t\t\t\twaitForConnection();\n\t\t\t\t\tsetupStreams();\n\t\t\t\t\twhileChatting();\n\t\t\t\t\t//connect and have conversation\n\t\t\t\t}catch(EOFException eofe){\n\t\t\t\t\tshowMessage(\"\\n Punk Ass Bitch.\");\n\t\t\t\t}finally{\n\t\t\t\t\tcloseChat();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}catch(IOException ioe){\n\t\t\tioe.printStackTrace();\n\t\t\t\n\t\t}\n\t}",
"public static void startServer() {\n clientListener.startListener();\n }",
"public void startRunning() {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t\n\t\t\t\tserver = new ServerSocket(6789, 100); //6789 is the port number for docking(Where to connect). 100 is backlog no, i.e how many people can wait to access it.\n\t\t\t\twhile (true) {\n\t\t\t\t\t//This will run forever.\n\t\t\t\t\t\n\t\t\t\t\ttry{\n\t\t\t\t\t\t\n\t\t\t\t\t\twaitForConnection();\n\t\t\t\t\t\tsetupStreams();\n\t\t\t\t\t\twhileChatting();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tcatch(EOFException eofException) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tshowMessage(\"\\n The server has ended the connection!\");\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfinally {\n\t\t\t\t\t\t\n\t\t\t\t\t\tcloseAll();\n\t\t\t\t\t\t//Housekeeping.\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tcatch(IOException ioException ) {\n\t\t\t\t\n\t\t\t\tioException.printStackTrace();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}",
"void initAndListen() {\n\t\twhile (true) {\n\t\t\ttry {\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t// Startuje nowy watek z odbieraniem wiadomosci.\n\t\t\t\tnew ClientHandler(clientSocket, this);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.err.println(\"Accept failed.\");\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n\tpublic void run() {\n\t\tlog(\"Running on port \" + serverSocket.getLocalPort());\n\t\twhile(true) {\n\t\t\ttry {\n\t\t\t\t// accept incomming connections\n\t\t\t\tSocket clientSocket = serverSocket.accept();\n\t\t\t\t//log(\"New connection from \" + client_socket.getRemoteSocketAddress());\n\t\t\t\t// create a new connection handler and run in a separate thread\n\t\t\t\tTrackerRequestHandler handler = new TrackerRequestHandler(this, clientSocket);\n\t\t\t\texecutor.execute(handler);\n\t\t\t} catch (IOException e) {\n\t\t\t\tlog(\"Problem accepting a connection\");\n\t\t\t}\n\t\t}\n\t}",
"public void start() {\n system = ActorSystem.create(\"http-server\", config);\n\n Settings settings = SettingsExtension.SettingsExtensionProvider.get(system);\n\n vHostHandlers = settings.vHostConfigs()\n .stream()\n .map(vc -> new AkkaTcpHandler(system, vc))\n .collect(Collectors.toList());\n\n vHostHandlers.forEach(VHostHandler::start);\n\n Runtime.getRuntime().addShutdownHook(new Thread(this::terminate));\n }",
"public void start(Socket socket) {\r\n\t\tthis.socket = socket;\r\n\t\tnew Thread(this).start();\r\n\t}",
"public void run(){\n\t\tstartServer();\n\t}",
"@Test\n public void startServer() throws InterruptedException {\n UicdInstrumentation uicdInstrumentation =\n UicdInstrumentation.getInstance(\n getInstrumentation().getContext(), DEFAULT_PORT);\n uicdInstrumentation.startServer();\n\n while (!uicdInstrumentation.isStopServer()) {\n SystemClock.sleep(PING_SERVER_MS);\n }\n }",
"public void start() {\n System.out.println(\"server started\");\n mTerminalNetwork.listen(mTerminalConfig.port);\n }",
"public void run() {\n\t\tMisc.log(\"Server waiting for client...\");\r\n\r\n\t\ttry {\r\n\t\t\tserver = socket.accept();\r\n\t\t\tMisc.log(server.getRemoteSocketAddress() + \" has connected.\");\r\n\t\t\t\r\n\t\t\t//get the input and output streams which are used to send and receive messages from the client\r\n\t\t\tin = new DataInputStream(server.getInputStream());\r\n\t\t\tout = new DataOutputStream(server.getOutputStream());\r\n\t\t\t\r\n\t\t\t//send host's username to the connected client by creating a hello packet with the username\r\n\t\t\tsendData(new HelloPacket(serverHost.getUsername()).getData());\r\n\t\t\t\r\n\t\t} catch(IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//server is listening until the serverRunning flag is set to false\r\n\t\twhile(serverRunning) {\t\t\t\r\n\t\t\t//construct packet object to save received data into\r\n\t\t\tbyte[] data = new byte[1024];\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\t//wait to receive a packet\r\n\t\t\t\tin.read(data);\r\n\t\t\t\t//handle packet\r\n\t\t\t\tpacketHandler.handlePacket(data);\r\n\t\t\t} catch(Exception e) {\r\n\t\t\t\tMisc.log(\"Exception in server.\");\r\n\t\t\t\tserverRunning = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t//we are done and it has been requested that the server turns off\r\n\t\tcloseServer();\r\n\t\t\r\n\t\t//end of thread\r\n\t}",
"public void startServer() {\n // configure the server properties\n int maxThreads = 20;\n int minThreads = 2;\n int timeOutMillis = 30000;\n\n // once routes are configured, the server automatically begins\n threadPool(maxThreads, minThreads, timeOutMillis);\n port(Integer.parseInt(this.port));\n this.configureRoutesAndExceptions();\n }",
"public Server() throws IOException\n {\n socket = new ServerSocket(port);\n }",
"public void runServer(){\n try {\n serverSocket = new ServerSocket(portNumber);\n } catch (IOException ioe){\n System.out.println(ioe.getMessage());\n }\n \n while (true) { \n try {\n Socket clientSocket = serverSocket.accept();\n InetAddress inetAddress = clientSocket.getInetAddress();\n System.out.println(\"Connected with \" + inetAddress.getHostName()+ \".\\n IP address: \" + inetAddress.getHostAddress() + \"\\n\");\n new Thread(new RequestHandlerRunnable(clientSocket, database)).start();\n } catch (IOException ioe){\n System.out.println(ioe.getMessage());\n }\n }\n \n }",
"public Thread execute() {\n shutdown = false;\n Thread serverThread = new Thread( new Runnable() {\n @Override\n public void run() {\n start();\n }\n } );\n\n // start the thread running, calling this server start()\n serverThread.start();\n try {\n Thread.yield();\n Thread.sleep( 200 );\n } catch ( InterruptedException e ) {}\n return serverThread;\n }",
"@Override\n public void run() {\n try {\n //create a socket using sever name or IP and port\n socket = new Socket(serverName, serverPort);\n // set up stream\n start();\n //if everything is good, enable controls on GUI\n send.setEnabled(true); // setup buttons\n tf.setEnabled(true);\n connect.setEnabled(false);\n //catch execeptions if any\n } catch (UnknownHostException uhe) {\n display(\"Host unknown: \" + uhe.getMessage()); // Alert not the right host/ IP\n } catch (IOException ioe) {\n display(\"Unexpected exception: \" + ioe.getMessage());\n }\n //keep listening to incoming messages\n while (true) { // the infinite loop\n try {\n while (!bufferInput.ready()) { // when steam ready to read\n }\n String output = bufferInput.readLine(); // Received the data from socket\n while (output != null) \n {append(output + \"\\n\");\n output = bufferInput.readLine();} } \n catch (IOException ioe) {ioe.getMessage();}\t\n \t\t\t}\t\t }",
"private void startFedServer(){\r\n \r\n try {\r\n System.out.println(\"Start server to listen for client connection....\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Start server to listen for client connection....\", \"info\");\r\n sSocket = new ServerSocket(serverPort);\r\n sSocket.setReuseAddress(true);\r\n //System.out.println(\"FedServer is launching\");\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Error listening on port \" + serverPort, \"severe\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n List<Thread> proc_list = new ArrayList();\r\n while (FLAG) {\r\n if (proc_list.size() == PROC_MAX) {\r\n boolean full = true;\r\n //check if thread number reach the maximum number, if yes, sleep; \r\n while (full) {\r\n for (int i = proc_list.size() - 1; i >= 0; i--) {\r\n if (!proc_list.get(i).isAlive()) {\r\n proc_list.remove(i);\r\n full = false;\r\n }\r\n }\r\n if (full) {\r\n try {\r\n Thread.sleep(1000);\r\n } catch (InterruptedException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n }\r\n }\r\n }\r\n //if not full, accpet new client connection\r\n try {\r\n cSocket = sSocket.accept();\r\n //System.out.println(\"[C4C-Notification] Accept connection from client\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Accept connection from client\", \"info\");\r\n //create new thread to process client request\r\n // System.out.println(\"Accept connection from client -step 1\");\r\n Thread request = new Thread(new processRequest(cSocket));\r\n request.start();\r\n proc_list.add(request);\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n\r\n }\r\n closeFedSockets();\r\n }",
"@Override\n\tpublic void run() {\n\n\t\tServerSocket sSocket;\n\t\ttry {\n\t\t\tsSocket = new ServerSocket(15001);\n\t\t\tSystem.out.println(\"server listening at \" + sSocket.getLocalPort());\n\t\t\twhile (true) {\n\t\t\t\t// this is an unique socket for each client\n\t\t\t\tSocket socket = sSocket.accept();\n\t\t\t\tSystem.out.println(\"Client with port number: \" + socket.getPort() + \" is connected\");\n\t\t\t\t// start a new thread for handling requests from the client\n\t\t\t\tClientRequestHandler requestHandler = new ClientRequestHandler(sketcher, socket, scene, playerMap);\n\t\t\t\tnew Thread(requestHandler).start();\n\t\t\t\t// start a new thread for handling responses for the client\n\t\t\t\tClientResponseHandler responseHandler = new ClientResponseHandler(socket, scene, playerMap);\n\t\t\t\tnew Thread(responseHandler).start();\n\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t}\n\t}",
"public void start() throws RemoteException, AlreadyBoundException\n {\n start(DEFAULT_PORT);\n }",
"public TCPServer(Socket s) throws IOException\n\t{\n\t\tthis.rover = s;\n\t\tthis.rover.setTcpNoDelay(false);\n\t\tthis.in = this.rover.getInputStream();\n\t\tthis.out = this.rover.getOutputStream();\n\t}",
"Socket call() throws InterruptedException;",
"private void startServer() {\n\t\ttry {\n//\t\t\tserver = new Server();\n//\t\t\tserver.start();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: add message in UI for user\n\t\t}\n\t}",
"public static void startServer() throws InterruptedException {\n\t\tEventLoopGroup bossGroup = new NioEventLoopGroup();\n\n\t\t// Accept Channel Worker Thread Group\n\t\tNioEventLoopGroup workerGroup = new NioEventLoopGroup();\n\n\t\t// Set I/O percentage\n\t\tworkerGroup.setIoRatio(50);\n\n\t\ttry {\n\t\t\tServerBootstrap bootstrap = new ServerBootstrap();\n\n\t\t\t// Set Time Loop Object, BossGroup for Accept Event, WorkerGroup for Connected I/O\n\t\t\tbootstrap.group(bossGroup, workerGroup);\n\n\t\t\t// for Create new Connect and create serverSocketChannel Factory\n\t\t\tbootstrap.channel(NioServerSocketChannel.class);\n\n\t\t\t// pre Add inboundHandler for Accept channel pipeline\n\t\t\tbootstrap.childHandler(new ChannelInitializer<SocketChannel>() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void initChannel(SocketChannel channel) {\n\t\t\t\t\t\t\tSystem.err.println(\"******** GBT BOSS Server Start **********\");\n\t\t\t\t\t\t\tchannel.config().setAutoRead(true);\n\t\t\t\t\t\t\t// explain http request message handler\n\t\t\t\t\t\t\tchannel.pipeline().addLast(new HttpRequestDecoder());\n\n\t\t\t\t\t\t\t// encode response into http response message sending\n\t\t\t\t\t\t\tchannel.pipeline().addLast(new HttpResponseEncoder());\n\n\t\t\t\t\t\t\t// custom define Http handler\n\t\t\t\t\t\t\tchannel.pipeline().addLast(new GbtBossHttpServerHandler());\n\t\t\t\t\t\t}\n\t\t\t\t\t}).option(ChannelOption.SO_BACKLOG, 128) // 流控\n\t\t\t\t\t.childOption(ChannelOption.SO_KEEPALIVE, true)\t;\n\n\t\t\t// bind method will created serverChannel, and register current channel to EventLoop\n\t\t\tChannelFuture future = bootstrap.bind(serverPort).sync();\n\n\t\t\tSystem.err.println(\"******** GBT BOSS Server run ********\");\n\t\t\t// block util close serverChannel\n\t\t\tfuture.channel().closeFuture().sync();\n\t\t} finally {\n\t\t\tworkerGroup.shutdownGracefully();\n\t\t\tbossGroup.shutdownGracefully();\n\t\t}\n\t}",
"@Override\n public void run() {\n //Create server socket\n try (ServerSocket serverSocket = new ServerSocket(serverPort))\n {\n //In loop to continuously accept connections from client\n //main thread doing this\n while (true)\n {\n System.out.println(\"Waiting for client(s) to connect..\");\n //Socket represents connection to client\n Socket clientSocket = serverSocket.accept();\n System.out.println(\"Accepted connection from \" + clientSocket);\n //Message to write to client when connected via outputstream\n OutputStream outputStream = clientSocket.getOutputStream();\n outputStream.write((\"You have connected. Please write: login <username> to login!\\n\" + \"Write <help> for list of additional commands!\\n\").getBytes());\n //Server worker, handles communication with client socket\n ServerWorker worker = new ServerWorker(this, clientSocket);\n //Adding worker to workerlist\n workerList.add(worker);\n //Starting thread worker\n worker.start();\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }",
"@Override\n\tpublic void run() {\n try {\n serverSocket = new ServerSocket(port);\n \n while (true) {\n System.out.println(\"[GenericServer.run] Waiting for connections on Port #\" + port);\n socket = serverSocket.accept();\n System.out.println(\"[GenericServer.run] A connection to a client is established!\");\n processConnection(socket);\n }\n\n } catch (IOException ioe) {\n System.err.println(\"IOException\" + ioe.getMessage());\n ioe.printStackTrace();\n }\n }",
"public void run() {\n\t\t\twhile (true) {// 保持连接直到异常发生或套接字返回\n\t\t\t\ttry {\n\t\t\t\t\tif (serverSocket != null) {\n\t\t\t\t\t\tmTempSocket = serverSocket.accept(); // 如果一个连接同意\n\t\t\t\t\t}\n\t\t\t\t\t// If a connection was accepted\n\t\t\t\t\tif (mTempSocket != null) {\n\t\t\t\t\t\t// Do work to manage the connection (in a separate\n\t\t\t\t\t\t// thread)\n\t\t\t\t\t\tmanageConnectedSocket(); // 管理一个已经连接的RFCOMM通道在单独的线程。\n\t\t\t\t\t\tserverSocket.close();\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public void run() {\n running = true;\n System.out.println(\"Server started on port: \" + port);\n manageClients();\n receive();\n startConsole();\n }",
"private void createServerSocket()\r\n {\r\n\t\tDebug.assert(port != 0, \"(Server/105)\");\r\n try {\r\n serverSocket = new ServerSocket(port);\r\n serverSocket.setSoTimeout(TIMEOUT);\r\n\t }\r\n\t catch (IOException e)\r\n\t \t{\r\n log(\"Could not create ServerSocket on port \" + port);\r\n\t \tDebug.printStackTrace(e);\r\n System.exit(-1);\r\n\t }\r\n }",
"@Override\n\tpublic void run()\n\t{\n\t\tSocket clientSocket;\n\t\tMemoryIO serverIO;\n\t\t// Detect whether the listener is shutdown. If not, it must be running all the time to wait for potential connections from clients. 11/27/2014, Bing Li\n\t\twhile (!super.isShutdown())\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait and accept a connecting from a possible client residing on the coordinator. 11/27/2014, Bing Li\n\t\t\t\tclientSocket = super.accept();\n\t\t\t\t// Check whether the connected server IOs exceed the upper limit. 11/27/2014, Bing Li\n\t\t\t\tif (MemoryIORegistry.REGISTRY().getIOCount() >= ServerConfig.MAX_SERVER_IO_COUNT)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t// If the upper limit is reached, the listener has to wait until an existing server IO is disposed. 11/27/2014, Bing Li\n\t\t\t\t\t\tsuper.holdOn();\n\t\t\t\t\t}\n\t\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t\t{\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// If the upper limit of IOs is not reached, a server IO is initialized. A common Collaborator and the socket are the initial parameters. The shared common collaborator guarantees all of the server IOs from a certain client could notify with each other with the same lock. Then, the upper limit of server IOs is under the control. 11/27/2014, Bing Li\n//\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator(), ServerConfig.COORDINATOR_PORT_FOR_MEMORY);\n\t\t\t\tserverIO = new MemoryIO(clientSocket, super.getCollaborator());\n\t\t\t\t// Add the new created server IO into the registry for further management. 11/27/2014, Bing Li\n\t\t\t\tMemoryIORegistry.REGISTRY().addIO(serverIO);\n\t\t\t\t// Execute the new created server IO concurrently to respond the client requests in an asynchronous manner. 11/27/2014, Bing Li\n\t\t\t\tsuper.execute(serverIO);\n\t\t\t}\n\t\t\tcatch (IOException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}"
] | [
"0.7596766",
"0.7294222",
"0.72010595",
"0.71258754",
"0.7106278",
"0.7081068",
"0.6994683",
"0.6904636",
"0.6895247",
"0.6798291",
"0.67681545",
"0.6764519",
"0.67503005",
"0.6744034",
"0.6699443",
"0.6672708",
"0.66193056",
"0.65938973",
"0.6589266",
"0.65824676",
"0.6558209",
"0.6554786",
"0.64869916",
"0.64805275",
"0.6478289",
"0.6462116",
"0.6448338",
"0.6412246",
"0.6392166",
"0.63818145",
"0.63803273",
"0.63773465",
"0.6367775",
"0.6350878",
"0.63443476",
"0.63392097",
"0.63314897",
"0.6308611",
"0.6307389",
"0.6302382",
"0.6297306",
"0.62949365",
"0.6294637",
"0.62888294",
"0.6287171",
"0.6275368",
"0.6273103",
"0.62717944",
"0.627025",
"0.6256854",
"0.6241001",
"0.6226258",
"0.62089485",
"0.62066877",
"0.6198275",
"0.61973643",
"0.6196209",
"0.6185075",
"0.6184494",
"0.61831224",
"0.6174922",
"0.61151683",
"0.6106125",
"0.61001915",
"0.609992",
"0.60960376",
"0.6086831",
"0.60818756",
"0.60762924",
"0.6073972",
"0.6061527",
"0.60465425",
"0.604538",
"0.6034285",
"0.6029999",
"0.6028585",
"0.60267514",
"0.6024484",
"0.60077816",
"0.59993243",
"0.5995576",
"0.59734213",
"0.59726834",
"0.59660774",
"0.59608454",
"0.5960298",
"0.59487414",
"0.59448636",
"0.5940641",
"0.5930757",
"0.5928586",
"0.59283537",
"0.5925402",
"0.59211224",
"0.5919908",
"0.5915888",
"0.5893646",
"0.5892091",
"0.5892021",
"0.5881433"
] | 0.5911167 | 96 |
Create ProcessorTask objects and configure it to be ready to proceed request. | @Override
protected DefaultProcessorTask newProcessorTask(boolean initialize){
ProcessorBlockingTask task = new ProcessorBlockingTask(initialize);
configureProcessorTask(task);
task.setMaxKeepAliveRequests(getMaxKeepAliveRequests());
if (secure){
task.setSSLImplementation(sslImplementation);
}
return task;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n public void generateTasks() {\r\n int tasks = Integer.parseInt(this.getProperty(\"numTask\", \"1000\"));\r\n setNumOfTasks(tasks);\r\n //TODO:fixed port here !!!! need to change!!!\r\n serverPort = Integer.parseInt(this.getProperty(\"reqServerPort\", \"5560\")); \r\n PROC_MAX = Integer.parseInt(this.getProperty(\"reqServerMaxConcurrentClients\",\"10\"));\r\n location = this.getProperty(\"location\", \"rutgers\");\r\n energyplusPropertyFile = this.getProperty(\"energyplusTemplate\", \"energyplus.property\");\r\n \r\n winnerTakeAll = Boolean.parseBoolean(this.getProperty(\"winnerTakeAll\",\"true\"));\r\n jobDistributionMap = new HashMap<Integer,Integer>();\r\n copyJobDistributionMap = new HashMap<Integer,Integer>();\r\n //System.out.println(\"energyplusPropertyFile:\"+energyplusPropertyFile);\r\n \r\n initInfoSystem();\r\n initDistributionSystem();\r\n startFedServer();\r\n }",
"public Task(Task source) {\n if (source.Application != null) {\n this.Application = new Application(source.Application);\n }\n if (source.TaskName != null) {\n this.TaskName = new String(source.TaskName);\n }\n if (source.TaskInstanceNum != null) {\n this.TaskInstanceNum = new Long(source.TaskInstanceNum);\n }\n if (source.ComputeEnv != null) {\n this.ComputeEnv = new AnonymousComputeEnv(source.ComputeEnv);\n }\n if (source.EnvId != null) {\n this.EnvId = new String(source.EnvId);\n }\n if (source.RedirectInfo != null) {\n this.RedirectInfo = new RedirectInfo(source.RedirectInfo);\n }\n if (source.RedirectLocalInfo != null) {\n this.RedirectLocalInfo = new RedirectLocalInfo(source.RedirectLocalInfo);\n }\n if (source.InputMappings != null) {\n this.InputMappings = new InputMapping[source.InputMappings.length];\n for (int i = 0; i < source.InputMappings.length; i++) {\n this.InputMappings[i] = new InputMapping(source.InputMappings[i]);\n }\n }\n if (source.OutputMappings != null) {\n this.OutputMappings = new OutputMapping[source.OutputMappings.length];\n for (int i = 0; i < source.OutputMappings.length; i++) {\n this.OutputMappings[i] = new OutputMapping(source.OutputMappings[i]);\n }\n }\n if (source.OutputMappingConfigs != null) {\n this.OutputMappingConfigs = new OutputMappingConfig[source.OutputMappingConfigs.length];\n for (int i = 0; i < source.OutputMappingConfigs.length; i++) {\n this.OutputMappingConfigs[i] = new OutputMappingConfig(source.OutputMappingConfigs[i]);\n }\n }\n if (source.EnvVars != null) {\n this.EnvVars = new EnvVar[source.EnvVars.length];\n for (int i = 0; i < source.EnvVars.length; i++) {\n this.EnvVars[i] = new EnvVar(source.EnvVars[i]);\n }\n }\n if (source.Authentications != null) {\n this.Authentications = new Authentication[source.Authentications.length];\n for (int i = 0; i < source.Authentications.length; i++) {\n this.Authentications[i] = new Authentication(source.Authentications[i]);\n }\n }\n if (source.FailedAction != null) {\n this.FailedAction = new String(source.FailedAction);\n }\n if (source.MaxRetryCount != null) {\n this.MaxRetryCount = new Long(source.MaxRetryCount);\n }\n if (source.Timeout != null) {\n this.Timeout = new Long(source.Timeout);\n }\n if (source.MaxConcurrentNum != null) {\n this.MaxConcurrentNum = new Long(source.MaxConcurrentNum);\n }\n if (source.RestartComputeNode != null) {\n this.RestartComputeNode = new Boolean(source.RestartComputeNode);\n }\n if (source.ResourceMaxRetryCount != null) {\n this.ResourceMaxRetryCount = new Long(source.ResourceMaxRetryCount);\n }\n }",
"protected abstract void createTasks();",
"@PostConstruct\n public void setUpTasks() {\n final Iterable<Task> findAll = taskService.findAll();\n if (findAll != null) {\n findAll.forEach(task -> {\n\n final RunnableTask runnableTask = new RunnableTask(task.getId(), runTaskService);\n\n if (task.getCronExpression() != null) {\n log.info(\"Adding cron schedule for {} : {}\", task.getId(), task.getCronExpression());\n threadPoolTaskScheduler.schedule(runnableTask, new CronTrigger(task.getCronExpression()));\n }\n else if (task.getDelayPeriod() > 0) {\n log.info(\"Adding periodic schedule for {} : {}\", task.getId(), task.getDelayPeriod());\n threadPoolTaskScheduler.schedule(runnableTask, new PeriodicTrigger(task.getDelayPeriod()));\n }\n else {\n log.error(\"Invalid task {}\", task.getId());\n }\n\n });\n }\n }",
"protected TaskFlow( ) { }",
"private void setupProcessingPipeline() throws Exception {\n // activeProcessingUnits = 1;\n\n nonThreadedProcessingUnit = new NonThreadedProcessingUnit(this);\n // Assign initial status to all Cas Processors in the processing pipeline\n for (int i = 0; i < annotatorList.size(); i++) {\n ((ProcessingContainer) annotatorList.get(i)).setStatus(Constants.CAS_PROCESSOR_RUNNING);\n }\n\n nonThreadedProcessingUnit.setContainers(annotatorList);\n nonThreadedProcessingUnit.setCasPool(casPool);\n for (int j = 0; j < statusCbL.size(); j++) {\n BaseStatusCallbackListener statCL = (BaseStatusCallbackListener) statusCbL.get(j);\n if (statCL != null) {\n nonThreadedProcessingUnit.addStatusCallbackListener(statCL);\n }\n }\n }",
"public interface TaskProcessFactory {\n\n TaskProcessor createTaskProcessor(String domain);\n}",
"protected void setupTask(Task task) {\n }",
"public void initialize() {\n\n\t\t// Initialize taskList\n\t\tthis.taskList = new LinkedList<Task>();\n\n\t\t// create a new thread for total size of pool\n\t\tfor (int i = 0; i < this.poolSize; ++i) {\n\t\t\tthreadPool.add(new WorkerThread(this));\n\t\t}\n\n\t\t// Start each thread in thread pool\n\t\tfor (WorkerThread t : threadPool) {\n\t\t\tnew Thread(t).start();\n\t\t}\n\n\t}",
"protected TaskChain() {\n\t}",
"@PostConstruct\n public void init() {\n threadPoolTaskScheduler.scheduleWithFixedDelay(this::process, Instant.now(), Duration.ofSeconds(30));\n }",
"Task createTask();",
"Task createTask();",
"Task createTask();",
"public TaskGenerator() {\n if (taskNames == null) {\n setUpNameList();\n }\n }",
"@Override\n protected void setup(final TaskBundle bundle, final List<Task<?>> taskList) {\n this.bundle = bundle;\n //taskNotificationDispatcher.setBundle(bundle);\n this.taskList = taskList;\n this.taskWrapperList = new ArrayList<>(taskList.size());\n this.dataProvider = taskList.get(0).getDataProvider();\n this.uuidList = bundle.getUuidPath().getList();\n ClassLoader taskClassLoader = null;\n try {\n taskClassLoader = getTaskClassLoader(taskList.get(0));\n usedClassLoader = threadManager.useClassLoader(taskClassLoader);\n } catch (final Exception e) {\n final String msg = ExceptionUtils.getMessage(e) + \" - class loader lookup failed for uuidPath=\" + uuidList;\n if (debugEnabled) log.debug(msg, e);\n else log.warn(msg);\n }\n accumulatedElapsed.set(0L);\n }",
"public Task() {\n\t}",
"void onTaskPrepare();",
"public void prepare() {\n this.taskHandler.run(this::inlinePrepare);\n }",
"public ScheduledTask (Task task, int startTime, int processor) {\n\t\tthis.task = task;\n\t\tthis.startTime = startTime;\n\t\tthis.processor = processor;\n\t}",
"@Override\n public void onInitializeTasks() {\n }",
"public void doAllTasks() throws Exception {\n final GenericInitializer<E,T> initializer = config.getInitializer();\n final TaskFactory<E,T,GenericInitializer<E,T>> initTaskFac = config.getInitFactory();\n final ObjectCache<GenericInitializer<E,T>> initCache = new ObjectCache<>(2*threads,initializer);\n \n final long sT = System.currentTimeMillis();\n List<Task<T>> initTasks = comm.getInitialTasks(maxTasks,myID);\n final long mT = System.currentTimeMillis();\n initFetchTimeMS += mT-sT;\n initChunksGotten++;\n \n do{\n noInits = initTasks.size();\n if(noInits == 0){\n // nothing to be done, kinda weird.\n System.out.println(\"WARNING: No tasks gotten for threading backend \" + myID + \" continuing but wondering...\");\n break;\n }\n // kind of subptimal but we need to get the ID offset\n currIDStart = (int) initTasks.get(0).getDummyAnswer(myID).getResult().getID();\n \n if(DEBUG){System.out.println(\"DEBUG: Starting with ID \" + currIDStart + \" we have \" + initTasks.size() + \" tasks to init.\");}\n\n final long tOff = System.currentTimeMillis();\n doXXX(threads, initTaskFac, initCache, initTasks);\n final long tMid = System.currentTimeMillis();\n initWorkTimeMS += (tMid-tOff);\n \n final boolean doneYet = synchronizePools(true);\n if(!doneYet){\n initTasks = comm.getInitialTasks(maxTasks,myID);\n initChunksGotten++;\n } else {\n initTasks.clear(); // not strictly necessary, I think\n }\n final long tEnd = System.currentTimeMillis();\n initFetchTimeMS += (tEnd-tMid);\n \n } while(!initTasks.isEmpty());\n \n // merge pools, technically this should have happened before already. However, this does not hurt and synchronizes even further.\n synchronizePools(false);\n \n ISINIT = false;\n \n // then do globopt tasks (setup task factory and cachers)\n final GenericGlobalOptimization<E,T> globopt = config.getGlobalOptimization();\n final ObjectCache<GenericGlobalOptimization<E,T>> globCache = new ObjectCache<>(2*threads,globopt);\n TaskFactory<E,T,GenericGlobalOptimization<E,T>> globTasks = new GlobTaskFactory<>();\n\n while(!comm.isEverythingDone()){\n \n final long tOff = System.currentTimeMillis();\n doXXX(threads, globTasks, globCache, (int) currIDStart, (int) tasksGotten);\n final long tMid = System.currentTimeMillis();\n optWorkTimeMS += (tMid-tOff);\n \n final boolean done = synchronizePools(false);\n final long tEnd = System.currentTimeMillis();\n optFetchTimeMS += (tEnd-tMid);\n \n if(done) {break;}\n }\n }",
"public ServiceTask() {\n\t}",
"public static Object createTaskObject(){\n try {\n\n return taskModel.make()\n .load(ClassLoader.getSystemClassLoader(), ClassLoadingStrategy.Default.WRAPPER)\n .getLoaded()\n .newInstance();\n\n\n } catch (InstantiationException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n return null;\n }",
"public void setUp() {\n instance = new Task();\n }",
"private void constructorPostProcessing()\n {\n prepareNextRequest();\n fetchNextBatch();\n advanceObjectSummary();\n }",
"@PostConstruct\r\n public void init() {\r\n \t//registerNotificationCallback(null); //to register taskexecution engine as default\r\n ThreadFactory namedThreadFactory = new ThreadFactoryBuilder().setNameFormat(\"MARM-thread-%d\").build();\r\n \texecutor = Executors.newFixedThreadPool(10, namedThreadFactory);\r\n\r\n ThreadFactory brokerThreadFactory = new ThreadFactoryBuilder().setNameFormat(\"Broker-thread-%d\").build();\r\n brokerExecutor = Executors.newFixedThreadPool(10, brokerThreadFactory);\r\n\r\n ThreadFactory logThreadFactory = new ThreadFactoryBuilder().setNameFormat(\"LOG-thread-%d\").setPriority(Thread.MIN_PRIORITY).build();\r\n logExecutor = Executors.newFixedThreadPool(10, logThreadFactory);\r\n broker.registerInputListener(this);\r\n broker.registerControlListener(this);\r\n }",
"public Task() {\r\n }",
"public TaskManager() {\n\t\tcompletedTasks = new ArrayList<Tasks>();\n\t}",
"private <E, F extends ITaskObject> IStatusTask createInitTask(F taskObject) {\n ITaskObjectManager<E, F> taskObjectManager = getTaskManagerConfiguration().getTaskObjectManagerRegistry().getTaskObjectManager(taskObject);\n Class<F> taskObjectClass = taskObjectManager.getTaskObjectClass();\n\n E currentStatus = taskObjectManager.getInitialStatus(taskObject);\n\n // Create a first task, it does nothing\n return getTaskManagerConfiguration().getTaskFactory().newStatusTask(null, taskObjectClass, currentStatus);\n }",
"public Task() { }",
"public void initialize() {\n\t\t//start the processor thread\n\t\t//logger.debug(processorName+\" starting processor thread\");\n\t\tprocessorThread.start();\n\t\t\n\t\t//logger.debug(processorName+\" initialized\");\n\t}",
"public Task(){}",
"void registerTasks(Object taskClassObject);",
"@Override\r\n\tpublic void PreExecute(TaskConfig config){\n\t}",
"private static Task[] createTaskList() {\n\t\t\n\t Task evalTask = new EvaluationTask();\n\t Task tamperTask = new TamperTask();\n\t Task newDocTask = new NewDocumentTask();\n\t Task reportTask = new AssignmentReportTask();\n\n\t Task[] taskList = {evalTask, tamperTask, newDocTask, reportTask};\n\n\t return taskList;\n\t}",
"public void start() { \t\n try {\n \tTask task = new FileTask(fileScanner);\n \tTaskDescription taskDescription = new TaskDescription();\n \ttaskDescription.setName(name + \"-FILE-EP\");\n \ttaskDescription.setTaskGroup(\"FILE-EP\");\n \ttaskDescription.setInterval(interval);\n \ttaskDescription.setIntervalInMs(true);\n \ttaskDescription.addResource(TaskDescription.INSTANCE, task);\n \ttaskDescription.addResource(TaskDescription.CLASSNAME, task.getClass().getName());\n \tstartUpController = new StartUpController();\n \tstartUpController.setTaskDescription(taskDescription);\n \tstartUpController.init(synapseEnvironment);\n\n } catch (Exception e) {\n log.error(\"Could not start File Processor. Error starting up scheduler. Error: \" + e.getLocalizedMessage());\n }\n }",
"public abstract void prepareTasks() throws JobException;",
"@Override\n\tpublic void initTask() {\n\t\tRankTempInfo rankInfo = RankServerManager.getInstance().getRankTempInfo(player.getPlayerId());\n\t\tif(rankInfo!=null){\n\t\t\tgetTask().getTaskInfo().setProcess((int)rankInfo.getSoul());\n\t\t}\n\t}",
"public Task() {\n }",
"public TaskServiceImpl() {}",
"@PostConstruct\n\tpublic void init()\n\t{\n\t\tlogModule.info(TaskGenerator.class, \"初始化 Task generator...\");\n\t}",
"public void createTasks(Integer _optID, String _tupleTag, String _taskType, String _info1, String _info2, String _destIP, String _port, String _location, long timestamp, Object _appSpecific){ \r\n //System.out.print(\"Create tasks\");\r\n boolean flag = false;\r\n String defaultIP = \"-1\";\r\n String defaultPort = \"-1\";\r\n \r\n //use wildcard to let one worker randomly choose the job to run\r\n //System.out.println(\"---What is optID: \" +_optID);\r\n if(_destIP.equals(\"RANDOM\")){\r\n int tempTaskID = getUpdatedTaskID();\r\n \r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,defaultIP,_info1,_info2,defaultPort,_location, timestamp,_appSpecific);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n //------THE TASK IS INSERTED HERE\r\n insertTask(tempTaskID);\r\n }\r\n //send tuples to all\r\n else if(_destIP.equals(\"ALL\")){\r\n //Iterate through all sites that subscribe to certain types of task \r\n //System.out.println(\"infoSys.getSiteList(): \"+infoSys.getSiteList());\r\n Iterator it = infoSys.getSiteList().entrySet().iterator();\r\n while (it.hasNext()) {\r\n Map.Entry entry = (Map.Entry) it.next();\r\n _destIP = ((String) entry.getKey());\r\n ConcurrentHashMap<String, String> subscribeType = (ConcurrentHashMap<String, String>) entry.getValue();\r\n \r\n //option 2, if there is multiple subscribers of a certain taskType in one site\r\n Iterator subIt = subscribeType.entrySet().iterator();\r\n while (subIt.hasNext()) {\r\n Map.Entry subEntry = (Map.Entry) subIt.next();\r\n String[] typeAndAssociate = subEntry.getValue().toString().split(\",\");\r\n if (typeAndAssociate[0].equals(_tupleTag) && typeAndAssociate[1].equals(_taskType)) {\r\n _port = subEntry.getKey().toString();\r\n\r\n int tempTaskID = getUpdatedTaskID();\r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,_destIP, _info1,_info2,_port,_location, timestamp,_appSpecific);\r\n //System.out.println(\"Master out: \"+\"--\"+_tupleTag+\"--\"+_taskType+\"--\"+_optID+\"--\"+_destIP+\"--\"+_budget+\"--\"+_deadline+\"--\"+_port);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n //------THE TASK IS INSERTED HERE\r\n insertTask(tempTaskID);\r\n \r\n }\r\n }\r\n }\r\n }\r\n //if user choose one specific worker, only send the message to it\r\n else{ \r\n //System.out.println(infoSys.getSiteList());\r\n //Check if this subscriber exists\r\n if (infoSys.hasAssociateSubscriber(_destIP, _port)) {\r\n int tempTaskID = getUpdatedTaskID();\r\n //System.out.println(\"Master out: \"+\"--\"+_tupleTag+\"--\"+_taskType+\"--\"+_optID+\"--\"+_destIP+\"--\"+_budget+\"--\"+_deadline+\"--\"+_port);\r\n insertIntoParaList(tempTaskID, _optID, _tupleTag, _taskType,_destIP,_info1,_info2,_port,_location, timestamp,_appSpecific);\r\n flag = true;\r\n addEntryToResultList(_optID,flag);\r\n insertTask(tempTaskID);\r\n } else {\r\n System.out.println(\"Incorrect destIP or destPort for creating task!\");\r\n }\r\n } \r\n //create entry in resultList\r\n addEntryToResultList(_optID,flag);\r\n }",
"public void setupTask(TaskAttemptContext context) throws IOException {\n }",
"private void setupConsumerPipeline() throws Exception {\n if (consumerList != null && consumerList.size() > 0) {\n nonThreadedCasConsumerProcessingUnit = new NonThreadedProcessingUnit(this);\n // Assign initial status to all Cas Processors in the processing pipeline\n for (int i = 0; i < consumerList.size(); i++) {\n ((ProcessingContainer) consumerList.get(i)).setStatus(Constants.CAS_PROCESSOR_RUNNING);\n }\n nonThreadedCasConsumerProcessingUnit.setContainers(consumerList);\n nonThreadedCasConsumerProcessingUnit.setCasPool(casPool);\n nonThreadedCasConsumerProcessingUnit.setReleaseCASFlag(false);\n\n // Add Callback Listeners\n for (int j = 0; j < statusCbL.size(); j++) {\n BaseStatusCallbackListener statCL = (BaseStatusCallbackListener) statusCbL.get(j);\n if (statCL != null) {\n nonThreadedCasConsumerProcessingUnit.addStatusCallbackListener(statCL);\n }\n }\n // Notify Callback Listeners when done processing entity\n nonThreadedCasConsumerProcessingUnit.setNotifyListeners(false);\n // Add custom timer\n try {\n nonThreadedCasConsumerProcessingUnit.setUimaTimer(getTimer());\n } catch (Exception e) {\n // Use default Timer\n nonThreadedCasConsumerProcessingUnit.setUimaTimer(new JavaTimer());\n }\n }\n }",
"public XmlAdaptedTask() {\n\t}",
"TaskFactory getTaskFactory();",
"public Tasks() {\n }",
"@PostConstruct\n public void start() throws Exception {\n UserGroupCallbackManager callbackMgr = UserGroupCallbackManager.getInstance();\n callbackMgr.setCallback(new org.jboss.processFlow.tasks.identity.PFPUserGroupCallback()); \n callbackMgr.setProperty(\"disable.all.groups\", \"true\");\n log.info(\"start() just set UserGroupCallbackManager with properties\");\n \n // 1) instantiate a deadline handler \n EscalatedDeadlineHandler deadlineHandler = null;\n if (System.getProperty(ITaskService.DEADLINE_HANDLER) != null) {\n deadlineHandler = (EscalatedDeadlineHandler) Class.forName(System.getProperty(ITaskService.DEADLINE_HANDLER)).newInstance();\n } else {\n throw new RuntimeException(\"start() need to pass system property = \"+ITaskService.DEADLINE_HANDLER);\n }\n \n SystemEventListener sEventListener = SystemEventListenerFactory.getSystemEventListener();\n \n // 2) turn on/off the intelligent human task input/output mapping\n if (System.getProperty(\"org.jboss.processFlow.task.enableIntelligentMapping\") != null)\n enableIntelligentMapping = Boolean.parseBoolean(System.getProperty(\"org.jboss.processFlow.task.enableIntelligentMapping\"));\n log.info(\"start() enableIntelligentMapping = \" + enableIntelligentMapping);\n \n \n // 3) instantiate TaskEventListeners\n log.info(\"TaskEventListeners: \" + System.getProperty(\"org.jboss.processFlow.tasks.TaskEventListeners\"));\n eventSupport = new PfpTaskEventSupport();\n if (System.getProperty(\"org.jboss.processFlow.tasks.TaskEventListeners\") != null) {\n String[] listenerClasses = System.getProperty(\"org.jboss.processFlow.tasks.TaskEventListeners\").split(\"\\\\s\");\n for (String lcn : listenerClasses) {\n eventSupport.addEventListener((TaskEventListener) Class.forName(lcn).newInstance());\n }\n }\n \n EntityManager eManager = null;\n try {\n eManager = humanTaskEMF.createEntityManager();\n Query queryObj = eManager.createQuery(\"from User\");\n List<User> userList = queryObj.getResultList();\n for(User userObj : userList){\n this.tempOrgEntitySet.add(userObj.getId());\n }\n log.info(\"start() just populated tempOrgEntitySet with following # of orgentity users found in DB: \"+userList.size());\n }finally {\n }\n \n jtaTaskService = new TaskService(jtaHumanTaskEMF, sEventListener, deadlineHandler);\n \n /** 1) since TaskService is using a RESOURCE-LOCAL EMF (for performance reasons), jbpm assumes it can define its own trnx boundaries\n * 2) in particular, jbpm human task impl defines its own trnx boundaries when this function creates a jbpm TaskService\n * 3) not sure how to disable a JTA trnx in this @PostConstruct function other than to suspend the trnx using the TransactionManager \n */\n try {\n Transaction suspendedTrnx = tMgr.suspend(); \n taskService = new TaskService(humanTaskEMF, sEventListener, deadlineHandler);\n tMgr.resume(suspendedTrnx);\n } catch(Exception x) {\n throw new RuntimeException(x);\n }\n \n \n }",
"public RefactoringTask() {\n\t\tlauncher = new Launcher();\n\t\tinputSources = new ArrayList<String>();\n\t\tprocessors = new ArrayList<String>();\n\t\ttemplates = new ArrayList<SpoonResource>();\n\t\trefactoringsApplied = new HashMap<String, Integer>();\n\t\toutputSource = \"\";\n\t\tisProcessed = false;\n\t\tisModelBuilt = false;\n\t}",
"protected void init() {\n new AsyncTask<Void, Void, Void>() {\n @Override\n protected Void doInBackground(Void... params) {\n RosFragmentActivity.this.init(nodeMainExecutorService);\n //Let everyone know that init is called\n synchronized (mNodeInitListeners) {\n for (final NodeInitListener nodeInitListener : mNodeInitListeners) {\n nodeInitListener.onNodeInit(nodeMainExecutorService, getMasterUri());\n }\n mNodeInitListeners.clear();\n }\n return null;\n }\n }.execute();\n }",
"private CollectTaskPool() {\n\t\tsuper();\n\t}",
"@Override\n public void onStart() {\n this.dataGenerator = new DataGenerator(this.dataSize, this.dataValues, this.dataValuesBalancing);\n this.dataStream = new DataStream();\n if (this.flowRate != 0)\n this.sleepTime = dataStream.convertToInterval(this.flowRate);\n this.count = 0L;\n// this.me = this.me + \"_\" + getRuntimeContext().getIndexOfThisSubtask();\n new Thread(this::receive).start();\n }",
"@Override\n public void startEndpoint() throws IOException, InstantiationException {\n setRunning(true);\n \n rampUpProcessorTask();\n registerComponents();\n\n startPipelines();\n startListener();\n }",
"public Schedule(int numProcessors) {\n scheduledTasks = new HashMap<>();\n processors = new ArrayList<>();\n length = 0;\n\n for (int i = 1; i <= numProcessors; i++) {\n processors.add(new Processor(\"\" + i));\n }\n }",
"protected void setup(IWorkerPoolConfiguration newConfig) {\n log.debug(\"Starting initial configuration\");\n \n pool = new ScheduledThreadPoolExecutor(newConfig.getWorkers().size());\n workers = new ArrayList<RunningWorkerInstance>();\n \n for (IWorkerConfiguration newWorker : newConfig.getWorkers()) {\n addWorker(newWorker);\n }\n \n // Check if pool size is still sufficient\n int s = workers.size();\n if (s > pool.getCorePoolSize()) \n pool.setCorePoolSize(s);\n }",
"public XmlAdaptedTask() {}",
"public XmlAdaptedTask() {}",
"private Task createTask(StressTest test)\n\t{\n\t\treturn new ClientServerTask(test);\n\t}",
"private void initTaskViews(){\n for (Task t : taskManager.getTasksList()){\n submit(t.getName(), t.getIdInView(), t.getTimeForTask(), t.isFinished());\n }\n }",
"@Override\r\n @SuppressWarnings(\"empty-statement\")\r\n public Object createTaskData(int taskid) { \r\n List curPara = new ArrayList();\r\n ArrayList<String[]> regArgs1=new ArrayList<String[]>();\r\n String [] regArgs2 = null;\r\n synchronized(lock){\r\n curPara = paramList.get(taskid); \r\n }\r\n \r\n String _taskType = curPara.get(2).toString();\r\n String _info1 = curPara.get(4).toString();\r\n String _info2 = curPara.get(5).toString();\r\n if(_taskType.equals(\"c4c\")){ \r\n String _tupleTag = curPara.get(1).toString();\r\n HashMap<String,Object> requestArgs ;\r\n if (_info2.equals(\"MET\")) {\r\n try {\r\n Thread.sleep(100);\r\n System.out.println(\"[Notification-createTaskData] metadata array to send \"+C4CHelper.regArgs2.size());\r\n Thread.sleep(100);\r\n regArgs1=C4CHelper.regArgs2;\r\n Thread.sleep(10000);\r\n System.out.println(\"[Notification-createTaskData] metadata completed\");\r\n C4CHelper.uploadModel=true;\r\n } catch (Exception ex) {\r\n Logger.getLogger(FedMeteorPublisherMaster.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n } else if (_info2.equals(\"VER\")){\r\n try {\r\n Thread.sleep(100);\r\n System.out.println(\"[Notification-createTaskData] version array to send \"+C4CHelper.regArgs1.size());\r\n Thread.sleep(100);\r\n regArgs1=C4CHelper.regArgs1;\r\n Thread.sleep(10000);\r\n System.out.println(\"[Notification-createTaskData] version completed\");\r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(FedMeteorPublisherMaster.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n } else if (_info1.equals(\"CONFIG\")){\r\n try {\r\n ArrayList<String[]> result=new ArrayList<String[]>();\r\n String[] res=new String[10];\r\n System.out.println(\"[Notification-createTaskData] config array to send: \"+C4CHelper.resultConfig.length());\r\n Thread.sleep(100);\r\n Pattern pattern = Pattern.compile(\"<IPAddress>(.*?)</IPAddress>\");\r\n Pattern pattern2 = Pattern.compile(\"<Port>(.*?)</Port>\");\r\n Matcher matcher = pattern.matcher(C4CHelper.resultConfig);\r\n Matcher matcher2 = pattern2.matcher(C4CHelper.resultConfig);\r\n while ((matcher.find()) && (matcher2.find())){\r\n res[0]=matcher.group(1);\r\n res[1]=matcher2.group(1);\r\n //System.out.println(\"[Notification-createTaskData] 1111 config completed \"+res[0] +\"-\"+res[1]);\r\n result.add(new String[] {res[0],res[1]});\r\n \r\n } \r\n regArgs1=result;\r\n //System.out.println(\"[Socket getInterfaceData] configuring ...end \"+result.get(0)[0]);\r\n //System.out.println(\"[Socket getInterfaceData] configuring ...end \"+result.get(0)[1]);\r\n System.out.println(\"[Notification-createTaskData] config completed\");\r\n \r\n } catch (InterruptedException ex) {\r\n Logger.getLogger(FedMeteorPublisherMaster.class.getName()).log(Level.SEVERE, null, ex);\r\n } \r\n } else { \r\n \r\n System.out.println(\"[Notification-createTaskData] fetch received\");\r\n }\r\n return (Object) regArgs1;\r\n \r\n }else if(_taskType.equals(\"C4C\")){\r\n String _tupleTag = curPara.get(1).toString();\r\n HashMap<String,Object> requestArgs ;\r\n if(_tupleTag.equals(\"CPT\")){\r\n requestArgs = (HashMap<String,Object>)curPara.get(9);\r\n }else{\r\n regArgs1 = null;\r\n }\r\n return (Object) regArgs1;\r\n }else{\r\n return null;\r\n } \r\n }",
"@Override\n public synchronized void init(ProcessingEnvironment processingEnvironment) {\n super.init(processingEnvironment);\n\n logger = new Logger(processingEnv.getMessager()); // Package the log utils.\n logger.info(\">>>>parse options<<<< :\"+processingEnvironment.getOptions().size());\n parseOptionParams(processingEnvironment.getOptions());\n\n mFiler = processingEnv.getFiler(); // Generate class.\n types = processingEnv.getTypeUtils(); // Get type utils.\n elements = processingEnv.getElementUtils(); // Get class meta.\n\n typeUtils = new TypeUtils(types, elements);\n\n\n logger.info(\">>> AutowiredProcessor init. <<<\");\n }",
"protected HttpJsonTasksStub(\n TasksStubSettings settings,\n ClientContext clientContext,\n HttpJsonStubCallableFactory callableFactory)\n throws IOException {\n this.callableFactory = callableFactory;\n\n HttpJsonCallSettings<GetTaskRequest, Task> getTaskTransportSettings =\n HttpJsonCallSettings.<GetTaskRequest, Task>newBuilder()\n .setMethodDescriptor(getTaskMethodDescriptor)\n .setTypeRegistry(typeRegistry)\n .setParamsExtractor(\n request -> {\n RequestParamsBuilder builder = RequestParamsBuilder.create();\n builder.add(\"name\", String.valueOf(request.getName()));\n return builder.build();\n })\n .build();\n HttpJsonCallSettings<ListTasksRequest, ListTasksResponse> listTasksTransportSettings =\n HttpJsonCallSettings.<ListTasksRequest, ListTasksResponse>newBuilder()\n .setMethodDescriptor(listTasksMethodDescriptor)\n .setTypeRegistry(typeRegistry)\n .setParamsExtractor(\n request -> {\n RequestParamsBuilder builder = RequestParamsBuilder.create();\n builder.add(\"parent\", String.valueOf(request.getParent()));\n return builder.build();\n })\n .build();\n\n this.getTaskCallable =\n callableFactory.createUnaryCallable(\n getTaskTransportSettings, settings.getTaskSettings(), clientContext);\n this.listTasksCallable =\n callableFactory.createUnaryCallable(\n listTasksTransportSettings, settings.listTasksSettings(), clientContext);\n this.listTasksPagedCallable =\n callableFactory.createPagedCallable(\n listTasksTransportSettings, settings.listTasksSettings(), clientContext);\n\n this.backgroundResources =\n new BackgroundResourceAggregation(clientContext.getBackgroundResources());\n }",
"protected Task<Void> createTask() {\n\n\t\t\treturn new Task<Void>() {\n\n\t\t\t\tprotected Void call() {\n\t\t\t\t\t_button.setDisable(true);\n\t\t\t\t\tTaskScheduler.executeAlgorithm(_digraph);\n\n\t\t\t\t\treturn null;\n\n\n\t\t\t\t}\n\t\t\t};\n\t\t}",
"@Override\n public void taskStarting() {\n\n }",
"public void initialize() {\n Runnable backgroundTask = () -> {\n Configuration configuration = loadApplicationConfiguration();\n\n if (Objects.nonNull(configuration)) {\n EbayService ebayService = new EbayService(configuration);\n\n try {\n List<OrderType> unshippedOrders = ebayService.getUnshippedOrders();\n\n for (OrderType order : unshippedOrders) {\n String orderID = order.getOrderID();\n String numberOfTransaction = Integer.toString(order.getTransactionArray().getTransaction().length);\n String transactionPrice = Double.toString(order.getTotal().getValue());\n\n String paidTime = \"\";\n\n if (order.getPaidTime() != null) {\n paidTime = eBayUtil.toAPITimeString(order.getPaidTime().getTime());\n }\n\n String buyerUserID = order.getBuyerUserID();\n\n Vector dataVector = new Vector();\n\n dataVector.add(orderID);\n dataVector.add(numberOfTransaction);\n dataVector.add(transactionPrice);\n dataVector.add(paidTime);\n dataVector.add(buyerUserID);\n dataVector.add(new JTextField(20));\n dataVector.add(new JButton(\"Create Fulfillment Order\"));\n\n providerTableModel.addRow(dataVector);\n }\n } catch (Exception exception) {\n showErrorMessage(exception.getMessage());\n }\n }\n };\n\n Thread backgroundThread = new Thread(backgroundTask);\n\n backgroundThread.start();\n }",
"public InstrumentedWorkerTask(gw.pl.persistence.core.BundleProvider bundleProvider) {\n this((java.lang.Void)null);\n com.guidewire.pl.system.entity.proxy.BeanProxy.initNewBeanInstance(this, bundleProvider.getBundle(), java.util.Arrays.asList());\n }",
"public void prepareForDeferredProcessing() {\n\n }",
"private BDD build_T() {\n\t\tExecutorService executorService = Executors.newCachedThreadPool();\n\t\tList<Future<BDD>> tasks = new ArrayList<>(processors);\n\n\t\tint scheduler = processors;\n\t\tint work = endGenerations / processors;\n\t\tint half = work;\n\n\t\tif((endGenerations % processors) != 0)\n\t\t\tscheduler--;\n\n\t\tfor (int i = 0; i < scheduler; i++){\n\t\t\ttasks.add(executorService.submit(new AsyncTask(work - half, work)));\t\n\n\t\t\twork += half;\n\t\t}\n\n\t\tif((endGenerations % processors) != 0)\n\t\t\ttasks.add(executorService.submit(new AsyncTask(work - half, work+1)));\t\n\t\t\n\n\t\tBDD res = factory.makeZero();\n\t\tfor (int i = 0; i < processors; i++) {\n\t\t\ttry {\n\n\t\t\t\tres.orWith(tasks.get(i).get());\n\n\t\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\t\t\n\t\t}\n\n\t\texecutorService.shutdown();\n\n\t\treturn res;\n\t}",
"public TaskDefinition() {\n\t\tthis.started = Boolean.FALSE; // default\n\t\tthis.startTime = new Date(); // makes it easier during task creation\n\t\t// as we have a default date populated\n\t\tthis.properties = new HashMap<>();\n\t}",
"@Override\n\tpublic Task constructInstance(Robot robot) {\n\t\treturn null;\n\t}",
"public void prepare()\n {\n // First, we assign the payload a new UUID if it does not already have one\n if(getId() == null)\n setId(UUID.randomUUID());\n \n // Set the submission date to now\n setSubmissionDate(new Date());\n }",
"private void initExecService() {\n try {\n executorService = Executors.newFixedThreadPool(NO_OF_THREADS);\n } catch (Exception e) {\n log.error(e.getMessage(), e);\n }\n }",
"private synchronized void loadProcessors() {\n if (loaded)\n return;\n\n // Get the processor service declarations\n Set<ServiceDeclaration> processorDeclarations; \n try {\n processorDeclarations = ServiceDiscovery.getInstance().getServiceDeclarations(URLArtifactProcessor.class);\n } catch (IOException e) {\n \tIllegalStateException ie = new IllegalStateException(e);\n \terror(\"IllegalStateException\", staxProcessor, ie);\n throw ie;\n }\n \n for (ServiceDeclaration processorDeclaration: processorDeclarations) {\n Map<String, String> attributes = processorDeclaration.getAttributes();\n // Load a URL artifact processor\n String artifactType = attributes.get(\"type\");\n String modelTypeName = attributes.get(\"model\");\n \n // Create a processor wrapper and register it\n URLArtifactProcessor processor = new LazyURLArtifactProcessor(artifactType, modelTypeName, \n \t\tprocessorDeclaration, extensionPoints, staxProcessor, monitor);\n addArtifactProcessor(processor);\n }\n \n loaded = true;\n }",
"public AnemoCheckTask() {\n }",
"@Override\n\tpublic TaskIterator createTaskIterator() {\n\t\treturn new TaskIterator(new HyperTask(cy));\n\t}",
"@PostConstruct\n public void init() {\n for (final Entry<String, Set<String>> aggregateEntry : processor.getTaskIndex().entrySet()) {\n final AggregateStopwatch stopwatchEntry = new AggregateStopwatch();\n\n aggregatedTasks.put(aggregateEntry.getKey(), stopwatchEntry);\n\n for (final String nameEntry : aggregateEntry.getValue()) {\n logger.info(\"adding stopwatchEntry - aggregate: \" + aggregateEntry.getKey() + \" task: \" + nameEntry);\n stopwatchEntry.getTimedTasks().put(nameEntry, new TaskStopwatch());\n }\n }\n }",
"public Task(){\n super();\n }",
"@PostConstruct\n\tpublic void init() throws UnknownHostException {\n\t\tfor(int i = 0; i < requestTaskThreadSize; i++) {\n\t\t\tworkerExecutor.execute(new OmcTestServiceRequestTask(requestQueue, deliveryQueue));\n\t\t}\n\n\t\tfor(int i = 0; i < deliveryTaskThreadSize; i++) {\n\t\t\tworkerExecutor.execute(new OmcTestServiceDeliveryTask(deliveryQueue, omcServiceDiscovery, deliveryMode, omcObserverState, deliveryRetryCount));\n\t\t}\n\n\t\tif(omcServiceRegistry != null) {\n\t\t\tString hostname = InetAddress.getLocalHost().getHostName();\n\t\t\tString uri = hostname + \":\" + omcObserverProperties.getServerPort() + servletContext.getContextPath();\n\t\t\tomcServiceRegistry.registerService(omcServiceRegistryName, uri);\n\t\t\tlogger.debug(\"Register service with path: \" + omcServiceRegistryName + \", value: \" + uri);\n\t\t}\n\t}",
"protected void onStart() {\n // Allocate while starting to improve chances of thread-local\n // isolation\n queue = new Runnable[INITIAL_QUEUE_CAPACITY];\n // Initial value of seed need not be especially random but\n // should differ across threads and must be nonzero\n int p = poolIndex + 1;\n seed = p + (p << 8) + (p << 16) + (p << 24); // spread bits\n }",
"public void initialize() {\n service = Executors.newCachedThreadPool();\n }",
"public HomographyTask(){\n\n }",
"public void init(){\n taskClient.connect(\"127.0.0.1\", 9123);\n }",
"@Override\n public void init() {\n this.log.pri1(LoggingInterface.INIT_START, \"\");\n // Any task initialization code goes here.\n this.log.pri1(LoggingInterface.INIT_END, \"\");\n }",
"@Override\n public void init() throws IOException {\n ToDoData.getInstance().loadTasks();\n }",
"protected boolean init() {\n\t\tthis.mProcInfo = new ProcInfo();\t\t\n\t\tthis.mProcInfo.ml = this.mMediaLocator;\n\t\t\n\t\ttry {\n\t\t\tSystem.err.println(\"- Create processor for: \" + this.mMediaLocator);\n\t\t\tthis.mProcInfo.p = Manager.createProcessor(this.mMediaLocator);\n\t } catch (Exception e) {\n\t\t\tSystem.err.println(\"Yikes! Cannot create a processor from the given url: \" + e);\n\t\t\treturn false;\n \t}\n\t\treturn true;\n\t}",
"private ProcessorUtils() { }",
"@Override\n\tpublic Object[] splitTasks() {\n\t\tif (tasks == null) {\n\t\t\tSystem.out.println(\"There are \"+taskNum +\" tasks, and handled by \"+clientsNum+\" clients\");\n\t\t}\t\t\n\t\ttasks = new SimpleTask[clientsNum];\n\t\ttq = taskNum / clientsNum;\n//\t\tbatchSize = tq;\n\t\tint left = taskNum - tq * clientsNum;\n\t\t\n\t\tfor (int i = 0; i < tasks.length; i++) {\n\t\t\tint l = 0;\n\t\t\tif (left >= i+1) {\n\t\t\t\tl = 1;\n\t\t\t}\n\t\t\tif (i == 0) {\n\t\t\t\ttasks[i] = new SimpleTask(1, tq + l, batchSize);\n\t\t\t} else {\n\t\t\t\ttasks[i] = new SimpleTask(\n\t\t\t\t\t\ttasks[i - 1].getEnd()+ 1, tasks[i - 1].getEnd() + tq + l, batchSize);\n\t\t\t}\t\t\t\n\t\t}\n//\t\tSystem.out.println(\"done .\"+clientsNum);\n\t\tthis.srvQ2QLSTM.getCfg().getQlSTMConfigurator().setMBSize(batchSize);\n\t\tthis.srvQ2QLSTM.getCfg().getAlSTMConfigurator().setMBSize(batchSize);\t\t\n\t\treturn tasks;\n\t}",
"public void readTaskInititate() {\n\t\tiStream = new ByteArrayInputStream(marshalledBytes);\t\n\t\tdin = new DataInputStream(new BufferedInputStream(iStream));\n\t\ttry {\n\t\t\tint rounds = din.readInt();\n\t\t\tfor(int i = 0; i<5; i++) {\n\t\t\t\t//Select random node from list of nodes to send a message to \n\t\t\t\tVertex randomNode = node.getRandomNode();\n\t\t\t\tStack<String> nxt= node.getNextNodesToReach(randomNode.ip,randomNode.port);\n\t\t\t\tString firstStop = nxt.pop();\n\t\t\t\tArrayList<String> nextSteps = new ArrayList<String>();\n\t\t\t\tfor(String x : nxt) {\n\t\t\t\t\tnextSteps.add(x);\n\t\t\t\t}\n\t\t\n\t\t\t\tMessage message = new ForwardMessage(nextSteps);\n\t\t\t\tSocket senderSocket = node.getConnections().getSocketWithName(firstStop);\n\t\t\t\tnew TCPSender(senderSocket, message);\n\t\t\t\tnode.addToSendSum(message.getPayload());\n\t\t\t\tnode.incrementSendTracker();\n\t\t\t}\n\t\t\trounds = rounds -1;\n\t\t\tif (rounds == 0) {\t\t\t\t// Send task Complete message if we have finished all of our rounds \n\t\t\t\tMessage completeMessage = new TaskComplete(node.ipAddr,node.portNum);\n\t\t\t\tSocket socketReturn = node.getConnections().getSocketWithName(node.getRegistryName());\n\t\t\t\tnew TCPSender (socketReturn, completeMessage);\n\t\t\t} else {\n\t\t\t\t//Else put a new event with a taskInitiate method into the queue\n\t\t\t\tMessage rerun = new TaskInitiate(rounds);\n\t\t\t\tbyte[] newData = rerun.getByteArray();\n\t\t\t\tEventFactory eventFactory = EventFactory.getInstance();\n\t\t\t\teventFactory.insert(messageType, newData, node, originSocket);\n\t\t\t}\n\t\t} catch (IOException e) { System.out.println(\"Failed to read message. \"); }\n\t}",
"private Processor()\n {\n super(providerName+\"ProxyProcessor\");\n }",
"@Override\n protected void onStart() {\n\n try {\n\n executorService = Executors.newFixedThreadPool(1);\n\n cryptoAddressesNetworkServiceDatabaseFactory = new CryptoAddressesNetworkServiceDeveloperDatabaseFactory(pluginDatabaseSystem,pluginId);\n try {\n cryptoAddressesNetworkServiceDatabaseFactory.initializeDatabase();\n } catch (CantInitializeCryptoAddressesNetworkServiceDatabaseException e) {\n e.printStackTrace();\n }\n\n //DAO\n cryptoAddressesNetworkServiceDao = new CryptoAddressesNetworkServiceDao(pluginDatabaseSystem, pluginId);\n\n try {\n cryptoAddressesNetworkServiceDao.initialize();\n } catch (CantInitializeCryptoAddressesNetworkServiceDatabaseException e) {\n e.printStackTrace();\n }\n\n\n\n // change message state to process again first time\n reprocessPendingMessage();\n\n //declare a schedule to process waiting request message\n startTimer();\n\n }catch (Exception e){\n\n System.out.println(\" -- CRYPTO ADDRESS NS START ERROR \" + e.getMessage());\n e.printStackTrace();\n }\n\n\n\n\n }",
"public void prepare(TaskRecord taskRecord) {\n\n newAlarmManager( taskRecord.getStartTime().getSeconds(), new Intent(getApplicationContext(),\n TaskReminderBroadcastReceiver.class).putExtra(REMINDER_TYPE, START_TASK)\n .putExtra( RECORD_ID, taskRecord.getId()),\n START_REQUEST_CODE);\n Log.d(MANAGE_TASK, taskRecord.getTask().getName() + \"is prepared at \" +\n taskRecord.getStartTime().toString());\n }",
"private Map<String, Object> initTask(Template template, byte[] buffer,\n Message msg)\n throws JMSException {\n Map ph;\n String key, text;\n if (template == null || msg == null)\n return null;\n text = MessageUtils.format(msg, buffer, template);\n try {\n StringReader ins = new StringReader(text);\n ph = (Map) JSON2Map.parse(ins);\n ins.close();\n }\n catch (Exception e) {\n throw(new JMSException(\"failed to init task: \" + e.toString()));\n }\n return MonitorGroup.initMonitor(ph, name);\n }",
"public LateDeliverableProcessorImpl() {\r\n // Empty\r\n }",
"public TaskIterator createTaskIterator() {\n\t\treturn new TaskIterator(new FCMCluster(context, clusterManager));\n\t}",
"public abstract void initializeProcess();",
"public Task makeTask() {\n Task genTask = new Task(this, state, generateLocationInNeighborhood());\n\n\n //state.printlnSynchronized(\"base bounty in neighborhood \" + id + \" is = \" + (totalTime / count));\n genTask.setBaseBounty(getBaseBounty(genTask.getJob().jobType, genTask));\n double br = getBountyRate(genTask.getLocation(),genTask.getJob().jobType);\n totalBr += br;\n genTask.setBountyRate(br);\n\n\n totalBaseBounty += genTask.getBounty();\n tasks.add(genTask);\n\n totalNumTasksGenerated++;\n return genTask;\n }",
"public Task(Task T){\n\n\t\tcmd = T.cmd;\n\t\ttasknum = T.tasknum;\n\t\tterminated = T.terminated;\n\t\tcycle_term = T.cycle_term;\n\t\taborted = T.aborted;\n\t\twaiting = T.waiting;\n\t\ttime_wait = T.time_wait;\n\t\trunning = T.running;\n\n\t\tfor (int i = 0; i < T.actions.size(); i++){\n\n\t\t\tactions.add(T.actions.get(i));\n\t\t\tres_needed.add(T.res_needed.get(i));\n\t\t\treq_num.add(T.req_num.get(i));\n\t\t}\n\n\t\tfor(int i = 0; i < T.claims.size(); i++){\n\n\t\t\tclaims.add(T.claims.get(i));\n\t\t\tallocation.add(T.allocation.get(i));\n\t\t}\n\n\t}",
"private void startup() {\n LOGGER.info(\"Warming up extraction pipeline....\");\n\n for (Extractor extractor : this.context.extractors()) {\n try {\n extractor.init(this.context.persistencyWriter(), this.context.batchSize());\n this.extractors.add(extractor);\n } catch (Throwable t) {\n LOGGER.warn(\"Failed to initialize extractor {} due to an exception: {}\", extractor.getClass().getSimpleName(), t.getMessage());\n }\n }\n\n for (Extractor exporter : this.context.exporters()) {\n try {\n exporter.init(this.context.persistencyWriter(), this.context.batchSize());\n this.extractors.add(exporter);\n } catch (Throwable t) {\n LOGGER.warn(\"Failed to exporter extractor {} due to an exception: {}\", exporter.getClass().getSimpleName(), t.getMessage());\n }\n }\n \n LOGGER.info(\"Extraction pipeline is ready with {} extractors.\", this.extractors.size());\n }",
"public boolean createCreateNodeTasks(\n Universe universe,\n Set<NodeDetails> nodesToBeCreated,\n boolean ignoreNodeStatus,\n boolean ignoreUseCustomImageConfig) {\n\n // Determine the starting state of the nodes and invoke the callback if\n // ignoreNodeStatus is not set.\n boolean isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n ignoreNodeStatus,\n NodeStatus.builder().nodeState(NodeState.ToBeAdded).build(),\n filteredNodes -> {\n createSetNodeStatusTasks(\n filteredNodes, NodeStatus.builder().nodeState(NodeState.Adding).build())\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n // Create the node or wait for SSH connection on existing instance from cloud provider.\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.Adding).build(),\n filteredNodes -> {\n createCreateServerTasks(filteredNodes)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n // Get and update node instance details of node into our DB, mark node as 'provisioned'.\n // Includes public IP address and private IP address if applicable and others.\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.InstanceCreated).build(),\n filteredNodes -> {\n createServerInfoTasks(filteredNodes)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n // Install tools like Node-Exporter, Chrony and config changes like SSH ports, home dir.\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.Provisioned).build(),\n filteredNodes -> {\n createInstallNodeAgentTasks(filteredNodes)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n createWaitForNodeAgentTasks(nodesToBeCreated)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n createHookProvisionTask(filteredNodes, TriggerType.PreNodeProvision);\n createSetupServerTasks(\n filteredNodes, p -> p.ignoreUseCustomImageConfig = ignoreUseCustomImageConfig)\n .setSubTaskGroupType(SubTaskGroupType.Provisioning);\n });\n\n isNextFallThrough =\n applyOnNodesWithStatus(\n universe,\n nodesToBeCreated,\n isNextFallThrough,\n NodeStatus.builder().nodeState(NodeState.ServerSetup).build(),\n filteredNodes -> {\n createHookProvisionTask(filteredNodes, TriggerType.PostNodeProvision);\n });\n\n return isNextFallThrough;\n }"
] | [
"0.65244025",
"0.6406141",
"0.63889307",
"0.6239287",
"0.61567605",
"0.6084778",
"0.6066109",
"0.59794796",
"0.59703654",
"0.5969541",
"0.5955825",
"0.5866268",
"0.5866268",
"0.5866268",
"0.5862439",
"0.5790336",
"0.5788622",
"0.57871443",
"0.5786438",
"0.57564986",
"0.57415485",
"0.57372886",
"0.5719704",
"0.5717925",
"0.57061875",
"0.5698499",
"0.5682207",
"0.56818134",
"0.56502795",
"0.5646393",
"0.56412286",
"0.56378603",
"0.5631899",
"0.5624276",
"0.56041956",
"0.55988526",
"0.558887",
"0.5584994",
"0.558084",
"0.5575443",
"0.55709803",
"0.55550337",
"0.5550733",
"0.5527897",
"0.55234855",
"0.55191845",
"0.5515456",
"0.55145967",
"0.55116117",
"0.5508808",
"0.55053955",
"0.5485672",
"0.5483872",
"0.547529",
"0.5472421",
"0.5469732",
"0.54653364",
"0.54653364",
"0.5462537",
"0.54556894",
"0.54179674",
"0.5415729",
"0.5390778",
"0.5387025",
"0.5366554",
"0.53558016",
"0.53467876",
"0.5343784",
"0.5341365",
"0.5331833",
"0.53276986",
"0.53276145",
"0.53184086",
"0.5311996",
"0.5311595",
"0.5307323",
"0.53060555",
"0.53029555",
"0.5299909",
"0.52894723",
"0.5287869",
"0.52856255",
"0.52821946",
"0.5280508",
"0.5274939",
"0.52715814",
"0.5268803",
"0.5267845",
"0.52577066",
"0.5247227",
"0.5234348",
"0.52263045",
"0.52186257",
"0.5213441",
"0.5204785",
"0.5182779",
"0.51821315",
"0.5167843",
"0.51648456",
"0.5161288"
] | 0.6921817 | 0 |
Return the ServerSocketFactory used when a blocking IO is enabled. | public ServerSocketFactory getServerSocketFactory(){
return factory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public ISOServerSocketFactory getSocketFactory() {\n return socketFactory;\n }",
"public RMIServerSocketFactory getServerSocketFactory() {\n/* 140 */ return ((TCPEndpoint)this.ep).getServerSocketFactory();\n/* */ }",
"public final SSLServerSocketFactory getServerSocketFactory() {\n return spiImpl.engineGetServerSocketFactory();\n }",
"public final SSLSocketFactory getSocketFactory() {\n return spiImpl.engineGetSocketFactory();\n }",
"public static MultihomePlainSocketFactory getSocketFactory()\n/* */ {\n/* 69 */ return DEFAULT_FACTORY;\n/* */ }",
"public interface ServerSocketFactory {\n\n\t\tpublic ServerSocket create() throws IOException;\n\n\t}",
"public SocketFactory socketFactory() {\n return socketFactory;\n }",
"public String getSocketFactoryClass() {\n\t\treturn socketFactoryClass;\n\t}",
"public interface ServerSocketFactory {\n\n\n // --------------------------------------------------------- Public Methods\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, and is bound to a the specified port. The socket is\n * configured with the socket options (such as accept timeout)\n * given to this factory.\n *\n * @param port the port to listen to\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, is bound to a the specified port, and uses the\n * specified connection backlog. The socket is configured with\n * the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses only the specified network\n * interface on the local host, is bound to a the specified port,\n * and uses the specified connection backlog. The socket is configured\n * with the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n * @param ifAddress the network interface address to use\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n}",
"public SSLSocketFactory sslSocketFactory() {\n return sslSocketFactory;\n }",
"public RMIClientSocketFactory getClientSocketFactory() {\n/* 133 */ return ((TCPEndpoint)this.ep).getClientSocketFactory();\n/* */ }",
"public SSLSocket getSocket() throws IOException {\n SSLSocket sslSocket = (SSLSocket) socketFactory.createSocket(pkiServerAddress, pkiServerPort);\n\n sslSocket.setEnabledProtocols(enabledProtocols);\n sslSocket.setEnabledCipherSuites(enabledCipherSuites);\n sslSocket.setSoTimeout(pkiTimeout);\n\n return sslSocket;\n }",
"public static ServerSocket getServerSocket(){\n if (listener == null) {\n listener = createServerSocket();\n }\n return listener;\n }",
"void setSocketFactory(SocketFactory socketFactory);",
"proto.MessagesProtos.ClientRequest.Socket getSock();",
"public interface CallServerSocketFactory {\n /**\n * @param pServerAddress Server identifier (DNS, IP, URL, etc.), can null\n */\n ServerSocket createSocket(\n String pServerAddress, \n int pPort)\n throws \n IOException;\n}",
"public LocalSocketAddress getSockAddress() throws IOException {\n // This method has never been implemented.\n return null;\n }",
"public org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily getSocketFamily() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily.valueOf(socketFamily_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily.INET : result;\n }",
"public SSLConnectionSocketFactory sslConnectionSocketFactory() throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException {\n\t\treturn new SSLConnectionSocketFactory(sslContext(), NoopHostnameVerifier.INSTANCE);\n\t}",
"public org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily getSocketFamily() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily.valueOf(socketFamily_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily.INET : result;\n }",
"public proto.MessagesProtos.ClientRequest.Socket getSock() {\n\t\t\treturn sock_ == null ? proto.MessagesProtos.ClientRequest.Socket.getDefaultInstance() : sock_;\n\t\t}",
"boolean hasSocketFamily();",
"private NettyServerFactory getWebServerFactory() {\n String[] beanNames = getBeanFactory()\n .getBeanNamesForType(NettyServerFactory.class);\n if (beanNames.length == 0) {\n throw new ApplicationContextException(\n \"Unable to start NettyServerApplicationContext due to missing \"\n + \"NettyServerFactory bean.\");\n }\n if (beanNames.length > 1) {\n throw new ApplicationContextException(\n \"Unable to start NettyServerApplicationContext due to multiple \"\n + \"NettyServerFactory beans : \"\n + StringUtils.arrayToCommaDelimitedString(beanNames));\n }\n return getBeanFactory().getBean(beanNames[0], NettyServerFactory.class);\n }",
"private ThreadLocalSSLSocketFactory(SocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"public ServerSocket getServerSocket() {\n\t\treturn serverSocket;\n\t}",
"public ServerSocket getServerSocket()\n\t{\n\t\treturn serverSocket;\n\t}",
"protected SSLSocketProvider getSocketProvider()\n {\n return f_providerSocket;\n }",
"void setServerSocketFactory(String factoryClassName)\n throws ClassNotFoundException, InstantiationException, IllegalAccessException;",
"public ServerSocket getServerSocket() {\n return this.ss;\n }",
"public Socket createSocket() {\n try {\n // Create socket\n server = new Socket(\"127.0.0.1\", 8520);\n } catch (IOException ioe) {\n System.out.println(\"IOException: \" + ioe.getMessage());\n }\n return server;\n }",
"public static @NonNull ServerChannelFactory<? extends ServerChannel> serverChannelFactory() {\n return CURR_NETTY_TRANSPORT.serverChannelFactory();\n }",
"public boolean hasSocketFamily() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public boolean hasSocketFamily() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public void setServerSocketFactory(ServerSocketFactory factory){\n this.factory = factory;\n }",
"public proto.MessagesProtos.ClientRequest.Socket getSock() {\n\t\t\t\tif (sockBuilder_ == null) {\n\t\t\t\t\treturn sock_ == null ? proto.MessagesProtos.ClientRequest.Socket.getDefaultInstance() : sock_;\n\t\t\t\t} else {\n\t\t\t\t\treturn sockBuilder_.getMessage();\n\t\t\t\t}\n\t\t\t}",
"public Socket getSocket(){\n return null;\n }",
"private static Socket getSocket() \n{\n return socket; \n }",
"public proto.MessagesProtos.ClientRequest.SocketOrBuilder getSockOrBuilder() {\n\t\t\t\tif (sockBuilder_ != null) {\n\t\t\t\t\treturn sockBuilder_.getMessageOrBuilder();\n\t\t\t\t} else {\n\t\t\t\t\treturn sock_ == null ?\n\t\t\t\t\t\t\tproto.MessagesProtos.ClientRequest.Socket.getDefaultInstance() : sock_;\n\t\t\t\t}\n\t\t\t}",
"proto.MessagesProtos.ClientRequest.SocketOrBuilder getSockOrBuilder();",
"private Socket createClient()\n\t{\n\t\tSocket client = null;\n\t\ttry {\n\t\t\tclient = this.server.accept();\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tinsertLogEntry(e.getMessage(), e.getStackTrace().toString());\n\t\t}\n\t\t\n\t\treturn client;\n\t}",
"public proto.MessagesProtos.ClientRequest.SocketOrBuilder getSockOrBuilder() {\n\t\t\treturn getSock();\n\t\t}",
"public ServerSocket getSocket() {\n\t\treturn socket;\n\t}",
"org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily getSocketFamily();",
"public String getSocket() {\n return socket;\n }",
"public static NetworkHandling getTCPHandler() {\r\n\t\treturn networkHandling;\r\n\t}",
"public SocketAddress getLocalSocketAddress() {\n if (state >= BOUND)\n return new InetSocketAddress (localAddr, localPort);\n else\n return null;\n }",
"public static synchronized SSLSocketFactory getTrustingSocketFactory(String protocol) {\n SSLSocketFactory socFact=null;\n Validate.notBlank(protocol,\"Invalid SSL protocol\");\n socFact= socketFactMap.get(protocol);\n\n if (socFact==null) {\n try {\n // Install the all-trusting trust manager\n SSLContext sc = SSLContext.getInstance(protocol);\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n socFact= sc.getSocketFactory();\n socketFactMap.put(protocol, socFact);\n } catch (Exception e) {\n LOG.error(\"Error creating SSL socket factory\", e);\n }\n }\n\n return socFact;\n }",
"public final NetBIOSSocket getSocket() {\n return m_sessSock;\n }",
"public interface DatagramSocketFactory\n{\n /**\n * Creates an unbound DatagramSocket:\n * - i.e <tt>return new DatagramSocket((SocketAddress) null)</tt>.\n *\n * @return An unbound DatagramSocket.\n *\n * @throws SocketException if the socket could not be opened.\n */\n public DatagramSocket createUnboundDatagramSocket()\n throws SocketException;\n}",
"default String socket() {\n return WebServer.DEFAULT_SOCKET_NAME;\n }",
"private DelegatingSSLSocketFactory.SSLChannelMode bindSocketFactory(\n final DelegatingSSLSocketFactory.SSLChannelMode channelMode)\n throws IOException {\n DelegatingSSLSocketFactory.resetDefaultFactory();\n Configuration conf = new Configuration(false);\n conf.set(SSL_CHANNEL_MODE, channelMode.name());\n ClientConfiguration awsConf = new ClientConfiguration();\n awsConf.setProtocol(Protocol.HTTPS);\n bindSSLChannelMode(conf, awsConf);\n return DelegatingSSLSocketFactory.getDefaultFactory().getChannelMode();\n }",
"public static ServerSocket createServerSocket() {\n \t\n try {\n listener = new ServerSocket(PORT,1, InetAddress.getByName(hostname));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return listener;\n }",
"protected Socket getSocket()\n {\n return m_Socket;\n }",
"public proto.MessagesProtos.ClientRequest.Socket.Builder getSockBuilder() {\n\n\t\t\t\tonChanged();\n\t\t\t\treturn getSockFieldBuilder().getBuilder();\n\t\t\t}",
"public static SocketFactory m1384a(Context context) {\n Exception e;\n synchronized (f1359a) {\n try {\n if (f1360b == null) {\n f1360b = new C1226f(context);\n }\n return f1360b;\n } catch (KeyManagementException e2) {\n e = e2;\n C1202a.m1320d(\"TLSSocketFactory\", \"Failed to new TLSSocketFactory instance.\" + e.getMessage());\n return SSLSocketFactory.getDefault();\n } catch (NoSuchAlgorithmException e3) {\n e = e3;\n C1202a.m1320d(\"TLSSocketFactory\", \"Failed to new TLSSocketFactory instance.\" + e.getMessage());\n return SSLSocketFactory.getDefault();\n } catch (IOException e4) {\n e = e4;\n C1202a.m1320d(\"TLSSocketFactory\", \"Failed to new TLSSocketFactory instance.\" + e.getMessage());\n return SSLSocketFactory.getDefault();\n } catch (CertificateException e5) {\n e = e5;\n C1202a.m1320d(\"TLSSocketFactory\", \"Failed to new TLSSocketFactory instance.\" + e.getMessage());\n return SSLSocketFactory.getDefault();\n } catch (KeyStoreException e6) {\n e = e6;\n C1202a.m1320d(\"TLSSocketFactory\", \"Failed to new TLSSocketFactory instance.\" + e.getMessage());\n return SSLSocketFactory.getDefault();\n } catch (IllegalArgumentException e7) {\n e = e7;\n C1202a.m1320d(\"TLSSocketFactory\", \"Failed to new TLSSocketFactory instance.\" + e.getMessage());\n return SSLSocketFactory.getDefault();\n } catch (Throwable th) {\n throw th;\n }\n }\n }",
"void setJNPServerSocketFactory(String factoryClassName) \n throws ClassNotFoundException, InstantiationException, IllegalAccessException;",
"protected InputStream getInputStream() throws IOException\n {\n if (fd == null) {\n throw new IOException(\"socket not created\");\n }\n\n synchronized (this) {\n if (fis == null) {\n fis = new SocketInputStream();\n }\n\n return fis;\n }\n }",
"protected final Socket getSocket() {\n return socket;\n }",
"public static Socket getSocket(boolean reset) throws IOException {\n String serverAddress = \"rosmaster.duckdns.org\";\n int PORT = 8090;\n \n if (s == null ) {\n Logger.info(\"Attempting to connect to \" + serverAddress + \" on port \" + PORT);\n s = new Socket(serverAddress, PORT);\n Logger.info(\"Connection complete..\");\n in = new BufferedReader(new InputStreamReader(s.getInputStream())); \n out = new PrintWriter(s.getOutputStream(), true);\n if (in.readLine() == null) {\n Logger.info(\"Status OK from server.\");\n }\n }\n else if (reset) {\n s.shutdownInput();\n s.shutdownOutput();\n s.close();\n Logger.info(\"Attempting to reconnect to \" + serverAddress + \" on port \" + PORT);\n\n s = new Socket(serverAddress, PORT);\n Logger.info(\"Connection complete..\");\n in = new BufferedReader(new InputStreamReader(s.getInputStream())); \n out = new PrintWriter(s.getOutputStream(), true);\n if (in.readLine() == null) {\n Logger.info(\"Status OK from server.\");\n }\n }\n \n return s;\n }",
"public int getSocketTimeout() {\r\n return socketTimeout;\r\n }",
"public String getSocketFactoryPortProperty() {\n\n return unmaskProperty(EmailConnectionConstants.PROPERTY_SOCKET_FACTORY_PORT);\n }",
"public TrustingSSLSocketFactory() throws SSLException {\n\t\tSecurity.addProvider(new com.sun.net.ssl.internal.ssl.Provider());\n\t\tSystem.setProperty(\"java.protocol.handler.pkgs\", \"com.sun.net.ssl.internal.www.protocol\");\n\t\ttry {\n\t\t\tSSLContext sslContext;\n\t\t\tsslContext = SSLContext.getInstance(\"SSLv3\");\n\t\t\tsslContext.init(null, new TrustManager[]{new UtilSSLSocketFactory.TrustingX509TrustManager()}, null);\n\t\t\tfactory = sslContext.getSocketFactory();\n\t\t} catch (NoSuchAlgorithmException nsae) {\n\t\t\tthrow new SSLException(\"Unable to initialize the SSL context: \", nsae);\n\t\t} catch (KeyManagementException kme) {\n\t\t\tthrow new SSLException(\"Unable to register a trust manager: \", kme);\n\t\t}\n\t\tciphers = factory.getDefaultCipherSuites();\n\t}",
"public Timeout getSocketTimeout() {\n return socketTimeout;\n }",
"@Reference\n public void setServerSocketFactory(final ServerSocketFactory factory)\n {\n m_ServerSocketFactory = factory;\n }",
"public Boolean tcpReuseChannel();",
"public Socket getSocket() {\n return SOCKET;\n }",
"public DatagramSocket getSocket() {\n\t\treturn socket;\n\t}",
"SocketAddress socketAddress();",
"public org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol getSocketProtocol() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol.valueOf(socketProtocol_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol.UDP : result;\n }",
"public void setSocketFactory(ISOServerSocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"public Socket getSocket()\n {\n return socket;\n }",
"void setClientSocketFactory(String factoryClassName)\n throws ClassNotFoundException, InstantiationException, IllegalAccessException;",
"public Socket createSocket()\n/* */ {\n/* 82 */ return new Socket();\n/* */ }",
"public Socket getSocket() {\n\t\treturn socket;\n\t}",
"Socket getSocket()\n {\n return socket;\n }",
"public static int openSocket() throws IOException {\n serverSocket = new ServerSocket(0, 10, InetAddress.getLocalHost());\n return serverSocket.getLocalPort();\n }",
"public org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol getSocketProtocol() {\n org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol result = org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol.valueOf(socketProtocol_);\n return result == null ? org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketProtocol.UDP : result;\n }",
"public Socket getSocket() {\n return mSocket;\n }",
"private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }",
"public int getSoLinger()\r\n/* 123: */ {\r\n/* 124: */ try\r\n/* 125: */ {\r\n/* 126:149 */ return this.javaSocket.getSoLinger();\r\n/* 127: */ }\r\n/* 128: */ catch (SocketException e)\r\n/* 129: */ {\r\n/* 130:151 */ throw new ChannelException(e);\r\n/* 131: */ }\r\n/* 132: */ }",
"boolean hasSocketProtocol();",
"private Socket newSocket() throws IOException {\n try {\n InetAddress hostAddress = InetAddress.getByName(publicAddress);\n return new Socket(hostAddress, AgentRemoteService.PORT);\n } catch (IOException e) {\n throw new IOException(\"Couldn't connect to publicAddress: \" + publicAddress + \":\" + AgentRemoteService.PORT, e);\n }\n }",
"public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;",
"public ServerSocket createServerSocket(int arg0) throws IOException {\n return null;\n }",
"private MySSLSocketFactory m37638a() {\n try {\n if (f25720m == null || f25720m.get() == null) {\n f25720m = new SoftReference<>(new MySSLSocketFactory(AuthConfigManager.f26522c, this.f25724d));\n }\n MySSLSocketFactory atVar = f25719k != null ? f25720m.get() : null;\n return atVar == null ? new MySSLSocketFactory(AuthConfigManager.f26522c, this.f25724d) : atVar;\n } catch (Throwable th) {\n SDKLogHandler.m37519b(th, \"ht\", \"gsf\");\n return null;\n }\n }",
"public SocketAddress getSocketAddress() {\n\t\treturn socketAddress;\r\n\t}",
"public Boolean tcpReuseConn();",
"public DNSConnector getConnector() {\r\n\t\treturn (new DNSUDPConnector());\r\n\t}",
"private static void createServerSocket() throws SocketTimeoutException, IOException, SocketTimeoutException {\r\n serverSocket.setSoTimeout(10000);\r\n socket = serverSocket.accept();\r\n System.out.println(\"Server: connection to: \" + socket.getInetAddress());\r\n }",
"protected synchronized Socket getSocket(ImmutableEndpoint endpoint) throws TlcException {\r\n\t\tSocket socket = null;\r\n\t\ttry {\r\n\t\t\tTcpSocketKey socketKey = new TcpSocketKey(endpoint);\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"borrowing socket for \" + socketKey + \"/\"\r\n\t\t\t\t\t\t+ socketKey.hashCode());\r\n\t\t\t\tif (null != lastSocketKey) {\r\n\t\t\t\t\tlogger.debug(\"same as \" + lastSocketKey.hashCode() + \"? \"\r\n\t\t\t\t\t\t\t+ lastSocketKey.equals(socketKey));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tsocket = (Socket) socketsPool.borrowObject(socketKey);\r\n\r\n\t\t\tif (logger.isDebugEnabled()) {\r\n\t\t\t\tlogger.debug(\"borrowed socket, \"\r\n\t\t\t\t\t\t+ (socket.isClosed() ? \"closed\" : \"open\") + \"; debt \"\r\n\t\t\t\t\t\t+ socketsPool.getNumActive());\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tlogger.error(\"Connection Refused\");\r\n\r\n\t\t}\r\n\t\treturn socket;\r\n\t}",
"protected SocketChannel getSocket() {\n\t\treturn channel;\n\t}",
"public int createSocket()\n\t{\n\t\t\n\t}",
"AsynchronousSocketChannel getOutgoingSocket() {\n return outgoingSocket;\n }",
"public ConnectionFactory getConnectionFactory() {\n return connectionFactory;\n }",
"public int getSocketTimeout()\n {\n return _socketTimeout;\n }",
"public ThreadFactory threadFactory() {\n return threadFactory_;\n }",
"protected OutputStream getOutputStream() throws IOException\n { \n if (fd == null) {\n throw new IOException(\"socket not created\");\n }\n\n synchronized (this) {\n if (fos == null) {\n fos = new SocketOutputStream();\n }\n\n return fos;\n }\n }",
"public DatagramSocket createUnboundDatagramSocket()\n throws SocketException;",
"public InetSocketAddress getRemoteAddressTCP() {\r\n\t\tSocketChannel socketChannel = tcp.socketChannel;\r\n\t\tif (socketChannel != null) {\r\n\t\t\tSocket socket = tcp.socketChannel.socket();\r\n\t\t\tif (socket != null) {\r\n\t\t\t\treturn (InetSocketAddress) socket.getRemoteSocketAddress();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public StateSocket getStateSocket() {\n return stateSocket;\n }"
] | [
"0.7463355",
"0.70276976",
"0.70178956",
"0.6975813",
"0.6841088",
"0.68059075",
"0.66930544",
"0.66465914",
"0.6288368",
"0.6269624",
"0.62597644",
"0.6139656",
"0.5858313",
"0.5857413",
"0.58518714",
"0.5772125",
"0.57630277",
"0.57600576",
"0.57587206",
"0.5732292",
"0.56365544",
"0.55902034",
"0.55727184",
"0.55670404",
"0.55665135",
"0.5561053",
"0.55450535",
"0.5530811",
"0.5483379",
"0.546318",
"0.5445568",
"0.54428935",
"0.54185694",
"0.54103535",
"0.5384338",
"0.5378813",
"0.5376726",
"0.5352342",
"0.5338988",
"0.5338734",
"0.53233624",
"0.5323307",
"0.53221035",
"0.5321994",
"0.53052837",
"0.53047717",
"0.52825445",
"0.5274284",
"0.52720755",
"0.5262201",
"0.5257075",
"0.52538234",
"0.524674",
"0.52375567",
"0.52300483",
"0.5217714",
"0.5202198",
"0.5197563",
"0.51899195",
"0.51879114",
"0.5184363",
"0.5180661",
"0.5162151",
"0.5138585",
"0.51382416",
"0.51379",
"0.51191884",
"0.5113626",
"0.5100471",
"0.5090457",
"0.5088173",
"0.50845724",
"0.50815994",
"0.5072184",
"0.50685215",
"0.50611204",
"0.5057741",
"0.5041684",
"0.50238395",
"0.50147855",
"0.49965498",
"0.4988724",
"0.4948545",
"0.49476776",
"0.4946362",
"0.49384993",
"0.49337",
"0.49309164",
"0.49184367",
"0.48964882",
"0.48939857",
"0.48827448",
"0.48826146",
"0.48780653",
"0.48702812",
"0.48670486",
"0.48669937",
"0.48661557",
"0.48584688",
"0.48537058"
] | 0.74743587 | 0 |
Set the ServerSocketFactory used when a blocking IO is enabled. | public void setServerSocketFactory(ServerSocketFactory factory){
this.factory = factory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setSocketFactory(SocketFactory socketFactory);",
"@Reference\n public void setServerSocketFactory(final ServerSocketFactory factory)\n {\n m_ServerSocketFactory = factory;\n }",
"void setServerSocketFactory(String factoryClassName)\n throws ClassNotFoundException, InstantiationException, IllegalAccessException;",
"public void setSocketFactory(ISOServerSocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"void setJNPServerSocketFactory(String factoryClassName) \n throws ClassNotFoundException, InstantiationException, IllegalAccessException;",
"void setClientSocketFactory(String factoryClassName)\n throws ClassNotFoundException, InstantiationException, IllegalAccessException;",
"public void setSocketFactoryClass(String socketFactoryClass) {\n\t\tthis.socketFactoryClass = socketFactoryClass;\n\t}",
"public void setSocket(SocketWrapper socket);",
"public ServerSocketFactory getServerSocketFactory(){\n return factory;\n }",
"public interface ServerSocketFactory {\n\n\t\tpublic ServerSocket create() throws IOException;\n\n\t}",
"public interface ServerSocketFactory {\n\n\n // --------------------------------------------------------- Public Methods\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, and is bound to a the specified port. The socket is\n * configured with the socket options (such as accept timeout)\n * given to this factory.\n *\n * @param port the port to listen to\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses all network interfaces on\n * the host, is bound to a the specified port, and uses the\n * specified connection backlog. The socket is configured with\n * the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n /**\n * Returns a server socket which uses only the specified network\n * interface on the local host, is bound to a the specified port,\n * and uses the specified connection backlog. The socket is configured\n * with the socket options (such as accept timeout) given to this factory.\n *\n * @param port the port to listen to\n * @param backlog how many connections are queued\n * @param ifAddress the network interface address to use\n *\n * @exception IOException input/output or network error\n * @exception KeyStoreException error instantiating the\n * KeyStore from file (SSL only)\n * @exception NoSuchAlgorithmException KeyStore algorithm unsupported\n * by current provider (SSL only)\n * @exception CertificateException general certificate error (SSL only)\n * @exception UnrecoverableKeyException internal KeyStore problem with\n * the certificate (SSL only)\n * @exception KeyManagementException problem in the key management\n * layer (SSL only)\n */\n public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;\n\n\n}",
"private ThreadLocalSSLSocketFactory(SocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"public void setSSLSocketFactory(final SSLSocketFactory ssf) {\n this.sslSocketFactory = ssf;\n }",
"public ISOServerSocketFactory getSocketFactory() {\n return socketFactory;\n }",
"public static MultihomePlainSocketFactory getSocketFactory()\n/* */ {\n/* 69 */ return DEFAULT_FACTORY;\n/* */ }",
"public RMIServerSocketFactory getServerSocketFactory() {\n/* 140 */ return ((TCPEndpoint)this.ep).getServerSocketFactory();\n/* */ }",
"public void setSocketChannel(SocketChannel socketChannel);",
"public void setSslSocketFactory(SSLSocketFactory sslSocketFactory) {\n this.sslSocketFactory = sslSocketFactory;\n }",
"public void setSocket(ServerSocket socket) {\n\t\tthis.socket = socket;\n\t}",
"public static void setServerSocket(ServerSocket serverSocket) {\n\t\tServer.serverSocket = serverSocket;\n\t}",
"public final SSLServerSocketFactory getServerSocketFactory() {\n return spiImpl.engineGetServerSocketFactory();\n }",
"private ServerSocket setUpServer(){\n ServerSocket serverSocket = null;\n try{\n serverSocket = new ServerSocket(SERVER_PORT);\n\n }\n catch (IOException ioe){\n throw new RuntimeException(ioe.getMessage());\n }\n return serverSocket;\n }",
"public SocketFactory socketFactory() {\n return socketFactory;\n }",
"public interface CallServerSocketFactory {\n /**\n * @param pServerAddress Server identifier (DNS, IP, URL, etc.), can null\n */\n ServerSocket createSocket(\n String pServerAddress, \n int pPort)\n throws \n IOException;\n}",
"public MockSocket () {\n state = UNBOUND;\n }",
"public String getSocketFactoryClass() {\n\t\treturn socketFactoryClass;\n\t}",
"public Builder clearSocketFamily() {\n bitField0_ = (bitField0_ & ~0x00000002);\n socketFamily_ = 1;\n onChanged();\n return this;\n }",
"protected final void setSocket(Socket socket) {\n this.socket = socket;\n }",
"private void setSockets()\n {\n String s = (String) JOptionPane.showInputDialog(null,\n \"Select Number of Sockets:\", \"Sockets\",\n JOptionPane.PLAIN_MESSAGE, null, socketSelect, \"1\");\n\n if ((s != null) && (s.length() > 0))\n {\n totalNumThreads = Integer.parseInt(s);\n }\n else\n {\n totalNumThreads = 1;\n }\n\n recoveryQueue.setMaxSize(totalNumThreads * 10);\n }",
"public Builder setSock(proto.MessagesProtos.ClientRequest.Socket value) {\n\t\t\t\tif (sockBuilder_ == null) {\n\t\t\t\t\tif (value == null) {\n\t\t\t\t\t\tthrow new NullPointerException();\n\t\t\t\t\t}\n\t\t\t\t\tsock_ = value;\n\t\t\t\t\tonChanged();\n\t\t\t\t} else {\n\t\t\t\t\tsockBuilder_.setMessage(value);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}",
"public void setSocketTimeout(final int socketTimeout) {\n this.newSoTimeout = socketTimeout;\n }",
"public Builder setSock(\n\t\t\t\t\tproto.MessagesProtos.ClientRequest.Socket.Builder builderForValue) {\n\t\t\t\tif (sockBuilder_ == null) {\n\t\t\t\t\tsock_ = builderForValue.build();\n\t\t\t\t\tonChanged();\n\t\t\t\t} else {\n\t\t\t\t\tsockBuilder_.setMessage(builderForValue.build());\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}",
"public void setSocketOptions(Socket socket) throws IOException\n {\n socket.setSoTimeout(config.getTimeout());\n socket.setTrafficClass(0x18);\n socket.setTcpNoDelay(true);\n }",
"public void makeSecure(SSLServerSocketFactory sslServerSocketFactory, String[] sslProtocols) {\n\t\tthis.serverSocketFactory = new SecureServerSocketFactory(sslServerSocketFactory,\n\t\t\t\tsslProtocols);\n\t}",
"private void initServerSock(int port) throws IOException {\n\tserver = new ServerSocket(port);\n\tserver.setReuseAddress(true);\n }",
"private DelegatingSSLSocketFactory.SSLChannelMode bindSocketFactory(\n final DelegatingSSLSocketFactory.SSLChannelMode channelMode)\n throws IOException {\n DelegatingSSLSocketFactory.resetDefaultFactory();\n Configuration conf = new Configuration(false);\n conf.set(SSL_CHANNEL_MODE, channelMode.name());\n ClientConfiguration awsConf = new ClientConfiguration();\n awsConf.setProtocol(Protocol.HTTPS);\n bindSSLChannelMode(conf, awsConf);\n return DelegatingSSLSocketFactory.getDefaultFactory().getChannelMode();\n }",
"public final SSLSocketFactory getSocketFactory() {\n return spiImpl.engineGetSocketFactory();\n }",
"@Before\n public void setUp() throws IOException {\n serverSocket = new ServerSocket(0, 1);\n }",
"public ClientTSap(SocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"public SocketChannelConfig setTcpNoDelay(boolean tcpNoDelay)\r\n/* 258: */ {\r\n/* 259: */ try\r\n/* 260: */ {\r\n/* 261:255 */ this.javaSocket.setTcpNoDelay(tcpNoDelay);\r\n/* 262: */ }\r\n/* 263: */ catch (SocketException e)\r\n/* 264: */ {\r\n/* 265:257 */ throw new ChannelException(e);\r\n/* 266: */ }\r\n/* 267:259 */ return this;\r\n/* 268: */ }",
"public void setSocketRetries(int retries);",
"private static void createServerSocket() throws SocketTimeoutException, IOException, SocketTimeoutException {\r\n serverSocket.setSoTimeout(10000);\r\n socket = serverSocket.accept();\r\n System.out.println(\"Server: connection to: \" + socket.getInetAddress());\r\n }",
"public void setSocketTimeout(int socketTimeout)\n {\n this._socketTimeout = socketTimeout;\n }",
"public SSLSocketFactory sslSocketFactory() {\n return sslSocketFactory;\n }",
"void setReceiveSocket(LcapSocket socket) {\n rcvSocket = socket;\n }",
"public void setSocketMessageListenerFactory(final ComponentFactory factory)\n {\n m_SocketMessageListenerFactory = factory;\n }",
"private void initServerSocket()\n\t{\n\t\tboundPort = new InetSocketAddress(port);\n\t\ttry\n\t\t{\n\t\t\tserverSocket = new ServerSocket(port);\n\n\t\t\tif (serverSocket.isBound())\n\t\t\t{\n\t\t\t\tSystem.out.println(\"Server bound to data port \" + serverSocket.getLocalPort() + \" and is ready...\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Unable to initiate socket.\");\n\t\t}\n\n\t}",
"public void setSocketTimeout(int socketTimeout) {\r\n this.socketTimeout = socketTimeout;\r\n }",
"public Boolean tcpReuseChannel();",
"public Builder setSocketFamily(org.graylog.plugins.dnstap.protos.DnstapOuterClass.SocketFamily value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000002;\n socketFamily_ = value.getNumber();\n onChanged();\n return this;\n }",
"public Boolean tcpReuseConn();",
"public void setSocket(String socket) {\n this.socket = socket == null ? null : socket.trim();\n }",
"protected void setFactory(HttpClientFactory factory) {\n\t\tthis.factory = factory;\n\t}",
"public SocketChannelConfig setSoLinger(int soLinger)\r\n/* 241: */ {\r\n/* 242: */ try\r\n/* 243: */ {\r\n/* 244:241 */ if (soLinger < 0) {\r\n/* 245:242 */ this.javaSocket.setSoLinger(false, 0);\r\n/* 246: */ } else {\r\n/* 247:244 */ this.javaSocket.setSoLinger(true, soLinger);\r\n/* 248: */ }\r\n/* 249: */ }\r\n/* 250: */ catch (SocketException e)\r\n/* 251: */ {\r\n/* 252:247 */ throw new ChannelException(e);\r\n/* 253: */ }\r\n/* 254:249 */ return this;\r\n/* 255: */ }",
"public void init() throws IOException {\r\n try {\r\n serverSocket = new ServerSocket(PORT);\r\n this.running = true;\r\n } catch (IOException e) {\r\n System.out.println(e);\r\n }\r\n }",
"private void initBinding() throws IOException {\n serverSocketChannel.bind(new InetSocketAddress(0));\n serverSocketChannel.configureBlocking(false);\n serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);\n\n sc.configureBlocking(false);\n var key = sc.register(selector, SelectionKey.OP_CONNECT);\n uniqueContext = new ClientContext(key, this);\n key.attach(uniqueContext);\n sc.connect(serverAddress);\n }",
"@Override\n public void initEndpoint() throws IOException, InstantiationException {\n SelectorThreadConfig.configure(this);\n \n initFileCacheFactory();\n initAlgorithm();\n initPipeline();\n initMonitoringLevel();\n \n setName(\"SelectorThread-\" + getPort());\n \n try{\n if (getInet() == null) {\n setServerSocket(getServerSocketFactory().createSocket(getPort(),\n getSsBackLog()));\n } else {\n setServerSocket(getServerSocketFactory().createSocket(getPort(), \n getSsBackLog(), getInet()));\n }\n getServerSocket().setReuseAddress(true); \n } catch (SocketException ex){\n throw new BindException(ex.getMessage() + \": \" + getPort());\n }\n \n getServerSocket().setSoTimeout(getServerTimeout());\n initReadBlockingTask(getMinReadQueueLength());\n \n setInitialized(true); \n getLogger().log(Level.FINE,\"Initializing Grizzly Blocking Mode\"); \n // Since NIO is not used, rely on Coyote for buffering the response.\n setBufferResponse(true);\n }",
"public void openServer() {\n try {\n this.serverSocket = new ServerSocket(this.portNumber);\n } catch (IOException ex) {\n System.out.println(ex);\n }\n }",
"protected void bind() throws SocketException {\n super.bind();\n\n //start the secure socket\n dtlsSocket = options.getSecurePort() > 0 ? new DatagramSocket(options.getSecurePort()) : new DatagramSocket();\n dtslReceiverThread = createDatagramServer(\"mqttsn-dtls-receiver\", options.getReceiveBuffer(), dtlsSocket);\n }",
"public SSLSocket getSocket() throws IOException {\n SSLSocket sslSocket = (SSLSocket) socketFactory.createSocket(pkiServerAddress, pkiServerPort);\n\n sslSocket.setEnabledProtocols(enabledProtocols);\n sslSocket.setEnabledCipherSuites(enabledCipherSuites);\n sslSocket.setSoTimeout(pkiTimeout);\n\n return sslSocket;\n }",
"public RMIClientSocketFactory getClientSocketFactory() {\n/* 133 */ return ((TCPEndpoint)this.ep).getClientSocketFactory();\n/* */ }",
"public ServerSocket createSocket (int port, int backlog,\n InetAddress ifAddress)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;",
"public static SSLServerSocketFactory makeSSLSocketFactory(KeyStore loadedKeyStore,\n\t\t\tKeyManagerFactory loadedKeyFactory) throws IOException {\n\t\ttry {\n\t\t\treturn makeSSLSocketFactory(loadedKeyStore, loadedKeyFactory.getKeyManagers());\n\t\t} catch (Exception e) {\n\t\t\tthrow new IOException(e.getMessage());\n\t\t}\n\t}",
"private void createServerSocket()\r\n {\r\n\t\tDebug.assert(port != 0, \"(Server/105)\");\r\n try {\r\n serverSocket = new ServerSocket(port);\r\n serverSocket.setSoTimeout(TIMEOUT);\r\n\t }\r\n\t catch (IOException e)\r\n\t \t{\r\n log(\"Could not create ServerSocket on port \" + port);\r\n\t \tDebug.printStackTrace(e);\r\n System.exit(-1);\r\n\t }\r\n }",
"@Override\n protected void initFactory() throws IOException {\n\n try {\n SSLContext context = getContext();\n sslFactory = context.getSocketFactory();\n } catch (Exception e) {\n if (e instanceof IOException) {\n throw (IOException) e;\n }\n throw new IOException(e.getMessage());\n }\n }",
"static void toggleMode(String server, int port) {\n Socket socket;\n\n try {\n socket = new Socket(server, port);\n socket.close();\n }\n catch(IOException x) {\n System.out.println(\"Socket error.\");\n x.printStackTrace();\n }\n}",
"public void setServer(BluetoothServerSocket bluetoothServerSocket){\n // Primeiro passo: Verifica se o servidor já está aberto e o fecha.\n if (isAvailable()){\n closeConnection();\n }\n // Segundo passo: Define a nova instância do servidor.\n this.bluetoothServerSocket = bluetoothServerSocket;\n }",
"protected void updateSocketWithOptions(final MongoClientConfiguration config)\n throws SocketException {\n mySocket.setKeepAlive(config.isUsingSoKeepalive());\n mySocket.setSoTimeout(config.getReadTimeout());\n try {\n mySocket.setTcpNoDelay(true);\n }\n catch (final SocketException seIgnored) {\n // The junixsocket implementation does not support TCP_NO_DELAY,\n // which makes sense but it throws an exception instead of silently\n // ignoring - ignore it here.\n if (!\"AFUNIXSocketException\".equals(seIgnored.getClass()\n .getSimpleName())) {\n throw seIgnored;\n }\n }\n mySocket.setPerformancePreferences(1, 5, 6);\n }",
"boolean hasSocketFamily();",
"public void setSoTimeout(int s) throws SocketException {\n\t\t// limit time to wait on blocking operations (0 = indefinite)\n\t\tcon.setSoTimeout(s);\n\t}",
"public boolean hasSocketFamily() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public boolean hasSocketFamily() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }",
"public Builder clearSocketProtocol() {\n bitField0_ = (bitField0_ & ~0x00000004);\n socketProtocol_ = 1;\n onChanged();\n return this;\n }",
"private void createSocket() throws Exception {\n try {\n socket = new Socket();\n socket.setTcpNoDelay(true);\n } catch (SocketException e) {\n throw new Exception();\n }\n }",
"BlockingConnection(Socket socket, CapabilitiesVMFactory capabilitiesVMFactory,\n Acceptor acceptor, MessagesSupportedVendorMessage supportedVendorMessage,\n MessageFactory messageFactory, NetworkManager networkManager,\n NetworkInstanceUtils networkInstanceUtils) {\n super(socket, capabilitiesVMFactory, supportedVendorMessage, networkManager, acceptor,\n networkInstanceUtils);\n this.socketsManager = null;\n this.messageFactory = messageFactory;\n }",
"@Override\n\tpublic void set(SocketAddress v) {\n\t\tsuper.set(Objects.requireNonNull(v));\n\t}",
"public final synchronized void setSocketTimeout(final int timeout) {\n HttpConnectionParams.setSoTimeout(params, timeout);\n }",
"public void creatSocket() {\n\n try {\n\n server = new ServerSocket(PORT);\n\n mExecutorService = Executors.newCachedThreadPool();\n\n while (true) {\n\n Socket client = server.accept();\n\n mExecutorService.execute(new SockectService(client));\n\n Log.d(TAG, \"Creating Socket\" );\n\n }\n\n } catch (Exception e) {\n\n e.printStackTrace();\n\n }\n\n }",
"private void setUpServerThread() {\n\t\ttry {\n\t\t\tthis.incomingMsgNodes = new TCPServerThread(0, this);\n\t\t\tThread thread = new Thread(incomingMsgNodes);\n\t\t\tthread.start();\n\t\t\tthis.myServerThreadPortNum = incomingMsgNodes.getPort();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage()\n\t\t\t\t\t+ \" Trouble creating Server Socket\");\n\t\t}\n\t}",
"public DefaultSocketChannelConfig(SocketChannel channel, Socket javaSocket)\r\n/* 23: */ {\r\n/* 24: 46 */ super(channel);\r\n/* 25: 47 */ if (javaSocket == null) {\r\n/* 26: 48 */ throw new NullPointerException(\"javaSocket\");\r\n/* 27: */ }\r\n/* 28: 50 */ this.javaSocket = javaSocket;\r\n/* 29: 53 */ if (PlatformDependent.canEnableTcpNoDelayByDefault()) {\r\n/* 30: */ try\r\n/* 31: */ {\r\n/* 32: 55 */ setTcpNoDelay(true);\r\n/* 33: */ }\r\n/* 34: */ catch (Exception localException) {}\r\n/* 35: */ }\r\n/* 36: */ }",
"@Override\r\n\tpublic void initial() {\n\t\ttry {\r\n\t\t\tserverSocket = new ServerSocket(port);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// System.out.println(\"LocalProxy run on \" + port);\r\n\t}",
"@Override\n public Socket connectSocket(int connectTimeout, Socket socket, HttpHost host, InetSocketAddress remoteAddress, InetSocketAddress localAddress, HttpContext context) throws IOException {\n InetSocketAddress unresolvedRemote = InetSocketAddress\n .createUnresolved(host.getHostName(), remoteAddress.getPort());\n return super.connectSocket(connectTimeout, socket, host, unresolvedRemote, localAddress, context);\n }",
"public SocketChannelConfig setReuseAddress(boolean reuseAddress)\r\n/* 215: */ {\r\n/* 216: */ try\r\n/* 217: */ {\r\n/* 218:221 */ this.javaSocket.setReuseAddress(reuseAddress);\r\n/* 219: */ }\r\n/* 220: */ catch (SocketException e)\r\n/* 221: */ {\r\n/* 222:223 */ throw new ChannelException(e);\r\n/* 223: */ }\r\n/* 224:225 */ return this;\r\n/* 225: */ }",
"public TrustingSSLSocketFactory() throws SSLException {\n\t\tSecurity.addProvider(new com.sun.net.ssl.internal.ssl.Provider());\n\t\tSystem.setProperty(\"java.protocol.handler.pkgs\", \"com.sun.net.ssl.internal.www.protocol\");\n\t\ttry {\n\t\t\tSSLContext sslContext;\n\t\t\tsslContext = SSLContext.getInstance(\"SSLv3\");\n\t\t\tsslContext.init(null, new TrustManager[]{new UtilSSLSocketFactory.TrustingX509TrustManager()}, null);\n\t\t\tfactory = sslContext.getSocketFactory();\n\t\t} catch (NoSuchAlgorithmException nsae) {\n\t\t\tthrow new SSLException(\"Unable to initialize the SSL context: \", nsae);\n\t\t} catch (KeyManagementException kme) {\n\t\t\tthrow new SSLException(\"Unable to register a trust manager: \", kme);\n\t\t}\n\t\tciphers = factory.getDefaultCipherSuites();\n\t}",
"public ServerSocket createServerSocket(int arg0) throws IOException {\n return null;\n }",
"private void openCtrlSocket() {\n ctrlThreadTask = ThreadTasks.OPEN;\n }",
"private void startNonBlockingListen() throws Exception {\n nioServer = new NioServer(null,8880);\n serverThread = (new Thread(nioServer));\n serverThread.setName(\"Server Thread\");\n serverThread.setDaemon(true);\n serverThread.start();\n }",
"public static ServerSocket createServerSocket() {\n \t\n try {\n listener = new ServerSocket(PORT,1, InetAddress.getByName(hostname));\n } catch (IOException e) {\n e.printStackTrace();\n }\n return listener;\n }",
"public ServerSocket createSocket (int port, int backlog)\n throws IOException, KeyStoreException, NoSuchAlgorithmException,\n CertificateException, UnrecoverableKeyException,\n KeyManagementException;",
"public void start() throws IOException {\n\t\tserverSocket = new ServerSocket(port);\n\t\tserverCallbacks.forEach(c -> c.onServerStarted(this, port));\n\t}",
"public void testSSLSocketInetAddressint() throws Exception {\n ServerSocket ss = new ServerSocket(0);\n SSLSocket soc = new MySSLSocket(InetAddress.getLocalHost(), ss\n .getLocalPort());\n ss.close();\n soc.close();\n }",
"public void setConnectionFactory(AbstractConnectionFactory connectionFactory) {\n\t\tif (connectionFactory instanceof AbstractClientConnectionFactory) {\n\t\t\tthis.clientConnectionFactory = connectionFactory;\n\t\t} else {\n\t\t\tthis.serverConnectionFactory = connectionFactory;\n\t\t\tconnectionFactory.registerSender(this);\n\t\t}\n\t}",
"public TCPSocketServer(){\n this.port=DEFAULT_SERVER_PORT;\n socketList = Collections.synchronizedList(new ArrayList<>());// Maintain a list of socket list. This uses synchronized list since\n // the terminate does not\n this.logWriter = new LogWriter(fileWriterQueue);\n log.info(\"Starting log writer..\");\n logWriter.start();\n this.periodicReportingService = new PeriodicReportingService();\n this.periodicReportingService.start();\n this.orderShutdown = new AtomicBoolean(false);\n Thread shutdownThread = new Thread(new ShutdownTask());\n log.info(\"Starting shutdown threads..\");\n shutdownThread.start();\n\n }",
"public static Socket getSocket(boolean reset) throws IOException {\n String serverAddress = \"rosmaster.duckdns.org\";\n int PORT = 8090;\n \n if (s == null ) {\n Logger.info(\"Attempting to connect to \" + serverAddress + \" on port \" + PORT);\n s = new Socket(serverAddress, PORT);\n Logger.info(\"Connection complete..\");\n in = new BufferedReader(new InputStreamReader(s.getInputStream())); \n out = new PrintWriter(s.getOutputStream(), true);\n if (in.readLine() == null) {\n Logger.info(\"Status OK from server.\");\n }\n }\n else if (reset) {\n s.shutdownInput();\n s.shutdownOutput();\n s.close();\n Logger.info(\"Attempting to reconnect to \" + serverAddress + \" on port \" + PORT);\n\n s = new Socket(serverAddress, PORT);\n Logger.info(\"Connection complete..\");\n in = new BufferedReader(new InputStreamReader(s.getInputStream())); \n out = new PrintWriter(s.getOutputStream(), true);\n if (in.readLine() == null) {\n Logger.info(\"Status OK from server.\");\n }\n }\n \n return s;\n }",
"public static ServerSocket getServerSocket(){\n if (listener == null) {\n listener = createServerSocket();\n }\n return listener;\n }",
"private static Socket getSocket() \n{\n return socket; \n }",
"private void startFedServer(){\r\n \r\n try {\r\n System.out.println(\"Start server to listen for client connection....\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Start server to listen for client connection....\", \"info\");\r\n sSocket = new ServerSocket(serverPort);\r\n sSocket.setReuseAddress(true);\r\n //System.out.println(\"FedServer is launching\");\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Error listening on port \" + serverPort, \"severe\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n List<Thread> proc_list = new ArrayList();\r\n while (FLAG) {\r\n if (proc_list.size() == PROC_MAX) {\r\n boolean full = true;\r\n //check if thread number reach the maximum number, if yes, sleep; \r\n while (full) {\r\n for (int i = proc_list.size() - 1; i >= 0; i--) {\r\n if (!proc_list.get(i).isAlive()) {\r\n proc_list.remove(i);\r\n full = false;\r\n }\r\n }\r\n if (full) {\r\n try {\r\n Thread.sleep(1000);\r\n } catch (InterruptedException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n }\r\n }\r\n }\r\n //if not full, accpet new client connection\r\n try {\r\n cSocket = sSocket.accept();\r\n //System.out.println(\"[C4C-Notification] Accept connection from client\");\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", \"Accept connection from client\", \"info\");\r\n //create new thread to process client request\r\n // System.out.println(\"Accept connection from client -step 1\");\r\n Thread request = new Thread(new processRequest(cSocket));\r\n request.start();\r\n proc_list.add(request);\r\n } catch (IOException ex) {\r\n FedLog.writeLog(this.getPeerIP().split(\":\")[1], \"masterLog%g-\" + this.getPeerIP().substring(2) + \".log\", FedLog.getExceptionStack(ex), \"severe\");\r\n }\r\n\r\n }\r\n closeFedSockets();\r\n }",
"@Override\r\n\tpublic void start() {\n\t\tscavenger.start();\r\n\t\tnew Thread() {\r\n\t\t\tpublic void run() {\r\n\t\t\t\twhile (!serverSocket.isClosed()) {\r\n\t\t\t\t\tSocket socket = null;\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tsocket = serverSocket.accept();\r\n\t\t\t\t\t\tscavenger.addSocket(socket);\r\n\t\t\t\t\t\tnew SynchronousSocketThread(socket).start();\r\n\t\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}.start();\r\n\t}",
"void resetPeakServerSocketCount();",
"protected SSLSocketProvider getSocketProvider()\n {\n return f_providerSocket;\n }"
] | [
"0.7638096",
"0.7330967",
"0.7160324",
"0.7042964",
"0.6597734",
"0.653401",
"0.6431928",
"0.6401947",
"0.6360911",
"0.63169867",
"0.61911535",
"0.6084227",
"0.6005068",
"0.59286964",
"0.58649135",
"0.5864677",
"0.57659626",
"0.5762533",
"0.5682623",
"0.56808513",
"0.565996",
"0.56492615",
"0.54775804",
"0.5466271",
"0.5429807",
"0.53897583",
"0.5384359",
"0.53672165",
"0.5350459",
"0.5334801",
"0.53226036",
"0.5307224",
"0.53028435",
"0.5278008",
"0.5268513",
"0.52258116",
"0.5221867",
"0.5215313",
"0.52132374",
"0.5176873",
"0.51642406",
"0.5141148",
"0.51257193",
"0.51221",
"0.51202774",
"0.5085246",
"0.50837266",
"0.50740093",
"0.50622815",
"0.5060105",
"0.50436634",
"0.5029018",
"0.5028015",
"0.50232637",
"0.5019591",
"0.49949986",
"0.4992854",
"0.49793437",
"0.4952573",
"0.49417198",
"0.49317953",
"0.49071336",
"0.49038103",
"0.48919758",
"0.4891953",
"0.48896116",
"0.4889444",
"0.4886382",
"0.4864472",
"0.48641384",
"0.4847875",
"0.48378727",
"0.48303393",
"0.48083612",
"0.47920445",
"0.47755313",
"0.47633",
"0.4760457",
"0.4751162",
"0.47511142",
"0.4744908",
"0.4733828",
"0.47279015",
"0.47269925",
"0.4721113",
"0.47165203",
"0.47127995",
"0.47021315",
"0.4700608",
"0.46914196",
"0.46886963",
"0.46842957",
"0.46799386",
"0.4676095",
"0.46731424",
"0.466663",
"0.46487436",
"0.46432805",
"0.46296948",
"0.46252567"
] | 0.73018765 | 2 |
Return the current SSLImplementation this Thread | public SSLImplementation getSSLImplementation() {
return sslImplementation;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public String getThread()\n\t{\n\t\treturn this.thread;\n\t}",
"public Thread getThread() {\n return thread;\n }",
"public synchronized Thread getThread() {\n return thread;\n }",
"public Thread getThread();",
"public AbstractThread getThread () {\n ToolsDebugger debugger = (ToolsDebugger) getDebugger ();\n ToolsThread tt = ((ToolsThreadGroup) debugger.getThreadGroupRoot ()).getThread (thread);\n if (tt != null) return tt;\n debugger.lastCurrentThread = thread;\n return new ToolsThread ((ToolsDebugger) getDebugger (), null, thread);\n }",
"public LoadThread getThread() {\r\n return thread;\r\n }",
"@Override\n\tpublic ITrace getCurrentTrace() {\n\t\treturn tracePerThread.get();\n\t}",
"public Transaction currentTransaction() {\r\n\t\treturn threadTransaction.get();\r\n\t}",
"public static void getThreadInfo(){\r\n ThreadMeasurement currentThreadState = new ThreadMeasurement();\r\n threadList.add(currentThreadState);\r\n //ThreadMeasurement.printThreadState(currentThreadState);\r\n }",
"String getThreadId();",
"public long getThreadId() {\n return threadId;\n }",
"public SchedulerInterface getCurrent() {\n return current;\n }",
"public ThreadingProfile getThreadingProfile()\n {\n return threadingProfile;\n }",
"public Long getThreadId() {\n return threadId;\n }",
"public String getThreadName() {\n return threadName;\n }",
"public int getThreadId() {\n\n return threadId.get();\n\n }",
"public long getThreadId() {\n return threadId_;\n }",
"public long getThreadId() {\n return threadId_;\n }",
"public String getThreadName() {\n return null;\n }",
"public CurrentStimulus getCurrentStimulus() {\n return currentStimulus;\n }",
"public Integer getThreadId() {\n\t\treturn threadId;\n\t}",
"long getThreadId();",
"public synchronized Thread getAssociatedThread()\r\n {\r\n return associatedThread;\r\n }",
"RemoteThread getLesseeThread() {\n return lesseeThread;\n }",
"private ISuspendableSchedulableProcess currentStep() {\n if (!processQ_NonInterruptable.isEmpty()) {\r\n return processQ_NonInterruptable.peek();\r\n } else {\r\n return processQ_Interruptable.peek();\r\n }\r\n }",
"private static int th() {\n return (int) Thread.currentThread().getId();\n }",
"public IMachine getSelf() {\n if (!agent.getFeature(IExecutionFeature.class).isComponentThread()) {\n throw new IllegalStateException(\"Error: Must be called on agent thread.\");\n }\n return self;\n }",
"public Thread getUsedBy()\n\t{\n\t\treturn usedBy;\n\t}",
"WorkerThread getWorker() {\n WorkerThread worker = null;\n\n synchronized (idle) {\n if (idle.size() > 0) {\n worker = (WorkerThread) idle.remove(0);\n }\n }\n\n return (worker);\n }",
"public Node getNode() {\n return thread;\n }",
"public String toString()\n\t{\n\t\treturn threadName;\n\t}",
"public abstract int getThreadNumber();",
"public int getExecutionInstance() {\n return executionInstance;\n }",
"public long threadId();",
"static public RenderingContext getCurrentInstance()\r\n {\r\n return _CURRENT_CONTEXT.get();\r\n }",
"public static Executor currentExecutor() {\n return (Executor)Thread.currentThread();\n }",
"protected final List<NulsThread> getThreadList(){\n return ModuleManager.getInstance().getThreadsByModule(this.moduleName);\n }",
"public String getThreadKey() {\n\t\treturn Integer.toString(this.hashCode());\n\t}",
"public ExecutionState getCurrentExecutionState() {\n\t\treturn currentExecutionState;\n\t}",
"private synchronized WorkerThread getThread() {\n\t\tfor (int i = 0; i < this.threadPool.size(); ++i) {\n\t\t\tif (this.threadPool.get(i).available()) {\n\t\t\t\tthis.threadPool.get(i).setAvailable(false);\n\t\t\t\treturn this.threadPool.get(i);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}",
"public ContextInstance getContextInstance() {\n\t\treturn token.getProcessInstance().getContextInstance();\r\n\t}",
"public long getCurrent() {\n return current;\n }",
"@RequiredUIAccess\n @Nonnull\n static UIAccess current() {\n assertIsUIThread();\n\n return UIInternal.get()._UIAccess_get();\n }",
"public static HystrixCommandKey getCurrentThreadExecutingCommand() {\n if (currentCommand == null) {\n // statics do \"interesting\" things across classloaders apparently so this can somehow be null ... \n return null;\n }\n return currentCommand.get().peek();\n }",
"public static String getUserForCurrentThread() {\r\n return userPerThread.get();\r\n }",
"public XnioIoThread getIoThread() {\n return readable.getIoThread();\n }",
"public long getRunning() { return running; }",
"public static SPSSDialog getCurrentInstance()\n\t{\n\t\treturn instance;\n\t}",
"public Integer getIscurrent() {\n return iscurrent;\n }",
"protected LockssDaemon getLockssDaemon() {\n return _lockssDaemon;\n }",
"ActivityDiagram.Thread getNestedThread();",
"public synchronized HttpThread getThread() {\n \t\tadjustThreadCount();\n \n \t\twhile (upper > 0) {\n \t\t\tint count = idleThreads.size();\n \t\t\tif (count > 0) {\n \t\t\t\tint i = count - 1;\n \n \t\t\t\tHttpThread thread = (HttpThread) idleThreads.elementAt(i);\n \t\t\t\tidleThreads.removeElementAt(i);\n \t\t\t\tif (thread.getPriority() != priority) {\n \t\t\t\t\tthread.setPriority(priority);\n \t\t\t\t}\n \t\t\t\tactiveThreads.addElement(thread);\n \t\t\t\t//new Exception((size-i)+\" Threads are at work!\").printStackTrace();\n \t\t\t\tif (Http.DEBUG) {\n \t\t\t\t\thttp.logDebug(thread.getName() + \": becoming active\"); //$NON-NLS-1$\n \t\t\t\t}\n \n \t\t\t\treturn thread;\n \t\t\t}\n \t\t\ttry {\n \t\t\t\twait();\n \t\t\t} catch (InterruptedException e) {\n \t\t\t\t// ignore and check exit condition\n \t\t\t}\n \t\t}\n \n \t\treturn null;\n \t}",
"public Object currentEvent() {\n\t\treturn processingState.currentEvent();\n\t}",
"public long getThreads() { return threads; }",
"public int getThreadUsed();",
"public Job currentJob() {\n \t\treturn currentJob;\n \t}",
"public Security getSecurity()\n {\n return __m_Security;\n }",
"public Runnable getRunnable() {\n return runnable;\n }",
"public Integer getCurrentTarget()\n\t{\n\t\treturn _currentTarget;\n\t}",
"public final Object getCurrent()\n\t{\n\t\treturn getCapture();\n\t}",
"public Context getThis()\r\n {\r\n return this.context;\r\n }",
"public String getCurrent()\n {\n return current.toString();\n }",
"public Object getSynchBlock ()\n\t{\n\t\treturn synchBlock;\n\t}",
"private Thread getThreadFor(Agent ag) {\n return getDataFor(ag).thread;\n }",
"public synchronized Scheduler getScheduler() { return this.scheduler; }",
"public long getAeThreadId() {\n\t\treturn threadId;\n\t}",
"public IRuntimeContext getContext() {\n return fContext;\n }",
"public static final void current (IData pipeline)\n throws ServiceException\n\t{\n\t\t// --- <<IS-START(current)>> ---\n\t\t// @subtype unknown\n\t\t// @sigtype java 3.5\n\t\t// [o] recref:0:required $thread tundra.schema:thread\n\t\tIDataCursor cursor = pipeline.getCursor();\n\n\t\ttry {\n\t\t IDataHelper.put(cursor, \"$thread\", ThreadHelper.toIData(ThreadHelper.current()));\n\t\t} finally {\n\t\t cursor.destroy();\n\t\t}\n\t\t// --- <<IS-END>> ---\n\n\n\t}",
"public IPrivateTestCompView.IContextElement currentContextElement() {\r\n return (IPrivateTestCompView.IContextElement) getCurrentElement();\r\n }",
"protected ThreadState pickNextThread() {\n Lib.assertTrue(Machine.interrupt().disabled());\n if (threadStates.isEmpty())\n return null;\n\n return threadStates.last();\n }",
"protected ThreadState getThreadState(KThread thread) {\n Lib.assertTrue(Machine.interrupt().disabled());\n if (thread.schedulingState == null)\n thread.schedulingState = new ThreadState(thread);\n\n return (ThreadState) thread.schedulingState;\n }",
"public Frame currentFrame() {\n\t\treturn current;\n\t}",
"public BThread getThread() {\n Long __key = this.threadDaoId;\n if (thread__resolvedKey == null || !thread__resolvedKey.equals(__key)) {\n if (daoSession == null) {\n throw new DaoException(\"Entity is detached from DAO context\");\n }\n BThreadDao targetDao = daoSession.getBThreadDao();\n BThread threadNew = targetDao.load(__key);\n synchronized (this) {\n thread = threadNew;\n \tthread__resolvedKey = __key;\n }\n }\n return thread;\n }",
"public Long getBlocking_thread_id() {\n return blocking_thread_id;\n }",
"public int getSharedTo() {\n return instance.getSharedTo();\n }",
"public cl_context getContext() {\r\n return context;\r\n }",
"public Long getWaiting_thread_id() {\n return waiting_thread_id;\n }",
"public boolean isStreamForThisThread() {\n return contexts.get(0)\n .equals(TransactionalContext.getRootContext());\n }",
"public Context getContext() {\n return (Context)this;\n }",
"public Integer getCurrent() {\n return this.current;\n }",
"protected ScllActivity iGetActivity() {\n\t\treturn (ScllActivity) getActivity();\n\t}",
"public TimeStamp getCurrentTimeStamp() {\n return timeStamps.get(currentTimeStamp);\n }",
"public IgniteThread checkpointerThread() {\n return checkpointerThread;\n }",
"public GraphicsObjectWrapper<?> getCurrentWrapper(\n )\n {return GraphicsObjectWrapper.get(this);}",
"public abstract List<? extends AbstractSctlThreadEntry> getThreads();",
"public int running() {\n return this.running;\n }",
"public BasicXmlDocument getCurrentRequest(){\r\n\t\treturn currentRequest;\r\n\r\n\t}",
"public String get_worker() {\n return this._worker;\n }",
"final Object getDelegateLock() {\n return getTarget().getTreeLock();\n }",
"public Prompt getCurrent() {\n\t\t\treturn current;\n\t\t}",
"@Override\n\tpublic Lock getLock() {\n\t\treturn this.lock;\n\t}",
"static synchronized Context getContext() {\n checkState();\n return sInstance.mContext;\n }",
"PLock getLock() {\n return getTextBuffer().getLock();\n }",
"Thread getLocker();",
"public static Version current() {\r\n\t\treturn current;\r\n\t}",
"public String toString() {\n StringBuffer sb = new StringBuffer();\n\n // Print the connection ID\n sb.append(\"id=\" + connId + \", \");\n\n // Print the thread information\n if (threadName != null) {\n sb.append(\"thread=\" + threadName + \" (\" + threadId + \")\");\n } else {\n sb.append(\"thread=\" + threadId);\n }\n\n return sb.toString();\n }",
"public T get() {\n\t\treturn get(ModSettings.currentContext);\n\t}",
"public static final IOpipeExecution currentExecution()\n\t{\n\t\tIOpipeExecution rv = IOpipeService.__execution();\n\t\tif (rv == null)\n\t\t\treturn new __NoOpExecution__(!IOpipeService._THAWED.get());\n\t\treturn rv;\n\t}",
"public Lock getLock() {\n return lock;\n }",
"boolean isActive() {\n assert this.isHeldByCurrentThread();\n return isActive;\n }"
] | [
"0.7076647",
"0.67888355",
"0.657088",
"0.6531235",
"0.63107854",
"0.6265124",
"0.61778796",
"0.61193633",
"0.6104552",
"0.6090695",
"0.60902876",
"0.6085694",
"0.6064094",
"0.6062374",
"0.605678",
"0.6048016",
"0.6047442",
"0.6006523",
"0.59581405",
"0.5957883",
"0.59450215",
"0.593154",
"0.58839726",
"0.58592916",
"0.58565086",
"0.5829098",
"0.58186597",
"0.58154666",
"0.5808442",
"0.58000004",
"0.5782445",
"0.57646793",
"0.5724937",
"0.56917536",
"0.5684762",
"0.566532",
"0.5630367",
"0.56188965",
"0.5603599",
"0.5601007",
"0.55692035",
"0.55649275",
"0.55590016",
"0.5520877",
"0.5515841",
"0.551532",
"0.549837",
"0.54779315",
"0.54647595",
"0.543771",
"0.54244584",
"0.54129654",
"0.53964156",
"0.5391408",
"0.5389675",
"0.5386348",
"0.53817356",
"0.53682333",
"0.5364772",
"0.53542197",
"0.5353436",
"0.5352162",
"0.5335829",
"0.5332673",
"0.5322516",
"0.5307111",
"0.5289463",
"0.528255",
"0.52787614",
"0.5274566",
"0.5266408",
"0.52572215",
"0.5248547",
"0.5245896",
"0.52440214",
"0.52394897",
"0.5230203",
"0.52268565",
"0.52190506",
"0.52151126",
"0.52100915",
"0.5209941",
"0.5204149",
"0.52023864",
"0.520158",
"0.51962566",
"0.5184745",
"0.516234",
"0.5158748",
"0.5157686",
"0.51566374",
"0.5156031",
"0.51554114",
"0.5155375",
"0.51548016",
"0.5147036",
"0.51469177",
"0.5140205",
"0.5137036",
"0.51366776"
] | 0.57563645 | 32 |
Set the SSLImplementation used by this thread.It usually means HTTPS will be used. | public void setSSLImplementation( SSLImplementation sslImplementation) {
this.sslImplementation = sslImplementation;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public SSLImplementation getSSLImplementation() {\n return sslImplementation;\n }",
"public void setSslProtocol(String strUrl) throws Exception {\r\n \r\n URL url = new URL(strUrl);\r\n String host = url.getHost();\r\n int port = url.getPort();\r\n\r\n if (port <= 0) {\r\n port = SSL_PORT;\r\n }\r\n setSslHostPort(host, port);\r\n\r\n }",
"@Override\r\n public SSLImplementation getSslImplementation() {\n return null;\r\n }",
"public void setSsl(boolean ssl) {\n this.ssl = ssl;\n }",
"public void setSsl(SSLConfiguration ssl) {\n this.ssl = ssl;\n }",
"@Override\n public void setSSLParameters(SSLParameters sslP) {\n\n }",
"public void setSSLSocketFactory(final SSLSocketFactory ssf) {\n this.sslSocketFactory = ssf;\n }",
"public boolean useSSL() {\n\t\treturn ssl;\n\t}",
"private void m1388b(SSLSocket sSLSocket) {\n sSLSocket.setEnabledProtocols(new String[]{\"TLSv1.2\"});\n }",
"public void setTls(boolean tls) {\n this.tls = tls;\n }",
"public boolean isSecure( ) {\n\t\treturn scheme.equals( \"https\" );\n\t}",
"public void setUrl(String url) {\n\n\t\ttry {\n\t\t\tthis.url = new URL(url);\n\t\t\tif (url.startsWith(\"https\")) {\n\t\t\t\tthis.httpsEnabled = true;\n\t\t\t}\n\t\t}\n\t\tcatch (MalformedURLException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"public boolean sslEnabled(){\n\t\treturn sslEnabled;\n\t}",
"public static final void registerTrustingSSLManager() {\n registerTrustingSSLManager(\"SSL\");\n }",
"private static void hackRequestForSwitchingSecureScheme() {\n// Logger.debug(\"SCOPE -> hackRequestForSwitchingSecureScheme\");\n Http.Request.current().secure = true;\n hackRequestPort();\n }",
"public boolean isSsl() {\n return ssl;\n }",
"@Override\npublic SSL_MODES getSSLMode() {\n\treturn null;\n}",
"public void setSecurity(Security security)\n {\n __m_Security = security;\n }",
"public void setSslProvider(String sslProvider) {\n this.sslProvider = sslProvider;\n }",
"public void setSslSocketFactory(SSLSocketFactory sslSocketFactory) {\n this.sslSocketFactory = sslSocketFactory;\n }",
"public void setTlsCert(String tlsCert);",
"public boolean isHttpsEnabled() {\n return httpsEnabled;\n }",
"public void setSecure(boolean secure) {\n m_Secure = secure;\n }",
"private static void setupSSL() {\n\t\ttry {\n\t\t\tTrustManager[] trustAllCerts = createTrustAllCertsManager();\n\t\t\tSSLContext sslContext = SSLContext.getInstance(SSL_CONTEXT_PROTOCOL);\n\t\t\tSecureRandom random = new java.security.SecureRandom();\n\t\t\tsslContext.init(null, trustAllCerts, random);\n\t\t\tHttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tLOGGER.error(INVALID_PROTOCOL_ERROR_MESSAGE, e);\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t} catch (GeneralSecurityException e) {\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}\n\n\t}",
"@PostConstruct\n\t\tprivate void configureSSL() {\n\t\t\tSystem.setProperty(\"https.protocols\", \"TLSv1.2\");\n\n\t\t\t//load the 'javax.net.ssl.trustStore' and\n\t\t\t//'javax.net.ssl.trustStorePassword' from application.properties\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStore\", env.getProperty(\"server.ssl.trust-store\"));\n\t\t\tSystem.setProperty(\"javax.net.ssl.trustStorePassword\",env.getProperty(\"server.ssl.trust-store-password\"));\n\t\t}",
"public void setSecure(boolean mySecure)\n\t{\n\t\tthis.secure = mySecure;\n\t}",
"public void setSecure(boolean secure)\n {\n this.secure = secure;\n }",
"public void setTlsCertPath(String tlsCertPath);",
"void applySecurityPolicy(HttpsURLConnection connection);",
"public final void isSocketSSLConnection(boolean isSecure){\r\n isSocketSSL = isSecure;\r\n }",
"public void setSslContext(SslContext sslContext) {\n this.sslContext = sslContext;\n }",
"public Https()\n\t{\n\t\ttry\n\t\t{\n\t\t\tPropertyConfigurator.configure(\"conf/log4j.properties\"); \t\n\t\t\tpropXML.load(new FileInputStream(\"conf/HTTPS.txt\"));\n\t\t\tkey=propXML.getProperty(\"key\");\t\t\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tlogger.error(this.getClass().getName()+\" \"+e.getMessage());\n\t\t} \n\n\t}",
"public void setSslContext(SSLContext sslContext) {\n this.sslContext = sslContext;\n }",
"@Property(name = \"staging:ssl\")\n public abstract boolean isSsl();",
"public void setTrustStore(String trustStoreLocation) {\n if (!complete) {\n this.trustStoreLocation = trustStoreLocation;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }",
"@DSSink({DSSinkKind.SENSITIVE_UNCATEGORIZED})\n @DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 13:02:01.395 -0500\", hash_original_method = \"886AE080148D5E5D7C66238C628CC678\", hash_generated_method = \"B59D430B54A9E84755CD1B8DE11AFB42\")\n \npublic void setSSLParameters(SSLParameters p) {\n String[] cipherSuites = p.getCipherSuites();\n if (cipherSuites != null) {\n setEnabledCipherSuites(cipherSuites);\n }\n String[] protocols = p.getProtocols();\n if (protocols != null) {\n setEnabledProtocols(protocols);\n }\n if (p.getNeedClientAuth()) {\n setNeedClientAuth(true);\n } else if (p.getWantClientAuth()) {\n setWantClientAuth(true);\n } else {\n setWantClientAuth(false);\n }\n }",
"@Override\n\t\tpublic boolean isSecure() {\n\t\t\treturn false;\n\t\t}",
"@Nullable Boolean isHttps();",
"public void setHttpsPort(Integer port) {\n\t\tif (myNode != null) {\n\t\t\tthrow new IllegalStateException(\"change of port only before startup!\");\n\t\t}\n\t\tif (port == null || port < 1) {\n\t\t\thttpsPort = 0;\n\t\t} else {\n\t\t\thttpsPort = port;\n\t\t}\n\t}",
"public void securityOn()\n {\n m_bSecurity = true;\n }",
"private static Socket m39192a(Socket socket) {\n if (socket instanceof SSLSocket) {\n SSLSocket sSLSocket = (SSLSocket) socket;\n ArrayList arrayList = new ArrayList(Arrays.asList(sSLSocket.getSupportedProtocols()));\n arrayList.retainAll(Arrays.asList(new String[]{\"TLSv1.2\", \"TLSv1.1\", \"TLSv1\"}));\n sSLSocket.setEnabledProtocols((String[]) arrayList.toArray(new String[arrayList.size()]));\n }\n return socket;\n }",
"public void setTlsKey(String tlsKey);",
"private ThreadLocalSSLSocketFactory(SocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"private static void hackRequestForSwitchingInsecureScheme() {\n// Logger.debug(\"SCOPE -> hackRequestForSwitchingInsecureScheme\");\n Http.Request.current().secure = false;\n hackRequestPort();\n }",
"private static void setAllowAllSSL(HttpsURLConnection httpsConn,\n KeyManager km) throws KeyManagementException, NoSuchAlgorithmException {\n TrustManager[] trustAllCerts = new TrustManager[] {\n new X509TrustManager() {\n @Override\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return new X509Certificate[]{};\n }\n\n @Override\n public void checkClientTrusted(\n java.security.cert.X509Certificate[] certs, String authType)\n throws CertificateException {\n }\n\n @Override\n public void checkServerTrusted(\n java.security.cert.X509Certificate[] certs, String authType)\n throws CertificateException {\n }\n }\n };\n KeyManager[] kms = (km == null) ? null : new KeyManager[]{km};\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(kms, trustAllCerts, new SecureRandom());\n httpsConn.setSSLSocketFactory(sc.getSocketFactory());\n // Don't check the hostname\n httpsConn.setHostnameVerifier(new NoopHostnameVerifier());\n }",
"public TrustingSSLSocketFactory() throws SSLException {\n\t\tSecurity.addProvider(new com.sun.net.ssl.internal.ssl.Provider());\n\t\tSystem.setProperty(\"java.protocol.handler.pkgs\", \"com.sun.net.ssl.internal.www.protocol\");\n\t\ttry {\n\t\t\tSSLContext sslContext;\n\t\t\tsslContext = SSLContext.getInstance(\"SSLv3\");\n\t\t\tsslContext.init(null, new TrustManager[]{new UtilSSLSocketFactory.TrustingX509TrustManager()}, null);\n\t\t\tfactory = sslContext.getSocketFactory();\n\t\t} catch (NoSuchAlgorithmException nsae) {\n\t\t\tthrow new SSLException(\"Unable to initialize the SSL context: \", nsae);\n\t\t} catch (KeyManagementException kme) {\n\t\t\tthrow new SSLException(\"Unable to register a trust manager: \", kme);\n\t\t}\n\t\tciphers = factory.getDefaultCipherSuites();\n\t}",
"public int getDesiredHttpsPort() {\n return desiredHttpsPort;\n }",
"public final boolean getIsSocketSSLConnection(){\r\n return isSocketSSL;\r\n }",
"public SSLOpts setProtocols(String protocols) {\r\n\t\tthis.protocols = protocols;\r\n\t\treturn this;\r\n\t}",
"public void setTLS11(boolean value) {\n\t\tthis.tls11 = value;\n\t}",
"public boolean isSslEnabled() {\n\t\treturn sslEnabled;\n\t}",
"public void SetSocialSecuritynumber(float num1, float num2, float num3){\n\t\t setFirstSSN(num1);\n\t\t setSecondSSN(num2);\n\t\t setThirdSSN(num3);\n\t\t }",
"protected static void setInstance(Security security)\n {\n __s_Instance = security;\n }",
"public interface SecurityConfigurator {\n\n /**\n * The provider to use for {@link SSLEngine}.\n */\n enum SslProvider {\n /**\n * Use the stock JDK implementation.\n */\n JDK,\n /**\n * Use the openssl implementation.\n */\n OPENSSL,\n /**\n * Auto detect which implementation to use.\n */\n AUTO\n }\n\n /**\n * Trusted certificates for verifying the remote endpoint's certificate. The input stream should\n * contain an {@code X.509} certificate chain in {@code PEM} format.\n *\n * @param trustCertChainSupplier a supplier for the certificate chain input stream.\n * <p>\n * The responsibility to call {@link InputStream#close()} is transferred to callers of the returned\n * {@link Supplier}. If this is not the desired behavior then wrap the {@link InputStream} and override\n * {@link InputStream#close()}.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(Supplier<InputStream> trustCertChainSupplier);\n\n /**\n * Trust manager for verifying the remote endpoint's certificate.\n * The {@link TrustManagerFactory} which take preference over any configured {@link Supplier}.\n *\n * @param trustManagerFactory the {@link TrustManagerFactory} to use.\n * @return {@code this}.\n */\n SecurityConfigurator trustManager(TrustManagerFactory trustManagerFactory);\n\n /**\n * The SSL protocols to enable, in the order of preference.\n *\n * @param protocols the protocols to use.\n * @return {@code this}.\n * @see SSLEngine#setEnabledProtocols(String[])\n */\n SecurityConfigurator protocols(String... protocols);\n\n /**\n * The cipher suites to enable, in the order of preference.\n *\n * @param ciphers the ciphers to use.\n * @return {@code this}.\n */\n SecurityConfigurator ciphers(Iterable<String> ciphers);\n\n /**\n * Set the size of the cache used for storing SSL session objects.\n *\n * @param sessionCacheSize the cache size.\n * @return {@code this}.\n */\n SecurityConfigurator sessionCacheSize(long sessionCacheSize);\n\n /**\n * Set the timeout for the cached SSL session objects, in seconds.\n *\n * @param sessionTimeout the session timeout.\n * @return {@code this}.\n */\n SecurityConfigurator sessionTimeout(long sessionTimeout);\n\n /**\n * Sets the {@link SslProvider} to use.\n *\n * @param provider the provider.\n * @return {@code this}.\n */\n SecurityConfigurator provider(SslProvider provider);\n}",
"public void setSslPort(String sslPort) {\r\n\t\tthis.sslPort = sslPort;\r\n\t}",
"public void setAsSecurityManager() {\r\n\t\tRemoteReflector.setSecurityPolicy(_sess, this);\r\n\t}",
"public String name () {\n return \"tls\";\n }",
"@Override\n\tpublic boolean isSecure() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isSecure() {\n\t\treturn false;\n\t}",
"public RequestBuilder https(boolean https) {\n this.https = https;\n return this;\n }",
"@Override public ServerConfig https(final boolean enabled) {\n httpsEnabled = enabled;\n return this;\n }",
"public interface TlsPolicy {\n \n boolean providesConfidentiality();\n \n boolean providesAuthentication();\n \n boolean providesIntegrity();\n \n\n X509ExtendedTrustManager getTrustManager();\n\n /**\n * NOTE: when using HttpsURLConnection, the hostname verifier is only \n * called if the server certificate does not match the address used to\n * connect. \n * When using Apache's StrictHostnameVerifier, the failure\n * message looks like \"HTTPS hostname wrong: should be <192.168.1.100>\"\n * When using our DenyAllHostnameVerifier, the failure message\n * looks like \"DENY-ALL\"\n * \n * \n * @return \n */\n X509HostnameVerifier getHostnameVerifier();\n \n /**\n * Due to the architecture of the Java SSLContext and the workaround for\n * connection pooling with TlsPolicyManager, the protocol selector must\n * be known prior to using the TlsPolicyManager. The TlsConnection \n * class provides a convenience function for creating the SSLContext \n * using the protocol selector.\n * be known \n * @return \n */\n ProtocolSelector getProtocolSelector();\n}",
"public boolean getSecure()\n\t{\n\t\treturn this.secure;\n\t}",
"public void setSslEnabled(final boolean sslEnabled) {\n\t\tthis.sslEnabled = sslEnabled;\n\t}",
"@Override\n public boolean isSecure() {\n return secure;\n }",
"public void setSmtpTLS(boolean value) {\n this.smtpTLS = value;\n }",
"public String getHttpsEndpoint() {\n\t\treturn \"https://\" + getMyHostname() + \":\" + httpsPort;\n\t}",
"public void setServerSignatureWSUrl(final String url)\r\n {\n\r\n AccessController.doPrivileged(new PrivilegedAction<Object>()\r\n {\r\n public Object run()\r\n {\r\n \tapph.setServerSignatureWSUrl(url);\r\n \treturn null;\r\n }\r\n });\r\n }",
"public TSURL getSurl() {\n\n\t\treturn surl;\n\t}",
"public String getSslPort() {\r\n\t\treturn sslPort;\r\n\t}",
"public Optional<URI> HTTPSAddress() {\n return https;\n }",
"public boolean isSecure() {\n return false;\n }",
"public boolean isSecure() {\n return false;\n }",
"private static void doSwitchScheme(SchemeType schemeType) {\n// Logger.debug(\"SCOPE -> doSwitchScheme\");\n\n // If ReverseProxy module is NOT enabled and https.port property is not configured...\n // Stop switching process between HTTP and HTTPS\n String httpsPort = Play.configuration.getProperty(\"https.port\");\n if (!reverseProxyEnabled && httpsPort == null) {\n Http.Request.current().secure = false;\n return;\n }\n\n // Continue switching process between HTTP and HTTPS\n switchScheme(schemeType);\n }",
"public final void setSecureMessaging() {\n\theader[0] = (byte) (header[0] | 0x0C);\n }",
"public boolean isTls() {\n return tls;\n }",
"public void setSurl(TSURL surl) {\n\n\t\tthis.surl = surl;\n\t}",
"public static final void registerTrustingSSLManager(String protocol) {\n Validate.notBlank(protocol, \"Invalid SSL protocol\");\n\n // Check SSL SocketFactory\n SSLSocketFactory trustingFact= getTrustingSocketFactory(protocol);\n SSLSocketFactory curFactory= HttpsURLConnection.getDefaultSSLSocketFactory();\n\n // Trusting factory not set?\n if (curFactory != trustingFact) {\n LOG.debug(\"Installing default trusting SSLSocketFactory!\");\n HttpsURLConnection.setDefaultSSLSocketFactory(trustingFact);\n }\n\n // Check HostnameVerifier\n HostnameVerifier trustingVerifier= getTrustingHostnameVerifier();\n HostnameVerifier curVerifier= HttpsURLConnection.getDefaultHostnameVerifier();\n\n // Install the all-trusting host verifier?\n if (curVerifier != trustingVerifier) {\n LOG.debug(\"Installing default trusting HostnameVertifier!\");\n HttpsURLConnection.setDefaultHostnameVerifier(trustingVerifier);\n }\n\n }",
"public SSLEngine openSSLEngine()\n {\n SSLSocketProvider.Dependencies deps = getSocketProvider().getDependencies();\n SSLEngine engine = deps.getSSLContext().createSSLEngine();\n String[] asCiphers = deps.getEnabledCipherSuites();\n String[] asProtocols = deps.getEnabledProtocolVersions();\n if (asCiphers != null)\n {\n engine.setEnabledCipherSuites(asCiphers);\n }\n\n if (asProtocols != null)\n {\n engine.setEnabledProtocols(asProtocols);\n }\n\n switch (deps.getClientAuth())\n {\n case wanted:\n engine.setNeedClientAuth(false);\n engine.setWantClientAuth(true);\n break;\n case required:\n engine.setWantClientAuth(true);\n engine.setNeedClientAuth(true);\n break;\n case none:\n default:\n engine.setWantClientAuth(false);\n engine.setNeedClientAuth(false);\n break;\n }\n\n return engine;\n }",
"private int getSSN (){\n return ssn;\n }",
"private void setWSClientToKeepSeparateContextPerThread() {\n ((BindingProvider) movilizerCloud).getRequestContext()\n .put(THREAD_LOCAL_CONTEXT_KEY, \"true\");\n }",
"private void setTrustedCertificates() {\n TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n public void checkClientTrusted(X509Certificate[] certs, String authType) {\n }\n\n public void checkServerTrusted(X509Certificate[] certs, String authType) {\n }\n }};\n // Install the all-trusting trust manager\n final SSLContext sc;\n try {\n sc = SSLContext.getInstance(\"TLS\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n } catch (NoSuchAlgorithmException | KeyManagementException e) {\n e.printStackTrace();\n return;\n }\n\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n // Create all-trusting host name verifier\n HostnameVerifier allHostsValid = new HostnameVerifier() {\n public boolean verify(String hostname, SSLSession session) {\n return true;\n }\n };\n\n // Install the all-trusting host verifier\n HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);\n }",
"public void setWebKey(String s)\n {\n ScDecoder x = new ScDecoder(s);\n _firstFlightId = (Integer)x.get();\n _secondFlightId = (Integer)x.get();\n _thirdFlightId = (Integer)x.get();\n _fourthFlightId = (Integer)x.get();\n _fifthFlightId = (Integer)x.get();\n _consignmentNumber = (String)x.get();\n _consignmentExpectedDestinationAirportCode = (String)x.get();\n _upuTagOriginCountryCode = (String)x.get();\n _upuTagOriginLocationCode = (String)x.get();\n _upuTagOriginOfficeOfExchangeQualifier = (String)x.get();\n _upuTagDestinationCountryCode = (String)x.get();\n _upuTagDestinationLocationCode = (String)x.get();\n _upuTagDestinationOfficeOfExchangeQualifier = (String)x.get();\n _upuTagMailCategoryCode = (String)x.get();\n _upuTagMailSubClassCode = (String)x.get();\n _upuTagMailClassCode = (String)x.get();\n _upuTagDispatchYear = (String)x.get();\n _upuTagDispatchSerialNumber = (String)x.get();\n _upuTagReceptacleSerialNumber = (String)x.get();\n _upuTagHighestNumberedReceptacleIndicator = (String)x.get();\n _upuTagInsuredOrRegisteredIndicator = (String)x.get();\n _upuTagWeight = (JwKilogram)x.get();\n }",
"void setSocketFactory(SocketFactory socketFactory);",
"@Override\nprotected Void doInBackground(Void... params){\n TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {\n public java.security.cert.X509Certificate[] getAcceptedIssuers() {\n return null;\n }\n\n public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n }\n\n public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {\n }\n } };\n\n // Install the all-trusting trust manager\n try {\n SSLContext sc = SSLContext.getInstance(\"SSL\");\n sc.init(null, trustAllCerts, new java.security.SecureRandom());\n HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n\n // Your code ...\n URL url = null;\n HttpsURLConnection conn = null;\n try {\n url = new URL(\"https://example.com\");\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n\n // ...\n}",
"public TblUauthSclntw() {\n\t\tthis(\"uauth_sclntw\", null);\n\t}",
"private void registerCustomProtocolHandler() {\n try {\n URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {\n @Override\n public URLStreamHandler createURLStreamHandler(String protocol) {\n if (\"https\".equals(protocol)) {\n return new sun.net.www.protocol.https.Handler() {\n @Override\n protected URLConnection openConnection(URL url, Proxy proxy) throws IOException {\n // Leaving sysout comments here for debugging and clarity if the tool does break again because of an Okta Update\n //System.out.format(\"openConnection %s (%s, %s)\\n\", url, url.getHost(), url.getPath());\n\n final HttpsURLConnectionImpl httpsURLConnection = (HttpsURLConnectionImpl) super.openConnection(url, proxy);\n if (\"artisan.okta.com\".equals(url.getHost()) && \"/home/amazon_aws/0oad7khqw5gSO701p0x7/272\".equals(url.getPath())) {\n\n return new URLConnection(url) {\n @Override\n public void connect() throws IOException {\n httpsURLConnection.connect();\n }\n\n public InputStream getInputStream() throws IOException {\n byte[] content = IOUtils.toByteArray(httpsURLConnection.getInputStream());\n String contentAsString = new String(content, \"UTF-8\");\n\n //System.out.println(\"########################## got stream content ##############################\");\n //System.out.println(contentAsString);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n //contentAsString = contentAsString.replaceAll(\",\\\"ENG_ENABLE_SCRIPT_INTEGRITY\\\"\", \"\"); // nested SRIs?\n baos.write(contentAsString.replaceAll(\"integrity ?=\", \"integrity.disabled=\").getBytes(\"UTF-8\"));\n return new ByteArrayInputStream(baos.toByteArray());\n }\n\n public OutputStream getOutputStream() throws IOException {\n return httpsURLConnection.getOutputStream();\n }\n\n };\n\n } else {\n return httpsURLConnection;\n }\n }\n\n };\n }\n return null;\n }\n });\n } catch (Throwable t) {\n System.out.println(\"Unable to register custom protocol handler\");\n }\n }",
"public boolean isSecure() {\n return m_Secure;\n }",
"public void setSocket(SocketWrapper socket);",
"public String getStartTlsProperty() {\n\n return unmaskProperty(EmailConnectionConstants.PROPERTY_START_TLS_ENABLE);\n }",
"public boolean isSSLEnabled() {\n return agentConfig.isSSLEnabled();\n }",
"public void setSymmetricRtp(boolean symmetric_rtp)\n { this.symmetric_rtp=symmetric_rtp;\n }",
"public static void setCurrentThreadLib(final DataClayRuntime dsLib) {\n\t\tcommonLibs.set(dsLib);\n\t}",
"public boolean isSecure() {\n return secure;\n }",
"public void setNetWS(long netWS) {\r\n/* 406 */ this._netWS = netWS;\r\n/* 407 */ this._has_netWS = true;\r\n/* */ }",
"public void setSocketFactory(ISOServerSocketFactory socketFactory) {\n this.socketFactory = socketFactory;\n }",
"public SSLSocketFactory sslSocketFactory() {\n return sslSocketFactory;\n }",
"public int isSSLEnabled() {\n\t\tint enabled = 0;\n\t\tif (Boolean.parseBoolean(config.getProperty(ssl_yml_key)) == true || config.getProperty(ssl_yml_key).equals(ssl_yml_key)) {\n\t\t\tenabled = 1;\n\t\t}\n\t\t\n\t\treturn enabled;\n\t}",
"public void securityOff()\n {\n m_bSecurity = false;\n }",
"public void setWebKey(String s)\n {\n ScDecoder x = new ScDecoder(s);\n setLegDepartureLocalTm((JwTime)x.get());\n setLegArrivalLocalTm((JwTime)x.get());\n setLegArrivalDayOffset((Integer)x.get());\n setLegStopCount((Integer)x.get());\n setLegEquipment((String)x.get());\n }"
] | [
"0.6889345",
"0.6316198",
"0.6308908",
"0.6129873",
"0.6082961",
"0.5986684",
"0.58864886",
"0.58661145",
"0.5854126",
"0.5829587",
"0.5777503",
"0.5705791",
"0.56310034",
"0.56172717",
"0.55535847",
"0.5539244",
"0.55362797",
"0.55278397",
"0.54718167",
"0.54602414",
"0.5454929",
"0.5416868",
"0.53977036",
"0.5372025",
"0.53717625",
"0.53716314",
"0.53637385",
"0.5359062",
"0.53395855",
"0.5300873",
"0.5281327",
"0.5279009",
"0.5269725",
"0.5251235",
"0.52474785",
"0.524576",
"0.52262807",
"0.52233297",
"0.5215861",
"0.519012",
"0.5188092",
"0.51851857",
"0.51831603",
"0.51762164",
"0.5120316",
"0.511469",
"0.5092021",
"0.50909877",
"0.50721",
"0.5059134",
"0.5058911",
"0.5038322",
"0.5037631",
"0.5037419",
"0.5032908",
"0.50202334",
"0.50149643",
"0.5007984",
"0.5007984",
"0.5005556",
"0.50022453",
"0.4999191",
"0.4993106",
"0.49861676",
"0.49822596",
"0.49732035",
"0.49731597",
"0.4948884",
"0.49435738",
"0.49421996",
"0.49266812",
"0.49189347",
"0.49189347",
"0.49186924",
"0.48986128",
"0.48965365",
"0.489278",
"0.48809043",
"0.487815",
"0.48614085",
"0.48530644",
"0.48508498",
"0.4848212",
"0.48417157",
"0.4837953",
"0.48295367",
"0.4824043",
"0.48203224",
"0.48187935",
"0.47967207",
"0.47917745",
"0.47907427",
"0.47786394",
"0.47774473",
"0.47624242",
"0.4761704",
"0.47602305",
"0.47576284",
"0.47564462",
"0.47539252"
] | 0.6959716 | 0 |
Function which encrypt a message using RSA algorithm | public static BigInteger encrypt(BigInteger message, RSAPublicKey key) {
try {
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.ENCRYPT_MODE, key);
return new BigInteger(cipher.doFinal(message.toByteArray()));
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
e.printStackTrace();
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);",
"public CryptObject encrypt(BigIntegerMod message);",
"public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}",
"private BigInteger encrypt(BigInteger message) {\n return message.modPow(e, n);\n }",
"public abstract String encryptMsg(String msg);",
"public static String encrypt(byte[] plaintext) throws Exception,NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException\n\t\t{\n\n\t\t\tPublicKey key = readPublicKey(publicKeyUrl1);\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\tbyte[] encryptedByte= cipher.doFinal(plaintext);\n\t\t\tString encodedString = new String(java.util.Base64.getEncoder().encode(encryptedByte));\n\t\t\treturn encodedString;\n\t\t}",
"public String encrypt(String message, String publicKey, String modulus){\n char a;\n BigInteger b;\n String c = \"\";\n \n for(int i = 0; i < message.length(); i++){\n a = message.charAt(i);\n b = new BigInteger(\"\" + (int)a);\n c += \"\" + encrypt(b, new BigInteger(publicKey), new BigInteger(modulus)) + (char)29;\n }\n \n return c;\n }",
"private String encryptMessage(String message) {\n int MESSAGE_LENGTH = message.length();\n //TODO: throw SizeTooBigException for message requirements\n if(MESSAGE_LENGTH > 1300){\n\n throw new SizeTooBigException();\n }\n\n final int length = message.length();\n String encryptedMessage = \"\";\n for (int i = 0; i < length; i++) {\n //TODO: throw InvalidCharacterException for message requirements\n int m = message.charAt(i);\n int k = this.kissKey.keyAt(i) - 'a';\n int value = m ^ k;\n encryptedMessage += (char) value;\n }\n return encryptedMessage;\n }",
"public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }",
"public String encrypt(String word){\n\tint modulus = rsaKeyA * rsaKeyB;\n\tint totient = (rsaKeyA - 1)*(rsaKeyB - 1);\n\tpublicE = calculateExponent(totient);\n\tprivateD = 1 + ((int)Math.random()*10)*totient;\n \n\tif(word == null||word.length()==0) throw new IllegalArgumentException();\n\tString result = \"\";\n\tString wordLower = word.toLowerCase();\n\n\tfor(int i=0; i<wordLower.length(); i++){\n\t if(wordLower.charAt(i)<97 || wordLower.charAt(i)>122)\n\t\tthrow new IllegalArgumentException();\n\t int a = (wordLower.charAt(i)-97);\n\t int b = (int)Math.pow(a,publicE);\n\t int k = (b%26)+97;\n\t result += Character.toString((char)k);\n\t}\n\treturn result;\n }",
"RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }",
"public static byte[] rsaEncrypt(byte[] plaintext, PublicKey encryptionKey) {\n\t\t// (1p) Implement RSA encryption, replace `null` with actual ciphertext\n\t\tbyte[] result = null;\n\t\tCipher cipher;\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"RSA\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, encryptionKey);\n\t\t\tresult = cipher.doFinal(plaintext);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t\treturn result;\n\t}",
"public CryptObject reencrypt(Ciphertext ciphertext, BigIntegerMod r);",
"@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n encMsg[ind] = (char) ((letter + key) % 65536);\n }\n return new String(encMsg);\n }\n }",
"@Override\n public String encryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] encMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n encMsg[ind] = (char) ('a' + ((letter - 'a' + key) % 26));\n } else if (letter >= 'A' && letter <= 'Z') {\n encMsg[ind] = (char) ('A' + ((letter - 'A' + key) % 26));\n } else {\n encMsg[ind] = letter;\n }\n }\n return new String(encMsg);\n }\n }",
"Encryption encryption();",
"String encryption(Long key, String encryptionContent);",
"public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }",
"@VisibleForTesting\n byte[] RSAEncrypt(byte[] decryptedInput) throws IncompatibleDeviceException, CryptoException {\n try {\n Certificate certificate = getRSAKeyEntry().getCertificate();\n Cipher cipher = Cipher.getInstance(RSA_TRANSFORMATION);\n cipher.init(Cipher.ENCRYPT_MODE, certificate);\n return cipher.doFinal(decryptedInput);\n } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) {\n /*\n * This exceptions are safe to be ignored:\n *\n * - NoSuchPaddingException:\n * Thrown if PKCS1Padding is not available. Was introduced in API 1.\n * - NoSuchAlgorithmException:\n * Thrown if the transformation is null, empty or invalid, or if no security provider\n * implements it. Was introduced in API 1.\n * - InvalidKeyException:\n * Thrown if the given key is inappropriate for initializing this cipher.\n *\n * Read more in https://developer.android.com/reference/javax/crypto/Cipher\n */\n Log.e(TAG, \"The device can't encrypt input using a RSA Key.\", e);\n throw new IncompatibleDeviceException(e);\n } catch (IllegalBlockSizeException | BadPaddingException e) {\n /*\n * They really should not be thrown at all since padding is requested in the transformation.\n * Delete the AES keys since those originated the input.\n *\n * - IllegalBlockSizeException:\n * Thrown if no padding has been requested and the length is not multiple of block size.\n * - BadPaddingException:\n * Thrown only on decrypt mode.\n */\n deleteAESKeys();\n throw new CryptoException(\"The RSA decrypted input is invalid.\", e);\n }\n }",
"private static String encryptWithPublicKey(String plainData, RSAPublicKey rsaPublicKey, String keyFingerPrint, String requestContentType) throws JOSEException {\n\t\t\tfinal JWEHeader.Builder builder = new JWEHeader.Builder(ALG, ENC_MTHD);\n\t\t\tif(keyFingerPrint != null){\n\t\t\t\tbuilder.keyID(keyFingerPrint);\n\t\t\t}\n\t\t\tif(requestContentType != null){\n\t\t\t\tbuilder.contentType(requestContentType);\n\t\t\t}\n\t\t\tfinal JWEHeader jweHeader = builder.build();\n\t\t\tJWEObject jwe = new JWEObject(\n\t\t\t\t\tjweHeader,\n\t\t\t\t\tnew Payload(plainData));\n\n\t\t\tfinal RSAEncrypter encrypter = new RSAEncrypter(rsaPublicKey);\n\n\t\t\tjwe.encrypt(encrypter);\n\t\t\treturn jwe.serialize();\n\t\t}",
"public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }",
"public String encrypt(String plaintext) {\n\t\tCipher rsaCipher, aesCipher;\n\t\ttry {\n\t\t\t// Create AES key\n\t\t\tKeyGenerator keyGen = KeyGenerator.getInstance(\"AES\");\n\t\t\tkeyGen.init(AES_BITS);\n\t\t\tKey aesKey = keyGen.generateKey();\n\n\t\t\t// Create Random IV\n\t\t\tbyte[] iv = SecureRandom.getSeed(16);\n\t\t\tIvParameterSpec ivSpec = new IvParameterSpec(iv);\n\n\t\t\t// Encrypt data using AES\n\t\t\taesCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\n\t\t\taesCipher.init(Cipher.ENCRYPT_MODE, aesKey, ivSpec);\n\t\t\tbyte[] data = aesCipher.doFinal(plaintext.getBytes());\n\n\t\t\t// Encrypt AES key using RSA public key\n\t\t\trsaCipher = Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n\t\t\trsaCipher.init(Cipher.ENCRYPT_MODE, this.pubKey);\n\t\t\tbyte[] encKey = rsaCipher.doFinal(aesKey.getEncoded());\n\n\t\t\t// Create output\n\t\t\tString keyResult = new String(Base64.encodeBytes(encKey, 0));\n\t\t\tString ivResult = new String(Base64.encodeBytes(iv, 0));\n\t\t\tString dataResult = new String(Base64.encodeBytes(data, 0));\n\t\t\tString result = FORMAT_ID + \"|\" + VERSION + \"|\" + this.keyId + \"|\"\n\t\t\t\t\t+ keyResult + \"|\" + ivResult + \"|\" + dataResult;\n\t\t\treturn Base64.encodeBytes(result.getBytes(), Base64.URL_SAFE);\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (NoSuchPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IllegalBlockSizeException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidAlgorithmParameterException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn \"Encryption_Failed\";\n\t}",
"static byte[] encrypt(String plainText, byte[] publicKeyEncoded) throws Exception {\n Cipher cipher = Cipher.getInstance(RSA__PADDING);\n\n PublicKey publicKey =\n KeyFactory.getInstance(\"RSA\").generatePublic(new X509EncodedKeySpec(publicKeyEncoded));\n\n //Initialize Cipher for ENCRYPT_MODE\n cipher.init(Cipher.ENCRYPT_MODE, publicKey);\n\n //Perform Encryption\n\n return cipher.doFinal(plainText.getBytes());\n }",
"public String encrypt(String plainText);",
"public CryptObject reencrypt(Ciphertext ciphertext);",
"public XoxoMessage encrypt(String message) {\n String encryptedMessage = this.encryptMessage(message); \n return new XoxoMessage(encryptedMessage, new HugKey(this.kissKey));\n }",
"public String encrypt(String geheimtext);",
"public String encrypt(String input) throws Throwable {\n\n byte[] inputByteArray = input.getBytes();\n String keyString = \"\";\n\n // reading the public key\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(\n new InputStreamReader(context.getAssets().open(\"Put your public key in assets and Enter its name here\"), \"UTF-8\"));\n String line;\n while ((line = reader.readLine()) != null) {\n keyString += line;\n }\n reader.close();\n }catch (IOException e){\n Toast.makeText(context, \"Couldn't create file reader\", Toast.LENGTH_SHORT).show();\n }\n\n // fetching the key from public key\n keyString = keyString.replaceAll(NEW_LINE_CHARACTER, EMPTY_STRING)\n .replaceAll(PUBLIC_KEY_START_KEY_STRING, EMPTY_STRING)\n .replaceAll(PUBLIC_KEY_END_KEY_STRING, EMPTY_STRING);\n\n byte[] publicKey = keyString.getBytes();\n\n Key generatePublic = KeyFactory.getInstance(\"RSA\").\n generatePublic(new X509EncodedKeySpec(Base64.getDecoder().decode(publicKey)));\n\n // create RSA Cipher instance\n Cipher cipherInstance = Cipher.getInstance(\"RSA/None/PKCS1Padding\");\n cipherInstance.init(Cipher.ENCRYPT_MODE, generatePublic);\n\n // encrypt string\n byte[] encryptedByteArray = cipherInstance.doFinal(inputByteArray);\n return Base64.getEncoder().encodeToString(encryptedByteArray);\n }",
"public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }",
"public String encrypt(String message) {\t\n\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t//this creates an array with the numbers that are keys \n\t\tint [] numberOfLetters = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i< newMessage.length(); i++){\n\t\t\tfor(int j=0; j< alphabet.length(); j++){\n\t\t\t\tif(newMessage.charAt(i) == alphabet.charAt(j)){ //if they have the same letter\n\t\t\t\t\tnumberOfLetters[i]=j+1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\n\t\t//creates an array of the keys\n\t\tint [] key = new int[numberOfLetters.length];\n\t\tint keys;\n\t\tfor(int i=0; i< numberOfLetters.length; i++){\n\t\t\tkeys = getKey();\n\t\t\tkey[i] = keys;\n\t\t}\n\t\n\t\t//create an array for what we encrypted \n\t\tint [] encryptNum = new int[key.length];\n\t\tfor(int i=0; i< key.length; i++){\n\t\t\tint value = numberOfLetters[i] + key[i];\n\t\t\tif(value > 26){\n\t\t\t\tvalue = value-26;\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}else{\n\t\t\t\tencryptNum[i]= value;\n\t\t\t}\n\t\t}\n\n\t\t//turn encryption into letters \n\t\tString encrypt = \"\";\n\t\tchar [] let = new char [encryptNum.length];\n\n\t\tfor(int i=0; i< encryptNum.length; i++){\n\t\t\tint x = encryptNum[i]-1;\n\t\t\tlet[i] = alphabet.charAt(x);\n\t\t}\n\n\t\tfor(int j=0; j< let.length; j++){\n\t\t\tencrypt += let[j];\n\t\t}\n\n\t\t// COMPLETE THIS METHOD\n\t\t// THE FOLLOWING LINE HAS BEEN ADDED TO MAKE THE METHOD COMPILE\n\n\t\treturn encrypt;\n\t}",
"byte[] encrypt(String plaintext);",
"public String encryptAESKey(String plainAESKey, PublicKey publicKey) throws Exception {\r\n Cipher cipher = Cipher.getInstance(\"RSA\");\r\n cipher.init(Cipher.ENCRYPT_MODE, publicKey);\r\n return Base64.getEncoder().encodeToString(cipher.doFinal(plainAESKey.getBytes()));\r\n }",
"public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }",
"public static String encrypt(String input) {\n\t\tBase64.Encoder encoder = Base64.getMimeEncoder();\n String message = input;\n String key = encoder.encodeToString(message.getBytes());\n return key;\n\t}",
"public BigInteger encrypt(BigInteger plaintext)\n {\n if (plaintext.compareTo(n) == -1) {\n return Utils.bigModPow(plaintext, e, n);\n }\n int blockByteLen = (n.bitLength() - 1) / 8;\n List<BigInteger> resList = new ArrayList<>();\n byte[] bytesPlaintext = plaintext.toByteArray();\n // Split and encrypt each block\n Utils.traverseByteByBlock(bytesPlaintext, blockByteLen, (byte[] b) -> {\n BigInteger block = BigInteger.valueOf(b[0]);\n for (int j = 1; j < b.length; j++) {\n block = block.shiftLeft(8).add(BigInteger.valueOf(b[j]));\n }\n resList.add(0, Utils.bigModPow(block, e, n));\n });\n // Concatenate all\n int eBlockByteLen = blockByteLen + 1; // encrypted blocks may have a bigger size than unencrypted blocks, thus we allocate one more byte for them\n return Utils.concatBigInteger(resList, eBlockByteLen);\n }",
"public static BigInteger[] rsaEncrypt(byte[] b, BigInteger e, BigInteger n) {\r\n\t\tBigInteger[] bigB = new BigInteger[b.length];\r\n\t\tfor (int i = 0; i < bigB.length; i++) {\r\n\t\t\tBigInteger x = new BigInteger(Byte.toString(b[i]));\r\n\t\t\tbigB[i] = encrypt(x, e, n);\r\n\t\t}\r\n\t\treturn bigB;\r\n\t}",
"public static String encrypt(String s, Key key)\n throws NotAuthorizedException\n {\n String result = null;\n try {\n Cipher cipher = Cipher.getInstance(\"RSA/ECB/OAEPWithSHA-256AndMGF1Padding\");\n cipher.init(ENCRYPT_MODE, key);\n\n result = Base64.getUrlEncoder().encodeToString(cipher.doFinal(s.getBytes(\"UTF-8\")));\n } catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n } catch (NoSuchPaddingException e) {\n throw new RuntimeException(e);\n } catch (InvalidKeyException e) {\n throw new NotAuthorizedException(e);\n } catch (BadPaddingException e) {\n throw new RuntimeException(e);\n } catch (IllegalBlockSizeException e) {\n throw new RuntimeException(e);\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n return result;\n\n }",
"String publicKey();",
"private byte[] encryptSymmetricKey(PublicKey receiverPublicKey, SecretKey semetricKey) throws Exception {\n\t\ttry {\n\t\t\tmyCipher = Cipher.getInstance(\"RSA\");\n\t\t\tmyCipher.init(Cipher.ENCRYPT_MODE, receiverPublicKey);\n\t\t\treturn myCipher.doFinal(semetricKey.getEncoded());\n\t\t} catch (Exception e) {\n\t\t\twriteToLog(\"Error While trying to encrypt the semetric-key: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception();\n\t\t}\n\n\t}",
"public byte[] encrypt(String data, Key privatekey) {\r\n\t\tif (!presentkey) {\r\n\t\t\t//TODO\r\n\t\t\tkeyDiffieHellmanFirst();\r\n\t\t\t// need to send these values to other side\r\n\t\t\t// wait\r\n\t\t\tkeyDiffieHellmanFinal(//nummer uit packet from the other side);\r\n\t\t}\r\n\t\tbyte[] encrypt = OFB.EnDecrypt(data.getBytes(), diffie.getKey().toByteArray());\r\n\t\tString sign = ((Integer) data.hashCode()).toString();\r\n\t\tbyte[] signed = RSA.encrypt(sign, privatekey);\r\n\t\tbyte[] encrypted = new byte[encrypt.length + signed.length];\r\n\t\tSystem.arraycopy(encrypt, 0, encrypted, 0, encrypt.length);\r\n\t\tSystem.arraycopy(signed, 0, encrypted, encrypt.length, signed.length);\r\n\t\treturn encrypted;\r\n\t}",
"private static String encrypt(String in){\n\n\t String alphabet = \"1234567890\";\n\n\t String scramble1 = \"<;\\'_$,.?:|)\";\n\t String scramble2 = \"XYZVKJUTHM\";\n\t String scramble3 = \"tuvwxyz&*}\";\n\t String scramble4 = \"~!-+=<>%@#\";\n\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t char messageIn[] = in.toCharArray();\n\t String r = \"\";\n\n\t for(int i = 0; i < in.length(); i++){\n\n\t int letterIndex = alphabet.indexOf(in.charAt(i));\n\n\t if(i % 3 == 0){\n\t r += scramble1.charAt(letterIndex);\n\t }else if (i % 3 == 1){\n\t \tr += scramble2.charAt(letterIndex);\n\t }else if(i % 3 == 2){\n\t \tr += scramble3.charAt(letterIndex);\n\t }\n\t }\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------\");\n\t\t\t\tSystem.out.println(\" Encoded Message: \" + r);\n\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------\\n\\n\");\n\t\treturn r;\n\t}",
"public byte[] encrypt(byte[] data, PublicKey publicUserKey) throws EncryptingException {\n try {\n return RSA.encrypt(data, publicUserKey);\n } catch (Exception e) {\n throw new EncryptingException();\n }\n }",
"public static byte[] encryptRSA(final byte[] data,\n final byte[] publicKey,\n final int keySize,\n final String transformation) {\n return rsaTemplate(data, publicKey, keySize, transformation, true);\n }",
"private static String encode(String license,String D, String N) {\n int MAX_ENCRYPT_BLOCK = 128;\n int offSet = 0;\n byte[] cache;\n int i = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n try {\n RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\n KeyFactory keyFactory = java.security.KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\n\n Cipher cipher = javax.crypto.Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.ENCRYPT_MODE,privateKey);\n\n byte[] data = license.getBytes(StandardCharsets.UTF_8);\n int inputLen = data.length;\n // 对数据分段加密\n while (inputLen - offSet > 0) {\n if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\n cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\n } else {\n cache = cipher.doFinal(data, offSet, inputLen - offSet);\n }\n out.write(cache, 0, cache.length);\n i++;\n offSet = i * MAX_ENCRYPT_BLOCK;\n }\n byte[] datas = out.toByteArray();\n out.close();\n\n System.out.println(\"datas:\"+datas.length);\n\n // byte[] datas = datas = cipher.doFinal(license.getBytes());\n datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\n return new String(datas,StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"public EncryptorReturn encrypt(String in) throws CustomizeEncryptorException;",
"void encrypt(ChannelBuffer buffer, Channel c);",
"public static byte [] encrypt(byte [] plainText, PublicKey encryptionKey) {\r\n\t\tif(plainText == null) return null;\r\n\t\t// needed len = wrappedKey + E[ encodedVerificationKey + Signature + plainText ]\r\n\t\tbyte [] outputBuffer = new byte[plainText.length+MIN_BUF_SIZE];\r\n\t\ttry {\r\n\t\t\t// generate a secret symmetric key\r\n\t\t\tKeyGenerator keyGenerator = KeyGenerator.getInstance(symmetricKeyAlgorithm);\r\n\t\t\tkeyGenerator.init(SYMMETRIC_KEY_LENGTH);\r\n\t\t\tSecretKey secretKey = keyGenerator.generateKey();\r\n\t\t\t// encrypt (wrap) the secret symmetric key using the public encryption key of the receiver\r\n\t\t\tCipher wrapper = Cipher.getInstance(encryptionAlgorithm);\r\n\t\t\twrapper.init(Cipher.WRAP_MODE, encryptionKey);\r\n\t\t\tbyte [] wrappedSecretKey = wrapper.wrap(secretKey);\r\n\r\n\t\t\t// place the length of the wrappedKey followed by the wrapped key into the output buffer at outputBuffer[0]\r\n\t\t\t// cursor points to the next available location in outputBuffer\r\n\t\t\tint cursor = packToByteArray(wrappedSecretKey, outputBuffer, 0);\r\n\t\t\tint encryptionCursor = cursor;\t// marker for start of encryption\r\n\r\n\t\t\t// add the length of the plain text to the message. We only push the length\r\n\t\t\t// of the message into the buffer, because we can do encryption in steps and avoid copies\r\n\t\t\toutputBuffer[cursor] = (byte)((plainText.length & 0xff00) >>> 8);\t// msb of plainText\r\n\t\t\toutputBuffer[cursor+1] = (byte)(plainText.length & 0xff);\t\t\t// lsb of plainText\r\n\t\t\tcursor += 2;\r\n\r\n\t\t\t// encrypt the message {PkLen,PublicKey,SLen,Signature,PtLen,PlainText}\r\n\t\t\tCipher encryptor = Cipher.getInstance(symmetricKeyAlgorithm);\r\n\t\t\tencryptor.init(Cipher.ENCRYPT_MODE, secretKey);\r\n\t\t\t// encrypt upto the cursor, and reset cursor to point to the end of the encrypted stream in the output buffer\r\n\t\t\tcursor = encryptionCursor + encryptor.update(outputBuffer,encryptionCursor,cursor-encryptionCursor,outputBuffer,encryptionCursor);\r\n\t\t\t// encrypt the plain text. Cursor points to the end of the output buffer\r\n\t\t\tcursor += encryptor.doFinal(plainText, 0, plainText.length, outputBuffer, cursor);\r\n\r\n\t\t\t// return the encrypted bytes\r\n\t\t\treturn Arrays.copyOfRange(outputBuffer, 0, cursor);\r\n\t\t} catch(Exception e){\r\n\t\t\tlogger.log(Level.WARNING,\"Unable to encrypt message \"+new String(Arrays.copyOf(plainText, 10))+\"...\",e);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public BigInteger Encryption(String text){\n \tcypherText = BigInteger.valueOf(0);\n \tint bposition = 0;\n \t/*\n \t * Cursor move from 128 to 1 each time. Do & operation between chvalue\n \t * and cursor, if not 0, means in bit format this position is 1, add\n \t * the corresponding BigInteger in the b list to cypherText.\n \t */\n \tfor(byte ch: text.getBytes()){\n \t\tint cursor = 128;\n \t\tint chvalue = ch;\n \t\tfor(int i = 0;i < 8;i++){\n \t\t\tif((chvalue & cursor) != 0){\n \t\t\t\tcypherText = cypherText.add(b[bposition]);\n \t\t\t}\n \t\t\tcursor >>= 1;\n \t\t bposition ++;\n \t\t}\n \t}\n \treturn cypherText;\n }",
"private void encode(){\r\n \r\n StringBuilder sb = new StringBuilder();\r\n \r\n /*\r\n *if a character code is >126 after adding the encryption key, subtract \r\n *95 to wrap\r\n */\r\n for(int i = 0; i < message.length(); i++){\r\n if(message.charAt(i) + key > 126){\r\n int wrappedKey = message.charAt(i) + key - 95;\r\n \r\n sb.append((char) wrappedKey);\r\n \r\n /*\r\n *if a character code ins't > 126 after adding the encryption key\r\n */\r\n } else{\r\n int wrappedKey = message.charAt(i) + key;\r\n sb.append( (char) wrappedKey);\r\n }\r\n }\r\n /*\r\n *case coded message to a string\r\n */\r\n codedMessage = sb.toString();\r\n }",
"public String encryptString(String message) {\n byte[] data = message.getBytes();\n return encrypt(new BigInteger(data)).toString();\n }",
"public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }",
"public void process(RSAMessage msg) throws IOException {\n relay(msg);\n }",
"public void encrypt(byte[] vanillaInformation){\n SecretKey symmetricKey = getSymmetricEncryption().createSecretKey();\n getSymmetricEncryption().encrypt(symmetricKey, vanillaInformation);\n setEncryptedInformation(getSymmetricEncryption().getEncryptedInformation());\n\n //encrypt symmetric key with user public key\n try {\n Cipher symmetricKeyEncryption = Cipher.getInstance(\"RSA\");\n symmetricKeyEncryption.init(Cipher.ENCRYPT_MODE, getPublicKey());\n setEncryptedSymmetricKey(symmetricKeyEncryption.doFinal(symmetricKey.getEncoded()));\n } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n e.printStackTrace();\n }\n }",
"private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }",
"@Override\n public byte[] encrypt(byte[] plaintext) {\n java.security.spec.ECPoint point = hashIntoTheCurveInternal(plaintext);\n return encrypt(convertECPoint(point));\n }",
"private native void dll_encrypt(String path_in, String path_out, byte[] npub, byte[] key, int alg);",
"public static String encrypt(String seed, String plain) throws Exception {\r\nbyte[] rawKey = getRawKey(seed.getBytes());\r\nbyte[] encrypted = encrypt(rawKey, plain.getBytes());\r\nreturn Base64.encodeToString(encrypted, Base64.DEFAULT);\r\n}",
"@Override\n public InputStream encrypt(InputStream in, EncryptionKey publicKey) throws IOException {\n KeyEncapsulationMechanism.KeyAndCiphertext<SymmetricKey> keyAndCiphertext = kem.encaps(publicKey);\n\n //Serialize the encapsulated key\n byte[] encapsulatedKey = new JSONConverter().serialize(keyAndCiphertext.encapsulatedKey.getRepresentation())\n .getBytes(StandardCharsets.UTF_8);\n\n //Prepare the encapsulated key length as the first four bytes of the ciphertext. That ought to be enough for\n // everybody.\n byte[] keyLenBytes = ByteBuffer.allocate(4).putInt(encapsulatedKey.length).array();\n\n //Return resulting stream that concatenates: keyLenBytes || encapsulatedKey || ciphertextFromSymmetricScheme\n return new SequenceInputStream(new ByteArrayInputStream(keyLenBytes),\n new SequenceInputStream(new ByteArrayInputStream(encapsulatedKey),\n symmetricScheme.encrypt(in, keyAndCiphertext.key)));\n }",
"String encrypt(String input) throws IllegalArgumentException, EncryptionException;",
"public static BigInteger encrypt(BigInteger lp, int k, BigInteger m) {\n\tBigInteger ret = getPadding(lp, k);\n\tret = ret.xor(m);\n\n\treturn ret;\n }",
"public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }",
"RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }",
"public XoxoMessage encrypt(String message, int seed) {\n //TODO: throw RangeExceededException for seed requirements\n if(seed > 36 || seed < 0){\n\n throw new RangeExceededException();\n }\n\n String encryptedMessage = this.encryptMessage(message); \n return new XoxoMessage(encryptedMessage, new HugKey(this.kissKey, seed));\n }",
"public String encrypt(String message, int key)\n\t{\n\t\tString encryptedMessage = \"\";\n\t\tchar ch;\n \n\t\tfor(int i = 0; i < message.length(); ++i){\n\t\t\tch = message.charAt(i);\n\t\t\t\n\t\t\tif(ch >= 'a' && ch <= 'z'){\n\t ch = (char)(ch + key);\n\t \n\t if(ch > 'z'){\n\t ch = (char)(ch - 'z' + 'a' - 1);\n\t }\n\t \n\t encryptedMessage += ch;\n\t }\n\t else if(ch >= 'A' && ch <= 'Z'){\n\t ch = (char)(ch + key);\n\t \n\t if(ch > 'Z'){\n\t ch = (char)(ch - 'Z' + 'A' - 1);\n\t }\n\t \n\t encryptedMessage += ch;\n\t }\n\t else {\n\t \tencryptedMessage += ch;\n\t }\n\t\t}\n return encryptedMessage;\n\t}",
"private static void SendToAuctioneer(BigInteger msg) {\r\n\t\tmsg=auctioneer_pk.encrypt(msg)[0];\r\n\t\tsendToClient(auctioneer,msg);\r\n\t}",
"String encode(File message, File key,File crypted);",
"public byte[] encrypt(byte[] input, Key pubKey) throws Exception {\n\t\tcipher.init(Cipher.ENCRYPT_MODE, pubKey);\n\t\treturn cipher.doFinal(input);\n\t}",
"public byte[] Tencryption() {\n int[] ciphertext = new int[message.length];\n\n for (int j = 0, k = 1; j < message.length && k < message.length; j = j + 2, k = k + 2) {\n sum = 0;\n l = message[j];\n r = message[k];\n for (int i = 0; i < 32; i++) {\n sum = sum + delta;\n l = l + (((r << 4) + key[0]) ^ (r + sum) ^ ((r >> 5) + key[1]));\n r = r + (((l << 4) + key[2]) ^ (l + sum) ^ ((l >> 5) + key[3]));\n }\n ciphertext[j] = l;\n ciphertext[k] = r;\n }\n return this.Inttobyte(ciphertext);\n\n }",
"private static BigInteger encrypt(BigInteger x, BigInteger e, BigInteger n) {\r\n\t\treturn x.modPow(e, n);\r\n\t}",
"byte[] encodePublicKey(PublicKey publicKey) throws IOException;",
"@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }",
"@Override\n\tprotected byte[] encryptSessionKey(SessionKey sessionKey,\n\t\t\tInputStream certificate) {\n\n\t\tCertificateFactory cf = null;\n\t\tCertificate cert = null;\n\t\ttry {\n\t\t\tcf = CertificateFactory.getInstance(\"X.509\");\n\t\t} catch (CertificateException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\tcert = cf.generateCertificate(certificate);\n\t\t} catch (CertificateException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\tCipher cipher = null;\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"RSA\");\n\t\t} catch (NoSuchAlgorithmException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t} catch (NoSuchPaddingException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\ttry {\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, cert);\n\t\t} catch (InvalidKeyException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tbyte[] ciphertext = null;\n\t\ttry {\n\t\t\tciphertext = cipher.doFinal();\n\t\t} catch (IllegalBlockSizeException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (BadPaddingException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn ciphertext;\n\t}",
"public static String encrypt(String message) {\n\t\tStringBuilder encryption = new StringBuilder();\n\t\tfor(int i=0;i<message.length();i++) {\n\t\t\tchar letter = message.charAt(i);\n\t\t\tif(letter >= 'a' && letter <= 'm') {\n\t\t\t\tletter +=13;\n\t\t\t}if(letter >= 'n' && letter <= 'z') {\n\t\t\t\tletter -=13;\n\t\t\t}if(letter >= 'A' && letter <= 'M') {\n\t\t\t\tletter +=13;\n\t\t\t}if(letter >= 'N' && letter <= 'Z') {\n\t\t\t\tletter -=13;\n\t\t\t}encryption.append(letter);\n\t\t}\n\t\treturn encryption.toString();\n\t}",
"public void encrypt(String s)\n\t{\n\t\tconvertToNum(s);\n\t\tfor(int i = 0; i < myMessage.length; i++)\n\t\t{\n\t\t\tmyView.setEncryptText((myMessage[i].modPow(E, publicKey)).toString() + \" \");\n\t\t}\n\t}",
"private static byte[] rsaTemplate(final byte[] data,\n final byte[] key,\n final int keySize,\n final String transformation,\n final boolean isEncrypt) {\n if (data == null || data.length == 0 || key == null || key.length == 0) {\n return null;\n }\n try {\n Key rsaKey;\n if (isEncrypt) {\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(key);\n rsaKey = KeyFactory.getInstance(\"RSA\").generatePublic(keySpec);\n } else {\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(key);\n rsaKey = KeyFactory.getInstance(\"RSA\").generatePrivate(keySpec);\n }\n if (rsaKey == null) return null;\n Cipher cipher = Cipher.getInstance(transformation);\n cipher.init(isEncrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE, rsaKey);\n int len = data.length;\n int maxLen = keySize / 8;\n if (isEncrypt) {\n String lowerTrans = transformation.toLowerCase();\n if (lowerTrans.endsWith(\"pkcs1padding\")) {\n maxLen -= 11;\n }\n }\n int count = len / maxLen;\n if (count > 0) {\n byte[] ret = new byte[0];\n byte[] buff = new byte[maxLen];\n int index = 0;\n for (int i = 0; i < count; i++) {\n System.arraycopy(data, index, buff, 0, maxLen);\n ret = joins(ret, cipher.doFinal(buff));\n index += maxLen;\n }\n if (index != len) {\n int restLen = len - index;\n buff = new byte[restLen];\n System.arraycopy(data, index, buff, 0, restLen);\n ret = joins(ret, cipher.doFinal(buff));\n }\n return ret;\n } else {\n return cipher.doFinal(data);\n }\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }\n return null;\n }",
"@Override\n public byte[] reEncrypt(byte[] ciphertext) {\n ECPoint point = checkPointOnCurve(ciphertext);\n return encrypt(point);\n }",
"public String encrypt() {\n StringBuilder encryptedText = new StringBuilder();\n //Make sure the key is valid.\n if (key < 0 || key > 25) {\n Log.d(\"TAG\", \"encrypt: Error in Keu=y \");\n return \"Key Must be 0 : 25\";\n }\n if (plaintext.length() <= 0) {\n Log.d(\"TAG\", \"encrypt: Error in Plain\");\n return \"Error in Plaintext\";\n }\n //Eliminates any whitespace and non alpha char's.\n plaintext = plaintext.trim();\n plaintext = plaintext.replaceAll(\"\\\\W\", \"\");\n if (plaintext.contains(\" \")) {\n plaintext = plaintext.replaceAll(\" \", \"\");\n }\n //Makes sure that all the letters are uppercase.\n plaintext = plaintext.toUpperCase();\n Log.i(\"Caesar\", \"encrypt: plainis : \" + plaintext);\n for (int i = 0; i < plaintext.length(); i++) {\n char letter = plaintext.charAt(i);\n if (charMap.containsKey(letter) && charMap.get(letter) != null) {\n int lookUp = (charMap.get(letter) + key) % 26;\n encryptedText.append(encryptionArr[lookUp]);\n }\n }\n Log.d(\"Caesar.java\", \"encrypt: the Data is \" + encryptedText.toString());\n return encryptedText.toString();\n }",
"public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }",
"public RSAKey(BigInteger n, BigInteger ed) {\n this.n = n;\n this.ed = ed;\n }",
"public static BigInteger bigIntEncrypt(String txt){\n\n\t String res = \"\"; //empty result string\n\n\t for(int i = 0; i < txt.length(); i++){ // for loop to get value of each char and adds to result\n\n\t res += (int)txt.charAt(i) + shift; // adds the num value of ascii to res string\n\n\t }\n\t\t\tSystem.out.println(\"------------------------------------------------\");\n\t System.out.println(\" String of char value + shift: \" + res); // shows the txt in big string format\n\t\t\tSystem.out.println(\"------------------------------------------------\\n\\n\");\n\n\t BigInteger bg = new BigInteger(res); // makes bigint out of res\n\n\n\t BigInteger newBg = bg.multiply(key); // math done to bigint\n\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\");\n\t System.out.println(\" String of char values * speical prime: \" + newBg);\n\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\\n\\n\");\n\n\t return newBg; // returns bigint, a very very big int\n\t }",
"private byte[] encrypt(ECPoint point) {\n return point.multiply(privateKey.getS()).getEncoded(true);\n }",
"public int encrypt(int clock){\n clock = clock * 10;\n try {\n os_obj = socket_obj.getOutputStream();\n osw_obj = new OutputStreamWriter(os_obj);\n bw_obj = new BufferedWriter(osw_obj);\n\n int message = clock;\n bw_obj.write(message);\n bw_obj.flush();\n\n }\n\n catch(Exception e)\n {\n e.printStackTrace();\n }\n\n\n return 0;\n }",
"public interface EncryptionAlgorithm {\n\n public String encrypt(String plaintext);\n\n}",
"public String cipher() {\n int[] r1taps = {13, 16, 17, 18};\n int[] r2taps = {20, 21};\n int[] r3taps = {7, 20, 21, 22};\n\n // Set register size and majority bits\n final int R1 = 19;\n final int R1M = 8;\n final int R2 = 22;\n final int R2M = 10;\n final int R3 = 23;\n final int R3M = 10;\n\n // Initialize variables\n String bs = \"\";\n byte[] key = HexStringToBytes(symKey);\n BitSet keySet = new BitSet();\n BitSet keyStream = new BitSet();\n BitSet messageSet = new BitSet();\n\n // Create a byte array length of sample message\n byte[] messageArray = new byte[message.length()];\n\n // Convert the sample message to a byte array\n try {\n messageArray = message.getBytes(\"ISO-8859-1\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n\n // Convert message sample byte array to string\n String as = \"\";\n for (int i = 0; i < messageArray.length; i++) {\n byte b1 = messageArray[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n as += s;\n }\n\n // Convert string of bits to a BitSet\n messageSet = BitStringToBitSet(as);\n\n // Creates string from key byte array\n for (int i = 0; i < 8; i++) {\n byte b1 = key[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n bs += s;\n }\n\n // Convert string of bits to a BitSet\n keySet = BitStringToBitSet(bs);\n\n // Initialize registers\n BitSet r1 = new BitSet();\n BitSet r2 = new BitSet();\n BitSet r3 = new BitSet();\n\n // Process key into registers\n for (int i = 0; i < 64; i++) {\n r1 = ShiftSet(r1, R1, keySet.get(i) ^ Tap(r1, r1taps));\n r2 = ShiftSet(r2, R2, keySet.get(i) ^ Tap(r2, r2taps));\n r3 = ShiftSet(r3, R3, keySet.get(i) ^ Tap(r3, r3taps));\n }\n\n // Clock additional 100 times for additional security (GSM standard)\n for (int i = 0; i < 100; i++) {\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n }\n\n // Create keystream as long as the sample message\n for (int i = 0; i < message.length() * 8; i++) {\n\n // Get keystream bit\n keyStream.set(i, r1.get(R1 - 1) ^ r2.get(R2 - 1) ^ r3.get(R3 - 1));\n\n // Shift majority registers\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n\n }\n\n // XOR the message with the created keystream and return as string\n messageSet.xor(keyStream);\n return BitStringToText(ReturnSet(messageSet, message.length() * 8));\n }",
"public static ProductGroupElement encrypt(ProductGroupElement m,\r\n \t\t\tProductRingElement s, ProductGroupElement pk, IGroup Gq,\r\n \t\t\tboolean negative) {\r\n \r\n \t\tIGroupElement g = pk.getElements().getAt(0);\r\n \t\tIGroupElement y = pk.getElements().getAt(1);\r\n \t\tArrayOfElements<IntegerRingElement> powers = s.getElements();\r\n \t\tArrayOfElements<IGroupElement> ms = m.getElements();\r\n \t\tArrayOfElements<IGroupElement> left = new ArrayOfElements<IGroupElement>();\r\n \t\tArrayOfElements<IGroupElement> right = new ArrayOfElements<IGroupElement>();\r\n \r\n \t\tfor (int i = 0; i < powers.getSize(); i++) {\r\n \t\t\tif (!negative) {\r\n \t\t\t\tleft.add(g.power(powers.getAt(i).getElement()));\r\n \t\t\t\tright.add((y.power(powers.getAt(i).getElement())).mult(ms\r\n \t\t\t\t\t\t.getAt(i)));\r\n \t\t\t} else {\r\n \t\t\t\tleft.add((g.power(powers.getAt(i).getElement())).inverse());\r\n \t\t\t\tright.add(((y.power(powers.getAt(i).getElement())).mult(ms\r\n \t\t\t\t\t\t.getAt(i))).inverse());\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\tProductGroupElement encryptedMsg = new ProductGroupElement(\r\n \t\t\t\tnew ProductGroupElement(left), new ProductGroupElement(right));\r\n \t\treturn encryptedMsg;\r\n \t}",
"public String Crypt(String s);",
"public String encrypt() throws LRException\n\t{\n\t\treturn LUEncrypt.encrypt(getFields(),\n\t\t\t((DataHRecordData)getData()).encryptKey.getStringValue());\n\t}",
"private void encryptionAlgorithm() {\n\t\ttry {\n\t\t\t\n\t\t\tFileInputStream fileInputStream2=new FileInputStream(\"D:\\\\program\\\\key.txt\");\n\t\t\tchar key=(char)fileInputStream2.read();\n\t\t\tSystem.out.println(key);\n\t\t\tFileInputStream fileInputStream1=new FileInputStream(\"D:\\\\program\\\\message.txt\");\n\t\t\tint i=0;\n\t\t\t\n\t\t\tStringBuilder message=new StringBuilder();\n\t\t\twhile((i= fileInputStream1.read())!= -1 )\n\t\t\t{\n\t\t\t\tmessage.append((char)i);\n\t\t\t}\n\t\t\tString s=message.toString();\n\t\t\tchar[] letters=new char[s.length()];\n\t\t\tStringBuilder en=new StringBuilder();\n\t\t\tfor(int j = 0;j < letters.length;j++)\n\t\t\t{\n\t\t\t\ten.append((char)(byte)letters[j]+key);\n\t\t\t}\t\t\n\t\t\tFileOutputStream fileoutput=new FileOutputStream(\"D:\\\\program\\\\encryptedfile.txt\");\n\t\t\t\n\t\t\tfileInputStream1.close();\n\t\t\tfileInputStream2.close();\n\t\t\t\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t\n\t}",
"public static void main(String[] args) throws Exception\n\t{\n\t\tSecurity.addProvider(new BouncyCastleProvider());\n\t\t//generate pub/prv keys \n\t\trsaGenerator rsa = new rsaGenerator();\n\t\trsa.generateRSAKey(\"server\");\n\n\t\t//Create a socket on port 3000\n\t\tServerSocket ss = new ServerSocket(3000);\t\n\t\tSystem.out.println(\"Waiting for client to connect...\");\n\t\tSocket s = ss.accept(); //Accept client connection \n\t\tSystem.out.println(\"Client connected\");\n\t\tObjectOutputStream dos = new ObjectOutputStream(s.getOutputStream()); //outputstream to send message to client\n\t\tdos.writeObject(\"You are connected\");\n\t\t\t\n\t\tObjectInputStream dis = new ObjectInputStream(s.getInputStream()); //input stream to recieve message from client\n\t\tSystem.out.println();\n\n //Recieve key and message from client\n SecretKey k = (SecretKey) dis.readObject(); //recieves the key\n byte[] iv = (byte[])dis.readObject(); //receives the iv\n byte[] received = (byte[])dis.readObject(); //recieves the encypted hash + message\n \n System.out.println(\"Received: \"+Base64.getEncoder().encodeToString(received));\n System.out.println();\n\n //decrypt the shared key using RSA\n System.out.println(\"Encoded Key: \"+ k);\n SecretKey decKey = rsa.decryptSharedKey(k.getEncoded());\n System.out.println(\"Decoded Key: \"+decKey);\n System.out.println();\n\n //decrypt using shared key \n\t\tbyte[] decryptCompByte = decryptByte(received,decKey,iv);\n System.out.println(\"Decrypted compressed concatenation: \"+Base64.getEncoder().encodeToString(decryptCompByte));\n System.out.println();\n \n //decompress\n String dcomp = decompress(decryptCompByte);\n \n \n //Separating the concatination\n String hash = dcomp.substring(0,dcomp.indexOf(\"|||\"));\n String message = dcomp.substring(dcomp.indexOf(\"|||\")+3);\n System.out.println(\"Encrypted hash: \"+hash);\n System.out.println();\n \n //decrypt hash using rsa\n hash = rsa.decryptHas(Base64.getDecoder().decode(hash));\n System.out.println(\"Decrypted hash: \"+hash);\n System.out.println();\n\n //create own hash to compare for authentication\n String myHash = Hash.hash(message);\n if(hash.equals(myHash))\n {\n System.out.println(\"---Message authenticated---\");\n System.out.println(message);\n System.out.println();\n System.out.println(\"Message received. Goodbye.\");\n }\n else\n {\n System.out.println(\"---Message NOT authenticated---\\nGoodbye.\");\n }\n \n s.close();\n ss.close();\n dos.close();\n dis.close();\n\t\t\t\n\n\t}",
"@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }",
"public Cipher getCipherRSA() throws NoSuchPaddingException, NoSuchAlgorithmException {\n return Cipher.getInstance(\"RSA/NONE/PKCS1Padding\");\n }",
"OpenSSLKey mo134201a();",
"public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }",
"public byte[] encrypt(byte[] input, String publicKeyFilePath) throws Exception {\n\t\treturn encrypt(input, getPublicKey(publicKeyFilePath));\n\t}",
"String getPublicKeyActorSend();",
"BigInteger getCEP();",
"public BigInteger apply(BigInteger m, boolean publicKey)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif (m.signum() != 1) { // i.e, m <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < m\r\n\r\n\t\t/*\r\n\t\t * Apply the public key since it should be small enough that will not merit using the Chinese\r\n\t\t * Remainder Theorem.\r\n\t\t */\r\n\t\tif (publicKey) {\r\n\t\t\treturn m.modPow(this.e, this.n);\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Check to see if we can use the Chinese Remainder Theorem instead of using the private key\r\n\t\t * directly.\r\n\t\t */\r\n\t\tif (this.p != null) {\r\n\t\t\t/**\r\n\t\t\t * Due to class invariants, we know that: <br>\r\n\t\t\t * 1. <code>this.q != null</code>. <br>\r\n\t\t\t * 2. <code>this.dP != null</code>. <br>\r\n\t\t\t * 3. <code>this.dQ != null</code>. <br>\r\n\t\t\t * 4. <code>this.qInv != null</code>. <br>\r\n\t\t\t * \r\n\t\t\t * Therefore, we can do the following: <br>\r\n\t\t\t * 1. <code>m = [(mP - mQ) * this.q * this.qInv + mQ] (mod this.n)</code>.\r\n\t\t\t */\r\n\r\n\t\t\tfinal BigInteger mP = m.modPow(this.dP, this.p);\r\n\t\t\tfinal BigInteger mQ = m.modPow(this.dQ, this.q);\r\n\t\t\tBigInteger result = mP.subtract(mQ);\r\n\t\t\tresult = result.multiply(this.q).multiply(this.qInv);\r\n\t\t\tresult = result.add(mQ).mod(this.n);\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * At this point, we know that publicKey is false and that the Chinese Remainder Theorem cannot be\r\n\t\t * used. Therefore, just perform the standard calculation.\r\n\t\t */\r\n\t\treturn m.modPow(this.d, this.n);\r\n\t}",
"@Override\n int doCryptoOperation(byte[] arrby, byte[] object) throws BadPaddingException, IllegalBlockSizeException {\n if (this.encrypting) {\n if (!this.usingPrivateKey) return NativeCrypto.RSA_public_encrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n return NativeCrypto.RSA_private_encrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n }\n try {\n if (!this.usingPrivateKey) return NativeCrypto.RSA_public_decrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n return NativeCrypto.RSA_private_decrypt(arrby.length, arrby, (byte[])object, this.key.getNativeRef(), this.padding);\n }\n catch (SignatureException signatureException) {\n object = new IllegalBlockSizeException();\n ((Throwable)object).initCause(signatureException);\n throw object;\n }\n }",
"String getPublicKey();",
"public static byte[] encryptText(String plainText,SecretKey secKey) throws Exception{\n\r\n Cipher aesCipher = Cipher.getInstance(\"AES\");\r\n\r\n aesCipher.init(Cipher.ENCRYPT_MODE, secKey);\r\n\r\n byte[] byteCipherText = aesCipher.doFinal(plainText.getBytes());\r\n\r\n return byteCipherText;\r\n\r\n}"
] | [
"0.7756929",
"0.7458207",
"0.69440275",
"0.6903333",
"0.68565124",
"0.6737576",
"0.6727306",
"0.6678753",
"0.66384333",
"0.6611151",
"0.6520186",
"0.6516373",
"0.6492165",
"0.6488891",
"0.6426001",
"0.6389363",
"0.638187",
"0.6376343",
"0.63257664",
"0.63066906",
"0.62903464",
"0.6275461",
"0.62334055",
"0.6221542",
"0.6220643",
"0.6220211",
"0.6215754",
"0.62135077",
"0.61381185",
"0.6137792",
"0.6135411",
"0.6113746",
"0.60814637",
"0.60552835",
"0.60500866",
"0.60388976",
"0.60036975",
"0.5999496",
"0.59582686",
"0.59444493",
"0.59370756",
"0.59350276",
"0.5922121",
"0.59103787",
"0.5906853",
"0.59012866",
"0.5884471",
"0.5866909",
"0.58582246",
"0.5833912",
"0.57877195",
"0.5783325",
"0.5778272",
"0.5773324",
"0.5771616",
"0.5768466",
"0.5760557",
"0.57581854",
"0.5743502",
"0.5739112",
"0.5738195",
"0.57377666",
"0.57377553",
"0.5723588",
"0.57003707",
"0.5665861",
"0.5664094",
"0.56638956",
"0.5643154",
"0.56156147",
"0.5614534",
"0.56040937",
"0.56028366",
"0.5595077",
"0.55919844",
"0.55803883",
"0.55750036",
"0.5557845",
"0.5555912",
"0.55455226",
"0.55270475",
"0.5523057",
"0.55165833",
"0.55097604",
"0.5476667",
"0.54704475",
"0.5469065",
"0.54680765",
"0.5465988",
"0.5463269",
"0.54578334",
"0.54344505",
"0.5427112",
"0.5421841",
"0.539094",
"0.53839785",
"0.536217",
"0.53588605",
"0.5354645",
"0.53459275"
] | 0.7240006 | 2 |
Function which decrypt a message using RSA algorithm | public static BigInteger decrypt(BigInteger cipherText, RSAPrivateKey key) {
try {
Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding");
cipher.init(Cipher.DECRYPT_MODE, key);
return new BigInteger(cipher.doFinal(cipherText.toByteArray()));
} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {
e.printStackTrace();
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract String decryptMsg(String msg);",
"private static String RSAdecrypt(byte[] signedhash) {\n String ab = new String(signedhash);\n //private keys\n BigInteger e = new BigInteger(\"65537\");\n BigInteger n = new BigInteger(\"2688520255179015026237478731436571621031218154515572968727588377065598663770912513333018006654248650656250913110874836607777966867106290192618336660849980956399732967369976281500270286450313199586861977623503348237855579434471251977653662553\");\n BigInteger m = new BigInteger(ab);\n BigInteger dataHash = m.modPow(e, n);\n String ComputeddataHash = new String(dataHash.toByteArray());\n return ComputeddataHash;\n }",
"private BigInteger decrypt(BigInteger encryptedMessage) {\n return encryptedMessage.modPow(d, n);\n }",
"public BigIntegerMod decrypt(Ciphertext ciphertext);",
"public byte[] decrypt(byte[] message, PrivateKey key) throws GeneralSecurityException {\n ByteBuffer buffer = ByteBuffer.wrap(message);\n int keyLength = buffer.getInt();\n byte[] encyptedPublicKey = new byte[keyLength];\n buffer.get(encyptedPublicKey);\n\n Cipher cipher = Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.DECRYPT_MODE, key);\n\n byte[] encodedPublicKey = cipher.doFinal(encyptedPublicKey);\n\n aes.setKeyValue(new String(encodedPublicKey));\n byte[] encryptedMessage = new byte[buffer.remaining()];\n buffer.get(encryptedMessage);\n String decrypt_message = \"\";\n try {\n decrypt_message = aes.decrypt(new String(encryptedMessage));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return decrypt_message.getBytes();\n }",
"void decryptMessage(String Password);",
"private BigInteger decrypt(BigInteger encrypted, BigInteger privateKey, BigInteger modulus){\n return encrypted.modPow(privateKey, modulus);\n }",
"public static byte[] rsaDecrypt(byte[] ciphertext, PrivateKey decryptionKey) {\n\t\t// (1p) Implement RSA decryption, replace `null` with actual plaintext\n\t\tbyte[] result = null;\n\t\tCipher cipher;\n\t\ttry {\n\t\t\tcipher = Cipher.getInstance(\"RSA\");\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, decryptionKey);\n\t\t\tresult = cipher.doFinal(ciphertext);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\n\t\treturn result;\n\t}",
"@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n int actKey = key % 65536;\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n decMsg[ind] = (char) ((letter - actKey < 0) ? letter - actKey + 65536 : letter - actKey);\n }\n return new String(decMsg);\n }\n }",
"@VisibleForTesting\n byte[] RSADecrypt(byte[] encryptedInput) throws IncompatibleDeviceException, CryptoException {\n try {\n PrivateKey privateKey = getRSAKeyEntry().getPrivateKey();\n Cipher cipher = Cipher.getInstance(RSA_TRANSFORMATION);\n cipher.init(Cipher.DECRYPT_MODE, privateKey);\n return cipher.doFinal(encryptedInput);\n } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) {\n /*\n * This exceptions are safe to be ignored:\n *\n * - NoSuchPaddingException:\n * Thrown if PKCS1Padding is not available. Was introduced in API 1.\n * - NoSuchAlgorithmException:\n * Thrown if the transformation is null, empty or invalid, or if no security provider\n * implements it. Was introduced in API 1.\n * - InvalidKeyException:\n * Thrown if the given key is inappropriate for initializing this cipher.\n *\n * Read more in https://developer.android.com/reference/javax/crypto/Cipher\n */\n Log.e(TAG, \"The device can't decrypt input using a RSA Key.\", e);\n throw new IncompatibleDeviceException(e);\n } catch (IllegalArgumentException | IllegalBlockSizeException | BadPaddingException e) {\n /*\n * Any of this exceptions mean the encrypted input is somehow corrupted and cannot be recovered.\n * Delete the AES keys since those originated the input.\n *\n * - IllegalBlockSizeException:\n * Thrown only on encrypt mode.\n * - BadPaddingException:\n * Thrown if the input doesn't contain the proper padding bytes.\n * - IllegalArgumentException\n * Thrown when doFinal is called with a null input.\n */\n deleteAESKeys();\n throw new CryptoException(\"The RSA encrypted input is corrupted and cannot be recovered. Please discard it.\", e);\n }\n }",
"public String Decrypt(String Message, int PrimeNo, String EncoderKeyPath) throws IOException\r\n {\r\n Scanner sc = new Scanner(System.in);\r\n Key key1 = new Key();\r\n char[] msg=new char[Message.length()];\r\n int s, x;\r\n System.out.println(\"Enter Your Secret Key To Decode \");\r\n x=sc.nextInt();\r\n int key = key1.Skey(PrimeNo, x, EncoderKeyPath);\r\n char s1;\r\n int len=Message.length();\r\n int res=0;\r\n\tfor(int i=0;i<len;i++)\r\n\t{\r\n res=i%key;\r\n s=Message.charAt(i);\r\n s-=res;\r\n s1= (char) s;\r\n msg[i]=s1;\t\r\n\t}\r\n String msg1 = new String(msg);\r\n return msg1; \r\n }",
"public String decrypt(String msg) {\n \n StringBuilder sb = new StringBuilder(msg);\n \n for (int i=0; i< sb.length(); i++) {\n char decrypted = decrypt(sb.charAt(i));\n sb.setCharAt(i, decrypted);\n }\n \n return sb.toString();\n }",
"public byte[] Tdecryption() {\n int[] plaintext = new int[message.length];\n\n for (int j = 0, k = 1; j < message.length && k < message.length; j = j + 2, k = k + 2) {\n sum = delta << 5;\n l = message[j];\n r = message[k];\n for (int i = 0; i < 32; i++) {\n r = r - (((l << 4) + key[2]) ^ (l + sum) ^ ((l >> 5) + key[3]));\n l = l - (((r << 4) + key[0]) ^ (r + sum) ^ ((r >> 5) + key[1]));\n sum = sum - delta;\n }\n plaintext[j] = l;\n plaintext[k] = r;\n }\n return this.Inttobyte(plaintext);\n }",
"@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n int temp = letter - 'a' - key;\n decMsg[ind] = (char) ('a' + (char) ((temp < 0) ? temp + 26 : temp));\n } else if (letter >= 'A' && letter <= 'Z') {\n int temp = letter - 'A' - key;\n decMsg[ind] = (char) ('A' + (char) ((temp < 0) ? temp + 26 : temp));\n } else {\n decMsg[ind] = letter;\n }\n }\n return new String(decMsg);\n }\n }",
"public String decryptMsg(String encryptedMsg) {\n encryptedMsg.toLowerCase(Locale.ROOT);\n\n //replace the things with the properties\n encryptedMsg = encryptedMsg.replace(\"1\", \"a\");\n encryptedMsg = encryptedMsg.replace(\"3\", \"e\");\n encryptedMsg = encryptedMsg.replace(\"5\", \"i\");\n encryptedMsg = encryptedMsg.replace(\"7\", \"o\");\n encryptedMsg = encryptedMsg.replace(\"9\", \"u\");\n\n //return the right value\n return encryptedMsg;\n }",
"public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}",
"public String Decrypt(String s);",
"void decrypt(ChannelBuffer buffer, Channel c);",
"public String decrypt(String key);",
"public void decrypt(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tString message = \"\";\n\t\tfor(int i = 0; i < chars.length; i++)\n\t\t{\n\t\t\tif(chars[i] == (char)32)\n\t\t\t{\n\t\t\t\tBigInteger encrypted = new BigInteger(message);\n\t\t\t\tconvertToString(encrypted.modPow(privateKey, publicKey).toString());\n\t\t\t\tmessage = \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmessage += chars[i];\n\t\t\t}\n\t\t}\n\t\tmyView.setDecryptText(myDecryptedMessage);\n\t\tmyDecryptedMessage = \"\";\n\t}",
"public String decrypt(String text) {\n byte[] dectyptedText = null;\n try {\n // decrypt the text using the private key\n cipher.init(Cipher.DECRYPT_MODE, publicKey);\n byte[] data=Base64.decode(text, Base64.NO_WRAP);\n String str=\"\";\n for(int i=0;i<data.length;i++)\n {\n str+=data[i]+\"\\n\";\n }\n android.util.Log.d(\"ali\",str);\n dectyptedText = cipher.doFinal(Base64.decode(text, Base64.NO_WRAP));\n return new String(dectyptedText);\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n return null;\n }",
"@Override\n public byte[] decrypt(byte[] ciphertext) {\n ECPoint point = checkPointOnCurve(ciphertext);\n BigInteger privateKeyInverse = privateKey.getS().modInverse(privateKey.getParams().getOrder());\n return point.multiply(privateKeyInverse).getEncoded(true);\n }",
"public String decrypt(String message) {\t\n\t\tchar [] letters = new char [message.length()];\n\t\tString newMessage = \"\";\n\n\t\t//create an array of characters from message\n\t\tfor(int i=0; i< message.length(); i++){\n\t\t\tletters[i]= message.charAt(i);\n\t\t}\n\n\t\tfor(int i=0; i<letters.length; i++){\n\t\t\tif(Character.isLetter(letters[i])){ //check to see if letter\n\t\t\t\tif(Character.isUpperCase(letters[i])){ //check to see if it is uppercase\n\t\t\t\t\tnewMessage += letters[i]; //add that character to new string\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//new message is the string that needs to be decrypted now \n\t\t//change the letters into numbers\n\t\tint [] decryptNums = new int[newMessage.length()];\n\t\tString alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\n\t\tfor(int i=0; i < newMessage.length(); i++){\n\t\t\tchar c = newMessage.charAt(i);\n\t\t\tint x = alphabet.indexOf(c) + 1;\n\t\t\tdecryptNums[i] = x;\n\t\t}\n\n\n\t\t//generate key from those numbers\n\t\tint[] keyNum = new int [decryptNums.length];\n\t\tfor(int i=0; i<decryptNums.length; i++){\n\t\t\tint x = getKey();\n\t\t\tkeyNum[i] = x;\n\t\t}\n\n\t\t//subtract letter number from key number\n\t\tint[] finalNum = new int [keyNum.length];\n\t\tfor(int i=0; i<keyNum.length; i++){\n\t\t\tint x= decryptNums[i]-keyNum[i];\n\t\t\tif(keyNum[i] >=decryptNums[i] ){\n\t\t\t\tx = x+26;\n\t\t\t\tfinalNum[i]=x;\n\t\t\t}else{\n\t\t\t\tfinalNum[i]=x;\n\t\t\t}\n\t\t}\n\n\t\t//now re match the alphabet to it \n\t\tchar[] finalChar = new char [finalNum.length];\n\n\t\tfor(int i=0; i< finalNum.length; i++){\n\t\t\tint x = finalNum[i]-1;\n\t\t\tchar c = alphabet.charAt(x);\n\t\t\tfinalChar[i]=c;\n\t\t}\n\n\t\tString decrypt = \"\";\n\t\tfor(int i=0; i< finalChar.length; i++){\n\t\t\tdecrypt += finalChar[i];\n\t\t}\n\t\t\n\t\treturn decrypt;\n\t}",
"static String decrypt(byte[] cipherTextArray, PrivateKey privateKey) throws Exception {\n Cipher cipher = Cipher.getInstance(RSA__PADDING);\n\n //Initialize Cipher for DECRYPT_MODE\n cipher.init(Cipher.DECRYPT_MODE, privateKey);\n\n //Perform Decryption\n byte[] decryptedTextArray = cipher.doFinal(cipherTextArray);\n\n return new String(decryptedTextArray);\n }",
"public String Decryption(BigInteger text){\n \tStringBuilder str = new StringBuilder();\n BigInteger decryptor = text.multiply(r.modInverse(q)).mod(q);\n int ch = 0;\n int cursor2 = 1;\n /*\n * Traverse w list, if element is small or equal to decryptor, then subtract\n * decryptor with the element. If cursor2 arrive to 128, it means we already\n * traverse 8 bits, convert the 8 bits to char and append to str, finally\n * reverse the str\n */\n for(int i = w.length;i > 0;i--){\n \t\tif(w[i-1].compareTo(decryptor) < 1){\n \t\t\tdecryptor = decryptor.subtract(w[i-1]);\n \t\t\tch += cursor2;\n \t\t}\n \t\tif(cursor2 == 128){\n \t\t\tstr.append((char) ch);\n \t\t\tcursor2 = 1;\n \t\t\tch = 0;\n \t\t\tcontinue;\n \t\t}\n \t\tcursor2 <<= 1;\n \t}\n return str.reverse().toString();\n }",
"public String decrypt(String cipherText);",
"public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }",
"public CryptObject reencrypt(Ciphertext ciphertext, BigIntegerMod r);",
"public String decrypt(String input) throws Throwable {\n byte[] inputByteArray = Base64.getDecoder().decode(input);\n String keyString = \"\";\n\n // read the private key\n BufferedReader reader = null;\n try {\n reader = new BufferedReader(\n new InputStreamReader(context.getAssets().open(\"Put your private key in assets and Enter its name here\"), \"UTF-8\"));\n String line;\n while ((line = reader.readLine()) != null) {\n keyString += line;\n }\n reader.close();\n }catch (IOException e){\n Toast.makeText(context, \"Couldn't create file reader\", Toast.LENGTH_SHORT).show();\n }\n\n // fetching the key from public key\n keyString = keyString.replaceAll(NEW_LINE_CHARACTER, EMPTY_STRING)\n .replaceAll(PRIVATE_KEY_START_KEY_STRING, EMPTY_STRING)\n .replaceAll(PRIVATE_KEY_END_KEY_STRING, EMPTY_STRING);\n\n byte[] privateKey = keyString.getBytes();\n\n Key generatePrivate = KeyFactory.getInstance(\"RSA\").\n generatePrivate(new PKCS8EncodedKeySpec(Base64.getDecoder().decode(privateKey)));\n\n // create RSA Cipher instance\n Cipher cipherInstance = Cipher.getInstance(\"RSA/None/PKCS1Padding\");\n cipherInstance.init(Cipher.DECRYPT_MODE, generatePrivate);\n\n // encrypt string\n byte[] decryptedByteArray = cipherInstance.doFinal(inputByteArray);\n return new String(decryptedByteArray);\n }",
"public String decrypt(String p, String pv, String md){\n char a;\n BigInteger b;\n String c = \"\", d = \"\";\n \n for(int i = 0; i < p.length(); i++){\n if((int)p.charAt(i) != 29)\n c += p.charAt(i);\n else{\n b = new BigInteger(c);\n a = (char)decrypt(b, new BigInteger(pv), new BigInteger(md)).intValue();\n d += a;\n c = \"\";\n }\n }\n return d;\n }",
"public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);",
"public String decrypt(byte[] encrypted, int length, Key publickey) {\r\n\t\tString result = null;\r\n\t\tbyte[] encrypt = Arrays.copyOfRange(encrypted, 0, encrypted.length - length);\r\n\t\tbyte[] hash = Arrays.copyOfRange(encrypted, encrypted.length - length, encrypted.length);\r\n\t\tString sign = ((Integer) encrypt.toString().hashCode()).toString();\r\n\t\tString verify = RSA.decrypt(hash, publickey);\r\n\t\tif (sign.equals(verify)) {\r\n\t\t\tresult = OFB.EnDecrypt(encrypt, diffie.getKey().toByteArray()).toString();\r\n\t\t} else {\r\n\t\t\tresult = \"error, bedieger\";\r\n\t\t}\r\n\t\treturn result;\r\n\t}",
"public String decryptAESKey(String encryptedAESKey, PrivateKey privateKey) throws Exception {\r\n Cipher cipher = Cipher.getInstance(\"RSA\");\r\n cipher.init(Cipher.DECRYPT_MODE, privateKey);\r\n return new String(cipher.doFinal(Base64.getDecoder().decode(encryptedAESKey)));\r\n }",
"public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }",
"public CryptObject encrypt(BigIntegerMod message);",
"String decryptString(String toDecrypt) throws NoUserSelectedException, IllegalValueException;",
"RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }",
"public static byte [] decryptAndVerify(PrivateKey decryptionKey, byte [] receivedCipherText){\r\n\t\tif(receivedCipherText == null) return null;\r\n\t\ttry {\r\n\t\t\t// NOTE: If both signAndEncrypt() and decryptAndVeryfy() methods use byte [] as cipherText, then base64 conversion\r\n\t\t\t// can be avoided here\r\n\t\t\t// convert incoming message to bytes\r\n\t\t\t// byte [] inputBuffer = StringUtil.base64Decode(receivedCipherText);\r\n\t\t\t// note that we make a copy to avoid overwriting the received cipher text\r\n\t\t\tbyte [] inputBuffer = Arrays.copyOf(receivedCipherText,receivedCipherText.length);\r\n\r\n\t\t\t// obtain the decryption key, and the cursor (current location in input buffer after the key)\r\n\t\t\tbyte [] wrappedEncryptionKey = unpackFromByteArray(inputBuffer, 0);\r\n\t\t\tint cursor = wrappedEncryptionKey.length+2;\r\n\t\t\t// unwrap the enclosed symmetric key using our public encryption key\r\n\t\t\tCipher unwrapper = Cipher.getInstance(encryptionAlgorithm);\r\n\t\t\tunwrapper.init(Cipher.UNWRAP_MODE, decryptionKey);\r\n\t\t\tKey k = unwrapper.unwrap(wrappedEncryptionKey,symmetricKeyAlgorithm,Cipher.SECRET_KEY);\r\n\r\n\t\t\t// decrypt the message. Note that decryption reduces the size of the message, so should fit\r\n\t\t\t// in the inputBuffer. We don't need the length of the decrypted message, since all lengths are\r\n\t\t\t// included in the message\r\n\t\t\tCipher decryptor = Cipher.getInstance(symmetricKeyAlgorithm);\r\n\t\t\tdecryptor.init(Cipher.DECRYPT_MODE, k);\r\n\t\t\tdecryptor.doFinal(inputBuffer,cursor,inputBuffer.length-cursor,inputBuffer,cursor);\r\n\r\n\t\t\t// locate the sender's public key used for signatures and update cursor\r\n\t\t\tbyte [] senderVerificationKey = unpackFromByteArray(inputBuffer, cursor);\r\n\t\t\tcursor += senderVerificationKey.length+2;\r\n\r\n\t\t\t// reconstruct the sender's public key used for message signing, and verify the signature\r\n\t\t\t// TODO: Note that the generation of the public key relies on the sender public key\r\n\t\t\t// using the algorithm defined by publicKeyAlgorithm. We need to encode the algorithm\r\n\t\t\t// as well\r\n\t\t\tX509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(senderVerificationKey);\r\n\t\t\tKeyFactory keyFactory = KeyFactory.getInstance(publicKeyAlgorithm);\r\n\t\t\tPublicKey pubKey = keyFactory.generatePublic(pubKeySpec);\r\n\r\n\t\t\t// locate the signature and update cursor\r\n\t\t\t// note: it is possible to reduce signature copy since verifier allows us to directly use the \r\n\t\t\t// signature bits in inpuBuffer, but the size is small, so we leave this here for the moment\r\n\t\t\tbyte [] signature = unpackFromByteArray(inputBuffer, cursor);\r\n\t\t\tcursor += signature.length+2;\r\n\r\n\t\t\t// locate the plainText\r\n\t\t\tbyte [] plainText = unpackFromByteArray(inputBuffer, cursor);\r\n\r\n\t\t\t// verify the signature\r\n\t\t\tSignature verifier = Signature.getInstance(signatureAlgorithm);\r\n\t\t\tverifier.initVerify(pubKey);\r\n\t\t\tverifier.update(plainText);\r\n\t\t\tif(!verifier.verify(signature)){\r\n\t\t\t\tthrow new ModelException(\"Unable to verify the message \"+new String(Arrays.copyOf(plainText, 10)));\r\n\t\t\t}\r\n\r\n\t\t\t// return the plain text\r\n\t\t\treturn plainText;\r\n\t\t} catch(Exception e){\r\n\t\t\tlogger.log(Level.WARNING,\"Unable to decrypt or verify incoming message \"+receivedCipherText, e);\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public String decrypt(String msg) {\n if (map == null) {\n getMapping();\n }\n\n // Find cipher match\n String ch = \"\";\n for (int j = 0; j < map.length; j++) {\n if ((map[j][0] + \"\").equals(msg)) {\n ch = (char)j + \"\";\n }\n }\n\n return ch;\n }",
"public static String decrypt(String input) {\n\t\t Base64.Decoder decoder = Base64.getMimeDecoder();\n\t String key = new String(decoder.decode(input));\n\t return key;\n\t}",
"public CryptObject reencrypt(Ciphertext ciphertext);",
"public BigInteger decrypt(BigInteger cipherText)\n {\n if (cipherText.compareTo(n) == -1) {\n return Utils.bigModPow(cipherText, d, n);\n }\n int eBlockByteLen = (n.bitLength() - 1) / 8 + 1;\n List<BigInteger> resList = new ArrayList<>();\n byte[] bytesCipherText = cipherText.toByteArray();\n // Split and decrypt each encrypted block\n Utils.traverseByteByBlock(bytesCipherText, eBlockByteLen, (byte[] b) -> {\n BigInteger eBlock = BigInteger.valueOf(b[0] & 0xFF);\n for (int j = 1; j < b.length; j++) {\n eBlock = eBlock.shiftLeft(8).add(BigInteger.valueOf(b[j] & 0xFF));\n }\n resList.add(0, Utils.bigModPow(eBlock, d, n));\n });\n // Concatenate all\n int blockByteLen = eBlockByteLen - 1; // decrypted block has 1 byte less than encrypted block, see the encrypt function\n return Utils.concatBigInteger(resList, blockByteLen);\n }",
"public int decrypt(){\n int message = 0;\n \n try {\n is_obj = socket_obj.getInputStream();\n isr_obj = new InputStreamReader(is_obj);\n br_obj = new BufferedReader(isr_obj);\n \n message = br_obj.read();\n \n //System.out.println(\"Proper Clock value received from Server is: \" +message);\n \t\t//return message/10; \n }\n catch (Exception e )\n {\n e.printStackTrace();\n }\n \treturn message/10;\n\t\n \n }",
"public static String decrypt(String seed, String encrypted)\r\nthrows Exception {\r\nbyte[] rawKey = getRawKey(seed.getBytes());\r\nbyte[] enc = Base64.decode(encrypted.getBytes(), Base64.DEFAULT);\r\nbyte[] result = decrypt(rawKey, enc);\r\nreturn new String(result);\r\n}",
"private static String decrypt(String in){\n\n\t\t\tString alphabet = \"1234567890\";\n\n\t\t\tString scramble1 = \"<;\\'_$,.?:|)\";\n\t\t String scramble2 = \"XYZVKJUTHM\";\n\t\t String scramble3 = \"tuvwxyz&*}\";\n\t\t String scramble4 = \"~!-+=<>%@#\";\n\t\t String scramble5 = \"PUDHCKSXWZ\";\n\n\t\t char messageIn[] = in.toCharArray();\n\t\t String r = \"\";\n\n\t\t for(int i = 0; i < in.length(); i++){\n\t\t if(i % 3 == 0){\n\t\t int letterIndex = scramble1.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 1){\n\t\t int letterIndex = scramble2.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }else if (i % 3 == 2){\n\t\t int letterIndex = scramble3.indexOf(in.charAt(i));\n\t\t r += alphabet.charAt(letterIndex);\n\t\t }\n\t\t }\n\t\treturn r;\n\t}",
"PGPPrivateKey decryptSecretKey(PGPSecretKey secretKey, String password);",
"RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }",
"public static String decrypt(String s, Key key)\n throws NotAuthorizedException\n {\n String result = null;\n try {\n Cipher cipher = Cipher.getInstance(\"RSA/ECB/OAEPWithSHA-256AndMGF1Padding\");\n cipher.init(DECRYPT_MODE, key);\n\n result = new String(cipher.doFinal(Base64.getUrlDecoder().decode(s)), \"UTF-8\");;\n } catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n } catch (NoSuchPaddingException e) {\n throw new RuntimeException(e);\n } catch (InvalidKeyException e) {\n throw new NotAuthorizedException(e);\n } catch (BadPaddingException e) {\n throw new RuntimeException(e);\n } catch (IllegalBlockSizeException e) {\n throw new RuntimeException(e);\n } catch (UnsupportedEncodingException e) {\n throw new RuntimeException(e);\n }\n return result;\n\n }",
"public void process(RSAMessage msg) throws IOException {\n relay(msg);\n }",
"public static String[] decryptTrackDataRSA(byte[] data) throws Exception {\n byte[] rsaBlock = new byte[256];\n System.arraycopy(data, 0, rsaBlock, 0, rsaBlock.length);\n byte[] decrypted = CryptoUtil.decryptRSABlock(PRIV_KEY_MOD_BYTES, PRIV_KEY_EXP_BYTES, rsaBlock);\n\n byte[] key = new byte[16];\n System.arraycopy(decrypted, 207, key, 0, key.length);\n\n byte[] enc = new byte[data.length - 272];\n System.arraycopy(data, 272, enc, 0, enc.length);\n\n byte[] dec = CryptoUtil.decryptAESCBC(key, enc);\n int offs = 0;\n\n String[] result = new String[2];\n\n result[0] = \"\";\n for (offs = 4; offs < dec.length && dec[offs] != 0; offs++) {\n result[0] += (char) dec[offs];\n }\n\n result[1] = \"\";\n for (offs += 1; offs < dec.length && dec[offs] != 0; offs++) {\n result[1] += (char) dec[offs];\n }\n\n offs++;\n byte[] sha256 = new byte[32];\n System.arraycopy(dec, offs, sha256, 0, sha256.length);\n\n MessageDigest md = MessageDigest.getInstance(\"SHA-256\");\n md.update(data, 256, 16);\n md.update(dec, 0, offs);\n byte[] calcSHA = md.digest();\n\n if (!MessageDigest.isEqual(calcSHA, sha256)) {\n throw new RuntimeException(\"Wrong key\");\n }\n\n return result;\n }",
"public static byte[] decryptRSA(final byte[] data,\n final byte[] privateKey,\n final int keySize,\n final String transformation) {\n return rsaTemplate(data, privateKey, keySize, transformation, false);\n }",
"public void receive_message(){\n logical_clock++;\n \n decrypt();\n System.out.println(\"Receive Message Clock:\" +logical_clock);\n }",
"String decrypt(PBEncryptStorage pbeStorage, String password, byte[] salt);",
"public int decryptStorage(String password) throws RemoteException;",
"public byte[] decrypt(byte[] input, Key privKey) throws Exception {\n\t\tcipher.init(Cipher.DECRYPT_MODE, privKey);\n\t\treturn cipher.doFinal(input);\t\n\t}",
"public byte[] decrypt(byte[] data, int token, String pin) \n\t\tthrows SignedDocException;",
"private byte[] decode(byte[] msg) {\r\n\t\treturn Base64.decode(msg); \r\n\t}",
"public static void dec(String cipherText, String key) {\n char msg[] = cipherText.toCharArray();\n int msglen = msg.length;\n int i,j;\n \n // Creating new char arrays\n char keygenerator[] = new char[msglen];\n char encMsg[] = new char[msglen];\n char decdMsg[] = new char[msglen];\n \n /* Generate key, using keyword in cyclic manner equal to the length of original message i.e plaintext */\n for(i = 0, j = 0; i <msglen; ++i, ++j)\n {\n if(j == key.length() - 1)\n {\n j = 0;\n }\n keygenerator[i] = key.charAt(j);\n }\n \n //Decryption\n for(i = 0; i < msglen; ++i) {\n decdMsg[i] = (char)((((encMsg[i] - keygenerator[i]) + 26) % 26) + 'A');\n }\n\n System.out.println(\"Decrypted Message: \" + String.valueOf(decdMsg));\n }",
"@Override\n public byte[] getRSAKeyById(String id) throws IOException, DecoderException {\n // TODO: bring that back after LocalEGA key server becomes able to register itself against Eureka\n // ResponseEntity<Resource> responseEntity =\n // restTemplate.getForEntity(keyServiceURL + \"/temp/rsa/\" + id, Resource.class);\n\n String rawKey = IOUtils.toString(new URL(keyServiceURL + \"/temp/rsa/\" + id).openStream(), Charset.defaultCharset());\n System.out.println(\"DEBUG getRSAKey: rawKey=\" + rawKey);\n String privateKey = String.valueOf(rawKey);\n byte[] privateKeyBytes = Hex.decodeHex(privateKey.toCharArray());\n try (PemReader pemReader = new PemReader(new InputStreamReader(new ByteArrayInputStream(privateKeyBytes)))) {\n return pemReader.readPemObject().getContent();\n }\n }",
"public static void main(String[] args) throws Exception\n\t{\n\t\tSecurity.addProvider(new BouncyCastleProvider());\n\t\t//generate pub/prv keys \n\t\trsaGenerator rsa = new rsaGenerator();\n\t\trsa.generateRSAKey(\"server\");\n\n\t\t//Create a socket on port 3000\n\t\tServerSocket ss = new ServerSocket(3000);\t\n\t\tSystem.out.println(\"Waiting for client to connect...\");\n\t\tSocket s = ss.accept(); //Accept client connection \n\t\tSystem.out.println(\"Client connected\");\n\t\tObjectOutputStream dos = new ObjectOutputStream(s.getOutputStream()); //outputstream to send message to client\n\t\tdos.writeObject(\"You are connected\");\n\t\t\t\n\t\tObjectInputStream dis = new ObjectInputStream(s.getInputStream()); //input stream to recieve message from client\n\t\tSystem.out.println();\n\n //Recieve key and message from client\n SecretKey k = (SecretKey) dis.readObject(); //recieves the key\n byte[] iv = (byte[])dis.readObject(); //receives the iv\n byte[] received = (byte[])dis.readObject(); //recieves the encypted hash + message\n \n System.out.println(\"Received: \"+Base64.getEncoder().encodeToString(received));\n System.out.println();\n\n //decrypt the shared key using RSA\n System.out.println(\"Encoded Key: \"+ k);\n SecretKey decKey = rsa.decryptSharedKey(k.getEncoded());\n System.out.println(\"Decoded Key: \"+decKey);\n System.out.println();\n\n //decrypt using shared key \n\t\tbyte[] decryptCompByte = decryptByte(received,decKey,iv);\n System.out.println(\"Decrypted compressed concatenation: \"+Base64.getEncoder().encodeToString(decryptCompByte));\n System.out.println();\n \n //decompress\n String dcomp = decompress(decryptCompByte);\n \n \n //Separating the concatination\n String hash = dcomp.substring(0,dcomp.indexOf(\"|||\"));\n String message = dcomp.substring(dcomp.indexOf(\"|||\")+3);\n System.out.println(\"Encrypted hash: \"+hash);\n System.out.println();\n \n //decrypt hash using rsa\n hash = rsa.decryptHas(Base64.getDecoder().decode(hash));\n System.out.println(\"Decrypted hash: \"+hash);\n System.out.println();\n\n //create own hash to compare for authentication\n String myHash = Hash.hash(message);\n if(hash.equals(myHash))\n {\n System.out.println(\"---Message authenticated---\");\n System.out.println(message);\n System.out.println();\n System.out.println(\"Message received. Goodbye.\");\n }\n else\n {\n System.out.println(\"---Message NOT authenticated---\\nGoodbye.\");\n }\n \n s.close();\n ss.close();\n dos.close();\n dis.close();\n\t\t\t\n\n\t}",
"public byte[] decrypt(PrivateKey privateKey){\n SecretKey symmetricKey = null;\n try {\n Cipher symmetricKeyDecryption = Cipher.getInstance(\"RSA\");\n symmetricKeyDecryption.init(Cipher.DECRYPT_MODE, privateKey);\n symmetricKey = new SecretKeySpec(symmetricKeyDecryption.doFinal(getEncryptedSymmetricKey()), getSymmetricEncryption().getEncryptionAlgorithm());\n } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n e.printStackTrace();\n }\n\n // decrypt license with symmetric encryption\n return getSymmetricEncryption().decrypt(symmetricKey);\n /*\n License license = null;\n try {\n ObjectInputStream objectInputStream = new ObjectInputStream(new ByteArrayInputStream(licenseBytes));\n license = (License) objectInputStream.readObject();\n objectInputStream.close();\n } catch (IOException | ClassNotFoundException e) {\n e.printStackTrace();\n }\n return license;\n */\n }",
"@Override\n public InputStream decrypt(InputStream in, DecryptionKey privateKey) throws IOException {\n byte[] keyLenBytes = new byte[4];\n int triesLeft = 10;\n for (int i = 0; i < 4; i++) {\n while (in.read(keyLenBytes, i, 1) < 1 && --triesLeft > 0) {\n ;\n }\n }\n if (triesLeft == 0)\n throw new IOException(\"didn't get keylen data from ciphertext\");\n int keyLen = ByteBuffer.wrap(keyLenBytes).getInt();\n\n //Deserialize the encapsulated key\n byte[] encapsulatedKeyBytes = new byte[keyLen];\n triesLeft = 10;\n for (int i = 0; i < keyLen; i++) {\n while (in.read(encapsulatedKeyBytes, i, 1) < 1 && --triesLeft > 0) {\n ; //TODO: don't read byte by byte...\n }\n }\n if (triesLeft == 0)\n throw new IOException(\"couldn't read encapulated key from ciphertext\");\n CipherText encapsulatedKey =\n kem.restoreEncapsulatedKey(new JSONConverter().deserialize(new String(encapsulatedKeyBytes)));\n\n //decaps the encapsulated key\n SymmetricKey symmetricKey = kem.decaps(encapsulatedKey, privateKey);\n\n //Return a stream where caller can read the decrypted payload\n return symmetricScheme.decrypt(in, symmetricKey);\n }",
"public String entschlüsseln(SecretKey key, String nachricht) throws Exception{\n BASE64Decoder myDecoder2 = new BASE64Decoder();\n byte[] crypted2 = myDecoder2.decodeBuffer(nachricht);\n\n // Entschluesseln\n Cipher cipher2 = Cipher.getInstance(\"AES\");\n cipher2.init(Cipher.DECRYPT_MODE, key);\n byte[] cipherData2 = cipher2.doFinal(crypted2);\n String erg = new String(cipherData2);\n\n // Klartext\n return(erg);\n\n}",
"BigInteger decodeBigInteger();",
"public void decryptMessageClick(View view) {\n\n String receivedMessage = mMessageContentEditText.getText().toString();\n mMessage.extractEncryptedMessageAndKey(receivedMessage);\n\n if(!decryptMessage()) showToast(\"Error! failed to decrypt text.\");\n\n else{\n\n showDecryptedMessage();\n }\n }",
"public PLEncrypterDecrypter( String textParms )\n {}",
"public static BigInteger encrypt(BigInteger message, RSAPublicKey key) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\treturn new BigInteger(cipher.doFinal(message.toByteArray()));\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"private static void decryptFile(String fileInput, String privateKeyFilename, String password) throws Exception {\n\n\t\t// Load the private key bytes\n\t\tFileInputStream fis = new FileInputStream(privateKeyFilename);\n\t\tByteArrayOutputStream baos = new ByteArrayOutputStream();\n\n\t\tint theByte = 0;\n\t\twhile ((theByte = fis.read()) != -1) {\n\t\t\tbaos.write(theByte);\n\t\t}\n\t\tfis.close();\n\n\t\tbyte[] keyBytes = baos.toByteArray();\n\t\tbaos.close();\n\n\t\tkeyBytes = passwordDecrypt(password.toCharArray(), keyBytes);\n\n\t\t// Turn the encoded key into a real RSA private key.\n\t\t// Private keys are encoded in PKCS#8.\n\t\tPKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);\n\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\tPrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n\n\t\t// Create a cipher using that key to initialize it\n\t\tCipher rsaCipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\n\t\t// Read in the encrypted bytes of the session key\n\t\tDataInputStream dis = new DataInputStream(new FileInputStream(fileInput + ENCRYPTED_FILENAME_SUFFIX));\n\t\tbyte[] encryptedKeyBytes = new byte[dis.readInt()];\n\t\tdis.readFully(encryptedKeyBytes);\n\n\t\t// Decrypt the session key bytes.\n\t\trsaCipher.init(Cipher.DECRYPT_MODE, privateKey);\n\t\tbyte[] rijndaelKeyBytes = rsaCipher.doFinal(encryptedKeyBytes);\n\n\t\t// Transform the key bytes into an actual key.\n\t\tSecretKey rijndaelKey = new SecretKeySpec(rijndaelKeyBytes, \"Rijndael\");\n\n\t\t// Read in the Initialization Vector from the file.\n\t\tbyte[] iv = new byte[16];\n\t\tdis.read(iv);\n\t\tIvParameterSpec spec = new IvParameterSpec(iv);\n\n\t\tCipher cipher = Cipher.getInstance(\"Rijndael/CBC/PKCS5Padding\");\n\t\tcipher.init(Cipher.DECRYPT_MODE, rijndaelKey, spec);\n\t\tCipherInputStream cis = new CipherInputStream(dis, cipher);\n\n\t\tSystem.out.println(\"Decrypting the file...\");\n\t\tFileOutputStream fos = new FileOutputStream(fileInput + DECRYPTED_FILENAME_SUFFIX);\n\n\t\t// Read through the file, decrypting each byte.\n\t\ttheByte = 0;\n\t\twhile ((theByte = cis.read()) != -1) {\n\t\t\tfos.write(theByte);\n\t\t}\n\t\tcis.close();\n\t\tfos.close();\n\t\tSystem.out.println(\"Done.\");\n\t\treturn;\n\t}",
"public static String decryptBellaso(String encryptedText, String bellasoStr) {\r\n String decryptedText = \"\";\r\n\t\t\r\n\t\tchar [] deText = new char[encryptedText.length()];\r\n\t\t\r\n\t mappingKeyToMessage(bellasoStr,encryptedText);\r\n\t \r\n\t char [] enText = encryptedText.toCharArray();\r\n\t\tchar [] blText = bellasoStr.toCharArray();\r\n\t\t\r\n\t\tint i=0;\r\n\t\tint diff = 0;\r\n\t\t\r\n\t\tdiff = diff + enText[i];\r\n\t\tdiff = diff + blText[1];\r\n\t\tdiff += RANGE;\r\n\t\tSystem.out.print(diff);\r\n\t\tdo {\r\n\t\t\tfor(char m: enText) {\r\n\t\t\t\r\n\t\t\t\tif (diff <32) {\r\n\t\t\t\t\tdiff += RANGE;\r\n\t\t\t\t\tm += diff;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}else {\r\n\t\t\t\t\tm +=diff;\r\n\t\t\t\t\tdeText[i] = m;\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}while(i<encryptedText.length());\r\n\t\tdecryptedText = String.valueOf(deText);\r\n\t\t\r\n\t \r\n\t return decryptedText; \r\n\t}",
"public void testCaesar(){\n String msg = \"At noon be in the conference room with your hat on for a surprise party. YELL LOUD!\";\n \n /*String encrypted = encrypt(msg, key);\n System.out.println(\"encrypted \" +encrypted);\n \n String decrypted = encrypt(encrypted, 26-key);\n System.out.println(\"decrypted \" + decrypted);*/\n \n \n String encrypted = encrypt(msg, 15);\n System.out.println(\"encrypted \" +encrypted);\n \n }",
"@Override\n\tpublic void Decrypt(Object key) {\n\n\t}",
"@GetMapping(\"/decrypt\")\n public String decrypt(String uid, String data) {\n return \"\";\n }",
"String decrypt(String input) {\n\t\treturn new String(BaseEncoding.base64().decode(input));\n\t}",
"public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }",
"public byte[] decryptKek(byte[] privateKey, byte[] encryptedKey){\n\n try {\n AsymmetricBlockCipher cipher = new OAEPEncoding(new RSAEngine(), new SHA1Digest());\n RSAPrivateKey rsaPrivateKey = RSAPrivateKey.getInstance(ASN1Sequence.fromByteArray(privateKey));\n cipher.init(false, new RSAKeyParameters(true, rsaPrivateKey.getModulus(), rsaPrivateKey.getPrivateExponent()));\n return cipher.processBlock(encryptedKey, 0, encryptedKey.length);\n\n } catch (Exception e) {\n LOG.error(\"There was an error decrypting kek: \", e);\n }\n return null;\n }",
"public byte[] decrypt(byte[] input, String privateKeyFilePath) throws Exception {\n\t\treturn decrypt(input, getPrivateKey(privateKeyFilePath));\t\n\t}",
"public String decrypt(String text) {\n\t\t\n\t\t//Porta encryption is symmetric so no additional decryption implementation is necessary\n\t\treturn encrypt(text);\n\t}",
"public static byte[] decrypt(byte[] message, byte[] key) throws Exception {\n byte[] initialValue = new byte[initialValueSize];\r\n System.arraycopy(message, 0, initialValue, 0, initialValueSize);\r\n IvParameterSpec initialValueSpec = new IvParameterSpec(initialValue);\r\n //get ciphertext from byte array input\r\n byte[] ciphertext = new byte[message.length - initialValueSize];\r\n\t\tSystem.arraycopy(message, initialValueSize, ciphertext, 0, message.length - initialValueSize);\r\n //initialize key, only 128 bits key for AES in Java\r\n key = Arrays.copyOf(hashMessage(key), 16);\r\n //initialize AES decryption algorithm\r\n\t\tSecretKeySpec keySpec = new SecretKeySpec(key, \"AES\");\r\n\t\tCipher aesCipher = Cipher.getInstance(\"AES/CBC/PKCS5Padding\");\r\n\t\taesCipher.init(Cipher.DECRYPT_MODE, keySpec, initialValueSpec);\r\n //decrypt message by applying the decryption algorithm\r\n\t\tbyte[] decryptedMessage = aesCipher.doFinal(ciphertext);\r\n return decryptedMessage;\r\n\t}",
"@Override\n public void decrypt(byte[] text) {\n if ( text.length != blockSize()) throw new IllegalArgumentException(\"text.length != cipher.blockSize())\");\n byte []temp = new byte[nonce.length];\n System.arraycopy(text, 0, temp, 0, blockSize());\n ciper.setKey(key);\n ciper.decrypt(text);\n xor_nonce(text);\n System.arraycopy(temp, 0, nonce, 0, blockSize());\n }",
"IMessage decode(byte[] data) throws InvalidMessageException;",
"@Override\n public void decrypt() {\n algo.decrypt();\n String cypher = vigenereAlgo(false);\n this.setValue(cypher);\n }",
"public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }",
"public String decode(String cipherText){\n String decodedMsg = cipherText;\n for(int i=0;i<n;i++)\n decodedMsg = reShuffle(decodedMsg);\n return decodedMsg;\n }",
"private static String bigIntDecode(String in){\n\n\t BigInteger largeNum = new BigInteger(in); // declare and initialize the largenum\n\t\t//\n\t BigInteger smallNum = largeNum.divide(key); // reverse math done in encryption\n\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\");\n\tSystem.out.println( \"Char Value *Must subtract shift now*: \" + smallNum.toString());\n\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\\n\\n\");\n\t in = smallNum.toString(); //updates in to the small original big int\n\n\n\t String r = \"\"; // empty result string\n\n\t for(int i = 0; i < in.length();i += 3){ // for loop to extract each 3 nums and get ascii value\n\n\t char add; // declars the char to be added\n\n\t if(in.length() < 2){ //if to determine and handle short encryption\n\t add = (char)(Integer.parseInt(in.substring(i, i + 3)) - shift);\n\n\t }else{ // else, countine as normal, substring each 2 numbers and convert to ascii letter\n\t add = (char)(Integer.parseInt(in.substring(i, i + 3)) - shift );\n\n\t }\n\n\t r+= add; // updates result string\n\t }\n\t\t\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\");\n\t\t\t\t\tSystem.out.println(\" Decrypted Message Found: \" + r);\n\t\t\t\t\t\tSystem.out.println(\"--------------------------------------------------------------------------------------------------------------------------\\n\\n\");\n\t return r; // returns result string\n\t }",
"@Override\n public String decrypt(String encryptedText) {\n if (StringUtils.isBlank(encryptedText)) {\n return null;\n }\n\n try {\n byte[] decoded = Base64.getDecoder().decode(encryptedText);\n\n byte[] iv = Arrays.copyOfRange(decoded, 0, GCM_IV_LENGTH);\n\n Cipher cipher = Cipher.getInstance(ENCRYPT_ALGORITHM);\n GCMParameterSpec ivSpec = new GCMParameterSpec(GCM_TAG_LENGTH * Byte.SIZE, iv);\n cipher.init(Cipher.DECRYPT_MODE, getKeyFromPassword(), ivSpec);\n\n byte[] ciphertext = cipher.doFinal(decoded, GCM_IV_LENGTH, decoded.length - GCM_IV_LENGTH);\n\n return new String(ciphertext, StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException\n | IllegalArgumentException\n | InvalidKeyException\n | InvalidAlgorithmParameterException\n | IllegalBlockSizeException\n | BadPaddingException\n | NoSuchPaddingException e) {\n LOG.debug(ERROR_DECRYPTING_DATA, e);\n throw new EncryptionException(e);\n }\n }",
"public abstract String encryptMsg(String msg);",
"public BigInteger apply(BigInteger m, boolean publicKey)\r\n\t\t\tthrows NullPointerException, IllegalArgumentException, ArithmeticException {\r\n\t\tif (m.signum() != 1) { // i.e, m <= 0\r\n\t\t\tthrow new IllegalArgumentException();\r\n\t\t}\r\n\t\t// 0 < m\r\n\r\n\t\t/*\r\n\t\t * Apply the public key since it should be small enough that will not merit using the Chinese\r\n\t\t * Remainder Theorem.\r\n\t\t */\r\n\t\tif (publicKey) {\r\n\t\t\treturn m.modPow(this.e, this.n);\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * Check to see if we can use the Chinese Remainder Theorem instead of using the private key\r\n\t\t * directly.\r\n\t\t */\r\n\t\tif (this.p != null) {\r\n\t\t\t/**\r\n\t\t\t * Due to class invariants, we know that: <br>\r\n\t\t\t * 1. <code>this.q != null</code>. <br>\r\n\t\t\t * 2. <code>this.dP != null</code>. <br>\r\n\t\t\t * 3. <code>this.dQ != null</code>. <br>\r\n\t\t\t * 4. <code>this.qInv != null</code>. <br>\r\n\t\t\t * \r\n\t\t\t * Therefore, we can do the following: <br>\r\n\t\t\t * 1. <code>m = [(mP - mQ) * this.q * this.qInv + mQ] (mod this.n)</code>.\r\n\t\t\t */\r\n\r\n\t\t\tfinal BigInteger mP = m.modPow(this.dP, this.p);\r\n\t\t\tfinal BigInteger mQ = m.modPow(this.dQ, this.q);\r\n\t\t\tBigInteger result = mP.subtract(mQ);\r\n\t\t\tresult = result.multiply(this.q).multiply(this.qInv);\r\n\t\t\tresult = result.add(mQ).mod(this.n);\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t * At this point, we know that publicKey is false and that the Chinese Remainder Theorem cannot be\r\n\t\t * used. Therefore, just perform the standard calculation.\r\n\t\t */\r\n\t\treturn m.modPow(this.d, this.n);\r\n\t}",
"@Override\n\tpublic double decrypt(String encryptedText) {\n\t\treturn cryptoProvider.decrypt(encryptedText);\n\t}",
"public EncryptorReturn decrytp(String in) throws CustomizeEncryptorException;",
"public static byte[] decryptBase64RSA(final byte[] data,\n final byte[] privateKey,\n final int keySize,\n final String transformation) {\n return decryptRSA(base64Decode(data), privateKey, keySize, transformation);\n }",
"@Test\r\n public void testDecrypt()\r\n {\r\n System.out.println(\"decrypt\");\r\n String input = \"0fqylTncsgycZJQ+J5pS7v6/fj8M/fz4bavB/SnIBOQ=\";\r\n KeyMaker km = new KeyMaker();\r\n SecretKeySpec sks = new SecretKeySpec(km.makeKeyDriver(\"myPassword\"), \"AES\");\r\n EncyptDecrypt instance = new EncyptDecrypt();\r\n String expResult = \"Hello how are you?\";\r\n String result = instance.decrypt(input, sks);\r\n assertEquals(expResult, result);\r\n }",
"public String decryptString(String encryptedMessage) {\n return new String(decrypt(new BigInteger(encryptedMessage)).toByteArray());\n }",
"public static void main(String[] args) throws Exception {\n \t\t\n \t\tSystem.out.println(new String(RSAdecryptByPublicKey(\"9ff782468e12e04a0229f0b2846c09eggo\".getBytes(), \n \t\t\t\t\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDP8ig8yOrDyWDIisI2ra8PTe7fS086nVG3t2vMTlueb7xwqUmeSvirQxvSYeRSpWBHfaUTBWgsrCgA0cSKFyJJvPOABIEORycYhSVqrPqYtbbqdyxKqC56km6viXTQqmSjco133MDuzWeQjGXneR24wzxTZc2dgy/TlZr06miJAwIDAQAB\")));\n\t}",
"public static String decryptCaesar(String encryptedText, int key) {\r\n\t\t// copying plaintext into char array.\r\n\t\tchar[] ipArr = encryptedText.toCharArray();\r\n\t\tchar[] opArr = new char[ipArr.length];\r\n\t\tint tmp = '0';\r\n\t\twhile(key > RANGE)\r\n\t\t{\r\n\t\t\tkey=key-RANGE;\r\n\t\t}\t\t\t\r\n\t\tfor (int i = 0; i < ipArr.length; i++) {\r\n\t\t\t\r\n\t\t\t\ttmp = (ipArr[i]+RANGE)-key;\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\tif(tmp>UPPER_BOUND) \r\n\t\t\t\t{\r\n\t\t\t\t\ttmp=tmp-RANGE;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\tif(tmp<LOWER_BOUND) \r\n\t\t\t\t{\r\n\t\t\t\t\ttmp=tmp+RANGE;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\topArr[i]=(char)tmp;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\treturn new String(opArr);\r\n\t}",
"public void runDecrypt(String filePath) {\n try {\n byte[] paramArrayOfbyte = Files.readAllBytes(Paths.get(filePath));\n if (paramArrayOfbyte.length >= 1024 && ((paramArrayOfbyte[0] == 73 && paramArrayOfbyte[1] == 71\n && paramArrayOfbyte[2] == 69 && paramArrayOfbyte[3] == 70)\n || (paramArrayOfbyte[0] == 67 && paramArrayOfbyte[1] == 68 && paramArrayOfbyte[2] == 69\n && paramArrayOfbyte[3] == 70))) {\n // TODO: figure out why it only selects 1024 bytes.\n if (paramArrayOfbyte.length != 1024) {\n byte[] arrayOfByte = new byte[1024];\n System.arraycopy(paramArrayOfbyte, 0, arrayOfByte, 0, 1024);\n paramArrayOfbyte = arrayOfByte;\n }\n\n // Not sure why needing this section?\n byte[] arrayOfByte1 = new byte[12];\n byte[] arrayOfByte2 = new byte[12];\n System.arraycopy(paramArrayOfbyte, 4, arrayOfByte1, 0, 12);\n System.arraycopy(paramArrayOfbyte, 16, arrayOfByte2, 0, 12);\n\n // Init the most important object.\n com.b.a.b.aa.a h = new com.b.a.b.aa.a(new com.b.a.b.aa.b() {\n public byte[] a() {\n return null;\n }\n\n public int b() {\n return 3;\n }\n });\n\n String str1 = (new String(paramArrayOfbyte, 28, 32)).intern();\n // String str2 = a.a(this.n, str1);\n String str2 = Decrypt.DECRYPTION_KEY;\n int i = h.a(str2.getBytes());\n byte[] guessResult = h.b();\n h.b(guessResult); // Digest, this also sets com.b.a.a.aa.a.b. (The hashmap)\n if (i != 0)\n System.out.println(Dumper.dump(h.a(i)));\n else\n System.out.println(\"error in i.\");\n\n // Using the official file reader.\n net.zamasoft.reader.book.a.b randomAccessFile = new net.zamasoft.reader.book.a.b(new File(filePath));\n System.out.println(\"file length: \" + randomAccessFile.length());\n System.out.println(\"key: \" + com.b.a.a.a.c.a.getBLatest());\n ArrayList<Byte> bytes = new ArrayList<>();\n while (!randomAccessFile.isEOF()) {\n byte b = (byte) randomAccessFile.read();\n bytes.add(b);\n }\n assert randomAccessFile.length() == bytes.size();\n byte[] bs = new byte[bytes.size()];\n for (int ii = 0; ii < bs.length; ii++) {\n bs[ii] = bytes.get(ii);\n }\n System.out.println(\"bytes length: \" + bytes.size());\n System.out.println(new String(bs, \"utf-8\"));\n } else {\n System.out.println(\"NOOOOOOOO!\");\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }",
"@GetMapping(\"/encrypt-decrypt/{smallMsg}\")\n\tpublic String encryptDecrypt(@PathVariable String password, @RequestParam(\"message\") String message) {\n\t\tSystem.out.println(\"IN CONTROLLER KEY IS : \"+password);\n String response = service1.authenticateUser(password, message);\n return \"RESPONSE AFTER DECRYPTION : \"+response;\n\t}",
"public static byte[] decryptSMS(String secretKeyString, byte[] encryptedMsg) throws Exception {\n // generate AES secret key from the user input secret key\n Key key = generateKey(secretKeyString);\n // get the cipher algorithm for AES\n Cipher c = Cipher.getInstance(\"AES\");\n // specify the decryption mode\n c.init(Cipher.DECRYPT_MODE, key);\n // decrypt the message\n byte[] decValue = c.doFinal(encryptedMsg);\n return decValue;\n }",
"private String encryptMessage(String message) {\n int MESSAGE_LENGTH = message.length();\n //TODO: throw SizeTooBigException for message requirements\n if(MESSAGE_LENGTH > 1300){\n\n throw new SizeTooBigException();\n }\n\n final int length = message.length();\n String encryptedMessage = \"\";\n for (int i = 0; i < length; i++) {\n //TODO: throw InvalidCharacterException for message requirements\n int m = message.charAt(i);\n int k = this.kissKey.keyAt(i) - 'a';\n int value = m ^ k;\n encryptedMessage += (char) value;\n }\n return encryptedMessage;\n }",
"private void blockDecrypt (byte[] in, int off, byte[] out, int outOff) {\n int L = (in[off++] & 0xFF) << 24 |\n (in[off++] & 0xFF) << 16 |\n (in[off++] & 0xFF) << 8 |\n in[off++] & 0xFF;\n int R = (in[off++] & 0xFF) << 24 |\n (in[off++] & 0xFF) << 16 |\n (in[off++] & 0xFF) << 8 |\n in[off ] & 0xFF;\n int a;\n\n for (int i = ROUNDS; i > 0;) { // subkeys in reverse order\n a = R ^ sKey[--i];\n L ^= P[S[ a & 0xFFF] & 0xFF] |\n P[S[(a >>> 8) & 0xFFF] & 0xFF] << 1 |\n P[S[(a >>> 16) & 0xFFF] & 0xFF] << 2 |\n P[S[(a >>> 24 | a << 8) & 0xFFF] & 0xFF] << 3;\n\n a = L ^ sKey[--i];\n R ^= P[S[ a & 0xFFF] & 0xFF] |\n P[S[(a >>> 8) & 0xFFF] & 0xFF] << 1 |\n P[S[(a >>> 16) & 0xFFF] & 0xFF] << 2 |\n P[S[(a >>> 24 | a << 8) & 0xFFF] & 0xFF] << 3;\n }\n out[outOff++] = (byte)(R >>> 24);\n out[outOff++] = (byte)(R >>> 16);\n out[outOff++] = (byte)(R >>> 8);\n out[outOff++] = (byte) R;\n out[outOff++] = (byte)(L >>> 24);\n out[outOff++] = (byte)(L >>> 16);\n out[outOff++] = (byte)(L >>> 8);\n out[outOff ] = (byte) L;\n }",
"PublicKey decodePublicKey(byte[] encoded) throws IOException;"
] | [
"0.7166711",
"0.70046854",
"0.6938179",
"0.6917462",
"0.68554705",
"0.67813915",
"0.6573603",
"0.6552343",
"0.65459645",
"0.6471056",
"0.6439084",
"0.6406102",
"0.62924176",
"0.62824845",
"0.6272442",
"0.6269254",
"0.6256331",
"0.62538403",
"0.620655",
"0.6186177",
"0.6177335",
"0.6120451",
"0.6110305",
"0.60813093",
"0.6060217",
"0.6055066",
"0.6035308",
"0.5970431",
"0.5939657",
"0.5909341",
"0.5900743",
"0.58862233",
"0.587943",
"0.58655655",
"0.5858955",
"0.5842932",
"0.58352673",
"0.57938266",
"0.5787742",
"0.57822347",
"0.57627916",
"0.57563883",
"0.572396",
"0.57180953",
"0.56953466",
"0.56384957",
"0.5627396",
"0.5604972",
"0.55860186",
"0.558036",
"0.5579474",
"0.55699694",
"0.5569747",
"0.5569443",
"0.5544932",
"0.55435956",
"0.55258304",
"0.5523394",
"0.5517276",
"0.5515661",
"0.55049527",
"0.54781157",
"0.5464723",
"0.54597676",
"0.54559296",
"0.5435336",
"0.54032195",
"0.53970397",
"0.5392675",
"0.53751147",
"0.5369946",
"0.536891",
"0.5354815",
"0.5345032",
"0.53388035",
"0.5337963",
"0.53371835",
"0.5333056",
"0.5327699",
"0.53180385",
"0.5314636",
"0.5311329",
"0.52941537",
"0.528926",
"0.5287814",
"0.52804494",
"0.52752715",
"0.5273172",
"0.52694494",
"0.5251279",
"0.52359736",
"0.5226279",
"0.522393",
"0.52234113",
"0.5222366",
"0.5221415",
"0.5212999",
"0.5212994",
"0.5206676",
"0.52060616"
] | 0.66734576 | 6 |
Function which sign a message using RSA algorithm | public static BigInteger blindSign(BigInteger message, RSAPrivateKey key) {
BigInteger d = key.getPrivateExponent();
BigInteger N = key.getModulus();
return message.modPow(d, N);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static String signSHA256RSA(String input,\n PrivateKey privateKey) throws Exception {\n Signature s = Signature.getInstance(\"SHA256withRSA\");\n s.initSign(privateKey);\n s.update(input.getBytes(\"UTF-8\"));\n byte[] signature = s.sign();\n //Base64.getEncoder().encode(\"Test\".getBytes());\n return Base64.getEncoder().encodeToString(signature);\n }",
"BlsPoint sign(BigInteger privateKey, byte[] data);",
"public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/253038666\"})\n @Test\n public void testSignVerifyWithParameters() {\n int keySizeInBits = 2048;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 20;\n KeyPair keypair;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n keypair = keyGen.genKeyPair();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] msg = new byte[4];\n RSAPublicKey pub = (RSAPublicKey) keypair.getPublic();\n RSAPrivateKey priv = (RSAPrivateKey) keypair.getPrivate();\n Signature signer;\n Signature verifier;\n try {\n signer = Signature.getInstance(\"RSASSA-PSS\");\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"RSASSA-PSS key generation is supported, but signature generation is not\");\n return;\n }\n // Signs the message. This part of the code constructs the PSS parameters\n // explicitely.\n try {\n signer.initSign(priv);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own private key\");\n return;\n }\n try {\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLength, 1);\n signer.setParameter(params);\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n fail(\"Parameters accepted as key generation parameters are rejected as algorithm parameters\");\n return;\n }\n byte[] signature;\n try {\n signer.update(msg);\n signature = signer.sign();\n } catch (SignatureException ex) {\n fail(\"Could not sign with RSAPSS-PSS:\" + ex.toString());\n return;\n }\n\n // Verifies the signature. This part of the code tries to copy the PSS parameters\n // from the public key. Ideally, just calling verifier.initVerify(pub) would\n // be sufficient, since the public key contains the parameters. Unfortunately,\n // copying the PSS parameters is necessary for OpenJDK, since OpenJDK does\n // not copy the algorithm parameters.\n // Even worse is BouncyCastle, where it is unclear if there is a simple way\n // to extract the algorithm parameters from the key.\n try {\n verifier.initVerify(pub);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own public key\");\n return;\n }\n \n try {\n verifier.setParameter(pub.getParams());\n verifier.update(msg);\n boolean verified = verifier.verify(signature);\n assertTrue(\"Signature did not verify\", verified);\n } catch (GeneralSecurityException ex) {\n throw new AssertionError(\"Provider could not verify its own signature\", ex);\n }\n }",
"byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;",
"public static BigInteger encrypt(BigInteger message, RSAPublicKey key) {\n\t\ttry {\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, key);\n\t\t\treturn new BigInteger(cipher.doFinal(message.toByteArray()));\n\t\t} catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\t}",
"private static void jsonWebSignatureWithRSA() {\n\t\tRSAKey rsaJWK = null;\n\t\ttry {\n\t\t\trsaJWK = new RSAKeyGenerator(2048).keyID(\"123\").generate();\n\t\t\tRSAKey rsaPublicJWK = rsaJWK.toPublicJWK();\n\n\t\t\t// Create RSA-signer with the private key\n\t\t\tJWSSigner signer = new RSASSASigner(rsaJWK);\n\n\t\t\t// Prepare JWS object with simple string as payload\n\t\t\tJWSObject jwsObject = new JWSObject(\n\t\t\t\t\tnew JWSHeader.Builder(JWSAlgorithm.RS256).keyID(rsaJWK.getKeyID()).build(),\n\t\t\t\t\tnew Payload(\"In RSA we trust!\"));\n\n\t\t\t// Compute the RSA signature\n\t\t\tjwsObject.sign(signer);\n\n\t\t\t// To serialize to compact form, produces something like\n\t\t\t// eyJhbGciOiJSUzI1NiJ9.SW4gUlNBIHdlIHRydXN0IQ.IRMQENi4nJyp4er2L\n\t\t\t// mZq3ivwoAjqa1uUkSBKFIX7ATndFF5ivnt-m8uApHO4kfIFOrW7w2Ezmlg3Qd\n\t\t\t// maXlS9DhN0nUk_hGI3amEjkKd0BWYCB8vfUbUv0XGjQip78AI4z1PrFRNidm7\n\t\t\t// -jPDm5Iq0SZnjKjCNS5Q15fokXZc8u0A\n\t\t\tString s = jwsObject.serialize();\n\n// To parse the JWS and verify it, e.g. on client-side\n\t\t\tjwsObject = JWSObject.parse(s);\n\n\t\t\tJWSVerifier verifier = new RSASSAVerifier(rsaPublicJWK);\n\n\t\t\tif (jwsObject.verify(verifier)) {\n\t\t\t\tSystem.out.println(\"jwsObject.verify(verifier)==true\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"jwsObject.verify(verifier)== false\");\n\t\t\t}\n\n\t\t\tif (jwsObject.getPayload().toString().equals(\"In RSA we trust!\")) {\n\t\t\t\tSystem.out.println(\"jwsObject.getPayload().toString().equals(\\\"In RSA we trust!\\\") == true\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"jwsObject.getPayload().toString().equals(\\\"In RSA we trust!\\\") == false\");\n\t\t\t}\n\n\t\t} catch (JOSEException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public byte[] signMessage(PrivateKey key, byte[] message) {\n\t\ttry {\n\t\t\tif (signatureEngine == null) {\n\t\t\t\tsignatureEngine = TOMUtil.getSigEngine();\n\t\t\t}\n\t\t\tbyte[] result = null;\n\n\t\t\tsignatureEngine.initSign(key);\n\t\t\tsignatureEngine.update(message);\n\t\t\tresult = signatureEngine.sign();\n\n\t\t\t// st.store(System.nanoTime() - startTime);\n\t\t\treturn result;\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"Failed to sign message\", e);\n\t\t\treturn null;\n\t\t}\n\t}",
"public byte[] sign(byte[] data) throws EncryptingException {\n try {\n return RSA.sign(data, serverPrivateKey);\n } catch (Exception e) {\n throw new EncryptingException();\n }\n }",
"public synchronized @NotNull Signature signMessage(@NotNull ByteString message,\n @NotNull BigInteger privateKey) {\n LOGGER.fine(\"Signing a message.\");\n\n // Check if private key is in bounds\n boolean inRange = BigIntegerUtil.isInRangeExclusive(\n privateKey,\n BigInteger.ZERO,\n curve.getDomain().getN()\n );\n\n if (!inRange) {\n LOGGER.warning(\"Private key is out of valid range.\");\n throw new IllegalArgumentException(\"Private key is not within range (0, n).\");\n }\n\n CipherParameters parameters = new ECPrivateKeyParameters(privateKey, curve.getDomain());\n\n LOGGER.fine(\"Initializing crypto library signer.\");\n DSA signer = new ECDSASigner();\n signer.init(true, parameters);\n\n LOGGER.fine(\"Generating crypto library signature.\");\n BigInteger[] rAndS = signer.generateSignature(message.toByteArray());\n\n BigInteger r = rAndS[0];\n BigInteger s = rAndS[1];\n\n LOGGER.fine(\"Generating public key from private key.\");\n PublicKey publicKey = curve.getPublicKeyFromPrivateKey(privateKey);\n\n LOGGER.finest(() -> MessageFormat.format(\n \"Compressed public key={0}, r={1}, s={2}\",\n toHexString(publicKey.toCompressed()),\n r,\n s\n ));\n\n return new Signature(r, s, publicKey);\n }",
"BigInteger getDigitalSignature();",
"public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);",
"public byte[] sign(byte[] msgHash) {\n byte[] ret =\n CryptoUtil.sign(\n new BigInteger(Arrays.concatenate(new byte[] {0x00}, privateKey)), msgHash);\n return ret;\n }",
"Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);",
"@Test\n public void testRandomization() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Set<String> signatures = new HashSet<String>();\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n signer.initSign(priv);\n signer.update(messageBytes);\n byte[] signature = signer.sign();\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"Failed to generat signatures:\" + ex);\n return;\n }\n }",
"public static String sign(String message, ECKey privateKey) {\n JSONObject unitObj = JSONObject.parseObject(message);\n String str = getSourceString(unitObj);\n return signStr(str,privateKey);\n }",
"public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}",
"@Test\n public void testNullRandom() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key generation is not supported.\" + ex);\n return;\n }\n Set<String> signatures = new HashSet<String>();\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n byte[] signature;\n try {\n signer.initSign(priv, null);\n signer.update(messageBytes);\n signature = signer.sign();\n } catch (GeneralSecurityException ex) {\n fail(\"Failed to sign. \" + ex);\n return;\n }\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n }",
"public lnrpc.Rpc.SignMessageResponse signMessage(lnrpc.Rpc.SignMessageRequest request) {\n return blockingUnaryCall(\n getChannel(), getSignMessageMethod(), getCallOptions(), request);\n }",
"public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }",
"byte[] encrypt(String message) throws SatispayException {\n\t\tString key;\n\t\tSignature privateSignature;\n\t\ttry {\n\t\t\tkey = new String(Files.readAllBytes(new File(privateKeyPath).toPath()), Charset.defaultCharset());\n\t\t\tString privateKeyPEM = key.replace(\"-----BEGIN PRIVATE KEY-----\", \"\").replaceAll(System.lineSeparator(), \"\")\n\t\t\t\t\t.replaceAll(\"\\\\R\", \"\").replace(\"-----END PRIVATE KEY-----\", \"\");\n\t\t\tbyte[] keyBytes = Base64.getDecoder().decode(privateKeyPEM);\n\t\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\t\tPKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes);\n\t\t\t\n\t\t\tprivateSignature = Signature.getInstance(\"SHA256withRSA\");\n\t\t\tprivateSignature.initSign(keyFactory.generatePrivate(keySpec));\n\t privateSignature.update(message.getBytes(\"UTF-8\"));\n\t\t} catch (IOException e) {\n\t\t\tthrow new SatispayException(\"Cannot read key\", e.getCause());\n\t\t} catch (InvalidKeyException e) {\n\t\t\tthrow new SatispayException(\"Invalid key\", e.getCause());\n\t\t} catch (InvalidKeySpecException e) {\n\t\t\tthrow new SatispayException(\"Invalid spec\", e.getCause());\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\tthrow new SatispayException(\"Wrong algorithm\", e.getCause());\n\t\t} catch (SignatureException e) {\n\t\t\tthrow new SatispayException(\"Wrong instance\", e.getCause());\n\t\t}\n\n\t\ttry {\n\t\t\treturn privateSignature.sign();\n\t\t} catch (SignatureException e) {\n\t\t\tthrow new SatispayException(\"error in sign\", e.getCause());\n\t\t}\n\t}",
"RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }",
"public String sign(long expire, String nonce, byte[] msg) throws InvalidKeyException, NoSuchAlgorithmException\n\t{\n\t\tMac hmac = Mac.getInstance(ALGORITHM);\n\t\thmac.init(keySpec);\n\t\tbyte[] digest = hmac.doFinal(msg);\n\t\tString digestBase64 = encoder.encode(digest);\n\n\t\treturn prefix + Long.toString(expire) + \"-\" + nonce + \"-\" + digestBase64;\n\t}",
"public static byte[] sign(PrivateKey privateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"String publicKey();",
"boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;",
"public static byte[] SignWithPrivateKey(byte[] buf,PrivateKey pkey) throws Exception{\r\n\t\tSecureRandom secureRandom = new SecureRandom();\r\n\t\tSignature signature = Signature.getInstance(\"SHA1WithECDSA\");\r\n\t\tsignature.initSign(pkey,secureRandom);\r\n\t\tsignature.update(buf);\r\n\t\tbyte[] digitalSignature = signature.sign();\r\n\t\treturn digitalSignature;\r\n\t\t\r\n\t}",
"public void affiche3(BigInteger signe){\n System.out.println(\"La signature est :\"+signe);\n }",
"public CryptObject encrypt(BigIntegerMod message);",
"@Test\n public void testEncodeDecodePublicWithParameters() {\n int keySizeInBits = 2048;\n PublicKey pub;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 32;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"Provider supports KeyPairGenerator but not KeyFactory\");\n return;\n }\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\n \"Provider failed to decode its own public key: \" + TestUtil.bytesToHex(encoded), ex);\n }\n }",
"public static byte[] sign(String stringPrivateKey,String plaintext){\r\n\t\ttry {\r\n\t\t\tPKCS8EncodedKeySpec privateKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(stringPrivateKey));\r\n\t\t\tKeyFactory kf = KeyFactory.getInstance(\"EC\");\r\n\t\t\tPrivateKey privateKey= kf.generatePrivate(privateKeySpec);\r\n\t\t\tSignature sig = Signature.getInstance(\"SHA256withECDSA\");\r\n\t\t\tsig.initSign(privateKey);\r\n\t\t\tsig.update(plaintext.getBytes(\"UTF-8\"));\r\n\t\t\tbyte[] signature = sig.sign();\r\n\t\t\tSystem.out.println(\"Bytes:\"+signature.length);\r\n\t\t\treturn signature;\r\n\t\t} catch (InvalidKeyException | SignatureException | UnsupportedEncodingException | NoSuchAlgorithmException | InvalidKeySpecException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn null;\r\n\t}",
"public static byte [] sign(PrivateKey signatureKey, byte [] plainText){\r\n\t\ttry {\r\n\t\t\tSignature signer = Signature.getInstance(signatureAlgorithm);\r\n\t\t\tsigner.initSign(signatureKey);\r\n\t\t\tsigner.update(plainText);\r\n\t\t\treturn signer.sign();\r\n\t\t} catch (SignatureException | NoSuchAlgorithmException | InvalidKeyException e) {\r\n\t\t\t// should not happen\r\n\t\t\tthrow new ModelException(\"Unable to sign message \"+new String(Arrays.copyOf(plainText, 10))+\"...\",e);\r\n\t\t}\r\n\t}",
"public static String signJWTWithRSA(JWTClaimsSet jwtClaimsSet, Key privateKey)\n throws RequestObjectException {\n SignedJWT signedJWT = getSignedJWT(jwtClaimsSet, (RSAPrivateKey) privateKey);\n return signedJWT.serialize();\n }",
"public static String sign(String preStr, String signType, String mchPrivateKey) throws Exception {\n\t\tRSAUtil.SignatureSuite suite = null;\n\t\tif (\"RSA_1_1\".equals(signType)) {\n\t\t\tsuite = RSAUtil.SignatureSuite.SHA1;\n\t\t} else if (\"RSA_1_256\".equals(signType)) {\n\t\t\tsuite = RSAUtil.SignatureSuite.SHA256;\n\t\t} else {\n\t\t\tthrow new Exception(\"不支持的签名方式\");\n\t\t}\n byte[] signBuf = RSAUtil.sign(suite, preStr.getBytes(\"UTF8\"),\n mchPrivateKey);\n return new String(Base64.encodeBase64(signBuf), \"UTF8\");\n }",
"@Override\n\tpublic void visit(SendRSAKey srsak) {\n\t\t\n\t}",
"@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }",
"@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"private static String signFirstTime() throws AddressFormatException\n {\n ECKey key1 = ECKey.fromPrivate(new BigInteger(\"64102401986961187973900162212679081334328198710146539384491794427145725009072\"));\n\n\n // Use the redeem script we have saved somewhere to start building the transaction\n Script redeemScript = new Script(hexStringToByteArray(\"5221021ae8964b8529dc3e52955f2cabd967e08c52008dbcca8e054143b668f3998f4a210306be609ef37366ab0f3dd4096ac23a6ee4d561fc469fa60003f799b0121ad1072102199f3d89fa00e6f55dd6ecdd911457d7264415914957db124d53bf0064963f3853ae\"));\n\n // Start building the transaction by adding the unspent inputs we want to use\n // The data is taken from blockchain.info, and can be found here: https://blockchain.info/rawtx/ca1884b8f2e0ba88249a86ec5ddca04f937f12d4fac299af41a9b51643302077\n Transaction spendTx = new Transaction(params);\n ScriptBuilder scriptBuilder = new ScriptBuilder();\n scriptBuilder.data(new String(\"a9145204ad7c5fa5a2491cd91c332e28c87221194ca087\").getBytes()); // Script of this output\n TransactionInput input = spendTx.addInput(new Sha256Hash(\"fed695bf5e2c15286956a7bd3464c5beb97ef064e1f9406eba189ea844733e7c\"), 1, scriptBuilder.build());\n\n // Add outputs to the person receiving bitcoins\n Address receiverAddress = new Address(params, \"n2cWhs5sbWFCwzuuWWsVM9ubPwykGtX75T\");\n Coin charge = Coin.valueOf(1000000); // 0.1 mBTC\n Script outputScript = ScriptBuilder.createOutputScript(receiverAddress);\n spendTx.addOutput(charge, outputScript);\n\n /*8888888888888888888888888888888888888888888888888888888888888*/\n\n // Sign the first part of the transaction using private key #1\n Sha256Hash sighash = spendTx.hashForSignature(0, redeemScript, Transaction.SigHash.ALL, false);\n ECKey.ECDSASignature ecdsaSignature = key1.sign(sighash);\n TransactionSignature transactionSignarture = new TransactionSignature(ecdsaSignature, Transaction.SigHash.ALL, false);\n\n // Create p2sh multisig input script\n Script inputScript = ScriptBuilder.createP2SHMultiSigInputScript(Arrays.asList(transactionSignarture), redeemScript);\n\n // Add the script signature to the input\n input.setScriptSig(inputScript);\n System.out.println(byteArrayToHex(spendTx.bitcoinSerialize()));\n\n return byteArrayToHex(spendTx.bitcoinSerialize());\n }",
"private static void rsaTest(String[] args) {\n\n BigInteger x = MyBigInt.parse(args[1]);\n BigInteger p = MyBigInt.parse(args[2]);\n BigInteger q = MyBigInt.parse(args[3]);\n BigInteger e = MyBigInt.parse(args[4]);\n\n boolean useSAM = (args.length > 5 && args[5].length() > 0);\n\n RSAUser bob = new RSAUser(\"Bob\", p, q, e);\n bob.setSAM(useSAM);\n bob.init();\n\n RSAUser alice = new RSAUser(\"Alice\");\n alice.setSAM(useSAM);\n alice.send(bob, x);\n }",
"public String sign(String data) throws NoSuchAlgorithmException {\r\n\t\treturn this.sign(data.getBytes(StandardCharsets.UTF_8));\r\n\t}",
"public static void SM2Sign_fixed(String digest_str, String dA_str, String k_str){\n\n BigInteger digest = new BigInteger(digest_str,16);\n BigInteger dA = new BigInteger(dA_str,16);\n BigInteger k = new BigInteger(k_str,16);\n outer:\n for (;true;) {\n\n //BigInteger k = new BigInteger(256, random);\n //BigInteger k =new BigInteger(\"6CB28D99385C175C94F94E934817663FC176D925DD72B727260DBAAE1FB2F96F\",16);\n ECPoint Q = basePoint.multiply(k).normalize();\n if (debug) {\n System.out.println(\"kG x = \" + Q.getAffineXCoord().toBigInteger().toString(16).toUpperCase());\n System.out.println(\"kG y = \" + Q.getAffineYCoord().toBigInteger().toString(16).toUpperCase());\n }\n BigInteger r = digest.add(Q.getAffineXCoord().toBigInteger()).mod(n);\n if (r.signum() == 0 | r.add(k).equals(n)) {\n\n continue outer;\n }\n\n BigInteger Inv;\n Inv = dA.add(one).modInverse(n);\n if (debug) {\n System.out.println(\"Inv = \" + Inv.toString(16).toUpperCase());\n }\n BigInteger s = Inv.multiply(k.subtract(r.multiply(dA))).mod(n);\n if (s.signum()==0) continue outer;\n else {\n if(debug) {\n System.out.println(\"r = \" + r.toString(16).toUpperCase());\n System.out.println(\"s = \" + s.toString(16).toUpperCase());\n }\n Sign_r = r;\n Sign_s = s;\n Sign_r_str = r.toString(16).toUpperCase();\n Sign_s_str = s.toString(16).toUpperCase();\n return;\n }\n }\n\n }",
"@Test\r\n public void testSign() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] result = instance.sign(data, keys);\r\n assertNotNull(result);\r\n }",
"public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }",
"public byte[] sign(byte[] digest, int token, String pin) \n throws SignedDocException;",
"public Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage) {\n\t\tlong ret = bindings.KeysInterface_sign_invoice(this.ptr, invoice_preimage);\n\t\tif (ret < 1024) { return null; }\n\t\tResult_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);\n\t\treturn ret_hu_conv;\n\t}",
"public byte[] sign() throws XMLSignatureException {\n/* 177 */ return this.signatureAlgorithm.engineSign();\n/* */ }",
"private void signMessage() {\n\n String messageText = messageTextArea.getText();\n SecureCharSequence secureCharSequence = new SecureCharSequence(currentPassword.getPassword());\n String signMessage = this.address.signMessage(messageText, secureCharSequence);\n signature.setText(signMessage);\n\n }",
"public static void main(String[] args) {\n\n String pfx = \"E:\\\\PDFFileTest\\\\1.pfx\";\n String tmpPath = \"E:\\\\PDFFileTest\\\\1562570792439.pdf\";\n String expPath = \"E:\\\\PDFFileTest\\\\11.11\\\\h83.pdf\";\n String gif = \"E:\\\\PDFFileTest\\\\1.gif\";\n String password = \"111111\";\n try {\n sign(pfx, tmpPath, expPath, gif, password);\n System.out.println(\"success\");\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"public com.google.common.util.concurrent.ListenableFuture<lnrpc.Rpc.SignMessageResponse> signMessage(\n lnrpc.Rpc.SignMessageRequest request) {\n return futureUnaryCall(\n getChannel().newCall(getSignMessageMethod(), getCallOptions()), request);\n }",
"public RSACryptoSignature sign(String signedBy, RSAKeyContents sKeys, String digestName, byte [] msgHashBytes) {\r\n\t\t\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tAsymmetricBlockCipher rsaEngine = new PKCS1Encoding(new RSABlindedEngine());\r\n\t\t\trsaEngine.init(true, sKeys.getPrivateKey());\r\n\t\t\tbyte [] sigBytes = rsaEngine.processBlock(msgHashBytes, 0, msgHashBytes.length);\r\n\t\t\tRSASignature sig = new RSASignature(sigBytes);\r\n\t\t\tSignatureMetadata meta = new SignatureMetadata(\r\n\t\t\t\t\tSignatureAlgorithm.RSA,\r\n\t\t\t\t\tdigestName,\r\n\t\t\t\t\tsKeys.getMetadata().getHandle(),\r\n\t\t\t\t\tsignedBy);\r\n\t\t\treturn new RSACryptoSignature(meta,sig);\r\n\t\t\r\n\t\t} catch (InvalidCipherTextException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}",
"public byte[] signData(String fitxer, PrivateKey priv) {\n byte[] signature = null;\n FileInputStream datafis;\n BufferedInputStream bufin = null;\n byte[] buffer = new byte[1024];\n int len;\n \n try {\n Signature signer = Signature.getInstance(\"SHA256withRSA\");\n signer.initSign(priv); //Inicialitzem la firma digital a partirde l’algorisme utilitzat\n \n datafis = new FileInputStream(fitxer);\n bufin = new BufferedInputStream(datafis);\n \n while (bufin.available() != 0) {\n len = bufin.read(buffer);\n signer.update(buffer, 0, len);//Li assignem a l’objecte firma les dades afirmar digitalment\n } \n\n bufin.close();\n signature = signer.sign();//Finalment generem la firma\n } catch (Exception ex) {\n System.err.println(\"Error signant les dades: \" + ex);\n }\n return signature;\n }",
"byte[] encodePublicKey(PublicKey publicKey) throws IOException;",
"public void verifyAsymmetricRsa() throws IOException, GeneralSecurityException {\n String projectId = \"your-project-id\";\n String locationId = \"us-east1\";\n String keyRingId = \"my-key-ring\";\n String keyId = \"my-key\";\n String keyVersionId = \"123\";\n String message = \"my message\";\n byte[] signature = null;\n verifyAsymmetricRsa(projectId, locationId, keyRingId, keyId, keyVersionId, message, signature);\n }",
"RSASecKey(BigInteger phi, BigInteger n, BigInteger e){\n\tthis.phi = phi;\n\n\ttry{\n\tthis.d = e.modInverse(phi);\n\tthis.n = n;\n\t}catch(Exception ex){\n\t System.out.println(\"inverse not found\");\n\t System.exit(1);\n\t}\n }",
"public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }",
"public GenRSAKey() {\n initComponents();\n }",
"public RSA() {\n \t\n \t//generisanje random key-eva\n Random random = new Random();\n BigInteger p = new BigInteger(512, 30, random);\n BigInteger q = new BigInteger(512, 30, random);\n \n //Nadjemo fi(n)\n BigInteger lambda = lcm(p.subtract(BigInteger.ONE), q.subtract(BigInteger.ONE));\n \n //Nadjemo n tako sto pomnozimo nase brojeve\n this.n = p.multiply(q);\n \n //nadjemo D kao coprime lambde\n this.d = comprime(lambda);\n \n //E nam je inverz d i lambde\n this.e = d.modInverse(lambda);\n }",
"@Test\n public void testDecodeEncodePublicKeyWithPssParameters() {\n String encodedPubKey =\n \"30820151303c06092a864886f70d01010a302fa00f300d060960864801650304\"\n + \"02010500a11c301a06092a864886f70d010108300d0609608648016503040201\"\n + \"05000382010f003082010a0282010100b09191ef91e8b4ab58f7c66430636641\"\n + \"0988d8cba6f2e0f33495d37b355828d04554472e854dff7d8c1dfd1ea50123de\"\n + \"12d34b77280220184b924db82a535978e9bfe7a6111f455028f18cd923c54144\"\n + \"08a247409d7121a99c3594708c0dd9cdebf1c9bb0060ff1c4c0363e25fac0d5b\"\n + \"bf85013945f393b0b9673780c6f579353ae895d7dc891220a92bac0a8deb35b5\"\n + \"20803cf82b19c27232a889d0f04fb2bde6623f357e3e56027298379d10bee8fa\"\n + \"4e0c29029a78fde01694719d2d036fe726aa5633205553565f127a78fec46918\"\n + \"182e41a16c5cc86bd3b77d26c5113082cb1f2d83d9213eca019bbdee99001e11\"\n + \"16bcfec1242ece175558b15c5bbbc4710203010001\";\n RSAPublicKey pubKey;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n X509EncodedKeySpec spec = new X509EncodedKeySpec(TestUtil.hexToBytes(encodedPubKey));\n pubKey = (RSAPublicKey) kf.generatePublic(spec);\n } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) {\n TestUtil.skipTest(\"RSASSA-PSS keys with parameters are not supported.\");\n return;\n }\n // Ensures that the encoding format is X.509. Other formats would not only break\n // this test but lead to incompatible implementations.\n assertEquals(\"Public key does not use X.509 format\", \"X.509\", pubKey.getFormat());\n byte[] encoded = pubKey.getEncoded();\n assertEquals(encodedPubKey, TestUtil.bytesToHex(encoded));\n }",
"private static String sign(String data, String key)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tMac mac = Mac.getInstance(\"HmacSHA1\");\n\t\t\t\tmac.init(new SecretKeySpec(key.getBytes(), \"HmacSHA1\"));\n\t\t\t\treturn Base64.encodeBytes(mac.doFinal(data.getBytes(\"UTF-8\")));\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tthrow new RuntimeException(new SignatureException(\"Failed to generate signature: \" + e.getMessage(), e));\n\t\t\t}\n\t\t}",
"public void RSAyoyo() throws NoSuchAlgorithmException, GeneralSecurityException, IOException {\r\n\r\n KeyPairGenerator kPairGen = KeyPairGenerator.getInstance(\"RSA\");\r\n kPairGen.initialize(2048);\r\n KeyPair kPair = kPairGen.genKeyPair();\r\n publicKey = kPair.getPublic();\r\n System.out.println(publicKey);\r\n privateKey = kPair.getPrivate();\r\n\r\n KeyFactory fact = KeyFactory.getInstance(\"RSA\");\r\n RSAPublicKeySpec pub = fact.getKeySpec(kPair.getPublic(), RSAPublicKeySpec.class);\r\n RSAPrivateKeySpec priv = fact.getKeySpec(kPair.getPrivate(), RSAPrivateKeySpec.class);\r\n serializeToFile(\"public.key\", pub.getModulus(), pub.getPublicExponent()); \t\t\t\t// this will give public key file\r\n serializeToFile(\"private.key\", priv.getModulus(), priv.getPrivateExponent());\t\t\t// this will give private key file\r\n\r\n \r\n }",
"Sign get_channel_signer(boolean inbound, long channel_value_satoshis);",
"private String signature() {\n\t\t++this.nonce;\n\t\tString message = new String(this.nonce + this.username + this.apiKey);\n\t\tMac hmac = null;\n\n\t\ttry {\n\t\t\thmac = Mac.getInstance(\"HmacSHA256\");\n\t\t\tSecretKeySpec secret_key = new SecretKeySpec(\n\t\t\t\t\t((String) this.apiSecret).getBytes(\"UTF-8\"), \"HmacSHA256\");\n\t\t\thmac.init(secret_key);\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn String.format(\"%X\",\n\t\t\t\tnew BigInteger(1, hmac.doFinal(message.getBytes())));\n\t}",
"private static String RSAdecrypt(byte[] signedhash) {\n String ab = new String(signedhash);\n //private keys\n BigInteger e = new BigInteger(\"65537\");\n BigInteger n = new BigInteger(\"2688520255179015026237478731436571621031218154515572968727588377065598663770912513333018006654248650656250913110874836607777966867106290192618336660849980956399732967369976281500270286450313199586861977623503348237855579434471251977653662553\");\n BigInteger m = new BigInteger(ab);\n BigInteger dataHash = m.modPow(e, n);\n String ComputeddataHash = new String(dataHash.toByteArray());\n return ComputeddataHash;\n }",
"@Test\n public void testEncodeDecodePublic() {\n int keySizeInBits = 2048;\n PublicKey pub;\n KeyFactory kf;\n try {\n kf = KeyFactory.getInstance(\"RSASSA-PSS\");\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n pub = keypair.getPublic();\n } catch (NoSuchAlgorithmException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] encoded = pub.getEncoded();\n assertEquals(\n \"The test assumes that the public key is in X.509 format\", \"X.509\", pub.getFormat());\n X509EncodedKeySpec spec = new X509EncodedKeySpec(encoded);\n try {\n kf.generatePublic(spec);\n } catch (InvalidKeySpecException ex) {\n throw new AssertionError(\"Provider can't decode its own key\", ex);\n }\n }",
"public void verifyAsymmetricRsa(\n String projectId,\n String locationId,\n String keyRingId,\n String keyId,\n String keyVersionId,\n String message,\n byte[] signature)\n throws IOException, GeneralSecurityException {\n // Initialize client that will be used to send requests. This client only\n // needs to be created once, and can be reused for multiple requests. After\n // completing all of your requests, call the \"close\" method on the client to\n // safely clean up any remaining background resources.\n try (KeyManagementServiceClient client = KeyManagementServiceClient.create()) {\n // Build the name from the project, location, and key ring, key, and key version.\n CryptoKeyVersionName keyVersionName =\n CryptoKeyVersionName.of(projectId, locationId, keyRingId, keyId, keyVersionId);\n\n // Convert the message into bytes. Cryptographic plaintexts and\n // ciphertexts are always byte arrays.\n byte[] plaintext = message.getBytes(StandardCharsets.UTF_8);\n\n // Get the public key.\n PublicKey publicKey = client.getPublicKey(keyVersionName);\n\n // Convert the public PEM key to a DER key (see helper below).\n byte[] derKey = convertPemToDer(publicKey.getPem());\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(derKey);\n java.security.PublicKey rsaKey = KeyFactory.getInstance(\"RSA\").generatePublic(keySpec);\n\n // Verify the 'RSA_SIGN_PKCS1_2048_SHA256' signature.\n // For other key algorithms:\n // http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Signature\n Signature rsaVerify = Signature.getInstance(\"SHA256withRSA\");\n rsaVerify.initVerify(rsaKey);\n rsaVerify.update(plaintext);\n\n // Verify the signature.\n boolean verified = rsaVerify.verify(signature);\n System.out.printf(\"Signature verified: %s\", verified);\n }\n }",
"OpenSSLKey mo134201a();",
"String getSign();",
"@Override\n\tpublic Packet generateInitialReplyPacket(Packet p) {\n\t\tPacket pkt=super.generateInitialReplyPacket(p);\n\t\t pkt=sm.sign(pkt);\n\t return pkt;\n\t}",
"public PublicKey getSignatory (Message m) {\n Logger.write(\"VERBOSE\", \"DB\", \"getSignatory(...)\");\n try {\n ResultSet keys = query(DBStrings.getAllKeys);\n while (keys.next())\n if (Crypto.verifySig(m, Crypto.decodeKey(keys.getString(\"key\"))))\n return Crypto.decodeKey(keys.getString(\"key\"));\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n }\n Logger.write(\"WARNING\", \"DB\", \"getSignatory() could not find signatory\");\n return null;\n }",
"public static void main(String[] args) {\n String keyFile = \"D:\\\\data\\\\kms\\\\liweigang.idc\";\n String message = \"dksf3r38324hrewjrh3r&^%djfdsjkek\";\n String pubmatrix = \"D:\\\\data\\\\kms\\\\sm2cpk.cn.pkm\";\n\n byte[] keycard = Tool.ReadFile(keyFile);\n System.out.println(\"keyCard:\" + Tool.Bytes2Hex(keycard));\n\n //得到私钥\n byte[] priKey = GMJni.GetPriKey(keycard);\n String priKeyHex = Tool.Bytes2Hex(priKey);\n System.out.println(\"private key:\" + priKeyHex);\n\n //得到密钥标识\n byte[] keyId = GMJni.GetKeyId(keycard);\n System.out.println(\"keyId:\" + Tool.Bytes2String(keyId));\n\n //得到公钥\n byte[] pubKey = GMJni.CalPubKey(Tool.String2Bytes(pubmatrix), keyId);\n System.out.println(\"public key:\" + Tool.Bytes2Hex(pubKey));\n\n //1000个不同message\n List<String> msgList = new ArrayList<>(12);\n for (int i = 0; i < 1000; i++) {\n //message基础上字符串长度+10\n msgList.add(message + RandomUtil.randomString(10));\n }\n long start = System.currentTimeMillis();\n //签名结果\n int rv = 0;\n //缓存\n MapCache cache = new MapCache();\n //命中缓存次数\n int count = 0;\n int count2 = 0;\n for (int i = 0; i < 100000; i++) {\n System.out.println(\"模拟请求第\" + i + \"次数\");\n\n //计算E值\n //30种不同的message,即仅30个不走缓存\n byte[] E = GMJni.SM2GetE(keyId, pubKey, Tool.String2Bytes(msgList.get(new Random().nextInt(30))));\n String hexE = Tool.Bytes2Hex(E);\n// System.out.println(\"E:\" + hexE);\n\n //SM2签名\n byte[] sig = GMJni.SM2Sign(priKey, E);\n// System.out.println(\"private key:\" + Tool.Bytes2Hex(priKey));\n// System.out.println(\"sign value:\" + Tool.Bytes2Hex(sig));\n\n // SM2签名验证\n // 引入Map缓存 E,sig的16进制的MD5值\n String hex = hexE + priKeyHex;\n// System.out.println(\"finalStr:\" + hex);\n String md5 = SecureUtil.md5(hex);\n if (null != cache.get(md5)) {\n count++;\n// System.out.println(\"命中缓存\" + (++count));\n } else {\n rv += GMJni.SM2Verify(pubKey, E, sig);\n count2++;\n cache.add(md5, (byte) 1, 50 * 1000);\n }\n }\n long end = System.currentTimeMillis();\n double v = (end - start) / 1000.0;\n System.out.println(\"time consuming:\" + v + \" sec\");\n System.out.println(Math.round(100000 / v) + \" times/sec\");\n System.out.println(\"命中缓存\" + (count));\n System.out.println(\"未命中\" + (count2));\n if (rv != 0) {\n System.out.println(\"Verify signature fail, error code is \" + String.valueOf(rv));\n } else {\n System.out.println(\"Verify signature success.\");\n }\n }",
"private byte[] signData(byte[] data)\n throws CmsCadesException, GeneralSecurityException, IOException {\n CadesSignature cmsSig = new CadesSignature(data, SignedData.EXPLICIT);\n // CadesBESParameters params = new CadesBESParameters();\n CadesTParameters params = new CadesTParameters(\n \"http://tsp.iaik.tugraz.at/tsp/TspRequest\", null, null);\n params.setDigestAlgorithm(\"SHA512\");\n cmsSig.addSignerInfo(privKey_, certChain_, params);\n return cmsSig.encodeSignature();\n }",
"public void signMessage(lnrpc.Rpc.SignMessageRequest request,\n io.grpc.stub.StreamObserver<lnrpc.Rpc.SignMessageResponse> responseObserver) {\n asyncUnaryCall(\n getChannel().newCall(getSignMessageMethod(), getCallOptions()), request, responseObserver);\n }",
"public byte[] encode(java.math.BigInteger r1, java.math.BigInteger r2) throws java.io.IOException {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.StdDSAEncoder.encode(java.math.BigInteger, java.math.BigInteger):byte[], dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.android.org.bouncycastle.jcajce.provider.asymmetric.ec.SignatureSpi.StdDSAEncoder.encode(java.math.BigInteger, java.math.BigInteger):byte[]\");\n }",
"private static BigInteger[] getPublicKeyOriginal(BigInteger in) \r\n{\r\n\tECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec(\"secp256k1\"); \r\n\tbyte[] pubKey = spec.getG().multiply(in).getEncoded(false);\r\n\tbyte[] a = new byte[32];\r\n\tbyte[] b = new byte[32];\r\n\tSystem.arraycopy(pubKey, 1, a, 0, 32);\r\n\tSystem.arraycopy(pubKey, 33, b, 0, 32);\r\n\tBigInteger[] erg = new BigInteger[2];\r\n\terg[0] = new BigInteger(1,a);\r\n\terg[1] = new BigInteger(1,b);\r\n\treturn erg;\r\n}",
"String getPublicKeyActorSend();",
"String getPublicKey();",
"public static boolean verifyProposeSign(ProposeMessage msg){\n if (Crypto.verifySignature(msg.data, msg.sign, msg.pubkey)) {\n logger.info(\"verifyProposeSign success.\");\n return true;\n } else {\n logger.error(\"verifyProposeSign failed.\");\n return false;\n }\n }",
"private String createSignedRSAToken(String jwtToken, String clientId, String clientKeyPairs, String keyPair) throws ParseException, JOSEException {\n log.info(\"Entering createSignedRSAToken\");\n log.info(\"clientKeyPairs: {}\", clientKeyPairs);\n\n Object signingKey;\n\n // To not affect current functionality, if no clientId parameter is passed,\n // sign with the default playground's \"testing_key\"\n JSONObject parseKeyPairs = JSONObjectUtils.parse(clientKeyPairs);\n log.info(\"Parsed clientKeyPairs\");\n\n if (clientId.equals(\"none\")) {\n signingKey = parseKeyPairs.get(\"default\");\n } else {\n signingKey = parseKeyPairs.get(clientId);\n if (signingKey == null) {\n throw new OauthException(\"Client ID to private key mapping not found\", HttpStatus.BAD_REQUEST);\n }\n }\n log.info(\"signingKey: {}\", signingKey);\n\n String[] splitString = jwtToken.split(\"\\\\.\");\n\n log.info(\"Size of splitString: {}\", splitString.length);\n\n log.info(\"~~~~~~~~~ JWT Header ~~~~~~~\");\n String base64EncodedHeader = splitString[0];\n JWSHeader head = JWSHeader.parse(new Base64URL(base64EncodedHeader));\n\n\n log.info(\"~~~~~~~~~ JWT Body ~~~~~~~\");\n String base64EncodedBody = splitString[1];\n Payload payload = new Payload(new Base64URL(base64EncodedBody));\n\n // RSA signatures require a public and private RSA key pair,\n // the public key must be made known to the JWS recipient to\n // allow the signatures to be verified\n\n log.info(\"keyPair: {}\", keyPair);\n\n net.minidev.json.JSONObject parsedRsa = JSONObjectUtils.parse(keyPair);\n\n Object getSigningKey = parsedRsa.get(signingKey);\n String signingKeyToString = String.valueOf(getSigningKey);\n\n RSAKey rsaJWK = RSAKey.parse(signingKeyToString);\n RSAPrivateKey prK = (RSAPrivateKey) rsaJWK.toPrivateKey();\n RSAPublicKey puK = (RSAPublicKey) rsaJWK.toPublicKey();\n\n byte[] privateKeyEnc = prK.getEncoded();\n byte[] privateKeyPem = java.util.Base64.getEncoder().encode(privateKeyEnc);\n String privateKeyPemStr = new String(privateKeyPem);\n\n // Create RSA-signer with the private key\n JWSSigner signer = new RSASSASigner(rsaJWK);\n\n // Prepare JWS object with simple string as payload\n JWSObject jwsObject = new JWSObject(head, payload);\n\n // Compute the RSA signature\n jwsObject.sign(signer);\n\n // To serialize to compact form, produces something like\n String s = jwsObject.serialize();\n log.info(\"Signed RSA Token:\");\n log.info(s);\n\n // To parse the JWS and verify it, e.g. on client-side\n jwsObject = JWSObject.parse(s);\n\n JWSVerifier verifier = new RSASSAVerifier(puK);\n\n log.info(\"Verify: {}\", jwsObject.verify(verifier));\n\n log.info(\"In RSA we trust! --> {}\", jwsObject.getPayload().toString());\n return s;\n }",
"public byte[] generateSignature()\n {\n if (!forSigning)\n {\n throw new IllegalStateException(\"PairingDigestSigner not initialised for signature generation.\");\n }\n\n byte[] hash = new byte[digest.getDigestSize()];\n digest.doFinal(hash, 0);\n\n Element[] sig = pairingSigner.generateSignature(hash);\n\n try {\n return pairingSigner.derEncode(sig);\n } catch (IOException e) {\n throw new IllegalStateException(\"unable to encode signature\");\n }\n }",
"public void process(RSAMessage msg) throws IOException {\n relay(msg);\n }",
"java.lang.String getPubkey();",
"private static void jwsSecureJWT() {\n\t\tRSAKey rsaJWK;\n\t\ttry {\n\t\t\trsaJWK = new RSAKeyGenerator(2048).keyID(\"123\").generate();\n\t\t\tRSAKey rsaPublicJWK = rsaJWK.toPublicJWK();\n\n\t\t\tRSAPublicKey rsaPublicJWK2 = rsaJWK.toRSAPublicKey();\n\n\t\t\tif (rsaPublicJWK.equals(rsaPublicJWK2)) {\n\t\t\t\tSystem.out.println(\"trung nhau\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Khong trung nhau\");\n\t\t\t}\n\n\t\t\t// Create RSA-signer with the private key\n\t\t\tJWSSigner signer = new RSASSASigner(rsaJWK);\n\n\t\t\t// Prepare JWT with claims set\n\t\t\tJWTClaimsSet claimsSet = new JWTClaimsSet.Builder().subject(\"alice\").issuer(\"https://c2id.com\")\n\t\t\t\t\t.expirationTime(new Date(new Date().getTime() + 60 * 1000)).build();\n\n\t\t\tSignedJWT signedJWT = new SignedJWT(\n\t\t\t\t\tnew JWSHeader.Builder(JWSAlgorithm.RS256).keyID(rsaJWK.getKeyID()).build(), claimsSet);\n\n\t\t\t// Compute the RSA signature\n\t\t\tsignedJWT.sign(signer);\n\n\t\t\t// To serialize to compact form, produces something like\n\t\t\t// eyJhbGciOiJSUzI1NiJ9.SW4gUlNBIHdlIHRydXN0IQ.IRMQENi4nJyp4er2L\n\t\t\t// mZq3ivwoAjqa1uUkSBKFIX7ATndFF5ivnt-m8uApHO4kfIFOrW7w2Ezmlg3Qd\n\t\t\t// maXlS9DhN0nUk_hGI3amEjkKd0BWYCB8vfUbUv0XGjQip78AI4z1PrFRNidm7\n\t\t\t// -jPDm5Iq0SZnjKjCNS5Q15fokXZc8u0A\n\t\t\tString s = signedJWT.serialize();\n\n\t\t\t// On the consumer side, parse the JWS and verify its RSA signature\n\t\t\tsignedJWT = SignedJWT.parse(s);\n\n\t\t\tJWSVerifier verifier = new RSASSAVerifier(rsaPublicJWK);\n\t\t\t// assertTrue(signedJWT.verify(verifier));\n\n\t\t\tif (signedJWT.verify(verifier)) {\n\t\t\t\tSystem.out.println(\"signedJWT.verify(verifier) == TRUE\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"signedJWT.verify(verifier) == FALSE\");\n\t\t\t}\n\t\t} catch (JOSEException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\n\t\tString message = \"\";\n\t\tbyte[] messageBytes;\n\t\tbyte[] tempPub = null;\n\t\tString sPub = null;\n\t\tbyte[] ciphertextBytes = null;\n\t\tbyte[] textBytes = null;\n\n\t\ttry {\n\n\t\t\t// The source of randomness\n\t\t\tSecureRandom secureRandom = new SecureRandom();\n\n\t\t\t// Obtain a RSA Cipher Object\n\t\t\tCipher cipher = Cipher.getInstance(\"RSA/ECB/PKCS1Padding\");\n\n\t\t\t// Loading certificate file \n\t\t\tString certFile = ResourceReader.readFileToString(\"classpath:softsolution.txt\").trim();\n\t\t\tInputStream inStream = new ByteArrayInputStream(certFile.getBytes());\n\t\t\tCertificateFactory cf = CertificateFactory.getInstance(\"X.509\");\n\t\t\tX509Certificate cert = (X509Certificate) cf.generateCertificate(inStream);\n\t\t\tinStream.close();\n\n\t\t\t// Read the public key from certificate file\n\t\t\tRSAPublicKey pubkey = (RSAPublicKey) cert.getPublicKey();\n\t\t\ttempPub = pubkey.getEncoded();\n\t\t\tsPub = new String(tempPub);\n\t\t\tlog.info(\"Public key from certificate file:\\n\" + hex(sPub) + \"\\n\");\n\t\t\tlog.info(\"Public Key Algorithm = \" + cert.getPublicKey().getAlgorithm() + \"\\n\");\n\n\t\t\t// Set plain message\n\t\t\tmessage = \"{\\r\\n\" +\n\t\t\t\t\t\"\\\"merchantId\\\":\\\"109618\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"subMerchantId\\\":\\\"12234\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"terminalId\\\":\\\"5411\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"merchantName\\\":\\\"test stores\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"subMerchantName\\\":\\\"sub_ test stores\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"payerVa\\\":\\\"testother2@icici\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"amount\\\":\\\"5.00\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"note\\\":\\\"collect-pay-request\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"collectByDate\\\":\\\"10/04/2018 11:01 AM\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"merchantTranId\\\":\\\"6124114576893\\\",\\r\\n\" +\n\t\t\t\t\t\"\\\"billNumber\\\":\\\"SDF234278\\\"\\r\\n\" +\n\t\t\t\t\t\"}\\r\\n\" +\n\t\t\t\t\t\"\";\n\t\t\tmessageBytes = message.getBytes();\n\t\t\tlog.info(\"Plain message:\\n\" + message + \"\\n\");\n\n\t\t\t// Initialize the cipher for encryption\n\t\t\tcipher.init(Cipher.ENCRYPT_MODE, pubkey, secureRandom);\n\n\t\t\t// Encrypt the message\n\t\t\tciphertextBytes = cipher.doFinal(messageBytes);\n\t\t\tlog.info(\"Message encrypted with certificate file public key:\\n\" + new String(org.bouncycastle.util.encoders.Base64.encode(ciphertextBytes)) + \"\\n\");\n\t\t\tString msg=new String(org.bouncycastle.util.encoders.Base64.encode(ciphertextBytes));\n\t\t\tlog.info(\"Decoded Message encrypted with certificate file public key:\\n\" +msg + \"\\n\");\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Loading private key file \n\t\t\tString keyFile = ResourceReader.readFileToString(\"classpath:softsolution.pem\").trim();\n\t\t\tinStream = new ByteArrayInputStream(keyFile.getBytes());\n\t\t\tbyte[] encKey = new byte[inStream.available()];\n\t\t\tinStream.read(encKey);\n\t\t\tinStream.close();\n\t\t\tString pvtKey = new String(encKey);\n\n\n\t\t\tpvtKey = pvtKey.replaceAll(\"\\\\n\", \"\").replace(\"-----BEGIN PRIVATE KEY-----\", \"\").replace(\"-----END PRIVATE KEY-----\", \"\");\n\n\n\t\t\tlog.info(pvtKey);\n\t\t\t// Read the private key from file\n\t\t\tlog.info(\"RSA PrivateKeyInfo: \" + encKey.length + \" bytes\\n\");\n\t\t\t// PKCS8EncodedKeySpec privKeySpec=new PKCS8EncodedKeySpec(Base64.getDecoder().decode(encKey));//new PKCS8EncodedKeySpec(encKey);\n\t\t\tPKCS8EncodedKeySpec privKeySpec = new PKCS8EncodedKeySpec(Base64.getDecoder().decode(pvtKey));\n\t\t\tKeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n\t\t\tlog.info(\"KeyFactory Object Info:\");\n\t\t\tlog.info(\"Algorithm = \" + keyFactory.getAlgorithm());\n\t\t\tlog.info(\"Provider = \" + keyFactory.getProvider());\n\t\t\tPrivateKey priv = (RSAPrivateKey) keyFactory.generatePrivate(privKeySpec);\n\t\t\tlog.info(\"Loaded \" + priv.getAlgorithm() + \" \" + priv.getFormat() + \" private key.\");\n\n\n\t\t\t// Initialize the cipher for decryption\n\t\t\tcipher.init(Cipher.DECRYPT_MODE, priv, secureRandom);\n\n\n\n\t\t\t// Decrypt the message\n\t\t\t//\ttextBytes = cipher.doFinal(ciphertextBytes);\n\t\t\tbyte[] cipherByte = org.bouncycastle.util.encoders.Base64.decode(msg.getBytes(\"UTF-8\"));\n\t\t\tlog.info(cipherByte);\n\n\t\t\tString op = new String(cipher.doFinal(cipherByte));\n\t\t\t// String s = new String(textBytes);\n\t\t\tlog.info(\"Message decrypted with file private key:\\n\");\n\t\t\tlog.info(op);\n\n\t\t} catch (IOException e) {\n\t\t\tlog.info(\"IOException:\" + e);\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\tlog.info(\"Exception:\" + e);\n\t\t\te.printStackTrace();\n\t\t}\n\t}",
"OctetString getPublicKey();",
"public static void main(String[] args) throws AddressFormatException {\n\n// generateMultisig();\n String getSignedTransaction = signFirstTime();\n String rawtx = signSecondTime(getSignedTransaction);\n\n System.out.println(\"rawtx ->\"+ rawtx);\n }",
"public static native String getSignature(long[] msgArgs);",
"public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }",
"private static boolean verify(BigInteger number, PublicKey pubKey, byte[] sigbytes) throws Exception {\r\n\t\tSignature sig = Signature.getInstance(\"SHAwithDSA\");\r\n\t\tsig.initVerify(pubKey);\r\n\t\tbyte[] data = bigIntToByteArray(number);\r\n\t\tsig.update(data);\r\n\t\treturn sig.verify(sigbytes);\r\n \t}",
"private byte[] encryptSymmetricKey(PublicKey receiverPublicKey, SecretKey semetricKey) throws Exception {\n\t\ttry {\n\t\t\tmyCipher = Cipher.getInstance(\"RSA\");\n\t\t\tmyCipher.init(Cipher.ENCRYPT_MODE, receiverPublicKey);\n\t\t\treturn myCipher.doFinal(semetricKey.getEncoded());\n\t\t} catch (Exception e) {\n\t\t\twriteToLog(\"Error While trying to encrypt the semetric-key: \" + e.getMessage());\n\t\t\tLogWriter.close();\n\t\t\tthrow new Exception();\n\t\t}\n\n\t}",
"public static void main(String[] args) {\n\n\t\tif (args.length != 5) {\n\t\t System.out.println(\"Usage: GenSig nameOfFileToSign keystore password sign publicKey\");\n\n\t\t }\n\t\telse try{\n\n\t\t KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());\n\t\t ks.load(new FileInputStream(args[1]), args[2].toCharArray());\n\t\t \n\t\t String alias = (String)ks.aliases().nextElement();\n\t\t PrivateKey privateKey = (PrivateKey) ks.getKey(alias, args[2].toCharArray());\n\n\t\t Certificate cert = ks.getCertificate(alias);\n\n\t\t // Get public key\t\n\t\t PublicKey publicKey = cert.getPublicKey();\n\n\t\t /* Create a Signature object and initialize it with the private key */\n\n\t\t Signature rsa = Signature.getInstance(\"SHA256withRSA\");\t\n\t\n\n\t\t rsa.initSign(privateKey);\n\n\t\t /* Update and sign the data */\n\n \t String hexString = readFile(args[0]).trim();\n\t\t byte[] decodedBytes = DatatypeConverter.parseHexBinary(hexString);\t\n\t\t InputStream bufin = new ByteArrayInputStream(decodedBytes);\n\n\n\t\t byte[] buffer = new byte[1024];\n\t\t int len;\n\t\t while (bufin.available() != 0) {\n\t\t\tlen = bufin.read(buffer);\n\t\t\trsa.update(buffer, 0, len);\n\t\t };\n\n\t\t bufin.close();\n\n\t\t /* Now that all the data to be signed has been read in, \n\t\t\t generate a signature for it */\n\n\t\t byte[] realSig = rsa.sign();\n\n\t\t \n\t\t /* Save the signature in a file */\n\n\t\t File file = new File(args[3]);\n\t\t PrintWriter out = new PrintWriter(file);\n\n\t\t\t// if file doesn't exists, then create it\n\t\t\tif (!file.exists()) {\n\t\t\t\tfile.createNewFile();\n\t\t\t}\n\n\t\t out.println(DatatypeConverter.printBase64Binary(realSig));\n\t\t out.close();\n\n\n\t\t /* Save the public key in a file */\n\t\t byte[] key = publicKey.getEncoded();\n\t\t FileOutputStream keyfos = new FileOutputStream(args[4]);\n\t\t keyfos.write(key);\n\n\t\t keyfos.close();\n\n\t\t} catch (Exception e) {\n\t\t System.err.println(\"Caught exception \" + e.toString());\n\t\t}\n\n\t}",
"java.lang.String getPublicKey();",
"byte[] encode(IMessage message) throws IOException;",
"public RSA(BigInteger e, BigInteger n) {\n this.e = e;\n this.n = n;\n }",
"public void initSign(Key paramKey, SecureRandom paramSecureRandom) throws XMLSignatureException {\n/* 255 */ this.signatureAlgorithm.engineInitSign(paramKey, paramSecureRandom);\n/* */ }",
"private BigInteger encrypt(BigInteger message) {\n return message.modPow(e, n);\n }",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/243905306\"})\n @Test\n public void testNoDefaultForParameters() {\n // An X509 encoded 2048-bit RSA public key.\n String pubKey =\n \"30820122300d06092a864886f70d01010105000382010f003082010a02820101\"\n + \"00bdf90898577911c71c4d9520c5f75108548e8dfd389afdbf9c997769b8594e\"\n + \"7dc51c6a1b88d1670ec4bb03fa550ba6a13d02c430bfe88ae4e2075163017f4d\"\n + \"8926ce2e46e068e88962f38112fc2dbd033e84e648d4a816c0f5bd89cadba0b4\"\n + \"d6cac01832103061cbb704ebacd895def6cff9d988c5395f2169a6807207333d\"\n + \"569150d7f569f7ebf4718ddbfa2cdbde4d82a9d5d8caeb467f71bfc0099b0625\"\n + \"a59d2bad12e3ff48f2fd50867b89f5f876ce6c126ced25f28b1996ee21142235\"\n + \"fb3aef9fe58d9e4ef6e4922711a3bbcd8adcfe868481fd1aa9c13e5c658f5172\"\n + \"617204314665092b4d8dca1b05dc7f4ecd7578b61edeb949275be8751a5a1fab\"\n + \"c30203010001\";\n PublicKey key;\n Signature verifier;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n X509EncodedKeySpec x509keySpec = new X509EncodedKeySpec(TestUtil.hexToBytes(pubKey));\n key = kf.generatePublic(x509keySpec);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key is not supported\");\n return;\n }\n try {\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n verifier.initVerify(key);\n } catch (NoSuchAlgorithmException | InvalidKeyException ex) {\n TestUtil.skipTest(\"RSASSA-PSS is not supported.\");\n return;\n }\n AlgorithmParameters params = verifier.getParameters();\n if (params != null) {\n PSSParameterSpec pssParams;\n try {\n pssParams = params.getParameterSpec(PSSParameterSpec.class);\n } catch (InvalidParameterSpecException ex) {\n fail(\"Can't generate PSSParameterSpec from \" + params.getClass().getName());\n return;\n }\n // The provider uses some default parameters. This easily leads to weak or\n // incompatible implementations.\n fail(\"RSASSA-PSS uses default parameters:\" + pssParameterSpecToString(pssParams));\n }\n }",
"public boolean verify(RSACryptoSignature sig, RSAKeyForPublication pKey, byte [] msgHashBytes){\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tAsymmetricBlockCipher rsaEngine = new PKCS1Encoding(new RSABlindedEngine());\r\n\t\t\trsaEngine.init(false, pKey.getPublicKey());\r\n\t\t\tbyte [] sigBytes = sig.signature.s.decodeToBytes();\r\n\t\t\tbyte [] rawBytes = rsaEngine.processBlock(sigBytes, 0, sigBytes.length);\r\n\t\t\treturn test_equal(rawBytes,msgHashBytes);\r\n\t\t} catch (InvalidCipherTextException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}",
"@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }",
"private static String encode(String license,String D, String N) {\n int MAX_ENCRYPT_BLOCK = 128;\n int offSet = 0;\n byte[] cache;\n int i = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n\n try {\n RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\n KeyFactory keyFactory = java.security.KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\n\n Cipher cipher = javax.crypto.Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.ENCRYPT_MODE,privateKey);\n\n byte[] data = license.getBytes(StandardCharsets.UTF_8);\n int inputLen = data.length;\n // 对数据分段加密\n while (inputLen - offSet > 0) {\n if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\n cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\n } else {\n cache = cipher.doFinal(data, offSet, inputLen - offSet);\n }\n out.write(cache, 0, cache.length);\n i++;\n offSet = i * MAX_ENCRYPT_BLOCK;\n }\n byte[] datas = out.toByteArray();\n out.close();\n\n System.out.println(\"datas:\"+datas.length);\n\n // byte[] datas = datas = cipher.doFinal(license.getBytes());\n datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\n return new String(datas,StandardCharsets.UTF_8);\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n } catch (InvalidKeySpecException e) {\n e.printStackTrace();\n } catch (NoSuchPaddingException e) {\n e.printStackTrace();\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n } catch (BadPaddingException e) {\n e.printStackTrace();\n } catch (IllegalBlockSizeException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"@Override\r\n\tpublic byte[] cosign(final byte[] sign,\r\n final String algorithm,\r\n final PrivateKey key,\r\n final java.security.cert.Certificate[] certChain,\r\n final Properties extraParams) throws AOException, IOException {\r\n return sign(sign, algorithm, key, certChain, extraParams);\r\n }",
"public void testVerifyCertificateRSA() throws Exception\n\t{\n\t\tm_random.setSeed(47989202);\n\t\ttestVerifyCertificate(new RSATestKeyPairGenerator(m_random));\n\t}"
] | [
"0.6749537",
"0.6621065",
"0.66143453",
"0.65531504",
"0.64833695",
"0.6251247",
"0.6249462",
"0.6248189",
"0.6247551",
"0.6163365",
"0.61460936",
"0.6146089",
"0.6106273",
"0.6034878",
"0.6020694",
"0.6006543",
"0.59968215",
"0.59938735",
"0.5987059",
"0.5975402",
"0.5926461",
"0.5922746",
"0.59157985",
"0.58851576",
"0.5883857",
"0.5862069",
"0.5846711",
"0.58241266",
"0.5816359",
"0.5789584",
"0.5788386",
"0.5757786",
"0.5751611",
"0.5736643",
"0.5683813",
"0.5674765",
"0.5668584",
"0.5667615",
"0.5664741",
"0.5624986",
"0.5598951",
"0.5593818",
"0.55849016",
"0.5549391",
"0.55405027",
"0.5522623",
"0.5500286",
"0.54830194",
"0.54790914",
"0.54636407",
"0.5459582",
"0.54253644",
"0.53917575",
"0.53710103",
"0.53567106",
"0.5354875",
"0.53523636",
"0.53397775",
"0.53263086",
"0.5323977",
"0.53217787",
"0.5315198",
"0.53023267",
"0.5283194",
"0.52831495",
"0.5270714",
"0.5253732",
"0.5248582",
"0.52339375",
"0.52317035",
"0.52263004",
"0.52253705",
"0.5225308",
"0.52236634",
"0.5201137",
"0.51984155",
"0.519725",
"0.51895285",
"0.51874495",
"0.5166431",
"0.5165122",
"0.5158367",
"0.51517683",
"0.51419395",
"0.5138896",
"0.5138884",
"0.5124725",
"0.5119672",
"0.5115379",
"0.5105008",
"0.5097021",
"0.50855297",
"0.50775284",
"0.5072248",
"0.5063434",
"0.5052341",
"0.5048665",
"0.50246745",
"0.5020681",
"0.5012563",
"0.5007372"
] | 0.0 | -1 |
Function which verify the signature of a message | public static boolean blindSignatureVerification(BigInteger message, BigInteger signature, RSAPublicKey key) {
BigInteger e = key.getPublicExponent();
BigInteger N = key.getModulus();
BigInteger clearText = signature.modPow(e, N);
return clearText.equals(message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;",
"public boolean verifySignature() {\r\n\t\t\r\n\t\tString data;\r\n\t\t\r\n\t\tif(isTypeCreation){\r\n\t\t\t\r\n\t\t\tdata = StringUtil.getStringFromKey(creator) + name +\r\n\t\t\t\t\tdescription + begin + end+end_subscription+\r\n\t\t\t\t\tlocation+min_capacity+max_capacity;\r\n\t\t\treturn StringUtil.verifyECDSASig(creator, data, signature);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdata = StringUtil.getStringFromKey(subscriber)+id_event;\r\n\t\t\treturn StringUtil.verifyECDSASig(subscriber, data, signature);\r\n\t\t}\r\n//\t\tSystem.out.println(\"signature \"+signature);\r\n\t\t\r\n\t}",
"@Override\n public boolean verifySignature(byte[] signature) {\n try {\n Element[] sig = derDecode(signature);\n CL04SignPublicPairingKeySerParameter pk = (CL04SignPublicPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(pairingKeySerParameter.getParameters());\n Element a = sig[0];\n Element b = sig[1];\n Element c = sig[2];\n List<Element> A = IntStream.range(3, 3 + messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n List<Element> B = IntStream.range(3 + messages.size(), 3 + 2 * messages.size()).mapToObj(i -> sig[i]).collect(Collectors.toList());\n return aFormedCorrectly(pairing, a, A, pk) && bFormedCorrectly(pairing, a, b, A, B, pk) && cFormedCorrectly(pairing, a, b, c, B, pk);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return false;\n\n }",
"private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }",
"boolean hasSignature();",
"boolean hasSignature();",
"public interface SignatureValidator {\n\n boolean validate(String encodedToken, final Signer signer);\n}",
"public boolean verify(String message) {\n try {\n String[] messageParts = message.split(\" \"); //messageParts[0] is <HMAC>\n //base64-decode <HMAC>\n byte[] receivedHash = Base64.decode(messageParts[0]);\n String otherMessageParts = message\n .substring(message.indexOf(' ') + 1); //= \"!msg <message>\"\n byte[] actualHash = createHash(\n otherMessageParts); //= hash calculated by message content\n\n return MessageDigest.isEqual(receivedHash, actualHash);\n } catch (Exception e) {\n //message format did not fit\n return false;\n }\n }",
"public boolean verifiySignature() {\n\t\tString data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(reciepient)\n\t\t\t\t+ Float.toString(value);\n\t\treturn StringUtil.verifyECDSASig(sender, data, signature);\n\t}",
"Entry<StatusType, String> verifyExternalSignature(Document document, Document signature);",
"public static boolean verifyProposeSign(ProposeMessage msg){\n if (Crypto.verifySignature(msg.data, msg.sign, msg.pubkey)) {\n logger.info(\"verifyProposeSign success.\");\n return true;\n } else {\n logger.error(\"verifyProposeSign failed.\");\n return false;\n }\n }",
"com.google.protobuf.ByteString getSignature();",
"Entry<StatusType, String> verifyInternalSignature(final Document document);",
"public boolean verifySignature() {\n\n String data = StringUtil.getStringFromKey(sender) + StringUtil.getStringFromKey(recipient) + Float.toString(value);\n return StringUtil.verifyECDSASig(sender, data, signature);\n }",
"private static boolean ValidateTokenSignature(String token, PublicKey publicKey) {\n \tboolean verified=true;\n try {\n \tJwts.parser().setSigningKey(publicKey).parseClaimsJws(token);\n } catch (Exception e) {\n verified=false;\n }\n return verified;\n }",
"String getSignature();",
"String getSignature();",
"String getSignature();",
"public static native String getSignature(long[] msgArgs);",
"public boolean verify(byte[] paramArrayOfbyte) throws XMLSignatureException {\n/* 305 */ return this.signatureAlgorithm.engineVerify(paramArrayOfbyte);\n/* */ }",
"public boolean verify(RSACryptoSignature sig, RSAKeyForPublication pKey, byte [] msgHashBytes){\r\n\t\tlock.lock();\r\n\t\ttry {\r\n\t\t\tAsymmetricBlockCipher rsaEngine = new PKCS1Encoding(new RSABlindedEngine());\r\n\t\t\trsaEngine.init(false, pKey.getPublicKey());\r\n\t\t\tbyte [] sigBytes = sig.signature.s.decodeToBytes();\r\n\t\t\tbyte [] rawBytes = rsaEngine.processBlock(sigBytes, 0, sigBytes.length);\r\n\t\t\treturn test_equal(rawBytes,msgHashBytes);\r\n\t\t} catch (InvalidCipherTextException e) {\r\n\t\t\tthrow new RuntimeException(e);\r\n\t\t} finally {\r\n\t\t\tlock.unlock();\r\n\t\t}\r\n\t}",
"org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder();",
"public static boolean verifySignature(byte[] data, byte[] signature) {\n try {\n if (!isTinkRegistered) {\n SignatureConfig.register();\n isTinkRegistered = true;\n }\n\n KeysetHandle publicKey = CleartextKeysetHandle.read(JsonKeysetReader.withInputStream(\n CheckSignatureWithTink.class.getClassLoader().getResourceAsStream(\"crypto/publicKey.pub\")));\n\n PublicKeyVerify verifier = publicKey.getPrimitive(PublicKeyVerify.class);\n verifier.verify(signature, data);\n return true;\n } catch (Exception e) {\n return false;\n }\n }",
"public abstract byte[] getSignature();",
"boolean checkSignature(long sig0, long sig1, long sig2) throws Exception {\n Integer[] sig = new Integer[3];\n\t /* Get signature */\n readSignature(sig);\n\t /* Compare signature */\n if (sig[0] != sig0 || sig[1] != sig1 || sig[2] != sig2) {\n throw new Exception(\"Signature does not match selected device! \");\n }\n return true; // Indicate supported command.\n }",
"private static boolean VerifyInput(String encrypteddata) throws NoSuchAlgorithmException, UnsupportedEncodingException {\n //extract the data and signed message\n String[] data = encrypteddata.split(\"#\");\n String clientdataComputedhash = \"\";\n try {\n clientdataComputedhash = CalHash(data[0].getBytes());\n } catch (UnsupportedEncodingException ex) {\n System.out.println(\"Unsupported Encoding Exception\");\n }\n //compute the hash from the signed message\n byte[] clientHash = data[1].getBytes();\n String clientdecryptHash = RSAdecrypt(clientHash);\n boolean status = false;\n //status if the signature does not matches\n status = clientdecryptHash.equals(clientdataComputedhash);\n return status;\n }",
"int getSignature ();",
"public boolean testVerify(byte[] message)\n {\n return false;\n }",
"org.apache.calcite.avatica.proto.Common.Signature getSignature();",
"public boolean verifyDigitalSignature(VidaasSignature vidaasSignature, String message)\n\t\t\tthrows GeneralSecurityException, IOException {\n\t\tbyte[] sigBytes;\n\t\tSystem.out.println(\"verifyDigitalSignature\");\n\t\t\n\t\tDate now = new Date();\n\t\tif (((now.getTime() - vidaasSignature.getTimestamp()) > (maxMessageAgeSeconds * 1000))\n\t\t\t\t&& (vidaasSignature.getTimestamp() != 0)) {\n\t\t\t// Message is too old\n\t\t\tmessageTooOld = true;\n\t\t} else {\n\t\t\t// Message has not yet expired\n\t\t\tmessageTooOld = false;\n\t\t\tString decodedUrl = decodeSignature(vidaasSignature.getSignature());\n\t\t\tSystem.out.println(\"Decoded:\" + decodedUrl);\n\t\t\tsigBytes = decodedUrl.getBytes();\n\t\t\treturn verifyDigitalSignature(sigBytes, vidaasSignature.getTimestampedMessage(message));\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public interface ContentVerifier\n{\n /**\n * Return the algorithm identifier describing the signature\n * algorithm and parameters this verifier supports.\n *\n * @return algorithm oid and parameters.\n */\n AlgorithmIdentifier getAlgorithmIdentifier();\n\n /**\n * Returns a stream that will accept data for the purpose of calculating\n * a signature for later verification. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate\n * the data on the fly as well.\n *\n * @return an OutputStream\n */\n OutputStream getOutputStream();\n\n /**\n * Return true if the expected value of the signature matches the data passed\n * into the stream.\n *\n * @param expected expected value of the signature on the data.\n * @return true if the signature verifies, false otherwise\n */\n boolean verify(byte[] expected);\n}",
"boolean hasSig();",
"public interface IVerifySignatureService {\n\n\t/**\n\t * Document which contains signature internally\n\t * \n\t * @param document : document to be verified\n\t * @return : verification result status and the Token file encoded by base64\n\t */\n\tEntry<StatusType, String> verifyInternalSignature(final Document document);\n\n\t/**\n\t * Document to be verified with its external signature\n\t * \n\t * @param document : document to be verified\n\t * @param signature : its signature file\n\t * @return\n\t */\n\tEntry<StatusType, String> verifyExternalSignature(Document document, Document signature);\n}",
"byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;",
"public static boolean validate(String publicKeyTrytes, String signatureTrytes, String message) {\n\n byte[] publicKeyBytes = TryteTool.trytesToBytes(publicKeyTrytes);\n byte[] signatureBytes = TryteTool.trytesToBytes(signatureTrytes);\n\n X509EncodedKeySpec publicKeySpec = new X509EncodedKeySpec(publicKeyBytes);\n PublicKey publicKey;\n\n try {\n publicKey = keyFactory.generatePublic(publicKeySpec);;\n } catch (InvalidKeySpecException e) {\n return false;\n }\n\n Signature signature;\n\n try {\n signature = Signature.getInstance(SignatureConstants.SIGNATURE_ALGORITHM);\n } catch (NoSuchAlgorithmException e) {\n throw new RuntimeException(e);\n }\n\n try {\n signature.initVerify(publicKey);\n } catch (InvalidKeyException e) {\n e.printStackTrace();\n return false;\n }\n\n byte[] msgBytes = message.getBytes();\n byte[] buffer = new byte[SignatureConstants.KEY_SIZE];\n\n try {\n for (byte b : msgBytes)\n signature.update(buffer, 0, b);\n return signature.verify(signatureBytes);\n } catch (SignatureException e) {\n e.printStackTrace();\n return false;\n }\n }",
"protected boolean verifySignature(Signature signature, Credential credential) {\n SignatureValidator validator = new SignatureValidator(credential);\n try {\n validator.validate(signature);\n } catch (ValidationException e) {\n log.debug(\"Signature validation using candidate validation credential failed\", e);\n return false;\n }\n \n log.debug(\"Signature validation using candidate credential was successful\");\n return true;\n }",
"public static boolean verify(PublicKey validationKey, byte [] plainText, byte [] signature){\r\n\t\ttry {\r\n\t\t\tSignature verifier = Signature.getInstance(signatureAlgorithm);\r\n\t\t\tverifier.initVerify(validationKey);\r\n\t\t\tverifier.update(plainText);\r\n\t\t\treturn verifier.verify(signature);\r\n\t\t} catch(SignatureException | NoSuchAlgorithmException | InvalidKeyException e){\r\n\t\t\tlogger.log(Level.WARNING,\"Unable to verify incoming message \"+new String(Arrays.copyOf(plainText, 10))+\"...\",e);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public abstract String getSignature();",
"public boolean verifyXMLSignature(java.lang.String xmlString) \n throws XMLSignatureException {\n return verifyXMLSignature(xmlString, null); \n }",
"private void verifyCadesSignature(byte[] signature, byte[] data)\n throws CmsCadesException, TspVerificationException, CMSSignatureException {\n CadesSignature cadesSig = new CadesSignature(signature, data);\n int signerInfoLength = cadesSig.getSignerInfos().length;\n\n System.out.println(\"Signature contains \" + signerInfoLength + \" signer infos\");\n\n for (int j = 0; j < signerInfoLength; j++) {\n cadesSig.verifySignatureValue(j);\n System.out.println(\"Signer \" + (j + 1) + \" signature value is valid.\");\n\n // tsp verification\n SignatureTimeStamp[] timestamps = cadesSig.getSignatureTimeStamps(j);\n for (SignatureTimeStamp tst : timestamps) {\n System.out.println(\"Signer info \" + (j + 1) + \" contains a signature timestamp.\");\n tst.verifyTimeStampToken(null);\n System.out.println(\"Signer info \" + (j + 1) + \" signature timestamp is valid.\");\n }\n }\n }",
"public void verifySignature(SignatureVerifier verifier) {\n\t\tverifier.verify(signingInput(), crypto);\n \t}",
"Signature getSignature();",
"public void verifyAsymmetricRsa(\n String projectId,\n String locationId,\n String keyRingId,\n String keyId,\n String keyVersionId,\n String message,\n byte[] signature)\n throws IOException, GeneralSecurityException {\n // Initialize client that will be used to send requests. This client only\n // needs to be created once, and can be reused for multiple requests. After\n // completing all of your requests, call the \"close\" method on the client to\n // safely clean up any remaining background resources.\n try (KeyManagementServiceClient client = KeyManagementServiceClient.create()) {\n // Build the name from the project, location, and key ring, key, and key version.\n CryptoKeyVersionName keyVersionName =\n CryptoKeyVersionName.of(projectId, locationId, keyRingId, keyId, keyVersionId);\n\n // Convert the message into bytes. Cryptographic plaintexts and\n // ciphertexts are always byte arrays.\n byte[] plaintext = message.getBytes(StandardCharsets.UTF_8);\n\n // Get the public key.\n PublicKey publicKey = client.getPublicKey(keyVersionName);\n\n // Convert the public PEM key to a DER key (see helper below).\n byte[] derKey = convertPemToDer(publicKey.getPem());\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(derKey);\n java.security.PublicKey rsaKey = KeyFactory.getInstance(\"RSA\").generatePublic(keySpec);\n\n // Verify the 'RSA_SIGN_PKCS1_2048_SHA256' signature.\n // For other key algorithms:\n // http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#Signature\n Signature rsaVerify = Signature.getInstance(\"SHA256withRSA\");\n rsaVerify.initVerify(rsaKey);\n rsaVerify.update(plaintext);\n\n // Verify the signature.\n boolean verified = rsaVerify.verify(signature);\n System.out.printf(\"Signature verified: %s\", verified);\n }\n }",
"boolean verify(byte[] expected);",
"private void verify(@NonNull byte[] dig, @NonNull byte[] sig, @NonNull WpcCrt crt) throws GeneralSecurityException {\n try {\n SafFkt.verSig(dig, sig, crt.getPublicKey()); // Verify the signature\n } catch (GeneralSecurityException err) { // An error occurred during the signature verification\n WpcLog.logErr(\"Wrong signature\"); // Log wrong signature\n throw err; // Report no successful signature verification\n }\n }",
"public boolean verify();",
"private void verifyCadesSignatureStream(InputStream signature, InputStream data)\n throws CmsCadesException, TspVerificationException, CMSSignatureException {\n CadesSignatureStream cadesSig = new CadesSignatureStream(signature, data);\n int signerInfoLength = cadesSig.getSignerInfos().length;\n\n System.out.println(\"Signature contains \" + signerInfoLength + \" signer infos\");\n\n for (int j = 0; j < signerInfoLength; j++) {\n cadesSig.verifySignatureValue(j);\n System.out.println(\"Signer \" + (j + 1) + \" signature value is valid.\");\n\n // tsp verification\n SignatureTimeStamp[] timestamps = cadesSig.getSignatureTimeStamps(j);\n for (SignatureTimeStamp tst : timestamps) {\n System.out.println(\"Signer info \" + (j + 1) + \" contains a signature timestamp.\");\n tst.verifyTimeStampToken(null);\n System.out.println(\"Signer info \" + (j + 1) + \" signature timestamp is valid.\");\n }\n }\n }",
"public abstract boolean verify();",
"boolean readSignature(Integer[] sig) {\n Scales.sendByte((byte) 's');\n\t /* Get actual signature */\n sig[2] = Scales.getByte();\n sig[1] = Scales.getByte();\n sig[0] = Scales.getByte();\n return true;\n }",
"public static boolean validateWithoutRevocations(\n String signedData,\n byte[] signature,\n PublicKey publicKey) {\n\n byte[] adjSignature = new byte[0];\n // check minimum length (taskinfo + R + S)\n if (signature.length < (36 + 48 + 48)) {\n return false;\n }\n try {\n // first 36 bytes are always the taskInfo\n byte[] taskInfo = Arrays.copyOfRange(signature, 0, 36);\n\n // adjust the signed data\n // data-to-verify format is: [ task-info | nonce (optional) | data ]\n // First 36 bytes of signature is the taskinfo. This value must be prepended\n // to the signedData\n ByteArrayOutputStream adjSignedData = new ByteArrayOutputStream();\n adjSignedData.write(taskInfo);\n adjSignedData.write(signedData.getBytes());\n\n adjSignature = convertSignature(signature, taskInfo);\n\n Signature sig = Signature.getInstance(\"SHA384withECDSA\");\n sig.initVerify(publicKey);\n sig.update(adjSignedData.toByteArray());\n return sig.verify(adjSignature);\n } catch (Exception ex) {\n return false;\n }\n }",
"java.lang.String getSignatureText();",
"int getSignatureType();",
"public void verifyAsymmetricRsa() throws IOException, GeneralSecurityException {\n String projectId = \"your-project-id\";\n String locationId = \"us-east1\";\n String keyRingId = \"my-key-ring\";\n String keyId = \"my-key\";\n String keyVersionId = \"123\";\n String message = \"my message\";\n byte[] signature = null;\n verifyAsymmetricRsa(projectId, locationId, keyRingId, keyId, keyVersionId, message, signature);\n }",
"public static void main(String[] args)\n throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, UnsupportedEncodingException {\n final String text = \"We would like to provide data integrity.\";\n\n /**\n * STEP 1.\n * We create a public-private key pair.\n * Standard Algorithm Names\n * http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html\n */\n final KeyPair key = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n /**\n * Alice creates Signature object defining Signature algorithm.\n */\n final Signature signatureAlg = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We initialize the signature object with\n * - Operation modes (SIGN) and\n * - provides appropriate ***Private*** Key\n */\n signatureAlg.initSign(key.getPrivate());\n\n // Finally, we load the message into the signature object and sign it\n signatureAlg.update(text.getBytes(\"UTF-8\"));\n final byte[] signedText = signatureAlg.sign();\n System.out.println(\"Signature: \" + DatatypeConverter.printHexBinary(signedText));\n\n /**\n * To verify the signature, we create another signature object\n * and specify its algorithm\n */\n final Signature signatureAlg2 = Signature.getInstance(\"SHA1withRSA\");\n\n /**\n * We have to initialize it with the mode. But to verify the algorithm,\n * we only need the public key of the original signee\n */\n signatureAlg2.initVerify(key.getPublic());\n\n //Finally, we can check whether the signature is valid\n signatureAlg2.update(text.getBytes(\"UTF-8\"));\n\n if (signatureAlg2.verify(signedText))\n System.out.println(\"Valid signature.\");\n else\n System.err.println(\"Invalid signature.\");\n }",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/253038666\"})\n @Test\n public void testSignVerifyWithParameters() {\n int keySizeInBits = 2048;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 20;\n KeyPair keypair;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n keypair = keyGen.genKeyPair();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] msg = new byte[4];\n RSAPublicKey pub = (RSAPublicKey) keypair.getPublic();\n RSAPrivateKey priv = (RSAPrivateKey) keypair.getPrivate();\n Signature signer;\n Signature verifier;\n try {\n signer = Signature.getInstance(\"RSASSA-PSS\");\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"RSASSA-PSS key generation is supported, but signature generation is not\");\n return;\n }\n // Signs the message. This part of the code constructs the PSS parameters\n // explicitely.\n try {\n signer.initSign(priv);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own private key\");\n return;\n }\n try {\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLength, 1);\n signer.setParameter(params);\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n fail(\"Parameters accepted as key generation parameters are rejected as algorithm parameters\");\n return;\n }\n byte[] signature;\n try {\n signer.update(msg);\n signature = signer.sign();\n } catch (SignatureException ex) {\n fail(\"Could not sign with RSAPSS-PSS:\" + ex.toString());\n return;\n }\n\n // Verifies the signature. This part of the code tries to copy the PSS parameters\n // from the public key. Ideally, just calling verifier.initVerify(pub) would\n // be sufficient, since the public key contains the parameters. Unfortunately,\n // copying the PSS parameters is necessary for OpenJDK, since OpenJDK does\n // not copy the algorithm parameters.\n // Even worse is BouncyCastle, where it is unclear if there is a simple way\n // to extract the algorithm parameters from the key.\n try {\n verifier.initVerify(pub);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own public key\");\n return;\n }\n \n try {\n verifier.setParameter(pub.getParams());\n verifier.update(msg);\n boolean verified = verifier.verify(signature);\n assertTrue(\"Signature did not verify\", verified);\n } catch (GeneralSecurityException ex) {\n throw new AssertionError(\"Provider could not verify its own signature\", ex);\n }\n }",
"private static boolean verify(BigInteger number, PublicKey pubKey, byte[] sigbytes) throws Exception {\r\n\t\tSignature sig = Signature.getInstance(\"SHAwithDSA\");\r\n\t\tsig.initVerify(pubKey);\r\n\t\tbyte[] data = bigIntToByteArray(number);\r\n\t\tsig.update(data);\r\n\t\treturn sig.verify(sigbytes);\r\n \t}",
"String getUniqueSignature();",
"private boolean verifySignature(String packageName, String signature) {\n try {\n final boolean signatureValid = signature.isEmpty()\n || mPackageManager.hasSigningCertificate(packageName,\n HexEncoding.decode(signature), CERT_INPUT_SHA256);\n\n if (!signatureValid) {\n Slog.w(TAG, packageName + \" did not have expected signature: \" + signature);\n }\n return signatureValid;\n } catch (IllegalArgumentException e) {\n Slog.w(TAG, \"Unable to verify signature \" + signature + \" for \" + packageName, e);\n return false;\n }\n }",
"com.google.protobuf.ByteString\n getSignatureBytes();",
"com.google.protobuf.ByteString\n getSignatureBytes();",
"public boolean isSignatureValid(final byte[] bytes, final byte[] signature) {\n return isSignatureValid(bytes, signature, UUID.randomUUID().toString());\n }",
"public native boolean signatureImage() throws MagickException;",
"public boolean verifyDigitalSignature(byte[] signatureBytes, String message) throws GeneralSecurityException {\n\t\tSignature sig = Signature.getInstance(SignatureGenerator.encodingInstance);\n\t\tsig.initVerify(publicKey);\n\t\tsig.update(message.getBytes());\n\t\treturn sig.verify(signatureBytes);\n\t}",
"public boolean verifySignature(OpenIDToken idToken, String jwksResponse) {\n boolean verificationStatus = false;\n try {\n JWKSet jwkSet = JWKSet.parse(jwksResponse);\n JWSHeader jwsHeader = idToken.getSignedJWT().getHeader();\n if (jwkSet != null) {\n List<JWK> matchingJWKs = new JWKSelector(new JWKMatcher.Builder()\n .keyID(jwsHeader.getKeyID())\n .algorithm(jwsHeader.getAlgorithm())\n .build())\n .select(jwkSet);\n OMLog.trace(TAG, \"Found \" + matchingJWKs.size() + \" matching JWKs\");\n\n JWSVerifierFactory jwsVerifierFactory = new DefaultJWSVerifierFactory();\n for (JWK jwk : matchingJWKs) {\n try {\n Key key = null;\n if (jwk instanceof RSAKey) {\n key = ((RSAKey) jwk).toRSAPublicKey();\n } else if (jwk instanceof ECKey) {\n key = ((ECKey) jwk).toECPublicKey();\n }\n if (key != null) {\n JWSVerifier jwsVerifier = jwsVerifierFactory.createJWSVerifier(jwsHeader, key);\n verificationStatus = idToken.getSignedJWT().verify(jwsVerifier);\n if (verificationStatus) {\n idToken.setVerified(true);\n break;\n }\n }\n } catch (JOSEException e) {\n OMLog.error(TAG, e.getMessage(), e);\n }\n }\n }\n } catch (ParseException e) {\n Log.e(TAG, e.getMessage(), e);\n }\n return verificationStatus;\n }",
"public static String verifyText(String plainText) throws Exception {\n\t\tPattern regex = Pattern.compile(\n\t\t\t\t\"-----BEGIN PGP SIGNED MESSAGE-----\\\\r?\\\\n.*?\\\\r?\\\\n\\\\r?\\\\n(.*)\\\\r?\\\\n(-----BEGIN PGP SIGNATURE-----\\\\r?\\\\n.*-----END PGP SIGNATURE-----)\",\n\t\t\t\tPattern.CANON_EQ | Pattern.DOTALL);\n\t\tMatcher regexMatcher = regex.matcher(plainText);\n\t\tif (regexMatcher.find()) {\n\t\t\tString dataText = regexMatcher.group(1);\n\t\t\tString signText = regexMatcher.group(2);\n\n\t\t\tSystem.out.println(dataText);\n\t\t\tSystem.out.println(signText);\n\n\t\t\tByteArrayInputStream dataIn = new ByteArrayInputStream(dataText.getBytes(\"UTF8\"));\n\t\t\tByteArrayInputStream signIn = new ByteArrayInputStream(signText.getBytes(\"UTF8\"));\n\n\t\t\treturn verifyFile3(dataText, signIn);\n\t\t}\n\t\tthrow new Exception(\"Cannot recognize input data\");\n\t}",
"SignatureIdentification createSignatureIdentification();",
"public static boolean verifyECDSASig(PublicKey publicKey, String data, byte[] signature) {\n try {\n Signature ecdsaVerify = Signature.getInstance(\"ECDSA\", \"SC\");\n ecdsaVerify.initVerify(publicKey);\n ecdsaVerify.update(data.getBytes());\n return ecdsaVerify.verify(signature);\n } catch (Exception e) {\n //throw new RuntimeException(e);\n Log.e(\"ERROR\",\"An error occured while verifying the signature!\");\n }\n return false;\n }",
"protected boolean validateSignature(SignedJWT jwtToken) {\n boolean valid = false;\n if (JWSObject.State.SIGNED == jwtToken.getState()) {\n LOG.debug(\"JWT token is in a SIGNED state\");\n if (jwtToken.getSignature() != null) {\n LOG.debug(\"JWT token signature is not null\");\n try {\n JWSVerifier verifier = new RSASSAVerifier(publicKey);\n if (jwtToken.verify(verifier)) {\n valid = true;\n LOG.debug(\"JWT token has been successfully verified\");\n } else {\n LOG.warn(\"JWT signature verification failed.\");\n }\n } catch (JOSEException je) {\n LOG.warn(\"Error while validating signature\", je);\n }\n }\n }\n return valid;\n }",
"public abstract void\n verifyOriginalPacket_(CertificateV2 trustedCertificate);",
"native String nativeGetSignature(long nativeHandler) throws RuntimeException;",
"public abstract void verify(PublicKey key, String sigProvider)\n throws CRLException, NoSuchAlgorithmException,\n InvalidKeyException, NoSuchProviderException,\n SignatureException;",
"boolean isValid(JsonMessage message);",
"public static boolean verify(byte[] message, byte[] proof, byte[] publicKey) {\n Objects.requireNonNull(message);\n Objects.requireNonNull(proof);\n Objects.requireNonNull(publicKey);\n\n if (proof.length != PROOF_BYTES) {\n throw new IllegalArgumentException(\"Invalid proof length:\" + proof.length);\n }\n\n if (publicKey.length != 32) {\n throw new IllegalArgumentException(\"Invalid public key length:\" + publicKey.length);\n }\n\n byte[] hash = new byte[PROOF_HASH_BYTES];\n Sodium.crypto_vrf_proof_to_hash(hash, proof);\n\n //Verify a proof per draft section 5.3. Return 0 on success, -1 on failure.\n int result = Sodium.crypto_vrf_verify(hash, publicKey, proof, message, message.length);\n return result == 0;\n }",
"public org.apache.calcite.avatica.proto.Common.SignatureOrBuilder getSignatureOrBuilder() {\n if (signatureBuilder_ != null) {\n return signatureBuilder_.getMessageOrBuilder();\n } else {\n return signature_ == null ?\n org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n }\n }",
"com.google.protobuf.ByteString getSig();",
"private boolean validateServerMessage(ClientMessage clientMessage, ServerMessage serverMessage) {\n boolean isValid = false;\n try {\n byte[] hash = java.security.MessageDigest.getInstance(\"MD5\").digest(clientMessage.toString().getBytes());\n String encodedHash = new String(java.util.Base64.getEncoder().encode(hash));\n if ((serverMessage.getMessageType().equals(ServerMessage.MessageType.OK)) &&\n (encodedHash.equals(serverMessage.getPayload()))) {\n isValid = true;\n }\n } catch (java.security.NoSuchAlgorithmException e) {\n e.printStackTrace();\n }\n return isValid;\n }",
"public static boolean verify_hash(byte[] messageHash, SecretKeySpec keySpec)\n {\n\tboolean ret = false;\n\t\t\n\ttry {\n\t // Split the array into the message and the digest\n\t byte[] message = new byte[messageHash.length - HMAC_SHA1_LEN];\n\t byte[] hash = new byte[HMAC_SHA1_LEN];\n\t\t\t\n\t System.arraycopy(messageHash, 0, message, 0, message.length);\n\t System.arraycopy(messageHash, message.length, hash, 0, hash.length);\n\t\t\t\n\t // Initialize the MAC with the given key\n\t Mac mac = Mac.getInstance(\"HmacSHA1\");\n\t mac.init(keySpec);\n\t\t\t\n\t // Get the MAC of the message\n\t byte[] m = mac.doFinal(message);\n\t\t\t\n\t // compare the the MAC sent and the one calculated\n\t ret = Arrays.equals(m, hash);\n\t\t\t\n\t} catch (Exception e) {\n\t // if there is an error, we know that hash can't be correct\n\t ret = false;\n\t}\n\t\t\n\treturn ret;\n }",
"private void verifyJwtSignature(SignedJWT signedJwt, String idpEntityID) throws SADValidationException {\n try {\n // Verify the JWT signature\n //\n List<X509Certificate> idpCerts = this.getValidationCertificates(idpEntityID);\n if (idpCerts.isEmpty()) {\n throw new SADValidationException(ErrorCode.SIGNATURE_VALIDATION_ERROR,\n \"No suitable IdP signature certificate was found - can not verify SAD JWT signature\");\n }\n logger.debug(\"Verifying SAD JWT signature. Will try {} IdP key(s) ...\", idpCerts.size());\n\n boolean verificationSuccess = false;\n for (X509Certificate idpCert : idpCerts) {\n try {\n JWSVerifier verifier = verifierFactory.createJWSVerifier(signedJwt.getHeader(), idpCert.getPublicKey());\n if (verifier.verify(signedJwt.getHeader(), signedJwt.getSigningInput(), signedJwt.getSignature())) {\n logger.debug(\"SAD JWT signature successfully verified\");\n verificationSuccess = true;\n break;\n }\n }\n catch (JOSEException e) {\n logger.debug(\"Failed to perform signature validation of SAD JWT - {}\", e.getMessage());\n logger.trace(\"\", e);\n }\n }\n if (!verificationSuccess) {\n throw new SADValidationException(ErrorCode.SIGNATURE_VALIDATION_ERROR,\n \"Signature on SAD JWT could not be validated using any of the IdP certificates found\");\n }\n }\n catch (ResolverException e) {\n throw new SADValidationException(ErrorCode.SIGNATURE_VALIDATION_ERROR, \"Failed to find validation certificate\", e);\n }\n }",
"boolean verify(ChunkDescriptor chunk);",
"public boolean verifyWSSSignature(org.w3c.dom.Document document,\n java.security.Key key)\n throws XMLSignatureException {\n return false;\n \n }",
"public interface SignatureObject {\n}",
"public boolean isSignatureValid(BasicOCSPResp ocspResp, Certificate responderCert) {\n try {\n ContentVerifierProvider verifierProvider = new JcaContentVerifierProviderBuilder()\n .setProvider(\"BC\").build(responderCert.getPublicKey());\n return ocspResp.isSignatureValid(verifierProvider);\n } catch (OperatorCreationException e) {\n return false;\n } catch (OCSPException e) {\n return false;\n }\n }",
"public static boolean testSignature(byte[] data, byte[] test) {\n return testSignature(data, 0, test);\n }",
"public org.apache.calcite.avatica.proto.Common.Signature getSignature() {\n if (signatureBuilder_ == null) {\n return signature_ == null ? org.apache.calcite.avatica.proto.Common.Signature.getDefaultInstance() : signature_;\n } else {\n return signatureBuilder_.getMessage();\n }\n }",
"public static boolean isValidSignature(String signature) {\n\t\tchar[] sig = signature.toCharArray();\n\t\tfor(char c : sig) {\n\t\t\tif(( c == ' ')) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}",
"public void testX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);\n // builder.setUserInfo(\"john\", \"keypass\");\n LOG.info(\"Before Signing ThumbprintSHA1....\");\n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Signed message with ThumbprintSHA1 key identifier:\");\n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);\n LOG.debug(outputString);\n }\n LOG.info(\"After Signing ThumbprintSHA1....\");\n verify(signedDoc);\n }",
"public synchronized boolean verifySignaturePublicKey(@NotNull Signature signature, @NotNull Hash publicKeyHash) {\n LOGGER.fine(\"Checking if public key hash corresponds to public key in signature.\");\n if (!signature.getPublicKey().getHash().equals(publicKeyHash)) {\n LOGGER.fine(\"Public key hash does not match signature public key: signature invalid.\");\n return false;\n }\n\n LOGGER.fine(\"Public key hash matches signature public key.\");\n return true;\n }",
"BigInteger getDigitalSignature();",
"public lnrpc.Rpc.VerifyMessageResponse verifyMessage(lnrpc.Rpc.VerifyMessageRequest request) {\n return blockingUnaryCall(\n getChannel(), getVerifyMessageMethod(), getCallOptions(), request);\n }",
"String process(String data) throws LocalizedSignatureException;",
"@Test\r\n public void testVerify() throws SodiumException, CryptoException {\r\n\r\n byte[] data = \"Hola caracola\".getBytes();\r\n\r\n CryptoService instance = new CryptoService();\r\n Keys keys = instance.createKeys(null);\r\n byte[] sign = instance.sign(data, keys);\r\n boolean result = instance.verify(data, sign, keys);\r\n assertTrue(result);\r\n }",
"public boolean validateSignature(SignedJWT signedJWT, X509Certificate x509Certificate)\n throws JOSEException, IdentityOAuth2Exception {\n\n JWSVerifier verifier;\n ReadOnlyJWSHeader header = signedJWT.getHeader();\n if (x509Certificate == null) {\n return logAndReturnFalse(\"Unable to locate certificate for JWT \" + header.toString());\n }\n\n String alg = signedJWT.getHeader().getAlgorithm().getName();\n if (isEmpty(alg)) {\n return false;\n } else {\n if (log.isDebugEnabled()) {\n log.debug(\"Signature Algorithm found in the JWT Header: \" + alg);\n }\n if (alg.indexOf(RS) == 0) {\n // At this point 'x509Certificate' will never be null.\n PublicKey publicKey = x509Certificate.getPublicKey();\n if (publicKey instanceof RSAPublicKey) {\n verifier = new RSASSAVerifier((RSAPublicKey) publicKey);\n } else {\n return logAndReturnFalse(\"Public key is not an RSA public key.\");\n }\n } else {\n return logAndReturnFalse(\"Signature Algorithm not supported yet : \" + alg);\n }\n }\n // At this point 'verifier' will never be null;\n return signedJWT.verify(verifier);\n }",
"public boolean verifyMessage(ATMMessage atmMessage){\n if(!(this.currTimeStamp < atmMessage.getTimeStamp())) error (\"Time stamp does not match\");\r\n if(!(parameterGenerator.getPreviousNonce() == atmMessage.getResponseNonce())) error (\"Nonce does not match\");\r\n return true;\r\n \r\n }",
"protected void checkParamsRaw(byte[] signature, byte[] content, String algorithmURI, CriteriaSet trustBasisCriteria)\n throws SecurityException {\n\n if (signature == null || signature.length == 0) {\n throw new SecurityException(\"Signature byte array was null or empty\");\n }\n if (content == null || content.length == 0) {\n throw new SecurityException(\"Content byte array was null or empty\");\n }\n if (DatatypeHelper.isEmpty(algorithmURI)) {\n throw new SecurityException(\"Signature algorithm was null or empty\");\n }\n if (trustBasisCriteria == null) {\n throw new SecurityException(\"Trust basis criteria set was null\");\n }\n if (trustBasisCriteria.isEmpty()) {\n throw new SecurityException(\"Trust basis criteria set was empty\");\n }\n }",
"String componentSignature();",
"WireMessage hasMessage(String sender, String regexp) throws RemoteException;",
"@Test\n public void testRandomization() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Set<String> signatures = new HashSet<String>();\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n signer.initSign(priv);\n signer.update(messageBytes);\n byte[] signature = signer.sign();\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"Failed to generat signatures:\" + ex);\n return;\n }\n }",
"public static boolean testSignature(byte[] data, String test) {\n return testSignature(data, 0, test.getBytes());\n }",
"public abstract void verify(PublicKey key)\n throws CRLException, NoSuchAlgorithmException,\n InvalidKeyException, NoSuchProviderException,\n SignatureException;",
"@Test\n public void testValidSig() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1 with Bob's kp, which is incorrect\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpBob.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n\n // Sign for tx1 with Alice's kp, which is now correct\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig2);\n tx1.finalize();\n\n assertTrue(txHandler.isValidTx(tx1));\n }"
] | [
"0.7921895",
"0.7150802",
"0.7085262",
"0.703374",
"0.7013981",
"0.7013981",
"0.6699502",
"0.6629545",
"0.6602111",
"0.66020274",
"0.6575008",
"0.6505964",
"0.64615405",
"0.6411824",
"0.63990927",
"0.6385288",
"0.6385288",
"0.6385288",
"0.6382895",
"0.63471895",
"0.62690794",
"0.62632215",
"0.62564665",
"0.6253467",
"0.62308484",
"0.62110007",
"0.6171789",
"0.6152691",
"0.61324435",
"0.61278987",
"0.6126175",
"0.6121274",
"0.60982877",
"0.60967445",
"0.60635126",
"0.6045396",
"0.6033893",
"0.6031244",
"0.6009796",
"0.60081977",
"0.59847856",
"0.59828776",
"0.5927465",
"0.5920069",
"0.58684796",
"0.58621335",
"0.58585715",
"0.58369476",
"0.5829796",
"0.5817028",
"0.58102673",
"0.58048236",
"0.5802997",
"0.5776369",
"0.5770129",
"0.5769463",
"0.5738095",
"0.5720279",
"0.5713621",
"0.5713621",
"0.5712776",
"0.5710888",
"0.5692773",
"0.5670986",
"0.5667879",
"0.5658715",
"0.5653824",
"0.5623309",
"0.55988365",
"0.55815786",
"0.55812037",
"0.55610424",
"0.5558163",
"0.5556446",
"0.55300605",
"0.5511105",
"0.55104226",
"0.54963726",
"0.5479766",
"0.5479447",
"0.54788893",
"0.545281",
"0.5452498",
"0.54356396",
"0.5432815",
"0.540877",
"0.53884995",
"0.53803647",
"0.53784573",
"0.5371117",
"0.53498197",
"0.5347774",
"0.5340236",
"0.53315276",
"0.5327807",
"0.5325457",
"0.5321495",
"0.53194964",
"0.53119624",
"0.526129"
] | 0.59819376 | 42 |
Function which blind a message in the case of RSA blind signature | public static BigInteger blind(BigInteger message, BigInteger r, RSAPublicKey publicKey) {
BigInteger e = publicKey.getPublicExponent();
BigInteger N = publicKey.getModulus();
return message.multiply(r.modPow(e, N)).mod(N);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BigInteger blindSign(BigInteger message, RSAPrivateKey key) {\n\t\tBigInteger d = key.getPrivateExponent();\n\t\tBigInteger N = key.getModulus();\n\n\t\treturn message.modPow(d, N);\t\n\t}",
"protected PKIMessage protectPKIMessage(PKIMessage msg, boolean badObjectId, String password, String keyId, int iterations) throws NoSuchAlgorithmException,\n NoSuchProviderException, InvalidKeyException {\n PKIHeader head = msg.getHeader();\n if(keyId != null) {\n \thead.setSenderKID(new DEROctetString(keyId.getBytes()));\n }\n // SHA1\n AlgorithmIdentifier owfAlg = new AlgorithmIdentifier(\"1.3.14.3.2.26\");\n // 567 iterations\n int iterationCount = iterations;\n DERInteger iteration = new DERInteger(iterationCount);\n // HMAC/SHA1\n AlgorithmIdentifier macAlg = new AlgorithmIdentifier(\"1.2.840.113549.2.7\");\n byte[] salt = \"foo123\".getBytes();\n DEROctetString derSalt = new DEROctetString(salt);\n\n // Create the new protected return message\n String objectId = \"1.2.840.113533.7.66.13\";\n if (badObjectId) {\n objectId += \".7\";\n }\n PBMParameter pp = new PBMParameter(derSalt, owfAlg, iteration, macAlg);\n AlgorithmIdentifier pAlg = new AlgorithmIdentifier(new DERObjectIdentifier(objectId), pp);\n head.setProtectionAlg(pAlg);\n PKIBody body = msg.getBody();\n PKIMessage ret = new PKIMessage(head, body);\n\n // Calculate the protection bits\n byte[] raSecret = password.getBytes();\n byte[] basekey = new byte[raSecret.length + salt.length];\n for (int i = 0; i < raSecret.length; i++) {\n basekey[i] = raSecret[i];\n }\n for (int i = 0; i < salt.length; i++) {\n basekey[raSecret.length + i] = salt[i];\n }\n // Construct the base key according to rfc4210, section 5.1.3.1\n MessageDigest dig = MessageDigest.getInstance(owfAlg.getObjectId().getId(), \"BC\");\n for (int i = 0; i < iterationCount; i++) {\n basekey = dig.digest(basekey);\n dig.reset();\n }\n // For HMAC/SHA1 there is another oid, that is not known in BC, but the\n // result is the same so...\n String macOid = macAlg.getObjectId().getId();\n byte[] protectedBytes = ret.getProtectedBytes();\n Mac mac = Mac.getInstance(macOid, \"BC\");\n SecretKey key = new SecretKeySpec(basekey, macOid);\n mac.init(key);\n mac.reset();\n mac.update(protectedBytes, 0, protectedBytes.length);\n byte[] out = mac.doFinal();\n DERBitString bs = new DERBitString(out);\n\n // Finally store the protection bytes in the msg\n ret.setProtection(bs);\n return ret;\n }",
"public static boolean blindSignatureVerification(BigInteger message, BigInteger signature, RSAPublicKey key) {\n\t\tBigInteger e = key.getPublicExponent();\n\t\tBigInteger N = key.getModulus();\n\n\t\tBigInteger clearText = signature.modPow(e, N);\n\n\t\treturn clearText.equals(message);\n\t}",
"public static BigInteger unblind(BigInteger signature, BigInteger N, BigInteger r) {\n\t\tBigInteger rInverse = r.modInverse(N);\n\n\t\treturn signature.multiply(rInverse).mod(N);\n\t}",
"public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }",
"private void preparePkcs1ClearText(byte[] clearText, short type, short messageLength) \r\n \t /*@ requires clearText != null &*& array_slice(clearText, 0, clearText.length, _) &*& clearText.length >= 128\r\n\t \t &*& PKCS1_HEADER |-> ?thePKCS1HEADER &*& PKCS1_SHA1_HEADER |-> ?thePKCS1SHA1HEADER &*& PKCS1_MD5_HEADER |-> ?thePKCS1MD5HEADER\r\n\t \t &*& thePKCS1HEADER != null &*& thePKCS1SHA1HEADER != null &*& thePKCS1MD5HEADER != null\r\n\t \t &*& thePKCS1HEADER.length == 1 &*& thePKCS1SHA1HEADER.length == 16 &*& thePKCS1MD5HEADER.length == 19\r\n\t \t &*& array_slice(thePKCS1HEADER, 0, thePKCS1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1SHA1HEADER, 0, thePKCS1SHA1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1MD5HEADER, 0, thePKCS1MD5HEADER.length, _)\r\n\t \t &*& messageBuffer |-> ?theMessageBuffer &*& theMessageBuffer != null \r\n\t \t &*& messageLength >= 0\r\n\t \t &*& type == ALG_SHA1_PKCS1 ? messageLength == 20 || messageLength == 22 : type == ALG_MD5_PKCS1 ? messageLength == 16 : messageLength < 126; @*/\r\n \t /*@ ensures array_slice(clearText, 0, clearText.length, _) &*& PKCS1_HEADER |-> thePKCS1HEADER \r\n \t \t &*& PKCS1_SHA1_HEADER |-> thePKCS1SHA1HEADER &*& PKCS1_MD5_HEADER |-> thePKCS1MD5HEADER\r\n\t \t &*& array_slice(thePKCS1HEADER, 0, thePKCS1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1SHA1HEADER, 0, thePKCS1SHA1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1MD5HEADER, 0, thePKCS1MD5HEADER.length, _)\r\n \t \t &*& messageBuffer |-> theMessageBuffer ; @*/\r\n\t{\r\n\t\t// first pad the whole clear text with 0xFF\r\n\t\tUtil.arrayFillNonAtomic(clearText, (short) 0, (short) 128, (byte) 0xff);\r\n\t\t// first 2 bytes should be 0x00 and 0x01\r\n\t\tUtil.arrayFillNonAtomic(clearText, (short) 0, (short) 1, (byte) 0x00);\r\n\t\tUtil.arrayFillNonAtomic(clearText, (short) 1, (short) 1, (byte) 0x01);\r\n\t\t// add the PKCS#1 header at the correct location\r\n\t\tbyte[] header = PKCS1_HEADER;\r\n\t\tif (type == ALG_SHA1_PKCS1)\r\n\t\t\theader = PKCS1_SHA1_HEADER;\r\n\t\tif (type == ALG_MD5_PKCS1)\r\n\t\t\theader = PKCS1_MD5_HEADER;\r\n\t\tUtil.arrayCopy(header, (short) 0, clearText, (short) (128 - messageLength - header.length), (short) header.length);\r\n\t}",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/253038666\"})\n @Test\n public void testSignVerifyWithParameters() {\n int keySizeInBits = 2048;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 20;\n KeyPair keypair;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n keypair = keyGen.genKeyPair();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] msg = new byte[4];\n RSAPublicKey pub = (RSAPublicKey) keypair.getPublic();\n RSAPrivateKey priv = (RSAPrivateKey) keypair.getPrivate();\n Signature signer;\n Signature verifier;\n try {\n signer = Signature.getInstance(\"RSASSA-PSS\");\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"RSASSA-PSS key generation is supported, but signature generation is not\");\n return;\n }\n // Signs the message. This part of the code constructs the PSS parameters\n // explicitely.\n try {\n signer.initSign(priv);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own private key\");\n return;\n }\n try {\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLength, 1);\n signer.setParameter(params);\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n fail(\"Parameters accepted as key generation parameters are rejected as algorithm parameters\");\n return;\n }\n byte[] signature;\n try {\n signer.update(msg);\n signature = signer.sign();\n } catch (SignatureException ex) {\n fail(\"Could not sign with RSAPSS-PSS:\" + ex.toString());\n return;\n }\n\n // Verifies the signature. This part of the code tries to copy the PSS parameters\n // from the public key. Ideally, just calling verifier.initVerify(pub) would\n // be sufficient, since the public key contains the parameters. Unfortunately,\n // copying the PSS parameters is necessary for OpenJDK, since OpenJDK does\n // not copy the algorithm parameters.\n // Even worse is BouncyCastle, where it is unclear if there is a simple way\n // to extract the algorithm parameters from the key.\n try {\n verifier.initVerify(pub);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own public key\");\n return;\n }\n \n try {\n verifier.setParameter(pub.getParams());\n verifier.update(msg);\n boolean verified = verifier.verify(signature);\n assertTrue(\"Signature did not verify\", verified);\n } catch (GeneralSecurityException ex) {\n throw new AssertionError(\"Provider could not verify its own signature\", ex);\n }\n }",
"byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;",
"public static BigInteger generateRForBlindSignature(BigInteger mod) {\n\t\tBigInteger r;\n\t\tdo {\n\t\t\tr = new BigInteger(1024, new SecureRandom());\n\t\t} while(r.gcd(mod) == BigInteger.ONE);\n\n\t\treturn r;\n\t}",
"@Test\n public void testNullRandom() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key generation is not supported.\" + ex);\n return;\n }\n Set<String> signatures = new HashSet<String>();\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n byte[] signature;\n try {\n signer.initSign(priv, null);\n signer.update(messageBytes);\n signature = signer.sign();\n } catch (GeneralSecurityException ex) {\n fail(\"Failed to sign. \" + ex);\n return;\n }\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n }",
"void decryptMessage(String Password);",
"public abstract String decryptMsg(String msg);",
"@Override\n\tpublic void visit(SendRSAKey srsak) {\n\t\t\n\t}",
"byte unwrap(byte[] keyHandle, short keyHandleOffset, short keyHandleLength, byte[] applicationParameter, short applicationParameterOffset, ECPrivateKey unwrappedPrivateKey);",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/243905306\"})\n @Test\n public void testNoDefaultForParameters() {\n // An X509 encoded 2048-bit RSA public key.\n String pubKey =\n \"30820122300d06092a864886f70d01010105000382010f003082010a02820101\"\n + \"00bdf90898577911c71c4d9520c5f75108548e8dfd389afdbf9c997769b8594e\"\n + \"7dc51c6a1b88d1670ec4bb03fa550ba6a13d02c430bfe88ae4e2075163017f4d\"\n + \"8926ce2e46e068e88962f38112fc2dbd033e84e648d4a816c0f5bd89cadba0b4\"\n + \"d6cac01832103061cbb704ebacd895def6cff9d988c5395f2169a6807207333d\"\n + \"569150d7f569f7ebf4718ddbfa2cdbde4d82a9d5d8caeb467f71bfc0099b0625\"\n + \"a59d2bad12e3ff48f2fd50867b89f5f876ce6c126ced25f28b1996ee21142235\"\n + \"fb3aef9fe58d9e4ef6e4922711a3bbcd8adcfe868481fd1aa9c13e5c658f5172\"\n + \"617204314665092b4d8dca1b05dc7f4ecd7578b61edeb949275be8751a5a1fab\"\n + \"c30203010001\";\n PublicKey key;\n Signature verifier;\n try {\n KeyFactory kf = KeyFactory.getInstance(\"RSA\");\n X509EncodedKeySpec x509keySpec = new X509EncodedKeySpec(TestUtil.hexToBytes(pubKey));\n key = kf.generatePublic(x509keySpec);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key is not supported\");\n return;\n }\n try {\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n verifier.initVerify(key);\n } catch (NoSuchAlgorithmException | InvalidKeyException ex) {\n TestUtil.skipTest(\"RSASSA-PSS is not supported.\");\n return;\n }\n AlgorithmParameters params = verifier.getParameters();\n if (params != null) {\n PSSParameterSpec pssParams;\n try {\n pssParams = params.getParameterSpec(PSSParameterSpec.class);\n } catch (InvalidParameterSpecException ex) {\n fail(\"Can't generate PSSParameterSpec from \" + params.getClass().getName());\n return;\n }\n // The provider uses some default parameters. This easily leads to weak or\n // incompatible implementations.\n fail(\"RSASSA-PSS uses default parameters:\" + pssParameterSpecToString(pssParams));\n }\n }",
"ISModifySignature createISModifySignature();",
"public CryptObject encrypt(BigIntegerMod message);",
"@Test\n public void testRandomization() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Set<String> signatures = new HashSet<String>();\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n signer.initSign(priv);\n signer.update(messageBytes);\n byte[] signature = signer.sign();\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"Failed to generat signatures:\" + ex);\n return;\n }\n }",
"public CryptObject encrypt(BigIntegerMod message, BigIntegerMod r);",
"boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;",
"Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);",
"private void generatePkcs1Sha1Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\t\r\n\t\t\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 20) || (byteRead != 20))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t\r\n\t\t\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// use the correct key\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\r\n\t\t\t////cipher.init(nonRepPrivateKey, Cipher.MODE_ENCRYPT); // stond al in comments\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_SHA1_PKCS1, lc);\r\n\t\t// copy the SHA1 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer); // todo\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}",
"private void signMessage() {\n\n String messageText = messageTextArea.getText();\n SecureCharSequence secureCharSequence = new SecureCharSequence(currentPassword.getPassword());\n String signMessage = this.address.signMessage(messageText, secureCharSequence);\n signature.setText(signMessage);\n\n }",
"void mo23214a(Message message);",
"void mo80456b(Message message);",
"public abstract String requestCard(byte[] messageRec) throws IOException;",
"OpenSSLKey mo134201a();",
"private static String RSAdecrypt(byte[] signedhash) {\n String ab = new String(signedhash);\n //private keys\n BigInteger e = new BigInteger(\"65537\");\n BigInteger n = new BigInteger(\"2688520255179015026237478731436571621031218154515572968727588377065598663770912513333018006654248650656250913110874836607777966867106290192618336660849980956399732967369976281500270286450313199586861977623503348237855579434471251977653662553\");\n BigInteger m = new BigInteger(ab);\n BigInteger dataHash = m.modPow(e, n);\n String ComputeddataHash = new String(dataHash.toByteArray());\n return ComputeddataHash;\n }",
"public abstract String encryptMsg(String msg);",
"public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}",
"private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}",
"public void testX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);\n // builder.setUserInfo(\"john\", \"keypass\");\n LOG.info(\"Before Signing ThumbprintSHA1....\");\n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n\n if (LOG.isDebugEnabled()) {\n LOG.debug(\"Signed message with ThumbprintSHA1 key identifier:\");\n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);\n LOG.debug(outputString);\n }\n LOG.info(\"After Signing ThumbprintSHA1....\");\n verify(signedDoc);\n }",
"private void generatePkcs1Md5Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 16) || (byteRead != 16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// use the correct key\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\t\t\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t\r\n\t\t////@ open valid(); // todo\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\t\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\t////@ open [1/2]valid();\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_MD5_PKCS1, lc);\r\n\t\t// copy the MD5 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\r\n\t\t////@ close [1/2]valid(); // auto\r\n\r\n\r\n\t}",
"@Test\n public void unencryptTransactionWeSentUsingRecipientKey() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final RecipientBox senderBox = RecipientBox.from(\"senderBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBoxes(List.of(senderBox.getData(), recipientBox.getData()))\n .withRecipientKeys(List.of(senderKey, recipientKey))\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey recipientPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(recipientKey)).thenReturn(recipientPrivateKey);\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(senderKey, recipientPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, recipientKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(senderKey, recipientPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(recipientKey);\n }",
"private byte[] preparePayload(byte[] message) {\n\t\treturn ComMethods.preparePayload(\"SecretServer\".getBytes(), message, counter, currentSessionKey, simMode);\n\t}",
"String getPublicKeyActorReceive();",
"BigInteger getDigitalSignature();",
"private String convertPrivateKeytoWIF(byte[] privatekey){\r\n\tbyte[] step1=concateByteArray(new byte[]{(byte) 0x80},privatekey);\r\n\tbyte[] step2to3=SHA256hash(SHA256hash(step1));\r\n\tbyte[] checksum=getCheckSum(step2to3);\r\n\tbyte[] step5=concateByteArray(step1,checksum);\r\n\treturn base58encode(step5);\r\n}",
"@Override\n\tpublic long getNewPrivateMessage(String userName) throws Exception {\n\t\treturn 0;\n\t}",
"private String preparaMensaje(String mensaje){\n String binario;\n int longitud = 0;\n String bi=\"\";\n longitud = mensaje.length() + 4;\n for( int i = 15; i>=0; i--){\n bi += ( ( ( longitud & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario = cadenaABinario(\" \") + bi + cadenaABinario(mensaje);\n }",
"public static void validateMessage(ProcessingContext context)\n throws XWSSecurityException {\n \n HarnessUtil.validateContext(context);\n FilterProcessingContext fpContext = new FilterProcessingContext(context);\n fpContext.isInboundMessage(true);\n\n MessagePolicy msgPolicy = (MessagePolicy) fpContext.getSecurityPolicy();\n if ((msgPolicy != null) && (msgPolicy.dumpMessages())) {\n DumpFilter.process(fpContext);\n }\n \n //unconditionally set these since the policy is unknown\n fpContext.setExtraneousProperty(\"EnableWSS11PolicyReceiver\",\"true\");\n List scList = new ArrayList();\n fpContext.setExtraneousProperty(\"receivedSignValues\", scList);\n fpContext.setMode(FilterProcessingContext.WSDL_POLICY);\n\n pProcess(fpContext);\n\n boolean isTrust = fpContext.isTrustMessage();\n //TODO: Venu this is a workaround for PROTOCOL Messages\n //To be removed after resolveOperationPolicy starts returning correct policy for\n //protocol messages.\n if(msgPolicy == null || msgPolicy.size() <= 0){\n PolicyResolver opResolver = \n (PolicyResolver)fpContext.getExtraneousProperty(fpContext.OPERATION_RESOLVER);\n if(opResolver != null && !isTrust)\n msgPolicy = opResolver.resolvePolicy(fpContext);\n }\n //TODO: this is a workaround for PROTOCOL Message\n try {\n if ((msgPolicy == null) ||\n (msgPolicy.size() == 0 && fpContext.getSOAPMessage().getSOAPBody().hasFault())) {\n \n fpContext.getSecurableSoapMessage().deleteSecurityHeader();\n fpContext.getSOAPMessage().saveChanges();\n return;\n }\n }catch (Exception ex) {\n log.log(Level.SEVERE, \"WSS0370.error.deleting.secheader\", ex);\n throw new XWSSecurityException(ex);\n }\n\n // for Policy verfication\n TargetResolver targetResolver = new TargetResolverImpl(context);\n MessagePolicyVerifier mpv = new MessagePolicyVerifier(context, targetResolver); \n /*\n try{\n System.out.println(\"Inferred Security Policy\");\n mpv.printInferredSecurityPolicy(fpContext.getInferredSecurityPolicy());\n } catch(Exception e){\n throw new XWSSecurityException(e);\n }\n System.out.println(\"==================================\");\n \n \n try{\n System.out.println(\"Actual SecurityPolicy\");\n mpv.printInferredSecurityPolicy(msgPolicy);\n } catch(Exception e){\n throw new XWSSecurityException(e);\n }\n */\n\n if(!isTrust){\n mpv.verifyPolicy(fpContext.getInferredSecurityPolicy(), msgPolicy);\n }\n \n\n try {\n fpContext.getSecurableSoapMessage().deleteSecurityHeader();\n fpContext.getSOAPMessage().saveChanges();\n }catch (Exception ex) {\n log.log(Level.SEVERE, \"WSS0370.error.deleting.secheader\", ex);\n throw new XWSSecurityException(ex);\n }\n }",
"@Test\n public void unencryptTransactionWeSentUsingSenderKey() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final RecipientBox senderBox = RecipientBox.from(\"senderBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBoxes(List.of(senderBox.getData(), recipientBox.getData()))\n .withRecipientKeys(List.of(senderKey, recipientKey))\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey senderPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(senderKey)).thenReturn(senderPrivateKey);\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(senderKey, senderPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(senderBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, senderKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(senderBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(senderKey, senderPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(senderKey);\n }",
"public String Decrypt(String Message, int PrimeNo, String EncoderKeyPath) throws IOException\r\n {\r\n Scanner sc = new Scanner(System.in);\r\n Key key1 = new Key();\r\n char[] msg=new char[Message.length()];\r\n int s, x;\r\n System.out.println(\"Enter Your Secret Key To Decode \");\r\n x=sc.nextInt();\r\n int key = key1.Skey(PrimeNo, x, EncoderKeyPath);\r\n char s1;\r\n int len=Message.length();\r\n int res=0;\r\n\tfor(int i=0;i<len;i++)\r\n\t{\r\n res=i%key;\r\n s=Message.charAt(i);\r\n s-=res;\r\n s1= (char) s;\r\n msg[i]=s1;\t\r\n\t}\r\n String msg1 = new String(msg);\r\n return msg1; \r\n }",
"private void validateFermatPacketSignature(FermatPacket fermatPacketReceive){\n\n System.out.println(\" WsCommunicationVPNClient - validateFermatPacketSignature\");\n\n /*\n * Validate the signature\n */\n boolean isValid = AsymmectricCryptography.verifyMessageSignature(fermatPacketReceive.getSignature(), fermatPacketReceive.getMessageContent(), vpnServerIdentity);\n\n System.out.println(\" WsCommunicationVPNClient - isValid = \" + isValid);\n\n /*\n * if not valid signature\n */\n if (!isValid){\n throw new RuntimeException(\"Fermat Packet received has not a valid signature, go to close this connection maybe is compromise\");\n }\n\n }",
"private void eraseKey(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\tswitch (buffer[ISO7816.OFFSET_P2]) {\r\n\t\tcase BASIC:\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid();\r\n\t\t\tbasicKeyPair = null;\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t}",
"public Object resetInputMessage(Object message);",
"public void testDoubleX509SignatureThumb() throws Exception {\n WSSecSignature builder = new WSSecSignature();\n builder.setUserInfo(\"16c73ab6-b892-458f-abf5-2f875f74882e\", \"security\");\n // builder.setUserInfo(\"john\", \"keypass\");\n builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER); \n Document doc = unsignedEnvelope.getAsDocument();\n \n WSSecHeader secHeader = new WSSecHeader();\n secHeader.insertSecurityHeader(doc);\n\n Document signedDoc = builder.build(doc, crypto, secHeader);\n Document signedDoc1 = builder.build(signedDoc, crypto, secHeader);\n verify(signedDoc1);\n }",
"private void internalAuthenticate(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif ((buffer[ISO7816.OFFSET_P1] != ALG_SHA1_PKCS1) || buffer[ISO7816.OFFSET_P2] != BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\t// we do not support Lc=0x97, only Lc=0x16\r\n\t\tif ((lc == 0x97) || (byteRead == 0x97))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tif ((lc != 0x16) || (byteRead != 0x16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// the first data byte must be \"94\" and the second byte is the length\r\n\t\t// (20 bytes)\r\n\t\tif ((buffer[ISO7816.OFFSET_CDATA] != (byte) 0x94) || (buffer[ISO7816.OFFSET_CDATA + 1] != (byte) 0x14))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// use the basic private key\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\r\n\t\tif (basicKeyPair == null)\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\r\n\t\t//VF: bovenstaande is mogelijk bug in programma!\r\n\t\tcipher.init(basicKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_SHA1_PKCS1, lc);\r\n\t\t// copy the challenge (SHA1 hash) from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA + 2), messageBuffer, (short) 108, (short) 20);\r\n\t\t// generate signature\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t// if T=0, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t// in case T=1 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t\t// decrement internal authenticate counter\r\n\t\t//internalAuthenticateCounter--;\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}",
"@Test\n @SuppressWarnings({\"ResultOfMethodCallIgnored\", \"deprecation\"})\n public void passphrasesNotCompatibleWithOldAPI() throws SecureCellException {\n SecureCell cellOld = new SecureCell(\"day 56 of the Q\", SecureCell.MODE_SEAL);\n SecureCell.Seal cellNew = SecureCell.SealWithPassphrase(\"day 56 of the Q\", StandardCharsets.UTF_16);\n byte[] message = \"All your base are belong to us!\".getBytes(StandardCharsets.UTF_8);\n\n byte[] encryptedOld = cellOld.protect(\"\", message).getProtectedData();\n byte[] encryptedNew = cellNew.encrypt(message);\n\n try {\n cellNew.decrypt(encryptedOld);\n fail(\"expected SecureCellException\");\n }\n catch (SecureCellException ignored) {}\n try {\n cellOld.unprotect(\"\", new SecureCellData(encryptedNew, null));\n fail(\"expected SecureCellException\");\n }\n catch (SecureCellException ignored) {}\n }",
"private static byte[] generate(final byte[] buffer, final PrivateKey key) {\r\n\r\n\t\tbyte[] data = null;\r\n\r\n\t\ttry {\r\n\t\t\tfinal X509EncodedKeySpec spec = new X509EncodedKeySpec(buffer);\r\n\t\t\tfinal KeyFactory kf = getKeyFactory();\r\n\t\t\tfinal PublicKey pk = kf.generatePublic(spec);\r\n\t\t\tdata = SharedSecret.doKeyExchange(key, pk);\r\n\t\t} catch (Exception e) {\r\n\t\t\tfinal String msg = Utils.toMessage(e);\r\n\t\t\tLOG.error(msg);\r\n\t\t\tLOG.debug(msg, e);\r\n\t\t\tdata = new byte[0];\r\n\t\t}\r\n\r\n\t\treturn data;\r\n\t}",
"@Override\n\tpublic Packet generateInitialReplyPacket(Packet p) {\n\t\tPacket pkt=super.generateInitialReplyPacket(p);\n\t\t pkt=sm.sign(pkt);\n\t return pkt;\n\t}",
"short generateKeyAndWrap(byte[] applicationParameter, short applicationParameterOffset, byte[] publicKey, short publicKeyOffset, byte[] keyHandle, short keyHandleOffset, byte info);",
"void mo80453a(Message message);",
"private String encryptMessage(String message) {\n int MESSAGE_LENGTH = message.length();\n //TODO: throw SizeTooBigException for message requirements\n if(MESSAGE_LENGTH > 1300){\n\n throw new SizeTooBigException();\n }\n\n final int length = message.length();\n String encryptedMessage = \"\";\n for (int i = 0; i < length; i++) {\n //TODO: throw InvalidCharacterException for message requirements\n int m = message.charAt(i);\n int k = this.kissKey.keyAt(i) - 'a';\n int value = m ^ k;\n encryptedMessage += (char) value;\n }\n return encryptedMessage;\n }",
"private static void SendToAuctioneer(BigInteger msg) {\r\n\t\tmsg=auctioneer_pk.encrypt(msg)[0];\r\n\t\tsendToClient(auctioneer,msg);\r\n\t}",
"public static void SM2Sign_fixed(String digest_str, String dA_str, String k_str){\n\n BigInteger digest = new BigInteger(digest_str,16);\n BigInteger dA = new BigInteger(dA_str,16);\n BigInteger k = new BigInteger(k_str,16);\n outer:\n for (;true;) {\n\n //BigInteger k = new BigInteger(256, random);\n //BigInteger k =new BigInteger(\"6CB28D99385C175C94F94E934817663FC176D925DD72B727260DBAAE1FB2F96F\",16);\n ECPoint Q = basePoint.multiply(k).normalize();\n if (debug) {\n System.out.println(\"kG x = \" + Q.getAffineXCoord().toBigInteger().toString(16).toUpperCase());\n System.out.println(\"kG y = \" + Q.getAffineYCoord().toBigInteger().toString(16).toUpperCase());\n }\n BigInteger r = digest.add(Q.getAffineXCoord().toBigInteger()).mod(n);\n if (r.signum() == 0 | r.add(k).equals(n)) {\n\n continue outer;\n }\n\n BigInteger Inv;\n Inv = dA.add(one).modInverse(n);\n if (debug) {\n System.out.println(\"Inv = \" + Inv.toString(16).toUpperCase());\n }\n BigInteger s = Inv.multiply(k.subtract(r.multiply(dA))).mod(n);\n if (s.signum()==0) continue outer;\n else {\n if(debug) {\n System.out.println(\"r = \" + r.toString(16).toUpperCase());\n System.out.println(\"s = \" + s.toString(16).toUpperCase());\n }\n Sign_r = r;\n Sign_s = s;\n Sign_r_str = r.toString(16).toUpperCase();\n Sign_s_str = s.toString(16).toUpperCase();\n return;\n }\n }\n\n }",
"@Test\n public void unencryptTransactionFromEarlyVersionUsingRecipient() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientKey(recipientKey)\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey recipientPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(recipientKey)).thenReturn(recipientPrivateKey);\n when(keyManager.getPublicKeys()).thenReturn(Set.of(senderKey, recipientKey));\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(senderKey, recipientPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, recipientKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(senderKey, recipientPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(recipientKey);\n verify(keyManager).getPublicKeys();\n }",
"public void process(RSAMessage msg) throws IOException {\n relay(msg);\n }",
"public String Crypt(String s);",
"void mo33731Pw();",
"@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n int actKey = key % 65536;\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n decMsg[ind] = (char) ((letter - actKey < 0) ? letter - actKey + 65536 : letter - actKey);\n }\n return new String(decMsg);\n }\n }",
"String getUniqueSignature();",
"com.google.protobuf.ByteString getSignature();",
"public byte[] decrypt(byte[] message, PrivateKey key) throws GeneralSecurityException {\n ByteBuffer buffer = ByteBuffer.wrap(message);\n int keyLength = buffer.getInt();\n byte[] encyptedPublicKey = new byte[keyLength];\n buffer.get(encyptedPublicKey);\n\n Cipher cipher = Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.DECRYPT_MODE, key);\n\n byte[] encodedPublicKey = cipher.doFinal(encyptedPublicKey);\n\n aes.setKeyValue(new String(encodedPublicKey));\n byte[] encryptedMessage = new byte[buffer.remaining()];\n buffer.get(encryptedMessage);\n String decrypt_message = \"\";\n try {\n decrypt_message = aes.decrypt(new String(encryptedMessage));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return decrypt_message.getBytes();\n }",
"private void processSecureMessage(APDU apdu) {\r\n\t\t// unwrapping message, if no secure messaging specified in CLA of apdu,\r\n\t\t// exception is thrown\r\n\t\tif (!apdu.isSecureMessagingCLA())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tmSecureChannel.unwrap(apdu.getBuffer(), apdu.getOffsetCdata(),\r\n\t\t\t\tapdu.getIncomingLength());\r\n\t}",
"private static BigInteger[] getPublicKeyOriginal(BigInteger in) \r\n{\r\n\tECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec(\"secp256k1\"); \r\n\tbyte[] pubKey = spec.getG().multiply(in).getEncoded(false);\r\n\tbyte[] a = new byte[32];\r\n\tbyte[] b = new byte[32];\r\n\tSystem.arraycopy(pubKey, 1, a, 0, 32);\r\n\tSystem.arraycopy(pubKey, 33, b, 0, 32);\r\n\tBigInteger[] erg = new BigInteger[2];\r\n\terg[0] = new BigInteger(1,a);\r\n\terg[1] = new BigInteger(1,b);\r\n\treturn erg;\r\n}",
"public HCRYPTMSG(Pointer p) {\n/* 1131 */ super(p);\n/* */ }",
"java.lang.String getSignatureText();",
"public doEncryptNotifdeEncode() {\n\t}",
"private String signature() {\n\t\t++this.nonce;\n\t\tString message = new String(this.nonce + this.username + this.apiKey);\n\t\tMac hmac = null;\n\n\t\ttry {\n\t\t\thmac = Mac.getInstance(\"HmacSHA256\");\n\t\t\tSecretKeySpec secret_key = new SecretKeySpec(\n\t\t\t\t\t((String) this.apiSecret).getBytes(\"UTF-8\"), \"HmacSHA256\");\n\t\t\thmac.init(secret_key);\n\t\t} catch (NoSuchAlgorithmException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (InvalidKeyException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn String.format(\"%X\",\n\t\t\t\tnew BigInteger(1, hmac.doFinal(message.getBytes())));\n\t}",
"public CryptObject reencrypt(Ciphertext ciphertext);",
"public void testEncryptionSHA1SymmetricBytesHandler() throws Exception {\n final WSSConfig cfg = WSSConfig.getNewInstance();\n final RequestData reqData = new RequestData();\n reqData.setWssConfig(cfg);\n java.util.Map messageContext = new java.util.TreeMap();\n messageContext.put(WSHandlerConstants.ENC_SYM_ENC_KEY, \"false\");\n messageContext.put(WSHandlerConstants.ENC_KEY_ID, \"EncryptedKeySHA1\");\n messageContext.put(WSHandlerConstants.PW_CALLBACK_REF, this);\n reqData.setMsgContext(messageContext);\n reqData.setUsername(\"\");\n \n final java.util.Vector actions = new java.util.Vector();\n actions.add(new Integer(WSConstants.ENCR));\n \n Document doc = unsignedEnvelope.getAsDocument();\n MyHandler handler = new MyHandler();\n handler.send(\n WSConstants.ENCR, \n doc, \n reqData, \n actions,\n true\n );\n \n String outputString = \n org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);\n if (LOG.isDebugEnabled()) {\n LOG.debug(outputString);\n }\n \n verify(doc);\n }",
"@Test\n @SuppressWarnings(\"ResultOfMethodCallIgnored\")\n public void passphraseIsNotSymmetricKey() {\n SymmetricKey secret = new SymmetricKey();\n SecureCell.Seal cellMK = SecureCell.SealWithKey(secret);\n SecureCell.Seal cellPW = SecureCell.SealWithPassphrase(secret.toByteArray());\n byte[] message = \"All your base are belong to us!\".getBytes(StandardCharsets.UTF_8);\n\n byte[] encryptedMK = cellMK.encrypt(message);\n byte[] encryptedPW = cellPW.encrypt(message);\n\n try {\n cellPW.decrypt(encryptedMK);\n fail(\"expected SecureCellException\");\n }\n catch (SecureCellException ignored) {}\n try {\n cellMK.decrypt(encryptedPW);\n fail(\"expected SecureCellException\");\n }\n catch (SecureCellException ignored) {}\n }",
"private void keyDiffieHellmanFinal(BigInteger B) {\r\n\t\tdiffie.setKey(diffie.generate(diffie.geta(), B, diffie.getp()));\r\n\t\tpresentkey = true;\r\n\t}",
"public pam_message(Pointer src) {\n useMemory(src);\n read();\n }",
"public String cipher() {\n int[] r1taps = {13, 16, 17, 18};\n int[] r2taps = {20, 21};\n int[] r3taps = {7, 20, 21, 22};\n\n // Set register size and majority bits\n final int R1 = 19;\n final int R1M = 8;\n final int R2 = 22;\n final int R2M = 10;\n final int R3 = 23;\n final int R3M = 10;\n\n // Initialize variables\n String bs = \"\";\n byte[] key = HexStringToBytes(symKey);\n BitSet keySet = new BitSet();\n BitSet keyStream = new BitSet();\n BitSet messageSet = new BitSet();\n\n // Create a byte array length of sample message\n byte[] messageArray = new byte[message.length()];\n\n // Convert the sample message to a byte array\n try {\n messageArray = message.getBytes(\"ISO-8859-1\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n\n // Convert message sample byte array to string\n String as = \"\";\n for (int i = 0; i < messageArray.length; i++) {\n byte b1 = messageArray[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n as += s;\n }\n\n // Convert string of bits to a BitSet\n messageSet = BitStringToBitSet(as);\n\n // Creates string from key byte array\n for (int i = 0; i < 8; i++) {\n byte b1 = key[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n bs += s;\n }\n\n // Convert string of bits to a BitSet\n keySet = BitStringToBitSet(bs);\n\n // Initialize registers\n BitSet r1 = new BitSet();\n BitSet r2 = new BitSet();\n BitSet r3 = new BitSet();\n\n // Process key into registers\n for (int i = 0; i < 64; i++) {\n r1 = ShiftSet(r1, R1, keySet.get(i) ^ Tap(r1, r1taps));\n r2 = ShiftSet(r2, R2, keySet.get(i) ^ Tap(r2, r2taps));\n r3 = ShiftSet(r3, R3, keySet.get(i) ^ Tap(r3, r3taps));\n }\n\n // Clock additional 100 times for additional security (GSM standard)\n for (int i = 0; i < 100; i++) {\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n }\n\n // Create keystream as long as the sample message\n for (int i = 0; i < message.length() * 8; i++) {\n\n // Get keystream bit\n keyStream.set(i, r1.get(R1 - 1) ^ r2.get(R2 - 1) ^ r3.get(R3 - 1));\n\n // Shift majority registers\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n\n }\n\n // XOR the message with the created keystream and return as string\n messageSet.xor(keyStream);\n return BitStringToText(ReturnSet(messageSet, message.length() * 8));\n }",
"public static void main(String[] args) throws ClassNotFoundException, BadPaddingException, IllegalBlockSizeException,\n IOException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {\n KeyPairGenerator kpg = KeyPairGenerator.getInstance(\"RSA\");\n // Generate the keys — might take sometime on slow computers\n KeyPair myPair = kpg.generateKeyPair();\n\n /*\n * This will give you a KeyPair object, which holds two keys: a private\n * and a public. In order to make use of these keys, you will need to\n * create a Cipher object, which will be used in combination with\n * SealedObject to encrypt the data that you are going to end over the\n * network. Here’s how you do that:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher c = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Encrypt, giving it the public key\n c.init(Cipher.ENCRYPT_MODE, myPair.getPublic());\n\n /*\n * After initializing the Cipher, we’re ready to encrypt the data.\n * Since after encryption the resulting data will not make much sense if\n * you see them “naked”, we have to encapsulate them in another\n * Object. Java provides this, by the SealedObject class. SealedObjects\n * are containers for encrypted objects, which encrypt and decrypt their\n * contents with the help of a Cipher object.\n *\n * The following example shows how to create and encrypt the contents of\n * a SealedObject:\n */\n\n // Create a secret message\n String myMessage = new String(\"Secret Message\");\n // Encrypt that message using a new SealedObject and the Cipher we created before\n SealedObject myEncryptedMessage= new SealedObject( myMessage, c);\n\n /*\n * The resulting object can be sent over the network without fear, since\n * it is encrypted. The only one who can decrypt and get the data, is the\n * one who holds the private key. Normally, this should be the server. In\n * order to decrypt the message, we’ll need to re-initialize the Cipher\n * object, but this time with a different mode, decrypt, and use the\n * private key instead of the public key.\n *\n * This is how you do this in Java:\n */\n\n // Get an instance of the Cipher for RSA encryption/decryption\n Cipher dec = Cipher.getInstance(\"RSA\");\n // Initiate the Cipher, telling it that it is going to Decrypt, giving it the private key\n dec.init(Cipher.DECRYPT_MODE, myPair.getPrivate());\n\n /*\n * Now that the Cipher is ready to decrypt, we must tell the SealedObject\n * to decrypt the held data.\n */\n\n // Tell the SealedObject we created before to decrypt the data and return it\n String message = (String) myEncryptedMessage.getObject(dec);\n System.out.println(\"foo = \"+message);\n\n /*\n * Beware when using the getObject method, since it returns an instance\n * of an Object (even if it is actually an instance of String), and not\n * an instance of the Class that it was before encryption, so you’ll\n * have to cast it to its prior form.\n *\n * The above is from: http:andreas.louca.org/2008/03/20/java-rsa-\n * encryption-an-example/\n *\n * [msj121] [so/q/13500368] [cc by-sa 3.0]\n */\n }",
"void keySequenceSoftFailure();",
"public static native String getSignature(long[] msgArgs);",
"@Test\n public void unencryptTransactionFromEarlyVersionUsingSender() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientKey(recipientKey)\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey senderPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(senderKey)).thenReturn(senderPrivateKey);\n when(keyManager.getPublicKeys()).thenReturn(Set.of(senderKey));\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(recipientKey, senderPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, senderKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(recipientKey, senderPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(senderKey);\n verify(keyManager).getPublicKeys();\n }",
"private byte[] handleUpdate(byte[] message) {\n\t\tbyte[] newSecretBytes = Arrays.copyOfRange(message, \"update:\".getBytes().length, message.length);\n\n/*\n\t\tSystem.out.println(\"THIS IS A TEST:\");\n\t\tSystem.out.println(\"newSecretBytes:\");\n\t\tComMethods.charByChar(newSecretBytes, true);\n\t\tSystem.out.println(\"newSecretBytes, reversed:\");\n\t\tString toStr = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tbyte[] fromStr = DatatypeConverter.parseBase64Binary(toStr);\n\t\tComMethods.charByChar(fromStr, true);\n*/\n\t\tString newSecret = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tboolean success = replaceSecretWith(currentUser, newSecret);\n\t\t\n\t\tif (success) {\n\t\t\tComMethods.report(\"SecretServer has replaced \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"secretupdated\".getBytes());\n\t\t} else {\n\t\t\tComMethods.report(\"SecretServer has FAILED to replace \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"writingfailure\".getBytes());\n\t\t}\n\t}",
"@Test\n public void unencryptTransactionWeSentUsingUnknownKey() {\n final PublicKey nonRecipientKey = PublicKey.from(\"unknown\".getBytes());\n\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final RecipientBox senderBox = RecipientBox.from(\"senderBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBoxes(List.of(senderBox.getData(), recipientBox.getData()))\n .withRecipientKeys(List.of(senderKey, recipientKey))\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final Throwable throwable =\n catchThrowable(() -> enclave.unencryptTransaction(payload, nonRecipientKey));\n\n assertThat(throwable)\n .isInstanceOf(EnclaveException.class)\n .hasMessage(\"recipient not found in listed keys\");\n }",
"@Override\n public Message converseMessage(final Message message) {\n //Preconditions\n assert message != null : \"message must not be null\";\n\n // handle operations\n return Message.notUnderstoodMessage(\n message, // receivedMessage\n this); // skill\n }",
"@Test\n public void unencryptPSVTransactionWithUnknownKey() {\n final PublicKey nonRecipientKey = PublicKey.from(\"unknown\".getBytes());\n\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"RecipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientNonce(recipientNonce)\n .withRecipientKeys(List.of(recipientKey, senderKey))\n .withPrivacyMode(PrivacyMode.PRIVATE_STATE_VALIDATION)\n .withExecHash(\"EXEC_HASH\".getBytes())\n .build();\n\n final Throwable throwable =\n catchThrowable(() -> enclave.unencryptTransaction(payload, nonRecipientKey));\n\n assertThat(throwable)\n .isInstanceOf(EnclaveException.class)\n .hasMessage(\"recipient not found in listed keys\");\n }",
"public static void main(String[] args) {\n\t\t\n\t\tString recievedMessage = \"Krw\\\"a\\\"lknwgw\\\"kz\\\"Erwjw\\\"zk\\\"Opabwj.\\\"vw\\\"zw\\\"oa\\\"lnkrane\\\"gkiqjegwyefwpw\\\"zwhe\\\"bqjgyekjenw\\\"\\\"\\\"\\\"\\\"\\\"\\\"\";\n\t\tBlockChiper bc = new BlockChiper(recievedMessage,0);\n\t\tSystem.out.println(bc.decrypt(224709026));\n\t\t\n\t\tString replyMessage = \"ej zdravo ivana, se e okej funkcionira gi dobivam porakite, sto znaci deka uspeshno sme go vospostavile dhke protokolot. pozdrav se gledame\";\n\t\tBlockChiper bc1 = new BlockChiper(replyMessage,0);\n\t\tSystem.out.println(bc1.encrypt(224709026));\n\t\t\n\t\t\n\t\t\n\t}",
"private byte[] handleAuthPt1(byte[] payload) {\n\t\tboolean userIdentified = false;\n\t\tbyte[] supposedUser = null;\n\n//\n\t\tSystem.out.println(\"payload received by SecretServer:\");\n\t\tComMethods.charByChar(payload,true);\n//\n\n\t\tuserNum = -1;\n\t\twhile (userNum < validUsers.length-1 && !userIdentified) {\n\t\t\tuserNum++;\n\t\t\tsupposedUser = validUsers[userNum].getBytes();\n\t\t\tuserIdentified = Arrays.equals(Arrays.copyOf(payload, supposedUser.length), supposedUser);\n\n//\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\\"\"+validUsers[userNum]+\"\\\" in bytes:\");\n\t\t\tComMethods.charByChar(validUsers[userNum].getBytes(),true);\n\t\t\tSystem.out.println(\"\\\"Arrays.copyOf(payload, supposedUser.length\\\" in bytes:\");\n\t\t\tComMethods.charByChar(Arrays.copyOf(payload, supposedUser.length),true);\n\t\t\tSystem.out.println();\n//\n\t\t}\n\n\t\tif (!userIdentified) {\n\t\t\tComMethods.report(\"SecretServer doesn't recognize name of valid user.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Process second half of message, and verify format\n\t\t\tbyte[] secondHalf = Arrays.copyOfRange(payload, supposedUser.length, payload.length);\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tsecondHalf = ComMethods.decryptRSA(secondHalf, my_n, my_d);\n\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tComMethods.report(\"SecretServer has decrypted the second half of the User's message using SecretServer's private RSA key.\", simMode);\n\n\t\t\tif (!Arrays.equals(Arrays.copyOf(secondHalf, supposedUser.length), supposedUser)) {\n\t\t\t\t// i.e. plaintext name doesn't match the encrypted bit\n\t\t\t\tComMethods.report(\"ERROR ~ invalid first message in protocol.\", simMode);\t\t\t\t\n\t\t\t\treturn \"error\".getBytes();\n\t\t\t} else {\n\t\t\t\t// confirmed: supposedUser is legit. user\n\t\t\t\tcurrentUser = new String(supposedUser); \n\t\t\t\tuserSet = true;\n\t\t\t\tbyte[] nonce_user = Arrays.copyOfRange(secondHalf, supposedUser.length, secondHalf.length);\n\n\t\t\t\t// Second Message: B->A: E_kA(nonce_A || Bob || nonce_B)\n\t\t\t\tmyNonce = ComMethods.genNonce();\n\t\t\t\tComMethods.report(\"SecretServer has randomly generated a 128-bit nonce_srvr = \"+myNonce+\".\", simMode);\n\t\t\t\n\t\t\t\tbyte[] response = ComMethods.concatByteArrs(nonce_user, \"SecretServer\".getBytes(), myNonce);\n\t\t\t\tbyte[] responsePayload = ComMethods.encryptRSA(response, usersPubKeys1[userNum], BigInteger.valueOf(usersPubKeys2[userNum]));\n\t\t\t\treturn responsePayload;\n\t\t\t}\n\t\t}\n\t}",
"public String proposer(int x) {\n boolean problem;\n getcodeSecret().afficherMessageTrouverCodeSecret(x);\n do {\n setRep2(sc.nextLine());\n problem = getJoueur().verificationFormatCodeSecret(getRep2(), x);\n } while (problem);\n return getRep2();\n }",
"public Penazenka(byte[] bArray, short bOffset, byte bLength) {\n arr = new byte [(short) 20];\n length_arr = 0; \n \n // instance AID \n short ilen = bArray[bOffset];\n bOffset += ilen + 1;\n \n // control info \n short clen = bArray[bOffset];\n bOffset += clen + 1;\n \n // applet data \n short alen = bArray[bOffset];\n \n if (alen > (short) 4) ISOException.throwIt( ISO7816.SW_WRONG_LENGTH );\n \n // The installation parameters contain the PIN - initialization\n pin = new OwnerPIN(PIN_TRY_LIMIT, MAX_PIN_SIZE);\n pin.update(bArray, (short) (bOffset + 1), (byte) alen);\n \n hash = JCSystem.makeTransientByteArray( MessageDigest.LENGTH_SHA, JCSystem.CLEAR_ON_RESET );\n md = MessageDigest.getInstance( MessageDigest.ALG_SHA, false);\n \n card_PrivateKey = (RSAPrivateKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PRIVATE, KeyBuilder.LENGTH_RSA_512, false);\n card_PublicKey = (RSAPublicKey) KeyBuilder.buildKey(KeyBuilder.TYPE_RSA_PUBLIC, KeyBuilder.LENGTH_RSA_512, true);\n \n card_PrivateKey.setExponent(RSA_PRIVATE_KEY_EXPONENT,(short)0,(short)RSA_PRIVATE_KEY_EXPONENT.length);\n card_PrivateKey.setModulus(RSA_KEY_MODULUS,(short)0,(short)RSA_KEY_MODULUS.length);\n \n card_PublicKey.setExponent(RSA_PUBLIC_KEY_EXPONENT,(short)0,(short)RSA_PUBLIC_KEY_EXPONENT.length);\n card_PublicKey.setModulus(RSA_KEY_MODULUS,(short)0,(short)RSA_KEY_MODULUS.length);\n \n card_KeyPair = new KeyPair(KeyPair.ALG_RSA, card_PublicKey.getSize());\n tmpMessage = JCSystem.makeTransientByteArray((short)(128),JCSystem.CLEAR_ON_DESELECT);\n \n signature = Signature.getInstance(Signature.ALG_RSA_SHA_PKCS1 ,false);\n \n register();\n }",
"private void clearSignature() {\n bitField0_ = (bitField0_ & ~0x00000010);\n signature_ = getDefaultInstance().getSignature();\n }",
"private static byte[] receiveBobPublicKeyAndSendAliceDigest(byte[] encodedPublicKeyBob)\r\n\t\t\tthrows NoSuchAlgorithmException, InvalidKeyException, IllegalStateException, InvalidKeySpecException,\r\n\t\t\tInvalidAlgorithmParameterException {\r\n\r\n\t\tfinal byte[] encodedPrivateKey = keyPairAlice.getPrivate().getEncoded();\r\n\t\tfinal byte[] sharedSecret = computeSharedSecret(encodedPrivateKey, encodedPublicKeyBob);\r\n\t\tfinal byte[] digestBytes = MessageDigest.getInstance(\"SHA-256\").digest(sharedSecret);\r\n\r\n\t\tSystem.out.printf(\"Alice shared secret length[%d], message digest length[%d]%n\", sharedSecret.length,\r\n\t\t\t\tdigestBytes.length);\r\n\t\treturn digestBytes;\r\n\t}",
"private void getPublicKey(APDU apdu) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, ?theBuffer) &*& array_slice(theBuffer, 0, theBuffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, theBuffer) &*& array_slice(theBuffer, 0, theBuffer.length, _);\r\n\t{\r\n\t\t\r\n\t\t\r\n\t\tbyte[] buffer = apdu.getBuffer();\r\n\t\t// if this is thrown: problem accesses getPreviousapdu\r\n\t\t// check P1\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// inform the JCRE that the applet has data to return\r\n\t\tshort le = apdu.setOutgoing();\r\n\t\t// Le = 0 is not allowed\r\n\t\tif (le != (short) (5 + 8 + 128))\r\n\t\t\tISOException.throwIt((short) (SW_WRONG_LENGTH_00 + (5 + 8 + 128)));\r\n\t\tbyte[] tempBuffer = new byte[le];\r\n\t\ttempBuffer[(short) 0] = (byte) 0x02;\r\n\t\ttempBuffer[(short) 1] = (byte) 0x08;\r\n\t\ttempBuffer[(short) 10] = (byte) 0x03;\r\n\t\ttempBuffer[(short) 11] = (byte) 0x81;\r\n\t\ttempBuffer[(short) 12] = (byte) 0x80;\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tif (buffer[ISO7816.OFFSET_P2] == AUTHENTICATION){\r\n\t\t\tif (getPreviousApduType() != GENERATE_KEY_PAIR) {\r\n\t\t\t\tauthKeyPair.getPublic().clearKey();\r\n\t\t\t ////@ close [1/2]valid(); // auto\r\n\t\t\t\tJCSystem.beginTransaction();\r\n\t\t\t ////@ open valid(); // auto\r\n\t\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\t ////@ close valid(); // auto\r\n\t\t\t\tJCSystem.commitTransaction();\r\n\t\t\t ////@ open [1/2]valid(); // auto\r\n\t\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t\t}\r\n\t\t\t((RSAPublicKey) authKeyPair.getPublic()).getExponent(tempBuffer, (short) 7);\r\n\t\t\t((RSAPublicKey) authKeyPair.getPublic()).getModulus(tempBuffer, (short) 13);\r\n\t\t}else if (buffer[ISO7816.OFFSET_P2] == NON_REPUDIATION) { \r\n\t\t\tif (getPreviousApduType() != GENERATE_KEY_PAIR) {\r\n\t\t\t\tnonRepKeyPair.getPublic().clearKey();\r\n\t\t\t ////@ close [1/2]valid(); // auto\r\n\t\t\t\tJCSystem.beginTransaction();\r\n\t\t\t ////@ open valid(); // auto\r\n\t\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\t\t////@ close valid(); // auto\r\n\t\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t\t}\t\t\t\r\n\t\t\t((RSAPublicKey) nonRepKeyPair.getPublic()).getExponent(tempBuffer, (short) 7);\r\n\t\t\t((RSAPublicKey) nonRepKeyPair.getPublic()).getModulus(tempBuffer, (short) 13);\r\n\t\t}else if (buffer[ISO7816.OFFSET_P2] == BASIC) {\t\t\r\n\t\t\tif (basicKeyPair == null)\r\n\t\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\t((RSAPublicKey) basicKeyPair.getPublic()).getExponent(tempBuffer, (short) 7);\r\n\t\t\t((RSAPublicKey) basicKeyPair.getPublic()).getModulus(tempBuffer, (short) 13);\r\n\t\t} else {\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t}\r\n\t ////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t ////@ open valid(); // auto\r\n\t\tsetPreviousApduType(OTHER);\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tauthKeyPair.getPublic().clearKey();\r\n\t\tnonRepKeyPair.getPublic().clearKey();\r\n\t\t// set the actual number of outgoing data bytes\r\n\t\tapdu.setOutgoingLength(le);\r\n\t\t// send content of buffer in apdu\r\n\t\tapdu.sendBytesLong(tempBuffer, (short) 0, le);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}",
"public void setRsaKeyB(int rsakeyB){\n\tthis.rsaKeyB = rsaKeyB;\n }",
"public abstract byte[] getSignature();",
"public CryptObject reencrypt(Ciphertext ciphertext, BigIntegerMod r);",
"public String encrypt(String word){\n\tint modulus = rsaKeyA * rsaKeyB;\n\tint totient = (rsaKeyA - 1)*(rsaKeyB - 1);\n\tpublicE = calculateExponent(totient);\n\tprivateD = 1 + ((int)Math.random()*10)*totient;\n \n\tif(word == null||word.length()==0) throw new IllegalArgumentException();\n\tString result = \"\";\n\tString wordLower = word.toLowerCase();\n\n\tfor(int i=0; i<wordLower.length(); i++){\n\t if(wordLower.charAt(i)<97 || wordLower.charAt(i)>122)\n\t\tthrow new IllegalArgumentException();\n\t int a = (wordLower.charAt(i)-97);\n\t int b = (int)Math.pow(a,publicE);\n\t int k = (b%26)+97;\n\t result += Character.toString((char)k);\n\t}\n\treturn result;\n }",
"PasswordProtection protection();",
"public interface DigestFunction\n{\n\n byte[] digest(String clearToken);\n}",
"boolean isPublicKeyBlackListed(PublicKey publicKey);",
"@Test\n public void unencryptTransactionFromEarlyVersionUsingUnknownRecipient() {\n final PublicKey nonRecipientKey = PublicKey.from(\"unknown\".getBytes());\n\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientKey(recipientKey)\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n when(keyManager.getPublicKeys()).thenReturn(Set.of(senderKey, recipientKey));\n\n final Throwable throwable =\n catchThrowable(() -> enclave.unencryptTransaction(payload, nonRecipientKey));\n\n assertThat(throwable)\n .isInstanceOf(EnclaveException.class)\n .hasMessage(\"recipient not found in listed keys\");\n\n verify(keyManager).getPublicKeys();\n }",
"public String mineSolution(String str) throws NoSuchAlgorithmException {\n String nonce;\n do{\n nonce = str + genString();\n //key = hash(genString());\n } while(!checkHash(hash(nonce)));\n return nonce;\n }"
] | [
"0.6505422",
"0.6256232",
"0.6199029",
"0.61188763",
"0.59917426",
"0.5384003",
"0.53324133",
"0.5326828",
"0.5282375",
"0.51477325",
"0.5110783",
"0.5090601",
"0.5055414",
"0.50231993",
"0.499495",
"0.49582663",
"0.4952869",
"0.49438635",
"0.49379274",
"0.49371308",
"0.49271968",
"0.49203783",
"0.49189427",
"0.48967075",
"0.48936215",
"0.4892292",
"0.48917642",
"0.488399",
"0.48633155",
"0.48140442",
"0.48108312",
"0.4806541",
"0.4803058",
"0.4794058",
"0.47761974",
"0.47736385",
"0.47636628",
"0.4756145",
"0.47500154",
"0.47248602",
"0.47195858",
"0.47194168",
"0.47129378",
"0.47095993",
"0.4674122",
"0.46713984",
"0.4668271",
"0.46646753",
"0.46540657",
"0.4646908",
"0.46356755",
"0.46331754",
"0.46263584",
"0.46258825",
"0.4617194",
"0.46127954",
"0.46047953",
"0.46036208",
"0.46027014",
"0.460095",
"0.4599899",
"0.45981264",
"0.4596721",
"0.459197",
"0.45907122",
"0.4589662",
"0.4588836",
"0.45854315",
"0.45766413",
"0.4570804",
"0.456477",
"0.45549226",
"0.45488375",
"0.45422006",
"0.4540459",
"0.45393404",
"0.45366973",
"0.45331728",
"0.45317078",
"0.45307347",
"0.45307007",
"0.45258114",
"0.4520231",
"0.45179135",
"0.45167503",
"0.45162278",
"0.4514373",
"0.45131013",
"0.4509585",
"0.45085782",
"0.45051184",
"0.45036232",
"0.45000333",
"0.44939712",
"0.44928876",
"0.4489883",
"0.44789928",
"0.44774115",
"0.44769043",
"0.44747"
] | 0.6219824 | 2 |
Function which unblind a message in the case of RSA blind signature | public static BigInteger unblind(BigInteger signature, BigInteger N, BigInteger r) {
BigInteger rInverse = r.modInverse(N);
return signature.multiply(rInverse).mod(N);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static BigInteger blindSign(BigInteger message, RSAPrivateKey key) {\n\t\tBigInteger d = key.getPrivateExponent();\n\t\tBigInteger N = key.getModulus();\n\n\t\treturn message.modPow(d, N);\t\n\t}",
"public static BigInteger blind(BigInteger message, BigInteger r, RSAPublicKey publicKey) {\n\t\tBigInteger e = publicKey.getPublicExponent();\n\t\tBigInteger N = publicKey.getModulus();\n\n\t\treturn message.multiply(r.modPow(e, N)).mod(N);\n\t}",
"public static boolean blindSignatureVerification(BigInteger message, BigInteger signature, RSAPublicKey key) {\n\t\tBigInteger e = key.getPublicExponent();\n\t\tBigInteger N = key.getModulus();\n\n\t\tBigInteger clearText = signature.modPow(e, N);\n\n\t\treturn clearText.equals(message);\n\t}",
"protected PKIMessage protectPKIMessage(PKIMessage msg, boolean badObjectId, String password, String keyId, int iterations) throws NoSuchAlgorithmException,\n NoSuchProviderException, InvalidKeyException {\n PKIHeader head = msg.getHeader();\n if(keyId != null) {\n \thead.setSenderKID(new DEROctetString(keyId.getBytes()));\n }\n // SHA1\n AlgorithmIdentifier owfAlg = new AlgorithmIdentifier(\"1.3.14.3.2.26\");\n // 567 iterations\n int iterationCount = iterations;\n DERInteger iteration = new DERInteger(iterationCount);\n // HMAC/SHA1\n AlgorithmIdentifier macAlg = new AlgorithmIdentifier(\"1.2.840.113549.2.7\");\n byte[] salt = \"foo123\".getBytes();\n DEROctetString derSalt = new DEROctetString(salt);\n\n // Create the new protected return message\n String objectId = \"1.2.840.113533.7.66.13\";\n if (badObjectId) {\n objectId += \".7\";\n }\n PBMParameter pp = new PBMParameter(derSalt, owfAlg, iteration, macAlg);\n AlgorithmIdentifier pAlg = new AlgorithmIdentifier(new DERObjectIdentifier(objectId), pp);\n head.setProtectionAlg(pAlg);\n PKIBody body = msg.getBody();\n PKIMessage ret = new PKIMessage(head, body);\n\n // Calculate the protection bits\n byte[] raSecret = password.getBytes();\n byte[] basekey = new byte[raSecret.length + salt.length];\n for (int i = 0; i < raSecret.length; i++) {\n basekey[i] = raSecret[i];\n }\n for (int i = 0; i < salt.length; i++) {\n basekey[raSecret.length + i] = salt[i];\n }\n // Construct the base key according to rfc4210, section 5.1.3.1\n MessageDigest dig = MessageDigest.getInstance(owfAlg.getObjectId().getId(), \"BC\");\n for (int i = 0; i < iterationCount; i++) {\n basekey = dig.digest(basekey);\n dig.reset();\n }\n // For HMAC/SHA1 there is another oid, that is not known in BC, but the\n // result is the same so...\n String macOid = macAlg.getObjectId().getId();\n byte[] protectedBytes = ret.getProtectedBytes();\n Mac mac = Mac.getInstance(macOid, \"BC\");\n SecretKey key = new SecretKeySpec(basekey, macOid);\n mac.init(key);\n mac.reset();\n mac.update(protectedBytes, 0, protectedBytes.length);\n byte[] out = mac.doFinal();\n DERBitString bs = new DERBitString(out);\n\n // Finally store the protection bytes in the msg\n ret.setProtection(bs);\n return ret;\n }",
"public abstract String decryptMsg(String msg);",
"private void preparePkcs1ClearText(byte[] clearText, short type, short messageLength) \r\n \t /*@ requires clearText != null &*& array_slice(clearText, 0, clearText.length, _) &*& clearText.length >= 128\r\n\t \t &*& PKCS1_HEADER |-> ?thePKCS1HEADER &*& PKCS1_SHA1_HEADER |-> ?thePKCS1SHA1HEADER &*& PKCS1_MD5_HEADER |-> ?thePKCS1MD5HEADER\r\n\t \t &*& thePKCS1HEADER != null &*& thePKCS1SHA1HEADER != null &*& thePKCS1MD5HEADER != null\r\n\t \t &*& thePKCS1HEADER.length == 1 &*& thePKCS1SHA1HEADER.length == 16 &*& thePKCS1MD5HEADER.length == 19\r\n\t \t &*& array_slice(thePKCS1HEADER, 0, thePKCS1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1SHA1HEADER, 0, thePKCS1SHA1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1MD5HEADER, 0, thePKCS1MD5HEADER.length, _)\r\n\t \t &*& messageBuffer |-> ?theMessageBuffer &*& theMessageBuffer != null \r\n\t \t &*& messageLength >= 0\r\n\t \t &*& type == ALG_SHA1_PKCS1 ? messageLength == 20 || messageLength == 22 : type == ALG_MD5_PKCS1 ? messageLength == 16 : messageLength < 126; @*/\r\n \t /*@ ensures array_slice(clearText, 0, clearText.length, _) &*& PKCS1_HEADER |-> thePKCS1HEADER \r\n \t \t &*& PKCS1_SHA1_HEADER |-> thePKCS1SHA1HEADER &*& PKCS1_MD5_HEADER |-> thePKCS1MD5HEADER\r\n\t \t &*& array_slice(thePKCS1HEADER, 0, thePKCS1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1SHA1HEADER, 0, thePKCS1SHA1HEADER.length, _)\r\n\t \t &*& array_slice(thePKCS1MD5HEADER, 0, thePKCS1MD5HEADER.length, _)\r\n \t \t &*& messageBuffer |-> theMessageBuffer ; @*/\r\n\t{\r\n\t\t// first pad the whole clear text with 0xFF\r\n\t\tUtil.arrayFillNonAtomic(clearText, (short) 0, (short) 128, (byte) 0xff);\r\n\t\t// first 2 bytes should be 0x00 and 0x01\r\n\t\tUtil.arrayFillNonAtomic(clearText, (short) 0, (short) 1, (byte) 0x00);\r\n\t\tUtil.arrayFillNonAtomic(clearText, (short) 1, (short) 1, (byte) 0x01);\r\n\t\t// add the PKCS#1 header at the correct location\r\n\t\tbyte[] header = PKCS1_HEADER;\r\n\t\tif (type == ALG_SHA1_PKCS1)\r\n\t\t\theader = PKCS1_SHA1_HEADER;\r\n\t\tif (type == ALG_MD5_PKCS1)\r\n\t\t\theader = PKCS1_MD5_HEADER;\r\n\t\tUtil.arrayCopy(header, (short) 0, clearText, (short) (128 - messageLength - header.length), (short) header.length);\r\n\t}",
"void decryptMessage(String Password);",
"private static String RSAdecrypt(byte[] signedhash) {\n String ab = new String(signedhash);\n //private keys\n BigInteger e = new BigInteger(\"65537\");\n BigInteger n = new BigInteger(\"2688520255179015026237478731436571621031218154515572968727588377065598663770912513333018006654248650656250913110874836607777966867106290192618336660849980956399732967369976281500270286450313199586861977623503348237855579434471251977653662553\");\n BigInteger m = new BigInteger(ab);\n BigInteger dataHash = m.modPow(e, n);\n String ComputeddataHash = new String(dataHash.toByteArray());\n return ComputeddataHash;\n }",
"public FudgeMsg getNormalizedMessage(final FudgeMsg msg, final String securityUniqueId) {\n final FieldHistoryStore history = new FieldHistoryStore();\n return getNormalizedMessage(msg, securityUniqueId, history);\n }",
"@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n int actKey = key % 65536;\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n decMsg[ind] = (char) ((letter - actKey < 0) ? letter - actKey + 65536 : letter - actKey);\n }\n return new String(decMsg);\n }\n }",
"public static void main(String[] args) {\r\n\r\n String message = \"Hello, I'm Alice!\";\r\n // Alice's private and public key\r\n RSA rsaAlice = new RSA();\r\n rsaAlice.generateKeyPair();\r\n // Bob's private and public key\r\n RSA rsaBob = new RSA();\r\n rsaBob.generateKeyPair();\r\n // encrypted message from Alice to Bob\r\n BigInteger cipher = rsaAlice.encrypt(message, rsaBob.pubKey);\r\n // create digital signature by Alice\r\n BigInteger signature = rsaAlice.createSignature(message);\r\n\r\n // Bob decrypt message and verify signature\r\n String plain = rsaBob.decrypt(cipher, rsaBob.pubKey);\r\n boolean isVerify = rsaBob.verifySignature(plain, signature, rsaAlice.pubKey);\r\n\r\n if( isVerify )\r\n {\r\n System.out.println(\"Plain text : \" + plain);\r\n }\r\n\r\n /**\r\n * Part II. Two-part RSA protocol to receive\r\n * session key, with signature\r\n */\r\n\r\n // A's private and public key\r\n RSA rsaA = new RSA();\r\n rsaA.generateKeyPair();\r\n // B's private and public key\r\n RSA rsaB = new RSA();\r\n rsaB.generateKeyPair();\r\n\r\n BigInteger newSessionKey = new BigInteger(\"123456789123465\", 10);\r\n // create message by A\r\n BigInteger S = newSessionKey.modPow(rsaA.getPrivKeyD(), rsaA.pubKey[1]);\r\n BigInteger k1 = newSessionKey.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n BigInteger S1 = S.modPow(rsaB.pubKey[0], rsaB.pubKey[1]);\r\n\r\n // --------- sending message to B --------- >>>\r\n\r\n // receive message by B and take new session key\r\n BigInteger k = k1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger Sign = S1.modPow(rsaB.getPrivKeyD(), rsaB.pubKey[1]);\r\n BigInteger verifyK = Sign.modPow(rsaA.pubKey[0], rsaA.pubKey[1]);\r\n\r\n if(verifyK.equals(k))\r\n {\r\n System.out.println(\"B receive new session key from A: \" + k.toString());\r\n }\r\n else\r\n {\r\n System.out.println(\"B receive FAKE session key from A: \" + k.toString());\r\n }\r\n\r\n }",
"void uncap();",
"public String decryptMsg(String encryptedMsg) {\n encryptedMsg.toLowerCase(Locale.ROOT);\n\n //replace the things with the properties\n encryptedMsg = encryptedMsg.replace(\"1\", \"a\");\n encryptedMsg = encryptedMsg.replace(\"3\", \"e\");\n encryptedMsg = encryptedMsg.replace(\"5\", \"i\");\n encryptedMsg = encryptedMsg.replace(\"7\", \"o\");\n encryptedMsg = encryptedMsg.replace(\"9\", \"u\");\n\n //return the right value\n return encryptedMsg;\n }",
"private void processSecureMessage(APDU apdu) {\r\n\t\t// unwrapping message, if no secure messaging specified in CLA of apdu,\r\n\t\t// exception is thrown\r\n\t\tif (!apdu.isSecureMessagingCLA())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tmSecureChannel.unwrap(apdu.getBuffer(), apdu.getOffsetCdata(),\r\n\t\t\t\tapdu.getIncomingLength());\r\n\t}",
"private String uncompressLogoutMessage(final String originalMessage) {\n final byte[] binaryMessage = Base64.decodeBase64(originalMessage);\n\n Inflater decompresser = null;\n try {\n // decompress the bytes\n decompresser = new Inflater();\n decompresser.setInput(binaryMessage);\n final byte[] result = new byte[binaryMessage.length * 10];\n\n final int resultLength = decompresser.inflate(result);\n\n // decode the bytes into a String\n return new String(result, 0, resultLength, \"UTF-8\");\n } catch (final Exception e) {\n logger.error(\"Unable to decompress logout message\", e);\n throw new RuntimeException(e);\n } finally {\n if (decompresser != null) {\n decompresser.end();\n }\n }\n }",
"public Object resetInputMessage(Object message);",
"private String preparaMensaje(String mensaje){\n String binario;\n int longitud = 0;\n String bi=\"\";\n longitud = mensaje.length() + 4;\n for( int i = 15; i>=0; i--){\n bi += ( ( ( longitud & ( 1<<i ) ) > 0 ) ? \"1\" : \"0\" ) ;\n }\n return binario = cadenaABinario(\" \") + bi + cadenaABinario(mensaje);\n }",
"public static void validateMessage(ProcessingContext context)\n throws XWSSecurityException {\n \n HarnessUtil.validateContext(context);\n FilterProcessingContext fpContext = new FilterProcessingContext(context);\n fpContext.isInboundMessage(true);\n\n MessagePolicy msgPolicy = (MessagePolicy) fpContext.getSecurityPolicy();\n if ((msgPolicy != null) && (msgPolicy.dumpMessages())) {\n DumpFilter.process(fpContext);\n }\n \n //unconditionally set these since the policy is unknown\n fpContext.setExtraneousProperty(\"EnableWSS11PolicyReceiver\",\"true\");\n List scList = new ArrayList();\n fpContext.setExtraneousProperty(\"receivedSignValues\", scList);\n fpContext.setMode(FilterProcessingContext.WSDL_POLICY);\n\n pProcess(fpContext);\n\n boolean isTrust = fpContext.isTrustMessage();\n //TODO: Venu this is a workaround for PROTOCOL Messages\n //To be removed after resolveOperationPolicy starts returning correct policy for\n //protocol messages.\n if(msgPolicy == null || msgPolicy.size() <= 0){\n PolicyResolver opResolver = \n (PolicyResolver)fpContext.getExtraneousProperty(fpContext.OPERATION_RESOLVER);\n if(opResolver != null && !isTrust)\n msgPolicy = opResolver.resolvePolicy(fpContext);\n }\n //TODO: this is a workaround for PROTOCOL Message\n try {\n if ((msgPolicy == null) ||\n (msgPolicy.size() == 0 && fpContext.getSOAPMessage().getSOAPBody().hasFault())) {\n \n fpContext.getSecurableSoapMessage().deleteSecurityHeader();\n fpContext.getSOAPMessage().saveChanges();\n return;\n }\n }catch (Exception ex) {\n log.log(Level.SEVERE, \"WSS0370.error.deleting.secheader\", ex);\n throw new XWSSecurityException(ex);\n }\n\n // for Policy verfication\n TargetResolver targetResolver = new TargetResolverImpl(context);\n MessagePolicyVerifier mpv = new MessagePolicyVerifier(context, targetResolver); \n /*\n try{\n System.out.println(\"Inferred Security Policy\");\n mpv.printInferredSecurityPolicy(fpContext.getInferredSecurityPolicy());\n } catch(Exception e){\n throw new XWSSecurityException(e);\n }\n System.out.println(\"==================================\");\n \n \n try{\n System.out.println(\"Actual SecurityPolicy\");\n mpv.printInferredSecurityPolicy(msgPolicy);\n } catch(Exception e){\n throw new XWSSecurityException(e);\n }\n */\n\n if(!isTrust){\n mpv.verifyPolicy(fpContext.getInferredSecurityPolicy(), msgPolicy);\n }\n \n\n try {\n fpContext.getSecurableSoapMessage().deleteSecurityHeader();\n fpContext.getSOAPMessage().saveChanges();\n }catch (Exception ex) {\n log.log(Level.SEVERE, \"WSS0370.error.deleting.secheader\", ex);\n throw new XWSSecurityException(ex);\n }\n }",
"void unsetDelegateSuggestedSigner2();",
"public String Decrypt(String Message, int PrimeNo, String EncoderKeyPath) throws IOException\r\n {\r\n Scanner sc = new Scanner(System.in);\r\n Key key1 = new Key();\r\n char[] msg=new char[Message.length()];\r\n int s, x;\r\n System.out.println(\"Enter Your Secret Key To Decode \");\r\n x=sc.nextInt();\r\n int key = key1.Skey(PrimeNo, x, EncoderKeyPath);\r\n char s1;\r\n int len=Message.length();\r\n int res=0;\r\n\tfor(int i=0;i<len;i++)\r\n\t{\r\n res=i%key;\r\n s=Message.charAt(i);\r\n s-=res;\r\n s1= (char) s;\r\n msg[i]=s1;\t\r\n\t}\r\n String msg1 = new String(msg);\r\n return msg1; \r\n }",
"byte unwrap(byte[] keyHandle, short keyHandleOffset, short keyHandleLength, byte[] applicationParameter, short applicationParameterOffset, ECPrivateKey unwrappedPrivateKey);",
"private String decodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 2);\n }",
"private void eraseKey(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x00)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\tswitch (buffer[ISO7816.OFFSET_P2]) {\r\n\t\tcase BASIC:\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid();\r\n\t\t\tbasicKeyPair = null;\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tISOException.throwIt(SW_REFERENCE_DATA_NOT_FOUND);\r\n\t\t\tbreak; //~allow_dead_code\r\n\t\t}\r\n\t}",
"@Test\n public void unencryptTransactionWeSentUsingRecipientKey() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final RecipientBox senderBox = RecipientBox.from(\"senderBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBoxes(List.of(senderBox.getData(), recipientBox.getData()))\n .withRecipientKeys(List.of(senderKey, recipientKey))\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey recipientPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(recipientKey)).thenReturn(recipientPrivateKey);\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(senderKey, recipientPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, recipientKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(senderKey, recipientPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(recipientKey);\n }",
"@Override\n public String decryptMsg(String msg) {\n if (msg.length() == 0) {\n return msg;\n } else {\n char[] decMsg = new char[msg.length()];\n for (int ind = 0; ind < msg.length(); ++ind) {\n char letter = msg.charAt(ind);\n if (letter >= 'a' && letter <= 'z') {\n int temp = letter - 'a' - key;\n decMsg[ind] = (char) ('a' + (char) ((temp < 0) ? temp + 26 : temp));\n } else if (letter >= 'A' && letter <= 'Z') {\n int temp = letter - 'A' - key;\n decMsg[ind] = (char) ('A' + (char) ((temp < 0) ? temp + 26 : temp));\n } else {\n decMsg[ind] = letter;\n }\n }\n return new String(decMsg);\n }\n }",
"public static byte[] extract_message(byte[] hash_message)\n {\n\tbyte[] plaintext = new byte[hash_message.length - HMAC_SHA1_LEN];\n\tSystem.arraycopy(hash_message, 0, plaintext, 0, plaintext.length);\n\n\treturn plaintext;\n }",
"@NoPresubmitTest(\n providers = {ProviderType.BOUNCY_CASTLE},\n bugs = {\"b/253038666\"})\n @Test\n public void testSignVerifyWithParameters() {\n int keySizeInBits = 2048;\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLength = 20;\n KeyPair keypair;\n try {\n RSAKeyGenParameterSpec params =\n getPssAlgorithmParameters(keySizeInBits, sha, mgf, sha, saltLength);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSASSA-PSS\");\n keyGen.initialize(params);\n keypair = keyGen.genKeyPair();\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n TestUtil.skipTest(\"Key generation for RSASSA-PSS is not supported.\");\n return;\n }\n byte[] msg = new byte[4];\n RSAPublicKey pub = (RSAPublicKey) keypair.getPublic();\n RSAPrivateKey priv = (RSAPrivateKey) keypair.getPrivate();\n Signature signer;\n Signature verifier;\n try {\n signer = Signature.getInstance(\"RSASSA-PSS\");\n verifier = Signature.getInstance(\"RSASSA-PSS\");\n } catch (NoSuchAlgorithmException ex) {\n fail(\"RSASSA-PSS key generation is supported, but signature generation is not\");\n return;\n }\n // Signs the message. This part of the code constructs the PSS parameters\n // explicitely.\n try {\n signer.initSign(priv);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own private key\");\n return;\n }\n try {\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLength, 1);\n signer.setParameter(params);\n } catch (NoSuchAlgorithmException | InvalidAlgorithmParameterException ex) {\n fail(\"Parameters accepted as key generation parameters are rejected as algorithm parameters\");\n return;\n }\n byte[] signature;\n try {\n signer.update(msg);\n signature = signer.sign();\n } catch (SignatureException ex) {\n fail(\"Could not sign with RSAPSS-PSS:\" + ex.toString());\n return;\n }\n\n // Verifies the signature. This part of the code tries to copy the PSS parameters\n // from the public key. Ideally, just calling verifier.initVerify(pub) would\n // be sufficient, since the public key contains the parameters. Unfortunately,\n // copying the PSS parameters is necessary for OpenJDK, since OpenJDK does\n // not copy the algorithm parameters.\n // Even worse is BouncyCastle, where it is unclear if there is a simple way\n // to extract the algorithm parameters from the key.\n try {\n verifier.initVerify(pub);\n } catch (InvalidKeyException ex) {\n fail(\"Provider rejects its own public key\");\n return;\n }\n \n try {\n verifier.setParameter(pub.getParams());\n verifier.update(msg);\n boolean verified = verifier.verify(signature);\n assertTrue(\"Signature did not verify\", verified);\n } catch (GeneralSecurityException ex) {\n throw new AssertionError(\"Provider could not verify its own signature\", ex);\n }\n }",
"@Test\n public void unencryptTransactionWeSentUsingSenderKey() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final RecipientBox senderBox = RecipientBox.from(\"senderBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBoxes(List.of(senderBox.getData(), recipientBox.getData()))\n .withRecipientKeys(List.of(senderKey, recipientKey))\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey senderPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(senderKey)).thenReturn(senderPrivateKey);\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(senderKey, senderPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(senderBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, senderKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(senderBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(senderKey, senderPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(senderKey);\n }",
"private String convertPrivateKeytoWIF(byte[] privatekey){\r\n\tbyte[] step1=concateByteArray(new byte[]{(byte) 0x80},privatekey);\r\n\tbyte[] step2to3=SHA256hash(SHA256hash(step1));\r\n\tbyte[] checksum=getCheckSum(step2to3);\r\n\tbyte[] step5=concateByteArray(step1,checksum);\r\n\treturn base58encode(step5);\r\n}",
"void unsetAlgIdExt();",
"void mo23214a(Message message);",
"private byte[] decode(byte[] msg) {\r\n\t\treturn Base64.decode(msg); \r\n\t}",
"void mo80456b(Message message);",
"public byte[] decrypt(byte[] message, PrivateKey key) throws GeneralSecurityException {\n ByteBuffer buffer = ByteBuffer.wrap(message);\n int keyLength = buffer.getInt();\n byte[] encyptedPublicKey = new byte[keyLength];\n buffer.get(encyptedPublicKey);\n\n Cipher cipher = Cipher.getInstance(\"RSA\");\n cipher.init(Cipher.DECRYPT_MODE, key);\n\n byte[] encodedPublicKey = cipher.doFinal(encyptedPublicKey);\n\n aes.setKeyValue(new String(encodedPublicKey));\n byte[] encryptedMessage = new byte[buffer.remaining()];\n buffer.get(encryptedMessage);\n String decrypt_message = \"\";\n try {\n decrypt_message = aes.decrypt(new String(encryptedMessage));\n } catch (Exception e) {\n e.printStackTrace();\n }\n return decrypt_message.getBytes();\n }",
"public String preprocessingDecryptToDisplay(String in);",
"private static AuthorizationInfo digest_fixup(AuthorizationInfo authorizationInfo, RoRequest roRequest, AuthorizationInfo authorizationInfo2, RoResponse roResponse, boolean bl) throws AuthSchemeNotImplException {\n String[] arrstring;\n Object object;\n Object object2;\n String string;\n NVPair[] arrnVPair;\n int n;\n int n2 = -1;\n int n3 = -1;\n int n4 = -1;\n int n5 = -1;\n int n6 = -1;\n int n7 = -1;\n int n8 = -1;\n NVPair[] arrnVPair2 = null;\n if (authorizationInfo2 != null) {\n arrnVPair2 = authorizationInfo2.getParams();\n for (n = 0; n < arrnVPair2.length; ++n) {\n String string2 = arrnVPair2[n].getName().toLowerCase();\n if (string2.equals(\"domain\")) {\n n2 = n;\n continue;\n }\n if (string2.equals(\"nonce\")) {\n n3 = n;\n continue;\n }\n if (string2.equals(\"opaque\")) {\n n5 = n;\n continue;\n }\n if (string2.equals(\"algorithm\")) {\n n4 = n;\n continue;\n }\n if (string2.equals(\"stale\")) {\n n6 = n;\n continue;\n }\n if (string2.equals(\"digest-required\")) {\n n7 = n;\n continue;\n }\n if (!string2.equals(\"qop\")) continue;\n n8 = n;\n }\n }\n n = -1;\n int n9 = -1;\n int n10 = -1;\n int n11 = -1;\n int n12 = -1;\n int n13 = -1;\n int n14 = -1;\n int n15 = -1;\n int n16 = -1;\n int n17 = -1;\n int n18 = -1;\n Object object3 = authorizationInfo;\n synchronized (object3) {\n arrnVPair = authorizationInfo.getParams();\n for (int i = 0; i < arrnVPair.length; ++i) {\n String string3 = arrnVPair[i].getName().toLowerCase();\n if (string3.equals(\"uri\")) {\n n = i;\n continue;\n }\n if (string3.equals(\"username\")) {\n n9 = i;\n continue;\n }\n if (string3.equals(\"algorithm\")) {\n n10 = i;\n continue;\n }\n if (string3.equals(\"nonce\")) {\n n12 = i;\n continue;\n }\n if (string3.equals(\"cnonce\")) {\n n13 = i;\n continue;\n }\n if (string3.equals(\"nc\")) {\n n14 = i;\n continue;\n }\n if (string3.equals(\"response\")) {\n n11 = i;\n continue;\n }\n if (string3.equals(\"opaque\")) {\n n15 = i;\n continue;\n }\n if (string3.equals(\"digest\")) {\n n16 = i;\n continue;\n }\n if (string3.equals(\"digest-required\")) {\n n17 = i;\n continue;\n }\n if (!string3.equals(\"qop\")) continue;\n n18 = i;\n }\n if (n10 != -1 && !arrnVPair[n10].getValue().equalsIgnoreCase(\"MD5\") && !arrnVPair[n10].getValue().equalsIgnoreCase(\"MD5-sess\")) {\n throw new AuthSchemeNotImplException(\"Digest auth scheme: Algorithm \" + arrnVPair[n10].getValue() + \" not implemented\");\n }\n if (n4 != -1 && !arrnVPair2[n4].getValue().equalsIgnoreCase(\"MD5\") && !arrnVPair2[n4].getValue().equalsIgnoreCase(\"MD5-sess\")) {\n throw new AuthSchemeNotImplException(\"Digest auth scheme: Algorithm \" + arrnVPair2[n4].getValue() + \" not implemented\");\n }\n arrnVPair[n] = new NVPair(\"uri\", roRequest.getRequestURI());\n string = arrnVPair[n12].getValue();\n if (n3 != -1 && !string.equals(arrnVPair2[n3].getValue())) {\n arrnVPair[n12] = arrnVPair2[n3];\n }\n if (n5 != -1) {\n if (n15 == -1) {\n arrnVPair = Util.resizeArray(arrnVPair, arrnVPair.length + 1);\n n15 = arrnVPair.length - 1;\n }\n arrnVPair[n15] = arrnVPair2[n5];\n }\n if (n4 != -1) {\n if (n10 == -1) {\n arrnVPair = Util.resizeArray(arrnVPair, arrnVPair.length + 1);\n n10 = arrnVPair.length - 1;\n }\n arrnVPair[n10] = arrnVPair2[n4];\n }\n if (n8 != -1 || n4 != -1 && arrnVPair2[n4].getValue().equalsIgnoreCase(\"MD5-sess\")) {\n if (n13 == -1) {\n arrnVPair = Util.resizeArray(arrnVPair, arrnVPair.length + 1);\n n13 = arrnVPair.length - 1;\n }\n if (digest_secret == null) {\n digest_secret = DefaultAuthHandler.gen_random_bytes(20);\n }\n long l = System.currentTimeMillis();\n byte[] arrby = new byte[]{(byte)(l & 0xFFL), (byte)(l >> 8 & 0xFFL), (byte)(l >> 16 & 0xFFL), (byte)(l >> 24 & 0xFFL), (byte)(l >> 32 & 0xFFL), (byte)(l >> 40 & 0xFFL), (byte)(l >> 48 & 0xFFL), (byte)(l >> 56 & 0xFFL)};\n object2 = new MD5(digest_secret);\n ((MD5)object2).Update(arrby);\n arrnVPair[n13] = new NVPair(\"cnonce\", ((MD5)object2).asHex());\n }\n if (n8 != -1) {\n int n19;\n if (n18 == -1) {\n arrnVPair = Util.resizeArray(arrnVPair, arrnVPair.length + 1);\n n18 = arrnVPair.length - 1;\n }\n String[] arrstring2 = Util.splitList(arrnVPair2[n8].getValue(), \",\");\n object = null;\n for (n19 = 0; n19 < arrstring2.length; ++n19) {\n if (arrstring2[n19].equalsIgnoreCase(\"auth-int\") && roRequest.getStream() == null) {\n object = \"auth-int\";\n break;\n }\n if (!arrstring2[n19].equalsIgnoreCase(\"auth\")) continue;\n object = \"auth\";\n }\n if (object == null) {\n for (n19 = 0; n19 < arrstring2.length; ++n19) {\n if (!arrstring2[n19].equalsIgnoreCase(\"auth-int\")) continue;\n throw new AuthSchemeNotImplException(\"Digest auth scheme: Can't comply with qop option 'auth-int' because data not available\");\n }\n throw new AuthSchemeNotImplException(\"Digest auth scheme: None of the available qop options '\" + arrnVPair2[n8].getValue() + \"' implemented\");\n }\n arrnVPair[n18] = new NVPair(\"qop\", (String)object, false);\n }\n if (n18 != -1) {\n if (n14 == -1) {\n arrnVPair = Util.resizeArray(arrnVPair, arrnVPair.length + 1);\n n14 = arrnVPair.length - 1;\n arrnVPair[n14] = new NVPair(\"nc\", \"00000001\", false);\n } else if (string.equals(arrnVPair[n12].getValue())) {\n String string4 = Long.toHexString(Long.parseLong(arrnVPair[n14].getValue(), 16) + 1L);\n arrnVPair[n14] = new NVPair(\"nc\", \"00000000\".substring(string4.length()) + string4, false);\n } else {\n arrnVPair[n14] = new NVPair(\"nc\", \"00000001\", false);\n }\n }\n arrstring = (String[])authorizationInfo.getExtraInfo();\n if (authorizationInfo2 != null && (n6 == -1 || !arrnVPair2[n6].getValue().equalsIgnoreCase(\"true\")) && n10 != -1 && arrnVPair[n10].getValue().equalsIgnoreCase(\"MD5-sess\")) {\n arrstring[1] = new MD5(arrstring[0] + \":\" + arrnVPair[n12].getValue() + \":\" + arrnVPair[n13].getValue()).asHex();\n authorizationInfo.setExtraInfo(arrstring);\n }\n authorizationInfo.setParams(arrnVPair);\n }\n object3 = n10 != -1 && arrnVPair[n10].getValue().equalsIgnoreCase(\"MD5-sess\") ? arrstring[1] : arrstring[0];\n string = roRequest.getMethod() + \":\" + arrnVPair[n].getValue();\n if (n18 != -1 && arrnVPair[n18].getValue().equalsIgnoreCase(\"auth-int\")) {\n object = new MD5();\n ((MD5)object).Update(roRequest.getData() == null ? NUL : roRequest.getData());\n string = string + \":\" + ((MD5)object).asHex();\n }\n string = new MD5(string).asHex();\n String string5 = n18 == -1 ? new MD5((String)object3 + \":\" + arrnVPair[n12].getValue() + \":\" + string).asHex() : new MD5((String)object3 + \":\" + arrnVPair[n12].getValue() + \":\" + arrnVPair[n14].getValue() + \":\" + arrnVPair[n13].getValue() + \":\" + arrnVPair[n18].getValue() + \":\" + string).asHex();\n arrnVPair[n11] = new NVPair(\"response\", string5);\n boolean bl2 = false;\n if (n7 != -1 && (arrnVPair2[n7].getValue() == null || arrnVPair2[n7].getValue().equalsIgnoreCase(\"true\"))) {\n bl2 = true;\n }\n if ((bl2 || n16 != -1) && roRequest.getStream() == null) {\n if (n16 == -1) {\n object2 = Util.resizeArray(arrnVPair, arrnVPair.length + 1);\n n16 = arrnVPair.length;\n } else {\n object2 = arrnVPair;\n }\n object2[n16] = new NVPair(\"digest\", DefaultAuthHandler.calc_digest(roRequest, arrstring[0], arrnVPair[n12].getValue()));\n if (n17 == -1) {\n n17 = ((NVPair[])object2).length;\n object2 = Util.resizeArray((NVPair[])object2, ((Object)object2).length + 1);\n object2[n17] = new NVPair(\"digest-required\", \"true\");\n }\n object = new AuthorizationInfo(authorizationInfo.getHost(), authorizationInfo.getPort(), authorizationInfo.getScheme(), authorizationInfo.getRealm(), (NVPair[])object2, arrstring);\n } else {\n object = bl2 ? null : new AuthorizationInfo(authorizationInfo.getHost(), authorizationInfo.getPort(), authorizationInfo.getScheme(), authorizationInfo.getRealm(), arrnVPair, arrstring);\n }\n if (n2 != -1) {\n object2 = null;\n try {\n object2 = new URI(roRequest.getConnection().getProtocol(), roRequest.getConnection().getHost(), roRequest.getConnection().getPort(), roRequest.getRequestURI());\n }\n catch (ParseException parseException) {\n // empty catch block\n }\n StringTokenizer stringTokenizer = new StringTokenizer(arrnVPair2[n2].getValue());\n while (stringTokenizer.hasMoreTokens()) {\n URI uRI;\n try {\n uRI = new URI((URI)object2, stringTokenizer.nextToken());\n }\n catch (ParseException parseException) {\n continue;\n }\n AuthorizationInfo authorizationInfo3 = AuthorizationInfo.getAuthorization(uRI.getHost(), uRI.getPort(), authorizationInfo.getScheme(), authorizationInfo.getRealm(), roRequest.getConnection().getContext());\n if (authorizationInfo3 == null) {\n arrnVPair[n] = new NVPair(\"uri\", uRI.getPath());\n authorizationInfo3 = new AuthorizationInfo(uRI.getHost(), uRI.getPort(), authorizationInfo.getScheme(), authorizationInfo.getRealm(), arrnVPair, arrstring);\n AuthorizationInfo.addAuthorization(authorizationInfo3);\n }\n if (bl) continue;\n authorizationInfo3.addPath(uRI.getPath());\n }\n } else if (!bl && authorizationInfo2 != null && (object2 = AuthorizationInfo.getAuthorization(authorizationInfo2.getHost(), authorizationInfo2.getPort(), authorizationInfo.getScheme(), authorizationInfo.getRealm(), roRequest.getConnection().getContext())) != null) {\n ((AuthorizationInfo)object2).addPath(\"/\");\n }\n return object;\n }",
"boolean verifySignature(byte[] message, byte[] signature, PublicKey publicKey) throws IOException;",
"public byte[] unwrap(byte[] incoming, int start, int len) throws SaslException {\n if (len == 0) {\n return EMPTY_BYTE_ARRAY;\n }\n byte[] mac = new byte[10];\n byte[] msg = new byte[len - 16];\n byte[] msgType = new byte[2];\n byte[] seqNum = new byte[4];\n System.arraycopy(incoming, start, msg, 0, msg.length);\n System.arraycopy(incoming, start + msg.length, mac, 0, 10);\n System.arraycopy(incoming, start + msg.length + 10, msgType, 0, 2);\n System.arraycopy(incoming, start + msg.length + 12, seqNum, 0, 4);\n byte[] expectedMac = getHMAC(peerKi, seqNum, msg, 0, msg.length);\n if (logger.isLoggable(Level.FINEST)) {\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST18:incoming: \", msg);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST19:MAC: \", mac);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST20:messageType: \", msgType);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST21:sequenceNum: \", seqNum);\n traceOutput(DI_CLASS_NAME, \"unwrap\", \"DIGEST22:expectedMAC: \", expectedMac);\n }\n if (!Arrays.equals(mac, expectedMac)) {\n logger.log(Level.INFO, \"DIGEST23:Unmatched MACs\");\n return EMPTY_BYTE_ARRAY;\n }\n if (peerSeqNum != networkByteOrderToInt(seqNum, 0, 4)) {\n throw new SaslException(\"DIGEST-MD5: Out of order \" + \"sequencing of messages from server. Got: \" + networkByteOrderToInt(seqNum, 0, 4) + \" Expected: \" + peerSeqNum);\n }\n if (!Arrays.equals(messageType, msgType)) {\n throw new SaslException(\"DIGEST-MD5: invalid message type: \" + networkByteOrderToInt(msgType, 0, 2));\n }\n peerSeqNum++;\n return msg;\n }",
"void unsetCapitalPayed();",
"public static byte[] stripOfFraming(final byte[] message)\r\n {\r\n // frame less message \r\n final byte[] framelessMsg = Arrays.copyOfRange(message, FRAME_OFFSET, message.length - FRAME_OFFSET);\r\n\r\n return framelessMsg;\r\n }",
"public String Decrypt(String s);",
"public void decrypt(String s)\n\t{\n\t\tchar chars[] = s.toCharArray();\n\t\tString message = \"\";\n\t\tfor(int i = 0; i < chars.length; i++)\n\t\t{\n\t\t\tif(chars[i] == (char)32)\n\t\t\t{\n\t\t\t\tBigInteger encrypted = new BigInteger(message);\n\t\t\t\tconvertToString(encrypted.modPow(privateKey, publicKey).toString());\n\t\t\t\tmessage = \"\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmessage += chars[i];\n\t\t\t}\n\t\t}\n\t\tmyView.setDecryptText(myDecryptedMessage);\n\t\tmyDecryptedMessage = \"\";\n\t}",
"byte[] generateSignature(byte[] message, PrivateKey privateKey, SecureRandom secureRandom) throws IOException;",
"public static BigInteger generateRForBlindSignature(BigInteger mod) {\n\t\tBigInteger r;\n\t\tdo {\n\t\t\tr = new BigInteger(1024, new SecureRandom());\n\t\t} while(r.gcd(mod) == BigInteger.ONE);\n\n\t\treturn r;\n\t}",
"public doEncryptNotifdeEncode() {\n\t}",
"void unsetDelegateSuggestedSignerEmail();",
"public abstract String encryptMsg(String msg);",
"@Test\n public void unencryptPSVTransactionWithUnknownKey() {\n final PublicKey nonRecipientKey = PublicKey.from(\"unknown\".getBytes());\n\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"RecipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientNonce(recipientNonce)\n .withRecipientKeys(List.of(recipientKey, senderKey))\n .withPrivacyMode(PrivacyMode.PRIVATE_STATE_VALIDATION)\n .withExecHash(\"EXEC_HASH\".getBytes())\n .build();\n\n final Throwable throwable =\n catchThrowable(() -> enclave.unencryptTransaction(payload, nonRecipientKey));\n\n assertThat(throwable)\n .isInstanceOf(EnclaveException.class)\n .hasMessage(\"recipient not found in listed keys\");\n }",
"@Override\n\tpublic void removePrivateMessage(String messageId, String userName,\n\t\t\tString type) throws Exception {\n\n\t}",
"public String Crypt(String s);",
"private void deactivateKey(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t}",
"@Test\n public void unencryptTransactionWeSentUsingUnknownKey() {\n final PublicKey nonRecipientKey = PublicKey.from(\"unknown\".getBytes());\n\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final RecipientBox senderBox = RecipientBox.from(\"senderBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBoxes(List.of(senderBox.getData(), recipientBox.getData()))\n .withRecipientKeys(List.of(senderKey, recipientKey))\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final Throwable throwable =\n catchThrowable(() -> enclave.unencryptTransaction(payload, nonRecipientKey));\n\n assertThat(throwable)\n .isInstanceOf(EnclaveException.class)\n .hasMessage(\"recipient not found in listed keys\");\n }",
"public void decodeMessage() {\n StringBuilder decoded = new StringBuilder();\n\n for (int i = 0; i < message.length(); i += 3) {\n if (message.charAt(i) == message.charAt(i + 1)) {\n decoded.append(message.charAt(i));\n } else if (message.charAt(i) == message.charAt(i + 2)) {\n decoded.append(message.charAt(i));\n } else {\n decoded.append(message.charAt(i + 1));\n }\n }\n\n message = decoded;\n }",
"@Test\n public void unencryptTransactionFromEarlyVersionUsingSender() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientKey(recipientKey)\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey senderPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(senderKey)).thenReturn(senderPrivateKey);\n when(keyManager.getPublicKeys()).thenReturn(Set.of(senderKey));\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(recipientKey, senderPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, senderKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(recipientKey, senderPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(senderKey);\n verify(keyManager).getPublicKeys();\n }",
"public void unsetSwissprot()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n get_store().remove_element(SWISSPROT$14, 0);\r\n }\r\n }",
"private void clearSignature() {\n bitField0_ = (bitField0_ & ~0x00000010);\n signature_ = getDefaultInstance().getSignature();\n }",
"@Test\n public void unencryptTransactionFromEarlyVersionUsingRecipient() {\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientKey(recipientKey)\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n final PrivateKey recipientPrivateKey = PrivateKey.from(\"private-key\".getBytes());\n when(keyManager.getPrivateKeyForPublicKey(recipientKey)).thenReturn(recipientPrivateKey);\n when(keyManager.getPublicKeys()).thenReturn(Set.of(senderKey, recipientKey));\n\n final SharedKey sharedKey = SharedKey.from(\"shared-key\".getBytes());\n when(nacl.computeSharedKey(senderKey, recipientPrivateKey)).thenReturn(sharedKey);\n\n final byte[] expectedOutcome = \"SUCCESS\".getBytes();\n\n when(nacl.openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey))\n .thenReturn(\"sharedOrMasterKeyBytes\".getBytes());\n when(nacl.openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class)))\n .thenReturn(expectedOutcome);\n\n final byte[] result = enclave.unencryptTransaction(payload, recipientKey);\n\n assertThat(result).isNotNull().isSameAs(expectedOutcome);\n\n verify(nacl).openAfterPrecomputation(recipientBox.getData(), recipientNonce, sharedKey);\n verify(nacl)\n .openAfterPrecomputation(any(byte[].class), eq(cipherTextNonce), any(MasterKey.class));\n verify(nacl).computeSharedKey(senderKey, recipientPrivateKey);\n verify(keyManager).getPrivateKeyForPublicKey(recipientKey);\n verify(keyManager).getPublicKeys();\n }",
"@Test\n @SuppressWarnings({\"ResultOfMethodCallIgnored\", \"deprecation\"})\n public void passphrasesNotCompatibleWithOldAPI() throws SecureCellException {\n SecureCell cellOld = new SecureCell(\"day 56 of the Q\", SecureCell.MODE_SEAL);\n SecureCell.Seal cellNew = SecureCell.SealWithPassphrase(\"day 56 of the Q\", StandardCharsets.UTF_16);\n byte[] message = \"All your base are belong to us!\".getBytes(StandardCharsets.UTF_8);\n\n byte[] encryptedOld = cellOld.protect(\"\", message).getProtectedData();\n byte[] encryptedNew = cellNew.encrypt(message);\n\n try {\n cellNew.decrypt(encryptedOld);\n fail(\"expected SecureCellException\");\n }\n catch (SecureCellException ignored) {}\n try {\n cellOld.unprotect(\"\", new SecureCellData(encryptedNew, null));\n fail(\"expected SecureCellException\");\n }\n catch (SecureCellException ignored) {}\n }",
"public static native void Inverse(long lpjFbxDualQuaternion);",
"private void _setUnshifted ()\r\n {\r\n m_bBase64mode = false;\r\n m_nBitsRead = 0;\r\n m_nTempChar = 0;\r\n }",
"void mo80453a(Message message);",
"void unsetIssued();",
"void unsetIdVerificationResponseData();",
"private native void unrefMsgCPtr ();",
"public void receiveResultrevokeApplication(\n boolean result\n ) {\n }",
"public String proposer(int x) {\n boolean problem;\n getcodeSecret().afficherMessageTrouverCodeSecret(x);\n do {\n setRep2(sc.nextLine());\n problem = getJoueur().verificationFormatCodeSecret(getRep2(), x);\n } while (problem);\n return getRep2();\n }",
"String process(String data) throws LocalizedSignatureException;",
"@Test\n public void testNullRandom() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key generation is not supported.\" + ex);\n return;\n }\n Set<String> signatures = new HashSet<String>();\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n byte[] signature;\n try {\n signer.initSign(priv, null);\n signer.update(messageBytes);\n signature = signer.sign();\n } catch (GeneralSecurityException ex) {\n fail(\"Failed to sign. \" + ex);\n return;\n }\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n }",
"@Test\n public void unencryptTransactionFromEarlyVersionUsingUnknownRecipient() {\n final PublicKey nonRecipientKey = PublicKey.from(\"unknown\".getBytes());\n\n final PublicKey senderKey = PublicKey.from(\"senderKey\".getBytes());\n final PublicKey recipientKey = PublicKey.from(\"recipientKey\".getBytes());\n final byte[] cipherText = \"cipherText\".getBytes();\n final Nonce cipherTextNonce = mock(Nonce.class);\n final RecipientBox recipientBox = RecipientBox.from(\"recipientBox\".getBytes());\n final Nonce recipientNonce = mock(Nonce.class);\n\n final EncodedPayload payload =\n EncodedPayload.Builder.create()\n .withSenderKey(senderKey)\n .withCipherText(cipherText)\n .withCipherTextNonce(cipherTextNonce)\n .withRecipientBox(recipientBox.getData())\n .withRecipientKey(recipientKey)\n .withRecipientNonce(recipientNonce)\n .withPrivacyMode(PrivacyMode.STANDARD_PRIVATE)\n .build();\n\n when(keyManager.getPublicKeys()).thenReturn(Set.of(senderKey, recipientKey));\n\n final Throwable throwable =\n catchThrowable(() -> enclave.unencryptTransaction(payload, nonRecipientKey));\n\n assertThat(throwable)\n .isInstanceOf(EnclaveException.class)\n .hasMessage(\"recipient not found in listed keys\");\n\n verify(keyManager).getPublicKeys();\n }",
"Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage);",
"private static void decodeString(String in){\n\t\t//reverse anything done in encoded string\n\t\tString demess = decrypt(in);\n\t\tString decodeMessage = bigIntDecode(demess);\n\n\t\tSystem.out.println(\"Decoded message: \" + decodeMessage + \"***make function to actually decode!\");\n\t}",
"boolean isPublicKeyBlackListed(PublicKey publicKey);",
"protected String normalizeExMsg(String msg) {\n return msg;\n }",
"public void resetEnc(){\n EncX.reset();\n }",
"private byte[] handleAuthPt1(byte[] payload) {\n\t\tboolean userIdentified = false;\n\t\tbyte[] supposedUser = null;\n\n//\n\t\tSystem.out.println(\"payload received by SecretServer:\");\n\t\tComMethods.charByChar(payload,true);\n//\n\n\t\tuserNum = -1;\n\t\twhile (userNum < validUsers.length-1 && !userIdentified) {\n\t\t\tuserNum++;\n\t\t\tsupposedUser = validUsers[userNum].getBytes();\n\t\t\tuserIdentified = Arrays.equals(Arrays.copyOf(payload, supposedUser.length), supposedUser);\n\n//\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"\\\"\"+validUsers[userNum]+\"\\\" in bytes:\");\n\t\t\tComMethods.charByChar(validUsers[userNum].getBytes(),true);\n\t\t\tSystem.out.println(\"\\\"Arrays.copyOf(payload, supposedUser.length\\\" in bytes:\");\n\t\t\tComMethods.charByChar(Arrays.copyOf(payload, supposedUser.length),true);\n\t\t\tSystem.out.println();\n//\n\t\t}\n\n\t\tif (!userIdentified) {\n\t\t\tComMethods.report(\"SecretServer doesn't recognize name of valid user.\", simMode);\n\t\t\treturn \"error\".getBytes();\n\t\t} else {\n\t\t\t// Process second half of message, and verify format\n\t\t\tbyte[] secondHalf = Arrays.copyOfRange(payload, supposedUser.length, payload.length);\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tsecondHalf = ComMethods.decryptRSA(secondHalf, my_n, my_d);\n\n//\n\tSystem.out.println(\"secondHalf = \"+secondHalf);\n//\n\t\t\tComMethods.report(\"SecretServer has decrypted the second half of the User's message using SecretServer's private RSA key.\", simMode);\n\n\t\t\tif (!Arrays.equals(Arrays.copyOf(secondHalf, supposedUser.length), supposedUser)) {\n\t\t\t\t// i.e. plaintext name doesn't match the encrypted bit\n\t\t\t\tComMethods.report(\"ERROR ~ invalid first message in protocol.\", simMode);\t\t\t\t\n\t\t\t\treturn \"error\".getBytes();\n\t\t\t} else {\n\t\t\t\t// confirmed: supposedUser is legit. user\n\t\t\t\tcurrentUser = new String(supposedUser); \n\t\t\t\tuserSet = true;\n\t\t\t\tbyte[] nonce_user = Arrays.copyOfRange(secondHalf, supposedUser.length, secondHalf.length);\n\n\t\t\t\t// Second Message: B->A: E_kA(nonce_A || Bob || nonce_B)\n\t\t\t\tmyNonce = ComMethods.genNonce();\n\t\t\t\tComMethods.report(\"SecretServer has randomly generated a 128-bit nonce_srvr = \"+myNonce+\".\", simMode);\n\t\t\t\n\t\t\t\tbyte[] response = ComMethods.concatByteArrs(nonce_user, \"SecretServer\".getBytes(), myNonce);\n\t\t\t\tbyte[] responsePayload = ComMethods.encryptRSA(response, usersPubKeys1[userNum], BigInteger.valueOf(usersPubKeys2[userNum]));\n\t\t\t\treturn responsePayload;\n\t\t\t}\n\t\t}\n\t}",
"private void generatePkcs1Sha1Signature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\t\r\n\t\t\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\tif ((lc != 20) || (byteRead != 20))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t\r\n\t\t\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// use the correct key\r\n\t\tif (getSignatureType() == NON_REPUDIATION) {\r\n\t\t\t////cipher.init(nonRepPrivateKey, Cipher.MODE_ENCRYPT); // stond al in comments\r\n\t\t\tcipher.init((RSAPrivateCrtKey)nonRepKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t\r\n\t\tif (getSignatureType() == AUTHENTICATION) {\r\n\t\t\tcipher.init((RSAPrivateCrtKey)authKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t}\r\n\t\t\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_SHA1_PKCS1, lc);\r\n\t\t// copy the SHA1 hash from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA), messageBuffer, (short) (128 - lc), lc);\r\n\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\t// generate signature\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as1);\r\n\t\t//@ foreachp_remove(messageBuffer, as1);\r\n\t\t////@ open transient_byte_array(messageBuffer); // auto\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t//@ close transient_byte_array(messageBuffer); // todo\r\n\t\t//@ foreachp_unremove(messageBuffer, as1);\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t}",
"private byte[] preparePayload(byte[] message) {\n\t\treturn ComMethods.preparePayload(\"SecretServer\".getBytes(), message, counter, currentSessionKey, simMode);\n\t}",
"public static void main(String[] args){\n\t\tRSA rsa = new RSA();\n\t\tString msg = \"hi there\";\n\t\tbyte [] code = rsa.encrypt(msg, rsa.publicKey);\n\t\tSystem.out.println(code.toString());\n\t\tSystem.out.println(rsa.decrypt(code, rsa.privateKey));\n\t}",
"private static String normalizeB64String(String s) {\n while(s.length() % 4 != 0)\n s += \"=\";\n return s;\n }",
"public FudgeMsg getNormalizedMessage(final FudgeMsg msg, final String securityUniqueId, final FieldHistoryStore history) {\n final FudgeMsg normalizedMsg = _normalizationRuleSet.getNormalizedMessage(msg, securityUniqueId, history);\n if (normalizedMsg == null) {\n return null;\n }\n if (normalizedMsg.getNumFields() == 0) {\n return null;\n }\n return normalizedMsg;\n }",
"private BigInteger decrypt(BigInteger encryptedMessage) {\n return encryptedMessage.modPow(d, n);\n }",
"@Test\n public void testInverseTransform2() {\n InputStream standardIn = System.in;\n PrintStream standardOut = System.out;\n try {\n // setup new input with encoded message\n System.setIn(new ByteArrayInputStream(ENCODED_INPUT2));\n // create new output stream as byte array and assign to standard\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(baos));\n\n BurrowsWheeler.inverseTransform();\n String decoded = baos.toString();\n // check length and chars\n assertEquals(DECODED_INPUT2.length(), decoded.length());\n assertEquals(DECODED_INPUT2, decoded);\n } finally {\n // return standard input and output\n System.setIn(standardIn);\n System.setOut(standardOut);\n }\n }",
"void unsetSubject();",
"private byte[] handleUpdate(byte[] message) {\n\t\tbyte[] newSecretBytes = Arrays.copyOfRange(message, \"update:\".getBytes().length, message.length);\n\n/*\n\t\tSystem.out.println(\"THIS IS A TEST:\");\n\t\tSystem.out.println(\"newSecretBytes:\");\n\t\tComMethods.charByChar(newSecretBytes, true);\n\t\tSystem.out.println(\"newSecretBytes, reversed:\");\n\t\tString toStr = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tbyte[] fromStr = DatatypeConverter.parseBase64Binary(toStr);\n\t\tComMethods.charByChar(fromStr, true);\n*/\n\t\tString newSecret = DatatypeConverter.printBase64Binary(newSecretBytes);\n\t\tboolean success = replaceSecretWith(currentUser, newSecret);\n\t\t\n\t\tif (success) {\n\t\t\tComMethods.report(\"SecretServer has replaced \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"secretupdated\".getBytes());\n\t\t} else {\n\t\t\tComMethods.report(\"SecretServer has FAILED to replace \"+currentUser+\"'s secret with \"+newSecret+\".\", simMode);\n\t\t\treturn preparePayload(\"writingfailure\".getBytes());\n\t\t}\n\t}",
"private String encodageMot(String message) {\n if (message == null || message.equals(\"\")) {\n throw new AssertionError(\"Texte non saisie\");\n } \n return transformWords(message, 1); \n }",
"private void internalAuthenticate(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t// check P1 and P2\r\n\t\tif ((buffer[ISO7816.OFFSET_P1] != ALG_SHA1_PKCS1) || buffer[ISO7816.OFFSET_P2] != BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t// receive the data that needs to be signed\r\n\t\tshort byteRead = apdu.setIncomingAndReceive();\r\n\t\t// check Lc\r\n\t\tshort lc = (short) (buffer[ISO7816.OFFSET_LC] & 0x00FF);\r\n\t\t// we do not support Lc=0x97, only Lc=0x16\r\n\t\tif ((lc == 0x97) || (byteRead == 0x97))\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\tif ((lc != 0x16) || (byteRead != 0x16))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_LENGTH);\r\n\t\t// the first data byte must be \"94\" and the second byte is the length\r\n\t\t// (20 bytes)\r\n\t\tif ((buffer[ISO7816.OFFSET_CDATA] != (byte) 0x94) || (buffer[ISO7816.OFFSET_CDATA + 1] != (byte) 0x14))\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_DATA);\r\n\t\t// use the basic private key\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t\r\n\t\t//@ transient_byte_arrays_mem(messageBuffer);\r\n\t\t//@ assert transient_byte_arrays(?as);\r\n\t\t//@ foreachp_remove(messageBuffer, as);\r\n\t\t//@ open transient_byte_array(messageBuffer);\r\n\r\n\t\tif (basicKeyPair == null)\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\r\n\t\t//VF: bovenstaande is mogelijk bug in programma!\r\n\t\tcipher.init(basicKeyPair.getPrivate(), Cipher.MODE_ENCRYPT);\r\n\t\t// prepare the message buffer to the PKCS#1 (v1.5) structure\r\n\t\tpreparePkcs1ClearText(messageBuffer, ALG_SHA1_PKCS1, lc);\r\n\t\t// copy the challenge (SHA1 hash) from the APDU to the message buffer\r\n\t\tUtil.arrayCopy(buffer, (short) (ISO7816.OFFSET_CDATA + 2), messageBuffer, (short) 108, (short) 20);\r\n\t\t// generate signature\r\n\t\tcipher.doFinal(messageBuffer, (short) 0, (short) 128, buffer, (short) 0);\r\n\t\t// if T=0, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t// in case T=1 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t\t// decrement internal authenticate counter\r\n\t\t//internalAuthenticateCounter--;\r\n\t\t//@ close transient_byte_array(messageBuffer);\r\n\t\t//@ foreachp_unremove(messageBuffer, as);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t}",
"void unsetManifestHashAlgorithm();",
"BigInteger getMessage();",
"@Test\n public void testInverseTransform() {\n InputStream standardIn = System.in;\n PrintStream standardOut = System.out;\n try {\n // setup new input with encoded message\n System.setIn(new ByteArrayInputStream(ENCODED_INPUT));\n // create new output stream as byte array and assign to standard\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n System.setOut(new PrintStream(baos));\n\n BurrowsWheeler.inverseTransform();\n String decoded = baos.toString();\n // check length and chars\n assertEquals(DECODED_INPUT.length(), decoded.length());\n assertEquals(DECODED_INPUT, decoded);\n } finally {\n // return standard input and output\n System.setIn(standardIn);\n System.setOut(standardOut);\n }\n }",
"public Object resetOutputMessage(Object message);",
"private void generateSignature(APDU apdu, byte[] buffer) \r\n \t //@ requires current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n \t //@ ensures current_applet(this) &*& [1/2]valid() &*& APDU(apdu, buffer) &*& array_slice(buffer, 0, buffer.length, _);\r\n\t{\r\n\t\t/*\r\n\t\t * IMPORTANT: in all other APDUs the previous APDU type gets overwritten\r\n\t\t * in process() function; this is not the case here because the\r\n\t\t * information is needed when processing to verify the security\r\n\t\t * condition for non repudiation signature\r\n\t\t * \r\n\t\t * the previous APDU type has to be overwritten in every possible exit\r\n\t\t * path out of this function; therefore we check the security conditions\r\n\t\t * of the non repudiation signature as early as possible, but we have to\r\n\t\t * overwrite the previous APDU type in the 2 possible exceptions before\r\n\t\t */\r\n\t\tJCSystem.beginTransaction();\r\n\t\t////@ open valid(); // auto\r\n\t\t// check P1 and P2\t\t\r\n\t\tif (buffer[ISO7816.OFFSET_P1] != (byte) 0x9E || buffer[ISO7816.OFFSET_P2] != (byte) 0x9A) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_WRONG_P1P2);\r\n\t\t}\r\n\t\t// generate signature without prepare signature results:\r\n\t\t// \"conditions of use not satisfied\"\r\n\t\tif (getSignatureType() == NO_SIGNATURE) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_CONDITIONS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t/*\r\n\t\t * verify authentication information throw\r\n\t\t * \"security condition not satisfied\" if something is wrong\r\n\t\t */\r\n\t\t// check if previous APDU did a cardholder PIN verification\r\n\t\tif ((getSignatureType() == NON_REPUDIATION) && (getPreviousApduType() != VERIFY_CARDHOLDER_PIN)) {\r\n\t\t\tsetPreviousApduType(OTHER);\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t}\r\n\t\t// overwrite previous ADPU type as soon as possible\r\n\t\tsetPreviousApduType(OTHER);\r\n\r\n\t\t// it is impossible to generate basic signatures with this command\r\n\t\tif (getSignatureType() == BASIC)\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t// check if cardholder PIN was entered correctly\r\n\t\tif (!cardholderPin.isValidated())\r\n\t\t\tISOException.throwIt(ISO7816.SW_SECURITY_STATUS_NOT_SATISFIED);\r\n\t\t\r\n\t\t////@ close valid(); // auto\r\n\t\tJCSystem.commitTransaction();\r\n\t\t////@ open [1/2]valid(); // auto\r\n\t\tswitch (signatureAlgorithm) {\r\n\t\tcase ALG_MD5_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Md5Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_SHA1_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Sha1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\tcase ALG_PKCS1:\r\n\t\t\t////@ close [1/2]valid(); // auto\r\n\t\t\tgeneratePkcs1Signature(apdu, buffer);\r\n\t\t\t////@ open [1/2]valid(); // auto\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t////@ close [1/2]valid(); // auto\r\n\t\t// if T=1, store signature in sigBuffer so that it can latter be sent\r\n\t\tif (APDU.getProtocol() == APDU.PROTOCOL_T1) {\r\n\t\t\tJCSystem.beginTransaction();\r\n\t\t\t//@ open valid(); // todo (???)\r\n\t\t\tUtil.arrayCopy(buffer, (short) 0, responseBuffer, (short) 0, (short) 128);\r\n\t\t\t////@ close valid(); // auto\r\n\t\t\tJCSystem.commitTransaction();\r\n\t\t\t\r\n\t\t\t// in case T=0 protocol, send the signature immediately in a\r\n\t\t\t// response APDU\r\n\t\t} else {\r\n\t\t\t// send first 128 bytes (= 1024 bit) of buffer\r\n\t\t\tapdu.setOutgoingAndSend((short) 0, (short) 128);\r\n\t\t}\r\n\t}",
"String convert(String msg) {\n for (int i = 0; i < msg.length(); i++) {\n if (msg.charAt(i) < 65 || msg.charAt(i) > 90) {\n throw new EnigmaException(\"Illegal input\");\n }\n }\n int index = 0;\n String result = \"\";\n while (index < msg.length()) {\n int num = msg.charAt(index) - 65;\n if (manyRotors[4].atNotch() && !manyRotors[3].atNotch()) {\n manyRotors[4].advance();\n manyRotors[3].advance();\n } else if (manyRotors[3].atNotch()) {\n manyRotors[4].advance();\n manyRotors[3].advance();\n manyRotors[2].advance();\n } else manyRotors[4].advance();\n for (int i = manyRotors.length - 1; i > 0; i--) {\n num = manyRotors[i].convertForward(num);\n }\n for (int i = 0; i < manyRotors.length; i++) {\n num = manyRotors[i].convertBackward(num);\n }\n result += String.valueOf((char) (num + 65));\n index++;\n }\n return result;\n //return null;\n // FIXME\n }",
"void unsetCryptProvider();",
"String getRawMessage();",
"public String cipher() {\n int[] r1taps = {13, 16, 17, 18};\n int[] r2taps = {20, 21};\n int[] r3taps = {7, 20, 21, 22};\n\n // Set register size and majority bits\n final int R1 = 19;\n final int R1M = 8;\n final int R2 = 22;\n final int R2M = 10;\n final int R3 = 23;\n final int R3M = 10;\n\n // Initialize variables\n String bs = \"\";\n byte[] key = HexStringToBytes(symKey);\n BitSet keySet = new BitSet();\n BitSet keyStream = new BitSet();\n BitSet messageSet = new BitSet();\n\n // Create a byte array length of sample message\n byte[] messageArray = new byte[message.length()];\n\n // Convert the sample message to a byte array\n try {\n messageArray = message.getBytes(\"ISO-8859-1\");\n } catch (Exception e) {\n System.out.println(\"Error: \" + e);\n }\n\n // Convert message sample byte array to string\n String as = \"\";\n for (int i = 0; i < messageArray.length; i++) {\n byte b1 = messageArray[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n as += s;\n }\n\n // Convert string of bits to a BitSet\n messageSet = BitStringToBitSet(as);\n\n // Creates string from key byte array\n for (int i = 0; i < 8; i++) {\n byte b1 = key[i];\n String s = String.format(\"%8s\", Integer.toBinaryString(b1 & 0xFF))\n .replace(' ', '0');\n bs += s;\n }\n\n // Convert string of bits to a BitSet\n keySet = BitStringToBitSet(bs);\n\n // Initialize registers\n BitSet r1 = new BitSet();\n BitSet r2 = new BitSet();\n BitSet r3 = new BitSet();\n\n // Process key into registers\n for (int i = 0; i < 64; i++) {\n r1 = ShiftSet(r1, R1, keySet.get(i) ^ Tap(r1, r1taps));\n r2 = ShiftSet(r2, R2, keySet.get(i) ^ Tap(r2, r2taps));\n r3 = ShiftSet(r3, R3, keySet.get(i) ^ Tap(r3, r3taps));\n }\n\n // Clock additional 100 times for additional security (GSM standard)\n for (int i = 0; i < 100; i++) {\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n }\n\n // Create keystream as long as the sample message\n for (int i = 0; i < message.length() * 8; i++) {\n\n // Get keystream bit\n keyStream.set(i, r1.get(R1 - 1) ^ r2.get(R2 - 1) ^ r3.get(R3 - 1));\n\n // Shift majority registers\n int maj = 0;\n boolean[] ar = {false, false, false};\n if (r1.get(R1M) == true) {\n ar[0] = true;\n maj += 1;\n }\n if (r2.get(R2M) == true) {\n ar[1] = true;\n maj += 1;\n }\n if (r3.get(R3M) == true) {\n ar[2] = true;\n maj += 1;\n }\n // If majority is false (0 bit)\n if (maj <= 1) {\n if (ar[0] == false) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == false) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == false) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n // Else majority is true\n } else {\n if (ar[0] == true) {\n r1 = ShiftSet(r1, R1, Tap(r1, r1taps));\n }\n if (ar[1] == true) {\n r2 = ShiftSet(r2, R2, Tap(r2, r2taps));\n }\n if (ar[2] == true) {\n r3 = ShiftSet(r3, R3, Tap(r3, r3taps));\n }\n }\n\n }\n\n // XOR the message with the created keystream and return as string\n messageSet.xor(keyStream);\n return BitStringToText(ReturnSet(messageSet, message.length() * 8));\n }",
"String getUniqueSignature();",
"private void signMessage() {\n\n String messageText = messageTextArea.getText();\n SecureCharSequence secureCharSequence = new SecureCharSequence(currentPassword.getPassword());\n String signMessage = this.address.signMessage(messageText, secureCharSequence);\n signature.setText(signMessage);\n\n }",
"public String uncheckedBill() {\n\t\tMap<String,Object> request = (Map) ActionContext.getContext().get(\"request\");\r\n\t\t\r\n\t\tSet uncheckedBill = creditCardManager.getUncheckedBill(creditCardID);\r\n\t\trequest.put(\"uncheckedBill\", uncheckedBill);\r\n\t\treturn \"uncheckedBill\";\r\n\t}",
"private void unpublish() {\n Log.i(TAG, \"Unpublishing.\");\n Nearby.Messages.unpublish(mGoogleApiClient, mPubMessage);\n }",
"com.google.cloud.video.livestream.v1.Encryption.Clearkey getClearkey();"
] | [
"0.586991",
"0.567036",
"0.56119514",
"0.5552899",
"0.5340303",
"0.51419103",
"0.514062",
"0.51310015",
"0.5054533",
"0.50497746",
"0.5012513",
"0.49736464",
"0.49698275",
"0.49589595",
"0.4929209",
"0.48817527",
"0.4869851",
"0.48580003",
"0.48571494",
"0.48296168",
"0.48161966",
"0.48024338",
"0.47715157",
"0.4715235",
"0.47121772",
"0.47024652",
"0.46941635",
"0.46928677",
"0.46574587",
"0.46223313",
"0.46094918",
"0.45993426",
"0.4598335",
"0.4592207",
"0.45919657",
"0.45717627",
"0.45670402",
"0.45603216",
"0.45541123",
"0.4554063",
"0.45483035",
"0.45392781",
"0.45362633",
"0.45355007",
"0.4533638",
"0.4529798",
"0.452918",
"0.45230755",
"0.4517636",
"0.4513243",
"0.45089674",
"0.45070666",
"0.45036215",
"0.44908836",
"0.4485259",
"0.44839483",
"0.44817883",
"0.44695646",
"0.44695064",
"0.44653243",
"0.44575992",
"0.44561973",
"0.44535518",
"0.44524786",
"0.44476905",
"0.44409743",
"0.44374192",
"0.44336545",
"0.44300818",
"0.44280252",
"0.44165745",
"0.44138095",
"0.44090068",
"0.44068986",
"0.44048178",
"0.4402486",
"0.43993175",
"0.43987182",
"0.4396412",
"0.43936786",
"0.43867496",
"0.43861878",
"0.43810564",
"0.4380202",
"0.43790713",
"0.43759066",
"0.43728483",
"0.43583134",
"0.43556765",
"0.43553227",
"0.43531528",
"0.43466416",
"0.43447068",
"0.43368658",
"0.4333684",
"0.43327308",
"0.43290913",
"0.43272597",
"0.43270195",
"0.43248278"
] | 0.6392796 | 0 |
Function which generate a blind factor in the case of RSA blind signature | public static BigInteger generateRForBlindSignature(BigInteger mod) {
BigInteger r;
do {
r = new BigInteger(1024, new SecureRandom());
} while(r.gcd(mod) == BigInteger.ONE);
return r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static int getSecretNum(int arg1) {\n Random rand = new Random();\n return rand.nextInt(UPPERBOUND)+1; //make range 1-100\n }",
"RSAKeygen(){\n Random rnd = new Random();\n p = BigInteger.probablePrime(bitlength, rnd);\n BigInteger eTmp = BigInteger.probablePrime(bitlength, rnd);\n\n while(p.equals(eTmp)){\n eTmp = BigInteger.probablePrime(bitlength,rnd);\n }\n\n q = eTmp;\n n = p.multiply(q);\n }",
"public final KeyPair generateKeyPair() {\n\t\tif (SECURE_RANDOM == null) {\n\t\t\tSECURE_RANDOM = new SecureRandom();\n\t\t}\n\t\t// for p and q we divide the bits length by 2 , as they create n, \n\t\t// which is the modulus and actual key size is depend on it\n\t\tBigInteger p = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\tBigInteger q;\n\t\tdo {\n\t\t\tq = new BigInteger(STRENGTH / 2, 64, SECURE_RANDOM);\n\t\t} while (q.compareTo(p) == 0);\n\n\t\t// lambda = lcm(p-1, q-1) = (p-1)*(q-1)/gcd(p-1, q-1)\n\t\tBigInteger lambda = p.subtract(BigInteger.ONE).multiply(q\n\t\t\t\t.subtract(BigInteger.ONE)).divide(p.subtract(BigInteger.ONE)\n\t\t\t\t.gcd(q.subtract(BigInteger.ONE)));\n\n\t\tBigInteger n = p.multiply(q); // n = p*q\n\t\tBigInteger nsquare = n.multiply(n); // nsquare = n*n\n\t\tBigInteger g;\n\t\tdo {\n\t\t\t// generate g, a random integer in Z*_{n^2}\n\t\t\tdo {\n\t\t\t\tg = new BigInteger(STRENGTH, 64, SECURE_RANDOM);\n\t\t\t} while (g.compareTo(nsquare) >= 0\n\t\t\t\t\t|| g.gcd(nsquare).intValue() != 1);\n\n\t\t\t// verify g, the following must hold: gcd(L(g^lambda mod n^2), n) =\n\t\t\t// 1,\n\t\t\t// where L(u) = (u-1)/n\n\t\t} while (g.modPow(lambda, nsquare).subtract(BigInteger.ONE).divide(n)\n\t\t\t\t.gcd(n).intValue() != 1);\n\n\t\t// mu = (L(g^lambda mod n^2))^{-1} mod n, where L(u) = (u-1)/n\n\t\tBigInteger mu = g.modPow(lambda, nsquare).subtract(BigInteger.ONE)\n\t\t\t\t.divide(n).modInverse(n);\n\n\t\tPaillierPublicKey publicKey = new PaillierPublicKey(n, g, nsquare);\n\t\tPaillierPrivateKey privateKey = new PaillierPrivateKey(lambda, mu,\n\t\t\t\tnsquare, n);\n\n\t\treturn new KeyPair(publicKey, privateKey);\n\t}",
"private static PBEParametersGenerator makePBEGenerator(int n, int n2) {\n void var2_17;\n if (n != 0 && n != 4) {\n if (n != 1 && n != 5) {\n if (n == 2) {\n if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE encryption.\");\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS12ParametersGenerator pKCS12ParametersGenerator = new PKCS12ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else {\n OpenSSLPBEParametersGenerator openSSLPBEParametersGenerator = new OpenSSLPBEParametersGenerator();\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) {\n if (n2 != 4) {\n if (n2 != 7) {\n if (n2 != 8) {\n if (n2 != 9) throw new IllegalStateException(\"unknown digest scheme for PBE PKCS5S2 encryption.\");\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA512());\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA384());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA224());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA256());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getSHA1());\n }\n return var2_17;\n } else {\n PKCS5S2ParametersGenerator pKCS5S2ParametersGenerator = new PKCS5S2ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n } else if (n2 != 0) {\n if (n2 != 1) throw new IllegalStateException(\"PKCS5 scheme 1 only supports MD2, MD5 and SHA1.\");\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getSHA1());\n return var2_17;\n } else {\n PKCS5S1ParametersGenerator pKCS5S1ParametersGenerator = new PKCS5S1ParametersGenerator(AndroidDigestFactory.getMD5());\n }\n return var2_17;\n }",
"BigInteger getDigitalSignature();",
"public static BigInteger blindSign(BigInteger message, RSAPrivateKey key) {\n\t\tBigInteger d = key.getPrivateExponent();\n\t\tBigInteger N = key.getModulus();\n\n\t\treturn message.modPow(d, N);\t\n\t}",
"public static BigInteger unblind(BigInteger signature, BigInteger N, BigInteger r) {\n\t\tBigInteger rInverse = r.modInverse(N);\n\n\t\treturn signature.multiply(rInverse).mod(N);\n\t}",
"String getMGFAlgorithm();",
"java.math.BigInteger getNcbistdaa();",
"@Test\n public void testRandomization() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Set<String> signatures = new HashSet<String>();\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n signer.initSign(priv);\n signer.update(messageBytes);\n byte[] signature = signer.sign();\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"Failed to generat signatures:\" + ex);\n return;\n }\n }",
"int luasPP(int a, int b){\r\n return a*b;\r\n }",
"float genChance();",
"java.math.BigInteger getNcbieaa();",
"private int generateSecret() {\n int secret = secretGenerator.nextInt();\n while (secretToNumber.containsKey(secret)) {\n secret = secretGenerator.nextInt();\n }\n return secret;\n }",
"static public PublicParameter BFSetup1(int n)\n\t\t\tthrows NoSuchAlgorithmException {\n\n\t\tString hashfcn = \"\";\n\t\tEllipticCurve E;\n\t\tint n_p = 0;\n\t\tint n_q = 0;\n\t\tPoint P;\n\t\tPoint P_prime;\n\t\tPoint P_1;\n\t\tPoint P_2;\n\t\tPoint P_3;\n\t\tBigInt q;\n\t\tBigInt r;\n\t\tBigInt p;\n\t\tBigInt alpha;\n\t\tBigInt beta;\n\t\tBigInt gamma;\n\n\t\tif (n == 1024) {\n\t\t\tn_p = 512;\n\t\t\tn_q = 160;\n\t\t\thashfcn = \"SHA-1\";\n\t\t}\n\n\t\t// SHA-224 is listed in the RFC standard but has not yet been\n\t\t// implemented in java.\n\t\t// else if (n == 2048) {\n\t\t// n_p = 1024;\n\t\t// n_q = 224;\n\t\t// hashfcn = \"SHA-224\";\n\t\t// }\n\n\t\t// The Following are not implemented based on the curve used from the\n\t\t// JPair Project\n\t\t// else if (n == 3072) {\n\t\t// n_p = 1536;\n\t\t// n_q = 256;\n\t\t// hashfcn = \"SHA-256\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 7680) {\n\t\t// n_p = 3840;\n\t\t// n_q = 384;\n\t\t// hashfcn = \"SHA-384\";\n\t\t// }\n\t\t//\n\t\t// else if (n == 15360) {\n\t\t// n_p = 7680;\n\t\t// n_q = 512;\n\t\t// hashfcn = \"SHA-512\";\n\t\t// }\n\n\t\tRandom rnd = new Random();\n\t\tTatePairing sstate = Predefined.ssTate();\n\n\t\t// This can be used if you are not implementing a predefined curve in\n\t\t// order to determine the variables p and q;\n\t\t// do{\n\t\t// q = new BigInt(n_p, 100, rnd);\n\t\t// r = new BigInt(n_p, rnd );\n\t\t// p = determinevariables(r, q, n_p, rnd);\n\t\t// P_ = sstate.getCurve().randomPoint(rnd);\n\t\t// P = sstate.getCurve().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\t// } while (P !=null);\n\n\t\tq = sstate.getGroupOrder();\n\t\tFp fp_p = (Fp) sstate.getCurve().getField();\n\t\tp = fp_p.getP();\n\n\t\tr = new BigInt(n_p, rnd);\n\t\t// P_ = sstate.getCurve2().randomPoint(rnd);\n\t\t// P = sstate.getCurve2().multiply(P_, BigInt.valueOf(12).multiply(r));\n\t\tP = sstate.RandomPointInG1(rnd);\n\t\tP_prime = sstate.RandomPointInG2(rnd);\n\t\tdo {\n\t\t\talpha = new BigInt(q.bitLength(), rnd);\n\t\t} while (alpha.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tbeta = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tdo {\n\t\t\tgamma = new BigInt(q.bitLength(), rnd);\n\t\t} while (beta.subtract(q).signum() == -1);\n\n\t\tP_1 = sstate.getCurve().multiply(P, alpha);\n\t\t// System.out.println(\"P_1 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_1));\n\t\tP_2 = sstate.getCurve2().multiply(P_prime, beta);\n\t\t// System.out.println(\"P_2 is on curve : \" +\n\t\t// sstate.getCurve2().isOnCurve(P_2));\n\t\tP_3 = sstate.getCurve().multiply(P, gamma);\n\t\t// System.out.println(\"P_3 is on curve : \" +\n\t\t// sstate.getCurve().isOnCurve(P_3));\n\n\t\tsecret.add(alpha);\n\t\tsecret.add(beta);\n\t\tsecret.add(gamma);\n\n\t\tComplex v = (Complex) sstate.compute(P_1, P_2);\n\t\treturn new PublicParameter(sstate, p, q, P, P_prime, P_1, P_2, P_3, v,\n\t\t\t\thashfcn);\n\t}",
"public void generateKeys() {\n\t\t// p and q Length pairs: (1024,160), (2048,224), (2048,256), and (3072,256).\n\t\t// q must be a prime; choosing 160 Bit for q\n\t\tSystem.out.print(\"Calculating q: \");\n\t\tq = lib.generatePrime(160);\n\t\tSystem.out.println(q + \" - Bitlength: \" + q.bitLength());\n\t\t\n\t\t// p must be a prime\n\t\tSystem.out.print(\"Calculating p \");\n\t\tp = calculateP(q);\n\t System.out.println(\"\\np: \" + p + \" - Bitlength: \" + p.bitLength());\n\t System.out.println(\"Test-Division: ((p-1)/q) - Rest: \" + p.subtract(one).mod(q));\n\t \n\t // choose an h with (1 < h < p−1) and try again if g comes out as 1.\n \t// Most choices of h will lead to a usable g; commonly h=2 is used.\n\t System.out.print(\"Calculating g: \");\n\t BigInteger h = BigInteger.valueOf(2);\n\t BigInteger pMinusOne = p.subtract(one);\n\t do {\n\t \tg = h.modPow(pMinusOne.divide(q), p);\n\t \tSystem.out.print(\".\");\n\t }\n\t while (g == one);\n\t System.out.println(\" \"+g);\n\t \n\t // Choose x by some random method, where 0 < x < q\n\t // this is going to be the private key\n\t do {\n\t \tx = new BigInteger(q.bitCount(), lib.getRandom());\n }\n\t while (x.compareTo(zero) == -1);\n\t \n\t // Calculate y = g^x mod p\n\t y = g.modPow(x, p);\n\t \n System.out.println(\"y: \" + y);\n System.out.println(\"-------------------\");\n System.out.println(\"Private key (x): \" + x);\n\t}",
"public void generate(){\n\t\t//Key Generation\n\t\tint p = 41, q = 67; //two hard-coded prime numbers\n\t\tint n = p * q;\n\t\tint w = (p-1) * (q-1);\n\t\tint d = 83; //hard-coded number relatively prime number to w\n\t\t\n\t\tthis.privatekey = new PrivateKey(d,n); //public key generation completed\n\t\t\n\t\t//Extended Euclid's algorithm\n\t\tint \ta = w, \n\t\t\t\tb = d,\n\t\t\t\tv = a/b;\n\t\tArrayList<Integer> \tx = new ArrayList<Integer>(), \n\t\t\t\t\ty = new ArrayList<Integer>(),\n\t\t\t\t\tr = new ArrayList<Integer>();\n\t\t\n\t\t\n\t\t//Iteration 0\n\t\tint i = 0;\n\t\tx.add(1);\n\t\ty.add(0);\n\t\tr.add(a);\n\t\ti++;\n\t\t//Iteration 1\n\t\tx.add(0);\n\t\ty.add(1);\n\t\tr.add(b);\n\t\ti++;\n\t\t//Iteration 2\n\t\t //iteration counter\n\t\tint e = y.get(i-1);\n\t\tv = r.get(i-2) / r.get(i-1);\n\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t+b*(y.get(i-2)-v*y.get(i-1))); \n\t\ti++;\n\t\t\n\t\t//Iterate until r == 0, then get the previous iteration's value of d\n\t\twhile(r.get(i-1) > 0){\n\t\t\te = y.get(i-1);\n\t\t\tv = r.get(i-2) / r.get(i-1);\n\t\t\tx.add(x.get(i-2)-v*x.get(i-1));\n\t\t\ty.add(y.get(i-2) - v*y.get(i-1));\n\t\t\tr.add(a*(x.get(i-2)-v*x.get(i-1))\n\t\t\t\t\t+b*(y.get(i-2) -(v*y.get(i-1))));\n\t\t\ti++;\n\t\t}\n\t\t\n\t\t//if number is negative, add w to keep positive\n\t\tif (e < 0){\n\t\t\te = w+e;\n\t\t}\n\t\tthis.publickey = new PublicKey(e,n); //private key generation completed\n\t\t\n\t\t//print values to console\n\t\tSystem.out.println(\"Value of public key: \" + e + \", private key: \" + d + \", modulus: \" + n);\n\t\tSystem.out.println();\n\t}",
"byte[] get_secure_random_bytes();",
"public void generateNewSecret() {\r\n \r\n //Get Random Number With Correct Digits\r\n int intRand = randomNumberGenerator.nextInt((int)(Math.pow(10, numDigits) - Math.pow(10, numDigits - 1))) + (int)Math.pow(10, numDigits - 1);\r\n \r\n //Set To String\r\n String strRand = String.valueOf(intRand);\r\n \r\n //Set Value\r\n secretNumber = convertNumToDigitArray(strRand);\r\n \r\n }",
"private double genMultiplier() {\n return (random.nextInt(81) + 60)/100.0;\n }",
"private static int bernoulli(long result, long fractionOfExponent, double[][] exponentialDistribution)\n {\n\n /* *\n * Computes the Actual Bernoulli Parameter = exp (-t / f)\n * Yields A Fraction of 2^62, to Keep Only 62 Bits of Precision in This Implementation\n * */\n double bernoulliParameter = 4611686018427387904.0;\n\n for (long i = 0, j = fractionOfExponent; i < 3; i++, j >>= 5)\n {\n\n bernoulliParameter *= exponentialDistribution[(int)i][(int)(j & 31)];\n\n }\n\n /* Sample from Bernoulli of bernoulliParameter */\n return (int)(((result & 0x3FFFFFFFFFFFFFFFL) - Math.round(bernoulliParameter)) >>> 63);\n\n }",
"private static int newSecretNumber(int min, int max)\n {\n Random rnd = new Random();\n return rnd.nextInt((max + 1 - min) + min);\n }",
"public void generateR(){\n\t\t\tdo{\n\t\t\t\tr = new BigInteger(80, new Random());\n\t\t\t}while(!(q.gcd(r).equals(BigInteger.ONE)&&r.compareTo(q)<0&&r.compareTo(BigInteger.ONE)>=0));\n\t}",
"public static BigInteger blind(BigInteger message, BigInteger r, RSAPublicKey publicKey) {\n\t\tBigInteger e = publicKey.getPublicExponent();\n\t\tBigInteger N = publicKey.getModulus();\n\n\t\treturn message.multiply(r.modPow(e, N)).mod(N);\n\t}",
"C5537g mo4096b(int i);",
"public static String generateHalfKey(){\n return randomChars(HALF_KEY_LENGTH);\n }",
"private BigInteger[] factor(BigInteger i) {\n return null;\r\n }",
"public static void main(String args[]) {\n System.out.print(\"please enter the value of n: \");\n Scanner in = new Scanner(System.in);\n Long n = in.nextLong();\n // generate a prime number p\n p = GEN_pq(n);\n System.out.println(\"p: \" + p);\n // generate a prime number q\n do {\n q = GEN_pq(n);\n } while(p==q);\n\n System.out.println(\"q: \" + q);\n // compute the value of N\n N = p * q;\n System.out.println(\"N: \" + N);\n // compute the value of phi(N)\n phi_N = (p - 1) * (q - 1);\n System.out.println(\"phi(N) : \" + phi_N);\n // generate the exponential number e (e must be smaller than phi(N)\n // and it must be relative prime with phi(N))\n e = GEN_e(phi_N);\n System.out.println(\"e: \" + e);\n // the trapdoor for RSA: d = (k * phi(N) + 1) / e\n d = GEN_d(phi_N);\n// d = (2 * (phi_N) + 1) / e;\n System.out.println(\"d: \" + d);\n // find and add all possible values into set Zn*\n Z = new ArrayList<Long>();\n for (long i = 1; i < N; i++) {\n if (gcd(i, N) == 1) {\n Z.add(i);\n }\n }\n // randomly select an element from the set Zn*\n Random rand = new Random();\n int index = rand.nextInt(Z.size() - 1);\n x = Z.get(index);\n System.out.println(\"x: \" + x);\n long y = encrypt(x, e, N);\n System.out.println(\"y: \" + y);\n long x_prime = decrpyt(y, d, N);\n System.out.println(\"decrypted x: \" + x_prime);\n if (x_prime == x) System.out.println(\"The RSA algorithm is functioning correctly\");\n }",
"private static int createSelectedKey(int bBit) {\r\n\t\tRandom random = new Random();\r\n\t\tint maxKey = (int) Math.pow(2, bBit);\r\n\t\tint randomKey = random.nextInt((maxKey - 1) + 1) + 1;\t\r\n\t\treturn randomKey;\r\n\t}",
"long mo30295f();",
"int CalcKey(int g, int x, int n)\r\n {\r\n int rtn = 1;\r\n for(int i = 0; i < x; i++)\r\n rtn = (rtn * g) % n;\r\n return rtn;\r\n }",
"public Key generateKey2(int l) throws IOException{\n int b = l/32;\r\n int [] unos = new int[b];\r\n for(int i=0;i<b;i++){\r\n unos[i] = 1;\r\n }\r\n byte [] aB = int2byte(unos);\r\n\r\n return new SecretKeySpec(aB, \"AES\");\r\n }",
"public int generateProtection() {\n\t\tRandom rand = new Random();\n\t\tint protection = 4;\n\t\twhile (!isPrime(protection))\n\t\t\tprotection = rand.nextInt(MAX_PROTECTION) + 1;\n\t\treturn protection;\n\t}",
"public double breitWigner(double arg, double a, double gamma){ \r\n return (2. * gamma / Math.PI) / (4. * Math.pow(arg - a, 2.) + gamma * gamma);\r\n }",
"public void generateKey() {\n\twhile(true){\n\t rsaKeyA = (int)(Math.random()*20000 + 26);\n\t if(isPrime(rsaKeyA)){\n\t\tbreak;\n\t }\n\t}\n\twhile(true){\n\t rsaKeyB = (int)(Math.random()* 20000 + 26);\n\t if(isPrime(rsaKeyB)&& rsaKeyB != rsaKeyA){\n\t\tbreak;\n\t }\n\t}\n \n }",
"public BigInteger random(int k){\r\n \tSecureRandom sr = new SecureRandom();\r\n byte[] ba = new byte[k];\r\n ba[0] = (byte) (sr.nextInt(9)+49);\r\n for (int d = 1;d<k;d++){\r\n ba[d] = (byte) (sr.nextInt(10)+48); \r\n }\r\n return new BigInteger(new String(ba));\r\n }",
"@Test\n public void testNullRandom() {\n String sha = \"SHA-256\";\n String mgf = \"MGF1\";\n int saltLen = 32;\n int keySizeInBits = 2048;\n int samples = 8;\n Signature signer;\n PrivateKey priv;\n try {\n String algorithm = getAlgorithmName(sha, mgf);\n KeyPairGenerator keyGen = KeyPairGenerator.getInstance(\"RSA\");\n keyGen.initialize(keySizeInBits);\n KeyPair keypair = keyGen.genKeyPair();\n priv = keypair.getPrivate();\n signer = Signature.getInstance(algorithm);\n PSSParameterSpec params = getPssParameterSpec(sha, mgf, sha, saltLen, 1);\n signer.setParameter(params);\n } catch (GeneralSecurityException ex) {\n TestUtil.skipTest(\"RSA key generation is not supported.\" + ex);\n return;\n }\n Set<String> signatures = new HashSet<String>();\n byte[] messageBytes = new byte[8];\n for (int i = 0; i < samples; i++) {\n byte[] signature;\n try {\n signer.initSign(priv, null);\n signer.update(messageBytes);\n signature = signer.sign();\n } catch (GeneralSecurityException ex) {\n fail(\"Failed to sign. \" + ex);\n return;\n }\n String hex = TestUtil.bytesToHex(signature);\n assertTrue(\"Same signature computed twice\", signatures.add(hex));\n }\n }",
"int mo44965b();",
"long mo25074b();",
"public String generateMP() {\n\t\t\tString characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~`!@#$%^&*()-_=+[{]}\\\\|;:\\'\\\",<.>/?\";\n\t\t\tString pwd = RandomStringUtils.random(15, 0, 0, false, false, characters.toCharArray(), new SecureRandom());\n\t\t\treturn pwd;\n\t\t}",
"private static byte[] KDF(PGPDigestCalculator digCalc, ECPoint s, int keyLen, byte[] param)\n throws IOException\n {\n byte[] ZB = s.getAffineXCoord().getEncoded();\n\n OutputStream dOut = digCalc.getOutputStream();\n\n dOut.write(0x00);\n dOut.write(0x00);\n dOut.write(0x00);\n dOut.write(0x01);\n dOut.write(ZB);\n dOut.write(param);\n\n byte[] digest = digCalc.getDigest();\n\n byte[] key = new byte[keyLen];\n\n System.arraycopy(digest, 0, key, 0, key.length);\n\n return key;\n }",
"@Override\r\n\tpublic byte[] nextBytes(int len) {\n\t\tbyte[] bs = new byte[len];\r\n\t\ttry{\r\n\t\t\tSecureRandom random = SecureRandom.getInstance(\"SHA1PRNG\");\t\r\n\t\t\trandom.nextBytes(bs);\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn bs;\r\n\t}",
"private static BigInteger getPadding(BigInteger lp0, BigInteger lp1, int k) {\n\tsha1.update(lp0.toByteArray());\n\tsha1.update(lp1.toByteArray());\n\tsha1.update(BigInteger.valueOf(k).toByteArray());\n\treturn (new BigInteger(sha1.digest())).and(mask);\n }",
"public BigInteger[] multiply_G(BigInteger factor) \r\n{\r\n\tBigInteger[] voher = EXPList.nullVektor;\r\n\tBigInteger[] erg = new BigInteger[2];\r\n\tfor(int i=0;i<=255;i++)\r\n\t{\r\n\t\tif(factor.testBit(i)==true) \r\n\t\t{\r\n\t\t erg = addition(voher,EXPList.list[i]); \r\n\t\t voher = erg;\r\n\t\t} \r\n\t}\r\n\treturn erg; \r\n}",
"private void keyDiffieHellmanFinal(BigInteger B) {\r\n\t\tdiffie.setKey(diffie.generate(diffie.geta(), B, diffie.getp()));\r\n\t\tpresentkey = true;\r\n\t}",
"BigInteger generatePublicExponent(BigInteger p, BigInteger q) {\n return new BigInteger(\"65537\");\n }",
"private static BigInteger[] getPublicKeyOriginal(BigInteger in) \r\n{\r\n\tECNamedCurveParameterSpec spec = ECNamedCurveTable.getParameterSpec(\"secp256k1\"); \r\n\tbyte[] pubKey = spec.getG().multiply(in).getEncoded(false);\r\n\tbyte[] a = new byte[32];\r\n\tbyte[] b = new byte[32];\r\n\tSystem.arraycopy(pubKey, 1, a, 0, 32);\r\n\tSystem.arraycopy(pubKey, 33, b, 0, 32);\r\n\tBigInteger[] erg = new BigInteger[2];\r\n\terg[0] = new BigInteger(1,a);\r\n\terg[1] = new BigInteger(1,b);\r\n\treturn erg;\r\n}",
"abstract double rightProbability();",
"Multiplication createRandomMultiplication();",
"Multiplication createRandomMultiplication();",
"public int R_M(){\n\t\tBigInteger nminus1=n.subtract(BigInteger.ONE);\n\t\tdo{\n\t\t\tif(nminus1.mod(two.pow(a)).equals(BigInteger.ZERO)){\n\t\t\t\ttable.add(a);\n\t\t\t}\n\t\t\titerator++;\n\t\t\ta++;\n\t\t}while(!(two.pow(a).compareTo(n)>0));\n\t\t\n\t\ta=table.get(table.size()-1);\n\t\tBigInteger m=nminus1.divide(two.pow(a));\n\t\tint wlen=n.bitLength();\n\t\tBigInteger b;\n\t\tBigInteger z;\n\t\tfor(int i=0;i<iterations;i++){\n\t\t\tint straznik=0;\n\t\t\tint straznik1=0;\n\t\t\tdo{\n\t\t\t b=new BigInteger(wlen,new Random());\n\t\t\t}while(!(b.compareTo(BigInteger.ONE)>0) && !(b.compareTo(nminus1)<0));\n\t\t\tz=b.modPow(m, n);\n\t\t\tif(z.equals(BigInteger.ONE) || z.equals(nminus1)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfor(int j=0;j<a-1;j++){\n\t\t\t\t\tz=z.pow(2).mod(n);\n\t\t\t\t\tif(z.equals(nminus1)){\n\t\t\t\t\t\tstraznik++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(z.equals(BigInteger.ONE)){\n\t\t\t\t\t\tstraznik1++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(straznik==1){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(straznik1==1){\n\t\t\t\t\tgetComposite();\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\t}\n\t\t\tgetComposite();\n\t\t\treturn 0;\n\t\t}\n\t\tgetProbablyPrime();\n\t\treturn 1;\n\t\t}",
"double getExtremeSpikeProbability();",
"int baseHash(int hashKey,int length)\n\t{\n\t\tdouble constant = (Math.sqrt(3) - 1);\n\t\tint base = (int) Math.floor((length * ((constant* hashKey) - Math.floor(constant* hashKey)))); \n\t\treturn base; //mod value is not applied at the base hashLevel. It is in the insert/find/reinset respectively\n\t}",
"@Test\n public void testComputeForTLS10() throws CryptoException {\n byte[] secret = new byte[0];\n PRFAlgorithm prfAlgorithm = PRFAlgorithm.TLS_PRF_LEGACY;\n String label = \"master secret\";\n byte[] seed = new byte[60];\n int size = 48;\n\n byte[] result1 = TlsUtils.PRF_legacy(secret, label, seed, size);\n byte[] result2 = PseudoRandomFunction.compute(PRFAlgorithm.TLS_PRF_LEGACY, secret, label, seed, size);\n assertArrayEquals(result1, result2);\n\n /*\n * Test case 2: test the whole keyBlock generation process check, if master secret is computed correctly\n */\n DHClientKeyExchangeMessage message = new DHClientKeyExchangeMessage();\n message.setPublicKey(new byte[] { 1 });\n message.prepareComputations();\n message.getComputations().setPremasterSecret(ArrayConverter.hexStringToByteArray(\n \"17631f03fb5f59e65ef9b581bb6494e7304e2eaffb07ff7356cf62db1c44f4e4c15614909a3f2980c1908da2200924a23bc037963c204048cc77b1bcab5e6c9ef2c32928bcbdc0b664535885d46a9d4af4104eba4d7428c5741cf1c74bbd54d8e7ea16eaa126218286639a740fc39173e8989aea7f4b4440e1cad321315911fc4a8135d1217ebada1c70cb4ce99ff11dc8c8ca4ffc3c48a9f3f2143588a8fec147a6c3da4d36df18cf075eb7de187d83c7e3b7fd27124741a4b8809bed4f43ed9a434ce59c6a33277be96d8ef27b8e6a59d70bf6a04a86f04dfc37ab69ad90da53dfc1ea27f60a32ee7608b2197943bf8673dbe68003277bfd40b40d18b1a3bf\"));\n message.getComputations().setClientServerRandom(ArrayConverter.hexStringToByteArray(\n \"c8c9c788adbd9dc72b5dd0635f9e2576e09c87b67e045c026ffa3281069601fd594c07e445947b545a746fcbc094e12427e0286be2199300925a81be02bf5467\"));\n result1 = TlsUtils.PRF_legacy(message.getComputations().getPremasterSecret().getValue(), label,\n message.getComputations().getClientServerRandom().getValue(), size);\n result2 = PseudoRandomFunction.compute(PRFAlgorithm.TLS_PRF_LEGACY,\n message.getComputations().getPremasterSecret().getValue(), label,\n message.getComputations().getClientServerRandom().getValue(), size);\n assertArrayEquals(result1, result2);\n\n /*\n * check, if keyblock is computed correctly TLS_DHE_RSA_WITH_AES_256_CBC_SHA MAC Write Client 20 Bytes Mac Write\n * Server 20 Bytes Enc Write Client 32 Bytes Enc Write Server 32 Bytes IV Write Client 16 Bytes IV Write Server\n * 16 Bytes\n */\n byte[] serverClientRandom = ArrayConverter.hexStringToByteArray(\n \"4a8135d1217ebada1c70cb4ce99ff11dc8c8ca4ffc3c48a9f3f2143588a8fec147a6c3da4d36df18cf075eb7de187d83c7e3b7fd27124741a4b8809bed4f43ed9a434ce59c6a33277be96d8ef27b8e6a59d70bf6a04a86f04dfc37ab69ad90da53dfc1ea27f60a32ee7608b2197943bf8673dbe68003277bfd40b40d18b1a3bf17631f03fb5f59e65ef9b581bb6494e7304e2eaffb07ff7356cf62db1c44f4e4c15614909a3f2980c1908da2200924a23bc037963c204048cc77b1bcab5e6c9ef2c32928bcbdc0b664535885d46a9d4af4104eba4d7428c5741cf1c74bbd54d8e7ea16eaa126218286639a740fc39173e8989aea7f4b4440e1cad321315911fc\");\n result1 = TlsUtils.PRF_legacy(result1, \"key expansion\", serverClientRandom, 136);\n result2 = PseudoRandomFunction.compute(PRFAlgorithm.TLS_PRF_LEGACY, result2, \"key expansion\",\n serverClientRandom, 136);\n assertArrayEquals(result1, result2);\n }",
"public double power ( int num1, int num2, Credential aCrendential) throws RemoteException;",
"private int Sigma1(int x) {\n int a = ROTR(17, x);\n int b = ROTR(19, x);\n int c = x >>> 10;\n int ret = a ^ b ^ c;\n return ret;\n }",
"public static String generateTOTP256(String key, int returnDigits) throws GeneralSecurityException {\n Calendar currentDateTime = getCalendar();\n long timeInMilis = currentDateTime.getTimeInMillis();\n\n String steps = \"0\";\n long T = (timeInMilis - TIME_ZERO) / TIME_SLICE_X;\n steps = Long.toHexString(T).toUpperCase();\n\n // Just get a 16 digit string\n while (steps.length() < 16)\n steps = \"0\" + steps;\n return TOTP.generateTOTP256(key, steps, returnDigits);\n }",
"protected PKIMessage protectPKIMessage(PKIMessage msg, boolean badObjectId, String password, String keyId, int iterations) throws NoSuchAlgorithmException,\n NoSuchProviderException, InvalidKeyException {\n PKIHeader head = msg.getHeader();\n if(keyId != null) {\n \thead.setSenderKID(new DEROctetString(keyId.getBytes()));\n }\n // SHA1\n AlgorithmIdentifier owfAlg = new AlgorithmIdentifier(\"1.3.14.3.2.26\");\n // 567 iterations\n int iterationCount = iterations;\n DERInteger iteration = new DERInteger(iterationCount);\n // HMAC/SHA1\n AlgorithmIdentifier macAlg = new AlgorithmIdentifier(\"1.2.840.113549.2.7\");\n byte[] salt = \"foo123\".getBytes();\n DEROctetString derSalt = new DEROctetString(salt);\n\n // Create the new protected return message\n String objectId = \"1.2.840.113533.7.66.13\";\n if (badObjectId) {\n objectId += \".7\";\n }\n PBMParameter pp = new PBMParameter(derSalt, owfAlg, iteration, macAlg);\n AlgorithmIdentifier pAlg = new AlgorithmIdentifier(new DERObjectIdentifier(objectId), pp);\n head.setProtectionAlg(pAlg);\n PKIBody body = msg.getBody();\n PKIMessage ret = new PKIMessage(head, body);\n\n // Calculate the protection bits\n byte[] raSecret = password.getBytes();\n byte[] basekey = new byte[raSecret.length + salt.length];\n for (int i = 0; i < raSecret.length; i++) {\n basekey[i] = raSecret[i];\n }\n for (int i = 0; i < salt.length; i++) {\n basekey[raSecret.length + i] = salt[i];\n }\n // Construct the base key according to rfc4210, section 5.1.3.1\n MessageDigest dig = MessageDigest.getInstance(owfAlg.getObjectId().getId(), \"BC\");\n for (int i = 0; i < iterationCount; i++) {\n basekey = dig.digest(basekey);\n dig.reset();\n }\n // For HMAC/SHA1 there is another oid, that is not known in BC, but the\n // result is the same so...\n String macOid = macAlg.getObjectId().getId();\n byte[] protectedBytes = ret.getProtectedBytes();\n Mac mac = Mac.getInstance(macOid, \"BC\");\n SecretKey key = new SecretKeySpec(basekey, macOid);\n mac.init(key);\n mac.reset();\n mac.update(protectedBytes, 0, protectedBytes.length);\n byte[] out = mac.doFinal();\n DERBitString bs = new DERBitString(out);\n\n // Finally store the protection bytes in the msg\n ret.setProtection(bs);\n return ret;\n }",
"public static byte[] getGenotipo(int f,int nB){\n byte g[] = new byte[nB];\n int aux,nf = f;\n int cont = 0;\n for(int i =nB-1; i>=0;i--){\n aux = (int) Math.pow(2, i);\n if(nf >= aux){\n nf = nf - aux;\n g[cont] = 1;\n }\n else\n g[cont] = 0;\n cont ++;\n }\n return g;\n }",
"public CryptographyKeysCreator() {\n Random random = new Random();\n BigInteger prime1 = BigInteger.probablePrime(256, random);\n BigInteger prime2 = BigInteger.probablePrime(256, random);\n primesMultiplied = prime1.multiply(prime2);\n BigInteger phi = prime1.subtract(BigInteger.ONE).multiply(prime2.subtract(BigInteger.ONE));\n encryptingBigInt = BigInteger.probablePrime(256, random);\n\n while (phi.gcd(encryptingBigInt).compareTo(BigInteger.ONE) > 0 && encryptingBigInt.compareTo(phi) < 0) {\n encryptingBigInt = encryptingBigInt.add(BigInteger.ONE);\n }\n\n decryptingBigInt = encryptingBigInt.modInverse(phi);\n }",
"public abstract int getNFactor();",
"private String pswd(){\n try{\n PBEKeySpec spec = new PBEKeySpec(this.Creator.toUpperCase().toCharArray(), this.Time.getBytes(), 100, 512);\n SecretKeyFactory skf = SecretKeyFactory.getInstance(\"PBKDF2WithHmacSHA1\");\n //System.out.println(\"pswd=\"+this.toHex(skf.generateSecret(spec).getEncoded()));\n return this.toHex(skf.generateSecret(spec).getEncoded());\n }catch(InvalidKeySpecException | NoSuchAlgorithmException e){\n e.printStackTrace();\n }\n return null;\n }",
"float mo56157b();",
"@Test\n public void testPowerMod_0_0_2() {\n NaturalNumber n = new NaturalNumber2(0);\n NaturalNumber p = new NaturalNumber2(0);\n NaturalNumber m = new NaturalNumber2(2);\n CryptoUtilities.powerMod(n, p, m);\n assertEquals(\"1\", n.toString());\n assertEquals(\"0\", p.toString());\n assertEquals(\"2\", m.toString());\n }",
"private static String getBinaryDigit(int iter, int seed)\r\n {\r\n if(iter == 0) {return \"\";}\r\n String result = seed % 2 == 0 ? \"0\" : \"1\";\r\n return result + getBinaryDigit(iter - 1, (int)Math.pow(seed,2) % (p * q));\r\n }",
"public BigInteger getSharedSecret(BigInteger composite)\n {\n return composite.modPow(privateKey, modulus);\n }",
"private BigInteger setPrivateKey(BigInteger modulus){\n BigInteger privateKey = null;\n \n do {\n \tprivateKey = BigInteger.probablePrime(N / 2, random);\n }\n /* n'a aucun autre diviseur que 1 */\n while (privateKey.gcd(phi0).intValue() != 1 ||\n /* qu'il est plus grand que p1 et p2 */\n privateKey.compareTo(modulus) != -1 ||\n /* qu'il est plus petit que p1 * p2 */\n privateKey.compareTo(p1.max(p2)) == -1);\n \n return privateKey;\n }",
"@Override\n public String generateKey(int round) {\n return this.key.substring(4 * round, 4 * round + 16);\n }",
"private static int modExp(int a, int b, int n) {\n\n // get a char array of the bits in b\n char[] k = (Integer.toBinaryString(b)).toCharArray();\n\n // initialize variables\n int c = 0, f = 1;\n // loop over every bit in k\n for (int i = 0; i < k.length; i ++) {\n\n // for every bit, i.e. if 0 or 1, do this\n c *= 2;\n f = (f * f) % n;\n\n // If current bit is equal to 1, then do this\n if (k[i] == '1') {\n c += 1;\n f = (f * a) % n;\n }\n }\n\n // returns the remainder\n return f;\n }",
"float getSpecialProb();",
"void mo33731Pw();",
"OpenSSLKey mo134201a();",
"static char mutateBaseWithProb(char base, double p)\n\t{\n\t\tif(rand.nextDouble() < p)\n\t\t{\n\t\t\tint baseAsInt = baseToInt(base);\n\t\t\tchar newBase = intToBase((baseAsInt + rand.nextInt(3) + 1)%4);\n\t\t\tif(Character.isLowerCase(base))\n\t\t\t{\n\t\t\t\tnewBase += 'a' - 'A';\n\t\t\t}\n\t\t\treturn newBase;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn base;\n\t\t}\n\t}",
"private static BigInteger Hash(String term, int printBits)\n {\n BigInteger baseHash = new BigInteger(\"14695981039346656037\");\n Long seed = 1099511628211L;\n long hash_mod = (long)java.lang.Math.pow(2, printBits);\n for(int i = 0; i < term.length(); i++) {\n baseHash = baseHash.multiply(new BigInteger(seed.toString())).remainder(new BigInteger(hash_mod+\"\"));\n baseHash = baseHash.xor(BigInteger.valueOf((long)term.charAt(i)));\n }\n return baseHash;\n }",
"private String generateToken () {\n SecureRandom secureRandom = new SecureRandom();\n long longToken;\n String token = \"\";\n for ( int i = 0; i < 3; i++ ) {\n longToken = Math.abs( secureRandom.nextLong() );\n token = token.concat( Long.toString( longToken, 34 + i ) );//max value of radix is 36\n }\n return token;\n }",
"@Override\n public byte[] generateKey() throws ProtocolException, IOException {\n BigInteger p, q, n, e, d;\n Polynomial pol;\n do {\n // we want e such that GCD(e, phi(p*q))=1. as e is actually fixed\n // below, then we need to search for suitable p and q\n p = generateCofactor();\n q = generateCofactor();\n n = computeModulus(p, q);\n e = generatePublicExponent(p, q);\n } while (!verifyCofactors(p, q, e));\n d = computePrivateExponent(p, q, e);\n pol = generatePolynomial(p, q, d);\n BigInteger[] shares = ProtocolUtil.generateShares(pol, tparams.getParties());\n RSAPrivateCrtKey[] packedShares = packShares(e, shares, n);\n try {\n storeShares(packedShares);\n } catch (SmartCardException ex) {\n throw new ProtocolException(\n \"Error while communicating with smart card: \" + ex.toString());\n }\n\n RSAPublicKey pk = SignatureUtil.RSA.paramsToRSAPublicKey(e, n);\n return pk.getEncoded();\n }",
"public void generateB(){\n\t\t\tfor(int i = 0;i < w.length;i++){\n\t\t\t\tb[i] = w[i].multiply(r).mod(q);\n\t\t\t}\n\t}",
"BigInteger getPower_consumption();",
"public static ECPoint scalmult(ECPoint P, BigInteger kin){\n //ECPoint R=P; - incorrect\n ECPoint R = ECPoint.POINT_INFINITY,S = P;\n BigInteger k = kin.mod(p);\n int length = k.bitLength();\n //System.out.println(\"length is\" + length);\n byte[] binarray = new byte[length];\n for(int i=0;i<=length-1;i++){\n binarray[i] = k.mod(TWO).byteValue();\n k = k.divide(TWO);\n }\n /*for(int i = length-1;i >= 0;i--){\n System.out.print(\"\" + binarray[i]);\n }*/\n\n for(int i = length-1;i >= 0;i--){\n // i should start at length-1 not -2 because the MSB of binarry may not be 1\n R = doublePoint(R);\n if(binarray[i]== 1)\n R = addPoint(R, S);\n }\n return R;\n }",
"int kelilingPP(int a, int b){\r\n return 2*(a+b);\r\n }",
"public GenRSAKey() {\n initComponents();\n }",
"public static void main(String[] args) {\n KeyPairGenerator keygen = null;\n try {\n keygen = KeyPairGenerator.getInstance(\"RSA\");\n SecureRandom secrand = new SecureRandom();\n // secrand.setSeed(\"17\".getBytes());//初始化随机产生器\n keygen.initialize(2048, secrand);\n KeyPair keys = keygen.genKeyPair();\n PublicKey publicKey = keys.getPublic();\n PrivateKey privateKey = keys.getPrivate();\n String pubKey = Base64.encode(publicKey.getEncoded());\n String priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n System.out.println(\"priKey = \" + new String(priKey));\n\n/*\n X509EncodedKeySpec keySpec = new X509EncodedKeySpec(pubkey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PublicKey publicKey = keyFactory.generatePublic(keySpec);\n pubKey = Base64.encode(publicKey.getEncoded());\n System.out.println(\"pubKey = \" + new String(pubKey));\n*/\n\n/*\n PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(prikey.getEncoded());\n KeyFactory keyFactory = KeyFactory.getInstance(\"RSA\");\n PrivateKey privateKey = keyFactory.generatePrivate(keySpec);\n priKey = Base64.encode(privateKey.getEncoded());\n System.out.println(\"priKey = \" + new String(priKey));\n*/\n //(N,e)是公钥\n RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey;\n System.out.println(\"RSAPublicKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPublicKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPublicKey.getModulus().toString());//n\n System.out.println(\"PublicExponent.length=\" +\n rsaPublicKey.getPublicExponent().bitLength());\n System.out.println(\"PublicExponent=\" + rsaPublicKey.getPublicExponent().toString());//e\n\n\n //(N,d)是私钥\n RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) privateKey;\n System.out.println(\"RSAPrivateKey:\");\n System.out.println(\"Modulus.length=\" +\n rsaPrivateKey.getModulus().bitLength());\n System.out.println(\"Modulus=\" + rsaPrivateKey.getModulus().toString());//n\n System.out.println(\"PrivateExponent.length=\" +\n rsaPrivateKey.getPrivateExponent().bitLength());\n System.out.println(\"PrivateExponent=\" + rsaPrivateKey.getPrivateExponent().toString());//d\n\n String encodeData = encode(\" public static String encode(String toEncode,String D, String N) {\\n\" +\n \" // BigInteger var2 = new BigInteger(\\\"17369712262290647732768133445861332449863405383733306695896586821166245382729380222118948668590047591903813382253186640467063376463309880263824085810383552963627855603429835060435976633955217307266714318344160886538360012623239010786668755679438900124601074924850696725233212494777766999123952653273738958617798460338184668049410136792403729341479373919634041235053823478242208651592611582439749292909499663165109004083820192135244694907138372731716013807836312280426304459316963033144149631900633817073029029413556757588486052978078614048837784810650766996280232645714319416096306667876390555673421669667406990886847\\\");\\n\" +\n \" // BigInteger var3 = new BigInteger(\\\"65537\\\");\\n\" +\n \" int MAX_ENCRYPT_BLOCK = 128;\\n\" +\n \" int offSet = 0;\\n\" +\n \" byte[] cache;\\n\" +\n \" int i = 0;\\n\" +\n \" ByteArrayOutputStream out = new ByteArrayOutputStream();\\n\" +\n \" try {\\n\" +\n \" RSAPrivateKeySpec rsaPrivateKeySpec = new java.security.spec.RSAPrivateKeySpec(new BigInteger(N),new BigInteger(D));\\n\" +\n \" KeyFactory keyFactory = java.security.KeyFactory.getInstance(\\\"RSA\\\");\\n\" +\n \" PrivateKey privateKey = keyFactory.generatePrivate(rsaPrivateKeySpec);\\n\" +\n \" Cipher cipher = javax.crypto.Cipher.getInstance(\\\"RSA\\\");\\n\" +\n \" cipher.init(Cipher.ENCRYPT_MODE,privateKey);\\n\" +\n \"\\n\" +\n \" byte[] data = toEncode.getBytes(StandardCharsets.UTF_8);\\n\" +\n \" int inputLen = data.length;\\n\" +\n \" // 对数据分段加密\\n\" +\n \" while (inputLen - offSet > 0) {\\n\" +\n \" if (inputLen - offSet > MAX_ENCRYPT_BLOCK) {\\n\" +\n \" cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK);\\n\" +\n \" } else {\\n\" +\n \" cache = cipher.doFinal(data, offSet, inputLen - offSet);\\n\" +\n \" }\\n\" +\n \" out.write(cache, 0, cache.length);\\n\" +\n \" i++;\\n\" +\n \" offSet = i * MAX_ENCRYPT_BLOCK;\\n\" +\n \" }\\n\" +\n \" byte[] datas = out.toByteArray();\\n\" +\n \" out.close();\\n\" +\n \"\\n\" +\n \" //byte[] datas = datas = cipher.doFinal(toEncode.getBytes());\\n\" +\n \" datas = org.apache.commons.codec.binary.Base64.encodeBase64(datas);\\n\" +\n \" return new String(datas,StandardCharsets.UTF_8);\\n\" +\n \" } catch (NoSuchAlgorithmException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeySpecException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (NoSuchPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (InvalidKeyException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (BadPaddingException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IllegalBlockSizeException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" } catch (IOException e) {\\n\" +\n \" e.printStackTrace();\\n\" +\n \" }\\n\" +\n \" return null;\\n\" +\n \" }\",rsaPrivateKey.getPrivateExponent().toString(),rsaPrivateKey.getModulus().toString());\n String decodeData = decode(encodeData,rsaPublicKey.getPublicExponent().toString(),rsaPublicKey.getModulus().toString());\n\n System.out.println(encodeData);\n System.out.println(decodeData);\n\n } catch (NoSuchAlgorithmException e) {\n e.printStackTrace();\n }/* catch (InvalidKeySpecException e) {\n e.printStackTrace();\n }*/\n }",
"private SecretKey generatePukBaseKey(byte[] derivedKeyBytes) {\n // Extract bytes 10-25 as recovery puk base key bytes\n final byte[] recoveryPukBaseKeyBytes = new byte[16];\n System.arraycopy(derivedKeyBytes, 10, recoveryPukBaseKeyBytes, 0, 16);\n return keyConvertor.convertBytesToSharedSecretKey(recoveryPukBaseKeyBytes);\n }",
"public int generate(int k) {\n // PUT YOUR CODE HERE\n }",
"long getAlgIdExt();",
"@LargeTest\n public void testMandelbrotfp64() {\n TestAction ta = new TestAction(TestName.MANDELBROT_DOUBLE);\n runTest(ta, TestName.MANDELBROT_DOUBLE.name());\n }",
"public double blending(double u, int n, int k) {\n // Insert your code here\n return coeff(n, k) * Math.pow(u, k) * Math.pow(1 - u, n - k);\n }",
"private String generateSecretKey(){\n SecureRandom random = new SecureRandom();\n byte[] bytes = new byte[20];\n\n random.nextBytes(bytes);\n Base32 base32 = new Base32();\n return base32.encodeToString(bytes);\n }",
"private static long f(long m) {\n\t\tlong k = 1;\r\n\t\tfor (long i=1; i<=m; i++){\r\n\t\t\tk *= i;\r\n\t\t}\r\n\t\treturn k;\r\n\t}",
"short generateKeyAndWrap(byte[] applicationParameter, short applicationParameterOffset, byte[] publicKey, short publicKeyOffset, byte[] keyHandle, short keyHandleOffset, byte info);",
"private String calcRebillTPS() throws java.security.NoSuchAlgorithmException {\n\t\tString tps = BP_SECRET_KEY + BP_MERCHANT + TRANSACTION_TYPE + REBILL_ID;\n\t\treturn md5(tps);\n\t}",
"public static void SM2Sign_fixed(String digest_str, String dA_str, String k_str){\n\n BigInteger digest = new BigInteger(digest_str,16);\n BigInteger dA = new BigInteger(dA_str,16);\n BigInteger k = new BigInteger(k_str,16);\n outer:\n for (;true;) {\n\n //BigInteger k = new BigInteger(256, random);\n //BigInteger k =new BigInteger(\"6CB28D99385C175C94F94E934817663FC176D925DD72B727260DBAAE1FB2F96F\",16);\n ECPoint Q = basePoint.multiply(k).normalize();\n if (debug) {\n System.out.println(\"kG x = \" + Q.getAffineXCoord().toBigInteger().toString(16).toUpperCase());\n System.out.println(\"kG y = \" + Q.getAffineYCoord().toBigInteger().toString(16).toUpperCase());\n }\n BigInteger r = digest.add(Q.getAffineXCoord().toBigInteger()).mod(n);\n if (r.signum() == 0 | r.add(k).equals(n)) {\n\n continue outer;\n }\n\n BigInteger Inv;\n Inv = dA.add(one).modInverse(n);\n if (debug) {\n System.out.println(\"Inv = \" + Inv.toString(16).toUpperCase());\n }\n BigInteger s = Inv.multiply(k.subtract(r.multiply(dA))).mod(n);\n if (s.signum()==0) continue outer;\n else {\n if(debug) {\n System.out.println(\"r = \" + r.toString(16).toUpperCase());\n System.out.println(\"s = \" + s.toString(16).toUpperCase());\n }\n Sign_r = r;\n Sign_s = s;\n Sign_r_str = r.toString(16).toUpperCase();\n Sign_s_str = s.toString(16).toUpperCase();\n return;\n }\n }\n\n }",
"@Override\n public byte[] generateSignature() throws CryptoException, DataLengthException {\n if (!forSigning) {\n throw new IllegalStateException(\"CL04 Signer not initialised for signature generation.\");\n }\n\n try {\n CL04SignSecretPairingKeySerParameter sk = (CL04SignSecretPairingKeySerParameter) pairingKeySerParameter;\n Pairing pairing = PairingFactory.getPairing(sk.getParameters());\n final Element alpha = pairing.getZr().newRandomElement().getImmutable();\n final Element a = sk.getG().powZn(alpha);\n final List<Element> A = sk.getZ().stream().map(a::powZn).collect(Collectors.toCollection(ArrayList::new));\n final Element b = a.powZn(sk.getY()).getImmutable();\n final List<Element> B = A.stream().map(Ai -> Ai.powZn(sk.getY())).collect(Collectors.toCollection(ArrayList::new));\n final Element xTimesY = alpha.mul(sk.getX().mul(sk.getY()));\n final Element c = a.powZn(sk.getX()).mul(commitment.powZn(xTimesY)).getImmutable();\n\n Element[] signElements = new Element[3 + 2 * messages.size()];\n signElements[0] = a;\n signElements[1] = b;\n signElements[2] = c;\n for (int i = 0; i < messages.size(); i++) {\n signElements[3 + i] = A.get(i);\n signElements[3 + messages.size() + i] = B.get(i);\n }\n return derEncode(signElements);\n } catch (IOException e) {\n e.printStackTrace();\n }\n return null;\n }",
"private void encodeIntoResponse(ServletResponse resp, BigInteger[] factors) {\n\r\n }",
"public void keyDerivation(String uid) {\n\t\tElement e1 = Hash(HashType.H1, uid);// Hash1(uidByte); G1\n\t\tElement e2 = Hash(HashType.H2, uid);// Hash2(uidByte); G1\n\t\t// System.out.println(\"generate sk \" + uid);\n\t\tkeys.setISK(0,e1.powZn(pairing.getZr().newElementFromBytes(keys.getMSK(0))).toBytes());\n\t\tkeys.setISK(1,e2.powZn(pairing.getZr().newElementFromBytes(keys.getMSK(1))).toBytes());\n\t\t\n\t\tmpkg1= pairing.getG1().newElementFromBytes(keys.getMPK(0)).getElementPowPreProcessing();\n\t\tisksk1 = pairing.getG1().newElementFromBytes(keys.getISK(0)).getElementPowPreProcessing();\n\t}",
"C3676k mo12649b();",
"private static String genString(){\n final String ALPHA_NUMERIC_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n int pwLength = 14; //The longer the password, the more likely the user is to change it.\n StringBuilder pw = new StringBuilder();\n while (pwLength-- != 0) {\n int character = (int)(Math.random()*ALPHA_NUMERIC_STRING.length());\n pw.append(ALPHA_NUMERIC_STRING.charAt(character));\n }\n return pw.toString(); //\n }",
"public BigInteger keyDiffieHellmanSecond(BigInteger[] numbers) {\r\n\t\tBigInteger A = numbers[1];\r\n\t\tBigInteger g = numbers[2];\r\n\t\tBigInteger p = numbers[3];\r\n\t\tBigInteger B = diffie.generate(diffie.geta(), g, p);\r\n\t\tdiffie.setKey(diffie.generate(diffie.geta(), A, p));\r\n\t\tpresentkey = true;\r\n\t\treturn B;\r\n\t}",
"public String Crypt(String s);",
"private void ModInvBigNbr(int[] a, int[] inv, int[] b, int NumberLength) {\r\n\t\tint i;\r\n\t\tint Dif, E;\r\n\t\tint st1, st2;\r\n\t\tlong Yaa, Yab; // 2^E * A' = Yaa A + Yab B\r\n\t\tlong Yba, Ybb; // 2^E * B' = Yba A + Ybb B\r\n\t\tlong Ygb0; // 2^E * Mu' = Yaa Mu + Yab Gamma + Ymb0 B0\r\n\t\tlong Ymb0; // 2^E * Gamma' = Yba Mu + Ybb Gamma + Ygb0 B0\r\n\t\tint Iaa, Iab, Iba, Ibb;\r\n\t\tlong Tmp1, Tmp2, Tmp3, Tmp4, Tmp5;\r\n\t\tint B0l;\r\n\t\tint invB0l;\r\n\t\tint Al, Bl, T1, Gl, Ml;\r\n\t\tlong carry1, carry2, carry3, carry4;\r\n\t\tint Yaah, Yabh, Ybah, Ybbh;\r\n\t\tint Ymb0h, Ygb0h;\r\n\t\tlong Pr1, Pr2, Pr3, Pr4, Pr5, Pr6, Pr7;\r\n\t\tlong[] B = this.CalcAuxModInvBB;\r\n\t\tlong[] CalcAuxModInvA = this.CalcAuxModInvA;\r\n\t\tlong[] CalcAuxModInvB = this.CalcAuxModInvB;\r\n\t\tlong[] CalcAuxModInvMu = this.CalcAuxModInvMu;\r\n\t\tlong[] CalcAuxModInvGamma = this.CalcAuxModInvGamma;\r\n\r\n\t\tif (NumberLength >= 2 && b[NumberLength - 1] == 0 && b[NumberLength - 2] < 0x40000000) {\r\n\t\t\tNumberLength--;\r\n\t\t}\r\n\t\tConvert31To32Bits(a, CalcAuxModInvA, NumberLength);\r\n\t\tConvert31To32Bits(b, CalcAuxModInvB, NumberLength);\r\n\t\tSystem.arraycopy(CalcAuxModInvB, 0, B, 0, NumberLength);\r\n\t\tB0l = (int) B[0];\r\n\t\tinvB0l = B0l; // 2 least significant bits of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 4 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 8 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 16 LSB of inverse correct.\r\n\t\tinvB0l = invB0l * (2 - B0l * invB0l); // 32 LSB of inverse correct.\r\n\t\tfor (i = NumberLength - 1; i >= 0; i--) {\r\n\t\t\tCalcAuxModInvGamma[i] = 0;\r\n\t\t\tCalcAuxModInvMu[i] = 0;\r\n\t\t}\r\n\t\tCalcAuxModInvMu[0] = 1;\r\n\t\tDif = 0;\r\n\t\touter_loop: for (;;) {\r\n\t\t\tIaa = Ibb = 1;\r\n\t\t\tIab = Iba = 0;\r\n\t\t\tAl = (int) CalcAuxModInvA[0];\r\n\t\t\tBl = (int) CalcAuxModInvB[0];\r\n\t\t\tE = 0;\r\n\t\t\tif (Bl == 0) {\r\n\t\t\t\tfor (i = NumberLength - 1; i >= 0; i--) {\r\n\t\t\t\t\tif (CalcAuxModInvB[i] != 0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif (i < 0)\r\n\t\t\t\t\tbreak; // Go out of loop if CalcAuxModInvB = 0\r\n\t\t\t}\r\n\t\t\tfor (;;) {\r\n\t\t\t\tT1 = 0;\r\n\t\t\t\twhile ((Bl & 1) == 0) {\r\n\t\t\t\t\tif (E == 31) {\r\n\t\t\t\t\t\tYaa = Iaa;\r\n\t\t\t\t\t\tYab = Iab;\r\n\t\t\t\t\t\tYba = Iba;\r\n\t\t\t\t\t\tYbb = Ibb;\r\n\t\t\t\t\t\tGl = (int) CalcAuxModInvGamma[0];\r\n\t\t\t\t\t\tMl = (int) CalcAuxModInvMu[0];\r\n\t\t\t\t\t\tDif++;\r\n\t\t\t\t\t\tT1++;\r\n\t\t\t\t\t\tYaa <<= T1;\r\n\t\t\t\t\t\tYab <<= T1;\r\n\t\t\t\t\t\tYmb0 = (-(int) Yaa * Ml - (int) Yab * Gl) * invB0l;\r\n\t\t\t\t\t\tYgb0 = (-Iba * Ml - Ibb * Gl) * invB0l;\r\n\t\t\t\t\t\tcarry1 = carry2 = carry3 = carry4 = 0;\r\n\t\t\t\t\t\tYaah = (int) (Yaa >> 32);\r\n\t\t\t\t\t\tYabh = (int) (Yab >> 32);\r\n\t\t\t\t\t\tYbah = (int) (Yba >> 32);\r\n\t\t\t\t\t\tYbbh = (int) (Ybb >> 32);\r\n\t\t\t\t\t\tYmb0h = (int) (Ymb0 >> 32);\r\n\t\t\t\t\t\tYgb0h = (int) (Ygb0 >> 32);\r\n\t\t\t\t\t\tYaa &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYab &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYba &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYbb &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYmb0 &= 0xFFFFFFFFL;\r\n\t\t\t\t\t\tYgb0 &= 0xFFFFFFFFL;\r\n\r\n\t\t\t\t\t\tst1 = Yaah * 6 + Yabh * 2 + Ymb0h;\r\n\t\t\t\t\t\tst2 = Ybah * 6 + Ybbh * 2 + Ygb0h;\r\n\t\t\t\t\t\tfor (i = 0; i < NumberLength; i++) {\r\n\t\t\t\t\t\t\tPr1 = Yaa * (Tmp1 = CalcAuxModInvMu[i]);\r\n\t\t\t\t\t\t\tPr2 = Yab * (Tmp2 = CalcAuxModInvGamma[i]);\r\n\t\t\t\t\t\t\tPr3 = Ymb0 * (Tmp3 = B[i]);\r\n\t\t\t\t\t\t\tPr4 = (Pr1 & 0xFFFFFFFFL) + (Pr2 & 0xFFFFFFFFL) + (Pr3 & 0xFFFFFFFFL) + carry3;\r\n\t\t\t\t\t\t\tPr5 = Yaa * (Tmp4 = CalcAuxModInvA[i]);\r\n\t\t\t\t\t\t\tPr6 = Yab * (Tmp5 = CalcAuxModInvB[i]);\r\n\t\t\t\t\t\t\tPr7 = (Pr5 & 0xFFFFFFFFL) + (Pr6 & 0xFFFFFFFFL) + carry1;\r\n\t\t\t\t\t\t\tswitch (st1) {\r\n\t\t\t\t\t\t\tcase -9:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -8:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -7:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -6:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -5:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -4:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -3:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -2:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\t\tcarry3 = -Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\tcarry3 = 0;\r\n\t\t\t\t\t\t\t\tcarry1 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\t\tcarry3 = Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry1 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcarry3 += (Pr1 >>> 32) + (Pr2 >>> 32) + (Pr3 >>> 32) + (Pr4 >> 32);\r\n\t\t\t\t\t\t\tcarry1 += (Pr5 >>> 32) + (Pr6 >>> 32) + (Pr7 >> 32);\r\n\t\t\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\t\t\tCalcAuxModInvMu[i - 1] = Pr4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t\tCalcAuxModInvA[i - 1] = Pr7 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tPr1 = Yba * Tmp1;\r\n\t\t\t\t\t\t\tPr2 = Ybb * Tmp2;\r\n\t\t\t\t\t\t\tPr3 = Ygb0 * Tmp3;\r\n\t\t\t\t\t\t\tPr4 = (Pr1 & 0xFFFFFFFFL) + (Pr2 & 0xFFFFFFFFL) + (Pr3 & 0xFFFFFFFFL) + carry4;\r\n\t\t\t\t\t\t\tPr5 = Yba * Tmp4;\r\n\t\t\t\t\t\t\tPr6 = Ybb * Tmp5;\r\n\t\t\t\t\t\t\tPr7 = (Pr5 & 0xFFFFFFFFL) + (Pr6 & 0xFFFFFFFFL) + carry2;\r\n\t\t\t\t\t\t\tswitch (st2) {\r\n\t\t\t\t\t\t\tcase -9:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -8:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -7:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -6:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -5:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -4:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -3:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -2:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = -Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase -1:\r\n\t\t\t\t\t\t\t\tcarry4 = -Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 0:\r\n\t\t\t\t\t\t\t\tcarry4 = 0;\r\n\t\t\t\t\t\t\t\tcarry2 = 0;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 - Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 + Tmp2 - Tmp3;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\t\tcarry4 = Tmp1 + Tmp2;\r\n\t\t\t\t\t\t\t\tcarry2 = Tmp4 + Tmp5;\r\n\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tcarry4 += (Pr1 >>> 32) + (Pr2 >>> 32) + (Pr3 >>> 32) + (Pr4 >> 32);\r\n\t\t\t\t\t\t\tcarry2 += (Pr5 >>> 32) + (Pr6 >>> 32) + (Pr7 >> 32);\r\n\t\t\t\t\t\t\tif (i > 0) {\r\n\t\t\t\t\t\t\t\tCalcAuxModInvGamma[i - 1] = Pr4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t\tCalcAuxModInvB[i - 1] = Pr7 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvA[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry1 -= Yaa;\r\n\t\t\t\t\t\t\tcarry2 -= Yba;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvB[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry1 -= Yab;\r\n\t\t\t\t\t\t\tcarry2 -= Ybb;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvMu[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry3 -= Yaa;\r\n\t\t\t\t\t\t\tcarry4 -= Yba;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif ((int) CalcAuxModInvGamma[i - 1] < 0) {\r\n\t\t\t\t\t\t\tcarry3 -= Yab;\r\n\t\t\t\t\t\t\tcarry4 -= Ybb;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tCalcAuxModInvA[i - 1] = carry1 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvB[i - 1] = carry2 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvMu[i - 1] = carry3 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tCalcAuxModInvGamma[i - 1] = carry4 & 0xFFFFFFFFL;\r\n\t\t\t\t\t\tcontinue outer_loop;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tBl >>= 1;\r\n\t\t\t\t\tDif++;\r\n\t\t\t\t\tE++;\r\n\t\t\t\t\tT1++;\r\n\t\t\t\t} /* end while */\r\n\t\t\t\tIaa <<= T1;\r\n\t\t\t\tIab <<= T1;\r\n\t\t\t\tif (Dif >= 0) {\r\n\t\t\t\t\tDif = -Dif;\r\n\t\t\t\t\tif (((Al + Bl) & 3) == 0) {\r\n\t\t\t\t\t\tT1 = Iba;\r\n\t\t\t\t\t\tIba += Iaa;\r\n\t\t\t\t\t\tIaa = T1;\r\n\t\t\t\t\t\tT1 = Ibb;\r\n\t\t\t\t\t\tIbb += Iab;\r\n\t\t\t\t\t\tIab = T1;\r\n\t\t\t\t\t\tT1 = Bl;\r\n\t\t\t\t\t\tBl += Al;\r\n\t\t\t\t\t\tAl = T1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tT1 = Iba;\r\n\t\t\t\t\t\tIba -= Iaa;\r\n\t\t\t\t\t\tIaa = T1;\r\n\t\t\t\t\t\tT1 = Ibb;\r\n\t\t\t\t\t\tIbb -= Iab;\r\n\t\t\t\t\t\tIab = T1;\r\n\t\t\t\t\t\tT1 = Bl;\r\n\t\t\t\t\t\tBl -= Al;\r\n\t\t\t\t\t\tAl = T1;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (((Al + Bl) & 3) == 0) {\r\n\t\t\t\t\t\tIba += Iaa;\r\n\t\t\t\t\t\tIbb += Iab;\r\n\t\t\t\t\t\tBl += Al;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tIba -= Iaa;\r\n\t\t\t\t\t\tIbb -= Iab;\r\n\t\t\t\t\t\tBl -= Al;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tDif--;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (CalcAuxModInvA[0] != 1) {\r\n\t\t\tSubtractBigNbr32(B, CalcAuxModInvMu, CalcAuxModInvMu, NumberLength);\r\n\t\t}\r\n\t\tif ((int) CalcAuxModInvMu[i = NumberLength - 1] < 0) {\r\n\t\t\tAddBigNbr32(B, CalcAuxModInvMu, CalcAuxModInvMu, NumberLength);\r\n\t\t}\r\n\t\tfor (; i >= 0; i--) {\r\n\t\t\tif (B[i] != CalcAuxModInvMu[i])\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t\tif (i < 0 || B[i] < CalcAuxModInvMu[i]) { // If B < Mu\r\n\t\t\tSubtractBigNbr32(CalcAuxModInvMu, B, CalcAuxModInvMu, NumberLength); // Mu <- Mu - B\r\n\t\t}\r\n\t\tConvert32To31Bits(CalcAuxModInvMu, inv, NumberLength);\r\n\t}"
] | [
"0.57844466",
"0.575543",
"0.5749234",
"0.57123256",
"0.55081534",
"0.54967076",
"0.5465042",
"0.543004",
"0.5418321",
"0.5391421",
"0.53769475",
"0.53542674",
"0.53469723",
"0.5286034",
"0.5275315",
"0.52722585",
"0.5269224",
"0.52682906",
"0.52669305",
"0.52639496",
"0.5242323",
"0.5222565",
"0.51823807",
"0.51617867",
"0.5143472",
"0.5132984",
"0.5092506",
"0.50866675",
"0.5072764",
"0.5065875",
"0.50542945",
"0.5040889",
"0.5027301",
"0.50262177",
"0.50087935",
"0.500818",
"0.49979392",
"0.49911135",
"0.49897873",
"0.49834052",
"0.49769124",
"0.49691546",
"0.49659657",
"0.49599802",
"0.49587438",
"0.4948791",
"0.49476382",
"0.49457604",
"0.49411455",
"0.49411455",
"0.49384892",
"0.493816",
"0.49330658",
"0.49294254",
"0.49224016",
"0.49192417",
"0.4914492",
"0.49113488",
"0.49071476",
"0.49069536",
"0.49045312",
"0.49023908",
"0.48996833",
"0.48935503",
"0.4880972",
"0.48768374",
"0.4874811",
"0.4873851",
"0.48690403",
"0.4868706",
"0.48615524",
"0.4856163",
"0.48530212",
"0.4852421",
"0.48508406",
"0.4846657",
"0.48465323",
"0.48345646",
"0.4833719",
"0.4821385",
"0.48183885",
"0.481342",
"0.48079428",
"0.48077354",
"0.48076454",
"0.4794398",
"0.4792188",
"0.47908652",
"0.47876823",
"0.4785728",
"0.47838768",
"0.478226",
"0.4782102",
"0.47811535",
"0.47793636",
"0.47601327",
"0.47581866",
"0.47561407",
"0.47545233",
"0.47544008"
] | 0.6665942 | 0 |
Called when an item in the navigation drawer is selected. | void onNavigationDrawerItemSelected(int position); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void onNavigationDrawerItemSelected(int resourceId);",
"@Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n menuItem.setChecked(true);\n // close drawer when item is tapped\n drawer.closeDrawers();\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n\n return true;\n }",
"@Override\n\t\t\tpublic void menuSelected(MenuItem selectedItem)\n\t\t\t{\n\n\t\t\t}",
"@Override\n\t\t\tpublic void menuSelected(MenuItem selectedItem)\n\t\t\t{\n\n\t\t\t}",
"@Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n menuItem.setChecked(true);\n // close drawer when item is tapped\n\n navDrawer.closeDrawers();\n\n int itemId = menuItem.getItemId();\n switch (itemId) {\n case R.id.nav_sale:\n Intent intent = new Intent(getApplicationContext(), SaleActivity.class);\n startActivity(intent);\n return true;\n }\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n displaySelected(id);\n// if (id == R.id.nav_camera) {\n// // Handle the camera action\n// } else if (id == R.id.nav_gallery) {\n//\n// } else if (id == R.id.nav_slideshow) {\n//\n// } else if (id == R.id.nav_manage) {\n//\n// } else if (id == R.id.nav_share) {\n//\n// } else if (id == R.id.nav_send) {\n//\n// }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n\n displaySelectedScreen(item.getItemId());\n\n item.setChecked(true);\n\n drawer.closeDrawers();\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n displaySelectedScreen(id);\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\r\n @Override\r\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n displaySelectedScreen(id);\r\n\r\n return true;\r\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n menuItem.setChecked(true);\n // close drawer when item is tapped\n switch (menuItem.getItemId()) {\n case R.id.weather:\n Intent net = new Intent (MainActivity.this, WeatherActivity.class);\n startActivity(net);\n break;\n case R.id.settings:\n Intent conf = new Intent(MainActivity.this, PreferencesActivity.class);\n startActivity(conf);\n break;\n default:\n break;\n }\n mDrawerLayout.closeDrawers();\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n // Handle the camera action\n handleselection(\"home\");\n } else if (id == R.id.nav_profile) {\n handleselection(\"profile\");\n } else if (id == R.id.nav_favorite_meals) {\n handleselection(\"favorite meals\");\n } else if (id == R.id.nav_diet_plan) {\n handleselection(\"diet plan\");\n } else if (id == R.id.nav_news) {\n handleselection(\"news\");\n } else if (id == R.id.nav_share) {\n handleselection(\"share\");\n } else if (id == R.id.nav_send) {\n handleselection(\"send\");\n } else if (id == R.id.nav_people) {\n handleselection(\"people\");\n }else if (id == R.id.nav_settings) {\n handleselection(\"settings\");\n }else if (id == R.id.nav_support) {\n handleselection(\"support\");\n }else if (id == R.id.nav_about) {\n handleselection(\"about\");\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void selectDrawerItem(MenuItem menuItem) {\n Fragment fragment = null;\n Class fragmentClass;\n switch(menuItem.getItemId()) {\n case R.id.nav_home:\n fragmentClass = MainFragment.class;\n startFragment(fragmentClass);\n break;\n case R.id.nav_fav:\n fragmentClass = FavoriteFragment.class;\n startFragment(fragmentClass);\n break;\n case R.id.nav_upd:\n openLink(\"https://play.google.com/store/apps/details?id=com.satyajit.gamex\");\n\n break;\n case R.id.nav_settings:\n fragmentClass = SettingsFragment.class;\n startFragment(fragmentClass);\n break;\n case R.id.nav_rate:\n openLink(\"https://play.google.com/store/apps/details?id=com.satyajit.gamex\");\n break;\n case R.id.nav_share:\n shareApp();\n break;\n }\n\n\n if (menuItem.getItemId()!= R.id.nav_share && menuItem.getItemId()!= R.id.nav_rate && menuItem.getItemId()!= R.id.nav_upd ) {\n // Highlight the selected item has been done by NavigationView\n menuItem.setChecked(true);\n // Set action bar title\n setTitle(menuItem.getTitle());\n\n }\n\n else {\n\n\n }\n // Close the navigation drawer\n mDrawer.closeDrawers();\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n // Handle the camera action\n Intent intent = new Intent(getApplicationContext(), Home.class);\n startActivity(intent);\n } else if (id == R.id.nav_timer) {\n\n Intent intent = new Intent(getApplicationContext(), Timer.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_preferences) {\n\n Intent intent = new Intent(getApplicationContext(), Preferences.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_ingredients) {\n Intent intent = new Intent(getApplicationContext(), SavedIngredientsList.class);\n startActivity(intent);\n }\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n startActivity(ChangeInfoActivity.class);\n } else if (id == R.id.nav_gallery) {\n startActivity(AddHdActivity.class);\n } else if (id == R.id.nav_slideshow) {\n startActivity(HDongDeleteActivity.class);\n } else if (id == R.id.nav_manage) {\n startActivity(FriendActivity.class);\n } else if (id == R.id.nav_share) {\n KeyValueStorage keyValueStorage = new KeyValueStorage(this);\n keyValueStorage.putString(Config.IS_AUTO_LOGIN,\"1\");\n startActivity(LoginActivity.class);\n finish();\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\r\n public boolean onNavigationItemSelected(int itemPosition, long itemId) {\r\n\r\n return true;\r\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.record_sum) {\n // Jump to the record sum page\n Intent intent = new Intent(AccountKeep.this, AccountSum.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_talk) {\n Intent intent = new Intent(AccountKeep.this, TalkInput.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id == R.id.nav_hot){\n\n }else if(id == R.id.nav_special){\n\n }else if(id == R.id.nav_preference){\n\n }else if(id == R.id.nav_findGame){\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.notification) {\n Intent intent = new Intent(this, Notification.class);\n startActivity(intent);\n } else if (id == R.id.pastActivity) {\n isPastSevenData = true;\n ((TextView)findViewById(R.id.activityHeading)).setText(\"Past Activities\");\n activitySegment.refresh(isPastSevenData);\n }else if (id == R.id.todaysActivity) {\n isPastSevenData = false;\n ((TextView)findViewById(R.id.activityHeading)).setText(\"Today's Activities\");\n activitySegment.refresh(isPastSevenData);\n } else if (id == R.id.mySchedule) {\n Intent intent = new Intent(this, Scheduler.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n menuItem.setChecked(true);\n // close drawer when item is tapped\n mdrawer.closeDrawers();\n\n String choice = menuItem.getTitle().toString();\n\n switch (choice) {\n case \"Register\":\n Intent i = new Intent(getBaseContext(), SignIn.class);\n startActivity(i);\n break;\n case \"Log In\":\n Intent p = new Intent(getBaseContext(), LoginActivity.class);\n startActivity(p);\n break;\n\n case \"Profile Picture\":\n Intent pic = new Intent(getBaseContext(), ImageUpload.class);\n startActivity(pic);\n break;\n\n case \"Users\":\n Intent users = new Intent(getBaseContext(), Userlist.class);\n startActivity(users);\n break;\n\n case \"Chats\":\n Intent chats = new Intent(getBaseContext(), ChatList.class);\n startActivity(chats);\n break;\n }\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n } else if (id == R.id.nav_collect) {\n Intent intent = new Intent(MainActivity.this, SearchActivity.class);\n intent.setAction(Constants.Action.SHOW_COLLECT);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n kondisi(id);\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n menuItem.setChecked(true);\n // close drawer when item is tapped\n mDrawerLayout.closeDrawers();\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n if (menuItem.getItemId() == R.id.nav_song){\n Intent intent = new Intent(SongList.this,SongList.class);\n startActivity(intent);}\n if (menuItem.getItemId() == R.id.nav_artist){\n Intent intent = new Intent(SongList.this,ArtistList.class);\n startActivity(intent);}\n if (menuItem.getItemId() == R.id.nav_playlist){\n Intent intent = new Intent(SongList.this,PlaylistList.class);\n startActivity(intent);}\n if (menuItem.getItemId() == R.id.nav_album){\n Intent intent = new Intent(SongList.this,AlbumList.class);\n startActivity(intent);}\n if (menuItem.getItemId() == R.id.nav_genre){\n Intent intent = new Intent(SongList.this,GenreList.class);\n startActivity(intent);}\n return true;\n }",
"@Override\r\n public boolean onNavigationItemSelected(MenuItem menuItem) {\r\n // Set item in checked state\r\n menuItem.setChecked(true);\r\n\r\n // TODO: handle navigation\r\n\r\n // Closing drawer on item click\r\n mDrawerLayout.closeDrawers();\r\n return true;\r\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_createalbums) {\n Intent intent = new Intent(this, CreateAlbum.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_addphoto) {\n Intent intent = new Intent(this, ChooseAlbumActivity.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_findusers) {\n Intent intent = new Intent(this, UserListActivity.class);\n startActivity(intent);\n\n } else if(id == R.id.nav_eventlog) {\n Intent intent = new Intent(this, LogActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n \tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n \t\treturn true;\n \t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_add_items) {\n Intent intent=new Intent(getApplicationContext(), AddItems.class);\n startActivity(intent);\n } else if (id == R.id.nav_search_items) {\n Intent intent=new Intent(getApplicationContext(), SearchItems.class);\n startActivity(intent);\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n\n } else if\n (id == R.id.post_by_subject) {\n Intent intent = new Intent(this, Branch.class);\n startActivity(intent);\n } else if (id == R.id.nav_slideshow) {\n } else if (id == R.id.nav_manage) {\n } else if (id == R.id.sign_out_drawer) {\n Intent intent = new Intent(this, Login.class);\n intent.putExtra(\"action\", \"logout\");\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n Intent intent = new Intent(StateActivity.this, SetTempActivity.class);\n startActivity(intent);\n finish();\n } else if (id == R.id.nav_gallery) {\n //state\n Intent intent = new Intent(StateActivity.this, StateActivity.class);\n startActivity(intent);\n finish();\n\n } else if (id == R.id.nav_share) {\n Intent intent = new Intent(StateActivity.this, AboutActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n /*\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n */\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\r\n @Override\r\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n if (id == R.id.nav_camera) {\r\n // Handle the camera action\r\n } else if (id == R.id.nav_gallery) {\r\n\r\n } else if (id == R.id.nav_slideshow) {\r\n\r\n } else if (id == R.id.nav_manage) {\r\n\r\n } else if (id == R.id.nav_share) {\r\n\r\n } else if (id == R.id.nav_send) {\r\n\r\n }\r\n\r\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\r\n drawer.closeDrawer(GravityCompat.START);\r\n return true;\r\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"private void selectDrawerItem(MenuItem menuItem) {\n Fragment fragment = null;\n Class fragmentClass;\n boolean flag = false;\n switch (menuItem.getItemId()) {\n case R.id.nav_organization_fragment:\n fragmentClass = OrganizationFragment.class;\n flag = true;\n break;\n case R.id.nav_home_fragment:\n fragmentClass = HomeFragment.class;\n flag = true;\n break;\n case R.id.nav_template_fragment:\n fragmentClass = TemplateFragment.class;\n flag = true;\n break;\n case R.id.nav_checklist_fragment:\n fragmentClass = ChecklistFragment.class;\n flag = true;\n break;\n case R.id.nav_activity_fragment:\n fragmentClass = ActivityFragment.class;\n flag = true;\n break;\n case R.id.nav_settings_fragment:\n fragmentClass = SettingFragment.class;\n flag = true;\n break;\n case R.id.nav_logout:\n fragmentClass = HomeFragment.class;\n revokeAccess();\n break;\n default:\n fragmentClass = HomeFragment.class;\n }\n\n try {\n Bundle args = new Bundle();\n args.putInt(\"status_checklist\", 0);\n fragment = (Fragment) fragmentClass.newInstance();\n fragment.setArguments(args);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n if (flag) {\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager\n .beginTransaction()\n .add(R.id.flContent, fragment)\n .commit();\n }\n\n\n\n menuItem.setChecked(true); // Highlight the selected item has been done by NavigationView\n setTitle(menuItem.getTitle());\n mDrawerLayout.closeDrawers();\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.driveboard) {\n Intent intent = new Intent(RideBoard.this, DriveBoard.class);\n startActivity(intent);\n } else if (id == R.id.rideboard) {\n\n } else if (id == R.id.messenger) {\n Intent intent = new Intent(RideBoard.this, MainActivity.class);\n startActivity(intent);\n } else if (id == R.id.profile) {\n Intent intent = new Intent(RideBoard.this, UserProfile.class);\n startActivity(intent);\n\n } else if (id == R.id.notification) {\n Intent intent = new Intent(RideBoard.this, NotificationViewActivity.class);\n startActivity(intent);\n }\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\r\n @Override\r\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //TODO handle navigation clicks\r\n\r\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\r\n drawer.closeDrawer(GravityCompat.START);\r\n return true;\r\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n displaySelectedScreen(item.getItemId());\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.profile) {\n // Handle the camera action\n } else if (id == R.id.map) {\n for (int i = 0; i < mAdapterItems.size(); i++) {\n mAdapterItems.get(i).setKey(mAdapterKeys.get(i));\n }\n Intent intent = new Intent(getApplicationContext(), MapsActivity.class);\n intent.putExtra(\"REPORTS\", mAdapterItems);\n startActivity(intent);\n } else if (id == R.id.graphs) {\n Intent intent = new Intent(getApplicationContext(), GraphsActivity.class);\n startActivity(intent);\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n\n } else if (id == R.id.nav_gallery) {\n Intent intent = new Intent(this, PersonGroupListActivity.class);\n startActivity(intent);\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n Intent intent = new Intent(this, TestActivity.class);\n startActivity(intent);\n }\n// else if (id == R.id.nav_slideshow) {\n//\n// }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n Intent intent;\n\n if (id == R.id.nav_home) {\n // Handle the camera action\n } else if (id == R.id.nav_log) {\n intent = new Intent(this,QuestLog.class);\n startActivity(intent);\n } else if (id == R.id.nav_groups) {\n\n } else if (id == R.id.nav_friends) {\n intent = new Intent(this, Friends.class);\n startActivity(intent);\n } else if (id == R.id.nav_request) {\n\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_lib) {\n // Handle the camera action\n startActivity(new Intent(this, LibraryActivity.class));\n } else if (id == R.id.nav_resto) {\n startActivity(new Intent(this, FoodmenuActivity.class));\n } else if (id == R.id.nav_notif) {\n startActivity(new Intent(this, NoticeActivity.class));\n } else if (id == R.id.nav_booksearch){\n startActivity(new Intent(this, ListActivity.class));\n }\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"private void itemSelection(int mSelectedId) {\n switch(mSelectedId){\n\n case R.id.navigation_Home:\n mDrawerLayout.closeDrawer(GravityCompat.START);\n\n break;\n\n case R.id.navigation_PreEngineering:\n mDrawerLayout.closeDrawer(GravityCompat.START);\n break;\n\n case R.id.navigation_Setup:\n mDrawerLayout.closeDrawer(GravityCompat.START);\n break;\n\n case R.id.navigation_Create_Report:\n mDrawerLayout.closeDrawer(GravityCompat.START);\n break;\n\n case R.id.navigation_Open_Report:\n mDrawerLayout.closeDrawer(GravityCompat.START);\n break;\n\n case R.id.navigation_Current_Report:\n mDrawerLayout.closeDrawer(GravityCompat.START);\n break;\n }\n\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n Intent intent;\n\n if (id == R.id.nav_home) {\n intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n\n } else if (id == R.id.nav_all_rooms) {\n intent = new Intent(this, AllRoomsActivity.class);\n intent.putExtra(\"action\",\"view\");\n startActivity(intent);\n\n } else if (id == R.id.nav_all_items) {\n intent = new Intent(this, AllItemsActivity.class);\n intent.putExtra(\"activity\", \"addItem\");\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\r\n @Override\r\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n if (id == R.id.nav_music) {\r\n\r\n } else if (id == R.id.nav_settting) {\r\n\r\n }\r\n\r\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\r\n drawer.closeDrawer(GravityCompat.START);\r\n return true;\r\n }",
"@Override\n public boolean onNavigationItemSelected(final MenuItem item) {\n item.setChecked(true);\n mNavItemId = item.getItemId();\n\n mDrawerLayout.closeDrawer(GravityCompat.START);\n mDrawerActionHandler.postDelayed(new Runnable() {\n @Override\n public void run() {\n navigateTo((item.getItemId()));\n }\n }, DRAWER_CLOSE_DELAY_MS);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_fav) {\n startActivity(new Intent(getApplicationContext(), CategoryActivity.class));\n }\n else if (id == R.id.nav_history) {\n startActivity(new Intent(getApplicationContext(), HistoryActivity.class));\n }\n else if (id == R.id.nav_book) {\n SharedPreferences prefs = getSharedPreferences(\"bookmarks\", MODE_PRIVATE);\n int size = prefs.getInt(\"bookmark_size\", 0);\n Intent intent = new Intent(getApplicationContext(), BookmarkActivity.class);\n startActivity(intent);\n }\n else if (id == R.id.nav_settings) {\n SharedPreferences prefs = getSharedPreferences(\"bookmarks\", MODE_PRIVATE);\n Intent intent = new Intent(getApplicationContext(), MainActivity.class);\n startActivity(intent);\n }\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n finish();\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\r\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n item.setChecked(true);\r\n // close drawer when item is tapped\r\n drawer.closeDrawers();\r\n switch (item.getItemId()){\r\n case R.id.nav_out:\r\n Logout();\r\n return true;\r\n case R.id.nav_choice:\r\n Intent choiceIntent = new Intent(getApplicationContext(), ChoiceMaker.class);\r\n choiceIntent.putExtra(\"username\", user.getUsername());\r\n startActivity(choiceIntent);\r\n return true;\r\n case R.id.nav_pref:\r\n Intent prefIntent = new Intent(getApplicationContext(), CarePreference.class);\r\n prefIntent.putExtra(\"username\", user.getUsername());\r\n startActivity(prefIntent);\r\n return true;\r\n case R.id.nav_display:\r\n Intent displayIntent = new Intent(getApplicationContext(), AcpResultDisplay.class);\r\n displayIntent.putExtra(\"username\", user.getUsername());\r\n startActivity(displayIntent);\r\n return true;\r\n\r\n }\r\n return false;\r\n }",
"@Override\r\n\tpublic void onMenuItemSelected(MenuItem item) {\n\r\n\t}",
"@Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n Intent intent = null;\n switch (id) {\n\n case R.id.home_h:\n intent = new Intent(this, MainActivity.class);\n break;\n\n case R.id.nav_info:\n intent = new Intent(this, Information.class);\n break;\n\n default:\n intent = new Intent(this, ToDo.class);\n }\n\n startActivity(intent);\n finish();\n /* Closing the drawer by getting reference to the drawer layout, and calling its closeDrawer() method. */\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START); // using START as the drawer is attached to the activity's start edge\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_sys_app) {\n // Handle the camera action\n } else if (id == R.id.nav_user_app) {\n\n } else if (id == R.id.nav_category) {\n\n } else if (id == R.id.nav_permis) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"public void onItemSelected(int id);",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Latest\n Intent i = new Intent(getApplicationContext(), LastestActivity.class);\n startActivity(i);\n finish();\n } else if (id == R.id.nav_gallery) {\n//Cat\n Intent i = new Intent(getApplicationContext(), CategoriesActivity.class);\n startActivity(i);\n finish();\n } else if (id == R.id.nav_slideshow) {\n//Favor\n\n Intent i = new Intent(getApplicationContext(), FavouriteActivity.class);\n startActivity(i);\n finish();\n } else if (id == R.id.nav_manage) {\n//GIFs\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_Perfil) {\n Intent intent = new Intent(getApplicationContext(), Activity_Perfil.class);\n startActivity(intent);\n } else if (id == R.id.nav_NewPost) {\n Intent intent = new Intent(getApplicationContext(), Activity_New_Post.class);\n startActivity(intent);\n } else if (id == R.id.nav_slideshow) {\n Intent intent = new Intent(getApplicationContext(), Activity_Login.class);\n startActivity(intent);\n } else if (id == R.id.nav_manage) {\n Intent intent = new Intent(getApplicationContext(), Activity_Registro.class);\n startActivity(intent);\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_approval) {\n startActivity(new Intent(this, WellsDailyDataForApprove.class));\n } else if (id == R.id.nav_logout) {\n presenter.logout();\n } else if (id == R.id.nav_report) {\n startActivity(new Intent(this, WellsReportsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.librarydraw) {\n\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem menuItem) {\n menuItem.setChecked(true);\n int id = menuItem.getItemId();\n if(id == R.id.nav_account){\n Intent intent = new Intent(RunningResultsActivity.this,ProfileActivity.class);\n startActivity(intent);\n }\n else if(id == R.id.nav_challenges){\n Intent intent = new Intent(RunningResultsActivity.this,ChallengesActivity.class);\n startActivity(intent);\n }\n else if(id == R.id.nav_friends){\n Intent intent = new Intent(RunningResultsActivity.this, HistoryActivity.class);\n startActivity(intent);\n }\n else if(id == R.id.history){\n Intent intent = new Intent(RunningResultsActivity.this,HistoryActivity.class);\n startActivity(intent);\n }\n else if(id == R.id.nav_leaderboard){\n Intent intent = new Intent(RunningResultsActivity.this,LeaderBoardActivity.class);\n startActivity(intent);\n }\n // close drawer when item is tapped\n mDrawerLayout.closeDrawers();\n\n // Add code here to update the UI based on the item selected\n // For example, swap UI fragments here\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_group) {\n Intent intent1 = new Intent(this, Grupa.class);\n startActivity(intent1);\n } else if (id == R.id.nav_costs) {\n Intent intent1 = new Intent(this, Wydatki.class);\n startActivity(intent1);\n } else if (id == R.id.nav_notifications) {\n Intent intent1 = new Intent(this, Przypomnienia.class);\n startActivity(intent1);\n } else if (id == R.id.nav_budget) {\n Intent intent1 = new Intent(this, Budzet.class);\n startActivity(intent1);\n } else if (id == R.id.nav_bugs) {\n Intent intent1 = new Intent(this, Bugi.class);\n startActivity(intent1);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n\t\t\tpublic void onPageSelected(int arg0) {\n\t\t\t\tactionBar.setSelectedNavigationItem(arg0);\n\t\t\t}",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.nav_gallery) {\n // Lorsque je clique sur \"Mes inscriptions\".\n Intent intent = new Intent(this, MesInscriptions.class);\n intent.putExtra(\"login\", login);\n intent.putExtra(\"role\", userRole);\n startActivity(intent);\n }else if(id == R.id.nav_share){\n //Lorsque je clique sur le mode admin\n Intent intent = new Intent(this, Admin.class);\n intent.putExtra(\"login\", login);\n intent.putExtra(\"role\", userRole);\n startActivity(intent);\n }\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n startActivity(new Intent(MainActivity.this, DBTestActivity.class));\n return true;\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_settings) {\n startActivity(new Intent(MainActivity.this,SettingsActivity.class));\n return true;\n } else if (id == R.id.nav_help) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"protected void selectNavDrawerItem(int position) {\n // Gets fragment selection from abstract class\n Fragment fragment = getFragmentByPosition(position);\n\n // If fragment is null\n if (fragment == null) {\n Log.e(TAG, \"Fragment not found\");\n return;\n }\n\n // Replaces current fragment\n FragmentManager fragmentManager = getSupportFragmentManager();\n fragmentManager.beginTransaction().replace(R.id.fragmentContainer, fragment).commit();\n\n // update selected item and title, then close the drawer\n setTitle(mDrawerChoices[position]);\n mDrawerList.setItemChecked(position, true);\n mDrawerLayout.closeDrawer(mDrawerList);\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_tools) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_home) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_tools) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }",
"@Override\n public boolean onNavigationItemSelected(MenuItem item) {\n // Handle navigation view item clicks here.\n int id = item.getItemId();\n if (id == R.id.nav_inicio) {\n selector();\n } else if (id == R.id.nav_carro) {\n flat(true, carro);\n } else if (id == R.id.nav_idioma) {\n //No se aplica de momento.\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }"
] | [
"0.76861554",
"0.7586287",
"0.7558048",
"0.7558048",
"0.75480205",
"0.74716806",
"0.7454571",
"0.74367344",
"0.74111027",
"0.7382962",
"0.73758155",
"0.7332955",
"0.72750425",
"0.72521573",
"0.72469074",
"0.72412056",
"0.72362214",
"0.7234137",
"0.72328377",
"0.7225312",
"0.7217041",
"0.7197436",
"0.7196693",
"0.7196327",
"0.7189613",
"0.71881115",
"0.7187333",
"0.7182658",
"0.7165883",
"0.71621424",
"0.7158436",
"0.7147489",
"0.7142341",
"0.7142341",
"0.7139613",
"0.7134869",
"0.71251315",
"0.7124462",
"0.7121356",
"0.7120186",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.7119413",
"0.71181315",
"0.7113236",
"0.710975",
"0.71064067",
"0.7101002",
"0.7095164",
"0.7089366",
"0.70853627",
"0.7083339",
"0.7082776",
"0.7082175",
"0.70817995",
"0.70810443",
"0.7079167",
"0.70758533",
"0.70706403",
"0.70638317",
"0.7060685",
"0.7060431",
"0.705914",
"0.7058482",
"0.704177",
"0.704015",
"0.7035194",
"0.7034658",
"0.70343226",
"0.7027412",
"0.7027412",
"0.70273715"
] | 0.77958024 | 1 |
TODO Autogenerated method stub | @Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
updatePrefSummary(findPreference(key));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}",
"@Override\n\tpublic void comer() {\n\t\t\n\t}",
"@Override\n public void perish() {\n \n }",
"@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}",
"@Override\n\tpublic void anular() {\n\n\t}",
"@Override\n\tprotected void getExras() {\n\n\t}",
"@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}",
"@Override\n\tpublic void entrenar() {\n\t\t\n\t}",
"@Override\n\tpublic void nadar() {\n\t\t\n\t}",
"@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}",
"@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}",
"@Override\n\tprotected void interr() {\n\t}",
"@Override\n\tpublic void emprestimo() {\n\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void grabar() {\n\t\t\n\t}",
"@Override\n\tpublic void gravarBd() {\n\t\t\n\t}",
"@Override\r\n\tpublic void rozmnozovat() {\n\t}",
"@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}",
"@Override\n protected void getExras() {\n }",
"@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}",
"@Override\n\tpublic void nefesAl() {\n\n\t}",
"@Override\n\tpublic void ligar() {\n\t\t\n\t}",
"@Override\n public void func_104112_b() {\n \n }",
"@Override\n\tprotected void initdata() {\n\n\t}",
"@Override\n\tpublic void nghe() {\n\n\t}",
"@Override\n public void function()\n {\n }",
"@Override\n public void function()\n {\n }",
"public final void mo51373a() {\n }",
"@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}",
"@Override\n public void inizializza() {\n\n super.inizializza();\n }",
"@Override\n\tprotected void initData() {\n\t\t\n\t}",
"@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}",
"@Override\n\tpublic void sacrifier() {\n\t\t\n\t}",
"@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}",
"public void designBasement() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}",
"public void gored() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\r\n\t}",
"@Override\n\tpublic void einkaufen() {\n\t}",
"@Override\n protected void initialize() {\n\n \n }",
"public void mo38117a() {\n }",
"@Override\n\tprotected void getData() {\n\t\t\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}",
"@Override\n\tpublic void one() {\n\t\t\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}",
"private stendhal() {\n\t}",
"@Override\n\tprotected void update() {\n\t\t\n\t}",
"@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tprotected void initData() {\n\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\t\t\n\t}",
"@Override\n public void init() {\n\n }",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\n\tprotected void initialize() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\r\n\tpublic void init() {\n\t\t\r\n\t}",
"@Override\n\tpublic void debite() {\n\t\t\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"@Override\r\n\tpublic void init() {\n\r\n\t}",
"public contrustor(){\r\n\t}",
"@Override\n\tprotected void initialize() {\n\n\t}",
"@Override\r\n\tpublic void dispase() {\n\r\n\t}",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"public void mo55254a() {\n }",
"@Override\n\tpublic void dtd() {\n\t\t\n\t}",
"@Override\n\tprotected void logic() {\n\n\t}",
"@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}",
"public void mo4359a() {\n }",
"@Override\r\n\tprotected void initialize() {\n\r\n\t}",
"@Override\n public void memoria() {\n \n }",
"@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}",
"private RepositorioAtendimentoPublicoHBM() {\r\t}",
"@Override\n protected void initialize() \n {\n \n }",
"@Override\r\n\tpublic void getProposition() {\n\r\n\t}",
"@Override\n\tpublic void particular1() {\n\t\t\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n\tpublic void init() {\n\n\t}",
"@Override\n protected void prot() {\n }",
"@Override\r\n\tpublic void init()\r\n\t{\n\t}",
"@Override\n\tprotected void initValue()\n\t{\n\n\t}",
"public void mo55254a() {\n }"
] | [
"0.6671074",
"0.6567672",
"0.6523024",
"0.6481211",
"0.6477082",
"0.64591026",
"0.64127725",
"0.63762105",
"0.6276059",
"0.6254286",
"0.623686",
"0.6223679",
"0.6201336",
"0.61950207",
"0.61950207",
"0.61922914",
"0.6186996",
"0.6173591",
"0.61327106",
"0.61285484",
"0.6080161",
"0.6077022",
"0.6041561",
"0.6024072",
"0.6020252",
"0.59984857",
"0.59672105",
"0.59672105",
"0.5965777",
"0.59485507",
"0.5940904",
"0.59239364",
"0.5910017",
"0.5902906",
"0.58946234",
"0.5886006",
"0.58839184",
"0.58691067",
"0.5857751",
"0.58503544",
"0.5847024",
"0.58239377",
"0.5810564",
"0.5810089",
"0.5806823",
"0.5806823",
"0.5800025",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5792378",
"0.5790187",
"0.5789414",
"0.5787092",
"0.57844025",
"0.57844025",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5774479",
"0.5761362",
"0.57596046",
"0.57596046",
"0.575025",
"0.575025",
"0.575025",
"0.5747959",
"0.57337177",
"0.57337177",
"0.57337177",
"0.5721452",
"0.5715831",
"0.57142824",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.57140535",
"0.5711723",
"0.57041645",
"0.56991017",
"0.5696783",
"0.56881124",
"0.56774884",
"0.56734604",
"0.56728",
"0.56696945",
"0.5661323",
"0.5657007",
"0.5655942",
"0.5655942",
"0.5655942",
"0.56549734",
"0.5654792",
"0.5652974",
"0.5650185"
] | 0.0 | -1 |
/ Activities occur when an intent is received | @Override
public void onReceive(Context context, Intent intent) {
int msgType = intent.getIntExtra("NOTIF_TYPE", 0); // grabs the notification message type
int uniqueID = intent.getIntExtra("ID", 0); // grabs the ID
String msgExpire = "Your food has expired!";
String msgSoonExpire = "Your food is about to expire!";
if (msgType == 0) {
createNotification(context, "Fridge Manager", msgExpire, "Alarm", uniqueID);
}
else {
createNotification(context, "Fridge Manager", msgSoonExpire, "Alarm", uniqueID);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onNewIntent(Intent intent) {\n }",
"@Override\n public void onNewIntent(Activity activity, Intent data) {\n }",
"@Override\n protected void onNewIntent(Intent intent){\n handleIntent(intent);\n }",
"@Override\n public void onNewIntent(Intent intent) {\n }",
"@Override\n protected void onNewIntent(Intent intent) {\n }",
"void startNewActivity(Intent intent);",
"@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n handleIntent(intent);\n }",
"void mo21580A(Intent intent);",
"@Override\n protected void onHandleIntent(Intent intent) {\n\n }",
"@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}",
"@Override\n\tprotected void onHandleIntent(Intent intent) {\n\n\t}",
"@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }",
"void intentHasBeenReceivedThroughTheBroadCast(Intent intent);",
"@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n handleIntent(intent);\n }",
"@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }",
"@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }",
"public void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n handleIntent(intent);\n }",
"@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tsuper.onReceive(context, intent);\n\n\t\tLog.d(TAG, \"onReceive==============>\");\n\t\t\n\t\tif (intent.getAction().equals(CLICK_ACTION)) {\n\t\t\tToast.makeText(context, \"OK!!!!!\", Toast.LENGTH_LONG).show();\n\n\t\t\t// final Intent intent2 = new Intent(context, MainActivity.class);\n\t\t\t// intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t// context.startActivity(intent2);\n\n\t\t\tIntent intent2 = new Intent(Intent.ACTION_MAIN);\n\t\t\tintent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\tintent2.putExtra(\"scene\", \"news\");\n\t\t\tComponentName cn = new ComponentName(\"com.youhao.DoctorOnline\",\n\t\t\t\t\t\"com.youhao.DoctorOnline.DoctorOnlineActivity\");\n\t\t\tintent2.setComponent(cn);\n\t\t\tcontext.startActivity(intent2);\n\n\t\t\t// Intent intent1 = new\n\t\t\t// Intent(\"com.example.helloandroidtest.start\");\n\t\t\t// context.startService(intent1);\n\t\t}\n\t}",
"@Override\n\t\t\t\tpublic void onNewIntent(TiRootActivity activity, Intent intent)\n\t\t\t\t{\n\t\t\t\t\tTiActivity.this.onNewIntent(intent);\n\t\t\t\t}",
"@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\thandleIntent(getIntent());\r\n\t}",
"@Override\r\nprotected void onNewIntent(Intent intent) {\n\tsuper.onNewIntent(intent);\r\nSystem.out.println(\"onNewIntent\");\r\n}",
"void onCreate(Intent intent);",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n intent = getIntent();\n }",
"@Override\r\n public void onNewIntent(Intent intent){\r\n super.onNewIntent(intent);\r\n\r\n //changes the intent returned by getIntent()\r\n setIntent(intent);\r\n }",
"@Override\n\tpublic void onNewIntent(Intent intent) {\n\t\tsetIntent(intent);\n\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n\n gerarNotificacaoTomarRemedio(context, new Intent(context , MainActivity.class));\n }",
"public void onButtonMyReceiverIntent(View view) {\n\n Intent myCustomIntent = new Intent(this, CustomIntent.class);\n startActivity(myCustomIntent);\n\n\n }",
"void start(Intent intent, IntentFilter filter, IIntentCallback callback, IEclipseContext context);",
"@Override\n protected void onHandleIntent(Intent workIntent) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n\n Intent intentMessage = new Intent(context, MessageActivity.class);\n intentMessage.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intentMessage);\n }",
"protected abstract Intent getIntent();",
"@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n Log.e(TAG, \"onNew Intent \" + this.getClass().getName());\n }",
"@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\tSystem.out.println(\"instakk\");\n\t\t}",
"@Override\n public void run() {\n startActivity(intent);\n }",
"@Override\n public List<ReportingMessage> onActivityCreated(Activity activity, Bundle bundle) {\n merchant.trackIncomingIntent(applicationContext, activity.getIntent());\n return null;\n }",
"public void onReceive(Context context, Intent intent) {\n // Intent intentPanel = new Intent(context.getApplicationContext(), GlobalPanelUI.class);\n // intentPanel.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n // context.startActivity(intentPanel);\n }",
"public void Volgende(Intent intent){\r\n\r\n startActivity(intent);\r\n\r\n }",
"public void intentHandler() {\n Intent intent = getIntent();\n if (intent.hasExtra(\"DATA\")) {\n data = (String[]) getIntent().getSerializableExtra(\"DATA\");\n recievedPosition = (int) getIntent().getSerializableExtra(\"POS\");\n if(recievedPosition != 0){\n IOException e = new IOException();\n try {\n itemArrAdapt.updateItem(recievedPosition, data, e);\n this.setPrefs();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }\n } else {\n // Start Normal\n }\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n }",
"@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t}",
"@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\r\n\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n switch (intent.getAction() ) {\n case \"com.example.android.a1nba\":\n Toast.makeText(context, \"A2 nba \", Toast.LENGTH_LONG).show();\n break;\n case \"com.example.android.a1mlb\":\n Toast.makeText(context, \"A2 mlb \", Toast.LENGTH_LONG).show();\n break;\n }\n }",
"@Override\n public void startActivity(Intent intent) {\n startActivity(intent, null);\n }",
"@Override\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\n\t\tsetIntent(intent);\n\t}",
"void intentPass(Activity activity, Class classname) {\n Intent i = new Intent(activity, classname);\n i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n startActivity(i);\n enterAnimation();\n }",
"@Override\r\n public void onNewIntent(Intent intent){\r\n \t\r\n \tthis.activateExamBoard(intent);\r\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(\"SELECTSTUDIO\")) {\n Studiotype startingstudio = Studiotype.valueOf(intent.getStringExtra(\"launchstudio\"));\n switch (startingstudio) {\n case RiskFactor:\n Intent i = new Intent(context, RiskFactor.class);\n i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(i);\n return;\n case Product:\n case Simulation:\n case Scenario:\n case Dashboard:\n Log.w(\"kek\", \"lololol unimplemented hohohoho\");\n return;\n default:\n Log.w(\"kek\", \"not even a choice bro\");\n return;\n }\n }\n }",
"private void openActivity() {\n }",
"@Override\r\n public void onReceive(Context context, Intent intent) {\n Log.e(\"BROADCAST GOT\", intent.toString());\r\n\r\n Intent startLoginScreen = new Intent(context, MainActivity.class);\r\n Bundle b = intent.getExtras();\r\n if (b != null && !b.isEmpty())\r\n startLoginScreen.putExtras(b);\r\n\r\n startLoginScreen.putExtra(\"request\", intent.getAction());\r\n\r\n context.startActivity(startLoginScreen);\r\n\r\n }",
"@Override\r\n\tpublic void onReceive(Context arg0, Intent arg1) {\n\t\t\r\n\t}",
"public void onNewIntent(Intent intent) {\n ArrayList<Object> blaubotComponents = new ArrayList<>();\n blaubotComponents.addAll(getAdapters());\n blaubotComponents.addAll(getConnectionStateMachine().getBeaconService().getBeacons());\n for(Object component : blaubotComponents) {\n if (component instanceof IBlaubotAndroidComponent) {\n final IBlaubotAndroidComponent androidComponent = (IBlaubotAndroidComponent) component;\n androidComponent.onNewIntent(intent);\n }\n }\n }",
"protected Intent getStravaActivityIntent()\n {\n return new Intent(this, MainActivity.class);\n }",
"private void tournaments() {\n\tstartActivity (new Intent(getApplicationContext(), Tournaments.class));\n\n\t}",
"private void handleIntent(Intent intent) {\n if (intent == null) {\n return;\n }\n\n // read intent\n String action = intent.getAction();\n Uri launchUri = intent.getData();\n\n // if app was not launched by the url - ignore\n if (!Intent.ACTION_VIEW.equals(action) || launchUri == null) {\n Log.d(TAG, \"launchUri is null or action != VIEW\");\n return;\n }\n\n\n // store message and try to consume it\n storedEvent = createEventFromUrl(launchUri);\n tryToConsumeEvent();\n }",
"public interface IntentStarter {\n void startActivityForResult(ResultRequestor requestor, Intent intent);\n}",
"@Override\n\tprotected void getIntentData(Bundle savedInstanceState) {\n\n\t}",
"public void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n initParams(intent);\n }",
"@Override \n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent); \n \n initData();\n }",
"@Override\n public boolean activityStarting(Intent intent, String pkg) throws RemoteException {\n Log.i(TAG, String.format(\"Starting %s in package %s\", intent, pkg));\n currentPackage = pkg;\n currentIntent = intent;\n return true;\n }",
"@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tif (intent.getAction() != null) {\n\t\t\tif ( intent.getAction().equals(Intent.ACTION_USER_PRESENT)) {\n\t\t\t\tIntent s = new Intent(context, FdActivity.class);\n\t\t\t\ts.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n\t\t\t\tcontext.startActivity(s);\n\t\t\t}\n\t\t}\n\t}",
"protected void onNewIntent(android.content.Intent intent) {\n java.lang.String referrer = intent.getStringExtra(\"referrer\");\n android.util.Log.d(\"TRACKING\", \"Reffff: \" + referrer);\n android.content.Intent i = new android.content.Intent();\n i.setAction(\"RRR_AAA_FFF\");\n i.putExtra(\"r\", referrer);\n this.context.sendBroadcast(i);\n super.onNewIntent(intent);\n }",
"@Override\n public void onStart(Intent intent, int startid) {\n }",
"@Override\n public void onClick(View view) {\n\n startActivity(getIntent());\n }",
"public void onClick(View v) {\n\n\n\n startActivity(myIntent);\n }",
"@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tXSDK.getInstance().onNewIntent(intent);\r\n\t\tsuper.onNewIntent(intent);\r\n\t}",
"private void handleIntent(Intent intent, boolean isOnNewIntent) {\n handleIntent(intent.getAction(), intent.getExtras(), intent.getData(), isOnNewIntent);\n }",
"void start(Intent intent, Class<? extends IIntentHandler> handlerClass, IIntentCallback callback,\n\t\t\tIEclipseContext context);",
"private void handleIntent() {\n // Get the intent set on this activity\n Intent intent = getIntent();\n\n // Get the uri from the intent\n Uri uri = intent.getData();\n\n // Do not continue if the uri does not exist\n if (uri == null) {\n return;\n }\n\n // Let the deep linker do its job\n Bundle data = mDeepLinker.buildBundle(uri);\n if (data == null) {\n return;\n }\n\n // See if we have a valid link\n DeepLinker.Link link = DeepLinker.getLinkFromBundle(data);\n if (link == null) {\n return;\n }\n\n // Do something with the link\n switch (link) {\n case HOME:\n break;\n case PROFILE:\n break;\n case PROFILE_OTHER:\n break;\n case SETTINGS:\n break;\n }\n\n String msg;\n long id = DeepLinker.getIdFromBundle(data);\n if (id == 0) {\n msg = String.format(\"Link: %s\", link);\n } else {\n msg = String.format(\"Link: %s, ID: %s\", link, id);\n }\n\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n }",
"@Override\r\n public void onStart(Intent intent, int startId) {\n }",
"public void mo1401a(Intent intent) {\n }",
"@Override\n\t\t\tpublic void run() {\n\t\t\t\tonIntentClass(activity, MainActivity.class, true);\n\t\t\t}",
"public void getintent() {\n Intent intent = this.getIntent();\n acceptDetailsModel = (AcceptDetailsModel) intent.getSerializableExtra(\"menu_item\");\n }",
"public void onNewIntent(Intent intent) {\n AppMethodBeat.m2504i(16653);\n super.onNewIntent(intent);\n setIntent(intent);\n if (this.ggF != null) {\n this.ggF.dismiss();\n this.ggF = null;\n }\n if (!anB()) {\n finish();\n }\n AppMethodBeat.m2505o(16653);\n }",
"@Override\n\tpublic void onReceive(Context arg0, Intent arg1) {\n\n\t}",
"Intent createNewIntent(Class cls);",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.i(\"TAG\", \"someone called me 3\");\n\n // Explicitly specify that GcmIntentService will handle the intent.\n ComponentName comp = new ComponentName(context.getPackageName(), GcmIntentService.class.getName());\n // Start the service, keeping the device awake while it is launching.\n Log.i(\"TAG\", \"someone called me 4\");\n startWakefulService(context, (intent.setComponent(comp)));\n setResultCode(Activity.RESULT_OK);\n Log.i(\"TAG\", \"someone called me 5\");\n\n }",
"@Override\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\n\t\tToast.makeText(MainActivity.this, \"player\", Toast.LENGTH_SHORT).show();\n\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n if(\"com.example.brdcst_rec.toast\".equals(intent.getAction())){\n Integer received = intent.getIntExtra(\"com.example.brdcst_rec.text\", -1);\n Intent in = new Intent(context, BrowserActivity.class);\n in.putExtra(\"number\", received);\n context.startActivity(in);\n }\n }",
"public interface OmnomActivity {\n\tpublic static final int REQUEST_CODE_ENABLE_BLUETOOTH = 100;\n\tpublic static final int REQUEST_CODE_SCAN_QR = 101;\n\n\tvoid start(Intent intent, int animIn, int animOut, boolean finish);\n\n\tvoid startForResult(Intent intent, int animIn, int animOut, int code);\n\n\tvoid start(Class<?> cls);\n\n\tvoid start(Class<?> cls, boolean finish);\n\n\tvoid start(Intent intent, boolean finish);\n\n\tActivity getActivity();\n\n\tint getLayoutResource();\n\n\tvoid initUi();\n\n\tPreferenceProvider getPreferences();\n\n\tSubscription subscribe(final Observable observable, final Action1<? extends Object> onNext, final Action1<Throwable> onError);\n\n\tvoid unsubscribe(final Subscription subscription);\n\n}",
"@Override\n public void onMessageReceived(MessageEvent messageEvent) {\n\n if( messageEvent.getPath().equalsIgnoreCase(\"/0\")) {\n String value = new String(messageEvent.getData(), StandardCharsets.UTF_8);\n Intent intent = new Intent(this, MainActivity.class );\n\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n //you need to add this flag since you're starting a new activity from a service\n String string = value;\n String[] parts = string.split(\",\");\n String part1 = parts[0];\n String part2 = parts[1];\n String part3 = parts[2];\n\n\n intent.putExtra(\"0\", part1);\n intent.putExtra(\"1\", part2);\n intent.putExtra(\"2\", part3);\n startActivity(intent);\n } else {\n super.onMessageReceived( messageEvent );\n }\n\n }",
"private void getIncomingIntent()\n {\n if(getIntent().hasExtra(\"Title\")\n && getIntent().hasExtra(\"Time\")\n && getIntent().hasExtra(\"Date\")\n && getIntent().hasExtra(\"Duration\")\n && getIntent().hasExtra(\"Location\")\n && getIntent().hasExtra(\"EventDetails\"))\n {\n Title = getIntent().getStringExtra(\"Title\");\n Time = getIntent().getStringExtra(\"Time\");\n Date = getIntent().getStringExtra(\"Date\");\n Duration = getIntent().getStringExtra(\"Duration\");\n Location = getIntent().getStringExtra(\"Location\");\n EventDetails = getIntent().getStringExtra(\"EventDetails\");\n\n setData(Title,Time,Date,Duration,Location,EventDetails);\n }\n }",
"public interface OnNewIntent {\n void onNewIntent(ZHIntent zHIntent);\n}",
"public void onNewIntent(Intent intent) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~onNewIntent\");\n m6632c(intent);\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(getApplicationContext(), StartActivityReceiver.class);\n intent.putExtra(\"zjf\", \"123\");\n sendBroadcast(intent);\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n boolean running = false;\n ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);\n for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {\n if (MyService.class.getName().equals(service.service.getClassName())) {\n running = true;\n break;\n }\n }\n if (!running) {\n Intent intentService = new Intent(context, MyService.class);\n context.startService(intentService);\n }\n //Intent myIntent1=new Intent(context,NotificationContent.class);\n }",
"private void openNextActivity(Intent intent) {\n\n String message = intent.getStringExtra(\"phase\");\n\n Log.d(\"STATE\", \"Waiting activity, phase is -> \" + message );\n if(message != null) {\n if (message.equals(\"USER_JOINED\")) { //TODO: This should be for ready to vote.\n Log.d(\"STATE\", \"Waiting activity, USER JOINED\" );\n\n Intent i = new Intent(this, VoteActivity.class);\n startActivity(i);\n } else if (message.equals(\"result\")) { //TODO: Change this to the new \"phase\" value\n Log.d(\"STATE\", \"Waiting activity. Meadle is ready\" );\n //Notification has been received that alerts meadle is complete\n MeadleDataManager.setHasResult(this);\n\n Intent i = new Intent(this, ResultsActivity.class);\n startActivity(i);\n } else if(message.equals(\"VOTING_FINISHED\")){\n Log.d(\"Votiing Finished\",intent.getExtras().toString());\n Intent i = new Intent(this,MeetingPointActivity.class);\n i.putExtras(intent.getExtras());\n startActivity(i);\n }\n }\n }",
"private void handleIntent(Intent intent) {\n\t\t// TODO Auto-generated method stub\n\t\tif (Intent.ACTION_VIEW.equals(intent.getAction())) {\n\t\t\tIntent paintingIntent = new Intent(this, PaintingActivity.class);\n\t\t\tpaintingIntent.setData(intent.getData());\n\t\t\tstartActivity(paintingIntent);\n\t\t} else if (Intent.ACTION_SEARCH.equals(intent.getAction())) {\n\t\t\tString query = intent.getStringExtra(SearchManager.QUERY);\n\t\t\tLog.v(\"Debug\", \"Search started\");\n\t\t\tshowResults(query);\n\t\t}\n\t}",
"private void startNewAcitivity(Intent intent, ActivityOptionsCompat options) {\n ActivityCompat.startActivity(this, intent, options.toBundle());\n }",
"@Override\n public void onClick(View v) {\n Intent i = new Intent(getApplicationContext(), Prescription.class);\n Bundle bundle = new Bundle();\n bundle.putString(\"Chatroomcode\", chatCode);\n i.putExtras(bundle);\n startActivity(i);\n CustomIntent.customType(Chat.this, \"fadein-to-fadeout\");\n }",
"public void iniciarActivity() {\n\n Intent intent = new Intent(ActivityA.this, ActivityB.class);\n startActivity(intent);\n }",
"public void onNewIntent(Intent intent) {\n this.eventDelegate.onNewIntent(intent);\n }",
"public void onIntentReceived(final String payload) {\n }",
"@Override\n public void onClick(View view) {\n Intent intent = new Intent(MainActivity.this, TriggerActivity.class);\n startActivity(intent);\n }",
"@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}",
"@Override\n public void onReceive(Context context, Intent intent) {\n // TODO Auto-generated method stub\n Log.d(TAG, \"got it\");\n }",
"@Override\n public void performAction(View view) {\n startActivity(new Intent(MainActivity.this, MyInfoActivity.class));\n// QPManager.startRecordActivity(MainActivity.this);\n }",
"@Override\n protected void onNewIntent(Intent intent) {\n Log.d(TAG, getString(R.string.debug_key) + \"TagWriter intent filter success\");\n this.setIntent(intent);\n }"
] | [
"0.753615",
"0.7476618",
"0.74645257",
"0.7404125",
"0.7311171",
"0.7242471",
"0.71672785",
"0.7163886",
"0.7157018",
"0.70891225",
"0.7074088",
"0.70600134",
"0.7043232",
"0.7026379",
"0.7001024",
"0.7001024",
"0.69523335",
"0.6946554",
"0.69351465",
"0.69004196",
"0.68762785",
"0.68735254",
"0.68424135",
"0.6831619",
"0.68052655",
"0.67707646",
"0.6763789",
"0.6731214",
"0.67307085",
"0.6723069",
"0.6697994",
"0.6664244",
"0.6648846",
"0.6648771",
"0.6648038",
"0.6635053",
"0.66324157",
"0.66293776",
"0.657894",
"0.657894",
"0.657894",
"0.65751016",
"0.65751016",
"0.6558368",
"0.65432435",
"0.65413636",
"0.65334195",
"0.6528927",
"0.6526341",
"0.6517562",
"0.65072477",
"0.64945567",
"0.64507014",
"0.6440528",
"0.6437311",
"0.6431105",
"0.64284444",
"0.64211184",
"0.64118814",
"0.6403538",
"0.6400325",
"0.6398714",
"0.6398691",
"0.63971484",
"0.6383019",
"0.63806385",
"0.6377408",
"0.6364601",
"0.6361691",
"0.63524306",
"0.6346701",
"0.63413095",
"0.63374746",
"0.63317066",
"0.63225037",
"0.63216335",
"0.63208807",
"0.6313411",
"0.6311069",
"0.6285783",
"0.6279224",
"0.6276694",
"0.626844",
"0.62609106",
"0.62602615",
"0.6239591",
"0.6235777",
"0.6230213",
"0.62230897",
"0.6210639",
"0.62077636",
"0.62059134",
"0.61909616",
"0.61863476",
"0.61862737",
"0.6167108",
"0.61622995",
"0.61606413",
"0.6158001",
"0.6156633",
"0.615443"
] | 0.0 | -1 |
/ Creates and format the notification settings | public void createNotification(Context context, String msg, String msgText, String msgAlert, int notifID) {
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
Intent repeating_intent = new Intent(context, MainMenu.class);
repeating_intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
PendingIntent pendingIntent = PendingIntent.getActivity(context, notifID, repeating_intent, PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder builder = new NotificationCompat.Builder(context)
.setContentIntent(pendingIntent)
.setSmallIcon(R.drawable.ic_fridge_empty)
.setContentTitle(msg)
.setContentText(msgText)
.setTicker(msgAlert)
.setColor(0xFFC107) // colour of the circle backgroud
.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000}) // Vibration
.setLights(0xFFFF00, 100, 50) // LED
.setAutoCancel(true);
notificationManager.notify(notifID, builder.build());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void createNotificationChannel() {\n mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel(PRIMARY_CHANNEL_ID,\"Log the game!\", NotificationManager.IMPORTANCE_HIGH);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Reminder to log your game on Friday's at 3:05 pm\");\n mNotificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"private void createNotificationChannel() {\n mNotificationManager =\r\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n\r\n // Notification channels are only available in OREO and higher.\r\n // So, add a check on SDK version.\r\n if (android.os.Build.VERSION.SDK_INT >=\r\n android.os.Build.VERSION_CODES.O) {\r\n\r\n // Create the NotificationChannel with all the parameters.\r\n NotificationChannel notificationChannel = new NotificationChannel\r\n (PRIMARY_CHANNEL_ID,\r\n \"Stand up notification\",\r\n NotificationManager.IMPORTANCE_HIGH);\r\n\r\n notificationChannel.enableLights(true);\r\n notificationChannel.setLightColor(Color.RED);\r\n notificationChannel.enableVibration(true);\r\n notificationChannel.setDescription(\"Daje znać użytkownikowi \" +\r\n \"by wprowadził swoje wydatki\");\r\n mNotificationManager.createNotificationChannel(notificationChannel);\r\n }\r\n }",
"public void createNotificationChannel() {\n mNotificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >=\n android.os.Build.VERSION_CODES.O) {\n\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel\n (PRIMARY_CHANNEL_ID,\n \"Stand up notification\",\n NotificationManager.IMPORTANCE_HIGH);\n\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Notifies every 15 minutes to \" +\n \"stand up and walk\");\n mNotificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"public void createNotificationChannels(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n NotificationChannel notificationChannel = new NotificationChannel(\n CHANNEL_1_ID, \"Channel 1\", NotificationManager.IMPORTANCE_HIGH\n );\n notificationChannel.enableLights(true);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Alarm Message\");\n\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(notificationChannel);\n }\n\n }",
"public void setNotificationProperties(){\r\n \t\ttry{\r\n\t\t\tint totalNotifications = this.getChildCount();\r\n\t\t\tfor (int i=0; i<totalNotifications; i++){\r\n\t\t\t\tNotificationView currentNotificationView = (NotificationView) this.getChildAt(i);\r\n\t\t\t\tsetViewLayoutProperties(currentNotificationView);\r\n\t\t\t}\r\n \t\t}catch(Exception ex){\r\n \t\t\tLog.e(_context, \"NotificationViewFlipper.setNotificationProperties() ERROR: \" + ex.toString());\r\n \t\t}\r\n \t}",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\r\n CharSequence name = \"Picture upload\";\r\n String description =\"PRIKACENA SLIKA\";\r\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\r\n NotificationChannel channel = new NotificationChannel(\"slika1\", name, importance);\r\n channel.setDescription(description);\r\n // Register the channel with the system; you can't change the importance\r\n // or other notification behaviors after this\r\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\r\n notificationManager.createNotificationChannel(channel);\r\n }\r\n }",
"private void createNotificationChannels() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel1 = new NotificationChannel(CHANNEL_REMINDER_ID, \"Reminder Channel\",NotificationManager.IMPORTANCE_HIGH);\n channel1.setDescription(\"Reminder to drink water\");\n\n NotificationManager manager = getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel1);\n\n\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = MyShardPrefernces.myNotificationChannelName;\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(MyShardPrefernces.myNoficataionChannelID, name, importance);\n channel.setDescription(\"Notifications for alert Messenging\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public void createNotificationChannel() {\n weatherNotificationManager =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n // Notification channels are only available in OREO and higher.\n // So, add a check on SDK version.\n if (android.os.Build.VERSION.SDK_INT >=\n android.os.Build.VERSION_CODES.O) {\n\n // Create the NotificationChannel with all the parameters.\n NotificationChannel notificationChannel = new NotificationChannel\n (PRIMARY_CHANNEL_ID,\n \"Weather change.\",\n NotificationManager.IMPORTANCE_HIGH);\n\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription\n (\"Conditions have are below threshold\");\n weatherNotificationManager.createNotificationChannel(notificationChannel);\n\n }\n }",
"public void createNotificationChannel()\n {\n //Instantiate the NotificationManager\n mNotifyManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n //Notification Channel constructed\n NotificationChannel notificationChannel = new NotificationChannel(PRIMARY_CHANNEL_ID, \"Simple Notification\", NotificationManager.IMPORTANCE_HIGH);\n notificationChannel.enableLights(true);\n notificationChannel.setLightColor(Color.RED);\n notificationChannel.enableVibration(true);\n notificationChannel.setDescription(\"Simple Notification\");\n\n //Create the channel with the NotificationManager\n mNotifyManager.createNotificationChannel(notificationChannel);\n }",
"@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_settings);\n\n String text = \"lol\";\n\n NotificationCompat.Builder mBuilder =\n (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(\"My notification\")\n .setContentText(\"Hello World!\");\n\n\n Intent resultIntent = new Intent(this, MainActivity.class);\n\n // Because clicking the notification opens a new (\"special\") activity, there's\n // no need to create an artificial back stack.\n PendingIntent resultPendingIntent =\n PendingIntent.getActivity(\n this,\n 0,\n resultIntent,\n PendingIntent.FLAG_UPDATE_CURRENT\n );\n\n\n mBuilder.setContentIntent(resultPendingIntent);\n\n\n // NotificationCompat.Builder mBuilder;\n // Sets an ID for the notification\n // Use the notify() method to issue the notification. When you call notify(), specify a notification ID. You can use\n // this ID to update the notification later on. This is described in more detail in Managing Notifications.\n // http://developer.android.com/training/notify-user/managing.html\n int mNotificationId = 001;\n// Gets an instance of the NotificationManager service\n NotificationManager mNotifyMgr =\n (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n// Builds the notification and issues it.\n mNotifyMgr.notify(mNotificationId, mBuilder.build());\n\n }",
"public static Notification createNotification(XmlAppConfigurationProvider appConfigurationProvider,\n Context context, String title, String content, Bundle intentExtras) {\n int smallNotificationIconResourceId = appConfigurationProvider.getSmallNotificationIconResourceId();\n if (smallNotificationIconResourceId == 0) {\n Log.d(TAG, \"Small notification icon resource was not found. Will use the app icon when \" +\n \"displaying notifications.\");\n smallNotificationIconResourceId = appConfigurationProvider.getApplicationIconResourceId();\n }\n\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(context);\n notificationBuilder.setTicker(title);\n notificationBuilder.setAutoCancel(true);\n\n // Create broadcast intent that will fire when the notification has been opened. To action on these messages,\n // register a broadcast receiver that listens to intent <your_package_name>.intent.APPBOY_NOTIFICATION_OPENED\n // and <your_package_name>.intent.APPBOY_PUSH_RECEIVED.\n String pushOpenedAction = context.getPackageName() + \".intent.APPBOY_NOTIFICATION_OPENED\";\n Intent pushOpenedIntent = new Intent(pushOpenedAction);\n if (intentExtras != null) {\n pushOpenedIntent.putExtras(intentExtras);\n }\n PendingIntent pushOpenedPendingIntent = PendingIntent.getBroadcast(context, 0, pushOpenedIntent, PendingIntent.FLAG_ONE_SHOT);\n notificationBuilder.setContentIntent(pushOpenedPendingIntent);\n\n\n // Sets the icon used in the notification bar itself.\n notificationBuilder.setSmallIcon(smallNotificationIconResourceId);\n notificationBuilder.setContentTitle(title);\n notificationBuilder.setContentText(content);\n\n // Setting notification sounds are supported after Honeycomb.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && intentExtras != null) {\n // Retrieve sound uri if included in intentExtras bundle.\n if (intentExtras.containsKey(Constants.APPBOY_PUSH_NOTIFICATION_SOUND_KEY)) {\n String soundURI = intentExtras.getString(Constants.APPBOY_PUSH_NOTIFICATION_SOUND_KEY);\n if(soundURI != null) {\n if (soundURI.equals(Constants.APPBOY_PUSH_NOTIFICATION_SOUND_DEFAULT_VALUE)) {\n notificationBuilder.setDefaults(Notification.DEFAULT_SOUND);\n } else {\n notificationBuilder.setSound(Uri.parse(soundURI));\n }\n\n }\n }\n }\n\n // From Honeycomb to ICS, we can use a custom view for our notifications which will allow them to be taller than\n // the standard one line of text.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {\n Resources resources = context.getResources();\n String packageName = context.getPackageName();\n\n int layoutResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_ID, \"layout\", packageName);\n int titleResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TITLE_ID, \"id\", packageName);\n int contentResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_CONTENT_ID, \"id\", packageName);\n int iconResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_ICON_ID, \"id\", packageName);\n int timeViewResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TIME_ID, \"id\", packageName);\n int twentyFourHourFormatResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TWENTY_FOUR_HOUR_FORMAT_ID, \"string\", packageName);\n int twelveHourFormatResourceId = resources.getIdentifier(APPBOY_NOTIFICATION_TWELVE_HOUR_FORTMAT_ID, \"string\", packageName);\n\n String twentyFourHourTimeFormat = getOptionalStringResource(resources,\n twentyFourHourFormatResourceId, Constants.DEFAULT_TWENTY_FOUR_HOUR_TIME_FORMAT);\n String twelveHourTimeFormat = getOptionalStringResource(resources,\n twelveHourFormatResourceId, Constants.DEFAULT_TWELVE_HOUR_TIME_FORMAT);\n\n if (layoutResourceId == 0 || titleResourceId == 0 || contentResourceId == 0 || iconResourceId == 0\n || timeViewResourceId == 0) {\n Log.w(TAG, String.format(\"Couldn't find all resource IDs for custom notification view, extended view will \" +\n \"not be used for push notifications. Received %d for layout, %d for title, %d for content, %d for icon, \" +\n \"and %d for time.\",\n layoutResourceId, titleResourceId, contentResourceId, iconResourceId, timeViewResourceId));\n } else {\n Log.d(TAG, \"Using RemoteViews for rendering of push notification.\");\n RemoteViews remoteViews = new RemoteViews(packageName, layoutResourceId);\n remoteViews.setTextViewText(titleResourceId, title);\n remoteViews.setTextViewText(contentResourceId, content);\n remoteViews.setImageViewResource(iconResourceId, smallNotificationIconResourceId);\n\n // Custom views cannot be used as part of a RemoteViews so we're using a TextView widget instead. This\n // view will always display the time without date information (even after the day has changed).\n SimpleDateFormat timeFormat = new SimpleDateFormat(\n android.text.format.DateFormat.is24HourFormat(context) ? twentyFourHourTimeFormat : twelveHourTimeFormat);\n String notificationTime = timeFormat.format(new Date());\n remoteViews.setTextViewText(timeViewResourceId, notificationTime);\n notificationBuilder.setContent(remoteViews);\n return notificationBuilder.build();\n }\n }\n\n // If we're using Jelly Bean, we can use the Big View Style, which lets the notification layout size grow to\n // accommodate longer text and images.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n\n // Summary text which appears with content in expanded view.\n String summaryText = \"\";\n\n // If there is an image url found in the extras payload and the image can be downloaded, then\n // use the android BigPictureStyle as the notification. Else, use the BigTextStyle instead.\n if (intentExtras != null) {\n\n // Retrieve summary text if included in intentExtras bundle.\n if (intentExtras.containsKey(Constants.APPBOY_PUSH_SUMMARY_TEXT_KEY)) {\n summaryText = intentExtras.getString(Constants.APPBOY_PUSH_SUMMARY_TEXT_KEY);\n }\n\n // Set a custom notification priority if defined in the bundle.\n notificationBuilder.setPriority(getNotificationPriority(intentExtras));\n\n Bundle extrasBundle = getExtrasBundle(intentExtras);\n if (extrasBundle!=null && extrasBundle.containsKey(Constants.APPBOY_PUSH_BIG_IMAGE_URL_KEY)) {\n String imageUrl = extrasBundle.getString(Constants.APPBOY_PUSH_BIG_IMAGE_URL_KEY);\n Bitmap imageBitmap = downloadImageBitmap(imageUrl);\n if (imageBitmap != null) {\n Log.d(TAG, \"Rendering push notification with BigPictureStyle\");\n\n return getBigPictureNotification(notificationBuilder, imageBitmap, content, summaryText);\n } else {\n Log.d(TAG, \"Bitmap download failed for push notification\");\n }\n }\n }\n Log.d(TAG, \"Rendering push notification with BigTextStyle\");\n return getBigTextNotification(notificationBuilder, content, summaryText);\n }\n return notificationBuilder.build();\n }",
"@RequiresApi(api = Build.VERSION_CODES.O)\nvoid configureNotificationChannel(){\n String CHANNEL_ID = TORNADO_WARNING_CHANNEL;\n NotificationChannel channel = new NotificationChannel(\n CHANNEL_ID,\n \"tornado warning\",\n NotificationManager.IMPORTANCE_DEFAULT);\n channel.enableLights(true);\n channel.enableVibration(true);\n channel.setDescription(\"warnings about tornados\");\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }",
"private void formatsetting() {\n SharedPreferences sharedPreferences =this.getSharedPreferences(Settings.SHARED_PREF_NAME, Context.MODE_PRIVATE);\n //Fetching thepatient_mobile_Number value form sharedpreferences\n String FormattedString = sharedPreferences.getString(Settings.Format_Selected_SHARED_PREF,\"Thousands separator\");\n String DecimalplaceString= sharedPreferences.getString(Settings.Decimal_Place_Selected_SHARED_PREF,\"2\");\n Settings settings=new Settings(FormattedString,DecimalplaceString);\n formatter= settings.setting();\n }",
"private void formatsetting() {\n SharedPreferences sharedPreferences =this.getSharedPreferences(Settings.SHARED_PREF_NAME, Context.MODE_PRIVATE);\n //Fetching thepatient_mobile_Number value form sharedpreferences\n String FormattedString = sharedPreferences.getString(Settings.Format_Selected_SHARED_PREF,\"Thousands separator\");\n String DecimalplaceString= sharedPreferences.getString(Settings.Decimal_Place_Selected_SHARED_PREF,\"2\");\n Settings settings=new Settings(FormattedString,DecimalplaceString);\n formatter= settings.setting();\n }",
"@Override\n public void onCreate() {\n super.onCreate();\n\n // initialize helper class\n notificationHelper = new NotificationHelper(this);\n formatter = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n }",
"public void createNotification(View view) {\n Intent intent = new Intent(this, Status1.class);\r\n PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);\r\n\r\n // Build notification\r\n // Actions are just fake\r\n Notification noti = new Notification.Builder(this)\r\n .setContentTitle(\"RKC App \")\r\n .setContentText(\"Click To Enter \").setSmallIcon(R.drawable.arc)\r\n .setContentIntent(pIntent)\r\n .addAction(R.drawable.ironman, \"Back\", pIntent)\r\n .addAction(R.drawable.gun, \"More\", pIntent)\r\n .build();\r\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\r\n // hide the notification after its selected\r\n noti.flags |= Notification.FLAG_AUTO_CANCEL;\r\n\r\n notificationManager.notify(0, noti);\r\n\r\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Tracker\";\n String description = getString(R.string.app_name);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n Log.d(TAG, \"createNotificationChannel: \" + Build.VERSION.SDK_INT);\n // Importance applicable to all the notifications in this Channel\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n\n NotificationChannel notificationChannel =\n new NotificationChannel(NOTIFICATION_CHANNEL_ID, CHANNEL_NAME, importance);\n\n String channelDescription = \"This is channel description\";\n notificationChannel.setDescription(channelDescription);\n notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);\n\n //finally create notification channel\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n notificationManager.createNotificationChannel(notificationChannel);\n }\n }\n }",
"public void createTaskProperties(View view) {\n \t\n \tIntent intent = new Intent(this, TaskProperties.class);\n \t\n \t//dont have any task properties at this point\n \tif(!propertiesGrabbed){\n \n \t\tintent.putExtra(EDIT, \"no\");\n \t\tstartActivityForResult(intent, 3);\n \t\t \t\t\n \t//we have properties so need to populate the next page\t\n \t}else{\n \t\t\n \t\t//creating the values to pass\n\t\t\t//0 -> where to send the notification\n\t \t//1 -> visibility\n\t \t//2 -> description\n\t \t//3 -> type\n \t\tString[] send = new String[TaskProperties.propertyCount];\n \t\tsend[0] = taskResponseString;\n \t\tsend[1] = taskVisibility;\n \t\tsend[3] = taskResponseType;\n \t\tsend [2] = taskDescription; \n \t\t\n \t\tintent.putExtra(EDIT, \"yes\");\n \t\tintent.putExtra(PROPERTIES, send);\n \t\tstartActivityForResult(intent, 3); \t\t\t\n \t} \t\n }",
"private void getSettings(){\n SharedPreferences sp = getSharedPreferences(\"PACERUNNER_SETTINGS\", Activity.MODE_PRIVATE);\n AMOUNT_OF_SECONDS_WHEN_TRIGGERING_NOTIFICATION = sp.getInt(\"NOTIFICATION_SENSITIVITY\", -15);\n REQUIRED_METERS_BEFORE_SHOWING_AVGPACE = sp.getInt(\"NOTIFICATION_METERS_BEFORE_START\", 500);\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"31\", \"test\", importance);\n channel.setDescription(\"hihi\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"channel_name\";\n String description =\"channel_description\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"1\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createStatusNotificationChannel(){\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {\n statusChannel = new NotificationChannel(\"2\",\"Status\",NotificationManager.IMPORTANCE_DEFAULT);\n statusChannel.setDescription(\"This is a status notification channel\");\n\n NotificationManager notificationManager = ctx.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(statusChannel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n String name = NOTIFICATION_CHANNEL_NAME;\n String descriptionText = NOTIFICATION_CHANNEL_DESCRIPTION;\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(descriptionText);\n\n // Register the channel with the system\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@TargetApi(Build.VERSION_CODES.O)\n private void createNotificationChannel() {\n CharSequence name = getString(R.string.appName);\n String description = getString(R.string.appName);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(name.toString(), name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n if(status.connection_status == enums.connection_status.connected)\n {\n CharSequence name = \"Sample VPN\";\n String description = \"VPN notification\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = home_model.getInstance().getHomeInstance().getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"NOTIFICATION\";\n String description = \"NOTIFICATION\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(NOTIFICATION_CHANNEL, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = (NotificationManager)getSystemService(NotificationManager.class);\n\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public static void createNotification(Context context, Reminder reminder) {\n Intent viewIntent = new Intent(context, MainScreen.class);\n viewIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n viewIntent.putExtra(\"NOTIFICATION_DISMISS\", true);\n PendingIntent pending = PendingIntent.getActivity(context, reminder.getId(), viewIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n /* // Create intent for notification snooze click behaviour\n Intent snoozeIntent = new Intent(context, SnoozeActionReceiver.class);\n snoozeIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingSnooze = PendingIntent.getBroadcast(context, reminder.getId(), snoozeIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n*/\n int imageResId = context.getResources().getIdentifier(reminder.getIcon(), \"drawable\", context.getPackageName());\n\n\n /*NotificationCompat.Builder builder = new NotificationCompat.Builder(context, CHANNEL_ID)\n .setSmallIcon(R.drawable.notification_icon)\n .setContentTitle(textTitle)\n .setContentText(textContent)\n .setPriority(NotificationCompat.PRIORITY_DEFAULT);\n\n */\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setSmallIcon(imageResId)\n .setColor(Color.parseColor(reminder.getColour()))\n .setStyle(new NotificationCompat.BigTextStyle().bigText(reminder.getContent()))\n .setContentTitle(reminder.getTitle())\n .setContentText(reminder.getContent())\n .setTicker(reminder.getTitle())\n .setContentIntent(pending);\n\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n\n /*if (sharedPreferences.getBoolean(\"checkBoxNagging\", false)) {\n Intent swipeIntent = new Intent(context, DismissReceiver.class);\n swipeIntent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingDismiss = PendingIntent.getBroadcast(context, reminder.getId(), swipeIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.setDeleteIntent(pendingDismiss);\n\n Calendar calendar = Calendar.getInstance();\n calendar.add(Calendar.MINUTE, sharedPreferences.getInt(\"nagMinutes\", context.getResources().getInteger(R.integer.default_nag_minutes)));\n calendar.add(Calendar.SECOND, sharedPreferences.getInt(\"nagSeconds\", context.getResources().getInteger(R.integer.default_nag_seconds)));\n Intent alarmIntent = new Intent(context, NagReceiver.class);\n AlarmUtil.setAlarm(context, alarmIntent, reminder.getId(), calendar);\n }*/\n\n String soundUri = sharedPreferences.getString(\"NotificationSound\", \"content://settings/system/notification_sound\");\n if (soundUri.length() != 0) {\n builder.setSound(Uri.parse(soundUri));\n }\n if (sharedPreferences.getBoolean(\"checkBoxLED\", true)) {\n builder.setLights(Color.BLUE, 700, 1500);\n }\n if (sharedPreferences.getBoolean(\"checkBoxOngoing\", false)) {\n builder.setOngoing(true);\n }\n if (sharedPreferences.getBoolean(\"checkBoxVibrate\", true)) {\n long[] pattern = {0, 300, 0};\n builder.setVibrate(pattern);\n }\n /*if (sharedPreferences.getBoolean(\"checkBoxMarkAsDone\", false)) {\n Intent intent = new Intent(context, DismissReceiver.class);\n intent.putExtra(\"NOTIFICATION_ID\", reminder.getId());\n PendingIntent pendingIntent = PendingIntent.getBroadcast(context, reminder.getId(), intent, PendingIntent.FLAG_UPDATE_CURRENT);\n builder.addAction(R.drawable.ic_done_white_24dp, context.getString(R.string.mark_as_done), pendingIntent);\n }\n if (sharedPreferences.getBoolean(\"checkBoxSnooze\", false)) {\n builder.addAction(R.drawable.ic_snooze_white_24dp, context.getString(R.string.snooze), pendingSnooze);\n }*/\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {\n builder.setPriority(Notification.PRIORITY_HIGH);\n }\n\n NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(reminder.getId(), builder.build());\n }",
"@RequiresApi(api = Build.VERSION_CODES.O)\n private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.notification);\n String description =getString(R.string.notification);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"lemubitA\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@Override\n public NotificationCompat.Builder extend(NotificationCompat.Builder builder) {\n Bitmap roundBitmap = Util.getCircleBitmap(loadedImage);\n return builder.setContentTitle(contact.getName())\n //.setColor(new BigInteger(\"FF333333\", 16).intValue())\n .setLargeIcon(roundBitmap);\n /*.setSound(Uri.parse(\"content://media/internal/audio/media/32\"))\n .setColor(new BigInteger(\"FF00FF00\", 16).intValue())\n .setStyle(new NotificationCompat.BigTextStyle().bigText(\"[Modified Body(bigText)]\"))\n .setContentText(\"[Modified Body(ContentText)]\");*/\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotification(int icon, String name, String auto_manual, String secondText, int color) {\n\n Intent notificationIntent = new Intent(this, SyncopyActivity.class);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this,\n 0, notificationIntent, 0);\n Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)\n .setContentTitle(name)\n .setContentText(secondText)\n .setSubText(String.format(\"(%s)\", auto_manual))\n .setSmallIcon(icon)\n .setColor(getResources().getColor(color))\n .setContentIntent(pendingIntent)\n .setVibrate(null)\n .setSound(null)\n .setPriority(NotificationManager.IMPORTANCE_LOW)\n .build();\n\n synchronized (notification){\n notification.notify();\n }\n\n startForeground(1, notification);\n\n\n }",
"private void createNotificationChannel() {\n // Create the NotificationChannel, but only on API 26+ because\n // the NotificationChannel class is new and not in the support library\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Inwentaryzacja\";\n String description = \"Powiadomienia\";\n int importance = NotificationManager.IMPORTANCE_LOW; // low importance - no sound\n NotificationChannel channel = new NotificationChannel(C.CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = \"\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n mNotificationManager = getSystemService(NotificationManager.class);\n mNotificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel(){\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n CharSequence name = \"DailyReminderChannel\";\n String desc = \"Channel for daily reminders\";\n NotificationChannel channel = new NotificationChannel(\"dailyReminders\", name, NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(desc);\n\n NotificationManager manager = getActivity().getSystemService(NotificationManager.class);\n manager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Channel 1\";\n String description = \"For testing\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void appendKeyGeneratorSettings() {\n Label keyGeneratorSettings = new Label(Localization.lang(\"Key generator settings\"));\n keyGeneratorSettings.getStyleClass().add(\"sectionHeader\");\n builder.add(keyGeneratorSettings, 1, 10);\n builder.add(autoGenerateOnImport, 1, 11);\n builder.add(letterStartA, 2, 11);\n builder.add(warnBeforeOverwriting, 1, 12);\n builder.add(letterStartB, 2, 12);\n builder.add(dontOverwrite, 1, 13);\n builder.add(alwaysAddLetter, 2, 13);\n builder.add(generateOnSave, 1, 14);\n\n builder.add((new Label(Localization.lang(\"Replace (regular expression)\") + ':')), 1, 15);\n builder.add(new Label(Localization.lang(\"by\") + ':'), 2, 15);\n\n builder.add(keyPatternRegex, 1, 16);\n builder.add(keyPatternReplacement, 2, 16);\n\n dontOverwrite.setOnAction(e ->\n // Warning before overwriting is only relevant if overwriting can happen:\n warnBeforeOverwriting.setDisable(dontOverwrite.isSelected()));\n }",
"public void CrearNotificacionChannel(){\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n CharSequence name = \"Notificacion name\";\n NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT);\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(notificationChannel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"1\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private static void writeToPreference(String type, String tag, String s) {\n /*SharedPreferences.Editor editor = eventHistory.edit(); //save log entries\n editor.putString(\n HISTORY_KEY, //key\n type + \" \" + s + \" \" + tag); //content\n editor.apply();*/\n recipient.replyTo( 1, (type + \" \" + s + \" \" + tag));\n }",
"private void createNotification() {\n\t\tIntent notifyIntent = new Intent(this, BirthdayActivity.class);\r\n\t\t// Sets the Activity to start in a new, empty task\r\n\t\tnotifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n\t\t// Creates the PendingIntent\r\n\t\tPendingIntent pendingIntent = PendingIntent.getActivity(this,\r\n\t\t\t\t(int) System.currentTimeMillis(), notifyIntent,\r\n\t\t\t\tPendingIntent.FLAG_UPDATE_CURRENT);\r\n\r\n\t\tNotificationManagerUtil notificationManagerUtil = NotificationManagerUtil\r\n\t\t\t\t.getInstance();\r\n\t\tnotificationManagerUtil.createNotifications(this, 1, \"Message\",\r\n\t\t\t\tpendingIntent);\r\n\t}",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n// CharSequence name = getString(R.string.channel_name);\n// String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"myChannelId\", \"channelName\", importance);\n channel.setDescription(\"this is channel myChannelId\");\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getActivity().getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"ReminderChannel\";\n String description = \"Hello channel\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"notifyAnkit\", name, importance);\n channel.setDescription(description);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void retrieveNotification() { =====================================================\n // Creating Notification Model\n // =====================================================\n\n// Bitmap patientAvatar1 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_18);\n// Bitmap patientAvatar2 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_19);\n// Bitmap patientAvatar3 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_20);\n//\n// Patient patient1 = new Patient(\"Garry\", \"Reese\", \"123AB456\", patientAvatar1);\n// Patient patient2 = new Patient(\"Lillian\", \"Wade\", \"987CD654\", patientAvatar2);\n// Patient patient3 = new Patient(\"Laura\", \"Freeman\", \"AV12G64\", patientAvatar3);\n//\n// Bitmap caregiverAvatar1 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_01);\n// Bitmap caregiverAvatar2 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_02);\n// Bitmap caregiverAvatar3 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_03);\n// Bitmap caregiverAvatar4 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_04);\n// Bitmap caregiverAvatar5 = BitmapFactory.decodeResource(getResources(), R.drawable.avatar_05);\n//\n// DateTime date1 = DateTime.now();\n// DateTime date2 = DateTime.now().minusDays(2).minusHours(2);\n// DateTime date3 = DateTime.now().minusDays(5).plusHours(1);\n// DateTime date4 = DateTime.now().minusDays(4).minusHours(2);\n// DateTime date5 = DateTime.now().minusDays(1).plusHours(1);\n// DateTime date6 = DateTime.now().minusDays(3).plusHours(5);\n//\n// String caregiverName1 = \"John Doe\";\n// String caregiverName2 = \"Jane Doe\";\n// String caregiverName3 = \"Tracy Lee\";\n// String caregiverName4 = \"Apple Tan\";\n// String caregiverName5 = \"Bethany Mandler\";\n//\n// String summary1 = \"Updated information of patient Garry Reese\";\n// String summary2 = \"Log new problem for patient Lilian Wade\";\n// String summary3 = \"Create new patient Laura Freeman\";\n// String summary4 = \"Recommended the game category memory to patient Garry Reese\";\n// String summary5 = \"Updated the milk allergy of patient Lillian Wade\";\n// String summary6 = \"Log new problem for patient Garry Reese\";\n//\n// Notification notification1 = new Notification(date1, caregiverName1, caregiverAvatar1, summary1, patient1, Notification.STATUS_NONE, Notification.TYPE_UPDATE_INFO_FIELD);\n// Notification notification2 = new Notification(date2, caregiverName2, caregiverAvatar2, summary2, patient2, Notification.STATUS_NONE, Notification.TYPE_NEW_INFO_OBJECT);\n// Notification notification3 = new Notification(date3, caregiverName3, caregiverAvatar3, summary3, patient3, Notification.STATUS_NONE, Notification.TYPE_NEW_PATIENT);\n// Notification notification4 = new Notification(date4, caregiverName4, caregiverAvatar4, summary4, patient1, Notification.STATUS_NONE, Notification.TYPE_GAME_RECOMMENDATION);\n// Notification notification5 = new Notification(date5, caregiverName5, caregiverAvatar5, summary5, patient2, Notification.STATUS_NONE, Notification.TYPE_UPDATE_INFO_OBJECT);\n// Notification notification6 = new Notification(date6, caregiverName3, caregiverAvatar3, summary6, patient1, Notification.STATUS_NONE, Notification.TYPE_NEW_INFO_OBJECT);\n//\n ArrayList<Notification> notificationList = new ArrayList<>();\n//// notificationList.add(notification1);\n//// notificationList.add(notification2);\n//// notificationList.add(notification3);\n//// notificationList.add(notification4);\n//// notificationList.add(notification5);\n//// notificationList.add(notification6);\n\n dbfile db = new dbfile();\n notificationList = db.prepareNotificationList(getApplicationContext());\n Log.v(\"WHY LIKE THAT\", String.valueOf(notificationList.size()));\n // =====================================================\n // Building the Notification Group based on the notification\n // =====================================================\n\n HashMap patientAndNotificationGroupMap = new HashMap();\n\n for(Notification notification:notificationList) {\n Patient currentPatient = notification.getAffectedPatient();\n String patientNric = currentPatient.getNric();\n\n if (patientAndNotificationGroupMap.containsKey(patientNric)) {\n NotificationGroup notifGroup = (NotificationGroup) patientAndNotificationGroupMap.get(patientNric);\n if(notification.getStatus() == Notification.STATUS_NONE) {\n notifGroup.getUnprocessedNotif().add(notification);\n } else {\n notifGroup.getProcessedNotif().add(notification);\n }\n } else {\n NotificationGroup newNotifGroup = new NotificationGroup();\n newNotifGroup.setAffectedPatient(currentPatient);\n if(notification.getStatus() == Notification.STATUS_NONE) {\n newNotifGroup.getUnprocessedNotif().add(notification);\n } else {\n newNotifGroup.getProcessedNotif().add(notification);\n }\n patientAndNotificationGroupMap.put(patientNric, newNotifGroup);\n }\n }\n\n ArrayList<NotificationGroup> notificationGroupList = new ArrayList<>();\n NotificationComparator comparator = new NotificationComparator();\n for (Object obj : patientAndNotificationGroupMap.values()) {\n NotificationGroup notificationGroup = (NotificationGroup) obj;\n\n // Set notification status\n UtilsUi.setNotificationGroupStatus(this, notificationGroup);\n\n // Sort the notifications by date\n Collections.sort(notificationGroup.getProcessedNotif(), comparator);\n Collections.sort(notificationGroup.getUnprocessedNotif(), comparator);\n\n // Set the summary\n UtilsUi.setNotificationGroupSummary(this, notificationGroup);\n\n notificationGroupList.add(notificationGroup);\n }\n\n DataHolder.setNotificationGroupList(notificationGroupList);\n }",
"private String buildMessage(MqttNotification notification, String value) {\n if (notification != null) {\n if (notification.getOption().getRule().equals(\"#\")) {\n return value.toUpperCase();\n } else {\n return value.toUpperCase() + \" ( \" + getComparisonString(notification.getOption().getRule()) + \" \"\n + notification.getOption().getThreshold() + \" )\";\n }\n }\n return \"\";\n }",
"@Override\n public void setNotification() {\n if (getTense() == Tense.FUTURE) {\n //Context ctx = SHiTApplication.getContext();\n //SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(ctx);\n\n int leadTimeEventMinutes = SHiTApplication.getPreferenceInt(Constants.Setting.ALERT_LEAD_TIME_EVENT, LEAD_TIME_MISSING);\n\n if (leadTimeEventMinutes != LEAD_TIME_MISSING) {\n if (travelTime > 0) {\n leadTimeEventMinutes += travelTime;\n }\n\n setNotification(Constants.Setting.ALERT_LEAD_TIME_EVENT\n , leadTimeEventMinutes\n , R.string.alert_msg_event\n , getNotificationClickAction()\n , null);\n }\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Test\";\n String description = \"Test noti\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(\"Vuongpro1\", name, importance);\n channel.setVibrationPattern(new long[]{300, 300, 300});\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createConfig(File fileName) {\n\t\tthis.getConfig().set(\"Auto-update\", false);\n \n\t\t// setting a String\n\t\tString announcerName = \"&6[&cBroadcast&5Ex&6]&f: \";\n\t\tthis.getConfig().set(\"Announcer Name\", announcerName);\n \n\t\t// setting an int value\n\t\tint Interval = 10;\n\t\tthis.getConfig().set(\"Interval\", Interval);\n \n\t\t// Setting a List of Strings\n\t\t// The List of Strings is first defined in this array\n\t\tList<String> Messages = Arrays.asList(\"Hello World\", \"Powered by BroadcastEx\", \"&dColor codes &fare compatible :)\");\n\t\tthis.getConfig().set(\"Messages\", Messages);\n\t\tthis.saveConfig();\n\t}",
"private void createNotificationChannel(){\n // Create the NotificationChannel, but only on API 26+ because\n // the NotificationChannel class is new and not in the support library\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O){\n Log.v(\"notification_channel \", \"true\");\n CharSequence name = \"channel_name2\";\n String description = \"channel_description2\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"channel_id2\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void setupNotification() {\n\n int notificationAction = android.R.drawable.ic_media_pause;\n PendingIntent playOrPauseIntent = null;\n\n if (mMediaPlayer != null && mMediaPlayer.isPlaying()) {\n notificationAction = android.R.drawable.ic_media_pause;\n // pause\n playOrPauseIntent = getPlaybackActionIntent(1);\n } else {\n notificationAction = android.R.drawable.ic_media_play;\n // play\n playOrPauseIntent = getPlaybackActionIntent(0);\n }\n\n Bitmap largeIcon = loadBitmapFromFile(mAudioInfo.guid);\n String text = mLoadingStatus.isEmpty() ? mAudioInfo.album : mLoadingStatus;\n Palette palette = Palette.from(largeIcon).generate();\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n createNotificationChannel();\n }\n\n NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID)\n .setOngoing(true)\n .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)\n .setOnlyAlertOnce(false)\n .setSmallIcon(R.mipmap.ic_cvox)\n .setLargeIcon(largeIcon)\n .setSubText(mAudioInfo.artist)\n .setContentTitle(mAudioInfo.title)\n .setContentText(text);\n\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {\n notificationBuilder = notificationBuilder.setColor(palette.getDominantColor(Color.BLACK)).setColorized(true);\n }\n\n if (mLoadingStatus.isEmpty()) {\n notificationBuilder = notificationBuilder.setStyle(\n new android.support.v4.media.app.NotificationCompat.MediaStyle()\n .setMediaSession(mMediaSession.getSessionToken())\n .setShowActionsInCompactView(0, 1, 2)\n .setShowCancelButton(true))\n .addAction(android.R.drawable.ic_media_previous, \"prev\", getPlaybackActionIntent(2))\n .addAction(notificationAction, \"play/pause\", playOrPauseIntent)\n .addAction(android.R.drawable.ic_media_next, \"next\", getPlaybackActionIntent(3));\n }\n\n mNotificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());\n }",
"private JSONObject constructJsonNotification( MassNotificationTaskConfig config, HtmlTemplate html, ResourceExtenderHistory resourceExtenderHistory, Map<String, Object> model )\n {\n Map<String, Object> map = new HashMap< >( );\n \n map.put( FormsExtendConstants.JSON_OBJECT, AppTemplateService.getTemplateFromStringFtl( config.getSubjectForDashboard( ), null, model ).getHtml( ) );\n map.put( FormsExtendConstants.JSON_SENDER, config.getSenderForDashboard( ) );\n map.put( FormsExtendConstants.JSON_MESSAGE, html.getHtml( ) );\n map.put( FormsExtendConstants.JSON_ID_USER, resourceExtenderHistory.getUserGuid( ) );\n\n return new JSONObject( map );\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"push\";//getString(R.string.channel_name);\n String description = \"pushnotif\";//getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"CHANNEL_ID\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"Channel1\";\n String description = \"Channel discription\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(channelId, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@Override\n public void setNotificationPreferences(String notificationPreferences) {\n this.notificationPreferences = notificationPreferences;\n SharedPreferences sharedPreferences = this.getSharedPreferences(KEY_SHAREDPREF_FILE, Context.MODE_PRIVATE);\n sharedPreferences.edit()\n .putString(KEY_SHARED_PREF_NOTIF,notificationPreferences)\n .apply();\n\n Log.i(TAG_MAIN, \"setNotificationPreferences: \" + notificationPreferences);\n }",
"@SuppressWarnings(\"deprecation\")\n\tprivate Notification makeNotification(){\n \tNotification notice = new Notification(R.drawable.ic_action_about, \n \t\t\tgetString(R.string.notice_ticker), System.currentTimeMillis());\n \tnotice.setLatestEventInfo(this, getString(R.string.notice_title), getString(R.string.notice_content), \n \t\t\tPendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class).\n \t\t\t\t\tsetFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP), 0));\n\n \tnotice.flags |= Notification.FLAG_NO_CLEAR;\n \t\n \treturn notice;\n\n }",
"public void createChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(\"Stopwatch\", \"StopWatch\", NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(\"Stopwatch Notifications\");\n Objects.requireNonNull(this.getSystemService(NotificationManager.class)).createNotificationChannel(channel);\n }\n }",
"private void settingsParameters(){\n String settings = Settings.System.getString(context.getContentResolver(), this.watchface+\"Settings\");\n if (settings == null || settings.equals(\"\")) {settings = \"{}\";}\n\n // Extract data from JSON\n JSONObject json_settings;\n try {\n json_settings = new JSONObject(settings);\n\n // Circles Widget\n if (json_settings.has(\"battery\")) {this.batteryBool = json_settings.getBoolean(\"battery\");}\n if (json_settings.has(\"steps\")) {this.stepsBool = json_settings.getBoolean(\"steps\");}\n if (json_settings.has(\"todayDistance\")) {this.todayDistanceBool = json_settings.getBoolean(\"todayDistance\");}\n if (json_settings.has(\"totalDistance\")) {this.totalDistanceBool = json_settings.getBoolean(\"totalDistance\");}\n if (json_settings.has(\"batteryCircle\")) {this.batteryCircleBool = json_settings.getBoolean(\"batteryCircle\");}\n if (json_settings.has(\"stepsCircle\")) {this.stepCircleBool = json_settings.getBoolean(\"stepsCircle\");}\n if (json_settings.has(\"todayDistanceCircle\")) {this.todayDistanceCircleBool = json_settings.getBoolean(\"todayDistanceCircle\");}\n if(isCircles()){\n if(batteryBool){\n\n\n }\n\n }\n\n } catch (JSONException e) {\n //Settings.System.putString(getContentResolver(), this.watchface+\"Settings\", \"{}\");//reset wrong settings data\n }\n }",
"private void setupNotificationCharacteristic() {\n notificationCharacteristic =\n new BluetoothGattCharacteristic(CHARACT_NOTIFICATION_UUID,\n BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE | BluetoothGattCharacteristic.PROPERTY_NOTIFY,\n BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE);\n\n notificationCharacteristic.addDescriptor(\n Peripheral.getClientCharacteristicConfigurationDescriptor());\n\n notificationCharacteristic.addDescriptor(\n Peripheral.getCharacteristicUserDescriptionDescriptor(CHARACT_NOTIFICATION_DESC));\n\n notificationCharacteristic.setValue(notificationCharacteristic_value);\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = getString(R.string.channel_name);\n String description = getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n\n // crate a channel with high priority\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID_1, name, importance);\n\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n\n// // Create an Intent for the activity you want to start\n// Intent resultIntent = new Intent(this, MainActivity.class);\n// // Create the TaskStackBuilder and add the intent, which inflates the back stack\n// TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n// stackBuilder.addNextIntentWithParentStack(resultIntent);\n// // Get the PendingIntent containing the entire back stack\n// PendingIntent resultPendingIntent =\n// stackBuilder.getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n }\n\n }",
"public void buildNotificationSingle(){\n if(arraylisted.size() ==1){\n Product contact = arraylisted.get(0);\n\n String userDept = arraylisted.get(0).getDept();\n String userName = arraylisted.get(0).getName();\n String userLevel = arraylisted.get(0).getLevel();\n String userID = arraylisted.get(0).getuserID();\n String str = notifyliste.get(0).getEmail();\n if(str.length() >=200){\n int k = str.length() / 2;\n str = str.substring(0,k) + \" ...\";\n }\n String prep = userName + System.getProperty(\"line.separator\") + userLevel + \" Level - \" + userDept;\n byte[] userPics = arraylisted.get(0).getBLOB();\n\n //build the actviity intents\n Intent notificationIntent = new Intent(getApplicationContext(),viewNamsn.class);\n\n notificationIntent.putExtra(\"userName\", userName);\n notificationIntent.putExtra(\"userLevel\", userLevel);\n notificationIntent.putExtra(\"userDept\", userDept);\n notificationIntent.putExtra(\"userID\", userID);\n notificationIntent.putExtra(\"userPics\", userPics);\n\n notificationIntent.setFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY | Intent.FLAG_ACTIVITY_NEW_TASK);\n PendingIntent pend = PendingIntent.getActivity(getApplicationContext(),0,notificationIntent,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //mBuilder = buildNotification(userPics,prep);\n //design the new custom view\n RemoteViews notificationView = new RemoteViews(\n getApplicationContext().getPackageName(),\n R.layout.activity_custom_notification\n );\n Bitmap bitmap = BitmapFactory.decodeByteArray(userPics,0,userPics.length);\n // notificationView.setImageViewResource(R.id.imagenotileft,R.mipmap.ic_launcher);\n notificationView.setImageViewBitmap(R.id.imagenotileft,bitmap);\n // Locate and set the Text into customnotificationtext.xml TextViews\n notificationView.setTextViewText(R.id.title, (getString(R.string.app_name)));\n notificationView.setTextViewText(R.id.text, prep);\n // notificationView.setTextViewText(R.id.qoute, str);\n\n //go and build the notification\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(getApplicationContext());\n mBuilder.setContentIntent(pend);\n mBuilder.setContentTitle(getString(R.string.app_name));\n mBuilder.setContentText(userName + \" Recently Joined ATBU 37 NAMSSN ELITE E-YEAR BOOK !!!\");\n mBuilder.setTicker(userName + \" Recently Joined ATBU 37 NAMSSN ELITE E-YEAR BOOK !!!\");\n mBuilder.setAutoCancel(true);\n mBuilder.setContent(notificationView);\n mBuilder.setSmallIcon(R.mipmap.ic_app);\n mBuilder.setPriority(2);\n Uri alarmsound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n mBuilder.setSound(alarmsound);\n mBuilder.setLights(Color.RED, 3000, 3000);\n mBuilder.setVibrate(new long[]{1000, 1000, 1000, 1000, 1000 });\n //display the notification\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.notify(0123,mBuilder.build());\n }\n // arraylisted.clear();\n }",
"static private void createNotificationChannel(Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"lw_notification_channel\";\n String description = \"lw_notification_channel_desc\";\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(Constants.WEATHER_NOTIFICATION_CHANNEL, name, importance);\n channel.setDescription(description);\n\n // Register Notification channel\n NotificationManager notificationManager = (NotificationManager)\n context.getSystemService(Context.NOTIFICATION_SERVICE);\n if (notificationManager != null) {\n notificationManager.createNotificationChannel(channel);\n }\n }\n }",
"private ContentValues buildValues(NotificationEntry notificationEntry) {\n CharSequence charSequence;\n byte[] drawableToByte = drawableToByte(notificationEntry.getSbn().getAppIcon());\n if (drawableToByte == null) {\n return null;\n }\n boolean isSensitive = notificationEntry.isSensitive();\n Notification notification = notificationEntry.getSbn().getNotification();\n CharSequence appName = isSensitive ? notificationEntry.getSbn().getAppName() : NotificationUtil.resolveTitle(notification);\n CharSequence hiddenText = isSensitive ? NotificationUtil.getHiddenText() : NotificationUtil.resolveText(notification);\n String str = CodeInjection.MD5;\n if (isSensitive) {\n charSequence = str;\n } else {\n charSequence = NotificationUtil.resolveSubText(notification);\n }\n ContentValues contentValues = new ContentValues();\n contentValues.put(\"icon\", drawableToByte);\n contentValues.put(\"title\", TextUtils.isEmpty(appName) ? str : appName.toString());\n contentValues.put(\"content\", TextUtils.isEmpty(hiddenText) ? str : hiddenText.toString());\n contentValues.put(\"time\", getTimeText(notificationEntry));\n contentValues.put(\"info\", new ArrayList(this.mSortedKeys).toString());\n if (!TextUtils.isEmpty(charSequence)) {\n str = charSequence.toString();\n }\n contentValues.put(\"subtext\", str);\n contentValues.put(\"key\", Integer.valueOf(notificationEntry.getKey().hashCode()));\n contentValues.put(\"pkg\", notificationEntry.getSbn().getPackageName());\n contentValues.put(\"user_id\", Integer.valueOf(notificationEntry.getSbn().getUserId()));\n return contentValues;\n }",
"private void showUserSettings() {\n\t\t\tSharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\tbuilder.append(\"\\n Send report:\"+ sharedPrefs.getBoolean(\"prefSendReport\", true));\n\t\t}",
"private void setFormatProperty(PSPubServer server, PSPublishServerInfo pubServerInfo, IPSSite site)\n {\n boolean isXmlSet = Boolean.parseBoolean(pubServerInfo.findProperty(XML_FLAG));\n String propertyValue = isXmlSet ? XML_FLAG : HTML_FLAG;\n\n server.addProperty(IPSPubServerDao.PUBLISH_FORMAT_PROPERTY, propertyValue);\n }",
"private void showInboxStyleNotification() {\n NotificationCompat.InboxStyle style = new NotificationCompat.InboxStyle();\n style.setBigContentTitle(\"Inbox Style Regular Notification\");\n style.addLine(\"Line 1\");\n style.addLine(\"Line 2\");\n style.addLine(\"Line 3\");\n style.addLine(\"Line 4\");\n\n //Build the content of the notification\n NotificationCompat.Builder builder = new NotificationCompat.Builder(ActivityA.this);\n builder.setContentTitle(\"Inbox Style Regular Notification\");\n builder.setContentText(contentText);\n builder.setSmallIcon(R.drawable.ic_launcher_background);\n builder.setTicker(\"Hey, This is a ticker!!!!!!\");\n builder.setAutoCancel(true);\n builder.setStyle(style);\n\n\n //Provide explicit intents for notification\n Intent i = new Intent(ActivityA.this,ActivityB.class);\n //Add a back stack using task using stack builder and set the intent to pending intent\n TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);\n stackBuilder.addParentStack(ActivityB.class);\n stackBuilder.addNextIntent(i);\n PendingIntent pi_main =stackBuilder.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for settings\n Intent j = new Intent(ActivityA.this,Settings.class);\n TaskStackBuilder stackBuilder_settings = TaskStackBuilder.create(this);\n stackBuilder_settings.addParentStack(Settings.class);\n stackBuilder_settings.addNextIntent(j);\n PendingIntent pi_settings =stackBuilder_settings.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n\n //Provide explicit intents Add a back stack using task using stack builder and set the intent to pending intent for help\n Intent k = new Intent(ActivityA.this,Help.class);\n TaskStackBuilder stackBuilder_help = TaskStackBuilder.create(this);\n stackBuilder_help.addParentStack(Help.class);\n stackBuilder_help.addNextIntent(k);\n PendingIntent pi_help =stackBuilder_help.getPendingIntent(0,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi_main);\n builder.addAction(R.drawable.settings,\"Settings\",pi_settings);\n builder.addAction(R.drawable.help,\"Help\",pi_help);\n\n //Notifications through notification manager\n Notification notification = builder.build();\n NotificationManager manager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);\n manager.notify(29,notification);\n }",
"public static void PopulateAppSettings(Context context)\n {\n\n Utilities.LogInfo(\"Getting preferences\");\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(context);\n\n /*AppSettings.setUseImperial(prefs.getBoolean(\"useImperial\", false));\n AppSettings.setLogToKml(prefs.getBoolean(\"log_kml\", false));\n AppSettings.setLogToGpx(prefs.getBoolean(\"log_gpx\", false));\n AppSettings.setLogToPlainText(prefs.getBoolean(\"log_plain_text\", false));\n AppSettings.setLogToOpenGTS(prefs.getBoolean(\"log_opengts\", false));\n */\n AppSettings.setShowInNotificationBar(prefs.getBoolean(\n \"show_notification\", true));\n\n /*AppSettings.setPreferCellTower(prefs.getBoolean(\"prefer_celltower\",\n false));*/\n\n\n String minimumDistanceString = prefs.getString(\n \"distance_before_logging\", \"0\");\n\n if (minimumDistanceString != null && minimumDistanceString.length() > 0)\n {\n AppSettings.setMinimumDistanceInMeters(Integer\n .valueOf(minimumDistanceString));\n }\n else\n {\n AppSettings.setMinimumDistanceInMeters(0);\n }\n\n/* String minimumAccuracyString = prefs.getString(\n \"accuracy_before_logging\", \"0\");\n\n if (minimumAccuracyString != null && minimumAccuracyString.length() > 0)\n {\n AppSettings.setMinimumAccuracyInMeters(Integer\n .valueOf(minimumAccuracyString));\n }\n else\n {\n AppSettings.setMinimumAccuracyInMeters(0);\n }*/\n\n /*if (AppSettings.shouldUseImperial())\n {\n AppSettings.setMinimumDistanceInMeters(Utilities.FeetToMeters(AppSettings\n .getMinimumDistanceInMeters()));\n\n AppSettings.setMinimumAccuracyInMeters(Utilities.FeetToMeters(AppSettings\n .getMinimumAccuracyInMeters()));\n }*/\n\n\n String minimumSecondsString = prefs.getString(\"time_before_logging\",\n \"60\");\n\n if (minimumSecondsString != null && minimumSecondsString.length() > 0)\n {\n AppSettings\n .setMinimumSeconds(Integer.valueOf(minimumSecondsString));\n }\n else\n {\n AppSettings.setMinimumSeconds(60);\n }\n\n /*AppSettings.setKeepFix(prefs.getBoolean(\"keep_fix\",\n false));*/\n\n/* String retryIntervalString = prefs.getString(\"retry_time\",\n \"60\");\n\n if (retryIntervalString != null && retryIntervalString.length() > 0)\n {\n AppSettings\n .setRetryInterval(Integer.valueOf(retryIntervalString));\n }\n else\n {\n AppSettings.setRetryInterval(60);\n }*/\n\n /*AppSettings.setNewFileCreation(prefs.getString(\"new_file_creation\",\n \"onceaday\"));\n\n if (AppSettings.getNewFileCreation().equals(\"onceaday\"))\n {\n AppSettings.setNewFileOnceADay(true);\n AppSettings.setStaticFile(false);\n }\n else if(AppSettings.getNewFileCreation().equals(\"static\"))\n {\n AppSettings.setStaticFile(true);\n AppSettings.setStaticFileName(prefs.getString(\"new_file_static_name\",\"gpslogger\"));\n }\n else\n {\n AppSettings.setNewFileOnceADay(false);\n AppSettings.setStaticFile(false);\n }\n\n\n AppSettings.setAutoEmailEnabled(prefs.getBoolean(\"autoemail_enabled\",\n false));*/\n\n AppSettings.setAutoSendEnabled(prefs.getBoolean(\"autosend_enabled\", true));//always auto send after %AutoDelayTime%\n\n if (Float.valueOf(prefs.getString(\"autosend_frequency\", \"0\")) >= 8f)\n {\n SharedPreferences.Editor editor = prefs.edit();\n editor.putString(\"autosend_frequency\", \"8\");\n editor.commit();\n }\n \n AppSettings.setAutoSendDelay(Float.valueOf(prefs.getString(\n \"autosend_frequency\", \"0.01667f\")));//default:0.01667f == 1 min.\n\n /*\n\n AppSettings.setSmtpServer(prefs.getString(\"smtp_server\", \"\"));\n AppSettings.setSmtpPort(prefs.getString(\"smtp_port\", \"25\"));\n AppSettings.setSmtpSsl(prefs.getBoolean(\"smtp_ssl\", true));\n AppSettings.setSmtpUsername(prefs.getString(\"smtp_username\", \"\"));\n AppSettings.setSmtpPassword(prefs.getString(\"smtp_password\", \"\"));\n AppSettings.setAutoEmailTargets(prefs.getString(\"autoemail_target\", \"\"));\n AppSettings.setDebugToFile(prefs.getBoolean(\"debugtofile\", false));\n AppSettings.setShouldSendZipFile(prefs.getBoolean(\"autosend_sendzip\", true));\n AppSettings.setSmtpFrom(prefs.getString(\"smtp_from\", \"\"));\n AppSettings.setOpenGTSEnabled(prefs.getBoolean(\"opengts_enabled\", false));\n AppSettings.setAutoOpenGTSEnabled(prefs.getBoolean(\"autoopengts_enabled\", false));*/\n \n AppSettings.setVmsServer(prefs.getString(\"vms_server\", \"123.30.31.138\"));\n AppSettings.setVmsServerPort(prefs.getString(\"vms_server_port\", \"8080\"));\n AppSettings.setVmsServerPath(prefs.getString(\"vms_server_path\", \"/GTS/eventdata\"));\n \n \n /*AppSettings.setOpenGTSDeviceId(prefs.getString(\"opengts_device_id\", \"\"));\n AppSettings.setOpenGTSServerCommunicationMethod(prefs.getString(\"opengts_server_communication_method\", \"\"));\n \n AppSettings.setAutoFtpEnabled(prefs.getBoolean(\"autoftp_enabled\",false));\n AppSettings.setFtpServerName(prefs.getString(\"autoftp_server\",\"\"));\n AppSettings.setFtpUsername(prefs.getString(\"autoftp_username\",\"\"));\n AppSettings.setFtpPassword(prefs.getString(\"autoftp_password\",\"\"));\n AppSettings.setFtpPort(Integer.valueOf(prefs.getString(\"autoftp_port\", \"21\")));\n AppSettings.setFtpUseFtps(prefs.getBoolean(\"autoftp_useftps\", false));\n AppSettings.setFtpProtocol(prefs.getString(\"autoftp_ssltls\",\"\"));\n AppSettings.setFtpImplicit(prefs.getBoolean(\"autoftp_implicit\", false));*/\n\n }",
"private void showUserSettings() {\n\t\tSharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\tStringBuilder builder = new StringBuilder();\n\t\tbuilder.append(\"\\n Send report:\"+ sharedPrefs.getBoolean(\"prefSendReport\", true));\n\t}",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"channel1\";\n String description = \"First Notification Channel\";\n NotificationChannel channel = new NotificationChannel( \"ch1\", name, NotificationManager.IMPORTANCE_DEFAULT);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"@Override\n public void onNotificationPosted(StatusBarNotification sbn) {\n int notificationCode = matchNotificationCode(sbn);\n String pack = \"\";\n Bundle extras = null;\n String title = \"\";\n String text = \"\";\n String subtext = \"\";\n String key = \"\";\n try {\n pack = sbn.getPackageName();\n extras = sbn.getNotification().extras;\n //Prendo i dati della notifica\n title = extras.getString(\"android.title\");\n //Parso il titolo\n if (title.contains(\"(\") && title.contains(\")\") && (title.contains((\"messaggi\")) || title.contains(\"messaggio\"))) {\n int posA = title.lastIndexOf('(');\n title = title.substring(0, posA - 1);\n }\n text = extras.getCharSequence(\"android.text\").toString();\n subtext = \"\";\n } catch (Exception ex) {\n Log.d(\"WHATSAPP RIGA 100\", \"Conv fallita\");\n }\n if (matchNotificationCode(sbn) != InterceptedNotificationCode.OTHER_NOTIFICATIONS_CODE) {\n if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)) {\n //EDIT\n /* Used for SendBroadcast */\n try {\n Parcelable b[] = (Parcelable[]) extras.get(Notification.EXTRA_MESSAGES);\n String content;\n if (b != null) {\n content = \"\";\n for (Parcelable tmp : b) {\n key = String.valueOf(tmp.hashCode());\n Bundle msgBundle = (Bundle) tmp;\n subtext = msgBundle.getString(\"text\");\n //content = content + msgBundle.getString(\"text\") + \"\\n\";\n }\n /*Toast.makeText(getApplicationContext(), content,\n Toast.LENGTH_LONG).show();*/\n }\n if (subtext.isEmpty()) {\n subtext = text;\n }\n } catch (Exception e) {\n Log.d(\"ERRORE RIGA 90 WHATSAPP\", \"Probabilmente la notifica è sballata\");\n }\n Notifica nuovaNotifica = new Notifica();\n\n if (subtext != null) {\n if (!text.contains(\"nuovi messaggi\") && !text.contains(\"WhatsApp Web is currently active\") && !text.contains(\"WhatsApp Web login\") && !title.toLowerCase().equals(\"whatsapp\")) {\n try {\n DateFormat df = new SimpleDateFormat(\"ddMMyyyyHHmmss\");\n String date = df.format(Calendar.getInstance().getTime());\n nuovaNotifica = new Notifica(key, pack, title, subtext, date);\n } catch (Exception ex) {\n Log.d(\"WHATSAPP RIGA 100\", \"Conversione fallita\");\n }\n try {\n //Parso il messaggio se viene da instagram\n if (matchNotificationCode(sbn) == InterceptedNotificationCode.INSTAGRAM_CODE) {\n //Elimino l'username nel messaggio\n if (subtext.contains(\":\"))\n subtext = subtext.substring(subtext.indexOf(':') + 2, subtext.length());\n else {\n if (subtext.contains(title)) {\n int ind = subtext.indexOf(title);\n subtext = subtext.replace(title, \"\");\n subtext = subtext.substring(1, subtext.length());\n }\n }\n }\n } catch (Exception ex) {\n Log.d(\"WHATSAPP RIGA 160\", \"Parser fallito\");\n }\n //Controllo che non abbia già ricevuto il messaggio\n String contatto = title + matchNotificationCode(sbn);\n int posizioneContatto = TrovaContattoInUltimiMessaggi(contatto);\n boolean daInviare = true;\n //Se ho trovato il contatto, controllo il valore se è diverso aggiungo e invio\n //Altrimenti modifico e non invio\n //Se non lo trovo lo registro e invio\n if (posizioneContatto != -1) {\n String strV = UltimiMessaggi.get(posizioneContatto).UltimoMessaggio;\n if (strV.equals(subtext)) {\n daInviare = false;\n } else {\n SettaUltimoMessaggio(posizioneContatto, subtext);\n }\n } else {\n //Aggiungo il contatto e il messaggio nella lista\n UltimiMessaggi.add(new ContattoAC(contatto, subtext));\n }\n //Invio la notifica alla mainActivity\n if (daInviare) {\n Intent intent = new Intent(\"ricevitoreNotifiche\");\n try {\n /*//LOG\n Log.d(\"Notifica KEY\", key);\n Log.d(\"Contatto\", title);\n Log.d(\"Messaggio\", subtext);*/\n intent.putExtra(\"ID\", nuovaNotifica.getID());\n intent.putExtra(\"Applicazione\", nuovaNotifica.getApplicazione());\n intent.putExtra(\"Titolo\", nuovaNotifica.getTitolo());\n intent.putExtra(\"Testo\", nuovaNotifica.getTesto());\n intent.putExtra(\"DateTime\", nuovaNotifica.getDateTime());\n sendBroadcast(intent);\n } catch (Exception ex) {\n Log.d(\"ERROR RIGA 103 WHATSAPP\", \"Non riesco a inviare in broadcast\");\n }\n }\n }\n /* End Used for Toast */\n }\n }\n }\n\n }",
"private void createNotification(FoodEvents event) {\n Context context = getBaseContext();\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context).setSmallIcon(R.drawable.ic_launcher).setContentTitle(event.getTitle())\n .setContentText(event.getDescription());\n Intent resultIntent = new Intent(this, EventDetails.class);\n resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n resultIntent.putExtra(EventDetails.EXTRA_EVENT, event);\n PendingIntent resultPendingIntent = PendingIntent.getActivity(getBaseContext(), 0, resultIntent, PendingIntent.FLAG_UPDATE_CURRENT, null);\n mBuilder.setContentIntent(resultPendingIntent);\n NotificationManager mNotificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n notifyMyWatch(event);\n }",
"private void initNotification() {\n Notification.Builder notificationBuilder =\n new Notification.Builder(this).setSmallIcon(R.drawable.notification_anim)\n .setContentTitle(\"Streaming\")\n .setContentText(\"Display mode stream\")\n .setTicker(\"Stream in progress\");\n notificationBuilder.setAutoCancel(true);\n if (notificationManager != null)\n notificationManager.notify(12345, notificationBuilder.build());\n }",
"@RequestMapping(value = \"/broadband-user/system/notification/create\")\n\tpublic String toNotificationCreate(Model model) {\n\n\t\tmodel.addAttribute(\"notification\", new Notification());\n\t\tmodel.addAttribute(\"panelheading\", \"Notification Create\");\n\t\tmodel.addAttribute(\"action\", \"/broadband-user/system/notification/create\");\n\n\t\treturn \"broadband-user/system/notification\";\n\t}",
"private NotificationCompat.Builder getNotificationBuilder()\n {\n //Launches the application once the user clicks the notification\n //Pending intent that is sent when the user clicks on the notification in the notification bar\n Intent notificationIntent = new Intent(this, MainActivity.class);\n PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, NOTIFICATION_ID, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder notifyBuilder = new NotificationCompat.Builder(this, PRIMARY_CHANNEL_ID)\n .setContentTitle(\"You've been notified!\")\n .setContentText(\"This is your notification text.\")\n .setContentIntent(notificationPendingIntent)\n .setSmallIcon(R.drawable.ic_stat_name);\n return notifyBuilder;\n }",
"public void setUpNotificationChannel() {\n Log.d(TAG, \"Build.version.SDK_INT: \" + Build.VERSION.SDK_INT);\n\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n\n if (notificationManager == null) {\n\n // get access to Notification Service through a Notification Manager object\n notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n\n int importance = NotificationManager.IMPORTANCE_HIGH;\n\n NotificationChannel notificationChannel =\n new NotificationChannel(channelId, channelName, importance);\n\n notificationManager.createNotificationChannel(notificationChannel);\n }\n\n }\n }",
"public void createOrUpdateNotification(Stock stock) {\n Intent intent = new Intent(mContext, MainActivity.class);\n PendingIntent pIntent = PendingIntent.getActivity(mContext, 0, intent, 0);\n\n // Build notification\n // Actions are just fake\n\n int color = stock.getLastDelta() > 0 ? mContext.getResources().getColor(android.R.color.holo_green_light) : mContext.getResources().getColor(android.R.color.holo_red_light);\n\n int change = (int) ((stock.getLastDelta() * 100) / (stock.getPrice() - stock.getLastDelta()));\n String indicator_text = stock.getLastDelta() > 0 ? mContext.getString(R.string.risen) : mContext.getString(R.string.dropped);\n\n DecimalFormat myFormatter = new DecimalFormat(\"##0.00\");\n\n\n String contentText = mContext.getString(R.string.notification_content, stock\n .getSymbol().toUpperCase(), color, indicator_text, myFormatter.format(stock.getPrice()), \"(\" + change +\"%)\");\n\n\n SpannableStringBuilder cs = new SpannableStringBuilder(contentText);\n int start = contentText.indexOf(indicator_text);\n int end = start + indicator_text.length();\n cs.setSpan(new ForegroundColorSpan(color), start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE);\n\n\n\n Notification noti = new NotificationCompat.Builder(mContext)\n .setContentTitle(mContext.getString(R.string.title))\n .setContentText(cs)\n .setSmallIcon(R.drawable.ic_launcher)\n .setContentIntent(pIntent)\n .build();\n\n NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Hide the notification after its selected\n noti.flags |= Notification.FLAG_AUTO_CANCEL;\n\n notificationManager.notify(stock.getId().intValue(), noti);\n\n\n }",
"public void sync_notifications() {\n Log.i(TAG,\"********** sync_notifications\");\n\n if (NotifierConfiguration.cfg_notifier_paused) {\n Log.i(TAG, \"Notifier paused. Ignoring...\");\n return;\n }\n\n sync_in_progress = true;\n /**\n * Initially mark everything in notifications table as inactive\n */\n ntfcn_items.markAllInactive();\n\n for (StatusBarNotification asbn : getActiveNotifications()) {\n StatusBarNotification sbn = asbn.clone();\n\n String condensed_string = ntfcn_items.getCondensedString(sbn);\n\n Log.i(TAG,\"Condensed string: \" + condensed_string);\n\n try {\n PackageManager pm = getPackageManager();\n String app_name = (String) pm.getApplicationLabel(\n pm.getApplicationInfo(sbn.getPackageName(), PackageManager.GET_META_DATA));\n\n Log.i(TAG,\"ID :\" + sbn.getId() + \"\\t\" + sbn.getNotification().tickerText +\n \"\\t\" + sbn.getPackageName());\n\n Log.i(TAG,\"App name :\" + app_name + \"\\n\");\n\n HashSet<String> exclusion_list = NotifierConfiguration.excluded_packages;\n if (exclusion_list.contains(sbn.getPackageName())) {\n Log.i(TAG, \"Pkg: \" + sbn.getPackageName() + \" in exclusion list. Ignoring.\");\n continue;\n }\n\n /** skip group headers */\n if ( ((sbn.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0)) {\n Log.i(TAG, \"skippiing group header key: \" + sbn.getKey());\n continue;\n }\n\n /** Add a new active notification entry or\n * just mark it as active if it already exists\n */\n addActiveSBN(sbn);\n\n\n /**\n if (sbn.getNotification().extras.get(NotificationCompat.EXTRA_TEMPLATE).equals(\n \"android.app.Notification$MessagingStyle\")\n ) {\n\n Log.e(TAG, \"Messaging\");\n Log.i(TAG, \"Extra Messages: \" +\n sbn.getNotification().extras.get(NotificationCompat.EXTRA_MESSAGES).toString());\n\n Log.i(TAG, \"Extra Messages History: \" +\n sbn.getNotification().extras.get(Notification.EXTRA_HISTORIC_MESSAGES));\n\n Log.i(TAG, \"Extra conversation title: \" +\n sbn.getNotification().extras.get(NotificationCompat.EXTRA_CONVERSATION_TITLE));\n }\n\n\n Log.i(TAG, \"Flags: \" +\n ((sbn.getNotification().flags & Notification.FLAG_GROUP_SUMMARY) != 0));\n\n Log.i(TAG, \"Title :\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TITLE) + \"\\n\");\n Log.i(TAG, \"Text :\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TEXT) + \"\\n\");\n Log.i(TAG, \"Extra conv titles: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_CONVERSATION_TITLE));\n\n Log.i(TAG, \"Extra info text: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_INFO_TEXT));\n Log.i(TAG, \"Extra Messages: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_MESSAGES));\n\n Log.i(TAG, \"Extra big text lines\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_BIG_TEXT));\n Log.i(TAG, \"Extra text lines\" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TEXT_LINES));\n Log.i(TAG, \"Extra sub text \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_SUB_TEXT));\n Log.i(TAG, \"Extra summary text \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_SUMMARY_TEXT));\n\n Log.i(TAG, \"Extra title big: \" + sbn.getNotification().extras.get(NotificationCompat.EXTRA_TITLE_BIG));\n\n\n Log.i(TAG, \"SBN group? \" + sbn.isGroup());\n Log.i(TAG, \"Clearable? \" + sbn.isClearable());\n Log.i(TAG, \"Posted at \" + DateUtils.getRelativeTimeSpanString(sbn.getPostTime()));\n Log.i(TAG, \"Group key \" + sbn.getGroupKey());\n Log.i(TAG, \"SBN key \" + sbn.getKey());\n Log.i(TAG, \"TAG \" + sbn.getTag());\n Log.i(TAG, \"Click Action :\" + sbn.getNotification().contentIntent.toString());\n\n Log.i(TAG, \"Delete Action :\" + sbn.getNotification().deleteIntent.toString());\n\n for (Notification.Action action : sbn.getNotification().actions) {\n Log.i(TAG, \"Action :\" + action.title + \" Intent: \" + action.actionIntent.toString() + \"\\n\");\n }\n */\n } catch(Exception e) {\n Log.e(TAG, \"Exception occurred while syncing notifications: \" + e.getMessage());\n }\n }\n\n /**\n * If there are entries previously marked inactive, but doesn't have its cleared time set,\n * Set its cleared time to now\n */\n ntfcn_items.update_cleared_time_if_zero();\n this.num_active = ntfcn_items.getActiveCount();\n sync_in_progress = false;\n\n /** Update active notifications count in persistent notification */\n pnotif_builder.setContentText(\"Tap to open Notifications Center\");\n\n if (NotifierConfiguration.cfg_svc_notification_enabled) {\n show_notification();\n }\n\n /**\n * TODO: if needed, remove all inactive applications at this point\n * if NotifierConfiguration.cfg_cache_notifications_enabled is false\n */\n }",
"private String createCustomInfoString() {\r\n String CustomInfo = \"\";\r\n Iterator<String> iterator = mCustomParameters.keySet().iterator();\r\n while (iterator.hasNext()) {\r\n String CurrentKey = iterator.next();\r\n String CurrentVal = mCustomParameters.get(CurrentKey);\r\n CustomInfo += CurrentKey + \" = \" + CurrentVal + \"\\n\";\r\n }\r\n return CustomInfo;\r\n }",
"private static void generateNotification(Context context, Bundle bundle) {\n\t\tint icon = R.drawable.icon;\n\t\tlong when = System.currentTimeMillis();\n\t\tString message = bundle.getString(\"message\");\n\t\tNotificationManager notificationManager = (NotificationManager) context\n\t\t\t\t.getSystemService(Context.NOTIFICATION_SERVICE);\n\t\tNotification notification = new Notification(icon, message, when);\n\t\tString title = context.getString(R.string.app_name);\n\t\tIntent notificationIntent = new Intent(context, NetasDemoActivity.class);\n\n\t\tnotificationIntent.putExtras(bundle);\n\n\t\t// set intent so it does not start a new activity\n\t\tnotificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP\n\t\t\t\t| Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\tPendingIntent intent = PendingIntent.getActivity(context, 0,\n\t\t\t\tnotificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n\t\tnotification.defaults |= Notification.DEFAULT_SOUND\n\t\t\t\t| notification.DEFAULT_LIGHTS | notification.DEFAULT_VIBRATE;\n\t\t// long[] vibrate = {0,100,200,300};\n\t\t// notification.vibrate = vibrate;\n\t\tnotification.setLatestEventInfo(context, title, message, intent);\n\t\tnotification.flags |= Notification.FLAG_AUTO_CANCEL\n\t\t\t\t| Notification.FLAG_SHOW_LIGHTS;\n\t\tnotification.ledOnMS = 1000; // light on in milliseconds\n\t\tnotification.ledOffMS = 4000; // light off in milliseconds\n\t\tnotificationManager.notify(0, notification);\n\t}",
"@NonNull\n\tNotificationBuilder newNotification();",
"private void createNotificationChannel(Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = context.getString(R.string.channel_name);\n String description = context.getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = context.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void setupNotificationLayout() {\n //Setup notification area to begin date-set process on click.\n notificationLayout.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View v, MotionEvent event) {\n showTimerPickerDialog();\n return false;\n }\n });\n\n //Remove date from task and updated view\n notificationRemoveButton.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n cal = null;\n EventBus.getDefault().post(new TaskEditedEvent());\n }\n });\n }",
"private void createContent() {\n\t\t// Design mail content\n\t\tview.getTxtSubject().setText(\n\t\t\t\tMessages.getString(\"SendAlertController.1\") + arr[9]);\n\t\tcontent += Messages.getString(\"SendAlertController.2\") + arr[1]\n\t\t\t\t+ Messages.getString(\"SendAlertController.3\");\n\t\tcontent += Messages.getString(\"SendAlertController.4\") + arr[12]\n\t\t\t\t+ Messages.getString(\"SendAlertController.5\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.6\");\n\t\tcontent += Messages.getString(\"SendAlertController.7\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.8\")\n\t\t\t\t+ new Date().toString()\n\t\t\t\t+ Messages.getString(\"SendAlertController.9\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.10\") + arr[9]\n\t\t\t\t+ Messages.getString(\"SendAlertController.11\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.12\") + arr[11]\n\t\t\t\t+ Messages.getString(\"SendAlertController.13\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.14\") + arr[12]\n\t\t\t\t+ Messages.getString(\"SendAlertController.15\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.16\")\n\t\t\t\t+ fee.getBorFee()\n\t\t\t\t+ Messages.getString(\"SendAlertController.17\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.18\")\n\t\t\t\t+ fee.getLateFee()\n\t\t\t\t+ Messages.getString(\"SendAlertController.19\");\n\t\tcontent += Messages.getString(\"SendAlertController.20\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.21\") + arr[1]\n\t\t\t\t+ Messages.getString(\"SendAlertController.22\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.23\") + arr[4]\n\t\t\t\t+ Messages.getString(\"SendAlertController.24\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.25\") + arr[6]\n\t\t\t\t+ Messages.getString(\"SendAlertController.26\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.27\") + arr[7]\n\t\t\t\t+ Messages.getString(\"SendAlertController.28\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.29\") + arr[5]\n\t\t\t\t+ Messages.getString(\"SendAlertController.30\");\n\t\tcontent += Messages.getString(\"SendAlertController.31\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.32\") + arr[15]\n\t\t\t\t+ Messages.getString(\"SendAlertController.33\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.34\") + arr[16]\n\t\t\t\t+ Messages.getString(\"SendAlertController.35\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.36\") + arr[17]\n\t\t\t\t+ Messages.getString(\"SendAlertController.37\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.38\") + arr[18]\n\t\t\t\t+ Messages.getString(\"SendAlertController.39\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.40\") + arr[19]\n\t\t\t\t+ Messages.getString(\"SendAlertController.41\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.42\") + arr[20]\n\t\t\t\t+ Messages.getString(\"SendAlertController.43\");\n\t\tcontent += Messages.getString(\"SendAlertController.44\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.45\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.46\");\n\t\tcontent += Messages.getString(\"SendAlertController.47\")\n\t\t\t\t+ Messages.getString(\"SendAlertController.48\");\n\t\tview.getTxtContent().setText(content);\n\t}",
"private void createNotification(String title, String body) {\n Context context = getBaseContext();\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n Intent notificationIntent = new Intent(context, OffersActivity.class);\n PendingIntent contentIntent = PendingIntent.getActivity(context,\n 0, notificationIntent,\n PendingIntent.FLAG_CANCEL_CURRENT);\n NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(getString(R.string.app_name))\n .setContentText(body)\n .setTicker(body)\n .setSound(defaultSoundUri)\n .setContentIntent(contentIntent)\n .setAutoCancel(true);\n NotificationManager mNotificationManager = (NotificationManager) context\n .getSystemService(Context.NOTIFICATION_SERVICE);\n mNotificationManager.notify(MESSAGE_NOTIFICATION_ID, mBuilder.build());\n }",
"public void addNotification() {\n PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, MapActivity.class), 0);\n Resources r = getResources();\n Notification notification = new NotificationCompat.Builder(this)\n .setTicker(r.getString(R.string.notification_titles))\n .setSmallIcon(android.R.drawable.ic_menu_report_image)\n .setContentTitle(r.getString(R.string.notification_titles))\n .setContentText(r.getString(R.string.notification_tex))\n .setContentIntent(pi)\n .setAutoCancel(true)\n .build();\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n notificationManager.notify(0, notification);\n }",
"private void sendNotification(Map<String, String> serverData) {\n Intent intent = new Intent(serverData.get(\"click_action\"));\n String title = serverData.get(\"title\");\n String body = serverData.get(\"body\");\n intent.putExtra(\"title\",title);\n intent.putExtra(\"body\",body);\n intent.putExtra(\"order\" , serverData.get(\"order\"));\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(this,0 /* request code */, intent, PendingIntent.FLAG_UPDATE_CURRENT);\n\n long[] pattern = {500,500,500,500,500};\n\n Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n\n NotificationCompat.Builder notificationBuilder = (NotificationCompat.Builder) new NotificationCompat.Builder(this)\n .setSmallIcon(R.drawable.ok)\n .setContentTitle(serverData.get(\"title\"))\n .setContentText(serverData.get(\"body\"))\n .setAutoCancel(true)\n .setVibrate(pattern)\n .setLights(Color.BLUE,1,1)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);\n notificationManager.notify(0 , notificationBuilder.build());\n }",
"private void createNotificationChannel() {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = \"hello\";\n String description = \"getString(R.string.channel_description)\";\n int importance = NotificationManager.IMPORTANCE_DEFAULT;\n NotificationChannel channel = new NotificationChannel(\"CHANNEL_ID\", name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"private void createScheduledNotification(List<SessionModel> values, int test)\n\t{\n\n\t\t// Get new calendar object and set the date to now\n\t\tCalendar calendar = Calendar.getInstance();\n\t\tcalendar.setTimeInMillis(System.currentTimeMillis());\n\t\t// Add defined amount of days to the date\n\n\t\tgetBaseContext();\n\t\t// Retrieve alarm manager from the system\n\t\tAlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);\n\n\t\tfor (SessionModel element : values) {\n\n\t\t\tString[] ymd = element.getStartDateSplit();\n\t\t\tint month = Integer.parseInt(ymd[0]);\n\t\t\tint date = Integer.parseInt(ymd[1]);\n\t\t\tint year = Integer.parseInt(ymd[2]);\n\n\t\t\tString[] hm = element.getStartTimeSplit();\n\t\t\tint hour = Integer.parseInt(hm[0]);\n\t\t\tint min = Integer.parseInt(hm[1]);\n\n\t\t\tcalendar.set(Calendar.YEAR, year);\n\t\t\tcalendar.set(Calendar.MONTH, month);\n\t\t\tcalendar.set(Calendar.DATE, date);\n\t\t\tcalendar.set(Calendar.HOUR, hour);\n\t\t\tcalendar.set(Calendar.MINUTE, min);\n\n\t\t\tlong secs = calendar.getTimeInMillis();\n\t\t\tsecs -= 600000;\n\t\t\tcalendar.setTimeInMillis(secs);\n\t\t\tLog.w(\"AlarmManager-TDC2014 \", \"Setting Alarm Time : \" + calendar.toString());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, element.getId());\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, element.getName());;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, element.getAuthor());\n\n\t\t\tint trackIcon = element.getTrackIcon();\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, trackIcon);\n\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, PendingIntent.FLAG_ONE_SHOT);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\n\t\t}\n\t\tif(test==1)\n\t\t{\n\t\t\t// 5secs from now\n\t\t\tcalendar.setTimeInMillis(System.currentTimeMillis() + 10000);\n\t\t\tLog.w(\"AlarmManager-TEST \", \"Setting Alarm Time : \" + calendar.getTime());\n\t\t\tint id = (int) System.currentTimeMillis();\n\t\t\tIntent intent = new Intent(\"net.redirectme.apps.SESSION_NOTIFY\");\n\t\t\tlong value = 1;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TEXT, value);\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_TITLE, \"Test Session\");;\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SUBJECT, \"Sanjeev BA\");\n\t\t\tintent.putExtra(android.content.Intent.EXTRA_SHORTCUT_ICON, R.drawable.track_43_general);\n\n\t\t\tPendingIntent pendingIntent = PendingIntent.getBroadcast(this, id, intent, 0);\n\t\t\talarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent);\n\t\t}\n\n\t}",
"private static void createNotificationChannel(Context context) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n CharSequence name = context.getString(R.string.channel_name);\n String description = context.getString(R.string.channel_description);\n int importance = NotificationManager.IMPORTANCE_HIGH;\n NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);\n channel.setDescription(description);\n // Register the channel with the system; you can't change the importance\n // or other notification behaviors after this\n NotificationManager notificationManager = context.getSystemService(NotificationManager.class);\n notificationManager.createNotificationChannel(channel);\n }\n }",
"public void sendNotification(View view) {\n\n NotificationManager nm= (NotificationManager) getSystemService(NOTIFICATION_SERVICE);\n\n if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.O){\n\n //We have to create a notification channel\n NotificationChannel nc = new NotificationChannel(\"srminterns\",\"SRM NOTIFICATIONS\",NotificationManager.IMPORTANCE_HIGH);\n nm.createNotificationChannel(nc);\n\n }\n\n // we have to normally write notification code.\n\n NotificationCompat.Builder builder=new NotificationCompat.Builder(this,\"srminterns\");\n builder.setSmallIcon(R.drawable.umbrella);\n builder.setContentTitle(\"Sample Notification\");\n builder.setContentText(\"This is the description of the notification\");\n builder.setAutoCancel(true);\n\n /* Pending Intent\n * - It is the description of the operation to be performed\n * - can be created using the following methods\n * -getActivity() - if you want to open an activity with pending Intent\n * -getService() - if you want to strat a service with Pending Intent\n * -getBroadcast() - if you want to send a broadcast with Pending Intent\n *\n * Requires 4 Arguments\n * -context\n * -Pending Intent ID (Can be any Integer)\n * -Intent(Action that you want to perform)\n * - FLAG (This flag will tell the existing pending Intent about what to do if there\n * is a new Pending Intent (Arrival) */\n\n PendingIntent pi = PendingIntent.getActivity(this,12,new Intent(this, MainActivity.class)\n ,PendingIntent.FLAG_UPDATE_CURRENT);\n\n builder.setContentIntent(pi);\n\n /*\n * Step1: is to convert any image format that you want to display into a Bitmap image format\n * Step2: is to create bigPicture style before you issue the notification.\n *\n *\n *\n *\n * */\n\n Bitmap bitmap= BitmapFactory.decodeResource(getResources(),R.drawable.kathmandu);\n builder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmap));\n nm.notify(42,builder.build());\n }",
"public void saveSettings(View v) {\n SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); // get shared preferences\n SharedPreferences.Editor editor = sharedPref.edit();\n int seconds_rec = Integer.parseInt(time_recording.getText().toString());\n int notif_occ = Integer.parseInt(time_occurance.getText().toString());\n\n editor.putInt(getString(R.string.time_recording_seconds), seconds_rec); // save values to a sp\n editor.putInt(getString(R.string.time_notification_minutes), notif_occ);\n editor.commit(); // commit the differences\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }",
"private void registerSettings()\r\n {\r\n m_tsm.addSetting(BOOLEAN, \"SpecPlayer\", \"off\");\r\n m_tsm.addSetting(STRING, \"SpeccedMsg\", \"none\");\r\n\r\n m_tsm.addSetting(BOOLEAN, \"ChangeShip\", \"off\");\r\n m_tsm.addSetting(INT, \"TargetShip\", \"3\");\r\n m_tsm.addSetting(STRING, \"ShipChgMsg\", \"none\");\r\n\r\n m_tsm.addSetting(BOOLEAN, \"ChangeFreq\", \"off\");\r\n m_tsm.addSetting(INT, \"TargetFreq\", \"1\");\r\n m_tsm.addSetting(STRING, \"FreqChgMsg\", \"none\");\r\n\r\n m_tsm.addSetting(INT, \"DelaySeconds\", \"0\");\r\n m_tsm.addSetting(BOOLEAN, \"EnableMS\", \"off\");\r\n\r\n m_tsm.restrictSetting(\"TargetShip\", 1, 8);\r\n m_tsm.restrictSetting(\"TargetFreq\", 0, 9999);\r\n m_tsm.restrictSetting(\"DelaySeconds\", 0, 1000);\r\n }",
"public void setNotification(String notification) {\n this.notification = notification;\n }",
"public static void createNotification1(Context context, Reminder reminder) {\n\n\n Intent intent = new Intent(context, SplashActivity.class);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n PendingIntent pendingIntent = PendingIntent.getActivity(context, 0 /* Request code */, intent,\n PendingIntent.FLAG_ONE_SHOT);\n\n String channelId = context.getString(R.string.default_notification_channel_id);\n Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);\n NotificationCompat.Builder notificationBuilder =\n new NotificationCompat.Builder(context, channelId)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(reminder.getTitle())\n .setContentText(reminder.getContent())\n .setAutoCancel(true)\n .setSound(defaultSoundUri)\n .setContentIntent(pendingIntent);\n\n NotificationManager notificationManager =\n (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);\n\n // Since android Oreo notification channel is needed.\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {\n NotificationChannel channel = new NotificationChannel(channelId,\n \"Channel human readable title\",\n NotificationManager.IMPORTANCE_DEFAULT);\n notificationManager.createNotificationChannel(channel);\n }\n\n notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());\n\n DeleteNotification(reminder,context);\n }",
"com.google.apps.alertcenter.v1beta1.Settings getSettings();"
] | [
"0.59604865",
"0.5773358",
"0.5709841",
"0.5657075",
"0.5639345",
"0.559473",
"0.55899656",
"0.55707216",
"0.55557203",
"0.5533316",
"0.5531857",
"0.54873353",
"0.547739",
"0.54558414",
"0.54558414",
"0.5425524",
"0.5417134",
"0.541423",
"0.5413719",
"0.5400228",
"0.5396964",
"0.5387313",
"0.53865045",
"0.5385673",
"0.53777814",
"0.5374969",
"0.53681266",
"0.53657734",
"0.5365573",
"0.5357539",
"0.53565824",
"0.5348813",
"0.534185",
"0.534185",
"0.5333377",
"0.5316452",
"0.5311609",
"0.5309451",
"0.5298815",
"0.5298815",
"0.529483",
"0.52877533",
"0.5286417",
"0.5283722",
"0.52836764",
"0.52806944",
"0.5273284",
"0.52686673",
"0.5266615",
"0.5264333",
"0.5262066",
"0.5259126",
"0.5257304",
"0.5254494",
"0.5228344",
"0.52256286",
"0.5206965",
"0.51997876",
"0.51976466",
"0.5180877",
"0.5175235",
"0.5161291",
"0.51548404",
"0.5141303",
"0.5138674",
"0.5136673",
"0.51288134",
"0.51251024",
"0.511386",
"0.51087165",
"0.5096841",
"0.50919396",
"0.50899327",
"0.50887746",
"0.5087373",
"0.5084931",
"0.507818",
"0.50756407",
"0.50734013",
"0.5061438",
"0.50606626",
"0.50588906",
"0.50588423",
"0.5058255",
"0.5056983",
"0.50562525",
"0.5045088",
"0.5044551",
"0.5040948",
"0.5031736",
"0.5027017",
"0.5023021",
"0.5018528",
"0.5016247",
"0.50140715",
"0.5009777",
"0.50046813",
"0.49892235",
"0.49677587",
"0.49520138"
] | 0.50123173 | 95 |
private Agent anonymous = null; private Mediator mediator=null; Standard Constructor | public WebConnectorRequestHandler () {
_userSessions = new Hashtable<Long, UserSession>(); //manage all active sessions
scheduledExecutorService.scheduleWithFixedDelay( //thread looping and checking for timeouts
new Runnable() { //if the user is logged in for too long without sending any requests-> logout
public void run() {
checkforLogout(false);
}
}
, LOGOUT_INTERVAL, LOGOUT_INTERVAL, TimeUnit.SECONDS);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private Mediator() {\n }",
"private MatterAgentClient() {}",
"public Odi11AgentImpl() {\n }",
"protected ModelAgent ()\n {\n this (\"ModelAgent\");\n\n }",
"public ClientNaiveAgent() {\n // the default ip is the localhost\n ar = new ClientActionRobotJava(\"127.0.0.1\");\n tp = new TrajectoryPlanner();\n randomGenerator = new Random();\n }",
"public QLearnAgent() {\n\t\tthis(name);\t\n\t}",
"public MMCAgent() {\n\n\t}",
"public MyAgent(World world)\n {\n w = world; \n }",
"public Investigator() {}",
"public Webinar() {\n\t\t\n\t}",
"public AETinteractions() {\r\n\t}",
"public AgentLogoffAction() {\n\n }",
"public static void helloAgent(){\n\t\tHelloAgent agent = new HelloAgent();\r\n\t\r\n\t}",
"Agent getAgent();",
"protected LearningAbstractAgent(){}",
"DefaultAgent(Controller controller) {\r\n\t\tthis.controller = controller;\r\n\t}",
"public Activator() {\r\n\t}",
"protected Agent(){\n\t\trand = SeededRandom.getGenerator();\n\t}",
"public Skill(Agent agent) {\n\t\tsuper(agent);\n\t}",
"public ClientNaiveAgent(String ip) {\n ar = new ClientActionRobotJava(ip);\n tp = new TrajectoryPlanner();\n randomGenerator = new Random();\n\n }",
"public MonHoc() {\n }",
"private Supervisor() {\r\n\t}",
"void initialize (ZyniAgent agent, Object ... args);",
"Claim() {\n }",
"public Aanbieder() {\r\n\t\t}",
"public Investment() {\r\n\t\t\r\n\t}",
"public NEATTranscriberBain() {\n\t}",
"private void initializeAgent() {\n if (Math.random() < PROBABILITY_START_WITH_AGENT) {\n agent = new SugarscapeAgent();\n }\n }",
"public AFMV() {\r\n }",
"public Interaction() {\n }",
"private TelemetryMessageHandler(){\n super();\n messageList = new TelemetryMessageList();\n telemetryArrivalMap = new TelemetryArrivalMap();\n }",
"public void setInitiator(ObjectType init) { initiator = init; }",
"public RDFReplayAgent() {//throws XMPPException {\n\n\t}",
"public DefaultResponsibleParty() {\n }",
"private Alarms() {}",
"public MLPAgent(StateObservation stateObs, ElapsedCpuTimer elapsedTimer) {\n\n }",
"public HymanifestParser() {\r\n \t\tsuper(null);\r\n \t}",
"public Mitarbeit() {\r\n }",
"public Notification(AGateway gateway)\r\n/* 11: */ {\r\n/* 12:31 */ setGateway(gateway);\r\n/* 13: */ }",
"public HelloMIDlet() {\n }",
"private SubjectManagement() {\n\n\t}",
"public interface IPSAgent\n{\n /**\n * This method is the first one to be called by the Agent Manager just after\n * instantiating the implementing class object. This is called only once in\n * the object's life cycle.\n * @param configData - DOM Element representing the configuration data\n * defined in the configuration file. The implementor dictates the DTD for\n * the element depending on what he needs.\n * @throws PSAgentException if initialization fails for any reason\n */\n void init(Element configData) throws PSAgentException;\n\n /**\n * This method is the engine of the agent and called any time a service from\n * this agent is requested by the Agent Manager.\n * @param action - name of the action to be excuted by the agent.\n * @param params - Map (name, value pairs) of all parameters from the\n * request\n * @param response <code>IPSAgentHandlerResponse</code> object that can be\n * used to set the results of execution of the action. If the requested\n * action is not implmented or enough parameters are not supplied to execute\n * the action, the result can be set to error.\n */\n void executeAction(String action, Map params,\n IPSAgentHandlerResponse response);\n\n /**\n * This method is called by the Agent Manager while shuttingdown. May be\n * used to do any cleaning.\n */\n void terminate();\n}",
"public\r\n Mobile() {}",
"private PersonHandler() {\n }",
"public PheromoneAgent(PheromoneBody b) {\n\t\tsuper();\n\t\tbody = b;\n\t}",
"protected abstract RemoteFactory.Agent<Msg, Ref> make_Agent();",
"private Grabber() {\n\t\tmotor = new CANTalon(Constants.grabberTalonMotorChannel);\n\t}",
"public Mobile() { }",
"public Publisher() {\n // This constructor is intentionally empty. Nothing special is needed here.\n }",
"public Communicator() {\n\t}",
"public Receiver() {\n\t\tsuper();\n\t}",
"public JSONSenderUtilsSim() {\n\t}",
"public Party() {\n // empty constructor\n }",
"public Agent(Grid<Agent> grid){\n\t\tthis.grid=grid;\n\t\tthis.alive=true;\n\t}",
"private Marinator() {\n }",
"private Marinator() {\n }",
"public Individual()\r\n\t{\r\n\t}",
"protected RemoteFactory.Agent.Component<Msg, Ref> newAgent() {\n RemoteFactory.Agent<Msg, Ref> _implem = _createImplementationOfAgent();\n return _implem._newComponent(new RemoteFactory.Agent.Requires<Msg, Ref>() {},true);\n }",
"public ActorNPC() {\r\n }",
"public StudentInteraction() {\n//\t\tsuper();\n\t\tsfCon = new StudentFunctionalityController();\n\t}",
"Constructor() {\r\n\t\t \r\n\t }",
"public GenMercuryCapabilities() {\n }",
"ClientMessageSender() {\n\n\t}",
"public SimOI() {\n super();\n }",
"public Telefone() {\n\t}",
"public AvaliacaoRisco() {\n }",
"public RoadAgentBehaviour(Agent a)\r\n\t\t{\r\n\t\t\tsuper(a);\r\n\t\t}",
"public Agent(StateObservation so, ElapsedCpuTimer elapsedTimer)\n {\n actions = new ArrayList<> ();\n states = new ArrayList<> ();\n success = false;\n step = 0;\n }",
"public BrowseOffenceAMClient() {\r\n }",
"public Telefone() {\n\t\t\n\t}",
"private EagerlySinleton()\n\t{\n\t}",
"public Voice() {\n }",
"public ActuatorData()\n\t{\n\t\tsuper(); \n\t}",
"public OntoBridge()\r\n\t{ \r\n\t}",
"public MovingGuest() \n {\n // Deferred to subclasses.\n }",
"private Infer() {\n\n }",
"private Inspect() {\n }",
"public Invitation() {\n }",
"public ActingGoal() {\n\t\t// rosbridge compatibility issues\n\t}",
"public ItsNatImpl()\r\n {\r\n }",
"public Mannschaft() {\n }",
"public MassMsgFrame() {\n\t}",
"public Bridge() {\n }",
"public Communicator() {\n }",
"public Communicator() {\n }",
"public RecruitingAppManagementImpl() {\n }",
"private ClientController() {\n }",
"public Intermediary()\r\n\t{\r\n\t\ttry {\r\n\t\t\treceiveSocket = new DatagramSocket(68);\r\n\t\t\tsendReceiveSocket = new DatagramSocket();\t\t\t\r\n\t\t\t\r\n\t\t} catch (SocketException se) {\r\n\t\t\tse.printStackTrace();\r\n\t\t\tSystem.exit(1);\r\n\t\t} \r\n\t\t\r\n\t\treqID = 1;\r\n\t\tSystem.out.println(\"===== INTERMEDIATE HOST STARTED =====\\n\");\r\n\t}",
"public Payload() {\n\t}",
"public StudentChoresAMImpl() {\n }",
"public AbstractBinaryInteraction() {\n\n\t}",
"public QueueSenderSession ()\r\n {\r\n\r\n\r\n }",
"public Notification()\n\t{\n\t\t\n\t}",
"public Agent(Point start, Point goal) {\n mStart = start;\n mGoal = goal;\n }",
"private SingleTon() {\n\t}",
"public EnsembleLettre() {\n\t\t\n\t}",
"private SequencerConnection() { }",
"public Invoker() {\n this.agg = new Aggregator();\n }",
"public Controller()\n {\n // Create initial queues and stations\n q0 = new Queue(); //registration q\n \n // p[arameters are id of station, 4 queues, completed q)\n s0 = new Station(0, q0, q1, q2, q3, qx);\n \n //Student soiurce ss is an actor\n \n actors = new ArrayList<>(); \n actors.add(s0); // add all Actor implementors\n //actors.add(myStudentSorce);\n }",
"public AgentTable() {\n this(\"agent\", null);\n }",
"public AI(){\n super();\n }"
] | [
"0.76726794",
"0.6908199",
"0.6852546",
"0.682129",
"0.680899",
"0.6712914",
"0.6691281",
"0.6678972",
"0.65784544",
"0.6431102",
"0.6402916",
"0.6380495",
"0.6343416",
"0.6312818",
"0.63009274",
"0.6293942",
"0.6235434",
"0.6229415",
"0.6227152",
"0.6222482",
"0.62222743",
"0.6178891",
"0.6177083",
"0.616917",
"0.61410916",
"0.6134328",
"0.60944676",
"0.60820466",
"0.60701275",
"0.6046506",
"0.6025217",
"0.5972822",
"0.59723336",
"0.5971033",
"0.59665227",
"0.5965779",
"0.5963793",
"0.5961615",
"0.59586084",
"0.5935176",
"0.59260046",
"0.5914751",
"0.59026754",
"0.5896651",
"0.58917654",
"0.5889133",
"0.588626",
"0.588086",
"0.58783215",
"0.5874773",
"0.58631974",
"0.5858329",
"0.5855517",
"0.5853651",
"0.58385295",
"0.58385295",
"0.5827412",
"0.5824246",
"0.5821488",
"0.5820819",
"0.58181447",
"0.5812053",
"0.58096904",
"0.5807828",
"0.5807015",
"0.58043087",
"0.57986647",
"0.5790759",
"0.5789495",
"0.5785953",
"0.57802105",
"0.5777649",
"0.5775935",
"0.5766461",
"0.5763121",
"0.57487124",
"0.57414836",
"0.57373923",
"0.5733768",
"0.57286394",
"0.57262164",
"0.57238513",
"0.5723304",
"0.5715552",
"0.5715552",
"0.5713194",
"0.5706293",
"0.57059205",
"0.5705391",
"0.5703004",
"0.5702736",
"0.57006407",
"0.56987",
"0.56945205",
"0.5692526",
"0.5691035",
"0.56889254",
"0.56727153",
"0.5669513",
"0.5669388",
"0.56666404"
] | 0.0 | -1 |
if the user is logged in for too long without sending any requests> logout | public void run() {
checkforLogout(false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void logOut() {\n try {\n // getGlobalNavigation().clickSignOut();\n } catch (TimeoutException e) {\n Log.log(\"logOut\", \"page loads for more than 30 seconds\", true);\n }\n }",
"protected static void deleteTimedOutSessions() {\r\n Enumeration userLogins = activeUserLogins.keys();\r\n\r\n while (userLogins.hasMoreElements()) {\r\n long now = System.currentTimeMillis();\r\n String thisKey = (String)userLogins.nextElement();\r\n Login thisLogin = activeUserLogins.get(thisKey);\r\n if ((thisLogin.getTimeout() > 0) &&\r\n (now > (thisLogin.getLastAccessed().getTime() + thisLogin.getTimeout()))) {\r\n log.debug(\"Logging \" + thisLogin.getUserId() + \" out\");\r\n logout(thisKey);\r\n\r\n }\r\n }\r\n }",
"public void logOut() {\n Logger.d(TAG,\"login#logOut\");\n Logger.d(TAG,\"login#stop reconnecting\");\n //\t\teverlogined is enough to stop reconnecting\n everLogined = false;\n isLocalLogin = false;\n reqLoginOut();\n }",
"@Override\n public void onCanceled() {\n\n logOutNow();\n\n }",
"public void Logout()\n {\n isLoggedIn = false;\n connection.Disconnect(); \n connection = null;\n }",
"@Override\r\n\tpublic boolean checkLogout() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean checkLogout() {\n\t\treturn false;\r\n\t}",
"private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }",
"private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }",
"protected void userLoggedOut() {\n\t\tRuvego.userLoggedOut();\n\t\tResultsActivityMenu.userLoggedOut();\n\t\tHistory.newItem(\"homePage\");\n\t}",
"private static void removeExpiredLoginUser() {\n\t\tList<String> expiredLoginName=clearExpiredPassport();\r\n\t\t/*暂时不修改数据库状态。*/\r\n\t\t//this.contactUserHessianService.editContactUserToOffline(expiredLoginName);\r\n\t}",
"private void logout() {\n getSharedPreferences(HELP_CATEGORIES, MODE_PRIVATE).edit().clear().apply();\n getSharedPreferences(LOGIN, MODE_PRIVATE).edit().putBoolean(IS_LOGGED_IN, false).apply();\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(URL + \"/nuh/logout\")\n .build();\n AsyncTask.execute(() -> {\n try {\n client.newCall(request).execute();\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }",
"@Override\n\tpublic void logOutUser() {\n\t\t\n\t}",
"public void Logout() {\n \t\t\t\n \t\t}",
"public void attemptLogout() {\n spEditor.clear();\n spEditor.putBoolean(LOGGEDIN_KEY, false);\n spEditor.commit();\n }",
"public void sessionTimeout() {\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DeviceTrackerApplication.getContext());\n alertDialogBuilder.setTitle(getString(R.string.app_name));\n alertDialogBuilder\n .setMessage(R.string.session_expired)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_msg, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n logout();\n }\n });\n alertDialog = alertDialogBuilder.create();\n alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);\n startSessionTimer(0);\n }",
"boolean checkLogout(User user, HttpServletRequest request, HttpSession session);",
"public void doLogout() {\n loggedIn = false;\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n .getExternalContext().getSession(false);\r\n session.invalidate(); \r\n String pag= \"/login.xhtml\";\r\n redireccionar(pag);\r\n }",
"public void logout(){\r\n\t\tallUser.remove(this.sessionID);\r\n\t\tthis.sessionID = -1;\r\n\t}",
"@Scheduled(fixedDelay = 36000000, initialDelay = 36000000)\n public void updateSessions() {\n ArrayList<Login> logins = AuthenticationController.getLogins();\n for (Login l : logins) {\n if (l.isExpired(maxDuration)) {\n AuthenticationController.logout(l.getUsername());\n }\n }\n }",
"@Override\n public void Logout() {\n\t \n }",
"@Override\n\tpublic boolean logOut(Client cl) {\n\t\treturn false;\n\t}",
"@Override\n\tpublic void onUserNeedLogout() {\n\t\t\n\t}",
"@Override\n\tpublic void onUserNeedLogout() {\n\t\t\n\t}",
"@Override\n public void doLogout() {\n // Toast.makeText(getApplicationContext(),\"Session Expired\",Toast.LENGTH_SHORT).show();\n Intent intent = new Intent(getApplicationContext(), activity_Login.class);\n startActivity(intent);\n }",
"public void logout() {\n \n }",
"public synchronized void checkUsers() {\n\t\tHttpSession temp;\n\t\tDate now = new Date();\n\t\tString tempUser;\n\t\tEnumeration userList = userSessions.keys();\n\t\twhile (userList.hasMoreElements()) {\n\t\t\ttempUser = (String) userList.nextElement();\n\t\t\ttry {\n\t\t\t\ttemp = (HttpSession) userSessions.get(tempUser);\n\t\t\t\tif ((now.getTime() - temp.getLastAccessedTime()) > 60000)\n\t\t\t\t\tuserSessions.remove(tempUser);\n\t\t\t} catch (Exception e) {\n\t\t\t\tuserSessions.remove(tempUser);\n\t\t\t}\n\t\t}\n\t}",
"public void logout() {\n loggedIn = \"\";\n FacesContext.getCurrentInstance().getExternalContext()\n .getSessionMap().put(\"loggedIn\", \"\");\n }",
"@Override\n public void doLogout() {\n // Toast.makeText(getApplicationContext(),\"Session Expired\",Toast.LENGTH_SHORT).show();\n Intent intent=new Intent(getApplicationContext(), activity_Login.class);\n startActivity(intent);\n }",
"private void signOutUser() {\n mAuth.signOut();\n LoginManager.getInstance().logOut();\n Toast.makeText(ChatMessage.this, \"You have been logout\", Toast.LENGTH_SHORT).show();\n finishAffinity();\n proceed();\n }",
"private void logout() {\n ProgressDialog logoutProgressDialog = new ProgressDialog(ContributionsGalleryActivity.this);\n logoutProgressDialog.setMessage(getResources().getString(R.string.logging_out));\n logoutProgressDialog.setCancelable(false);\n logoutProgressDialog.show();\n ParseUser.logOutInBackground(e -> {\n logoutProgressDialog.dismiss();\n if (e != null) { // Logout has failed\n Snackbar.make(contributionsGalleryRelativeLayout, getResources().getString(R.string.logout_failed), Snackbar.LENGTH_LONG).show();\n }\n else { // Logout has succeeded\n goLoginSignupActivity();\n finish();\n }\n });\n }",
"@Override\n\tpublic void exitSessionUser() {\n\t\tgetThreadLocalRequest().getSession().invalidate();\n\t\t\n\t}",
"void sessionExpired();",
"private void checkforLogout(boolean forceAll)\n\t{\n\t\tLong currentTime=(new Date()).getTime();\n\t\tconnector.logMessage(\"logout check\");\n\t\ttry\n\t\t{\n\t\t\tfor (Long userId : _userSessions.keySet()) { //for each user\n\t\t\t\tUserSession sess=_userSessions.get(userId);\t\n\t\t\t\t\n\t\t\t\tfor (String serviceName : sess.getServices().keySet()) //for each service\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(forceAll||sess.getServices().get(serviceName)+DEFAULT_TIMEMOUT<currentTime)//check timeout\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogout(serviceName,userId); \n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnector.logMessage(\"Logout: \"+l2pNode.getLoginForAgentId(userId));\n\t\t\t\t\t\t} catch (AgentNotKnownException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void userLoggedOut(User user) \n\t\t{\n\t\t\tLog.i(\"OpenFeint\", \"User logged out\");\n\t\t\tMainActivity.this.userLoggedOut();\n\t\t}",
"@Override\n\tprotected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {\n\t\tSubject subject = getSubject(request, response);\n\t\tif (!subject.isAuthenticated() && !subject.isRemembered()) {\n\t\t\t// 如果没有登录,直接进行之后的流程\n\t\t\treturn true;\n\t\t}\n\t\tString username = (String) subject.getPrincipal();\n\t\tSession session = subject.getSession();\n\t\tString sessionId = (String) session.getId();\n\n\t\tHttpServletRequest req = WebUtils.toHttp(request);\n\t\tServletContext application = req.getSession().getServletContext();\n\t\tDeque<Object> deque = deque = (Deque<Object>) application.getAttribute(username);\n\t\tif (deque == null) {\n\t\t\tdeque = new LinkedList<>();\n\t\t\tdeque.push(sessionId);\n\t\t\tapplication.setAttribute(username, deque);\n\t\t\treturn true;\n\t\t}\n\t\tif (!deque.contains(sessionId) && session.getAttribute(\"kickout\") == null) {\n\t\t\tdeque.push(sessionId);\n\t\t}\n\t\twhile (deque.size() > 1) {\n\t\t\tString kickSessionId = (String) deque.removeLast();\n\t\t\tif (kickSessionId != null) {\n\t\t\t\tSession kickoutSession = null;\n\t\t\t\ttry {\n\t\t\t\t\tkickoutSession = sessionManager.getSession(new DefaultSessionKey(kickSessionId));\n\t\t\t\t\tkickoutSession.setAttribute(\"kickout\", true);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (session.getAttribute(\"kickout\") != null) {\n\t\t\tsubject.logout();\n\t\t\tsaveRequest(request);\n\t\t\treq.setAttribute(\"kickMsg\", \"该账号异地登录,您被强制下线\");\n\t\t\tWebUtils.issueRedirect(request, response, kickoutUrl);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void userLoggedOut(User user) \n\t\t{\n\t\t\tLog.i(\"OpenFeint\", \"User logged out\");\n\t\t\tMainActivity.this.userLoggedOut();\t\n\t\t}",
"public void logout() {\n\t\tthis.setCurrentUser(null);\n\t\tthis.setUserLoggedIn(false);\t\t\n\t}",
"private void doLogout() {\r\n\t\tdoctor.setOnline(0);\r\n\t\t// Set doctor as logged out\r\n\t\tdbAdapter.updateDoctor(doctor);\r\n\t\t// Release objects and notify observers\r\n\t\tloggedIn = false;\r\n\t\tnotifyObservers();\r\n\t\tdoctors = null;\r\n\t\tdoctor = null;\r\n\t}",
"private void logout() {\n //set offline flag\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\n new PostNoSqlDataBase(this).offline(uid);\n\n //logout\n // FirebaseAuth mAuth = FirebaseAuth.getInstance();\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n mGoogleSignInClient.signOut();\n FirebaseAuth.getInstance().signOut();\n //go to the main activity\n startActivity(new Intent(this, SignUpActivity.class));\n finish();\n }",
"private void logout(){\n showLoadingDialog();\n TwitterController.getInstance().logout(logoutCallback);\n }",
"@Override\r\n\tpublic void logout() {\n\t\t\r\n\t}",
"long getInvalidLoginLockoutTime();",
"private void countDownToLogin() {\n\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n if (isOnline()) {\n if (sharedPreferences.getBoolean(Constant.AUTO_LOGIN, false)) {\n String userEmail = sharedPreferences.getString(Constant.USER_EMAIL, \"\");\n String userPw = sharedPreferences.getString(Constant.USER_PW, \"\");\n if (!userEmail.equals(\"\") && !userPw.equals(\"\")) {\n new LoginPresenter(SplashActivity.this).login(userEmail, userPw);\n } else {\n onLoginFail(null);\n }\n } else {\n onLoginFail(null);\n }\n } else {\n// startActivity(new Intent(context, DisconnectActivity.class));\n// finish();\n //Go to DisconnectActivity\n }\n\n }\n }, SPLASH_TIME);\n }",
"public void onLogout() {\n ParseUser.logOut();\n\n promptForLogin();\n }",
"void logoutDone();",
"private void logout() {\n\t\tParseUser.logOut();\n\n\t\t// Go to the login view\n\t\tstartLoginActivity();\n\t}",
"public void logout() {\n getRequest().getSession().invalidate();\n }",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(EnterActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"public static void makeUnlogged() {\n\t\tMemberSessionFacade.removeAttribute(ConfigKeys.LOGGED);\n//\t\tControllerUtils.addCookie(ConfigKeys.LOGGED, null);\n\t}",
"public boolean logOut(HttpServletRequest request, HttpServletResponse response, String data) {\n request.getSession().removeAttribute(\"user\");\n removeAppCookie(response);\n try {\n response.sendRedirect(\"http://localhost:8010/CostsManagerHit/login\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n return true;\n }",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n\n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n }\n\n }",
"private static void logedIn(Request req, Response res, CloudService cloud) {\r\n\t\t\tif (cloud.getKorisnici().get(req.cookie(\"userID\")) == null) {\r\n\t\t\t\tString[] params = req.splat();\r\n\t\t\t\tString path;\r\n\t\t\t\tif(params.length == 0)\r\n\t\t\t\t\tpath = \"\";\r\n\t\t\t\telse\r\n\t\t\t\t\tpath = params[0];\r\n\t\t\t\tif(path.equals(\"checkLogin\") || path.equals(\"favicon.ico\"))\r\n\t\t\t\t\treturn;\r\n\t\t\t\tres.redirect(\"/login.html\");\r\n\t\t\t\thalt(302);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(req.session().attribute(\"user\") == null) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tKorisnik k = cloud.getKorisnici().get(req.cookie(\"userID\"));\r\n\t\t\t\t\treq.session().attribute(\"user\", k); // postavi mu korisnika za sesiju\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public static void Logout(){\n\t\tloginSystem();\r\n\t\t\r\n\t}",
"@Override\n public void onFailure(@NonNull Exception e) {\n\n logOutNow();\n\n }",
"public void logOut() {\r\n\t\tthis.modoAdmin = false;\r\n\t\tthis.usuarioConectado = null;\r\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(this, Login.class);\n startActivity(intent);\n finish();\n }",
"public void logout() {\n\n $(logOutNavigator).click();\n driver = commonMethods.waitForElement(driver, logOffBtn);\n $(logOffBtn).click();\n $(loadingProgressIcon).should(disappear);\n }",
"@Override\n public void run() {\n LogoutHelper.logout(context, AppMessage.TOAST_MESSAGE_SESSION_EXPIRED);\n }",
"protected void startLogoutTimer() {\n AccessState.getInstance().startLogoutTimer(this);\n }",
"public void checkLastActive() {\n if (this.lastActive < System.nanoTime() - this.timeout) {\n this.logout();\n this.timer.cancel();\n }\n }",
"private void logout() {\n LogoutTask mAuthTask = new LogoutTask();\n mAuthTask.execute((Void) null);\n }",
"void logout();",
"void logout();",
"public static boolean shouldLogin() {\n if (AppPreference.getInstance().getUserLoggedIn() == null ) {\n //|| deltaActive > Constant.SESSION_EXIPRED_TIME) {\n return true;\n }\n\n return false;\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(Activity_Main.this, Activity_Login.class);\n startActivity(intent);\n finish();\n }",
"public void logout () {\n\t\tif (isLoggedIn()) {\n\t\t\tGPPSignIn.sharedInstance().signOut();\n\t\t\tGPGManager.sharedInstance().signOut();\n\t\t}\n\t}",
"void logoff();",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n /*\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n \n \n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n */\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n\n this.setVisible(false);\n }\n\n }",
"public void logout(boolean lobby) {\n\t\tif (!running)\n\t\t\treturn;\n\t\tlong currentTime = Utils.currentTimeMillis();\n\t\tif (getAttackedByDelay() + 1 > currentTime) {\n\t\t\tgetPackets()\n\t\t\t\t\t.sendGameMessage(\n\t\t\t\t\t\t\t\"You can't log out until 10 seconds after the end of combat.\");\n\t\t\treturn;\n\t\t}\n\t\tif (getEmotesManager().getNextEmoteEnd() >= currentTime) {\n\t\t\tgetPackets().sendGameMessage(\n\t\t\t\t\t\"You can't log out while performing an emote.\");\n\t\t\treturn;\n\t\t}\n\t\tif (lockDelay >= currentTime) {\n\t\t\tgetPackets().sendGameMessage(\n\t\t\t\t\t\"You can't log out while performing an action.\");\n\t\t\treturn;\n\t\t}\n\t\tgetPackets().sendLogout(lobby && Settings.MANAGMENT_SERVER_ENABLED);\n\t\trunning = false;\n\t}",
"@Override\n public void logOut() {\n }",
"private void logout() {\n userModel.setLoggedInUser(null);\n final Intent intent = new Intent(this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"@Override\n\tpublic Boolean logout()\n\t\t\tthrows UnknownException {\n HttpSession sesion = this.getThreadLocalRequest().getSession();\n sesion.removeAttribute(\"beanusuario\");\n sesion.removeAttribute(\"idsession\"); \n sesion.invalidate(); \n return true;\n\t}",
"private void checkToLogout() {\n logout();\n checkToHome();\n drawViewSideMenu();\n }",
"void logoutSuccessful();",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(MainActivity.this, Login.class);\n startActivity(intent);\n finish();\n }",
"void sessionInactivityTimerExpired(DefaultSession session, long now);",
"private void logOutIfAlreadyLogInTest() {\n try {\n onView(withId(R.id.menuButtonImage)).perform(click());\n onView(withText(R.string.logout)).perform(click());\n onView(withId(R.id.google_sign_in_button)).check(matches(isDisplayed()));\n }\n catch (NoMatchingViewException e) {\n // was already logged out\n }\n }",
"void onLogout(boolean loggedIn);",
"@Override\n\tpublic boolean isLoggedIn() {\n\t\treturn false;\n\t}",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\t\tdb.deleteUsers();\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(MainActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"public boolean logoutUser(Context context){\n DatabaseHandler db = new DatabaseHandler(context);\n db.resetTables();\n return true;\n }",
"@Override\n\tpublic void logout() {\n\t}",
"public void logOut() {\n sp.edit().clear().commit();\n }",
"public void Logout(){\n preferences.edit().remove(userRef).apply();\n }",
"public void logout(View view) {\n if (isNetworkAvailable()) {\n FirebaseAuth.getInstance().signOut();\n startActivity(new Intent(AllChannelListActivity.this, SignInActivity.class));\n finish();\n } else {\n\n Toast.makeText(AllChannelListActivity.this, \"To Log Out, Please Connect your Phone to Internet..\", Toast.LENGTH_SHORT).show();\n\n }\n }",
"private void cerrarSession() {\n FirebaseAuth.getInstance().signOut();\n LoginManager.getInstance().logOut();\n Auth.GoogleSignInApi.signOut(googleApiClient).setResultCallback( new ResultCallback<Status>() {\n @Override\n public void onResult(@NonNull Status status) {\n if (status.isSuccess()) {\n logOut();\n } else {\n Toast.makeText(getApplicationContext(),\"Fallo al cerrar session\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }",
"@Override\n public void performLogout(){\n }",
"public WebConnectorRequestHandler () {\t\t\n\t\t_userSessions = new Hashtable<Long, UserSession>(); //manage all active sessions\n\t\t\n\t scheduledExecutorService.scheduleWithFixedDelay( //thread looping and checking for timeouts\n\t \t\tnew Runnable() {\t\t\t\t\t\t//if the user is logged in for too long without sending any requests-> logout\n\t\t\t public void run() {\t\t\t\t\t\n\t\t\t \tcheckforLogout(false);\n\t\t\t \n\t\t\t }\n\t\t\t }\n\t \t\t, LOGOUT_INTERVAL, LOGOUT_INTERVAL, TimeUnit.SECONDS);\n\t\t\t \n\n\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(EscolhaProjeto.this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"public void sessionDestroyed(HttpSessionEvent arg0) {\n\t\tApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(arg0.getSession().getServletContext());\r\n\t\t RedisUtil ru = (RedisUtil) ctx.getBean(BEANNAME);\r\n\t\t Jedis je = ru.getConnection();\r\n\t\t //如果在线 下线,销毁其中一个\r\n\t\t je.decr(CURRENT_USER_COUNT);\r\n\t\t //TODO\r\n\t\t //需要判断如果用户已经登录,那么要修改用户的下线时间\r\n\t\t ru.returnResource(je);\r\n\t}",
"private void logout(){\r\n\t\ttry {\r\n\t\t\tserver.rmvClient(user);\r\n\t\t} catch (RemoteException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tSystem.exit(0);\r\n\t}",
"@Override\n\tpublic void logout()\n\t{\n\t\tthis.user = null;\n\t}",
"public boolean logOut(int id) {\n\t\ttry {\n\t\t\tUser user = em.find(User.class, id);\n\t\t\tuser.setExpiresAt(null);\n\t\t\tuser.setToken(null);\n\t\t\tem.merge(user);\n\t\t\treturn true;\n\t\t} catch (Exception e) {\n\t\t\tlogger.warning(e.getMessage());\n\t\t\tlogger.warning(\"Unable to remove registration token for user id: \" + id);\n\t\t\treturn false;\n\t\t}\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(getActivity(), LoginActivity.class);\n startActivity(intent);\n getActivity().finish();\n }",
"private void logout() {\n\t\tgetUI().get().navigate(\"login\");\r\n\t\tgetUI().get().getSession().close();\r\n\t}",
"public boolean logoutUser(Context context){\n\t\tDatabaseHandler db = new DatabaseHandler(context);\n\t\tdb.resetTables();\n\t\treturn true;\n\t}",
"@Override\n\tpublic void logout() {\n\t\tsessionService.setCurrentUserId(null);\n\t}",
"public static void Logout() throws IOException {\n Socket client = ConnectionToServer();\n // Checks if the sever is online\n if (client.isConnected()) {\n OutputStream outputStream = client.getOutputStream();\n InputStream inputStream = client.getInputStream();\n\n ObjectOutputStream send = new ObjectOutputStream(outputStream);\n ObjectInputStream receiver = new ObjectInputStream(inputStream);\n\n send.writeUTF(\"Logout\"); // Send logout to server\n send.writeUTF(loggedInUser); // Send username to server\n send.flush();\n// End connections\n send.close();\n receiver.close();\n client.close();\n }\n// Resetting the application for the user on the client-side\n loggedInUser = \"\";\n Login.usernameText.setText(\"\");\n loginSuccessful = false;\n boolean[] falsePermission = {false, false, false, false};\n permission.SetUserPermission(falsePermission);\n token = \"\";\n ControlPanelFrameHandler.LogoutWindow();\n }",
"public void forceLogout()\n\t{\n\t\tif(getSession() != null && getSession().getLoggedIn())\n\t\t\tgetSession().close();\n\t\telse\n\t\t\tGameServer.getServiceManager().getNetworkService().getLogoutManager().queuePlayer(this);\n\t}",
"public static void logout() {\n try {\n buildSocket();\n ClientService.sendMessageToServer(connectionToServer, ClientService.logoutUser());\n closeSocket();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }"
] | [
"0.71043897",
"0.70937496",
"0.67068285",
"0.6684584",
"0.66449344",
"0.6595346",
"0.6595346",
"0.6562865",
"0.65424365",
"0.6537751",
"0.65133256",
"0.6502781",
"0.6479014",
"0.6467208",
"0.6465658",
"0.64246994",
"0.6389976",
"0.63882744",
"0.6379234",
"0.6355165",
"0.63500655",
"0.63324845",
"0.63271636",
"0.63271636",
"0.6307499",
"0.6304515",
"0.6297649",
"0.6296126",
"0.629543",
"0.62953264",
"0.62908095",
"0.62844926",
"0.6269988",
"0.62546307",
"0.62460315",
"0.62424314",
"0.62348837",
"0.62348294",
"0.62267727",
"0.6225675",
"0.62243736",
"0.6213023",
"0.62105495",
"0.62097955",
"0.6209353",
"0.62035465",
"0.6166244",
"0.6163696",
"0.6151039",
"0.6150355",
"0.6131669",
"0.6131611",
"0.6128951",
"0.61123973",
"0.6106104",
"0.61049044",
"0.6102821",
"0.6098185",
"0.6096",
"0.6094583",
"0.60943717",
"0.60924846",
"0.60920286",
"0.60920286",
"0.60914963",
"0.60874903",
"0.605455",
"0.60521406",
"0.6045833",
"0.603683",
"0.60318035",
"0.60232264",
"0.6017215",
"0.6005767",
"0.6003376",
"0.60026",
"0.599884",
"0.59882873",
"0.59836596",
"0.5981591",
"0.597519",
"0.5964855",
"0.59546727",
"0.594068",
"0.59403086",
"0.59382963",
"0.59371144",
"0.59360826",
"0.5935364",
"0.5934625",
"0.59299713",
"0.5929823",
"0.5926913",
"0.5925551",
"0.5921255",
"0.59156704",
"0.5914948",
"0.5911131",
"0.59091127",
"0.5908875",
"0.59057486"
] | 0.0 | -1 |
Checks if a user is logged in for too long into a service without sending requests and logs them out after a period of time. | private void checkforLogout(boolean forceAll)
{
Long currentTime=(new Date()).getTime();
connector.logMessage("logout check");
try
{
for (Long userId : _userSessions.keySet()) { //for each user
UserSession sess=_userSessions.get(userId);
for (String serviceName : sess.getServices().keySet()) //for each service
{
if(forceAll||sess.getServices().get(serviceName)+DEFAULT_TIMEMOUT<currentTime)//check timeout
{
logout(serviceName,userId);
try {
connector.logMessage("Logout: "+l2pNode.getLoginForAgentId(userId));
} catch (AgentNotKnownException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
catch(Exception e)
{
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static void deleteTimedOutSessions() {\r\n Enumeration userLogins = activeUserLogins.keys();\r\n\r\n while (userLogins.hasMoreElements()) {\r\n long now = System.currentTimeMillis();\r\n String thisKey = (String)userLogins.nextElement();\r\n Login thisLogin = activeUserLogins.get(thisKey);\r\n if ((thisLogin.getTimeout() > 0) &&\r\n (now > (thisLogin.getLastAccessed().getTime() + thisLogin.getTimeout()))) {\r\n log.debug(\"Logging \" + thisLogin.getUserId() + \" out\");\r\n logout(thisKey);\r\n\r\n }\r\n }\r\n }",
"public synchronized void checkUsers() {\n\t\tHttpSession temp;\n\t\tDate now = new Date();\n\t\tString tempUser;\n\t\tEnumeration userList = userSessions.keys();\n\t\twhile (userList.hasMoreElements()) {\n\t\t\ttempUser = (String) userList.nextElement();\n\t\t\ttry {\n\t\t\t\ttemp = (HttpSession) userSessions.get(tempUser);\n\t\t\t\tif ((now.getTime() - temp.getLastAccessedTime()) > 60000)\n\t\t\t\t\tuserSessions.remove(tempUser);\n\t\t\t} catch (Exception e) {\n\t\t\t\tuserSessions.remove(tempUser);\n\t\t\t}\n\t\t}\n\t}",
"@Override\n protected boolean check(User user, UUID uuid, String service, String key) {\n if (this.timeOuts.containsKey(uuid) && this.timeOuts.get(uuid) + 1000 * 2 >= System\n .currentTimeMillis()) {\n user.sendMessage(Translation.RANKSYNC_COMMAND_REQUEST_LIMIT.getTranslation());\n return false;\n } else {\n this.timeOuts.put(uuid, System.currentTimeMillis());\n return true;\n }\n }",
"public static boolean shouldLogin() {\n if (AppPreference.getInstance().getUserLoggedIn() == null ) {\n //|| deltaActive > Constant.SESSION_EXIPRED_TIME) {\n return true;\n }\n\n return false;\n }",
"long getInvalidLoginLockoutTime();",
"public boolean checkTimeout(){\n\t\tif((System.currentTimeMillis()-this.activeTime.getTime())/1000 >= this.expire){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"boolean isExpired(int userId);",
"private void countDownToLogin() {\n\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n if (isOnline()) {\n if (sharedPreferences.getBoolean(Constant.AUTO_LOGIN, false)) {\n String userEmail = sharedPreferences.getString(Constant.USER_EMAIL, \"\");\n String userPw = sharedPreferences.getString(Constant.USER_PW, \"\");\n if (!userEmail.equals(\"\") && !userPw.equals(\"\")) {\n new LoginPresenter(SplashActivity.this).login(userEmail, userPw);\n } else {\n onLoginFail(null);\n }\n } else {\n onLoginFail(null);\n }\n } else {\n// startActivity(new Intent(context, DisconnectActivity.class));\n// finish();\n //Go to DisconnectActivity\n }\n\n }\n }, SPLASH_TIME);\n }",
"@Scheduled(fixedDelay = 36000000, initialDelay = 36000000)\n public void updateSessions() {\n ArrayList<Login> logins = AuthenticationController.getLogins();\n for (Login l : logins) {\n if (l.isExpired(maxDuration)) {\n AuthenticationController.logout(l.getUsername());\n }\n }\n }",
"public boolean isExpired(int threshold) {\n \t\n \tlogger.log(Level.ALL, \" auth expires in \" + authorizationExpiresIn.getTime());\n \tlogger.log(Level.ALL,expiresIn.getTime() + \" \" + threshold * 1000);\n if(expiresIn!=null) {\n \t// threshold is in seconds and need to add to millisecond time\n long exp = authorizationExpiresIn.getTime() + threshold * 1000; \n long now = System.currentTimeMillis();\n logger.log(Level.ALL,\"exp : \" + exp + \" - now \" + now + \" \" + (exp<=now)); //Add logging to Level.ALL\n return exp<=now; \n }\n return false;\n }",
"private boolean validLogin() {\n\t\tObject principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();\r\n\t\tif(principal.equals(IConstant.LOGIN_STATUS.ANONYMOUS_USER)) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tUserDetails userDetails = (UserDetails) principal;\r\n\t\t\treturn userDetails.isAccountNonExpired() &&\r\n\t\t\t\t\tuserDetails.isAccountNonLocked() &&\r\n\t\t\t\t\tuserDetails.isCredentialsNonExpired() &&\r\n\t\t\t\t\tuserDetails.isEnabled();\r\n\t\t}\r\n\t}",
"boolean isAccountNonExpired();",
"boolean isAccountNonExpired();",
"public boolean accessTokenExpired() {\n Date currentTime = new Date();\n if ((currentTime.getTime() - lastAccessTime.getTime()) > TIMEOUT_PERIOD) {\n return true;\n } else {\n return false;\n }\n }",
"private static void removeExpiredLoginUser() {\n\t\tList<String> expiredLoginName=clearExpiredPassport();\r\n\t\t/*暂时不修改数据库状态。*/\r\n\t\t//this.contactUserHessianService.editContactUserToOffline(expiredLoginName);\r\n\t}",
"public void sessionTimeout() {\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(DeviceTrackerApplication.getContext());\n alertDialogBuilder.setTitle(getString(R.string.app_name));\n alertDialogBuilder\n .setMessage(R.string.session_expired)\n .setCancelable(false)\n .setPositiveButton(R.string.ok_msg, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n logout();\n }\n });\n alertDialog = alertDialogBuilder.create();\n alertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);\n startSessionTimer(0);\n }",
"public void checkLastActive() {\n if (this.lastActive < System.nanoTime() - this.timeout) {\n this.logout();\n this.timer.cancel();\n }\n }",
"@Test\r\n public void testAuthSessionAfterTimeoutAdded() {\r\n try {\r\n SessionThrottler throttler = new SessionThrottler(mockHelper);\r\n throttler.setMaxAuthSession(0);\r\n String userId = \"FDJTEST\";\r\n boolean allowAuthSession = throttler.allowAuthSession(\"abcd1234\", userId);\r\n assertFalse(\"Should not allow auth session\", allowAuthSession);\r\n } catch (Exception e) {\r\n fail(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\r\n public boolean isAccountNonExpired() {\r\n return true;\r\n }",
"Duration getTokenExpiredIn();",
"private void validateLoginUser() {\n\t\tUser user = userDao.getByPin(et_password.getText().toString());\n\t\tSession.setDriver(user);\n\n\t\tif (user.getWorkStatus().equals(User.STATUS_INACTIVE)) {\n\n\t\t\tdoLogin();\n\t\t} else {\n\t\t\tString locAt = \"\";\n\t\t\tif (user.getWorkStatus().equals(User.STATUS_IN_VEHICLE)) {\n\t\t\t\tVehiclesDao dao = new VehiclesDao();\n\t\t\t\tlocAt = dao.getById(user.getCurrentVehicleId()).getName();\n\t\t\t} else {\n\t\t\t\tServiceLocationDao dao = new ServiceLocationDao();\n\t\t\t\tlocAt = dao.getById(user.getCurrentServiceLocationId()).getName();\n\t\t\t}\n\t\t\tString msg = \"You are currently marked as \" + user.getWorkStatus() + \" at \" + locAt + \" since \" + user.getWorkStatusDate()\n\t\t\t\t\t+ \"\\n\" + \"Do you want to continue and override this status?\";\n\t\t\tAlertDialog.Builder alert_box = new AlertDialog.Builder(this);\n\t\t\talert_box.setIcon(R.drawable.icon);\n\t\t\talert_box.setMessage(msg);\n\t\t\talert_box.setPositiveButton(\"YES\", new DialogInterface.OnClickListener() {\n\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tdoPunchOut(et_password.getText().toString());\n\t\t\t\t\tdoLogin();\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}\n\t\t\t});\n\t\t\talert_box.setNeutralButton(\"NO\", new DialogInterface.OnClickListener() {\n\t\t\t\t@Override\n\t\t\t\tpublic void onClick(DialogInterface dialog, int which) {\n\t\t\t\t\tdialog.dismiss();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\talert_box.show();\n\t\t}\n\t}",
"boolean isCredentialsNonExpired();",
"boolean isCredentialsNonExpired();",
"@Override\n public boolean isAccountNonExpired() {\n return !locked;\n }",
"@Override\r\n\tpublic boolean checkLogout() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean checkLogout() {\n\t\treturn false;\r\n\t}",
"void sessionInactivityTimerExpired(DefaultSession session, long now);",
"@Override\n public boolean isAccountNonExpired() {\n return false;\n }",
"@Override\n public boolean isAccountNonExpired() {\n return false;\n }",
"@Override\n public boolean isAccountNonExpired() {\n return false;\n }",
"@Override\n public boolean isAccountNonExpired() {\n return true;\n }",
"@Override\n public boolean isAccountNonExpired() {\n return true;\n }",
"@Override\n public boolean isAccountNonExpired() {\n return true;\n }",
"@Override\n\tprotected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {\n\t\tSubject subject = getSubject(request, response);\n\t\tif (!subject.isAuthenticated() && !subject.isRemembered()) {\n\t\t\t// 如果没有登录,直接进行之后的流程\n\t\t\treturn true;\n\t\t}\n\t\tString username = (String) subject.getPrincipal();\n\t\tSession session = subject.getSession();\n\t\tString sessionId = (String) session.getId();\n\n\t\tHttpServletRequest req = WebUtils.toHttp(request);\n\t\tServletContext application = req.getSession().getServletContext();\n\t\tDeque<Object> deque = deque = (Deque<Object>) application.getAttribute(username);\n\t\tif (deque == null) {\n\t\t\tdeque = new LinkedList<>();\n\t\t\tdeque.push(sessionId);\n\t\t\tapplication.setAttribute(username, deque);\n\t\t\treturn true;\n\t\t}\n\t\tif (!deque.contains(sessionId) && session.getAttribute(\"kickout\") == null) {\n\t\t\tdeque.push(sessionId);\n\t\t}\n\t\twhile (deque.size() > 1) {\n\t\t\tString kickSessionId = (String) deque.removeLast();\n\t\t\tif (kickSessionId != null) {\n\t\t\t\tSession kickoutSession = null;\n\t\t\t\ttry {\n\t\t\t\t\tkickoutSession = sessionManager.getSession(new DefaultSessionKey(kickSessionId));\n\t\t\t\t\tkickoutSession.setAttribute(\"kickout\", true);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (session.getAttribute(\"kickout\") != null) {\n\t\t\tsubject.logout();\n\t\t\tsaveRequest(request);\n\t\t\treq.setAttribute(\"kickMsg\", \"该账号异地登录,您被强制下线\");\n\t\t\tWebUtils.issueRedirect(request, response, kickoutUrl);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public void logOut() {\n try {\n // getGlobalNavigation().clickSignOut();\n } catch (TimeoutException e) {\n Log.log(\"logOut\", \"page loads for more than 30 seconds\", true);\n }\n }",
"boolean checkLogout(User user, HttpServletRequest request, HttpSession session);",
"@Test\r\n public void testAuthSessionAfterTimeoutPassUnderMax() {\r\n try {\r\n SessionThrottler throttler = new SessionThrottler(mockHelper);\r\n throttler.setMaxAuthSession(2);\r\n String userId = \"FDJTEST\";\r\n boolean allowAuthSession = throttler.allowAuthSession(\"abcd1234\", userId);\r\n assertTrue(\"Failed to allow auth session\", allowAuthSession);\r\n } catch (Exception e) {\r\n fail(e.getMessage());\r\n e.printStackTrace();\r\n }\r\n }",
"private static void logedIn(Request req, Response res, CloudService cloud) {\r\n\t\t\tif (cloud.getKorisnici().get(req.cookie(\"userID\")) == null) {\r\n\t\t\t\tString[] params = req.splat();\r\n\t\t\t\tString path;\r\n\t\t\t\tif(params.length == 0)\r\n\t\t\t\t\tpath = \"\";\r\n\t\t\t\telse\r\n\t\t\t\t\tpath = params[0];\r\n\t\t\t\tif(path.equals(\"checkLogin\") || path.equals(\"favicon.ico\"))\r\n\t\t\t\t\treturn;\r\n\t\t\t\tres.redirect(\"/login.html\");\r\n\t\t\t\thalt(302);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif(req.session().attribute(\"user\") == null) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tKorisnik k = cloud.getKorisnici().get(req.cookie(\"userID\"));\r\n\t\t\t\t\treq.session().attribute(\"user\", k); // postavi mu korisnika za sesiju\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"@Override\n public boolean isAccountNonExpired () {\n return true;\n }",
"@Override\npublic boolean isAccountNonExpired() {\n\treturn false;\n}",
"@Override\npublic boolean isAccountNonExpired() {\n\treturn true;\n}",
"private static void timeout(String user, int time) { sendMessage(\"/timeout \" + user + \" \" + time); }",
"private boolean isLoggedInUser(){\n return true;\n }",
"@Override\n\tprotected void service(HttpServletRequest request, HttpServletResponse response)\n\t\tthrows ServletException, IOException {\n\t\tif ((new AuthenticatedUser(request,response)).unauthenticated())\n\t\t\treturn;\n\t\tsuper.service(request, response);\n\t}",
"public static\n void checkExpiringPassword()\n {\n User user = ResourcesMgr.getSessionManager().getUser();\n \n String sPassword = user.getPassword();\n \n // Controllo della scadenza della password al primo accesso\n if(user.getDateLastAccess() == null && sPassword != null && sPassword.length() > 0) {\n // Primo accesso\n boolean boExpiredFA = ResourcesMgr.getBooleanProperty(ResourcesMgr.sGUILOGIN_EXP_FIRSTA, false);\n if(boExpiredFA) {\n GUIMessage.showWarning(\"Questo \\350 il Suo primo accesso. Il sistema Le richieder\\340 di cambiare la password.\");\n try {\n ResourcesMgr.getGUIManager().showGUIChangePassword(ResourcesMgr.mainFrame, true);\n }\n catch(Exception ex) {\n ex.printStackTrace();\n System.out.println(ResourcesMgr.sLOG_PREFIX + \" exit application\");\n System.exit(1);\n }\n return;\n }\n }\n \n // Controllo della scadenza della password rispetto a quando e' stata aggiornata l'ultima volta.\n if(user.getDateLastAccess() == null && sPassword != null && sPassword.length() > 0) {\n int iExpirationDays = ResourcesMgr.getIntProperty(ResourcesMgr.sGUILOGIN_EXP_DAYS, 0);\n if(iExpirationDays > 0) {\n int iDays = getDaysFrom(user.getDatePassword());\n if(iExpirationDays <= iDays) {\n GUIMessage.showWarning(\"La Sua password risulta scaduta. Il sistema Le richieder\\340 di cambiare la password.\");\n try {\n ResourcesMgr.getGUIManager().showGUIChangePassword(ResourcesMgr.mainFrame, true);\n }\n catch(Exception ex) {\n ex.printStackTrace();\n System.out.println(ResourcesMgr.sLOG_PREFIX + \" exit application\");\n System.exit(1);\n }\n return;\n }\n }\n else {\n int iMonths = getMonthsFrom(user.getDatePassword());\n int iExpirationMonths = ResourcesMgr.getIntProperty(ResourcesMgr.sGUILOGIN_EXP_MONTHS, 0);\n if(iExpirationMonths > 0 && iExpirationMonths <= iMonths) {\n GUIMessage.showWarning(\"La Sua password risulta scaduta. Il sistema Le richieder\\340 di cambiare la password.\");\n try {\n ResourcesMgr.getGUIManager().showGUIChangePassword(ResourcesMgr.mainFrame, true);\n }\n catch(Exception ex) {\n ex.printStackTrace();\n System.out.println(ResourcesMgr.sLOG_PREFIX + \" exit application\");\n System.exit(1);\n }\n return;\n }\n }\n }\n }",
"private void checkUser() {\n\t\tloginUser = mySessionInfo.getCurrentUser();\n\t}",
"@Override\n public void onCanceled() {\n\n logOutNow();\n\n }",
"public boolean isLoggedIn() {\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\n if (accessToken == null) {\n return false;\n }\n return !accessToken.isExpired();\n }",
"@Override\n public boolean isTokenValid(CrUser user, String token) {\n boolean result = false;\n if (user.getToken().equalsIgnoreCase(token)) {\n Date currentTime = new Date();\n if ((currentTime.getTime() - user.getTokenUpdateTime().getTime()) <= 1800000) {\n user.setTokenUpdateTime(currentTime);\n result = true;\n }\n }\n return result;\n }",
"private boolean _requiresLogin() {\n AccessToken accessToken = AccessToken.getCurrentAccessToken();\n if (accessToken == null) {\n return true;\n } else {\n return accessToken.isExpired();\n }\n }",
"@Override\r\n\tpublic boolean isAccountNonExpired() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean isAccountNonExpired() {\n\t\treturn false;\r\n\t}",
"private boolean hasCoolOffPeriodExpired(Jwt jwt) {\n\n Date issuedAtTime = jwt.getClaimsSet().getIssuedAtTime();\n\n Calendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n calendar.set(Calendar.MILLISECOND, 0);\n calendar.add(Calendar.MINUTE, -1);\n\n return calendar.getTime().compareTo(issuedAtTime) > 0;\n }",
"@Override\n\t\t\t\tpublic boolean isAccountNonExpired() {\n\t\t\t\t\treturn false;\n\t\t\t\t}",
"public void logOut() {\n Logger.d(TAG,\"login#logOut\");\n Logger.d(TAG,\"login#stop reconnecting\");\n //\t\teverlogined is enough to stop reconnecting\n everLogined = false;\n isLocalLogin = false;\n reqLoginOut();\n }",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn false;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn false;\n\t}",
"@Override\r\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\r\n\t}",
"@Override\r\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\r\n\t}",
"private void checkSessionState() {\n // get logged in mUser\n mUser = getStoredUser();\n // check if valid\n mIsLoggedIn = (mUser != null && mUser.getId() != null);\n }",
"public void setTimeout(int user_id){\r\n\t\tServerLogger.log(\"Set Timeout Countdown to 5 min for User \" + user_id, Constants.DEBUG);\r\n\t\tTimer timer = new Timer();\r\n\t\ttask = new TimerTask() {\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\tServerLogger.log(\"Logout for User \" + user_id, Constants.DEBUG);\r\n\t\t\t\tAmberServer.getDatabase().logout(user_id);\r\n\t\t\t}\r\n\t\t};\r\n\t\t// Logout in in given time\r\n\t\ttimer.schedule(task, TIMEOUT);\r\n\t\ttimers.put(user_id, task);\r\n\t}",
"@Override\r\n public boolean isCredentialsNonExpired() {\r\n return true;\r\n }",
"@Override\n\tpublic boolean isLoggedIn() {\n\t\treturn false;\n\t}",
"@Override\n public boolean isCredentialsNonExpired() {\n return false;\n }",
"@Override\n public boolean isCredentialsNonExpired() {\n return false;\n }",
"@Override\n public boolean isCredentialsNonExpired() {\n return false;\n }",
"@Override\r\n\tpublic boolean checkLogin() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean checkLogin() {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\n\tpublic boolean isAccountNonExpired() {\n\t\treturn true;\n\t}",
"@Override\npublic boolean isCredentialsNonExpired() {\n\treturn false;\n}",
"@Override\n public boolean isCredentialsNonExpired() {\n return true;\n }",
"@Override\n\tpublic boolean isAccountNonExpired()\n\t{\n\t\treturn true;\n\t}",
"boolean hasLoginapisuccessfulhitcount();",
"@Override\n public boolean isCredentialsNonExpired() {\n return Boolean.TRUE;\n }",
"@Override\n\tpublic boolean isUserLoggedIn() {\n\t\treturn sessionService.getCurrentUserId() != null;\n\t}",
"private void checkAccessAndLoggIn() {\n // Make sure we have access\n ConnectionChecker connectionHelper = new ConnectionChecker(this);\n boolean haveAccess = connectionHelper.canConnectInternet();\n if (haveAccess) {\n // Check if user is logged in\n final ParseUser user = ParseUser.getCurrentUser();\n boolean isLoggedIn = (user != null);\n Log.d(TAG, \"User logged in = \" + isLoggedIn);\n checkLogIn(isLoggedIn);\n } else {\n // Alert user we need access to internet\n Toast.makeText(this, \"We are unable to access Good Feed. Please check your connection\", Toast.LENGTH_LONG).show();\n }\n }",
"@Override\npublic boolean isCredentialsNonExpired() {\n\treturn true;\n}",
"private void logOutIfAlreadyLogInTest() {\n try {\n onView(withId(R.id.menuButtonImage)).perform(click());\n onView(withText(R.string.logout)).perform(click());\n onView(withId(R.id.google_sign_in_button)).check(matches(isDisplayed()));\n }\n catch (NoMatchingViewException e) {\n // was already logged out\n }\n }",
"public int getSessionMaxAliveTime();",
"@Override\n public void run() {\n\n\n if(sessionManager.isLoggedIn()){\n\n // This method will be executed once the timer is over\n // Start your app main activity\n mDilatingDotsProgressBar.hideNow();\n Intent i = new Intent(SplashActivity.this, MainActivity.class);\n startActivity(i);\n\n }else{\n\n // This method will be executed once the timer is over\n // Start your app main activity\n mDilatingDotsProgressBar.hideNow();\n Intent i = new Intent(SplashActivity.this, LoginActivity1.class);\n startActivity(i);\n }\n\n\n\n\n }",
"private void checkIfUserIsAuthenticated() {\n splashViewModel.checkIfUserIsAuthenticated();\n splashViewModel.getIsUserAuthenticated().observe(this, user -> {\n if (!user.isAuthenticated()) {\n startAuthActivity();\n finish();\n } else {\n getUserFromDatabase(user.getUid());\n }\n });\n }",
"public boolean isAccountNonExpired() {\n\t\treturn false;\r\n\t}",
"public boolean hasLoginAdvice();",
"public void enquireTimeout(Long sessionId);",
"boolean isExpired();",
"public boolean isUserLoggedIn(Context context){\n\t\tDatabaseHandler db = new DatabaseHandler(context);\n\t\tint count = db.getRowCount();\n\t\tif(count > 0){\n\t\t\t// user logged in\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"
] | [
"0.6764381",
"0.65950936",
"0.63386",
"0.62378377",
"0.62147963",
"0.6011604",
"0.5987683",
"0.5977146",
"0.58724153",
"0.58711535",
"0.58651596",
"0.58545125",
"0.58545125",
"0.58112055",
"0.5784846",
"0.57552576",
"0.5719332",
"0.571555",
"0.5708346",
"0.57057595",
"0.5693532",
"0.56911445",
"0.56911445",
"0.56894076",
"0.56733036",
"0.56733036",
"0.5660015",
"0.56547534",
"0.56547534",
"0.56547534",
"0.5628827",
"0.5628827",
"0.5628827",
"0.5615966",
"0.5604299",
"0.5602693",
"0.55882746",
"0.5587382",
"0.558349",
"0.5572446",
"0.55625695",
"0.555586",
"0.55555326",
"0.55437106",
"0.5540698",
"0.55406106",
"0.5538562",
"0.5537033",
"0.55262625",
"0.5520926",
"0.5515689",
"0.5515689",
"0.5514903",
"0.54865783",
"0.5474759",
"0.5463131",
"0.5463131",
"0.5463131",
"0.54546785",
"0.54546785",
"0.54496706",
"0.5439796",
"0.54355747",
"0.54330885",
"0.5424502",
"0.5424502",
"0.5424502",
"0.5420744",
"0.5420744",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.5396551",
"0.53953475",
"0.5393882",
"0.53924644",
"0.53859717",
"0.537937",
"0.5376183",
"0.53718734",
"0.5366656",
"0.5355192",
"0.5345991",
"0.53417087",
"0.5339594",
"0.53369516",
"0.5335758",
"0.53260475",
"0.5325581",
"0.5322442"
] | 0.59168524 | 8 |
Force logout for all users | protected void finalize () throws Throwable
{
checkforLogout(true);
scheduledExecutorService.shutdown();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void logOutUser() {\n\t\t\n\t}",
"private void checkforLogout(boolean forceAll)\n\t{\n\t\tLong currentTime=(new Date()).getTime();\n\t\tconnector.logMessage(\"logout check\");\n\t\ttry\n\t\t{\n\t\t\tfor (Long userId : _userSessions.keySet()) { //for each user\n\t\t\t\tUserSession sess=_userSessions.get(userId);\t\n\t\t\t\t\n\t\t\t\tfor (String serviceName : sess.getServices().keySet()) //for each service\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tif(forceAll||sess.getServices().get(serviceName)+DEFAULT_TIMEMOUT<currentTime)//check timeout\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\tlogout(serviceName,userId); \n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnector.logMessage(\"Logout: \"+l2pNode.getLoginForAgentId(userId));\n\t\t\t\t\t\t} catch (AgentNotKnownException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public void logout() {\n \n }",
"public void logout() {\n\t\tthis.setCurrentUser(null);\n\t\tthis.setUserLoggedIn(false);\t\t\n\t}",
"@Override\n\tpublic void logout() {\n\t\tsessionService.setCurrentUserId(null);\n\t}",
"public void logOutAdministrator() {\n logOutGeneral();\n }",
"@Override\r\n\tpublic void logout() {\n\t\t\r\n\t}",
"@Override\n\tpublic void logout() {\n\t}",
"public void logOut() {\r\n\t\tthis.modoAdmin = false;\r\n\t\tthis.usuarioConectado = null;\r\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(this, Login.class);\n startActivity(intent);\n finish();\n }",
"@Override\n\tpublic void logout()\n\t{\n\t\tthis.user = null;\n\t}",
"public void logout(){\r\n\t\tallUser.remove(this.sessionID);\r\n\t\tthis.sessionID = -1;\r\n\t}",
"private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(MainActivity.this, Login.class);\n startActivity(intent);\n finish();\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(Activity_Main.this, Activity_Login.class);\n startActivity(intent);\n finish();\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(getActivity(), LoginActivity.class);\n startActivity(intent);\n getActivity().finish();\n }",
"void logoff();",
"public void doLogout() {\n mSingleton.getCookieStore().removeUser(mUser);\n mPreferences.setUser(null);\n new ActivityTable().flush();\n\n //update variables\n mUser = null;\n mLogin = false;\n\n //reset drawer\n restartActivity();\n }",
"public void resetAllExceptLogout() {\n reset(getAllExcept(UserActions.NOTIFY_LOGOUT_ACTION));\n }",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\t\tdb.deleteUsers();\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(MainActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"public void logoutCurrentUser() {\n currentUser = null;\n }",
"protected void userLoggedOut() {\n\t\tRuvego.userLoggedOut();\n\t\tResultsActivityMenu.userLoggedOut();\n\t\tHistory.newItem(\"homePage\");\n\t}",
"@Override\n public void Logout() {\n\t \n }",
"void logout();",
"void logout();",
"public abstract void logout();",
"public static void Logout(){\n\t\tloginSystem();\r\n\t\t\r\n\t}",
"private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }",
"public void Logout() {\n \t\t\t\n \t\t}",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(EnterActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"public void logOut() {\n try {\n // getGlobalNavigation().clickSignOut();\n } catch (TimeoutException e) {\n Log.log(\"logOut\", \"page loads for more than 30 seconds\", true);\n }\n }",
"public void logOut() {\n\t\tToken.getIstance().setHashPassword(null);\n\t}",
"@Override\n\tpublic void onUserNeedLogout() {\n\t\t\n\t}",
"@Override\n\tpublic void onUserNeedLogout() {\n\t\t\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(EscolhaProjeto.this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"public void logOut() {\n sp.edit().clear().commit();\n }",
"@Override\r\n\tpublic void userLogout(String login) {\n\r\n\t}",
"public void attemptLogout() {\n spEditor.clear();\n spEditor.putBoolean(LOGGEDIN_KEY, false);\n spEditor.commit();\n }",
"private void logout() {\n getSharedPreferences(HELP_CATEGORIES, MODE_PRIVATE).edit().clear().apply();\n getSharedPreferences(LOGIN, MODE_PRIVATE).edit().putBoolean(IS_LOGGED_IN, false).apply();\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(URL + \"/nuh/logout\")\n .build();\n AsyncTask.execute(() -> {\n try {\n client.newCall(request).execute();\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }",
"@Override\n public void performLogout(){\n }",
"public void logoutCurrentUser() {\n mAuth.signOut();\n this.loggedInUser = null;\n }",
"private void logout() {\n userModel.setLoggedInUser(null);\n final Intent intent = new Intent(this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"static void logout() {\n\t\tserver.clearSharedFiles(username);\n\t\tserver.clearNotSharedFiles(username);\n\t}",
"@Get\n\t@Path(\"/logoff\")\n\tpublic void logoff() {\n\t\tloggedUser.doLogoff();\n\t\tresult.redirectTo(IndexController.class).index();\n\t}",
"public void logout(){\n\t\t\n\t\tcurrentUser.logout();\n\t\tcurrentUser = null;\n\t\tchangeViewPort(new GUI_Logout(\"\", \"\", this));\n\t}",
"public void doLogout() {\n loggedIn = false;\r\n HttpSession session = (HttpSession) FacesContext.getCurrentInstance()\r\n .getExternalContext().getSession(false);\r\n session.invalidate(); \r\n String pag= \"/login.xhtml\";\r\n redireccionar(pag);\r\n }",
"private void signOutUser() {\n mAuth.signOut();\n LoginManager.getInstance().logOut();\n Toast.makeText(ChatMessage.this, \"You have been logout\", Toast.LENGTH_SHORT).show();\n finishAffinity();\n proceed();\n }",
"private void logout() {\n\t\tParseUser.logOut();\n\n\t\t// Go to the login view\n\t\tstartLoginActivity();\n\t}",
"private void logout() {\n\t\tgetUI().get().navigate(\"login\");\r\n\t\tgetUI().get().getSession().close();\r\n\t}",
"public void logout() {\n getRequest().getSession().invalidate();\n }",
"@Override\n\tpublic void logout(user theUser) {\n\t}",
"public static void makeUnlogged() {\n\t\tMemberSessionFacade.removeAttribute(ConfigKeys.LOGGED);\n//\t\tControllerUtils.addCookie(ConfigKeys.LOGGED, null);\n\t}",
"public void logout() {\n loggedIn = \"\";\n FacesContext.getCurrentInstance().getExternalContext()\n .getSessionMap().put(\"loggedIn\", \"\");\n }",
"public boolean logoutUser(Context context){\n DatabaseHandler db = new DatabaseHandler(context);\n db.resetTables();\n return true;\n }",
"@Override\n\tpublic void exitSessionUser() {\n\t\tgetThreadLocalRequest().getSession().invalidate();\n\t\t\n\t}",
"public void logoutUser() {\n editor.remove(Is_Login).commit();\n editor.remove(Key_Name).commit();\n editor.remove(Key_Email).commit();\n editor.remove(KEY_CUSTOMERGROUP_ID).commit();\n // editor.clear();\n // editor.commit();\n // After logout redirect user to Loing Activity\n\n }",
"@Override\n\tpublic void userLogout(String userId) throws Exception {\n\n\t}",
"public void forceLogout()\n\t{\n\t\tif(getSession() != null && getSession().getLoggedIn())\n\t\t\tgetSession().close();\n\t\telse\n\t\t\tGameServer.getServiceManager().getNetworkService().getLogoutManager().queuePlayer(this);\n\t}",
"@Override\n public void logOut() {\n }",
"void logoutDone();",
"public boolean logoutUser(Context context){\n\t\tDatabaseHandler db = new DatabaseHandler(context);\n\t\tdb.resetTables();\n\t\treturn true;\n\t}",
"private void doLogout() {\r\n\t\tdoctor.setOnline(0);\r\n\t\t// Set doctor as logged out\r\n\t\tdbAdapter.updateDoctor(doctor);\r\n\t\t// Release objects and notify observers\r\n\t\tloggedIn = false;\r\n\t\tnotifyObservers();\r\n\t\tdoctors = null;\r\n\t\tdoctor = null;\r\n\t}",
"public static void logout() {\n userId = -1;\n aisId = -1;\n \n name = \"\";\n role = \"\";\n roleFromDatabase = \"\";\n \n lastAction = LocalDateTime.now().minusYears(100);\n }",
"public void Logout(){\n preferences.edit().remove(userRef).apply();\n }",
"protected void logout() {\n\t\tActiveUserModel userController = ActiveUserModel.getInstance();\n\t\tuserController.performLogout();\n\n\t\tIntent intent = new Intent(this, LoginActivity.class);\n\t\tstartActivityForResult(intent, LOGIN_ACTIVITY);\n\t}",
"public void logout() {\n \n FacesContext.getCurrentInstance().getExternalContext().invalidateSession();\n try {\n FacesContext.getCurrentInstance().getExternalContext()\n .redirect(\"/BookStorePelikSangat/faces/admin/loginadmin.xhtml\");\n } \n catch (IOException e) {}\n\t}",
"public void logOut() {\n Logger.d(TAG,\"login#logOut\");\n Logger.d(TAG,\"login#stop reconnecting\");\n //\t\teverlogined is enough to stop reconnecting\n everLogined = false;\n isLocalLogin = false;\n reqLoginOut();\n }",
"public void doLogout() {\r\n\t\tdestroy();\r\n\r\n\t\t/* ++++++ Kills the Http session ++++++ */\r\n\t\t// HttpSession s = (HttpSession)\r\n\t\t// Sessions.getCurrent().getNativeSession();\r\n\t\t// s.invalidate();\r\n\t\t/* ++++++ Kills the zk session +++++ */\r\n\t\t// Sessions.getCurrent().invalidate();\r\n\t\tExecutions.sendRedirect(\"/j_spring_logout\");\r\n\r\n\t}",
"public void setlogUserOut() {\n\t\tcontroller.logoutUser();\n\t\tuserMenuButton.setText(\"\");\n\t\tuserMenuButton.setStyle(\"\");\n\t\tuserMenuButton.getItems().removeAll(menu1, menu2);\n\t\tloggedinuser.setVisible(false);\n\t\tuserSettings.setVisible(false);\n\t\tloginoption.setVisible(true);\n\n\t}",
"public void logout() {\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(AppConfig.SHARED_PREF_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n mCtx.startActivity(new Intent(mCtx, LoginActivity.class));\n }",
"public void Logout()\n {\n isLoggedIn = false;\n connection.Disconnect(); \n connection = null;\n }",
"private void logoutHandler(RoutingContext context) {\n context.clearUser();\n context.session().destroy();\n context.response().setStatusCode(204).end();\n }",
"@Override\r\n public void logoutAdmin() throws Exception {\n \r\n }",
"@Override\r\n public void logoutAdmin() throws Exception {\n \r\n }",
"private void logout() {\n ((MyApplication)this.getApplication()).setLoggedIn(false);\n// Intent intent = new Intent(this, StartupActivity.class);\n// startActivity(intent);\n }",
"public void logOut() {\n\t\t// Close all opened windows and start up the App again\n\t\tcurrentUser = null;\n\t\tcurrentContact = null;\n\t\tjava.awt.Window win[] = java.awt.Window.getWindows();\n\t\tfor (int i = 0; i < win.length; i++) {\n\t\t\twin[i].dispose();\n\t\t}\n\t\tApp.main(null);\n\t}",
"private void logout() {\n LogoutTask mAuthTask = new LogoutTask();\n mAuthTask.execute((Void) null);\n }",
"@Override\r\n\tpublic boolean checkLogout() {\n\t\treturn false;\r\n\t}",
"@Override\r\n\tpublic boolean checkLogout() {\n\t\treturn false;\r\n\t}",
"@Override\n\tpublic Boolean logout()\n\t\t\tthrows UnknownException {\n HttpSession sesion = this.getThreadLocalRequest().getSession();\n sesion.removeAttribute(\"beanusuario\");\n sesion.removeAttribute(\"idsession\"); \n sesion.invalidate(); \n return true;\n\t}",
"@FXML\n private void logout(ActionEvent event) throws IOException {\n if (CurrentUser.getInstance().getUser() != null) {\n CurrentUser.getInstance().init(null); //Logs off\n App.setRoot(\"default\");\n }\n }",
"public void logout() {\n\n // Instance, user and token become null\n instance = null;\n user = null;\n authtoken = null;\n\n // Switch all the settings back to true\n isLifeStoryLinesOn = true;\n isFamilyTreeLinesOn = true;\n isSpouseLinesOn = true;\n isFatherSideOn = true;\n isMotherSideOn = true;\n isMaleEventsOn = true;\n isFemaleEventsOn = true;\n\n //Take care of resetting boolean logics use throughout app\n isLoggedIn = false;\n personOrSearch = false;\n startLocation = null;\n eventID = null;\n\n // Clear all lists\n\n people.clear();\n events.clear();\n personEvents.clear();\n currentPersonEvents.clear();\n eventTypes.clear();\n\n childrenMap.clear();\n maleSpouse.clear();\n femaleSpouse.clear();\n paternalAncestorsMales.clear();\n paternalAncestorsFemales.clear();\n maternalAncestorsMales.clear();\n maternalAncestorsFemales.clear();\n }",
"public static void logout(Context context) \r\n\t{\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\tcontext.sessionAttribute(\"currentUser\", null);\r\n\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t\t//context.json(new MyCustomResponseMessage(\"You've successfully logged out\", \"success\"));\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t}\r\n\t}",
"@Override\n public void loggedOut() {\n timeTables = new Timetables();\n appointments = new Appointments();\n tasks = new Tasks();\n messages = new Messages();\n substitutions = new Substitutions();\n files = new Files();\n announcements = new Announcements();\n excuseNotes = new ExcuseNotes();\n }",
"@Override\n public void logout() {\n if (SecurityContextHolder.getContext().getAuthentication() != null) {\n SecurityContextHolder.getContext().setAuthentication(null);\n }\n session.invalidate();\n }",
"public void logout() {\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n Intent myIntent = new Intent(mCtx, LoginActivity.class);\n myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n mCtx.startActivity(myIntent);\n }",
"public void logout(){\n SharedPreferences settings = mContext.getSharedPreferences(\"UserData\", 0);\n SharedPreferences.Editor preferencesEditor = settings.edit();\n preferencesEditor.clear();\n preferencesEditor.commit();\n // take user back to login screen\n Intent logoutIntent = new Intent(mContext, LoginActivity.class);\n logoutIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n mContext.startActivity(logoutIntent);\n }",
"public void logout () {\n\t\tif (isLoggedIn()) {\n\t\t\tGPPSignIn.sharedInstance().signOut();\n\t\t\tGPGManager.sharedInstance().signOut();\n\t\t}\n\t}",
"public void onLogout() {\n ParseUser.logOut();\n\n promptForLogin();\n }",
"public void userLoggedOut(User user) \n\t\t{\n\t\t\tLog.i(\"OpenFeint\", \"User logged out\");\n\t\t\tMainActivity.this.userLoggedOut();\n\t\t}",
"public void logout() {\r\n SharedPreferences sharedPreferences = ctx.getSharedPreferences(SHARED_PREF_NAME, Context.MODE_PRIVATE);\r\n SharedPreferences.Editor editor = sharedPreferences.edit();\r\n editor.clear();\r\n editor.apply();\r\n ctx.startActivity(new Intent(ctx, MainActivity.class));\r\n }",
"public Result logOut() {\n customerService().logout();\n return redirectToReturnUrl();\n }",
"private void logout() {\n //set offline flag\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\n new PostNoSqlDataBase(this).offline(uid);\n\n //logout\n // FirebaseAuth mAuth = FirebaseAuth.getInstance();\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n mGoogleSignInClient.signOut();\n FirebaseAuth.getInstance().signOut();\n //go to the main activity\n startActivity(new Intent(this, SignUpActivity.class));\n finish();\n }",
"public void logout()\r\n {\r\n loginForForm = \"\";\r\n passwordForForm = \"\";\r\n redirectSession(\"/logout\");\r\n }",
"public void userLoggedOut(User user) \n\t\t{\n\t\t\tLog.i(\"OpenFeint\", \"User logged out\");\n\t\t\tMainActivity.this.userLoggedOut();\t\n\t\t}",
"@Override\n\tpublic String logout() {\n\t\treturn null;\n\t}",
"public void logout() {\n showLoginScreen();\n }",
"public void logout() {\n\n $(logOutNavigator).click();\n driver = commonMethods.waitForElement(driver, logOffBtn);\n $(logOffBtn).click();\n $(loadingProgressIcon).should(disappear);\n }",
"private void logout(){\n ParseUser.logOut();\n removeUserFromPrefs();\n Intent intent = LandingActivity.intent_factory(this);\n startActivity(intent);\n }",
"private void doLogout() {\n mRtmClient.logout(null);\n MessageUtil.cleanMessageListBeanList();\n }",
"public void logout(){\n logger.debug(\"logout from the application\");\n driver.findElement(oLogout).click();\n new WebDriverWait(driver,10).until(\n ExpectedConditions.titleIs(\"Sign-on: Mercury Tours\"));\n\n }"
] | [
"0.7519904",
"0.749718",
"0.7316057",
"0.7285737",
"0.72729325",
"0.723355",
"0.7192566",
"0.71438485",
"0.711563",
"0.7109997",
"0.7087974",
"0.7086544",
"0.70836383",
"0.70752543",
"0.70745254",
"0.70692855",
"0.7037661",
"0.7017519",
"0.70004",
"0.69771487",
"0.697577",
"0.69590366",
"0.6956523",
"0.69488204",
"0.69488204",
"0.6937057",
"0.69318914",
"0.692499",
"0.6905867",
"0.6904946",
"0.6901915",
"0.6886772",
"0.6877851",
"0.6877851",
"0.6868982",
"0.6861216",
"0.684495",
"0.6834054",
"0.6828884",
"0.6828358",
"0.681903",
"0.68093085",
"0.6788581",
"0.6782881",
"0.67793596",
"0.6759258",
"0.6752816",
"0.6747143",
"0.67268527",
"0.6709548",
"0.67095184",
"0.66940844",
"0.6684981",
"0.6683886",
"0.6671699",
"0.66688776",
"0.664874",
"0.6645911",
"0.66398907",
"0.6637883",
"0.66361225",
"0.66230786",
"0.6602358",
"0.6599236",
"0.6592063",
"0.65872586",
"0.65857625",
"0.6573893",
"0.65735465",
"0.6557672",
"0.6523395",
"0.6520804",
"0.65154713",
"0.65154713",
"0.65123147",
"0.65120834",
"0.65055215",
"0.6480483",
"0.6480483",
"0.64799696",
"0.64746374",
"0.6468995",
"0.64665926",
"0.6465271",
"0.64600873",
"0.64433765",
"0.6441391",
"0.6433702",
"0.6428717",
"0.64268744",
"0.64180243",
"0.6413013",
"0.6407785",
"0.6403007",
"0.63989455",
"0.63821936",
"0.6370061",
"0.6368836",
"0.63636833",
"0.635367",
"0.63524944"
] | 0.0 | -1 |
set the connector handling this request processor | public void setConnector ( WebConnector connector ) {
this.connector = connector;
l2pNode = connector.getL2pNode();
//anonymous = l2pNode.getAnonymous();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void setConnectorHandler(Handler handler) {\n connectorHandler = handler;\n }",
"@Override\n\tpublic void setConnector(final Connector connector) {\n\n\t}",
"@Reference(name = \"httpConnector\",\n service = HttpConnector.class,\n cardinality = ReferenceCardinality.AT_LEAST_ONE,\n policy = ReferencePolicy.DYNAMIC,\n unbind = \"unsetHttpConnector\")\n public void setHttpConnector(HttpConnector connector) {\n connector.setServerConnection((request, response) -> {\n MDC.put(\"uuf-request\", String.valueOf(count.incrementAndGet()));\n serve(request, response);\n MDC.remove(\"uuf-request\");\n return response;\n });\n log.info(\"HttpConnector '\" + connector.getClass().getName() + \"' registered.\");\n }",
"private Handler getConnectorHandler() {\n return connectorHandler;\n }",
"public void setCommunicationHandler(){\n this.comHandler = new CommunicationHandler(this);\n }",
"public void setConnectorBase(Ec connectorBase) {\n\n this.connectorBase = connectorBase;\n //Se connectorBase existe, atribui este como seu parente\n// if(this.connectorBase != null)\n// this.connectorBase.setParent(this);\n }",
"public void consume(Connector connector) {\n\n\t}",
"public SendingFaxes( Connector connector) {\n this.m_connector = connector;\n }",
"@Override\n\tpublic Connector getConnector() {\n\t\treturn null;\n\t}",
"public InputConnector getInputConnector(String connectorName);",
"public T caseConnector(Connector object) {\n\t\treturn null;\n\t}",
"public void setHead(Connector<T> head) {\n\t\tthis.head = head;\n\t}",
"public void setDelegate(HttpConnectorDelegate delegate) {\n\t\tsynchronized ( this ) {\n\t\t\tif ( mRequestFlag ) {\n\t\t\t\tthrow new IllegalStateException(\"already started request\");\n\t\t\t} \n\t\t\tmDelegate = delegate;\n\t\t}\n\t}",
"public interface ConnectorContext {\n\n\n /**\n * Get a reference to a global state manager for state coordination, dedup and ordering semantics\n *\n * @return global state manager instance\n */\n StateManager getStateManager();\n\n /**\n * Get a Globally unique connector instance identifier for the connector instance\n *\n * @return globally unique uuid\n */\n UUID getConnectorId();\n\n /**\n * Partition id for the connector instance.\n *\n * @return local partition id in cluster\n */\n int getPartitionId();\n\n /**\n * Get expected total instances of this connector type currently active\n *\n * @return total active instance count\n */\n int getInstanceCount();\n\n /**\n * Notifying the external runtime of metrics and other related events\n *\n * @param event Event to Sent\n * @return Error or success code\n */\n Integer publishEvent(SendableEvent event);\n\n /**\n * Receiving events from an external manager post initialization, meant for throttling and config updates.\n *\n * @param listener Local listener object to bind to.\n */\n void subscribeToEvents(Listener listener);\n\n /**\n * Get a reference to the global state manager\n *\n * @return a client object to interact with the scheme registry\n */\n SchemaManager getSchemaManager();\n}",
"public void setConnection(Connection conn);",
"@Override\n protected void extend(ServerConnector target) {\n\n }",
"boolean setConnector(@NonNull ConnectorProfile profile);",
"public Class<?> getConnectorClass() {\n\t\t\treturn connectorClass;\n\t\t}",
"public void setFormat(Connector connector, Format format);",
"public InputConnector getInputConnector()\n {\n return inputConnector;\n }",
"public void configure(URLConnection c) {\n }",
"public HttpConnector(){\n super();\n }",
"public void setConnectionHandler(ConnectionHandler connectionHandler) {\n this.connectionHandler = connectionHandler;\n }",
"public void setConn(Connection conn) {this.conn = conn;}",
"public T caseFConnector(FConnector object) {\n\t\treturn null;\n\t}",
"public void put(String name, Connector connector) {\n if (containsKey(name)) {\n throw new RuntimeException(\"Connector '\" + name + \"' already exists in Module '\" + BasicModule.this.getClass().getName() + \"::\" + name + \"'\");\n }\n if (this.def == null) {\n this.def = connector;\n }\n super.put(name, connector);\n }",
"public synchronized void associateHandle() {\n JCublas2.cublasSetStream(handle,oldStream);\n }",
"public void setTCPConnection(TCPConnectionHandler tcp) {\r\n\t\tthis.tcp = tcp;\r\n\t}",
"public void connectorPushed(InputConnector inputConnector);",
"public void setHandlerChain(MessageHandlerChain<MessageType> handlerChain);",
"public T caseEConnector(EConnector object) {\n\t\treturn null;\n\t}",
"public void setConnection(WarpConnection connection) {\r\n this.connection=connection;\r\n }",
"public interface Connector {\n}",
"public void setTail(Connector<T> tail) {\n\t\tthis.tail = tail;\n\t}",
"public void connectTo(Connector connector) {\n\t\tthis.connectors.add(connector);\n\t\tif (connector.getUnit() == null)\n\t\t\tthrow new RuntimeException(\"Connector must be attached\");\n\t\tif (!(receivers.contains(connector.getUnit()))) {\n\t\t\treceivers.add(connector.getUnit());\n\t\t}\n\t}",
"@Nullable Connector getConnector();",
"public Connector()\n\t{\n\t\tconn = null;\n\t}",
"public OutputConnector getOutputConnector(String connectorName);",
"protected void setHandlerChain(List<HiveIOExceptionHandler> handlerChain) {\n this.handlerChain = handlerChain;\n }",
"@Override\n\tpublic void setHandler(Incoming handler) {\n\t\tthis.handler = handler;\n\t}",
"public void setConnection(Connection value) {\r\n connection = value;\r\n }",
"public void setupPipelineBuffer(final HttpServerExchange exchange) {\n ((HttpServerConnection) exchange.getConnection()).getChannel().getSinkChannel().setConduit(this);\n }",
"public int getNumberOfConnectors() { return numberOfConnectors; }",
"public void setSocket(SocketWrapper socket);",
"void setupConnectorType(String userId,\n String assetManagerGUID,\n String assetManagerName,\n boolean assetManagerIsHome,\n String connectionGUID,\n String connectorTypeGUID,\n Date effectiveFrom,\n Date effectiveTo,\n Date effectiveTime,\n boolean forLineage,\n boolean forDuplicateProcessing) throws InvalidParameterException,\n UserNotAuthorizedException,\n PropertyServerException;",
"public void setConnection(Connection connection)\n\t{\n\t\twConn = connection;\n\t}",
"public void setConnection(Connection connection) {\n this.connection = connection;\n }",
"public Format connectTo(InputConnector inputConnector, Format useThisFormat)\n {\n Format format = canConnectTo(inputConnector, useThisFormat);\n // if (format==null)\n // return null;\n\n this.inputConnector = inputConnector;\n inputConnector.setOutputConnector(this);\n int bufferSize = Math.max(getSize(), inputConnector.getSize());\n\n circularBuffer = new CircularBuffer(bufferSize);\n inputConnector.setCircularBuffer(circularBuffer);\n return null;\n }",
"@Override\r\n public void setConfig(ConnectorConfig config) {\n cameraIndex = config.getIntegerParam(\"cameraIndex\", cameraIndex);\r\n\r\n }",
"public void setConn(Connection connection){\n\t\tthis.conn = connection;\n\t}",
"FaultMediatorInputConnector getInputConnector();",
"private void registerCustomProtocolHandler() {\n try {\n URL.setURLStreamHandlerFactory(new URLStreamHandlerFactory() {\n @Override\n public URLStreamHandler createURLStreamHandler(String protocol) {\n if (\"https\".equals(protocol)) {\n return new sun.net.www.protocol.https.Handler() {\n @Override\n protected URLConnection openConnection(URL url, Proxy proxy) throws IOException {\n // Leaving sysout comments here for debugging and clarity if the tool does break again because of an Okta Update\n //System.out.format(\"openConnection %s (%s, %s)\\n\", url, url.getHost(), url.getPath());\n\n final HttpsURLConnectionImpl httpsURLConnection = (HttpsURLConnectionImpl) super.openConnection(url, proxy);\n if (\"artisan.okta.com\".equals(url.getHost()) && \"/home/amazon_aws/0oad7khqw5gSO701p0x7/272\".equals(url.getPath())) {\n\n return new URLConnection(url) {\n @Override\n public void connect() throws IOException {\n httpsURLConnection.connect();\n }\n\n public InputStream getInputStream() throws IOException {\n byte[] content = IOUtils.toByteArray(httpsURLConnection.getInputStream());\n String contentAsString = new String(content, \"UTF-8\");\n\n //System.out.println(\"########################## got stream content ##############################\");\n //System.out.println(contentAsString);\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\n //contentAsString = contentAsString.replaceAll(\",\\\"ENG_ENABLE_SCRIPT_INTEGRITY\\\"\", \"\"); // nested SRIs?\n baos.write(contentAsString.replaceAll(\"integrity ?=\", \"integrity.disabled=\").getBytes(\"UTF-8\"));\n return new ByteArrayInputStream(baos.toByteArray());\n }\n\n public OutputStream getOutputStream() throws IOException {\n return httpsURLConnection.getOutputStream();\n }\n\n };\n\n } else {\n return httpsURLConnection;\n }\n }\n\n };\n }\n return null;\n }\n });\n } catch (Throwable t) {\n System.out.println(\"Unable to register custom protocol handler\");\n }\n }",
"public InternalConnectionHandler() {\r\n\t\tthis.setPacketProcessor(InternalPacketProcessor.getInstance());\r\n\t}",
"public void unsetHttpConnector(HttpConnector connector) {\n connector.setServerConnection(null);\n log.info(\"HttpConnector '\" + connector.getClass().getName() + \"' unregistered.\");\n }",
"public SQLCMDMeta(ConnectionFactory connector) {\r\n super();\r\n this.connector = connector;\r\n }",
"@Override\n\tpublic void connect(int threadNumber, int handlerID) {\n\t}",
"void setURLStreamHandler(String protocol, URLStreamHandler handler) {\n handlers.put(protocol, handler);\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add handler\n InetSocketAddress remoteSocketAddress = new InetSocketAddress(directRemoteHost, directRemotePort);\n pipeline.addLast(new DirectProxyUpstreamHandler(remoteSocketAddress, false, 1048576, new RequestInterceptor(remoteSocketAddress), \" -->\"));\n }",
"void registerInputConnector(String name, InputConnector in);",
"public void setConn(Connection conn) {\r\n this.conn = conn;\r\n }",
"@Override\n protected void initChannel(SocketChannel ch) throws Exception {\n ChannelPipeline pipeline = ch.pipeline();\n\n // add HTTPS client -> proxy support\n SSLEngine engine = SSLFactory.getInstance().sslContext().createSSLEngine();\n engine.setUseClientMode(false);\n pipeline.addLast(\"ssl inbound\", new SslHandler(engine));\n\n // add handler\n InetSocketAddress remoteSocketAddress = new InetSocketAddress(directRemoteHost, directRemotePort);\n pipeline.addLast(new DirectProxyUpstreamHandler(remoteSocketAddress, true, 1048576, new RequestInterceptor(remoteSocketAddress), \" -->\"));\n\n }",
"public void setConn(Connection conn)\r\n\t{\r\n\t\tthis.conn = conn;\r\n\t}",
"void setEndpoint(String endpoint);",
"public HttpConnector(JsonSystem system) {\r\n super(system);\r\n }",
"public void setConn(Connection conn) {\n this.conn = conn;\n }",
"void setRequest(Request req);",
"public void setNextHandler(Handler nextHandler){\n\n this.nextHandler = nextHandler;\n\n }",
"void registerOutputConnector(String name, OutputConnector out);",
"protected GaConnector() {\n }",
"public void setConnectRequest(boolean connectRequest) {\n\t\tthis.connectRequest = connectRequest;\n\t\t\n\t}",
"public LoginServerConnector getLoginServerConnector() {\n\t\treturn connector;\n\t}",
"public void setHandler(Handler handler) {\r\n this.handler = handler;\r\n }",
"public void setHandler(Handler handler) {\r\n this.handler = handler;\r\n }",
"void setConnection(Connection con);",
"protected void setProxiedClient(URL paramURL, String paramString, int paramInt) throws IOException {\n/* 127 */ this.delegate.setProxiedClient(paramURL, paramString, paramInt);\n/* */ }",
"public void setProtocol(Protocol protocol)\n \t{\n \t\tthis.protocol = protocol;\n \t}",
"public final void setConnection(Connection connection) {\n this.conn = connection;\n }",
"@ReactMethod\n public void setUseConnectionService(final boolean use) {\n runInAudioThread(new Runnable() {\n @Override\n public void run() {\n useConnectionService_ = use;\n setAudioDeviceHandler();\n }\n });\n }",
"public void setConn(Connection conn)\n\t{\n\t\tthis.conn = conn;\n\t}",
"@Override\n\tpublic List<String> getConnectorIds() {\n\t\treturn connectorIds;\n\t}",
"public void setConnection(Connection connection) {\n //doNothing\n }",
"public void setConnection(Connection connection) {\n\t\tthis.connection = connection;\n\t}",
"public void setConnectionContext(final ChannelHandlerContext ctx) {\n while (true) {\n final ChannelHandlerContext oldCtx = connectionCtx.get();\n if (connectionCtx.compareAndSet(oldCtx, ctx)) {\n return;\n }\n }\n }",
"@Override\n\tprotected void extend(AbstractClientConnector target) {\n\t\tsuper.extend(target);\n\t}",
"@Override\r\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\tch.pipeline().addLast(\"tcpDecoder\", new MessageDecoder());\r\n\t\tch.pipeline().addLast(\"tcpHandler\", new TcpServerHandler(ac)); \r\n\t\t\r\n\t}",
"@Override\n protected void configure() {\n flow(\"OutputParamsAsXML\")\n .from(\"http://localhost:8080\") //embedded http server that listen on 8080 port\n .filter(groovy(\"message.payload != \\\"/favicon.ico\\\"\")) //don't process the browser request for `favicon.ico`\n .transformWith(HttpRequestBodyToParamMap.class) //transform http request body to a map\n .transformWith(ObjectToXml.class) //transform the payload (map) to xml\n .messageProperties()\n .put(\"Content-Type\", \"text/xml\"); //sets the output content-type to xml\n }",
"private void onConnectorMessage(final EcologyMessage message) {\n getEcologyLooper().getHandler().post(new Runnable() {\n @Override\n public void run() {\n handleMessage(message);\n }\n });\n }",
"public void setEndPoint(EndPoint endPoint) {\r\n\t\tthis.endPoint = endPoint;\r\n\t}",
"protected void setProxiedClient(URL paramURL, String paramString, int paramInt, boolean paramBoolean) throws IOException {\n/* 143 */ this.delegate.setProxiedClient(paramURL, paramString, paramInt, paramBoolean);\n/* */ }",
"@Override\n\tprotected void initChannel(SocketChannel ch) throws Exception {\n\t\tch.pipeline().addLast(\"tcpDecoder\", new MessageDecoder());\n\t\tch.pipeline().addLast(\"tcpHandler\", new TcpServerHandler(ac)); \n\t\t\n\t}",
"public void setTrustStore(String trustStoreLocation) {\n if (!complete) {\n this.trustStoreLocation = trustStoreLocation;\n } else {\n log.warn(\"Connection Descriptor setter used outside of factory.\");\n }\n }",
"public void setRequest(REQ request) {\n this.request = request;\n }",
"public void SetConnectInbound(boolean option){\n FunctionLogger logger=new FunctionLogger(\"SetConnectInbound\",this,myLogger);\n logger.args(option);\n ConnectInboundFlag=option;\n }",
"public final void setDescriptor(RouteProviderDescriptor descriptor) {\n if (descriptor == null) {\n throw new IllegalArgumentException(\"descriptor must not be null\");\n }\n MediaRouter.checkCallingThread();\n \n if (mDescriptor != descriptor) {\n mDescriptor = descriptor;\n if (!mPendingDescriptorChange) {\n mPendingDescriptorChange = true;\n mHandler.sendEmptyMessage(MSG_DELIVER_DESCRIPTOR_CHANGED);\n }\n }\n }",
"public interface IStreamConnector extends IConnector {\r\n\r\n\t/** \r\n\t * Returns an input stream that can be used to receive data. This\r\n\t * method should only be called once per connector, although a connector can\r\n\t * declare that it supports multiple calls to this method. The specific type\r\n\t * returned by this method can be queries using the get type method. \r\n\t * \r\n\t * @return An input stream that can be used to receive data. \r\n\t * @throws IOException Thrown if the connector cannot open an input stream.\r\n\t */\r\n\tpublic InputStream getInputStream() throws IOException;\r\n\t\r\n\t/**\r\n\t * Returns an output stream that can be used to transfer data. Be\r\n\t * aware that this method should only be called once per connector. The \r\n\t * specific type returned by this method is defined by the get type method.\r\n\t * \r\n\t * @return An output stream that can be used to transfer data.\r\n\t * @throws IOException Thrown if the connector cannot open an output stream.\r\n\t */\r\n\tpublic OutputStream getOutputStream() throws IOException;\r\n\t\r\n}",
"@Override\n public void channelActive(final ChannelHandlerContext ctx) throws Exception {\n ioContext = new IoContext(\n endpointContext,\n ctx.channel().localAddress(),\n ctx.channel().remoteAddress(),\n endpointContext.bucket()\n );\n\n channelContext = new HttpChannelContext(ctx.channel().id());\n\n remoteHost = endpoint.remoteHostname() + \":\" + endpoint.remotePort();\n ctx.pipeline().get(HttpObjectAggregator.class).channelActive(ctx);\n ctx.fireChannelActive();\n }",
"public void setHttpRequest( HttpRequest req ) {\r\n\trequest=req;\r\n }",
"@Override\n public void run() {\n super.run(); // obtain connection\n if (connection == null)\n return; // problem obtaining connection\n\n try {\n request_spec.context.setAttribute\n (ExecutionContext.HTTP_CONNECTION, connection);\n\n doOpenConnection();\n\n HttpRequest request = (HttpRequest) request_spec.context.\n getAttribute(ExecutionContext.HTTP_REQUEST);\n request_spec.executor.preProcess\n (request, request_spec.processor, request_spec.context);\n\n response = request_spec.executor.execute\n (request, connection, request_spec.context);\n\n request_spec.executor.postProcess\n (response, request_spec.processor, request_spec.context);\n\n doConsumeResponse();\n\n } catch (Exception ex) {\n if (exception != null)\n exception = ex;\n\n } finally {\n conn_manager.releaseConnection(connection, -1, null);\n }\n }",
"public void setSocketChannel(SocketChannel socketChannel);",
"protected void setConnected(boolean paramBoolean) {\n/* 169 */ this.delegate.setConnected(paramBoolean);\n/* */ }"
] | [
"0.75331664",
"0.73005396",
"0.67515403",
"0.6527469",
"0.5768867",
"0.5718043",
"0.5651469",
"0.5640483",
"0.55363256",
"0.5442427",
"0.5410246",
"0.53728414",
"0.53589225",
"0.5301989",
"0.5294093",
"0.52823997",
"0.5278947",
"0.52485794",
"0.5210595",
"0.5165969",
"0.51634777",
"0.51555717",
"0.5135806",
"0.5123339",
"0.51208466",
"0.5095738",
"0.5086904",
"0.5046211",
"0.5037705",
"0.50183237",
"0.5013341",
"0.5000592",
"0.4996483",
"0.4993921",
"0.4993187",
"0.49823532",
"0.49591598",
"0.49552923",
"0.49116987",
"0.4907018",
"0.48979118",
"0.48666513",
"0.4863334",
"0.4854339",
"0.4845009",
"0.48397383",
"0.48380747",
"0.48308295",
"0.48291805",
"0.4804876",
"0.48008263",
"0.47950125",
"0.4785655",
"0.47837728",
"0.4778064",
"0.47685587",
"0.47638354",
"0.4763048",
"0.47502372",
"0.47253886",
"0.47225472",
"0.4718142",
"0.47038594",
"0.46975794",
"0.46844125",
"0.46823838",
"0.4681991",
"0.46677697",
"0.4662413",
"0.4652711",
"0.4643439",
"0.46434125",
"0.46434125",
"0.46427175",
"0.46248254",
"0.46183643",
"0.4618162",
"0.46063897",
"0.46052018",
"0.460183",
"0.46007726",
"0.4597306",
"0.45934907",
"0.45841601",
"0.45779887",
"0.45714563",
"0.45706576",
"0.45593515",
"0.45547757",
"0.45518607",
"0.4547963",
"0.45447466",
"0.45433933",
"0.45423913",
"0.45395046",
"0.45376727",
"0.45319578",
"0.45308074",
"0.45297235",
"0.45243007"
] | 0.61787295 | 4 |
Login user as a las2peer user | private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException
{
String[] requestSplit=request.getPath().split("/",3);
if(requestSplit.length<2)
return false;
String serviceName=requestSplit[1];
final int BASIC_PREFIX_LENGTH="BASIC ".length();
String userPass="";
String username="";
String password="";
//Check for authentication information in header
if(request.hasHeaderField(AUTHENTICATION_FIELD)
&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))
{
userPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);
userPass=new String(Base64.decode(userPass), "UTF-8");
int separatorPos=userPass.indexOf(':');
//get username and password
username=userPass.substring(0,separatorPos);
password=userPass.substring(separatorPos+1);
try
{
long userId;
Agent userAgent;
if ( username.matches ("-?[0-9].*") ) {
try {
userId = Long.valueOf(username);
} catch ( NumberFormatException e ) {
throw new L2pSecurityException ("The given user does not contain a valid agent id!");
}
} else {
userId = l2pNode.getAgentIdForLogin(username);
}
userAgent = l2pNode.getAgent(userId);
if ( ! (userAgent instanceof PassphraseAgent ))
throw new L2pSecurityException ("Agent is not passphrase protected!");
((PassphraseAgent)userAgent).unlockPrivateKey(password);
_currentUserId=userId;
if(!_userSessions.containsKey(userId))//if user not registered
{
Mediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);
_userSessions.put(userId, new UserSession(mediator));
}
_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service
connector.logMessage("Login: "+username);
connector.logMessage("Sessions: "+Integer.toString(_userSessions.size()));
return true;
}catch (AgentNotKnownException e) {
sendUnauthorizedResponse(response, null, request.getRemoteAddress() + ": login denied for user " + username);
} catch (L2pSecurityException e) {
sendUnauthorizedResponse( response, null, request.getRemoteAddress() + ": unauth access - prob. login problems");
} catch (Exception e) {
sendInternalErrorResponse(
response,
"The server was unable to process your request because of an internal exception!",
"Exception in processing create session request: " + e);
}
}
else
{
response.setStatus ( HttpResponse.STATUS_BAD_REQUEST );
response.setContentType( "text/plain" );
response.print ( "No authentication provided!" );
connector.logError( "No authentication provided!" );
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic ResultMessage login(String user_name, String password) throws RemoteException{\n\t\treturn null;\n\t}",
"void login(String user, String password);",
"public void login(User user);",
"@Override\n\tpublic void loginUser() {\n\t\t\n\t}",
"public User login(String loginName, String password) throws UserBlockedException;",
"public void login(String addr, String port, String user){\n if (state != State.NOCONNECTION){\n Log.d(\"State\", state.toString());\n return;\n }\n if (user.length() < 3){\n Log.d(\"Username\", \"length too short\");\n return; //BAD HUMAN!!!\n }\n _user = user;\n try {\n mConnection = new NetworkingConnection(new MyResponseVisitor(), addr, port);\n state = State.HASCONNECTION;\n } catch (UnknownHostException e){\n e.printStackTrace();\n //there is an unknown host aka ur IP is wrong bish\n Log.d(\"Bad IP address\", addr);\n state = State.NOCONNECTION;\n }\n //make the error handler somewher\n INetworkingConnection.OnErrorSend handleErr = new INetworkingConnection.OnErrorSend(){\n public void onError(@NonNull Throwable err){\n err.printStackTrace();\n }\n };\n //send the login request somewhere(???)\n LoginRequest loginReq = new LoginRequest(user);\n mConnection.send(loginReq, handleErr).execute();\n state = State.ATTEMPTEDLOGIN;\n }",
"public void login() {\n\t\tUser user = new User(\"admin\", \"12345678\", Role.ADMIN);\n\t\tuser.setEmail(\"admin@gibmit.ch\");\n\t\t\n\t\tif(user != null) {\n\t\t\tuserBean.setLoggedInUser(user);\n\t\t\tFacesContext context = FacesContext.getCurrentInstance();\n\t\t\tHttpServletRequest req = (HttpServletRequest)context.getExternalContext().getRequest();\n\t\t\treq.getSession().setAttribute(ATTR_USER, user);\n\t\t}else{\n\t\t\tkeepDialogOpen();\n\t\t\tdisplayErrorMessageToUser(\"Wrong Username/Password. Try again\");\n\t\t}\n\t\t\n\t}",
"public String login(Users user){\r\n\t\tthis.user = em.find(Users.class, user.getUserName());\r\n\t\t\r\n\t\tif(this.user == null){\r\n\t\t\tsetUser(new Users());\r\n\t\t\treturn \"userNotExists\";\r\n\t\t\t\r\n\t\t}else{\t\r\n\t\t\tString salt = this.user.getSalt();\r\n\t\t\tString code = ((Integer) (user.getPassword() + salt).hashCode()).toString();\r\n\t\t\tif(code.equals(this.user.getPassword())){\r\n\t\t\t\treturn \"success\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\treturn \"passwordFail\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}",
"@Override\n\tpublic User login(String user, String pass) {\n\t\treturn null;\n\t}",
"@Override\r\n\tpublic UserVO login(LoginUserVO user) {\n\t\treturn login.login(user);\r\n\t}",
"@Override\n\tpublic SmbmsUser login(String userCode, String userPassword) {\n\t\treturn sud.login(userCode, userPassword);\n\t}",
"@Override\r\n\tpublic user login(String name, String pwd) {\n\t\treturn userM.login(pwd,name);\r\n\t\t\r\n\t}",
"public void loginAsUser() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"user\");\n vinyardApp.fillPassord(\"123\");\n vinyardApp.clickSubmitButton();\n }",
"void login(String cuid, String pass)\n throws RemoteException;",
"public void login(User user) {\n try {\n Encrypter encrypter = new Encrypter();\n //el usuario ha logueado usando el email\n if (user.getUserName().contains(\"@\")){\n String emailAux = encrypter.encrypt(user.getUserName());\n String passwordAux = encrypter.encrypt(user.getPassword());\n\n doStream.writeUTF(\"L\");\n doStream.writeUTF(emailAux);\n doStream.writeUTF(passwordAux);\n\n }else{\n //el usuario ha logueado usando el nombre de usuario\n String nameAux = encrypter.encrypt(user.getUserName());\n String passwordAux = encrypter.encrypt(user.getPassword());\n\n doStream.writeUTF(\"L\");\n doStream.writeUTF(nameAux);\n doStream.writeUTF(passwordAux);\n }\n tractaResposta(diStream.readUTF());\n } catch (Exception a){\n a.printStackTrace();\n }\n }",
"public boolean loginUser();",
"User login(String username, String password);",
"int authenticateUser(IDAOSession session, String userName, String password);",
"public User logInUser(final String login, final String password);",
"public void doLogin() {\r\n\t\tif(this.getUserName()!=null && this.getPassword()!=null) {\r\n\t\t\tcdb=new Connectiondb();\r\n\t\t\tcon=cdb.createConnection();\r\n\t\t\ttry {\r\n\t\t\t\tps=con.prepareStatement(\"Select idUser,nom,prenom,userName,type,tel from t_user where userName=? and pass=? and status=?\");\r\n\t\t\t\tps.setString(1, this.getUserName());\r\n\t\t\t\tps.setString(2, this.getPassword());\r\n\t\t\t\tif(rs.next()) {\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"idUser\", rs.getInt(\"idUser\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"nom\", rs.getString(\"nom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"prenom\", rs.getString(\"prenom\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"userName\", rs.getString(\"userName\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"type\", rs.getString(\"type\"));\r\n\t\t\t\t\tSessionConfig.getSession().setAttribute(\"tel\", rs.getString(\"tel\"));\r\n\t\t\t\t\tFacesContext.getCurrentInstance().getExternalContext().redirect(\"view/welcome.xhtml\");\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tnew Message().error(\"echec de connexion\");\r\n\t\t\t}finally {\r\n\t\t\t\tcdb.closeConnection(con);\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tnew Message().warnig(\"Nom d'utilisateur ou mot de passe incorrecte\");\r\n\t\t}\r\n\t}",
"String login(Integer userId);",
"public boolean login(String user, String pwd){\n\t\ttry\n\t\t{\n\t\t\tCryptoHelper ch = new CryptoHelper();\n\t\t\tMessageDigest msgDigest = MessageDigest.getInstance(\"SHA-256\"); \n\t\t\tbyte[] userHash = msgDigest.digest(user.getBytes(\"UTF-16\")); // generating hash of the user\n\t\t\t\n\t\t\tif(sock.isConnected())\n\t\t\t{\n\t\t\t\t// send msg {Login+Hash(User)}serverPublickey to the server\n\t\t\t\tOutputStream sout = sock.getOutputStream();\t\t\t\t\n\t\t\t\tByteArrayOutputStream outputStream = new ByteArrayOutputStream();\n\t\t\t\toutputStream.write((byte)LOGIN); // send login signal to the server\n\t\t\t\tHashHelper.WriteInt(outputStream, userHash.length);\n\t\t\t\toutputStream.write(userHash);\n\t\t\t\tHashHelper.WriteInt(outputStream, clientPort);\n\t\t\t\tbyte msg[] = outputStream.toByteArray();\n\t\t\t\tmsg = ch.asymEncrypt(serverPubKey, msg); // Asymmetric encrypting the message\n\t\t\t\toutputStream = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(outputStream, msg.length);\n\t\t\t\toutputStream.write(msg);\n\t\t\t\tsout.write(outputStream.toByteArray()); // sending the message to the server\n\t\t\t\t\n\t\t\t\t// read server response\n\t\t\t\tDataInputStream sin = new DataInputStream(sock.getInputStream());\n\t\t\t\tint response = HashHelper.ReadInt(sin);\n\t\t\t\t\n\t\t\t\t// Any error is handled in the following condition\n\t\t\t\tif (response == ERROR){\n\t\t\t\t\tSystem.out.println(\"User already logged in or doesn't exist...\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// if nonce and salt are received then read nonce\n\t\t\t\tbyte[] nonce = new byte[response];\n\t\t\t\tsin.readFully(nonce);\n\t\t\t\t\n\t\t\t\t// Read the salt for the password\n\t\t\t\tbyte[] salt = new byte[HashHelper.ReadInt(sin)];\n\t\t\t\tsin.readFully(salt);\n\t\t\t\t\n\t\t\t\t// Send nonce+hash(salt||password) to server encrypted with server's public key\n\t\t\t\tbyte[] passwordByte = pwd.getBytes(\"UTF-16\");\n\t\t\t\tbyte[] saltedPassword = new byte[salt.length + passwordByte.length];\n\t\t\t\tSystem.arraycopy(salt, 0, saltedPassword, 0, salt.length);\n\t\t\t\tSystem.arraycopy(passwordByte, 0, saltedPassword, salt.length, passwordByte.length);\n\t\t\t\tbyte[] saltedHash = msgDigest.digest(saltedPassword);\n\t\t\t\toutputStream = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(outputStream, nonce.length);\n\t\t\t\toutputStream.write(nonce);\n\t\t\t\tHashHelper.WriteInt(outputStream, saltedHash.length);\n\t\t\t\toutputStream.write(saltedHash);\n\t\t\t\t// Asymmetric encrypting the salted hash with the server's public key.\n\t\t\t\tbyte[] message = ch.asymEncrypt(serverPubKey, outputStream.toByteArray());\n\t\t\t\toutputStream = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(outputStream, message.length);\n\t\t\t\toutputStream.write(message);\n\t\t\t\tsout.write(outputStream.toByteArray()); // sending the message to the server.\n\t\t\t\t\n\t\t\t\t// Generate Client's Diffie-Hellman Part\n\t\t\t\tDHHelper dh = new DHHelper();\n\t\t\t\tByteArrayOutputStream out = new ByteArrayOutputStream();\n\t\t\t\tObjectOutputStream serializer = new ObjectOutputStream(sout);\n\t\t\t\tDHParameterSpec spec = dh.getParameterSpec();\n\t\t\t\tserializer.writeObject(spec.getP());\n\t\t\t\tserializer.writeObject(spec.getG());\n\t\t\t\tserializer.writeInt(spec.getL());\n\t\t\t\tserializer.writeObject(dh.getPublicKey());\n\t\t\t\tserializer.flush();\n\t\t\t\t\n\t\t\t\t//read the server's response\n\t\t\t\tresponse = HashHelper.ReadInt(sin);\n\t\t\t\t\n\t\t\t\t// Errors are handled by the following condition.\n\t\t\t\tif (response == ERROR){\n\t\t\t\t\tSystem.out.println(\"Incorrect password...\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//else read Diffie-Hellman part of server\n\t\t\t\tbyte[] serverDH = new byte[response];\n\t\t\t\tsin.readFully(serverDH);\n\t\t\t\tByteArrayInputStream in = new ByteArrayInputStream(serverDH);\n\t\t\t\tObjectInputStream deserializer = new ObjectInputStream(in);\n\t\t\t\tPublicKey pubkey = (PublicKey)deserializer.readObject();\n\t\t\t\t\n\t\t\t\t// Obtain the symmetric key.\n\t\t\t\tSecretKey symKey = dh.doFinal(pubkey, \"AES\");\n\t\t\t\tsymK = symKey;\n\t\t\t\t\n\t\t\t\t// reading c1 received from server\n\t\t\t\tbyte[] c1iv = new byte[HashHelper.ReadInt(sin)];\n\t\t\t\tsin.readFully(c1iv);\n\t\t\t\tByteArrayInputStream bais = new ByteArrayInputStream(c1iv);\n\t\t\t\tDataInputStream dis = new DataInputStream(bais);\n\t\t\t\tint len = HashHelper.ReadInt(dis);\n\t\t\t\tbyte[] iv = new byte[len];\n\t\t\t\tdis.readFully(iv);\n\t\t\t\tbyte[] c1 = new byte[HashHelper.ReadInt(dis)]; \n\t\t\t\tdis.readFully(c1);\n\t\t\t\tbyte[] c1_dec = ch.symDecrypt(symKey, iv, c1);\n\t\t\t\t\n\t\t\t\t// Generate C2 to be appended with C1\n\t\t\t\tSecureRandom rand = new SecureRandom();\n\t\t\t\tbyte[] c2 = new byte[32];\n\t\t\t\trand.nextBytes(c2);\n\t\t\t\t\n\t\t\t\t// encrypt c1+c2 with symmetric key \n\t\t\t\tout = new ByteArrayOutputStream();\n\t\t\t\tout.write(c1_dec);\n\t\t\t\tout.write(c2);\n\t\t\t\tbyte[] c1c2enc = ch.symEncrypt(symKey, out.toByteArray());\n\t\t\t\t\n\t\t\t\t// send K{c1+c2} to server\n\t\t\t\tout = new ByteArrayOutputStream();\n\t\t\t\tHashHelper.WriteInt(out, c1c2enc.length);\n\t\t\t\tout.write(c1c2enc);\n\t\t\t\tsout.write(out.toByteArray());\n\t\t\t\t\n\t\t\t\t// receive c2 from server and decrypt\n\t\t\t\tbyte[] c2iv = new byte[HashHelper.ReadInt(sin)];\n\t\t\t\tsin.readFully(c2iv);\n\t\t\t\tbais = new ByteArrayInputStream(c2iv);\n\t\t\t\tdis = new DataInputStream(bais);\n\t\t\t\tlen = HashHelper.ReadInt(dis);\n\t\t\t\tiv = new byte[len];\n\t\t\t\tdis.readFully(iv);\n\t\t\t\tbyte[] c2_received = new byte[HashHelper.ReadInt(dis)]; \n\t\t\t\tdis.readFully(c2_received);\n\t\t\t\tbyte[] c2_dec = ch.symDecrypt(symKey, iv, c2_received);\n\t\t\t\t\n\t\t\t\t// compare received and sent c2\n\t\t\t\tif (!Arrays.equals(c2_dec, c2)){\n\t\t\t\t\tSystem.out.println(\"Login failed as c2!=c2\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"Logged in successfully...\");\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(\"Socket not connected\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\tSystem.out.println(\"Login failed\");\n\t\t\te.printStackTrace();\n\t\t\treturn false;\n\t\t}\n\t}",
"@Override public User login(String username, String password)\r\n throws RemoteException, SQLException {\r\n this.username = username;\r\n this.password = password;\r\n user = gameListClientModel.login(username, password);\r\n return gameListClientModel.login(username, password);\r\n }",
"@Override\n\tpublic User login(User user) {\n\t\treturn userMapper.login(user);\n\t}",
"private void loginExternalUser(final BusinessUserDetail user, final int widgetToLoad) {\n loginService.loginExternalUser(user.getUserId(), new SecuredAsyncCallback<Void>(eventBus) {\n\n @Override\n public void onSuccess(Void result) {\n loginUser(user, widgetToLoad);\n }\n });\n }",
"@Test\n\tpublic void testLoginUser(){\n\t\t\n\t\tboolean passed = true;\n\t\t\n\t\ttry {\n\t\t\tps.loginUser(new UserLoginInput(\"Sam\", \"sam\"));\n\t\t} catch (ServerException e) {\n\t\t\te.printStackTrace();\n\t\t\tpassed = false;\n\t\t}\n\t\t\n\t\tassertTrue(passed);\n\t}",
"@Override\r\n\tpublic User login(User user) {\n\t\treturn userdao.findByUserId(user.getId());\r\n\t}",
"User login(Uuid id, String username, String password, Time creationTime);",
"@Override\n\tpublic void userLogin(String userId) throws Exception {\n\n\t}",
"private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }",
"protected void login() {\n\t\t\r\n\t}",
"protected boolean login() {\n\t\tString Id = id.getText();\n\t\tif (id.equals(\"\")){\n\t\t\tJOptionPane.showMessageDialog(null, \"请输入用户名!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tUserVO user = bl.findUser(Id);\n\t\tif (user == null){\n\t\t\tJOptionPane.showMessageDialog(null, \"该用户不存在!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (! user.getPassword().equals(String.valueOf(key.getPassword()))){\n\t\t\tSystem.out.println(user.getPassword());\n\t\t\tJOptionPane.showMessageDialog(null, \"密码错误!\",\"\", JOptionPane.ERROR_MESSAGE);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tsimpleLoginPanel.this.setVisible(false);\n\t\tUserblService user2 = new Userbl(Id);\n\t\tReceiptsblService bl = new Receiptsbl(user2);\n\t\tClient.frame.add(new simpleMainPanel(user2,bl));\n\t\tClient.frame.repaint();\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"@Override\n\tpublic String login2(MemberDTO mdto) {\n\t\treturn adminDao.login2(mdto);\n\t}",
"public static void login(Lookup lookup) {\r\n\r\n\t\ttry {\r\n\r\n\t\t\tSystem.out.println(\"Enter your UserName: \");\r\n\t\t\t\r\n\t\t\tString name = sc.nextLine();\r\n\r\n\t\t\tSystem.out.println(\"Enter your Password: \");\r\n\t\t\t\r\n\t\t\tString pass = sc.nextLine();\r\n\r\n\t\t\tsUser = lookup.checkLoginAuth(name, pass);\r\n\r\n\t\t} catch (InvalidInputException e) {\r\n\r\n\t\t\tSystem.err.println(e.getMessage());\r\n\t\t\tSystem.err.flush();\r\n\r\n\t\t}\r\n\r\n\t}",
"public abstract void login(String userName, String password) throws RemoteException;",
"@Override\n public boolean userLogin(String username, String password) \n {\n User tmpUser = null;\n tmpUser = getUser(username);\n if(tmpUser == null) return false;\n if(tmpUser.getPassword().equals(password)) return true;\n return false;\n }",
"@Override\r\n\tpublic User login(User u) throws Exception {\n\t\treturn userRepository.login(u);\r\n\t}",
"public abstract User login(User data);",
"public com.sun.jna.PointerType login(Credentials c) throws RelationException;",
"private void login(String username,String password){\n\n }",
"private void logIn() throws IOException {\n\n BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));\n String line = reader.readLine();\n String[] a = line.split(\";\");\n\n String user = a[0];\n String password = a[1];\n boolean rez = service.checkPassword(user, password);\n if(rez == TRUE)\n System.out.println(\"Ok\");\n else\n System.out.println(\"Not ok\");\n }",
"@Override\n\tpublic boolean login(String userName, String password) {\n\t\tuk.ac.glasgow.internman.users.User user = users.getUser(userName, password);\n\t\tif (user != null){\n\t\t\tcurrentUser = user;\n\t\t\treturn true;\n\t\t}\n\t\telse return false;\n\t}",
"public static void userLogin(Context context)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\r\n\t\t\tString username = context.formParam(\"myUsername\");\r\n\t\t\tString password = context.formParam(\"myPassword\");\r\n\t\t\t\r\n\t\t\tif(myAccountServ.attemptLoginServiceLayer(username, password)) //if true then get user account from DB\r\n\t\t\t{\r\n\t//\t\t\tSystem.out.println(myAccountServ.getMyAccountFromDatabase(username, password));\r\n\t\t\t\tcontext.sessionAttribute(\"currentUser\", myAccountServ.getMyAccountFromDatabase(username, password)); //set session to user account info\r\n\t//\t\t\tSystem.out.println(((Account)context.sessionAttribute(\"currentUser\")));\r\n\t//\t\t\tSystem.out.println(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 1);\r\n\t\t\t\tif(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 1)//check user role id if they employeee\r\n\t\t\t\t{\r\n\t\t\t\t\t//take me to the employee page\r\n\t\t\t\t\tcontext.redirect(\"/html/employee-page.html\");\r\n\t\t\t\t}\r\n\t\t\t\telse if(((Account)context.sessionAttribute(\"currentUser\")).getRoleId() == 0) // or if they manager\r\n\t\t\t\t{\r\n\t\t\t\t\tcontext.redirect(\"/html/manager-page.html\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse//if we failed login attempt... send us back to login page aka \"/index.html\"\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"not correct credentials\");\r\n\t\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t}\r\n\t\t\r\n//\t\tSystem.out.println(\"username: \" + username);\r\n//\t\tSystem.out.println(\"pssword: \" + password);\r\n\t}",
"@Override\n public void onClick(View v) {\n loginUser(\"555555\");\n }",
"public void loginTo(String strUserName,String strPasword)\n { \n if(strUserName.equals(\"\"))\n \tthis.getUserName().clear();\n \n if(strPasword.equals(\"\"))\n \tthis.getPassword().clear();\n \n \n \tthis.getUserName().sendKeys(strUserName); \n\n this.getPassword().sendKeys(strPasword); \n\n this.getLoginButton().click(); \n }",
"@Override\n\tpublic synchronized String login(String username, String password) throws HFModuleException {\n\t\tLog.d(\"HFModuleManager\", \"login\");\n\t\t\n\t\tUserLoginPayload payload = new UserLoginPayload();\n\t\tpayload.setAccessKey(HFConfigration.accessKey);\n\t\tpayload.setUserName(username);\n\t\tpayload.setPassword(password);\n\t\tpayload.setMac(getMacAddress());\n\t\tpayload.setClientName(android.os.Build.MANUFACTURER);\n\t\t\n\t\tUserLoginRequest request = new UserLoginRequest();\n\t\trequest.setPayload(payload);\n\t\t\n\t\ttry {\n\t\t\tUserIdResponse response = cloudSecurityManager.login(request);\n\t\t\t\n\t\t\t\n\t\t\t//[should remove these code later]\n\t\t\tthis.setSid(response.getSessionId());\n\t\t\tHFLocalSaveHelper.getInstence().getMainUserInfoHelper()\n\t\t\t\t\t.setUserName(HFConfigration.cloudUserName);\n\t\t\tHFLocalSaveHelper.getInstence().getMainUserInfoHelper()\n\t\t\t\t\t.setPswd(HFConfigration.cloudPassword);\n\t\t\tHFLocalSaveHelper.getInstence().setAccesskey(\n\t\t\t\t\tHFConfigration.accessKey);\n\t\t\tHFLocalSaveHelper.getInstence().setIsregisted(true);\n\t\t\tManagerFactory.getManager(context, IHFSFManager.class).syncRemoteModuleInfo(\n\t\t\t\t\tnew SyncModuleEventListener() {\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onSyncSuccess() {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void onSyncErr() {\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t//[should remove these code later] the end \n\t\t\t\n\t\t\tString sessionId = response.getSessionId();\n\t\t\tString userId = response.getPayload().getUserId();\n\t\t\t\n\t\t\tUserInfo userInfo;\n\t\t\twhile ((userInfo = userInfoDao.getActiveUserInfo()) != null) {\n\t\t\t\tuserInfo.setActive(false);\n\t\t\t\tuserInfoDao.saveUserInfo(userInfo);\n\t\t\t}\n\t\t\t\n\t\t\tuserInfo = userInfoDao.getUserInfo(userId);\n\t\t\tif (userInfo == null) {\n\t\t\t\tuserInfo = new UserInfo();\n\t\t\t\tuserInfo.setUserId(userId);\n\t\t\t}\n\t\t\tuserInfo.setUserName(username);\n\t\t\tuserInfo.setPassword(password);\n\t\t\tuserInfo.setToken(sessionId);\n\t\t\tuserInfo.setTokenExpiredTime(System.currentTimeMillis() + UserInfo.TOKEN_EXPIRED_TIME);\n\t\t\tuserInfo.setActive(true);\n\t\t\tuserInfo.setAccessKey(payload.getAccessKey());\n\t\t\tuserInfoDao.saveUserInfo(userInfo);\n\t\t\t\n\t\t\treturn sessionId;\n\t\t} catch (CloudException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t\tthrow new HFModuleException(e1.getErrorCode(), e1.getMessage());\n\t\t}\n\t}",
"private void loginUser(String username, String password) {\n ParseUser.logInInBackground(username, password, new LogInCallback() {\n @Override\n public void done(ParseUser user, ParseException e) {\n if(e != null){\n Log.e(TAG, \"Issue with login: \"+e);\n Toast.makeText(LoginActivity.this, e+\"\", Toast.LENGTH_SHORT);\n return;\n }\n\n linkOneSignalID(ParseUser.getCurrentUser());\n goMainActivity();\n Toast.makeText(LoginActivity.this, \"Success!\", Toast.LENGTH_SHORT);\n }\n });\n }",
"private void byPassLogin(String email) {\n User user = new User(123, email, Grade.A, 100, 9999991, 50f, 25f);\n Login(user);\n }",
"public void loginAsTom() {\n textFieldUsername.withTimeoutOf(2000, MILLIS).type(\"tomsmith\");\n textFieldPassword.type(\"SuperSecretPassword!\");\n buttonLogin.click();\n }",
"public UserTo callLoginUser(UserTo userTo) throws ConnectException {\n\t\tif(Objects.isNull(userTo.getUsername()) || Objects.isNull(userTo.getPassword())) {\n\t\t\tSystem.out.println(\"Invalid login credentials.\");\n\t\t\treturn null;\n\t\t}\n\t\ttry {\n\t\t\tWebResource webResource = getJerseyClient(\"http://localhost:8080/useroptix/j_spring_security_check\");\n\t\t\tString postBodyStr = \"username=\" + userTo.getUsername() + \"&password=\"+userTo.getPassword();\n\t\t\tString respStr = webResource.type(MediaType.APPLICATION_FORM_URLENCODED ).post(String.class, postBodyStr);\n\t\t\tif(Objects.nonNull(respStr) && !respStr.isEmpty() && respStr.contains(\"token\")) {\n\t\t\t\t//response contains date values so need to provide the date formate.\n\t\t\t\tGson gson = new GsonBuilder().setDateFormat(\"yyyy-MM-dd\").create();\n\t\t\t\tType userLoginResults = new TypeToken<Map<String, String>>(){}.getType();\n\t\t\t\t// // Convert the data from the response JSON object\n\t\t\t\tMap<String, String> userLoginResultMap = gson.fromJson(respStr, userLoginResults);\n\t\t\t\tif(userLoginResultMap != null \n\t\t\t\t\t\t&& !userLoginResultMap.isEmpty() \n\t\t\t\t\t\t&& userLoginResultMap.containsKey(\"token\")) {\n\t\t\t\t\tuserTo.setToken(String.valueOf(userLoginResultMap.containsKey(\"token\")));\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\" ----->>> \" + userLoginResultMap.get(\"token\"));\n\t\t\t}\n\t\t} catch (UniformInterfaceException e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call LoginUser : (401 Unauthorized) \"+e.getMessage());\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Error in getting the response from REST call CreateUser : \"+e.getMessage());\n\t\t}\n\t\treturn userTo;\n\t}",
"@Override\r\n\tpublic int login(userData user) {\n\t\tString pwd = user.getUser_pwd();\r\n\t\tSystem.out.println(user.getUser_phone()+\" get \"+ pwd + \"key:\"+user.getKey()+\" phone:\"+user.getUser_phone());\r\n\t\tpwd = MD5.md5_salt(pwd);\r\n\t\tSystem.out.println(user.getUser_phone()+\" final: \"+ pwd);\r\n\t\tHashMap<String,String> t = new HashMap();\r\n\t\tt.put(\"key\", user.getKey());\r\n\t\tt.put(\"value\", user.getUser_phone());\r\n\t\tString phone = AES.decode(t);\r\n\t\tSystem.out.println(\"phone:\"+phone+\"final: \"+ pwd);\r\n\t\tList<user_table> res = this.userRespository.login(phone, pwd);\r\n\t\t\r\n\t\tif(res.size() == 1)\r\n\t\t{\r\n\t\t\tuser_table u = res.get(0);\r\n\t\t\tString identity = u.getIdentity();\r\n\t\t\ttry {\r\n\t\t\t\tif(identity.equals(\"S\")){\r\n\t\t\t\t\tSystem.out.println(\"检查学生信息完善?\");\r\n\t\t\t\t\tstudent_table st = this.student.findByPhone(u.getUserphone());\r\n\t\t\t\t\tif(st == null)\r\n\t\t\t\t\t\treturn 801;\r\n\t\t\t\t\treturn 400;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tSystem.out.println(\"检查老师信息完善?\");\r\n\t\t\t\t\tteacher_table tea = this.teacher.findByPhone(u.getUserphone());\r\n\t\t\t\t\tif(tea == null)\r\n\t\t\t\t\t\treturn 802;\r\n\t\t\t\t\treturn 500;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}catch(Exception e) {\r\n\t\t\t\tSystem.out.println(\"800\");\r\n\t\t\t\treturn 800;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}else {\r\n\t\t\treturn 401;\r\n\t\t}\r\n\t}",
"public boolean loginUser(String usernameToFind, String passwordToCheck) throws IOException {\n boolean success = client.login(usernameToFind, passwordToCheck);\n if (success == true) {\n user = client.getCurrentUser();\n client.updateCurrentUser();\n SwingUtilities.invokeLater(new ChatDriver(client));\n return true;\n }\n JOptionPane.showMessageDialog(null, \"Either username or password didn't match, \" +\n \"please try again!\", \"Errors\", JOptionPane.ERROR_MESSAGE);\n return false;\n }",
"boolean userLogin(UserDTO user) throws UserException, Exception;",
"@Override\r\n protected final String loginAsAutoUser(boolean launch) {\r\n \t//login(DDConstants.AUTO_USERNAME, DDConstants.AUTO_PASSWORD, launch);\r\n \tsuper.login(getAutoUserName(), getAutoPassword(), launch);\r\n\r\n \tchooseApp();\r\n\r\n \treturn getCurrentUser();\r\n }",
"Login(String strLogin)\n {\n \tsetLogin(strLogin);\n }",
"public void authenticateUser()\r\n\t{\r\n\t\tsc.nextLine(); \r\n\t\tint index=loginattempt();\r\n\t}",
"String login(String userName, String password) throws RemoteException, InterruptedException;",
"public static String LogIn(Messenger esql){\n try{\n System.out.print(\"\\tEnter user login: \");\n String login = in.readLine();\n System.out.print(\"\\tEnter user password: \");\n String password = in.readLine();\n\n String query = String.format(\"SELECT * FROM Usr WHERE login = '%s' AND password = '%s'\"\n , login, password);\n\n int userNum = esql.executeQuery(query);\n if (userNum > 0)\n return login;\n return null;\n }catch(Exception e){\n System.err.println (e.getMessage ());\n return null;\n }\n }",
"@Test\r\n\tpublic void login() {\n\t\tUser loginExit = userMapper.login(\"wangxin\", \"123456\");\r\n\t\tif (loginExit == null) {\r\n\t\t\tSystem.out.println(\"用户不存在\");\r\n\t\t} else {\r\n\t\t\tSystem.out.println(loginExit);\r\n\t\t\tSystem.out.println(\"登录成功!\");\r\n\t\t}\r\n\t}",
"@Override\n\tpublic boolean managerLogin(Context ctx) {\n\t\tString username = ctx.formParam(\"username\");\n\t\tString password = ctx.formParam(\"password\");\n\t\tboolean result = authService.managerLogIn(username, password);\n\t\treturn result;\n\t}",
"@Override\r\n\tpublic void login() {\n\t\t\r\n\t}",
"void onOnlineLoginSuccess(User user);",
"private void loginSuccess(String uname) {\n }",
"@Override\r\n\tpublic User login(User user) {\n\t\tif(user == null) {\r\n\t\t\tthrow new CMSException(\"用户名和密码不能为空\");\r\n\t\t}\r\n\t\tif(!StringUtil.hasText(user.getUsername())) {\r\n\t\t\tthrow new CMSException(\"用户名不能为空\");\r\n\t\t}\r\n\t\tif(!StringUtil.hasText(user.getPassword())) {\r\n\t\t\tthrow new CMSException(\"密码不能为空\");\r\n\t\t}\r\n\t\tUser u = um.login(user.getUsername());\r\n\t\tif(u == null) {\r\n\t\t\tthrow new CMSException(\"当前用户不存在\");\r\n\t\t}\r\n\t\tif(u.getLocked() == 1) {\r\n\t\t\tthrow new CMSException(\"当前用户已被禁用\");\r\n\t\t}\r\n\t\t//if(u.getPassword().equals(Md5Util.md5Encoding(user.getPassword()))) {少了一个非数据库是明码这里是暗码\r\n\t\tif(!u.getPassword().equals(Md5Util.md5Encoding(user.getPassword()))) {\r\n\t\t\tthrow new CMSException(\"密码不正确\");\r\n\t\t}else {\r\n\t\t\tSystem.out.println(u.getPassword()+\"=====\"+user.getPassword());\r\n\t\t}\r\n\t\treturn u;\r\n\t}",
"private void loginUser() throws JSONException, UnsupportedEncodingException {\n JSONObject jsonObject = new JSONObject();\n jsonObject.put(\"username\", editUserName.getText().toString());\n jsonObject.put(\"password\", editPassword.getText().toString());\n jsonObject.put(\"DeviceID\", diviceToken);\n jsonObject.put(\"DevicePlatform\", devicePlatform);\n invokeLogin(jsonObject);\n\n\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"999999\");\n }",
"public AdbLoginResponse loginScoinFromAdb(AdbLoginScoinRequest adbLoginScoinRequest);",
"User loginUser(User userLoginRequest, HttpSession httpSession) throws Exception;",
"@Override\n public void onClick(View v) {\n loginUser(\"222222\");\n }",
"void loginAttempt(String email, String password);",
"@Override\n public void onClick(View v) {\n loginUser(\"111111\");\n }",
"public void loginUser(final BusinessUserDetail user, final int widgetToLoad) {\n\n final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, getSpringLoginUrl());\n rb.setHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n final StringBuilder sbParams = new StringBuilder(100);\n sbParams.append(\"j_username=\");\n sbParams.append(URL.encode(user.getEmail()));\n sbParams.append(\"&j_password=\");\n sbParams.append(URL.encode(user.getPassword()));\n\n try {\n rb.sendRequest(sbParams.toString(), new RequestCallback() {\n @Override\n public void onError(final Request request, final Throwable exception) {\n // Couldn't connect to server (could be timeout, SOP violation, etc.)\n LOGGER.severe(\"Server part (poptavka-core) doesn't respond during user logging, exception=\"\n + exception.getMessage());\n eventBus.setErrorMessage(Storage.MSGS.loginUnknownError());\n }\n\n @Override\n public void onResponseReceived(final Request request, final Response response) {\n eventBus.setLoadingProgress(50, Storage.MSGS.loggingLoadProfile());\n int status = response.getStatusCode();\n LOGGER.fine(\"Response status code = \" + status);\n if (status == Response.SC_OK) {\n LOGGER.info(\"User=\" + user.getEmail() + \" has logged in!\");\n // notify all interested components that user has succesfully logged in\n fireAfterLoginEvent(widgetToLoad);\n } else if (status == Response.SC_UNAUTHORIZED) {\n LOGGER.fine(\"User entered wrong credentials !\");\n eventBus.setErrorMessage(Storage.MSGS.wrongLoginMessage());\n } else {\n // other status codes can be processed here\n LOGGER.severe(\"Unexptected response status code while logging in, code=\" + status);\n eventBus.setErrorMessage(Storage.MSGS.loginUnknownError());\n }\n }\n });\n\n } catch (RequestException exception) {\n LOGGER.severe(\"RequestException thrown during user logging, exception=\" + exception.getMessage());\n eventBus.setErrorMessage(Storage.MSGS.loginUnknownError());\n }\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"888888\");\n }",
"public static opCode loginUser()\n {\n opCode answerCode;\n\n clientSocketChannel = openConnection(Utils.CLIENT_PORT);\n\n if(clientSocketChannel == null)\n answerCode = opCode.OP_FAIL;\n else\n {\n //effettuo la richiesta di login\n Operation request = new Operation(username);\n request.setPassword(password);\n request.setCode(opCode.LOGIN);\n\n sendReq(clientSocketChannel,request);\n answerCode = getAnswer();\n\n //se il login è andato a buon fine, inizializzo il thread per ricevere gli inviti\n if(answerCode == opCode.OP_OK)\n {\n // apro un nuovo socket per ricevere gli inviti\n inviteSocketChannel = openConnection(Utils.CLIENT_PORT);\n if(inviteSocketChannel == null)\n {\n //in caso di errore chiudo tutte le socket\n try {clientSocketChannel.close();}\n catch (IOException e) {e.printStackTrace();}\n return opCode.OP_FAIL;\n }\n\n request.setCode(opCode.SET_INVITATION_SOCK);\n sendReq(inviteSocketChannel, request);\n\n //creo il thread per la ricezione degli inviti\n inviteThread = new Thread(new InviteTask(inviteSocketChannel));\n inviteThread.start();\n\n //richiedo e scarico la lista di eventuali inviti ricevuti mentre ero offline\n request.setCode(opCode.PENDING_INVITATIONS);\n sendReq(clientSocketChannel,request);\n\n try\n {\n pendingInvitations = (ArrayList<Message>) Utils.recvObject(clientSocketChannel);\n\n if(pendingInvitations == null)\n throw new NullPointerException();\n\n //esito dell'operazione di login\n answerCode = getAnswer();\n }\n catch(ClassNotFoundException | IOException | NullPointerException e)\n {\n System.err.println(\"Error in downloading pending invites\");\n answerCode = opCode.OP_FAIL;\n }\n }\n }\n return answerCode;\n }",
"public static int logIn(String userName, String password, String token) throws ClassNotFoundException, SQLException { \n String[] name = {userName};\n String[] pk = {userPK};\n List<user> tempU = selectUser(pk, name);\n if(tempU.isEmpty()) {\n return -2;\n }\n else if(tempU.get(0).getPassWord().equals(encytp(password))) {\n String[] temp = {token, userName};\n String[] restriction = {VERTIFY};\n updateUser(restriction, temp);\n return 0;\n }\n else {\n return -1;\n }\n }",
"public void doLogin(String user, String pass) {\n\t\trefgservice.checkUserPassword(user, pass, new LoginCallback());\n\t\t\n\t}",
"public void login() {\n if (!areFull()) {\n return;\n }\n\n // Get the user login info\n loginInfo = getDBQuery(nameField.getText());\n if (loginInfo.equals(\"\")) {\n return;\n }\n\n // Get password and check if the entered password is true\n infoArray = loginInfo.split(\" \");\n String password = infoArray[1];\n if (!passField.getText().equals(password)) {\n errorLabel.setText(\"Wrong Password!\");\n return;\n }\n\n continueToNextPage();\n }",
"public boolean login(){\r\n try{\r\n DbManager0 db = DbManager0.getInstance();\r\n Query q = db.createQuery(\"SELECT * FROM user WHERE username = '\"+this.login+\"' and password = '\"+this.pwd+\"';\");\r\n QueryResult rs = db.execute(q);\r\n rs.next();\r\n if(rs.wasNull()) return false;\r\n this.id = rs.getInt(\"id\")+\"\";\r\n return true;\r\n }\r\n catch(SQLException ex){\r\n throw new RuntimeException( ex.getMessage(), ex );\r\n }\r\n }",
"@Override\n\tpublic Lt_User login(Lt_User user) throws Lt_Blog_Exception {\n\t\tConnection con = DBUtil.getConnection();\n\t\tPreparedStatement state = null; \n\t\tResultSet rs = null;\n\t\tString sql = \"select type from lt_user where username=? and password = ?\";\n\t\ttry {\n\t\t\tstate = con.prepareStatement(sql);\n\t\t\tstate.setString(1, user.getUsername());\n\t\t\tstate.setString(2, user.getPasword());\n\t\t\trs = state.executeQuery();\n\t\t\tboolean hasRs = rs.next();\n\t\t\t\n\t\t\tif(!hasRs)\n\t\t\t\treturn null;\n\t\t\tuser.setType(rs.getInt(1));\n\t\t\treturn user;\n\t\t} catch (SQLException e) {\n\t\t\tLt_Blog_Exception be = new Lt_Blog_Exception();\n\t\t\tbe.code = Lt_Blog_Exception.LOGIN_ERROR;\n\t\t\tbe.description = \"登录内部错误;\";\n\t\t\t\n\t\t\tthrow be;\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\ttry {\n\t\t\t\tstate.close();;\n\t\t\t\tif(rs!=null)\n\t\t\t\t\trs.close();\n\t\t\t\tcon.close();\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\tLt_Blog_Exception be = new Lt_Blog_Exception();\n\t\t\t\tbe.code = Lt_Blog_Exception.LOGIN_ERROR;\n\t\t\t\tbe.description = \"登录内部错误;\";\n\t\t\t\t\n\t\t\t\tthrow be;\n\t\t\t}\n\t\t}\n\t}",
"boolean checkUserCorrispondenceLogin(String emailLogin, String passwordLogin);",
"@Override\r\n\tpublic void loginSuccess(String userName, String psd) {\n\t\tet_username_logon.setText(\"\" + userName);\r\n\t\tet_password_logon.setText(\"\");\r\n\t\tmyLogon.setString(userName, psd);\r\n\t\tmyLogon.logon();\r\n\t}",
"@Override\r\n\tpublic User login(String username,String pwd) {\n\t\tString sql=\"select uid,upass from user where uid=? and upass=?\";\r\n\t\tDBHelp hp=new DBHelp();\r\n\t\tUser us=null;\r\n\t\ttry {\r\n\t\t\tResultSet rs=hp.select(sql, username,pwd);\r\n\t\t\twhile(rs.next()){\r\n\t\t\t\t us=new User(rs.getString(\"uid\"),rs.getString(\"upass\"));\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\treturn us;\r\n\t}",
"public void login () {\n\t\tGPPSignIn.sharedInstance().authenticate();\n\t}",
"private void Login(User user) {\n // instantiate User Database to store User's details locally\n UserDB db = new UserDB(this);\n db.resetTables(); // clear previous table data\n db.addUser(user);\n Log.i(TAG, \"Logged in as \" + email);\n\n // Move to main activity\n startActivity(new Intent(this, MainActivity.class));\n finish();\n }",
"@Override\n\tpublic int checkLogin(User user) {\n\t\tint msg=0;\n\t\ttry{\n\t\t\tUser user2=uDao.loginUser(user.getUsername().toString());\n\t\t\tString pwd=getEncodTool.decodeHexTest(user2.getPassword());\n\t\t\tif(pwd.equals(user.getPassword())){\n\t\t\tmsg=1;\n\t\t\t}else{\n\t\t\t\tmsg=3;\t\n\t\t\t}\n\t\t}catch(NullPointerException e){\n\t\t\tmsg=2;\n\t\t}\t\n\t\treturn msg;\n\t}",
"@Override\n\tpublic SpaceUserVO login(SpaceUserVO spaceUserVO) throws Exception {\n\t\treturn null;\n\t}",
"LoginContext login(String username, String password) throws LoginException;",
"public Integer logIn(String u_name, String u_pw){\n //find entry with u_name = this.u_name\n //probably not so safe\n //getting user with index 0 because getUserFromUsername returns List\n User user = userDao.getUserFromUsername(u_name).get(0);\n //print at console\n LOGGER.info(\"User: \" + user);\n //returns integer 1 if user.get_pw equals to this.pw or 0 if not\n if (user.getU_Pw().equals(u_pw)){\n return user.getU_Id();\n }else{\n return 0;\n }\n }",
"private void logIn() {\n char[] password = jPasswordField1.getPassword();\n String userCode = jTextField1.getText();\n\n String txtpassword = \"\";\n for (char pw : password) {\n txtpassword += pw;\n }\n if (\"\".equals(txtpassword)) {\n JOptionPane.showMessageDialog(this, textBundle.getTextBundle().getString(\"enterPassword\"), \"No Password\", JOptionPane.WARNING_MESSAGE);\n } else if (txtpassword.equals(userData.get(0).toString())) {\n jPasswordField2.setEnabled(true);\n jPasswordField3.setEnabled(true);\n jPasswordField2.setEditable(true);\n jPasswordField3.setEditable(true);\n jPasswordField2.grabFocus();\n }\n }",
"@Override\r\n\tpublic Login loginUser(Login user) {\n\t\treturn dao.loginUser(user);\r\n\t}",
"public String login() {\n try {\n HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();\n request.login(name, password);\n initUser();\n request.getSession().setAttribute(\"current_user\", this);\n return \"/index?faces-redirect=true\";\n } catch (ServletException e) {\n FacesContext context = FacesContext.getCurrentInstance();\n FacesMessage message = new FacesMessage(\"Wrong login or password\");\n message.setSeverity(FacesMessage.SEVERITY_ERROR);\n context.addMessage(\"login\", message);\n }\n return \"/pages/login.xhtml\";\n }",
"public ToLAuthenticator(String user, String pw) {\n username = user;\n password = pw;\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"444444\");\n }",
"public static boolean login(Context ctx) {\n\t\t\n\t\tString username = ctx.formParam(\"username\");\n\t\tString password = ctx.formParam(\"password\");\n\t\t\n\t\tSystem.out.println(username);\n\t\tSystem.out.println(password);\n\t\t\n\t\tif(username.equals(\"user\") && password.equals(\"pass\")) {\n\t\t\tctx.res.setStatus(204);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"McBobby\",true));\n\t\t\treturn true;\n\t\t}else {\n\t\t\t\n\t\t\tctx.res.setStatus(400);\n\t\t\tctx.sessionAttribute(\"user\", new User(\"fake\",false));\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\n//\t\tctx.queryParam(password); /authenticate?password=value\n//\t\tctx.pathParam(password); /authenticate/{password}\n\t}",
"private boolean requestUserLogin() {\n\t\tServerAPITask userTasks = new ServerAPITask();\n\t\tString uName = usernameField.getText().toString();\n\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/lookup/\" + uName);\n\t\ttry {\n\t\t\tString response = userTasks.execute(\"\").get();\n\t\t\tLog.e(\"Response String\", response);\n\t\t\t\n\t\t\tjsonResponse = new JSONArray(response);\n\t\t\tif (jsonResponse.length() < 1) {\n\t\t\t\tToast.makeText(this.getContext(), \"The username does not exist\", Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tJSONObject jsObj = jsonResponse.getJSONObject(0);\n\t\t\t\tif (jsObj == null) {\n\t\t\t\t\tToast.makeText(this.getContext(), \"An error occurred while retrieving user\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tString _user_id = jsObj.getString(\"_id\");\n\t\t\t\t\tPreferencesUtil.saveToPrefs(userContext, PreferencesUtil.PREFS_LOGIN_USER_ID_KEY, _user_id);\n\t\t\t\t\t\n\t\t\t\t\tPreferencesUtil.saveToPrefs(userContext, PreferencesUtil.PREFS_LOGIN_USERNAME_KEY, uName);\n\t\t\t\t\t((Activity) userContext).getActionBar().setTitle(\"Stone - \" + uName);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t\t\n\t\treturn true;\n\t}",
"public String login() {\r\n FacesContext context = FacesContext.getCurrentInstance();\r\n HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();\r\n System.out.println(\"Username: \" + email);\r\n System.out.println(\"Password: \" + password);\r\n try {\r\n //this method will actually check in the realm for the provided credentials\r\n request.login(this.email, this.password);\r\n\r\n } catch (ServletException e) {\r\n context.addMessage(null, new FacesMessage(\"Login failed.\"));\r\n return \"error\";\r\n }\r\n return \"/faces/users/index.xhtml\";\r\n }",
"@Override\n public void onClick(View v) {\n loginUser(\"666666\");\n }",
"UserToken login(String username, String password) throws WorkspaceException;",
"public User loginUserExternal(UserAccount ua, Map params) throws MultipleLoginException {\r\n\t\tLogManager.getLogger().info( \"Sessions before login: \" + appSessionRepository.count() );\r\n\t\tLogManager.getLogger().info( \"Locks before login: \" + appLockRepository.count() );\r\n\r\n\t\tAppSession is = appSessionRepository.find( ua.getUserCode() );\r\n\t\tDate currentLastLogin = null;\r\n\t\tif ( is == null ) {\r\n\t\t\tappSessionRepository.create((String)params.getOrDefault(\"address\", null), ua.getUserCode());\r\n\t\t\tcurrentLastLogin = ua.getLastlogin();\r\n\t\t\tua.setLastlogin( new Date() );\r\n\t\t\tua.setRealLastlogin(currentLastLogin); // so UI knows the actual last login\r\n\t\t\tuserAccountRepository.persist( ua );\r\n\t\t} else {\r\n\t\t\tdhh.logLogin(ua.getUsername(), \"ALREADY_LOGGED_IN\", params);\r\n\t\t\tthrow new MultipleLoginException();\r\n\t\t}\r\n\t\tdhh.logLogin(ua.getUsername(), \"AUTHENTICATION_SUCCEEDED\", params);\r\n\t\tUser u = ua.getUser();\r\n\t\treturn u;\r\n\t}",
"private void authenticate(String user, String pass) {\n }",
"public Person login(String username, String password);"
] | [
"0.68541455",
"0.6832042",
"0.67606604",
"0.65983325",
"0.6594464",
"0.65775025",
"0.64992034",
"0.648764",
"0.6485296",
"0.64527416",
"0.6437876",
"0.6417855",
"0.64102817",
"0.63875675",
"0.63813597",
"0.6343215",
"0.6340959",
"0.6326263",
"0.6305645",
"0.62972474",
"0.62876785",
"0.62760246",
"0.62713796",
"0.6270055",
"0.6260143",
"0.62170124",
"0.62079686",
"0.62043256",
"0.6203548",
"0.6202068",
"0.61844766",
"0.61647063",
"0.6133785",
"0.6122899",
"0.6116114",
"0.61158407",
"0.6109364",
"0.61083466",
"0.60926193",
"0.6085319",
"0.6083814",
"0.60823137",
"0.60798025",
"0.606704",
"0.60616",
"0.6057545",
"0.6056828",
"0.60527307",
"0.60505676",
"0.60486543",
"0.6048199",
"0.60365844",
"0.60365075",
"0.6033226",
"0.6018452",
"0.6015618",
"0.5995266",
"0.59941006",
"0.59915125",
"0.59885114",
"0.5988359",
"0.5986245",
"0.5985657",
"0.598551",
"0.5980079",
"0.5970377",
"0.5969575",
"0.5966076",
"0.596401",
"0.59605294",
"0.59584963",
"0.595692",
"0.5953426",
"0.59483063",
"0.59464246",
"0.59434456",
"0.59425014",
"0.5942274",
"0.59367967",
"0.5936119",
"0.59351116",
"0.5934618",
"0.59313864",
"0.5930085",
"0.5929829",
"0.5929596",
"0.59289014",
"0.5925183",
"0.5923346",
"0.59229165",
"0.592176",
"0.59217",
"0.59214574",
"0.5917999",
"0.59128946",
"0.5912646",
"0.5904877",
"0.59029174",
"0.5900289",
"0.58988154",
"0.5895918"
] | 0.0 | -1 |
Handles a request (login, invoke) | @Override
public void processRequest(HttpRequest request, HttpResponse response) throws Exception {
response.setHeaderField( "Server-Name", "Las2peer 0.1" );
response.setContentType( "text/xml" );
if(authenticate(request,response))
if(invoke(request,response));
//logout(_currentUserId);
//connector.logMessage(request.toString());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void userLogin(HttpServletRequest request, HttpServletResponse response) {\n\t\t\n\t}",
"RequestResult loginRequest() throws Exception;",
"@Override\n public JsonResponse duringAuthentication(String... params) {\n try {\n final String username = params[0];\n final String password = params[1];\n return RequestHandler.authenticate(this.getApplicationContext(), username, password);\n } catch (IOException e) {\n return null;\n }\n }",
"void handleRequest();",
"@Override\n\t\t\tpublic void handle(Request req, Response res) throws Exception {\n\t\t\t\tfinal String op = req.params(\":op\");\n\t\t\t\tfinal String username = req.queryParams(\"user\");\n\t\t\t\tfinal String path = req.queryParams(\"path\");\n\t\t\t\t\n\t\t\t\t//--- framework access ---//\n\t\t\t\tif (!Results.hasFrameworkAccess(op, path)) halt(404);\n\t\t\t\t//--- path exists? ---//\n\t\t\t\tif (!Directories.isExist(path)) halt(404);\n\t\t\t\t//--- section and path access ---//\n\t\t\t\tif (!AccessManager.hasAccess(username, path)) halt(401);\n\n\t\t\t}",
"@Override\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) {\n\n\t\tString id = request.getParameter(\"id\");\n\t\tString pw = request.getParameter(\"pw\");\n\n\t\tMemberDao dao = MemberDao.getInstance();\n\t\tint checkNum = dao.login(id, pw);\n\n\t\trequest.setAttribute(\"checkNum\", checkNum);\n\t\trequest.setAttribute(\"id\", id);\n\t\trequest.setAttribute(\"pw\", pw);\n\n\t}",
"public void authenticate(LoginRequest loginRequest) {\n\n }",
"private void handleLogin() {\n // Get the values from the inputs\n final String username = this.mUsernameInput.getText().toString();\n final String password = this.mPasswordInput.getText().toString();\n // Make sure the username and password EditTexts are not empty\n if (this.isValid(username, password)) {\n // Authenticate the user credentials on the background thread\n AuthenticationTask authenticationTask = new AuthenticationTask(this);\n // Retain the AsyncTask in the RetainedTaskFragment\n this.mAuthenticationTaskFragment.setTask(authenticationTask);\n // Execute\n authenticationTask.execute(username, password);\n }\n }",
"private void loginHandler(RoutingContext context) {\n JsonObject creds = new JsonObject()\n .put(\"username\", context.getBodyAsJson().getString(\"username\"))\n .put(\"password\", context.getBodyAsJson().getString(\"password\"));\n\n // TODO : Authentication\n context.response().setStatusCode(500).end();\n }",
"public void loginRequest(View view){\n\n callLoginServlet();\n }",
"Object handle(Object request);",
"public void handleRequest(String request) throws IOException {\n\n String method = getMethod(request);\n\n this.uri = ToolBox.getUri(request);\n this.url = ToolBox.getUrl(uri);\n this.extension = ToolBox.getExtension(url);\n\n System.out.println(\"method :\" + method);\n switch (method) {\n case \"GET\":\n doGet();\n break;\n case \"POST\":\n doPost();\n break;\n case \"HEAD\":\n doHead();\n break;\n case \"PUT\":\n doPut();\n break;\n case \"DELETE\":\n doDelete();\n break;\n default:\n statusCode = BAD_REQUEST;\n this.sendHeader(statusCode, \"text/html\", null);\n break;\n }\n this.out.flush();\n this.out.close();\n }",
"public LoginResponse login(LoginRequest request, String urlPath) throws IOException, TweeterRemoteException {\n LoginResponse response = clientCommunicator.doPost(urlPath, request, null, LoginResponse.class);\n if(response.isSuccess()) {\n return response;\n } else {\n throw new RuntimeException(response.getMessage());\n }\n }",
"public void handlePost( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n // the web client wants to submit a log in request\n case \"/log-in\":\n // get the body of the HttpExchange\n String body = getBody(exchange);\n print(\"BODY: \\n\" + body);\n if ( body.equals(\"-1\") == true) { // if the body is empty\n sendResponse(exchange, new byte[0], 204);\n // HTTP Response code 204 - no content\n } else {\n\n String[] content = body.split(\"&\");\n //pos 0 : username=<content>; pos 1 : password=<content>; pos 2 : <submit type>\n\n String username = content[0].split(\"=\")[1];\n String password = content[1].split(\"=\")[1];\n\n //check database\n if( username.equals(\"james\") && password.equals(\"123\")) {\n print(\"Username and Password Match\");\n sendResponse(exchange, getHTMLPage(\"/home.html\"), 200); // this will be changed to a redirect notice\n // set client as logged in\n logged_in = true;\n\n// sendResponse(exchange, getPanel(exchange, \"home.html\"), 200);\n } else {\n sendResponse(exchange, new byte[0], 406);\n // send HTTP Response code 406 - Not acceptable\n }\n }\n\n break;\n case \"/home\":\n\n default:\n print(\"Body:\");\n print( getBody(exchange) );\n sendResponse(exchange, htmlBuilder( \"Not Implemented\", \"Http Error 501: Not Implemented\").getBytes(), 501);\n break;\n }\n // got body response .. check form sending to - if form is login then get username and password combo\n }",
"public void handleLogin() {\n\t\tString username = usernameInput.getText();\n\t\tString password = passwordInput.getText();\n\n\t\t// Saves username and password if remember me is ticked\n\t\t// otherwise it deletes the file.\n\t\tif (rememberMeCheckbox.isSelected()) {\n\t\t\twriteRememberMe(username, password);\n\t\t} else {\n\t\t\tclearRememberMe();\n\t\t}\n\n\n\t\ttryUsernamePassword(username, password);\n\t}",
"public abstract void login(\r\n com.google.protobuf.RpcController controller,\r\n PbDemoProto.Login_C2S request,\r\n com.google.protobuf.RpcCallback<PbDemoProto.Login_S2C> done);",
"protected void doPostLogin(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tout.println(\"Look where we are, it's the login page\");\n\t\t\n\t\t//get parameter Names\n\t\tsetParameters(request);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tKeyspace keyspace = Connection.getKeyspace();\n\t\tStringSerializer se = StringSerializer.get();\n\t\t\n\t\ttry\n\t\t{\n\t\t\t// given Keyspace keyspace and StringSerializer se\n\t\t\tSliceQuery<String, String, String> q = HFactory.createSliceQuery(keyspace, se, se, se);\n\t\t\tq.setColumnFamily(\"Users\") .setKey(displayName).setColumnNames(\"fullname\", \"email\", \"password\");\n\t\t\tQueryResult<ColumnSlice<String, String>> r = q.execute();\n\n\t\t\tfullname = r.get().getColumnByName(\"fullname\").getValue();\n\t\t\temail = r.get().getColumnByName(\"email\").getValue();\n\n\t\t\tif(password.equals(r.get().getColumnByName(\"password\").getValue()))\n\t\t\t{\n\t\t\t\t//LOGGED IN CORRECTLY\n\t\t\t\t\n\t\t\t\tmySexySession.setAttribute(\"displayName\", displayName);\n\t\t\t\tmySexySession.setAttribute(\"fullname\", fullname);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmySexySession.setAttribute(\"message\", \"Incorrect Password.\");\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t//catches happen when the key is not found (i.e. user doesn't exist)\n\t\t\tmySexySession.setAttribute(\"message\", \"User does not exist.\");\n\t\t}\n\t\tresponse.sendRedirect(\"/quotes/home\");\n\t}",
"public void doLogin() {\n\t\tSystem.out.println(\"loginpage ----dologin\");\n\t\t\n\t}",
"public Message handleLogin(Message loginRequest){\n String userNameRequested = loginRequest.getUserName();\n String passWordRequested = loginRequest.getPassWord();\n\n Message badResult = new Message(Message.LOGIN_ERROR);\n\n // case: non registered user\n if(!controlServer.containsUserKey(userNameRequested)){\n return badResult;\n }\n\n // case: registered user\n UserData userData = controlServer.getUserData(userNameRequested);\n\n // compare userName & passWord with the ones in the user register\n if(userData.getPassWord().equals(passWordRequested)){\n Message goodResult = new Message(Message.LOGIN_OK);\n goodResult.setUserData(userData);\n controlServer.showMessage(\"user '\" + userData.getUserName() + \"' just logged in \\n\");\n return goodResult;\n }\n return badResult;\n }",
"public LoginResponse login(LoginRequest request) throws IOException {\n ClientCommunicator loginCommunicator = new ClientCommunicator(new LoginStrategy());\n\n return (LoginResponse) loginCommunicator.doWebRequest(request, null);\n }",
"@Override\n String execute(HttpServletRequest request, HttpServletResponse response) throws LegohusException {\n String email = request.getParameter(\"email\");\n String password = request.getParameter(\"password\");\n User user = LogicFacade.login(email, password);\n HttpSession session = request.getSession();\n session.setAttribute(\"user\", user);\n \n return \"WEB-INF/\" + user.getRole() + \"page\";\n }",
"public abstract void login(\r\n com.google.protobuf.RpcController controller,\r\n PbDemoProto.Login_C2S request,\r\n com.google.protobuf.RpcCallback<PbDemoProto.Login_S2C> done);",
"@Override\n\tpublic void sendLogin() {\n\t\t// TODO Auto-generated method stub\n\t\ttry{\n\t\t\tString result = \"\";\n\t\t\tif (this.servType.equals(SERVICE_TYPE_SOAP)){\n\t\t\t\tresult = server.login();\n\t\t\t} else {\n\t\t\t\tWebResource loginService = service.path(URI_LOGIN);\n\t\t\t\tresult = loginService.accept(MediaType.TEXT_PLAIN).get(String.class);\n\t\t\t}\n\t\t\t//get the clientId\n\t\t\tclientId = Integer.parseInt(result);\n\t\t\t//set the status\n\t\t\tgui.setStatus(\"Successfully logged in! Obtained client ID: \"+clientId+\" from server!\");\n\t\t\t//immediately send the request for the list of items\n\t\t\tsendItemListRequest();\n\t\t} catch (ClientHandlerException ex){\n\t\t\t//exceptions for REST service\n\t\t\tex.printStackTrace();\n\t\t\tsetOKDialog(\"Error\", \"The RESTFul server is not responding!! Closing application...\");\n\t\t\tSystem.exit(0);\n\t\t} catch (WebServiceException ex){\n\t\t\t//exceptions for SOAP-RPC service\n\t\t\tex.printStackTrace();\n\t\t\tsetOKDialog(\"Error\", \"The SOAP-RPC server is not responding!! Closing application...\");\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"@Override\r\n\tpublic boolean handleEvent(Event e) {\n\t\tConnection connection = (Connection) e.get(\"connection\");\r\n\t\tClient client = (Client) connection.getService();\r\n\t\tclient.clientTimeout.interrupt();\r\n\t\tString response = (String) e.get(\"response\");\r\n\r\n\t\tswitch (response) {\r\n\t\tcase \"blank_user\":\r\n\t\t\tService.logInfo(\"Please enter a username\");\r\n\t\t\tbreak;\r\n\t\tcase \"login_success\":\r\n\t\t\tclient.setPerson((Voter) e.get(\"person\"));\r\n\t\t\tclient.setCandidates((ArrayList<Candidate>) e.get(\"candidates\"));\r\n\t\t\tclient.vote();\r\n\t\t\tbreak;\r\n\t\tcase \"incorrect_password\":\r\n\t\t\tService.logInfo(\"Bad password\");\r\n\t\t\tbreak;\r\n\t\tcase \"registered_user\":\r\n\t\t\tService.logInfo(\"registered with server.\");\r\n\t\t\tbreak;\r\n\t\tcase \"user_unregistered\":\r\n\t\t\tService.logInfo(\"Please register with server.\");\r\n\t\t\tclient.enableReg();\r\n\t\t\tbreak;\r\n\t\tcase \"already_voted\":\r\n\t\t\tService.logInfo(\"You have already voted.\");\r\n\t\t\tbreak;\n\t\tcase \"district_mismatch\":\r\n\t\t\tService.logInfo(\"Attempt to log into incorrect district\");\r\n\t\t\tbreak;\n\t\tcase \"election_not_started\":\r\n\t\t\tService.logInfo(\"Election has not started\");\r\n\t\t\tbreak;\r\n\t\tcase \"election_ended\":\r\n\t\t\tService.logInfo(\"Election has ended\");\r\n\t\t\tbreak;\t\n\t\tdefault:\r\n\t\t\tService.logWarn(\"Unknown Login Response: \" + response);\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"private boolean authenticate (HttpRequest request, HttpResponse response) throws UnsupportedEncodingException\n\t{\n\t\tString[] requestSplit=request.getPath().split(\"/\",3);\n\t\tif(requestSplit.length<2)\n\t\t\treturn false;\n\t\tString serviceName=requestSplit[1];\n\t\tfinal int BASIC_PREFIX_LENGTH=\"BASIC \".length();\n\t\tString userPass=\"\";\n\t\tString username=\"\";\n\t\tString password=\"\";\n\t\t\n\t\t//Check for authentication information in header\n\t\tif(request.hasHeaderField(AUTHENTICATION_FIELD)\n\t\t\t\t&&(request.getHeaderField(AUTHENTICATION_FIELD).length()>BASIC_PREFIX_LENGTH))\n\t\t{\n\t\t\tuserPass=request.getHeaderField(AUTHENTICATION_FIELD).substring(BASIC_PREFIX_LENGTH);\n\t\t\tuserPass=new String(Base64.decode(userPass), \"UTF-8\");\n\t\t\tint separatorPos=userPass.indexOf(':');\n\t\t\t//get username and password\n\t\t\tusername=userPass.substring(0,separatorPos);\n\t\t\tpassword=userPass.substring(separatorPos+1);\n\t\t\t\n\t\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t\n\t\t\t\tlong userId;\n\t\t\t\tAgent userAgent;\n\t\t\t\t\n\t\t\t\tif ( username.matches (\"-?[0-9].*\") ) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tuserId = Long.valueOf(username);\n\t\t\t\t\t} catch ( NumberFormatException e ) {\n\t\t\t\t\t\tthrow new L2pSecurityException (\"The given user does not contain a valid agent id!\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tuserId = l2pNode.getAgentIdForLogin(username);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tuserAgent = l2pNode.getAgent(userId);\n\t\t\t\t\n\t\t\t\tif ( ! (userAgent instanceof PassphraseAgent ))\n\t\t\t\t\tthrow new L2pSecurityException (\"Agent is not passphrase protected!\");\n\t\t\t\t((PassphraseAgent)userAgent).unlockPrivateKey(password);\n\t\t\t\t_currentUserId=userId;\n\t\t\t\t\n\t\t\t\tif(!_userSessions.containsKey(userId))//if user not registered\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\tMediator mediator = l2pNode.getOrRegisterLocalMediator(userAgent);\n\t\t\t\t\t_userSessions.put(userId, new UserSession(mediator));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_userSessions.get(userId).updateServiceTime(serviceName,new Date().getTime());//update last access time for service\n\t\t\t\t\n\t\t\t\tconnector.logMessage(\"Login: \"+username);\n\t\t\t\tconnector.logMessage(\"Sessions: \"+Integer.toString(_userSessions.size()));\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t}catch (AgentNotKnownException e) {\n\t\t\t\tsendUnauthorizedResponse(response, null, request.getRemoteAddress() + \": login denied for user \" + username);\n\t\t\t} catch (L2pSecurityException e) {\n\t\t\t\tsendUnauthorizedResponse( response, null, request.getRemoteAddress() + \": unauth access - prob. login problems\");\n\t\t\t} catch (Exception e) {\n\t\t\t\t\n\t\t\t\tsendInternalErrorResponse(\n\t\t\t\t\t\tresponse, \n\t\t\t\t\t\t\"The server was unable to process your request because of an internal exception!\", \n\t\t\t\t\t\t\"Exception in processing create session request: \" + e);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tresponse.setStatus ( HttpResponse.STATUS_BAD_REQUEST );\n\t\t\tresponse.setContentType( \"text/plain\" );\n\t\t\tresponse.print ( \"No authentication provided!\" );\n\t\t\tconnector.logError( \"No authentication provided!\" );\n\t\t}\n\t\treturn false;\n\t}",
"private Object authenticate(Invocation invocation, HttpServletRequest request,\r\n HttpServletResponse response) throws IOException {\r\n\r\n Object[] args = invocation.getArgs();\r\n if (args.length != 2) {\r\n throw new RuntimeException(\"The authenticate call must have two arguments\");\r\n }\r\n\r\n String user = (String) args[0];\r\n String password = (String) args[1];\r\n\r\n //We can make the remote call\r\n Object result = invoke(invocation);\r\n\r\n //If the authentification failed we finish the execution\r\n if (result instanceof LoginContext) {\r\n LoginContext loginContext = (LoginContext) result;\r\n if (loginContext == null) {\r\n throw new RuntimeException(\"Login failed!!\");\r\n }\r\n \r\n HttpSession session = request.getSession(false);\r\n String sessionId = session.getId();\r\n response.addHeader(\"jsessionid\", sessionId);\r\n\r\n \r\n session.setAttribute(User.USER_KEY, loginContext.getUser());\r\n\r\n session.setAttribute(RhSessionContext.CLIENT_ID, loginContext.getClient_id());\r\n session.setAttribute(RhSessionContext.ORG_ID, loginContext.getOrg_id());\r\n session.setAttribute(RhSessionContext.DUTY_ID, loginContext.getDutyId());\r\n\r\n Map attrs = loginContext.getAttributes();\r\n Set<Map.Entry> entries = attrs.entrySet();\r\n for (Map.Entry entry : entries) {\r\n session.setAttribute((String) entry.getKey(), entry.getValue());\r\n }\r\n\r\n // 创建login session\r\n LoginSession loginSession = new LoginSession();\r\n loginSession.setLoginName(loginContext.getUser().getUsername());\r\n loginSession.setIp(request.getRemoteHost());\r\n loginSession.setLoginDate(new Date(session.getCreationTime()));\r\n loginSession.setSessionId(session.getId());\r\n loginSession.setLiving(true);\r\n\r\n //Session hibernateSession = RhinoCtx.instance().getHibernate().getSession();\r\n try {\r\n \r\n ServiceBase serviceBase = (ServiceBase) ServiceFactory.getService(ServiceBase.NAME);\r\n //ServiceBase serviceBase = (ServiceBase) RhinoCtx.getBean(\"serviceBase\");\r\n //hibernateSession.beginTransaction();\r\n serviceBase.save(loginSession);\r\n //hibernateSession.getTransaction().commit();\r\n session.setAttribute(\"loginSession\", loginSession);\r\n\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n //hibernateSession.getTransaction().rollback();\r\n } finally {\r\n //hibernateSession.close();\r\n }\r\n }\r\n return result;\r\n }",
"@FXML\n\tvoid login(ActionEvent event) throws IOException {\n\t\tMessage messageToServer = new Message();\n\t\tString userName = txtUserName.getText();\n\t\tString password = txtPassword.getText();\n\t\t// check that user put details\n\t\tif (userName.trim().isEmpty() || password.trim().isEmpty())\n\t\t\tlblErr.setText(\"User Name or Password is missing\");\n\t\telse {\n\t\t\tlblErr.setText(\"\");\n\t\t\t// create new Message object with the request\n\t\t\tmessageToServer.setMsg(userName + \" \" + password);\n\t\t\tmessageToServer.setOperation(\"isUserExists\");\n\t\t\tmessageToServer.setControllerName(\"UserController\");\n\t\t\t// the result User instance\n\t\t\tuser = (User) ClientUI.client.handleMessageFromClientUI(messageToServer);\n\t\t\t// user isn't exists in DB\n\t\t\tif (user == null) { // create pop up alert\n\t\t\t\tlblErr.setText(\"User Name or Password is incorrect\");\n\t\t\t}\n\t\t\t// user already log in\n\t\t\telse if (user.isLogedIN() == true) { // create pop up alert\n\t\t\t\tlblErr.setText(\"User already logged in\");\n\t\t\t} else { // user logged in successfully\n\t\t\t\tmessageToServer.setMsg(userName);\n\t\t\t\tmessageToServer.setOperation(\"updateConnectionStatus\");\n\t\t\t\tmessageToServer.setControllerName(\"UserController\");\n\t\t\t\t// update the user's connection status\n\t\t\t\tClientUI.client.handleMessageFromClientUI(messageToServer);\n\t\t\t\t// navigate user to the right home page, by his permission\n\t\t\t\tswitch (user.getUserType()) {\n\t\t\t\tcase STUDENT:\n\t\t\t\t\tNavigator.instance().navigate(\"StudentHomeForm\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase TEACHER:\n\t\t\t\t\tNavigator.instance().navigate(\"TeacherHomeForm\");\n\t\t\t\t\tbreak;\n\t\t\t\tcase PRINCIPAL:\n\t\t\t\t\tNavigator.instance().navigate(\"PrincipalHomeForm\");\n\t\t\t\t\tbreak;\n\t\t\t\t} // end switch case\n\t\t\t}\n\t\t}\n\t}",
"@Override\n public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException,\n IOException {\n \n final JsonMessage message = new JsonMessage(200, this.getClass().getName());\n \n try {\n final Map<String, String> parameters = getParameters(request);\n final RequestCode code = requestCodeMap.get(parameters.get(\"code\"));\n final String login = parameters.get(\"login\");\n final String password = parameters.get(\"password\");\n \n switch (code) {\n case READ :\n message.setMethod(\"READ\");\n if (login == null) {\n throw new InternalBackEndException(\"login argument missing!\");\n } else if (password == null) {\n throw new InternalBackEndException(\"password argument missing!\");\n } else {\n message.addData(\"warning\", \"METHOD DEPRECATED - Post method should be used instead of Get!\");\n final MUserBean userBean = authenticationManager.read(login, password);\n message.setDescription(\"Successfully authenticated\");\n message.addData(\"user\", getGson().toJson(userBean));\n }\n break;\n case DELETE :\n throw new InternalBackEndException(\"not implemented yet...\");\n default :\n throw new InternalBackEndException(\"AuthenticationRequestHandler(\" + code + \") not exist!\");\n }\n } catch (final AbstractMymedException e) {\n e.printStackTrace();\n MLogger.info(\"Error in doGet operation\");\n MLogger.debug(\"Error in doGet operation\", e.getCause());\n message.setStatus(e.getStatus());\n message.setDescription(e.getMessage());\n }\n \n printJSonResponse(message, response);\n }",
"public Message handleRequest(Message request){\n\n Message error = new Message(Message.GENERIC_ERROR);\n\n switch (request.getId()){\n\n case Message.LOGIN:\n return handleLogin(request);\n case Message.CREATE_DOCUMENT:\n return handleCreate(request);\n case Message.REMOVE_INVITE:\n controlServer.removeInvite(request.getUserName(),request.getDocumentName());\n return request;\n case Message.PORTIONS:\n System.out.println(\"HANDLER pre-handle: \" +request.getDocumentName());\n request.setSectionNumbers(controlServer.getPortions(request.getDocumentName()));\n return request;\n case Message.ADMINS:\n Message response = new Message(Message.ADMINS);\n response.setStringVector(new Vector<>(controlServer.getAdmins(request.getDocumentName())));\n return response;\n case Message.USERS:\n request.setStringVector(controlServer.getUserNames());\n return request;\n case Message.INVITATION:\n controlServer.addAdmin(request.getDocumentName(),request.getReceiver());\n controlServer.addInvite(request.getReceiver(),request.getDocumentName());\n request.setId(Message.INVITE_SENT);\n return request;\n case Message.GET_INVITES:\n String owner = request.getUserName();\n request.setStringVector(controlServer.getUserData(owner).getInvites());\n return request;\n case Message.GET_USERDATA:\n return handleGetUserData(request);\n case Message.LOCK:\n if(!controlServer.lock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.LOCK_NOK);\n else\n request.setId(Message.LOCK_OK);\n return request;\n case Message.UNLOCK:\n if(controlServer.unlock(request.getDocumentName(),request.getSectionNumbers()))\n request.setId(Message.UNLOCK_OK);\n return request;\n case Message.EDIT:\n String DocumentName = request.getDocumentName();\n int SectionNumbers = request.getSectionNumbers();\n request.setText(controlServer.getSection(DocumentName,SectionNumbers));\n return request;\n case Message.END_EDIT:\n controlServer.editDoc(request.getDocumentName(),request.getSectionNumbers(),request.getText());\n return request;\n case Message.PRINT:\n request.setText(controlServer.getDocumentString(request.getDocumentName()));\n return request;\n case Message.SHOW:\n String text = controlServer.getSection(request.getDocumentName(),request.getSectionNumbers());\n request.setText(text);\n return request;\n default:\n controlServer.showMessage(\"unknown request\");\n break;\n }return error;\n }",
"@Override\n\tpublic ModelAndView handleRequest(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws Exception {\n\t\t\n\t\treturn helloservice.vailData(request, response);\n\t\t\n\t\t\n\t\t/*String name = request.getParameter(\"name\");\n\t\tString pwd = request.getParameter(\"password\");\n\t\tSystem.out.println(\"hello world this is controller\");\n\t\tModelAndView mv = new ModelAndView();\n\t\tif(\"hello\".equals(name) && \"world\".equals(pwd))\n\t\t{\n\t\t\t\n\t\t\tmv.addObject(\"message\", \"Hello World!\");\n\t\t\t\n\t\t\t}else{\n\t\t\t\tmv.addObject(\"message\", \"not users\");\n\t\t\t}\n\t\t\tmv.setViewName(\"hello\");\n\t\treturn mv;*/\n\t}",
"public void loginAsUser() {\n vinyardApp.navigateToUrl(\"http://localhost:8080\");\n vinyardApp.fillUsername(\"user\");\n vinyardApp.fillPassord(\"123\");\n vinyardApp.clickSubmitButton();\n }",
"public static String login(HttpServletRequest request) {\n\t\tif (request.getMethod().equals(FinalUtil.HTTP_GET)) {\n\t\t\treturn \"loginpage.html\";\n\t\t}\n\n\t\t// POST logic\n\t\tEmployee loggedEmployee = EmployeeService.getEmployeeService().login(\n\t\t\t\tnew Employee(\n\t\t\t\t\t\trequest.getParameter(\"email\"), \n\t\t\t\t\t\trequest.getParameter(\"password\")\n\t\t\t\t));\n\t\tSystem.out.println(\"LOGIN CONTROLLER: \" + loggedEmployee);\n\t\t\n\t\trequest.setAttribute(\"loggedEmployee\", loggedEmployee);\n\t\t\n\t\t// Wrong Credentials\n\t\tif (loggedEmployee.getEmailAddress().equals(\"\")) {\n\t\t\treturn \"loginpage.html\";\n\t\t} else {\n\t\t\n\t\t\trequest.getSession().setAttribute(\"loggedEmployee\", loggedEmployee);\n\n\t\t\t\n\t\t\tEmployee logged = (Employee) request.getSession().getAttribute(\"loggedEmployee\");\n\t\t\t\n\t\t\tSystem.out.println(\"Parameters(email and password from form): \" + request.getParameter(\"email\") +\":\" + request.getParameter(\"password\"));\n\t\t\tboolean loggedEmployee1 = EmployeeService.getEmployeeService().isManager(logged);\n\n\t\t\tif (loggedEmployee1 == true) {\n\t\t\t\treturn \"managerHome.jsp\";\n\t\t\t} else\n\t\t\t\treturn \"employeeHome.jsp\";\n\t\t}\n\t\t}",
"protected Response login() {\n return login(\"\");\n }",
"String execute(HttpServletRequest request);",
"private void login() {\n AnonimoTO dati = new AnonimoTO();\n String username = usernameText.getText();\n String password = passwordText.getText();\n\n if (isValidInput(username, password)) {\n dati.username = username;\n dati.password = password;\n\n ComplexRequest<AnonimoTO> request =\n new ComplexRequest<AnonimoTO>(\"login\", RequestType.SERVICE);\n request.addParameter(dati);\n\n SimpleResponse response =\n (SimpleResponse) fc.processRequest(request);\n\n if (!response.getResponse()) {\n if (ShowAlert.showMessage(\n \"Username o password non corretti\", AlertType.ERROR)) {\n usernameText.clear();\n passwordText.clear();\n }\n }\n }\n\n }",
"public void handler(AbstractRequest request) {\n\t\tSystem.out.println(\"===handle1\" + request.getContent());\n\t}",
"public static String login(HttpServletRequest request) {\n\t\tif(request.getMethod().equals(FinalUtil.HTTP_GET)) {\n\t\t\treturn \"login.jsp\";\n\t\t}\n\t\t\n\t\t//POST logic\n\t\tCustomer loggedCustomer = CustomerService.getCustomerService().login(\n\t\t\t\tnew Customer(\n\t\t\t\t\t\trequest.getParameter(\"username\"),\n\t\t\t\t\t\trequest.getParameter(\"password\")\n\t\t\t\t\t\t));\n\t\t\n\t\t// Wrong Credentials\n\t\tif(loggedCustomer.getUsername().equals(\"\")) {\n\t\t\treturn \"login.jsp\";\n\t\t}\n\t\telse {\n\t\t\t/* Storing loggedCustomer to current session\n\t\t\tSESSION SCOPE IS AVAILABLE ONLY IN THIS REQUEST (CLIENT) */\n\t\t\trequest.getSession().setAttribute(\"loggedCustomer\", loggedCustomer);\n\t\t\t\n\t\t\t//Forward user to hit another controller\n\t\t\treturn \"/home.do\";\n\t\t}\n\t}",
"protected void doDSPost(Context context, HttpServletRequest request,\n HttpServletResponse response) throws ServletException, IOException,\n SQLException, AuthorizeException\n {\n String email = request.getParameter(\"login_email\");\n String password = request.getParameter(\"login_password\");\n String jsp = null;\n\n // Locate the eperson\n int status = AuthenticationManager.authenticate(context, email, password,\n null, request);\n \n \n if (status == AuthenticationMethod.SUCCESS)\n {\n // Logged in OK.\n Authenticate.loggedIn(context, request, context.getCurrentUser());\n\n // Set the Locale according to user preferences\n Locale epersonLocale = I18nUtil.getEPersonLocale(context.getCurrentUser());\n context.setCurrentLocale(epersonLocale);\n Config.set(request.getSession(), Config.FMT_LOCALE, epersonLocale);\n\n log.info(LogManager.getHeader(context, \"login\", \"type=explicit\"));\n\n // resume previous request\n Authenticate.resumeInterruptedRequest(request, response);\n\n return;\n }\n else if (status == AuthenticationMethod.CERT_REQUIRED)\n jsp = \"/error/require-certificate.jsp\";\n else\n jsp = \"/login/incorrect.jsp\";\n\n // If we reach here, supplied email/password was duff.\n log.info(LogManager.getHeader(context, \"failed_login\",\n \"email=\" + email + \", result=\" + String.valueOf(status)));\n JSPManager.showJSP(request, response, jsp);\n }",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)\n\t\t\tthrows Exception {\n\t\t System.err.println(\"URI -- \"+request.getRequestURL());\n\t\t if(request.getRequestURI()!=null &&\n\t\t (request.getRequestURI().contains(\"/self/login\"))) return true;\n\t\t \n\t\t \n\t\t String authHeader = request.getHeader(AUTH_HEADER);\n\t\t \n\t\t if (authHeader == null) { \n\t\t\t response.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t\t response.getOutputStream().write(TOKEN_EXPIRE_MSG.getBytes()); return false;\n\t\t }\n\t\t \n\t\t if (authHeader.contains(\"Basic \")) {\n\t\t \n\t\t String encodedUserNamePassword = authHeader.split(\"Basic \")[1]; String\n\t\t strValue = \"\";\n\t\t try\n\t\t { \n\t\t\t strValue = new String(java.util.Base64.getDecoder().decode(encodedUserNamePassword.getBytes(\n\t\t\t\t\t \t\t)), \"UTF-8\"); \n\t\t }\n\t\t catch (Exception e)\n\t\t { \n\t\t\t e.printStackTrace(); \n\t\t\t // TODO: handle exception return false; \n\t\t }\n\t\t \n\t\t String[] arrayOfString = strValue.split(\"\\\\:\");\n\t\t \n\t\t if (arrayOfString.length > 1) \n\t\t { \n\t\t\t \tString userName = arrayOfString[0]; String\n\t\t\t \tpassword = arrayOfString[1]; System.err.println(userName);\n\t\t\t \tSystem.err.println(password);\n\t\t \n\t\t\t \tpassword = Base64.getEncoder().encodeToString((password + \"\").getBytes(\"utf-8\")); \n\t\t\t \tUsernamePasswordAuthenticationToken\n\t\t\t \tusernamePasswordAuthenticationToken = new\n\t\t\t \tUsernamePasswordAuthenticationToken( userName, password);\n\t\t \n\t\t\t \tAuthentication authentication = null; \n\t\t\t \ttry { authentication =\n\t\t\t \t\t\tautheticationManager.authenticate(usernamePasswordAuthenticationToken);\n\t\t \n\t\t } catch (Exception ex) { \n\t\t\t ex.printStackTrace();\n\t\t\t response.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t\t response.getOutputStream().write(UNAUTHORISED_ACCESS_MSG.getBytes());\n\t\t \n\t\t\t return false; \n\t\t } \n\t\t if (authentication.isAuthenticated()) {\n\t\t\t SecurityContextHolder.getContext().setAuthentication(authentication);\n\t\t\t return true; \n\t\t } else { \n\t\t\t\n\t\t\tresponse.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t\t response.getOutputStream().write(UNAUTHORISED_ACCESS_MSG.getBytes()); \n\t\t\t return false; \n\t\t\t } \n\t\t } else { \n\t\t\t String encodedValue = authHeader.split(\"Basic \")[1];\n\t\t \n\t\t\t if (isValidToken(encodedValue)) return true;\n\t\t \n\t\t \tresponse.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t \tresponse.getOutputStream().write(TOKEN_EXPIRE_MSG.getBytes()); return false;\n\t\t }\n\t\t \n\t\t } \n\t\t response.setContentType(JSON_HAL_CONTENT_TYPE);\n\t\t response.getOutputStream().write(UNAUTHORISED_ACCESS_MSG.getBytes()); return\n\t\t false;\n\t\t \n\t\t\n\t}",
"public abstract void onLogin();",
"private void authenticateAction() {\n if (requestModel.getUsername().equals(\"superuser\")\n && requestModel.getPassword().equals(\"\")) {\n Collection<Webres> webres = getAllWebres();\n proceedWhenAuthenticated(new User(null, null, null, \"superuser\", \"\", null) {\n @Override\n public Collection<Webres> getAllowedResources() {\n return webres;\n }\n @Override\n public ActionController getDefaultController() {\n return ActionController.EMPLOYEES_SERVLET;\n }\n });\n return;\n }\n \n // try to authenticate against other credentials from the database\n Optional<User> u = getUserByCredentials(requestModel.getUsername(), requestModel.getPassword()); \n if (u.isPresent()) {\n proceedWhenAuthenticated(u.get());\n return;\n }\n \n // report authentication failed\n LOG.log(Level.INFO, \"{0} Authentication failed. Login: {1}, Password: {2}\", new Object[]{httpSession.getId(), requestModel.getUsername(), requestModel.getPassword()});\n SignInViewModel viewModel = new SignInViewModel(true);\n renderSignInView(viewModel);\n }",
"private void signInRequest() {\n errorContainer.getChildren().clear();\n if (!validateForm()) {\n displayErrorMessages();\n } else {\n\n //update the UI to notify the user that the connection is in \n //progress.\n startWorkInProgress(\"Connecting\");\n\n final Runnable connectionRequestRunnable = new Runnable() {\n @Override\n public void run() {\n mConnectionRequestCommand.setLogin(userNameField.getText());\n mConnectionRequestCommand.setPassword(passwordField.getText());\n mConnectionRequestCommand.execute();\n }\n };\n new Thread(connectionRequestRunnable, \"Connection Request\").start();\n\n }\n }",
"private void cmdHandler(JSONArray parameter, String cmd) {\n switch (cmd) {\n case \"login\":\n signIn(parameter);\n break;\n case \"time\":\n Date d = new GregorianCalendar().getTime();\n clientResponse(d.toString());\n break;\n case \"ls\":\n listFiles(parameter);\n break;\n case \"who\":\n clientResponse(MailboxServer.getUsersAsString());\n break;\n case \"msg\":\n sendMessage(parameter);\n break;\n case \"exit\":\n signOut();\n break;\n }\n }",
"@Override\n\tpublic boolean preHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler) throws Exception {\n\t\tString sessionId = request.getHeader(\"sid\");\n\t\tif (sessionId == null || \"\".equals(sessionId)) {\n\t\t\tsessionId = request.getParameter(\"sid\");\n\t\t}\n\t\tString url = request.getRequestURL().toString();\n\t\tif (url.contains(\"admin_user/login\") || url.contains(\"admin_user/test\")\n\t\t\t\t|| url.contains(\"admin_app/download_app\")\n\t\t\t\t|| url.contains(\"admin_user/login_out\")\n\t\t\t\t|| url.contains(\"admin_app/add_app_report\")\n\t\t\t\t|| url.contains(\"admin_user/getDesKey\")) {\n\t\t\treturn true;\n\t\t}\n\t\tResult result = new Result();\n\t\tObjectMapper om = new ObjectMapper();\n\t\tif (StringUtils.isEmpty(sessionId)) {\n\t\t\tresult.setCode(Constance.RESPONSE_USER_ERROR);\n\t\t\tresult.setMsg(\"请登陆!\");\n\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\treturn false;\n\t\t}\n\t\tsessionId = Constance.REDIS_USER_PRE + sessionId;\n\t\tif (redisUtil.get(sessionId) == null\n\t\t\t\t|| StringUtils.isEmpty(redisUtil.get(sessionId).toString())) {\n\t\t\tresult.setCode(Constance.RESPONSE_USER_ERROR);\n\t\t\tresult.setMsg(\"请登陆!\");\n\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\treturn false;\n\t\t}\n\t\tString userId = redisUtil.get(sessionId).toString();\n\t\tUser user = userMapper.getUserById(userId);\n\n\t\tif (user.getRole() == (short) 1) {\n\t\t\trequest.setAttribute(\"userId\", redisUtil.get(sessionId).toString());\n\t\t\tredisUtil.set(sessionId, request.getAttribute(\"userId\").toString(),\n\t\t\t\t\tLong.valueOf(10 * 60));\n\t\t\t// 校验权限\n\t\t\tboolean bool = checkedAuthorityByAdminAcount(userId, url);\n\t\t\tif (!bool) {\n\t\t\t\tresult.setCode(Constance.RESPONSE_AUTH_ERROR);\n\t\t\t\tresult.setMsg(\"您无权进行此操作!\");\n\t\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tresult.setCode(Constance.RESPONSE_AUTH_ERROR);\n\t\t\tresult.setMsg(\"您无权进行此操作!\");\n\t\t\tresponse.setContentType(\"application/json;charset=utf-8\");\n\t\t\tresponse.getWriter().print(om.writeValueAsString(result));\n\t\t\treturn false;\n\t\t}\n\t}",
"private void handleRequest(Request request) throws IOException{\n switch (request){\n case NEXTODD:\n case NEXTEVEN:\n new LocalThread(this, request, nextOddEven).start();\n break;\n case NEXTPRIME:\n case NEXTEVENFIB:\n case NEXTLARGERRAND:\n new NetworkThread(this, userID, serverIPAddress, request).start();\n break;\n default:\n break;\n }\n }",
"protected abstract String invoke(HttpServletRequest request) throws DriverException, WorkflowException;",
"protected void service(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String login = request.getParameter(\"login\");\n String senha = request.getParameter(\"senha\");\n UsuarioDAO dao = new UsuarioDAO();\n if (dao.checkLogin(login, senha)) {\n HttpSession session = request.getSession(true);\n session.setAttribute(\"login\", login);\n Cookie[] cookies = request.getCookies();\n Cookie cookie = null;\n for (int i = 0; cookies != null && i < cookies.length; i++) {\n Cookie c = cookies[i];\n if (c.getName().equals(\"myapp.login\")) {\n cookie = c;\n cookie.setValue(cookie.getValue().replace(\"@\" + login, \"\"));\n cookie.setValue(cookie.getValue().replace(login + \"@\", \"\"));\n cookie.setValue(login + \"@\" + cookie.getValue());\n break;\n }\n }\n if (cookie == null) {\n cookie = new Cookie(\"myapp.login\", login);\n }\n cookie.setMaxAge(Integer.MAX_VALUE);\n response.addCookie(cookie);\n RequestDispatcher rd = request.getRequestDispatcher(\"WEB-INF/TheGame.jsp\");\n rd.forward(request, response);\n } else {\n request.setAttribute(\"msg\", \"<span class=\\\"alert label\\\">Login ou senha inválida</span>\");\n RequestDispatcher rd = request.getRequestDispatcher(\"index.jsp\");\n rd.forward(request, response);\n }\n }",
"public Object handleRequest(P request) throws Exception;",
"protected void login() {\n\t\t\r\n\t}",
"public void doAction(HttpServletRequest request, HttpServletResponse response) throws ServletException,IOException{\r\n\t\tString strRequestAction = null;\r\n\t\tLoginUserBean loginUserBean = null;\r\n\t\tHttpSession session = request.getSession(false);\r\n\t\t\r\n\t\t\r\n\t\t// return Exception if session is already expired.\r\n\t\tif ( session == null || session.getAttribute(\"login_user_bean\") == null ) {\r\n\t\t\tthrow new ServletException(\"SESSION_EXPIRED\");\r\n\t\t}\r\n\t\tloginUserBean = (LoginUserBean) session.getAttribute(\"login_user_bean\");\r\n\t\trequest.setAttribute(\"login_user_bean\", loginUserBean.toJSON());\r\n\r\n\t\t// get the URI portion without Application Name\r\n\t\tstrRequestAction = request.getRequestURI();\r\n\t\tstrRequestAction = strRequestAction.substring( strRequestAction.indexOf(\"/\", 1), strRequestAction.length());\r\n\r\n\t\tWebServiceManager wsm = new WebServiceManager();\r\n\t\twsm.sendRequest(Constants.APPEDO_UI_MODULE_SERVICES + strRequestAction, request );\r\n\t\t\r\n\t\tif( wsm.getStatusCode() != null && wsm.getStatusCode() == HttpStatus.SC_OK ) {\r\n\t\t\tresponse.getWriter().write(wsm.getResponse());\r\n\t\t} else {\r\n\t\t\tresponse.getWriter().write( UtilsFactory.getJSONFailureReturn(\"Problem with Services\").toString() );\r\n\t\t}\r\n\t\t\r\n\t\t// clear used variables\r\n\t\tUtilsFactory.clearCollectionHieracy(loginUserBean);\r\n\t\tloginUserBean = null;\r\n\t\tstrRequestAction = null;\r\n\t}",
"@Override\n\tpublic ResponseEntity<? extends LoginResponse> handle(RequestEntity<? extends LoginRequest> request)\n\t\t\tthrows ApiException, Exception {\n\t\treturn null;\n\t}",
"public void handleRequest(Request req) {\n\n }",
"private static void postLoginPage() {\n post(\"/login\", \"application/json\", (req, res) -> {\n HomerAccount loggedInAccount = homerAuth.login(req.body());\n if(loggedInAccount != null) {\n req.session().attribute(\"account\", loggedInAccount);\n res.redirect(\"/team\");\n } else {\n res.redirect(\"/login\");\n }\n return null;\n });\n }",
"protected void handleRequest(dk.i1.diameter.Message request, ConnectionKey connkey, Peer peer) {\n\n String log = \"\";\n Message answer = new Message();\n answer.prepareResponse(request);\n AVP avp;\n avp = request.find(ProtocolConstants.DI_SESSION_ID);\n if (avp != null)\n answer.add(avp);\n node().addOurHostAndRealm(answer);\n //avp = request.find(ProtocolConstants.DI_CC_REQUEST_TYPE); DIAMETER_COMMAND_AA\n avp = request.find(ProtocolConstants.DI_AUTH_REQUEST_TYPE);\n if (avp == null) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_MISSING_AVP,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{new AVP(ProtocolConstants.DI_AUTH_REQUEST_TYPE, new byte[]{})})});\n return;\n }\n\n\n int aa_request_type = -1;\n try {\n aa_request_type = new AVP_Unsigned32(avp).queryValue();\n } catch (InvalidAVPLengthException ex) {\n }\n if (aa_request_type != ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE &&\n aa_request_type != ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY &&\n aa_request_type != ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHORIZE_ONLY) {\n answerError(answer, connkey, ProtocolConstants.DIAMETER_RESULT_INVALID_AVP_VALUE,\n new AVP[]{new AVP_Grouped(ProtocolConstants.DI_FAILED_AVP, new AVP[]{avp})});\n return;\n }\n\n\n\n avp = request.find(ProtocolConstants.DI_AUTH_APPLICATION_ID);\n if (avp != null)\n answer.add(avp);\n avp = request.find(ProtocolConstants.DI_AUTH_REQUEST_TYPE);\n if (avp != null)\n answer.add(avp);\n\n\n switch (aa_request_type) {\n case ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY:\n case ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHENTICATE:\n //grant whatever is requested\n avp = request.find(ProtocolConstants.DI_USER_NAME);\n answer.add(avp);\n String userName = new AVP_UTF8String(avp).queryValue();\n avp = request.find(ProtocolConstants.DI_USER_PASSWORD);\n String userPassword = new AVP_UTF8String(avp).queryValue();\n\n\n synchronized (PrintedStrings.stringsToPrint) {\n System.out.println(log = \"UserName: \" + userName);\n PrintedStrings.stringsToPrint.add(log);\n System.out.println(log = \"password: \" + userPassword);\n PrintedStrings.stringsToPrint.add(log);\n\n //TODO Sprawdzic to jesli nie ma z w slowniku\n String pass = userToPasswordDict.get(userName);\n if (pass == null) {\n System.out.println(log=\"nie ma takiego uzytkownika\");\n\n PrintedStrings.stringsToPrint.add(log);\n }\n if (userPassword.equals(pass)) {\n\n avp = request.find(ProtocolConstants.DI_CHAP_AUTH);\n if (avp != null) {\n try {\n AVP_Grouped chapAuth = new AVP_Grouped(avp);\n AVP[] elements = chapAuth.queryAVPs();\n byte[] idBytes = new AVP_OctetString(elements[1]).queryValue();\n char id = (char) idBytes[0];\n System.out.println(log = \"id: \" + id);\n PrintedStrings.stringsToPrint.add(log);\n\n byte[] chapResponseBytes = new AVP_OctetString(elements[2]).queryValue();\n printBytesAsString(chapResponseBytes, \"odebrane rozwiazanie \");\n log = getBytesAsString(chapResponseBytes, \"odebrane rozwiazanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n byte[] chapChallengeBytes = new AVP_OctetString(elements[3]).queryValue();\n printBytesAsString(chapChallengeBytes, \"odebrane zadanie \");\n log = getBytesAsString(chapResponseBytes, \"odebrane zadanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n //sprawdzenie czy nie ma ataku przez odtwarzanie\n ServicingUserEntry sessionEntry = curentlyServicing.get(userName);\n if (sessionEntry == null) {\n System.out.println(log = \"Atak/ pakiet dotarl po upłynieciu czasu oczekiwania/ pakiet został powtórzony\");\n //w takiej sytuacji nie odpowiadamy wcale\n PrintedStrings.stringsToPrint.add(log);\n return;\n }\n Date now = new Date();\n if (id != sessionEntry.getId() ||\n !Arrays.equals(chapChallengeBytes, sessionEntry.getChallenge()) ||\n (now.getTime() - sessionEntry.getTime().getTime()) > 5000) {\n\n System.out.println(log = \"Atak/ pakiet dotarl po upłynieciu czasu oczekiwania/ przekłamanie pakietu\");\n //w takiej sytuacji nie odpowiadamy wcale\n PrintedStrings.stringsToPrint.add(log);\n return;\n }\n curentlyServicing.remove(userName);\n byte[] md5 = caluculateMD5(idBytes, userToSecretDict.get(userName).getBytes(\"ASCII\"), chapChallengeBytes);\n printBytesAsString(chapResponseBytes, \"obliczone rozwiazanie \");\n log = getBytesAsString(chapResponseBytes, \"obliczone rozwiazanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n if (Arrays.equals(chapResponseBytes, md5)) {\n\n answer.add(new AVP_OctetString(ProtocolConstants.DI_FRAMED_IP_ADDRESS, clusterAddress.getBytes()));\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_SUCCESS));\n System.out.println(log = \"Uwierzytelnionio, pozwalam na dołaczenie do klastra\");\n PrintedStrings.stringsToPrint.add(log);\n } else {\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_AUTHENTICATION_REJECTED));\n System.out.println(log = \"Błędnie rozwiązane zadanie\");\n PrintedStrings.stringsToPrint.add(log);\n }\n } catch (InvalidAVPLengthException e) {\n e.printStackTrace();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n } else {\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_MULTI_ROUND_AUTH));\n //zwiekszamy ostatnio uzywany index o 1 i korzystamy z niego\n incrementIndex();\n byte[] ind = new byte[]{(byte) lastId};\n byte[] challenge = generateChallenge();\n printBytesAsString(challenge, \"wygenerowane zadanie \");\n log = getBytesAsString(challenge, \"wygenerowane zadanie \");\n PrintedStrings.stringsToPrint.add(log);\n\n\n curentlyServicing.put(userName, new ServicingUserEntry(userName, challenge, lastId));\n //System.out.println(\"generated chalenge : \" + challenge.toString());\n answer.add(new AVP_Grouped(ProtocolConstants.DI_CHAP_AUTH,\n new AVP_Integer32(ProtocolConstants.DI_CHAP_ALGORITHM, 5),\n new AVP_OctetString(ProtocolConstants.DI_CHAP_IDENT, ind),\n new AVP_OctetString(ProtocolConstants.DI_CHAP_CHALLENGE, challenge)));\n\n\n if(lastId==34)\n serverGUIController.firstInClaster = true; //TODO obsluz wszsytkich\n if(lastId==35)\n serverGUIController.secondInClaster = true;\n if(lastId==36)\n serverGUIController.thirdInClaster = true;\n if(lastId==37)\n serverGUIController.fourthInClaster = true;\n }\n } else {\n answer.add(new AVP_Unsigned32(ProtocolConstants.DI_RESULT_CODE, ProtocolConstants.DIAMETER_RESULT_AUTHENTICATION_REJECTED));\n log=\"podane hasło jest niepoprawne\";\n PrintedStrings.stringsToPrint.add(log);\n }\n }\n case ProtocolConstants.DI_AUTH_REQUEST_TYPE_AUTHORIZE_ONLY:\n break;\n }\n\n Utils.setMandatory_RFC3588(answer);\n\n try {\n answer(answer, connkey);\n } catch (dk.i1.diameter.node.NotAnAnswerException ex) {\n }\n\n switch (lastId) {\n case 34: {\n serverGUIController.firstConnected = true;\n serverGUIController.firstTextClear = true;\n break;\n }\n case 35:{\n serverGUIController.secondConnected = true;\n serverGUIController.secondTextClear = true;\n break;\n }\n case 36:{\n serverGUIController.thirdConnected = true;\n serverGUIController.thirdTextClear = true;\n break;\n }\n case 37:{\n serverGUIController.fourthCOnnected = true;\n serverGUIController.fourthTextClear = true;\n break;\n }\n\n }\n\n }",
"@FXML\r\n\tpublic void handleLoginButton() throws IOException{\r\n\t\tString username = tfUsernameLogin.getText();\r\n\t\tString password = pfPasswordLogin.getText();\r\n\t\tuserCred = theController.isValidUser(username, password);\r\n\t\tif(userCred.equals(\"manager\")){\r\n\t\t\tloginSuccess = true;\r\n\t\t\tconsoleScreen.setDisable(false);\r\n\t\t\tactionItemsScreen.setDisable(false);\r\n\t\t\tmemberScreen.setDisable(false);\r\n\t\t\tteamScreen.setDisable(false);\r\n\t\t\thandleConsoleButton();\r\n\t\t}\r\n\t\telse if(userCred.equals(\"employee\")){\r\n\t\t\tloginSuccess = true;\r\n\t\t\tconsoleScreen.setDisable(false);\r\n\t\t\tactionItemsScreen.setDisable(false);\r\n\t\t\tmemberScreen.setDisable(true);\r\n\t\t\tteamScreen.setDisable(true);\r\n\t\t\thandleConsoleButton();\r\n\t\t}\r\n\t\telse{\r\n\t\t\tlbAlertLogin.setTextFill(Color.RED);\r\n\t\t\tlbAlertLogin.setText(userCred);\r\n\t\t}\r\n\t}",
"private void login(HttpServletRequest request, HttpServletResponse response) throws SQLException {\n String nombre = request.getParameter(\"nombreUser\");\r\n String passwd = request.getParameter(\"passwdUser\");\r\n\r\n try {\r\n //COMPRUEBA CREDENCIALES EN BBDD\r\n if (uDao.CompruebaLogin(nombre, passwd)) {\r\n \r\n System.out.println(\"OK LOGIN\");\r\n //LOGIN OK- enviamos el listado a la vista(JSP)\r\n RequestDispatcher miDispatcher = request.getRequestDispatcher(\"/ControllerUsuario\");\r\n miDispatcher.forward(request, response);\r\n } else {\r\n //LOGIN FAILED- recarga vista login(JSP)\r\n RequestDispatcher miDispatcher = request.getRequestDispatcher(\"/Login.jsp\");\r\n miDispatcher.forward(request, response);\r\n }\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n\r\n }",
"@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"public void dispatchRequest(String Username, String Password)\n\t {\n\t\t System.out.println(\"Front Controller -> dispatchRequest() \");\n\t\t \n\t\t //Calling Front controller Authenticate model\n\t\t if(AuthenticateUser(Username,Password))\n\t\t {\n\t\t\t //Calling dispatcher dispatch method\n\t\t\t dispatcher.dispatch(usersession);\n\t\t }\n\t\t else{\n\t\t\t signupVw.displayMessages(\"Login Failed..!\");\n\t\t }\n\t }",
"protected void processRequest(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n String acao = request.getParameter(\"acao\");\n if (acao.equals(\"logar\")) {\n logar(request, response);\n } else if(acao.equals(\"logout\")) {\n logout(request, response);\n }\n }",
"protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tfinal String URI = request.getRequestURI().replace(\"/HelloFrontController/\", \"\"); // this is the name of the root project folder\n\t\t\n\t\tswitch(URI) {\n\t\tcase \"login\":\n\t\t\t// call a method from a request helper......\t\n\t\t\tRequestHelper.processLogin(request, response);\n\t\t\tbreak;\n\t\tcase \"employees\":\n\t\t\t// call method show all employees -- this means we'll be querying our DB...\n\t\t\tRequestHelper.processEmployees(request, response);\n\t\t\tbreak;\n\t\tcase \"error\":\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tRequestHelper.processError(request, response);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t}",
"@Override\r\n\tpublic boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)\r\n\t\t\tthrows Exception {\n\t\tString uri = request.getRequestURI();\r\n\t\tif (uri.indexOf(\"login\") >= 0 || uri.indexOf(\"index\") >= 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\tUser user = (User) request.getSession().getAttribute(\"loginInfo\");\r\n\t\tif (user == null) {\r\n\t\t\trequest.setAttribute(\"errMsg\", \"ÇëÏȵǼ£¡\");\r\n\t\t\trequest.getRequestDispatcher(\"/WEB-INF/jsp/user/login.jsp\").forward(request, response);\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t// }\r\n\t}",
"@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (SQLException ex) {\r\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }",
"@FXML\n private void handleLoginAttempt() {\n\n if (isInputValid()) {\n String uname = userField.getText();\n if (Model.doesUsernameExist(uname)) {\n User user = Model.verifyLogin(uname, pwField.getText());\n\n if (user == null) {\n // uname exists but incorrect login\n user = UserInfoTable.getUserFromUserName(uname);\n _loginAuthenticated = false;\n user.setLockoutNum(user.getLockoutNum() + 1);\n Model.editUser(user);\n\n // increment incorrect login attempts, check if banned\n if (user.getLockoutNum() >= 3) {\n bannedAlert();\n return;\n }\n } else {\n // uname exists and correct login\n // check if banned\n if (user.getLockoutNum() >= 3) {\n bannedAlert();\n return;\n }\n user.setLockoutNum(0);\n Model.editUser(user);\n Model.setUser(user);\n _loginAuthenticated = true;\n app.showMainPage();\n return;\n }\n }\n // Show the error message if bad data\n Alert alert = new Alert(Alert.AlertType.ERROR);\n alert.initOwner(_dialogStage);\n alert.setTitle(\"Please Correct Invalid Fields \");\n alert.setHeaderText(\"Incorrect password and/or username\");\n\n alert.showAndWait();\n }\n }",
"@SuppressWarnings(\"unchecked\")\n\tpublic void handleRequest(InputStream input, OutputStream output, Context context) throws IOException {\n\n \n \tLambdaLogger logger = context.getLogger();\n \tlogger.log(\"New Login code eee\");\n \t\n \tInputStreamReader isr = new InputStreamReader(input, Charset.forName(\"UTF-8\"));\n \tBufferedReader br = new BufferedReader(isr);\n \tString in = \"\"; \n \tString line1 = \"\";\n \twhile ((line1 = br.readLine()) != null) {\n\n in += line1;\n \t\tlogger.log(\" new user output \"+ in);\n \t} \n \t\n \n logger.log(\"Invoked Foodie Login function \" + in);\n \n JSONParser parser = new JSONParser();\n \n Object objIn = null ;\n \n try {\n\n objIn = parser.parse(in);\n }\n catch(Exception ex)\n {\n \tex.printStackTrace();\n }\n\n JSONObject inObj = (JSONObject)objIn;\n logger.log(inObj.toJSONString());\n \n /**\n * Steps to check:\n * \t1. Make sure the User-Status is CONFIRMED from cognito\n * 2. Note that userID is auto-increment\n */\n String user_status = (String) ((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"cognito:user_status\");\n \n if(user_status.equalsIgnoreCase(\"CONFIRMED\"))\n {\n\t String user_nm = (String) inObj.get(\"userName\");\n\t logger.log(\"user_nm \" + user_nm);\n\t\n\t \n\t int userid = getUserId(100000,1000000) ;\n\t \n\t \n\t String email = (String) ((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"email\");\n\t String mobile = (String) ((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"custom:mobile\");\n\t //int building = Integer.parseInt(((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"custom:building\"));\n\t int building = Integer.parseInt((String)((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"custom:building\"));\n\t int flat = Integer.parseInt((String)((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"custom:flat\"));\n\t String city = (String) ((JSONObject) ((JSONObject)inObj.get(\"request\")).get(\"userAttributes\")).get(\"custom:city\");\n\t logger.log(\"email \" + email + \" building \"+ building + \" flat \"+ flat);\n\t\n\t logger.log(\" User info \" + userid + \" \" + user_nm + \" \" + email);\n\t \n\t\t \n\t\t \ttry {\n\t\t String url = \"jdbc:mysql://foodie.cl8mn8l8ahnm.us-east-1.rds.amazonaws.com:3306\";\n\t\t String username = \"Lokmeer\";\n\t\t String password = \"Welcome123\";\n\t\t\n\t\t Connection conn = DriverManager.getConnection(url, username, password);\n\t\t Statement stmt = conn.createStatement();\n\t\t //ResultSet resultSet = stmt.executeQuery(\"SELECT NOW()\");\n\t\t stmt.executeUpdate(\"INSERT INTO FoodieDB.tb_User \"\n\t\t \t\t+ \"(User_id, \"\n\t\t \t\t+ \"Community_id, \"\n\t\t \t\t+ \"Building_id, \"\n\t\t \t\t+ \"Flat_id, \"\n\t\t \t\t+ \"Diet_type_id, \"\n\t\t \t\t+ \"User_nm, \"\n\t\t \t\t+ \"Email_addr, \"\n\t\t \t\t+ \"Encrypted_pwd, \"\n\t\t \t\t+ \"phone_nbr, \"\n\t\t \t\t+ \"Seller_flg) \" \n\t\t + \"VALUES (\" + userid + \", 1, \"+ building +\", \"+flat +\", 1, \\\" \" + user_nm + \"\\\", \\\" \"+ email + \" \\\", \\\"kdhskjfhskdjfhskhfskjfhsdsdkjfskldfjdslf\\\",\\\"\" + mobile + \"\\\",0)\");\n\t\t\n\t\t /**********Order Management Calls*************/\n\t\t \n\t\t \n\t\t } catch (Exception e) {\n\t\t e.printStackTrace();\n\t\t logger.log(\"Caught exception: \" + e.getMessage());\n\t\t }\n\n }\n //Inserted user successfully by this point into DB\n logger.log(\"Successfully executed user-db persistence trigger. Result for LokMeer Project \" );\n \n \n //output.write(in.getBytes()); ;\n \n //OBJECT_MAPPER.writeValue(output,eventNode);\n \n // Success Condition, send back same JSON\n try (Writer w = new OutputStreamWriter(output, \"UTF-8\")) {\n w.write(inObj.toString());\n }\n \n \n }",
"public UserLoginhandle() {\n\t\tsuper();\n\t}",
"@Override\n protected void initiateAuthenticationRequest(HttpServletRequest request, HttpServletResponse response,\n AuthenticationContext context) throws AuthenticationFailedException {\n String loginPage = ConfigurationFacade.getInstance().getAuthenticationEndpointURL()\n .replace(\"authenticationendpoint/login.do\", Token2Constants.LOGIN_PAGE);\n String queryParams = FrameworkUtils.getQueryStringWithFrameworkContextId(context.getQueryParams(),\n context.getCallerSessionKey(), context.getContextIdentifier());\n String retryParam = \"\";\n if (context.isRetrying()) {\n retryParam = Token2Constants.RETRY_PARAMS;\n }\n try {\n response.sendRedirect(loginPage + (\"?\" + queryParams) + \"&authenticators=\"\n + getName() + retryParam);\n } catch (IOException e) {\n throw new AuthenticationFailedException(\"Authentication failed!\", e);\n }\n }",
"@Override\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t\tString email=request.getParameter(\"email\");\n\t\tString password=request.getParameter(\"password\");\n\t\t\n\t\tUserVo vo=new UserDao().get(email,password);\n\t\tif(vo==null)\n\t\t{\n\t\t\t//인증실패\n\t\t\t\n\t\t\trequest.setAttribute(\"result\", \"fail\");\n\t\t\t\n\t\t\tWebUtils.forward(request, response, \"/WEB-INF/views/user/loginform.jsp\");\n\t\t\treturn;\n\t\t}\n\t\t//인증성공 -> 인증처리\n\t\tHttpSession session=request.getSession(true);\n\t\tsession.setAttribute(\"authuser\", vo);\n\t\t\n\t\t//main으로 보내기\n\t\tWebUtils.redirect(request, response, request.getContextPath());\n\t\t\n\t\t\n\t\t\n\t}",
"@Override\n public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler){\n log.info(\"Handling request from user with id {}\", request.getSession().getId());\n return true;\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (ClassNotFoundException ex) {\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\n } catch (SQLException ex) {\n Logger.getLogger(Login.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"@Override\r\n\t\tpublic void run() {\n\t\t\tHashMap<Integer, String> respMap = userHelper.loginUser(userName, password);\r\n\t\t\t\r\n\t\t\tMessage message=Message.obtain();\r\n message.obj=respMap;\r\n message.what=0x123;\r\n handler.sendMessage(message);\r\n\t\t}",
"String execute(HttpServletRequest request) throws Exception;",
"private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext) {\n\n executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));\n\n return doInvoke(request, responseHandler, executionContext);\n }",
"@Override\n\tpublic boolean execute(HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\n\t\tString login = request.getParameter(\"login\");\n\t\tString logout = request.getParameter(\"logout\");\n\t\tString activation = request.getParameter(\"activation\");\n\n\t\t// *************************************************\n\t\t// \t\t\t\t\t\tLOGIN\n\t\t// *************************************************\n\t\tif (login != null) {\n\t\t\ttry {\n\t\t\t\tconn = DBConnectionFactory.getConnection();\n\t\t\t\tstmt = conn.createStatement();\n\n\t\t\t\tString username = request.getParameter(\"username\");\n\t\t\t\tString password = request.getParameter(\"password\");\n\n\t\t\t\tusername = username.toLowerCase();\n\t\t\t\tString hashedPassword = hashing(password);\n\n\t\t\t\tString sqlQuery = \"SELECT * FROM users WHERE username = '\"\n\t\t\t\t\t\t+ username + \"'\";\n\n\t\t\t\tResultSet result = stmt.executeQuery(sqlQuery);\n\n\t\t\t\twhile (result.next()) {\n\n\t\t\t\t\tString dbUserID = result.getString(\"userid\");\n\t\t\t\t\tString dbUsername = result.getString(\"username\");\n\t\t\t\t\tString dbPassword = result.getString(\"password\");\n\t\t\t\t\tString dbFirstName = result.getString(\"first_name\");\n\t\t\t\t\tString dbLastName = result.getString(\"last_name\");\n\t\t\t\t\tString dbRole = result.getString(\"role\");\n\t\t\t\t\tString dbNickName = result.getString(\"nickname\");\n\t\t\t\t\tString dbEmail = result.getString(\"email\");\n\t\t\t\t\tString dbStatus = result.getString(\"status\");\n\n\t\t\t\t\tif (dbUsername.equalsIgnoreCase(username)\n\t\t\t\t\t\t\t&& dbStatus.equalsIgnoreCase(\"active\")) {\n\n\t\t\t\t\t\tif (hashedPassword.equals(dbPassword)) {\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"userid\",\n\t\t\t\t\t\t\t\t\tdbUserID);\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"username\",\n\t\t\t\t\t\t\t\t\tdbUsername);\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"first_name\",\n\t\t\t\t\t\t\t\t\tdbFirstName);\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"last_name\",\n\t\t\t\t\t\t\t\t\tdbLastName);\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"role\", dbRole);\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"nickname\",\n\t\t\t\t\t\t\t\t\tdbNickName);\n\t\t\t\t\t\t\trequest.getSession().setAttribute(\"email\", dbEmail);\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} \n\t\t// *************************************************\n\t\t// \t\t\t\t\t\tLOGOUT\n\t\t// *************************************************\n\t\telse if (logout != null) {\n\n\t\t\tHttpSession session = request.getSession(false);\n\t\t\tsession.invalidate();\n\t\t\treturn true;\n\t\t} \n\t\t\n\t\t// *************************************************\n\t\t// \t\t\t\tACTIVATION CHECKING\n\t\t// *************************************************\n\t\t\n\t\telse if (activation != null) {\n\n\t\t\tString username = request.getParameter(\"username\");\n\n\t\t\ttry {\n\t\t\t\tconn = DBConnectionFactory.getConnection();\n\t\t\t\tstmt = conn.createStatement();\n\n\t\t\t\tString sqlQuery = \"SELECT status FROM users WHERE username = '\"\n\t\t\t\t\t\t+ username + \"'\";\n\n\t\t\t\tResultSet result = stmt.executeQuery(sqlQuery);\n\n\t\t\t\twhile (result.next()) {\n\t\t\t\t\tString status = result.getString(\"status\");\n\n\t\t\t\t\tif (status.equals(activation)) {\n\n\t\t\t\t\t\tString updateStatus = \"UPDATE users SET status='active' WHERE username='\"\n\t\t\t\t\t\t\t\t+ username + \"'\";\n\t\t\t\t\t\tstmt2 = conn.createStatement();\n\t\t\t\t\t\tstmt2.executeUpdate(updateStatus);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} catch (Exception e) {\n\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}",
"@FXML\n\tprivate void handleLogin() {\n\t \n\t\t\t\ttry {\n\t\t\t\t\tmain.showHomePageOverview(username.getText(),password.getText());\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\n\t}",
"@Override\r\n\tpublic void login() {\n\t\t\r\n\t}",
"public abstract void handle(Request request, Response response) throws Exception;",
"protected HttpResponse executeRequest(RPCRequest invocation) throws Exception {\n\t\treturn getHttpInvokerRequestExecutor().executeRequest(getServiceUrl(), invocation);\n\t}",
"public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString userName = request.getParameter(\"adminID\");//取得用户名\n\t\tString password = request.getParameter(\"adminPswd\");//取得密码\n\t\tString returnUri = request.getParameter(\"return_uri\");\n\t\trequest.getSession().setAttribute(\"userID\", userName);\n\t\t\n\t\tDBUtil db = new DBUtil();//构建数据库对象\n\t\tboolean canLogin = db.loginSuccess(userName, password);\n\t\t\n\t\tRequestDispatcher rd = null;\n\t\tif (canLogin) {\n\t\t\trequest.getSession().setAttribute(\"flag\", \"login_success\");\n\t\t\tif (returnUri != null) {\n\t\t\t\trd = request.getRequestDispatcher(returnUri);\n\t\t\t\trd.forward(request, response);\n\t\t\t}else {\n\t\t\t\trd = request.getRequestDispatcher(\"index.jsp\");\n\t\t\t\trd.forward(request, response);\n\t\t\t}\n\t\t}else {\n\t\t\tresponse.sendRedirect(\"back.jsp\");\n\t\t\trequest.getSession().setAttribute(\"flag\", \"login_error\");\n\t\t\trd = request.getRequestDispatcher(\"login.jsp\");\t\t\t\t\n\t\t\trd.forward(request, response);\n\t\t}\n\t}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString uri = req.getRequestURI();\r\n\t\tString action = uri.substring(uri.lastIndexOf('/') + 1);\r\n\t\tsession = req.getSession();\r\n\t\tpath = req.getContextPath();\r\n\t\tpw = resp.getWriter();\r\n\t\tSystem.out.println(uri);\r\n\t\tswitch (action) {\r\n\t\tcase \"check\":\r\n\t\t\ttry {\r\n\t\t\t\tthis.checkAction(req,resp);\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase \"index\":\r\n\t\t\tthis.checkSessionAction(req,resp);\r\n\t\t\tbreak;\r\n\t\tcase \"logout\":\r\n\t\t\tthis.logoutAction(req,resp);\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\r\n\t\t}\r\n\t\treturn;\r\n\t}",
"private void callHandler(String method, HttpServletRequest request, HttpServletResponse response) throws IOException {\n JsonElement payload = getPayload(request, response);\n RequestContext context = new RequestContext(\n request, response, urlVariables, request.getParameterMap(), payload);\n PathNode apiStructure = getApiStructure(method);\n\n if (request.getPathInfo() == null) {\n logger.warn(\"Received \" + method + \" request with empty path.\");\n return;\n }\n\n PathNode.PathNodeResult result = apiStructure.getBindingForSubPath(request.getPathInfo());\n if (result != null) {\n urlVariables.putAll(result.getArgValues());\n result.getApiSpec().apiInterface.call(context);\n }\n }",
"Login.Req getLoginReq();",
"public void handleAuthenticationRequest(RoutingContext context) {\n\n final HttpServerRequest request = context.request();\n\n final String basicAuthentication = request.getHeader(AUTHORIZATION_HEADER);\n\n try {\n\n final String[] auth =\n BasicAuthEncoder.decodeBasicAuthentication(basicAuthentication).split(\":\");\n\n if (auth.length < 2) {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, HTML_CONTENT_TYPE)\n .end(Json.encode(Errors.CREDENTIAL_ERROR.error()));\n\n } else {\n\n final Credential credential = new Credential(auth[0], auth[1]);\n\n authenticationService.authenticate(credential, user -> {\n\n if (null != user) {\n\n tokenService.generateToken(user, token -> {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, HTML_CONTENT_TYPE).end(token);\n\n }, err -> {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(Errors.INTERNAL_ERROR.error()));\n\n });\n\n } else {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(Errors.CREDENTIAL_ERROR.error()));\n\n }\n\n }, err -> {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(err.toError()));\n\n });\n\n\n }\n\n } catch (final Exception e) {\n\n context.response().putHeader(CONTENT_TYPE_HEADER, JSON_CONTENT_TYPE)\n .end(Json.encode(Errors.INVALID_AUTHENTICATION_TOKEN.error()));\n\n\n }\n\n\n\n }",
"protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tUsers inputUser = mapper.readValue(request.getInputStream(), Users.class);\n\t\tString username = inputUser.getUName();\n\t\tString password = inputUser.getPassword();\n\t\t\n\t\t\n\t\tPrintWriter writer = response.getWriter(); //initialize printwriter\n\t\tHttpSession session=request.getSession(); //initialize session\n \n\t\tUsers userCode = service.logIn(username, password);\n\t\t\n\t\tif(userCode.getValue() ==-1)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==-2)\n\t\t{\n\t\t\tresponse.setStatus(200); //CREATED\n\t\t\tresponse.setContentType(\"application/text\");\n\t\t\t \n\t\t}\n\t\tif(userCode.getValue()==3 ||userCode.getValue()==4 )\n\t\t{\n\t\t\t\n\t\t\tsession.setAttribute(\"uid\",userCode.getUserID());\n\t\t\tsession.setAttribute(\"name\",userCode.getFName());\n\t\t\tsession.setAttribute(\"roleid\",userCode.getURole().getRoleID());\n\t\t\t\n\t\t\t//resource = \"/ers/ERequest.view\";\n\t\t\t//request.getRequestDispatcher(resource).forward(request, response);\n\t\t\t//response.sendRedirect(resource);\n\t\t\t//writer.write(\"Welcome Employee\"); \n\t\t}\n\t\tresponse.setStatus(200);\n\t\tresponse.setContentType(\"application/text\");\n\t\twriter.write(userCode.getValue()+\"\");\n\t\t\t\t\n\t}",
"public void doRequest( HttpServletRequest rqs, HttpServletResponse rsp ) throws ServletException, IOException {\n\n StopWatch sw = new StopWatch();\n sw.reset();\n\n sw.start( rqs.getRequestURI() );\n\n Core core = (Core) getServletContext().getAttribute( \"core\" );\n\n logger.debug( \"Query : {}\", rqs.getQueryString() );\n logger.debug( \"URI : {}\", rqs.getRequestURI() );\n logger.debug( \"METHOD : {}\", rqs.getMethod() );\n logger.debug( \"CORE : {}\", core );\n\n /* Instantiating request and response */\n Request request = new Request( rqs, core.getDefaultTemplate() );\n request.setLocaleFromCookie( \"language\" );\n\n Response response = new Response( rsp );\n response.setCharacterEncoding( \"UTF-8\" );\n\n request.setStopWatch( sw );\n\n logger.debug( \"[Parameters] {}\", rqs.getParameterMap() );\n\n /* Instantiating context */\n VelocityContext vc = new VelocityContext();\n vc.put( \"title\", \"\" );\n\n request.setContext( vc );\n request.getContext().put( \"request\", request );\n request.setRequestParts( rqs.getRequestURI().split( \"/\" ) );\n logger.debug( \"------ {} -----\", Arrays.asList( request.getRequestParts() ) );\n\n vc.put( \"currentUrl\", rqs.getRequestURI() );\n\n request.setUser( core.getAnonymousUser() );\n request.setTheme( core.getDefaultTheme() );\n\n request.getStopWatch().stop( rqs.getRequestURI() );\n\n WebResponse r = null;\n if(request.getRequestParts().length > 0 && request.getRequestParts()[0].equalsIgnoreCase(\"static\")) {\n \ttry {\n\t\t\t\tr = ((Autonomous)core.getRoot().getChild(\"static\")).autonomize(request);\n\t\t\t} catch (Throwable e) {\n\t\t\t\tthrow new ServletException(e);\n\t\t\t}\n } else {\n request.getStopWatch().start( \"Authentication\" );\n\n logger.debug( \"THE USER: {}\", request.getUser() );\n\n logger.debug( \"AUTHENTICATING\" );\n try {\n\t core.getAuthentication().authenticate( request, response );\n\t\t\t\n\t\t\t logger.debug( \"THE USER: {}\", request.getUser() );\n\t\t\t request.getStopWatch().stop( \"Getting user\", true );\n\t\t\t\n\t\t\t request.getStopWatch().stop( \"Authentication\" );\n\t\t\t request.getStopWatch().start( \"Render page\" );\n\t\t\n\t\t // Render the page\n\t\t Runner runner = core.render( request );\n\t\t runner.injectContext(request);\n\t\t r = runner.run();\n\t\t request.getUser().setSeen();\n\t\t } catch( CoreException e ) {\n\t\t e.printStackTrace();\n\t\t /*\n\t\t if( response.isRenderingMain() ) {\n\t\t response.renderError( request, e );\n\t\t } else {\n\t\t response.sendError( e.getCode(), e.getMessage() );\n\t\t }\n\t\t */\n\t\t r = new ErrorResponse(e).badRequest();\n\t\t } catch( Throwable e ) {\n\t\t logger.error( \"CAUGHT ERROR\" );\n\t\t e.printStackTrace();\n\t\t generateException( request, rsp.getWriter(), e, e.getMessage() );\n\t\t }\n }\n \n r.respond(request, response);\n\n sw.stop();\n logger.info( \"Request response: {}\", response.getResponse() );\n\n // Render the bottom\n /*\n if( response.isRenderingMain() ) {\n try {\n vc.put( \"seconds\", sw.getSeconds() );\n response.getWriter().print( core.getTemplateManager().getRenderer( request ).render( \"org/seventyeight/web/bottomPage.vm\" ) );\n } catch( TemplateException e ) {\n e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }\n */\n\n //logger.info( sw.print( 1000 ) );\n System.out.println( sw.print( 10000 ) );\n }",
"@SuppressWarnings(\"unchecked\")\r\n\tpublic void execute() {\r\n\t\tlong startTime = System.currentTimeMillis();\r\n\r\n\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\tLOG.debug(String.format(\"Entering AbstractAuthenticator, userid: %s\", ssoUser!=null?ssoUser.getUserName():\"null\"));\r\n\t\t}\r\n\t\tmapHeaderToUserProfileMap();\r\n\r\n\t\tif (AuthenticatorHelper.isVAPLoggedIn(request)) {\r\n\t\t\tString userIdentifier = (String)userProfile.get(AuthenticationConsts.KEY_USER_NAME);\r\n\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\tLOG.debug(String.format(\"User is Logged in, user: %s\", userIdentifier));\r\n\t\t\t}\r\n\t\t\tif (AuthenticatorHelper.isForceCleanupSession(request)) {\r\n\t\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\t\tLOG.debug(String.format(\"Force session clean up, userid: %s\", userIdentifier));\r\n\t\t\t\t}\r\n\t\t\t\tAuthenticatorHelper.cleanupSession(request);\r\n\t\t\t} else if (isDiffUser()) {\r\n\t\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\t\tLOG.debug(String.format(\"Different User, userid: %s\", userIdentifier));\r\n\t\t\t\t}\r\n\t\t\t\tuserProfile.put(AuthenticationConsts.KEY_LAST_LOGIN_DATE,\r\n\t\t\t\t\t\t\t\tnew Date());\r\n\t\t\t\tAuthenticatorHelper.cleanupSession(request);\r\n\t\t\t} else if (isUserRecentUpdated()) {\r\n\t\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\t\tLOG.debug(String.format(\"User is updated, userid: %s\", userIdentifier));\r\n\t\t\t\t}\r\n\t\t\t\t// not cleanup session per CR 86\r\n\t\t\t\t//AuthenticatorHelper.cleanupSession(request);\r\n\t\t\t} else if (AuthenticatorHelper.isForceInitSession(request)) {\r\n\t\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\t\tLOG.debug(String.format(\"Force initSession tag found, userid: %s\", userIdentifier));\r\n\t\t\t\t}\r\n\t\t\t\t// not cleanup session per CR 86\r\n\t\t\t\t//AuthenticatorHelper.cleanupSession(request);\r\n\t\t\t} else if (AuthenticatorHelper.isSiteChanged(request)) {\r\n\t\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\t\tLOG.debug(String.format(\"Site is changed, userid: %s\", userIdentifier));\r\n\t\t\t\t}\r\n\t\t\t\t// not cleanup session per CR 86\r\n\t\t\t\t//AuthenticatorHelper.cleanupSession(request);\r\n\t\t\t} else {\r\n\t\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\t\tLOG.debug(String.format(\"Other Cases, userid: %s\", userIdentifier));\r\n\t\t\t\t}\r\n\t\t\t\t// keep the current HTTP header user profile\r\n\t\t\t\tMap httpHeaderUserProfile = userProfile;\r\n\r\n\t\t\t\t// fetch userProfile from session, only need to refresh this user profile map\r\n\t\t\t\tuserProfile = (Map)request.getSession()\r\n\t\t\t\t\t\t\t\t\t\t .getAttribute(AuthenticationConsts.USER_PROFILE_KEY);\r\n\t\t\t\t// get groups from userProfile\r\n\t\t\t\tList<String> sessionGroups = (List<String>)userProfile.get(AuthenticationConsts.KEY_USER_GROUPS);\r\n\t\t\t\trefreshLocaleRelatedGroups(sessionGroups);\r\n\r\n\t\t\t\t// refresh user timezone\r\n\t\t\t\trefreshUserTimezone(userProfile, httpHeaderUserProfile);\r\n\r\n\t\t\t\tuserName = (String)userProfile.get(AuthenticationConsts.KEY_USER_NAME);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\t\tLOG.debug(String.format(\"User is logging in as: %s\", ssoUser!=null?ssoUser.getUserName():\"null\"));\r\n\t\t\t}\r\n\t\t\tuserProfile.put(AuthenticationConsts.KEY_LAST_LOGIN_DATE,\r\n\t\t\t\t\t\t\tnew Date());\r\n\t\t}\r\n\r\n\r\n\t\t// Set the SPFAuthType attribute before calling group service so the group definitions can\r\n\t\t// use its value.\r\n\t\tsetAuthTypeProfileAttribute();\r\n\r\n\t\ttry {\r\n\t\t\t// Retrieve user group from UGS to SSOUser\r\n\t\t\t// and synchronous to VAP user, and return the\r\n\t\t\t// updated vap user\r\n\t\t\tUser updatedVAPUser = syncVAPUser();\r\n\t\t\tsaveUserProfile2Session(updatedVAPUser);\r\n\t\t\tuserName = ssoUser.getUserName();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tuserName = null;\r\n\t\t\tLOG.error(\"Invoke Authenticator.execute error: \" + ex.getMessage(),\r\n\t\t\t\t\t ex);\r\n\t\t\trequest.getSession()\r\n\t\t\t\t .setAttribute(AuthenticationConsts.SESSION_ATTR_SSO_ERROR,\r\n \"1\");\r\n\t\t\tRequestContext.getThreadInstance()\r\n\t\t\t\t\t\t .getDiagnosticContext()\r\n\t\t\t\t\t\t .setError(ErrorCode.AUTH001, ex.toString());\r\n\t\t}\r\n\t\tif (LOG.willLogAtLevel(LogConfiguration.DEBUG)) {\r\n\t\t\tLOG.debug(String.format(\"Time spent on AbstractAuthenticator.execute (sec): %s for user: %s\", (System.currentTimeMillis()-startTime)/1000, userName));\r\n\t\t}\r\n\t}",
"public void processRequest() throws ServerException {\r\n\t\tint statusCode = 0;\r\n\r\n\t\tSecureDirectory secureDirectory = getSecureDirectory( request.getURI() );\r\n\t\tswitch ( checkAuthentication( secureDirectory ) ) {\r\n\t\tcase NOT_SECURE_DIR:\r\n\t\t\tstatusCode = processNormalRequest( true );\r\n\t\t\tbreak;\r\n\t\tcase NEED_AUTHENTICATE:\r\n\t\t\tstatusCode = sendAuthenticateMessage( secureDirectory );\r\n\t\t\tbreak;\r\n\t\tcase AUTHENTICATED:\r\n\t\t\tstatusCode = processNormalRequest( false );\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tthrow new ServerException( ResponseTable.INTERNAL_SERVER_ERROR );\r\n\t\t}\r\n\r\n\t\tnew AccessLog().log( request, statusCode );\r\n\t}",
"public void login(ActionEvent e) {\n boolean passwordCheck = jf_password.validate();\n boolean emailCheck = jf_email.validate();\n if (passwordCheck && emailCheck) {\n\n\n new LoginRequest(jf_email.getText(), jf_password.getText()) {\n @Override\n protected void success(JSONObject response) {\n Platform.runLater(fxMain::switchToDashboard);\n }\n\n @Override\n protected void fail(String error) {\n Alert alert = new Alert(Alert.AlertType.ERROR, error, ButtonType.OK);\n alert.showAndWait();\n }\n };\n\n\n }\n }",
"public void login(HttpServletRequest req, HttpServletResponse res) throws IOException {\n\n // Client credentials\n Properties p = GlobalSettings.getNode(\"oauth.password-credentials\");\n String clientId = p.getProperty(\"client\");\n String secret = p.getProperty(\"secret\");\n ClientCredentials clientCredentials = new ClientCredentials(clientId, secret);\n\n // User credentials\n String username = req.getParameter(\"username\");\n String password = req.getParameter(\"password\");\n UsernamePassword userCredentials = new UsernamePassword(username, password);\n\n // Create request\n TokenResponse oauth = TokenRequest.newPassword(userCredentials, clientCredentials).post();\n if (oauth.isSuccessful()) {\n PSToken token = oauth.getAccessToken();\n\n // If open id was defined, we can get the member directly\n PSMember member = oauth.getMember();\n if (member == null) {\n member = OAuthUtils.retrieve(token);\n }\n\n if (member != null) {\n OAuthUser user = new OAuthUser(member, token);\n HttpSession session = req.getSession(false);\n String goToURL = this.defaultTarget;\n if (session != null) {\n ProtectedRequest target = (ProtectedRequest)session.getAttribute(AuthSessions.REQUEST_ATTRIBUTE);\n if (target != null) {\n goToURL = target.url();\n session.invalidate();\n }\n }\n session = req.getSession(true);\n session.setAttribute(AuthSessions.USER_ATTRIBUTE, user);\n res.sendRedirect(goToURL);\n } else {\n LOGGER.error(\"Unable to identify user!\");\n res.sendError(HttpServletResponse.SC_FORBIDDEN);\n }\n\n } else {\n LOGGER.error(\"OAuth failed '{}': {}\", oauth.getError(), oauth.getErrorDescription());\n if (oauth.isAvailable()) {\n res.sendError(HttpServletResponse.SC_FORBIDDEN);\n } else {\n res.sendError(HttpServletResponse.SC_BAD_GATEWAY);\n }\n }\n\n }",
"@Override\n public AuthenticatorFlowStatus process(HttpServletRequest request, HttpServletResponse response,\n AuthenticationContext context) throws AuthenticationFailedException {\n if (context.isLogoutRequest()) {\n return AuthenticatorFlowStatus.SUCCESS_COMPLETED;\n }\n\n if (StringUtils.isNotEmpty(request.getParameter(\"tcParam\"))) {\n try {\n processAuthenticationResponse(request, response, context);\n } catch (Exception e) {\n context.setRetrying(true);\n context.setCurrentAuthenticator(getName());\n return initiateAuthRequest(response, context, e.getMessage());\n }\n return AuthenticatorFlowStatus.SUCCESS_COMPLETED;\n } else {\n return initiateAuthRequest(response, context, null);\n }\n }",
"public static void main(String[] args) {\n\t\tString homeUrl= \"http://localhost/upload/login.php\";\r\n\t\tString loginUrl= \"http://localhost/upload/login.php?\";\r\n\t\tString postData= \"forward=&jumpurl=http%3A%2F%2Flocalhost%2Fupload%2Fthread.php%3Ffid%3D10&step=2&lgt=0&pwuser=admin&pwpwd=admin&hideid=0&cktime=31536000\";\r\n\t\t//String ResponseByLogin= new CommonHandler().sendPost(loginUrl, postData);\r\n\t\tnew HttpRequestor().sendGet(homeUrl);\r\n\t\tSystem.out.println(new HttpRequestor().mycookie);\r\n\t\tnew HttpRequestor().sendPost(loginUrl, postData);\r\n\t\tSystem.out.println(\"==============================\");\r\n\t\tSystem.out.println(new HttpRequestor().mycookie);\r\n\t\t\r\n\r\n\t}",
"public JSONObject handleGETRequest(StringParams reqs) {\n String action = reqs.getParam(\"analysis\");\n\n if (action.equals(\"login\")) {\n try {\n clearHandler();\n return LoginHandler.getInstance().login(reqs);\n } catch (ServletException e) {\n e.printStackTrace();\n return wrongJson(\"Unexpected error during login!\");\n } catch (IOException e) {\n e.printStackTrace();\n return wrongJson(\"Unexpected error during login!\");\n }\n } else if (action.equals(\"register\")) {\n return LoginHandler.getInstance().register(reqs);\n } else if (action.equals(\"changePassword\")) {\n return LoginHandler.getInstance().updatePassword(reqs);\n } else if (action.equals(\"forgot_password\")) {\n return PasswordRequest.getInstance().forgotPassword(reqs);\n } else if (action.equals(\"logout\")) {\n clearHandler();\n LoginHandler.getInstance().setUser(null);\n return successUser(null);\n } else {\n if (LoginHandler.getInstance().getUser() == null) {\n return wrongJson(\"No user logged in!\");\n } else if (action.equals(\"getSuppliers\")) {\n return successJsonTable(\"Suppliers retrieved\", SUPPLIERS);\n } else if (action.equals(\"getInvoices\")) {\n return successJsonTable(\"Invoices retrieved\", INVOICES);\n } else if (action.equals(\"getFullUser\")) {\n return successUser(null);\n } else if (action.equals(\"reset_db\")) {\n try {\n DbHandler.getInstance().refreshDatabase();\n } catch (SQLException e) {\n e.printStackTrace();\n return wrongJson(\"Unexpected error while resetting the database!\");\n }\n clearHandler();\n return successUser(\"DBResetOK\");\n } else if (action.equals(\"getUser\")) {\n if (image == null) {\n return successJson(\"First upload an invoice.\");\n } else {\n return successJson(\"hide\");\n }\n } else {\n try {\n return checkFileAndAnalyse(reqs);\n } catch (Exception e) {\n e.printStackTrace();\n return wrongJson(\"Unexpected error while processing request!\");\n }\n }\n }\n }",
"private void login(String username,String password){\n\n }",
"@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }",
"protected void doProcess(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\trequest.setCharacterEncoding(\"utf-8\");\r\n\t\tString requestURI = request.getRequestURI();\r\n\t\tString contextPath = request.getContextPath();\r\n\t\tString command = requestURI.substring(contextPath.length());\r\n\t\tAction action = null;\r\n\t\tActionForward forward = null;\r\n\t\t\r\n\t\tif (command.equals(\"/managerLogin.ma\")) {\r\n\t\t\taction = new ManagerLogInAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (command.equals(\"/managerLogOut.ma\")) {\r\n\t\t\taction = new ManagerLogOutAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (command.equals(\"/memberList.ma\")) {\r\n\t\t\taction = new MemberListAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if (command.equals(\"/managerDelete.ma\")) {\r\n\t\t\taction = new ManagerDeleteFromMemberAction();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tforward = action.execute(request, response);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tif (forward != null) {\r\n\t\t\tif (forward.isRedirect()) {\r\n\t\t\t\tresponse.sendRedirect(forward.getPath());\r\n\t\t\t} else {\r\n\t\t\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(forward.getPath());\r\n\t\t\t\tdispatcher.forward(request, response);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"@Override\n public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {\n LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute(\"dispatcher\");\n if (dispatcher == null) {\n throw new EventHandlerException(\"The local service dispatcher is null\");\n }\n DispatchContext dctx = dispatcher.getDispatchContext();\n if (dctx == null) {\n throw new EventHandlerException(\"Dispatch context cannot be found\");\n }\n\n // get the details for the service(s) to call\n String mode = SYNC;\n String serviceName = null;\n\n if (UtilValidate.isEmpty(event.getPath())) {\n mode = SYNC;\n } else {\n mode = event.getPath();\n }\n\n // we only support SYNC mode in this handler\n if (!SYNC.equals(mode)) {\n throw new EventHandlerException(\"Async mode is not supported\");\n }\n\n // nake sure we have a defined service to call\n serviceName = event.getInvoke();\n if (serviceName == null) {\n throw new EventHandlerException(\"Service name (eventMethod) cannot be null\");\n }\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Set mode/service]: \" + mode + \"/\" + serviceName, MODULE);\n }\n\n // some needed info for when running the service\n Locale locale = UtilHttp.getLocale(request);\n TimeZone timeZone = UtilHttp.getTimeZone(request);\n HttpSession session = request.getSession();\n GenericValue userLogin = (GenericValue) session.getAttribute(\"userLogin\");\n\n // get the service model to generate context(s)\n ModelService modelService = null;\n\n try {\n modelService = dctx.getModelService(serviceName);\n } catch (GenericServiceException e) {\n throw new EventHandlerException(\"Problems getting the service model\", e);\n }\n\n if (modelService == null) {\n throw new EventHandlerException(\"Problems getting the service model\");\n }\n\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Processing]: SERVICE Event\", MODULE);\n }\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Using delegator]: \" + dispatcher.getDelegator().getDelegatorName(), MODULE);\n }\n\n // check if we are using per row submit\n boolean useRowSubmit = request.getParameter(\"_useRowSubmit\") == null ? false\n : \"Y\".equalsIgnoreCase(request.getParameter(\"_useRowSubmit\"));\n\n // check if we are to also look in a global scope (no delimiter)\n boolean checkGlobalScope = request.getParameter(\"_checkGlobalScope\") == null ? true\n : !\"N\".equalsIgnoreCase(request.getParameter(\"_checkGlobalScope\"));\n\n // The number of multi form rows is retrieved\n int rowCount = UtilHttp.getMultiFormRowCount(request);\n if (rowCount < 1) {\n throw new EventHandlerException(\"No rows to process\");\n }\n\n // some default message settings\n String errorPrefixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.error.prefix\", locale);\n String errorSuffixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.error.suffix\", locale);\n String messagePrefixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.message.prefix\", locale);\n String messageSuffixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.message.suffix\", locale);\n\n // prepare the error message and success message lists\n List<Object> errorMessages = new LinkedList<>();\n List<String> successMessages = new LinkedList<>();\n\n boolean eventGlobalTransaction = event.isGlobalTransaction();\n\n // big try/finally to make sure commit or rollback are run\n boolean beganTrans = false;\n String returnString = null;\n try {\n if (eventGlobalTransaction) {\n // start the global transaction\n try {\n beganTrans = TransactionUtil.begin(modelService.getTransactionTimeout() * rowCount);\n } catch (GenericTransactionException e) {\n throw new EventHandlerException(\"Problem starting multi-service global transaction\", e);\n }\n }\n\n // now loop throw the rows and prepare/invoke the service for each\n for (int i = 0; i < rowCount; i++) {\n String curSuffix = UtilHttp.getMultiRowDelimiter() + i;\n boolean rowSelected = false;\n if (UtilValidate.isNotEmpty(request.getAttribute(UtilHttp.getRowSubmitPrefix() + i))) {\n rowSelected = request.getAttribute(UtilHttp.getRowSubmitPrefix() + i) == null ? false\n : \"Y\".equalsIgnoreCase((String) request.getAttribute(UtilHttp.getRowSubmitPrefix() + i));\n } else {\n rowSelected = request.getParameter(UtilHttp.getRowSubmitPrefix() + i) == null ? false\n : \"Y\".equalsIgnoreCase(request.getParameter(UtilHttp.getRowSubmitPrefix() + i));\n }\n\n // make sure we are to process this row\n if (useRowSubmit && !rowSelected) {\n continue;\n }\n\n // build the context\n Map<String, Object> serviceContext = new HashMap<>();\n for (ModelParam modelParam: modelService.getInModelParamList()) {\n String paramName = modelParam.getName();\n\n // Debug.logInfo(\"In ServiceMultiEventHandler processing input parameter [\" + modelParam.name +\n // (modelParam.optional?\"(optional):\":\"(required):\") + modelParam.mode + \"] for service [\" + serviceName + \"]\", MODULE);\n\n // don't include userLogin, that's taken care of below\n if (\"userLogin\".equals(paramName)) continue;\n // don't include locale, that is also taken care of below\n if (\"locale\".equals(paramName)) continue;\n // don't include timeZone, that is also taken care of below\n if (\"timeZone\".equals(paramName)) continue;\n\n Object value = null;\n if (UtilValidate.isNotEmpty(modelParam.getStringMapPrefix())) {\n Map<String, Object> paramMap = UtilHttp.makeParamMapWithPrefix(request, modelParam.getStringMapPrefix(), curSuffix);\n value = paramMap;\n } else if (UtilValidate.isNotEmpty(modelParam.getStringListSuffix())) {\n List<Object> paramList = UtilHttp.makeParamListWithSuffix(request, modelParam.getStringListSuffix(), null);\n value = paramList;\n } else {\n // check attributes; do this before parameters so that attribute which can be changed by code can\n // override parameters which can't\n value = request.getAttribute(paramName + curSuffix);\n\n // first check for request parameters\n if (value == null) {\n String name = paramName + curSuffix;\n\n String[] paramArr = request.getParameterValues(name);\n if (paramArr != null) {\n if (paramArr.length > 1) {\n value = Arrays.asList(paramArr);\n } else {\n value = paramArr[0];\n }\n }\n }\n\n // if the parameter wasn't passed and no other value found, check the session\n if (value == null) {\n value = session.getAttribute(paramName + curSuffix);\n }\n\n // now check global scope\n if (value == null) {\n if (checkGlobalScope) {\n String[] gParamArr = request.getParameterValues(paramName);\n if (gParamArr != null) {\n if (gParamArr.length > 1) {\n value = Arrays.asList(gParamArr);\n } else {\n value = gParamArr[0];\n }\n }\n if (value == null) {\n value = request.getAttribute(paramName);\n }\n if (value == null) {\n value = session.getAttribute(paramName);\n }\n }\n }\n\n // make any composite parameter data (e.g., from a set of parameters {name_c_date, name_c_hour, name_c_minutes})\n if (value == null) {\n value = UtilHttp.makeParamValueFromComposite(request, paramName + curSuffix);\n }\n\n if (value == null) {\n // still null, give up for this one\n continue;\n }\n\n if (value instanceof String && ((String) value).isEmpty()) {\n // interpreting empty fields as null values for each in back end handling...\n value = null;\n }\n }\n // set even if null so that values will get nulled in the db later on\n serviceContext.put(paramName, value);\n\n // Debug.logInfo(\"In ServiceMultiEventHandler got value [\" + value + \"] for input parameter [\" + paramName + \"] for service [\"\n // + serviceName + \"]\", MODULE);\n }\n\n // get only the parameters for this service - converted to proper type\n serviceContext = modelService.makeValid(serviceContext, ModelService.IN_PARAM, true, null, timeZone, locale);\n\n // include the UserLogin value object\n if (userLogin != null) {\n serviceContext.put(\"userLogin\", userLogin);\n }\n\n // include the Locale object\n if (locale != null) {\n serviceContext.put(\"locale\", locale);\n }\n\n // include the TimeZone object\n if (timeZone != null) {\n serviceContext.put(\"timeZone\", timeZone);\n }\n\n // Debug.logInfo(\"ready to call \" + serviceName + \" with context \" + serviceContext, MODULE);\n\n // invoke the service\n Map<String, Object> result = null;\n try {\n result = dispatcher.runSync(serviceName, serviceContext);\n } catch (ServiceAuthException e) {\n // not logging since the service engine already did\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNonNestedMessage());\n } catch (ServiceValidationException e) {\n // not logging since the service engine already did\n request.setAttribute(\"serviceValidationException\", e);\n List<String> errors = e.getMessageList();\n if (errors != null) {\n for (String message: errors) {\n errorMessages.add(\"Service invocation error on row (\" + i + \"): \" + message);\n }\n } else {\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNonNestedMessage());\n }\n } catch (GenericServiceException e) {\n Debug.logError(e, \"Service invocation error\", MODULE);\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNested() + messageSuffixStr);\n }\n\n if (result == null) {\n returnString = ModelService.RESPOND_SUCCESS;\n } else {\n // check for an error message\n String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, \"\", \"\");\n if (UtilValidate.isNotEmpty(errorMessage)) {\n errorMessages.add(errorMessage);\n }\n\n // get the success messages\n if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE))) {\n String newSuccessMessage = (String) result.get(ModelService.SUCCESS_MESSAGE);\n if (!successMessages.contains(newSuccessMessage)) {\n successMessages.add(newSuccessMessage);\n }\n }\n if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE_LIST))) {\n List<String> newSuccessMessages = UtilGenerics.cast(result.get(ModelService.SUCCESS_MESSAGE_LIST));\n for (int j = 0; j < newSuccessMessages.size(); j++) {\n String newSuccessMessage = newSuccessMessages.get(j);\n if (!successMessages.contains(newSuccessMessage)) {\n successMessages.add(newSuccessMessage);\n }\n }\n }\n }\n // set the results in the request\n if ((result != null) && (result.entrySet() != null)) {\n for (Map.Entry<String, Object> rme: result.entrySet()) {\n String resultKey = rme.getKey();\n Object resultValue = rme.getValue();\n\n if (resultKey != null && !ModelService.RESPONSE_MESSAGE.equals(resultKey) && !ModelService.ERROR_MESSAGE.equals(resultKey)\n && !ModelService.ERROR_MESSAGE_LIST.equals(resultKey) && !ModelService.ERROR_MESSAGE_MAP.equals(resultKey)\n && !ModelService.SUCCESS_MESSAGE.equals(resultKey) && !ModelService.SUCCESS_MESSAGE_LIST.equals(resultKey)) {\n //set the result to request w/ and w/o a suffix to handle both cases: to have the result in each iteration and to prevent\n // its overriding\n request.setAttribute(resultKey + curSuffix, resultValue);\n request.setAttribute(resultKey, resultValue);\n }\n }\n }\n }\n } finally {\n if (!errorMessages.isEmpty()) {\n if (eventGlobalTransaction) {\n // rollback the global transaction\n try {\n TransactionUtil.rollback(beganTrans, \"Error in multi-service event handling: \" + errorMessages.toString(), null);\n } catch (GenericTransactionException e) {\n Debug.logError(e, \"Could not rollback multi-service global transaction\", MODULE);\n }\n }\n errorMessages.add(0, errorPrefixStr);\n errorMessages.add(errorSuffixStr);\n StringBuilder errorBuf = new StringBuilder();\n for (Object em: errorMessages) {\n errorBuf.append(em + \"\\n\");\n }\n request.setAttribute(\"_ERROR_MESSAGE_\", errorBuf.toString());\n returnString = \"error\";\n } else {\n if (eventGlobalTransaction) {\n // commit the global transaction\n try {\n TransactionUtil.commit(beganTrans);\n } catch (GenericTransactionException e) {\n Debug.logError(e, \"Could not commit multi-service global transaction\", MODULE);\n throw new EventHandlerException(\"Commit multi-service global transaction failed\");\n }\n }\n if (!successMessages.isEmpty()) {\n request.setAttribute(\"_EVENT_MESSAGE_LIST_\", successMessages);\n }\n returnString = \"success\";\n }\n }\n\n return returnString;\n }",
"protected synchronized void login() {\n\t\tauthenticate();\n\t}",
"@Override\r\n\tpublic void execute(HttpServletRequest request, HttpServletResponse response) throws CommandExeption {\n\r\n\t\tString login;\r\n\t\tString pass;\r\n\t\t\r\n\t\tlogin= request.getParameter(LOGIN);\r\n\t\tpass=request.getParameter(PASSWORD);\r\n\t\t\r\n\t\tif(login==null || login.isEmpty()){\r\n\t\t\tresponse.setContentType(\"text/html\");\r\n\t\t\tPrintWriter pw;\r\n\t\t\ttry {\r\n\t\t\t\tpw = response.getWriter();\r\n\t\t\t\tpw.println(\"<h1>insert login</h1>\");\r\n\t\t\t\tpw.flush();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tthrow new CommandExeption(e);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tif(pass==null || pass.isEmpty()){\r\n\t\t\tresponse.setContentType(\"text/html\");\r\n\t\t\tPrintWriter pw;\r\n\t\t\ttry {\r\n\t\t\t\tpw = response.getWriter();\r\n\t\t\t\tpw.println(\"<h1>insert password</h1>\");\r\n\t\t\t\tpw.flush();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tthrow new CommandExeption(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tString query = \"SELECT* FROM EXAMPLE.LIBRARY_USERS WHERE login ='\" + login + \"'\" + \"&& password = '\" + pass\r\n\t\t\t\t+ \"'\";\r\n\t\t\r\n\t\tConnection conn=null; \r\n\t\t\r\n\t\tResultSet rs=null;\r\n\t\ttry {\r\n\t\t\tconn= getConnection();\r\n\t\t\tStatement stat= conn.createStatement();\r\n\t\t\trs= stat.executeQuery(query);\r\n\t\t\t\r\n\t\t\tif (!rs.next()) {\r\n\t\t\t\t\r\n\t\t\t\tresponse.setContentType(\"text/html\");\r\n\t\t\t\tPrintWriter pw= response.getWriter();\r\n\t\t\t\tpw.println(\"<h1>Wrong username or password</h1>\");\r\n\t\t\t\tpw.flush();\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t} catch (SQLException e1) {\r\n\t\t\tLogger.getLogger(Logination.class.getName()).log(Level.SEVERE\t, null\t, e1);\r\n\t\t} catch (IOException e) {\r\n\t\t\tLogger.getLogger(Logination.class.getName()).log(Level.SEVERE\t, null\t, e);\r\n\t\t}finally {\r\n\t\t\tif(rs!=null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\trs.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\tLogger.getLogger(Logination.class.getName()).log(Level.SEVERE\t, null\t, e);\r\n\t\t\t\t}\r\n\t\t\t}if(conn!=null){\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconn.close();\r\n\t\t\t\t} catch (SQLException e) {\r\n\t\t\t\t\tLogger.getLogger(Logination.class.getName()).log(Level.SEVERE\t, null\t, e);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tUser user= new User();\r\n\t\tuser.setLogin(login);\r\n\t\t\r\n\t\tHttpSession session= request.getSession(true);\r\n\t\tsession.setAttribute(\"user\", user);\r\n\t\t\r\n\t\tRequestDispatcher disp= request.getRequestDispatcher(\"jsp/welcome.jsp\");\r\n\t\ttry {\r\n\t\t\tdisp.forward(request, response);\r\n\t\t} catch (ServletException | IOException e) {\r\n\t\t\tthrow new CommandExeption(e);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}",
"protected void login (HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\n String username = req.getParameter(\"username\");\n String password = req.getParameter(\"password\");\n // invoke userService.login()\n User loginUser = userService.login(new User(null, username, password, null));\n // if null, then fail\n if (loginUser == null) {\n // save information to request domain\n req.setAttribute(\"msg\", \"Username or Password incorrect !\");\n req.setAttribute(\"username\", username);\n // jump to login page dispatcher share the same request information\n req.getRequestDispatcher(\"/pages/user/login.jsp\").forward(req, resp);\n }\n else {\n\n // save user information to Session domain\n req.getSession().setAttribute(\"user\", loginUser);\n req.getRequestDispatcher(\"/pages/user/login_success.jsp\").forward(req, resp);\n }\n\n }",
"private void userLogin(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tString id=request.getParameter(\"user\");\r\n\t\tString pwd=request.getParameter(\"pwd\");\r\n\t\tUserFunctions uf=new UserFunctionsImpl();\r\n\t\tString st=uf.login(id, pwd);\r\n\t\tif(!(st.equals(\"incorrect username\")||st.equals(\"incorrect password\")))\r\n\t\t\t\t{\r\n\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(\"successlogin.jsp\");\r\n\t\trequest.setAttribute(\"name\", st); \r\n dispatcher.forward(request, response);\r\n\t\t\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tRequestDispatcher dispatcher = request.getRequestDispatcher(\"failurelogin.jsp\");\r\n\t\t\t\trequest.setAttribute(\"name\", st); \r\n\t\t dispatcher.forward(request, response);\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t\r\n\t}",
"private boolean handleLogin(String serverMessage){\r\n\t\t// Separating the message STATUS + TOKEN\r\n\t\tString[] messageParts = serverMessage.split(SEPARATOR);\r\n\r\n\t\t// Get status code from message\r\n\t\tint messageStatus = Integer.parseInt(messageParts[0]);\r\n\r\n\t\t//Process status\r\n\t\tswitch (messageStatus) {\r\n\t\tcase REQUEST_OK:\r\n\r\n\t\t\t// Status OK set TOKEN to Authenticated User\r\n\t\t\tSystem.out.println(\"Login request OK\");\r\n\t\t\tcontroller.getModel().getAuthUser().setToken(messageParts[1]);\r\n\t\t\treturn true;\r\n\r\n\t\tcase INCORRECT_REQUEST_FORMAT:\r\n\r\n\t\t\tSystem.err.println(\"Oups! \\nSomethin went wrong!\\n Request format was invalid\");\r\n\t\t\tbreak;\r\n\r\n\t\tcase INCORRECT_USER_OR_PASSWOROD:\r\n\r\n\t\t\tJOptionPane.showMessageDialog(null,\"Username or password is incorrect!\", \"Error\",\r\n\t\t\t\t\tJOptionPane.ERROR_MESSAGE);\r\n\t\t\tbreak;\r\n\r\n\t\tdefault:\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}"
] | [
"0.6960564",
"0.66749084",
"0.65013516",
"0.6393681",
"0.63722605",
"0.6356718",
"0.633208",
"0.6318953",
"0.6313312",
"0.63062775",
"0.6267095",
"0.6233971",
"0.6229542",
"0.6178006",
"0.61661756",
"0.6116712",
"0.6114154",
"0.6108941",
"0.6099534",
"0.6084459",
"0.6066885",
"0.6057555",
"0.60184574",
"0.59738934",
"0.59713954",
"0.595276",
"0.5941565",
"0.59291816",
"0.59240437",
"0.5907308",
"0.5884373",
"0.5876999",
"0.586604",
"0.5847243",
"0.58405685",
"0.5836841",
"0.5830565",
"0.5829257",
"0.58265716",
"0.58260703",
"0.5825371",
"0.58248013",
"0.5822241",
"0.5818607",
"0.58138627",
"0.5806362",
"0.57965183",
"0.579052",
"0.57875204",
"0.577988",
"0.57786936",
"0.57784426",
"0.57717586",
"0.57620174",
"0.57618314",
"0.5753952",
"0.5753612",
"0.5748542",
"0.57330966",
"0.5723004",
"0.5720308",
"0.57081723",
"0.5705355",
"0.5698654",
"0.5696124",
"0.56886744",
"0.5684351",
"0.5683746",
"0.5683271",
"0.5681371",
"0.56810236",
"0.56798947",
"0.5676346",
"0.56745124",
"0.567188",
"0.5670305",
"0.56600434",
"0.56539685",
"0.5653493",
"0.5644408",
"0.56401265",
"0.5638056",
"0.5636741",
"0.563577",
"0.5629116",
"0.5619637",
"0.56162775",
"0.56127286",
"0.56003565",
"0.55976105",
"0.5596893",
"0.5596489",
"0.559275",
"0.55919564",
"0.55917656",
"0.5588974",
"0.55824447",
"0.55805975",
"0.5579916",
"0.55714196"
] | 0.68105096 | 1 |
Logs the user out. Calls a cleanUp() method of the service, if available. | private void logout(String serviceName, long userId)
{
try {
Mediator mediator=_userSessions.get(userId).getMediator();
try { //clean up buffers etc before logout
mediator.invoke(serviceName,CLEAN_UP_METHOD, new Serializable[]{}, connector.preferLocalServices());
} catch (Exception e) {
//pssst, don't bother anyone, if service has no cleanUp method (is not required by service interface)
}
_userSessions.get(userId).getServices().remove(serviceName); //cleanup userSessions
if(_userSessions.get(userId).getServices().size()<=0)
{
_userSessions.remove(userId);
Agent userAgent =l2pNode.getAgent(mediator.getResponsibleForAgentId());
l2pNode.unregisterAgent(userAgent);
((PassphraseAgent)userAgent).lockPrivateKey();//don't know if really necessary
}
} catch (Exception e) {
e.printStackTrace();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"@Override\n\tpublic void logout()\n\t{\n\t\tthis.user = null;\n\t}",
"public void logout() {\n\t\tthis.setCurrentUser(null);\n\t\tthis.setUserLoggedIn(false);\t\t\n\t}",
"public static void Logout(){\n\t\tloginSystem();\r\n\t\t\r\n\t}",
"private void Logout() {\n\n\t\tPreferenceUtil.getInstance(mContext).saveBoolean(\"exitApp\", true);\n\t\tPreferenceUtil.getInstance(mContext).clear();\n\t\tPreferenceUtil.getInstance(mContext).destroy();\n\n\t\tZganLoginService.toClearZganDB();\n\n\t\tstopService(new Intent(mContext, ZganPushService.class));\n\n\t\tsetContentView(R.layout.nullxml);\n\t\tfinish();\n\t\tandroid.os.Process.killProcess(android.os.Process.myPid());\n\n\t\tSystem.exit(0);\n\t}",
"private void signOutUser() {\n mAuth.signOut();\n LoginManager.getInstance().logOut();\n Toast.makeText(ChatMessage.this, \"You have been logout\", Toast.LENGTH_SHORT).show();\n finishAffinity();\n proceed();\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(this, Login.class);\n startActivity(intent);\n finish();\n }",
"private void logOut() {\n mApi.getSession().unlink();\n\n // Clear our stored keys\n clearKeys();\n // Change UI state to display logged out version\n setLoggedIn(false);\n }",
"private void logout() {\n userModel.setLoggedInUser(null);\n final Intent intent = new Intent(this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"public void doLogout() {\n mSingleton.getCookieStore().removeUser(mUser);\n mPreferences.setUser(null);\n new ActivityTable().flush();\n\n //update variables\n mUser = null;\n mLogin = false;\n\n //reset drawer\n restartActivity();\n }",
"public void logOut() {\n sp.edit().clear().commit();\n }",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\t\tdb.deleteUsers();\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(MainActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(Activity_Main.this, Activity_Login.class);\n startActivity(intent);\n finish();\n }",
"public void logOut() {\n\t\tToken.getIstance().setHashPassword(null);\n\t}",
"private void logout()\r\n {\r\n LogoutRequest request = new LogoutRequest();\r\n request.setUsername(username);\r\n this.sendRequest(request);\r\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(MainActivity.this, Login.class);\n startActivity(intent);\n finish();\n }",
"public void Logout() {\n \t\t\t\n \t\t}",
"public static void logout() {\n\t\tif (activeAccount != null) try {\n\t\t\t\n\t\t\tif (authClient != null)\n\t\t\t\tauthClient.logout();\n\t\t\tauthClient = null;\n\t\t\t\n\t\t\tactiveAccount = null;\n\t\t}\n\t\tcatch (IOException ioe) {\n\t\t\tJOptionPane.showMessageDialog(DialogPanel.getTopWindow(), (\"An error occurred while logging out from the GoldenGATE Server at\\n\" + activeAccount.host + \":\" + activeAccount.port + \"\\n\" + ioe.getMessage()), \"Error on Logout\", JOptionPane.ERROR_MESSAGE);\n\t\t}\n\t}",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(getActivity(), LoginActivity.class);\n startActivity(intent);\n getActivity().finish();\n }",
"public void logout(){\n\t\t\n\t\tcurrentUser.logout();\n\t\tcurrentUser = null;\n\t\tchangeViewPort(new GUI_Logout(\"\", \"\", this));\n\t}",
"public void logoutCurrentUser() {\n mAuth.signOut();\n this.loggedInUser = null;\n }",
"public void logOut() {\r\n\t\tthis.modoAdmin = false;\r\n\t\tthis.usuarioConectado = null;\r\n\t}",
"protected void userLoggedOut() {\n\t\tRuvego.userLoggedOut();\n\t\tResultsActivityMenu.userLoggedOut();\n\t\tHistory.newItem(\"homePage\");\n\t}",
"public void logOut() {\n try {\n // getGlobalNavigation().clickSignOut();\n } catch (TimeoutException e) {\n Log.log(\"logOut\", \"page loads for more than 30 seconds\", true);\n }\n }",
"private void logoutUser() {\n session.setLogin(false);\n\n db.deleteUsers();\n\n // Launching the login activity\n Intent intent = new Intent(EscolhaProjeto.this, LoginActivity.class);\n startActivity(intent);\n finish();\n }",
"public void logout () {\n\t\tif (isLoggedIn()) {\n\t\t\tGPPSignIn.sharedInstance().signOut();\n\t\t\tGPGManager.sharedInstance().signOut();\n\t\t}\n\t}",
"public void logout(){\r\n\t\tallUser.remove(this.sessionID);\r\n\t\tthis.sessionID = -1;\r\n\t}",
"private void logoutUser() {\n\t\tsession.setLogin(false);\n\n\n\t\t// Launching the login activity\n\t\tIntent intent = new Intent(EnterActivity.this, LoginActivity.class);\n\t\tstartActivity(intent);\n\t\tfinish();\n\t}",
"private void doLogout() {\r\n\t\tdoctor.setOnline(0);\r\n\t\t// Set doctor as logged out\r\n\t\tdbAdapter.updateDoctor(doctor);\r\n\t\t// Release objects and notify observers\r\n\t\tloggedIn = false;\r\n\t\tnotifyObservers();\r\n\t\tdoctors = null;\r\n\t\tdoctor = null;\r\n\t}",
"public void userLoggedOut(User user) \n\t\t{\n\t\t\tLog.i(\"OpenFeint\", \"User logged out\");\n\t\t\tMainActivity.this.userLoggedOut();\n\t\t}",
"private void logout() {\n LogoutTask mAuthTask = new LogoutTask();\n mAuthTask.execute((Void) null);\n }",
"public void logoff() {\n CNHudsonUtil.logoff(this.cna);\n this.cna = null;\n }",
"private void logout(){\r\n\t\ttry {\r\n\t\t\tserver.rmvClient(user);\r\n\t\t} catch (RemoteException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tSystem.exit(0);\r\n\t}",
"public void userLoggedOut(User user) \n\t\t{\n\t\t\tLog.i(\"OpenFeint\", \"User logged out\");\n\t\t\tMainActivity.this.userLoggedOut();\t\n\t\t}",
"private void logout() {\n getSharedPreferences(HELP_CATEGORIES, MODE_PRIVATE).edit().clear().apply();\n getSharedPreferences(LOGIN, MODE_PRIVATE).edit().putBoolean(IS_LOGGED_IN, false).apply();\n\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder()\n .url(URL + \"/nuh/logout\")\n .build();\n AsyncTask.execute(() -> {\n try {\n client.newCall(request).execute();\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n }",
"private void logout() {\n\t\tParseUser.logOut();\n\n\t\t// Go to the login view\n\t\tstartLoginActivity();\n\t}",
"protected void logout() {\n\t\tActiveUserModel userController = ActiveUserModel.getInstance();\n\t\tuserController.performLogout();\n\n\t\tIntent intent = new Intent(this, LoginActivity.class);\n\t\tstartActivityForResult(intent, LOGIN_ACTIVITY);\n\t}",
"public void logout() {\n \n }",
"public void logoutCurrentUser() {\n currentUser = null;\n }",
"public void logout() {\n\n // Instance, user and token become null\n instance = null;\n user = null;\n authtoken = null;\n\n // Switch all the settings back to true\n isLifeStoryLinesOn = true;\n isFamilyTreeLinesOn = true;\n isSpouseLinesOn = true;\n isFatherSideOn = true;\n isMotherSideOn = true;\n isMaleEventsOn = true;\n isFemaleEventsOn = true;\n\n //Take care of resetting boolean logics use throughout app\n isLoggedIn = false;\n personOrSearch = false;\n startLocation = null;\n eventID = null;\n\n // Clear all lists\n\n people.clear();\n events.clear();\n personEvents.clear();\n currentPersonEvents.clear();\n eventTypes.clear();\n\n childrenMap.clear();\n maleSpouse.clear();\n femaleSpouse.clear();\n paternalAncestorsMales.clear();\n paternalAncestorsFemales.clear();\n maternalAncestorsMales.clear();\n maternalAncestorsFemales.clear();\n }",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n\n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n }\n\n }",
"@Override\n\tpublic void logout() {\n\t\tsessionService.setCurrentUserId(null);\n\t}",
"public void Logout(){\n preferences.edit().remove(userRef).apply();\n }",
"@Override\n\tpublic void logOutUser() {\n\t\t\n\t}",
"private void signOut() {\n mAuth.signOut();\n updateUI(null);\n }",
"public void logOut() {\n\t\t// Close all opened windows and start up the App again\n\t\tcurrentUser = null;\n\t\tcurrentContact = null;\n\t\tjava.awt.Window win[] = java.awt.Window.getWindows();\n\t\tfor (int i = 0; i < win.length; i++) {\n\t\t\twin[i].dispose();\n\t\t}\n\t\tApp.main(null);\n\t}",
"void logoff();",
"private void signOut() {\n mAuth.signOut();\n }",
"@Override\n public void Logout() {\n\t \n }",
"private void logout() {\n //set offline flag\n String uid = FirebaseAuth.getInstance().getCurrentUser().getUid();\n new PostNoSqlDataBase(this).offline(uid);\n\n //logout\n // FirebaseAuth mAuth = FirebaseAuth.getInstance();\n GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)\n .requestIdToken(getString(R.string.default_web_client_id))\n .requestEmail()\n .build();\n\n GoogleSignInClient mGoogleSignInClient = GoogleSignIn.getClient(this, gso);\n mGoogleSignInClient.signOut();\n FirebaseAuth.getInstance().signOut();\n //go to the main activity\n startActivity(new Intent(this, SignUpActivity.class));\n finish();\n }",
"private void logoutHandler() {\n AlertDialog.Builder builder = new AlertDialog.Builder(context, android.R.style.Theme_DeviceDefault_Dialog);\n builder.setTitle(\"Logout?\");\n builder.setMessage(\"Are you sure you want to logout?\");\n builder.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n Util.setLoggedInFlag(false);\n\n HPIApp.getAppContext().stopService(new Intent(HPIApp.getAppContext(), StepService.class));\n\n Intent intent = new Intent(HomeActivity.this, SplashActivity.class);\n startActivity(intent);\n HomeActivity.this.finish();\n }\n });\n\n builder.setNegativeButton(\"Cancel\", new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n dialog.dismiss();\n }\n });\n\n builder.show();\n }",
"public void logout() {\n\n if (WarehouseHelper.warehouse_reserv_context.getUser().getId() != null) {\n //Save authentication line in HisLogin table\n /*\n HisLogin his_login = new HisLogin(\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n WarehouseHelper.warehouse_reserv_context.getUser().getId(),\n String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName()\n + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + WarehouseHelper.warehouse_reserv_context.getUser().getLogin(),\n GlobalVars.APP_HOSTNAME, GlobalMethods.getStrTimeStamp()));\n his_login.setCreateId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n his_login.setWriteId(WarehouseHelper.warehouse_reserv_context.getUser().getId());\n \n \n String str = String.format(Helper.INFO0012_LOGOUT_SUCCESS,\n WarehouseHelper.warehouse_reserv_context.getUser().getFirstName() + \" \" + WarehouseHelper.warehouse_reserv_context.getUser().getLastName()\n + \" / \" + PackagingVars.context.getUser().getLogin(), GlobalVars.APP_HOSTNAME,\n GlobalMethods.getStrTimeStamp());\n his_login.setMessage(str);\n\n str = \"\";\n his_login.create(his_login);\n */\n //Reset the state\n state = new S001_ReservPalletNumberScan();\n\n this.clearContextSessionVals();\n\n connectedUserName_label.setText(\"\");\n\n this.setVisible(false);\n }\n\n }",
"public void removeCurrentUser() {\n currentUser.logout();\n currentUser = null;\n indicateUserLoginStatusChanged();\n }",
"public void onLogout() {\n ParseUser.logOut();\n\n promptForLogin();\n }",
"public void Logout()\n {\n isLoggedIn = false;\n connection.Disconnect(); \n connection = null;\n }",
"private void logout() {\n\t\tgetUI().get().navigate(\"login\");\r\n\t\tgetUI().get().getSession().close();\r\n\t}",
"public void logOut() {\n Logger.d(TAG,\"login#logOut\");\n Logger.d(TAG,\"login#stop reconnecting\");\n //\t\teverlogined is enough to stop reconnecting\n everLogined = false;\n isLocalLogin = false;\n reqLoginOut();\n }",
"static void logout() {\n\t\tserver.clearSharedFiles(username);\n\t\tserver.clearNotSharedFiles(username);\n\t}",
"private void logout() {\n ProgressDialog logoutProgressDialog = new ProgressDialog(ContributionsGalleryActivity.this);\n logoutProgressDialog.setMessage(getResources().getString(R.string.logging_out));\n logoutProgressDialog.setCancelable(false);\n logoutProgressDialog.show();\n ParseUser.logOutInBackground(e -> {\n logoutProgressDialog.dismiss();\n if (e != null) { // Logout has failed\n Snackbar.make(contributionsGalleryRelativeLayout, getResources().getString(R.string.logout_failed), Snackbar.LENGTH_LONG).show();\n }\n else { // Logout has succeeded\n goLoginSignupActivity();\n finish();\n }\n });\n }",
"public void logOutAdministrator() {\n logOutGeneral();\n }",
"public static void logout() {\n userId = -1;\n aisId = -1;\n \n name = \"\";\n role = \"\";\n roleFromDatabase = \"\";\n \n lastAction = LocalDateTime.now().minusYears(100);\n }",
"public void logOut() {\n\t\t//Inform the database that the user want to log out\n\t\tdc.logOutPlayer(activity);\n\t\t\n\t\t/*\n\t\t * Call is made to StartActivity, which surely is in the bottom of activity-stack. Add a flag to clear stack\n\t\t * and from StartActivity a call is made to the Login screen and StartActivity is finished. By doing this we\n\t\t * assure that Login screen is at the bottom of the activity-stack and a press on back button, while placed \n\t\t * on Login screen, will result in that the application is closed\n\t\t */\n\t\tIntent intent = new Intent(activity, StartActivity.class);\n\t\tintent.putExtra(\"finish\", true);\n\t\tintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n\t\tactivity.startActivity(intent);\n\t\tactivity.finish();\n\t}",
"public void logout(){\n SharedPreferences settings = mContext.getSharedPreferences(\"UserData\", 0);\n SharedPreferences.Editor preferencesEditor = settings.edit();\n preferencesEditor.clear();\n preferencesEditor.commit();\n // take user back to login screen\n Intent logoutIntent = new Intent(mContext, LoginActivity.class);\n logoutIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);\n mContext.startActivity(logoutIntent);\n }",
"public static void exit() {\n\t\t\n\t\t//\tlog out\n\t\tlogout();\n\t\t\n\t\t//\tclean up\n\t\taccountNames.clear();\n\t\taccountsByName.clear();\n\t\tdataProvider = null;\n\t\trememberedUserNames = null;\n\t}",
"public void onSignOut() {\n SharedPreferences userPrefs = PreferenceManager.getDefaultSharedPreferences(\n TBLoaderAppContext.getInstance());\n SharedPreferences.Editor editor = userPrefs.edit();\n editor.clear().apply();\n mTbSrnHelper = null;\n mUserPrograms = null;\n }",
"@Override\n protected void onDestroy() {\n super.onDestroy();\n UsersManager.getInstance().saveCurrentUser();\n }",
"private void logout() {\n ((MyApplication)this.getApplication()).setLoggedIn(false);\n// Intent intent = new Intent(this, StartupActivity.class);\n// startActivity(intent);\n }",
"@Override\n public void Destroy() {\n mLoginHandler = null;\n }",
"public void signOut(){\n mAuth.signOut();\n }",
"@Override\n\tpublic void exitSessionUser() {\n\t\tgetThreadLocalRequest().getSession().invalidate();\n\t\t\n\t}",
"public static void logout() {\n try {\n buildSocket();\n ClientService.sendMessageToServer(connectionToServer, ClientService.logoutUser());\n closeSocket();\n } catch (Exception e) {\n e.printStackTrace();\n }\n }",
"@Override\r\n\tpublic void logout() {\n\t\t\r\n\t}",
"private void doLogout() {\n mRtmClient.logout(null);\n MessageUtil.cleanMessageListBeanList();\n }",
"public void systemServiceManagerCleanupUser(int userId) {\n this.mService.mSystemServiceManager.cleanupUser(userId);\n }",
"public void logout() {\n\n $(logOutNavigator).click();\n driver = commonMethods.waitForElement(driver, logOffBtn);\n $(logOffBtn).click();\n $(loadingProgressIcon).should(disappear);\n }",
"public void signOut() {\n ReusableActionsPageObjects.clickOnElement(driver, signOut, logger, \"log out.\");\n }",
"private void logout(){\n ParseUser.logOut();\n removeUserFromPrefs();\n Intent intent = LandingActivity.intent_factory(this);\n startActivity(intent);\n }",
"private void signOut(){\n Log.d(TAG, \"signOut: signing out\");\n FirebaseAuth.getInstance().signOut();\n }",
"public void logoutUser() {\n editor.remove(Is_Login).commit();\n editor.remove(Key_Name).commit();\n editor.remove(Key_Email).commit();\n editor.remove(KEY_CUSTOMERGROUP_ID).commit();\n // editor.clear();\n // editor.commit();\n // After logout redirect user to Loing Activity\n\n }",
"@Step(\"Log out\")\n public void logOut() {\n open();\n sighOutButton.click();\n }",
"public void logout() {\n SharedPreferences sharedPreferences = mCtx.getSharedPreferences(AppConfig.SHARED_PREF_NAME, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.clear();\n editor.apply();\n mCtx.startActivity(new Intent(mCtx, LoginActivity.class));\n }",
"void logout();",
"void logout();",
"@Override\n public void logOut() {\n }",
"public void logout()\n\t\tthrows Exception\n\t{\n\n\t\t// Disconnect from the beamline\n\t\tdisconnect();\n\n\t\t// Set tab to default\n//\t\ttab = getDefaultTab();\n\n\t\tWebiceLogger.info(\"Client logged out: user=\" + getUser()\n\t\t\t\t\t\t\t+ \" sessionId=\" + getSessionId()\n\t\t\t\t\t\t\t+ \" \" + new Date().toString());\n\t}",
"@POST\n\t@Path(\"/LogOutService\")\n\tpublic String logOutService()\n\t{\n\t\tJSONObject object = new JSONObject();\n\t\tUserEntity user = UserEntity.currentUser;\n\t\tif(user == null)\n\t\t\tobject.put(\"Status\", \"Failed\");\n\t\telse\n\t\t{\n\t\t\tobject.put(\"Status\", \"OK\");\n\t\t\tuser = null;\n\t\t}\n\t\treturn object.toString();\n\t}",
"@Override\n\tpublic void logout(user theUser) {\n\t}",
"@Override\r\n public void onClick(View view) {\n new SignOut();\r\n\r\n // stop all services\r\n stopService(new Intent(MainActivity.this,UserDataChangeListener.class));\r\n stopService(new Intent(MainActivity.this,GeofenceService.class));\r\n stopService(new Intent(MainActivity.this,LocationService.class));\r\n\r\n // restart sign in\r\n Intent signIn = new Intent(MainActivity.this,SignIn.class);\r\n startActivity(signIn);\r\n finish();\r\n }",
"void logoutDone();",
"public void logout() {\n getRequest().getSession().invalidate();\n }",
"@Override\n public void onCanceled() {\n\n logOutNow();\n\n }",
"@AfterGroups(groups = {\"SUPER_ADMIN\", \"REGION_ADMIN\", \"OFFICER\"})\n protected void logout() throws Exception {\n final SecurityClient securityClient = SecurityClientFactory.getSecurityClient();\n securityClient.logout();\n }",
"public static void makeUnlogged() {\n\t\tMemberSessionFacade.removeAttribute(ConfigKeys.LOGGED);\n//\t\tControllerUtils.addCookie(ConfigKeys.LOGGED, null);\n\t}",
"@Override\n\tpublic void logout() {\n\t}",
"public static void logout(Activity a) {\n\t\t// Directing to the LogIn page\n\t\tIntent intent = new Intent(a, MainActivity.class);\n\t\tUser.getUser().setToken(\"\");\n\t\tUser.getUser().setUserid(\"\");\n\t\tUser.getUser().setAccounts(null);\n\t\ta.startActivity(intent);\n\t\ta.finish();\t\n\t}",
"public void attemptLogout() {\n spEditor.clear();\n spEditor.putBoolean(LOGGEDIN_KEY, false);\n spEditor.commit();\n }",
"private void signOut () {\n\n //Normal account sign out\n mAuth.signOut();\n //Google account sign out\n mGoogleSignInClient.signOut();\n updateUI(\"Signed out\");\n //Can't open chat without non-empty accountEmail\n accountEmail = \"\";\n }",
"@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tdispose();\n\t\t\t\tUserHandler.logOut();\n\t\t\t}",
"public static void logout() {\n click(MY_ACCOUNT_DROPDOWN);\n click(LOGOUT_BUTTON);\n }",
"public void logout(Principal user) {\n }",
"@AfterAll\r\n public void cleanUp() {\r\n\r\n UserEto savedUserFromDb = this.usermanagement.findUserByName(\"testUser\");\r\n\r\n if (savedUserFromDb != null) {\r\n this.usermanagement.deleteUser(savedUserFromDb.getId());\r\n }\r\n }"
] | [
"0.76209146",
"0.7564835",
"0.7484458",
"0.7478695",
"0.7377405",
"0.7371086",
"0.7357067",
"0.73478144",
"0.7343644",
"0.7297838",
"0.7272645",
"0.7256279",
"0.72493106",
"0.72470695",
"0.7236918",
"0.72348404",
"0.7219814",
"0.72099495",
"0.71980757",
"0.71700734",
"0.71648496",
"0.71460134",
"0.71109694",
"0.7092958",
"0.7085191",
"0.706803",
"0.7067919",
"0.7064247",
"0.70597994",
"0.7053228",
"0.70530057",
"0.7051374",
"0.7032706",
"0.70268697",
"0.70187104",
"0.7008995",
"0.70036304",
"0.69976294",
"0.6979334",
"0.6975243",
"0.69610703",
"0.69596213",
"0.6959574",
"0.69426167",
"0.6915209",
"0.6908404",
"0.6867575",
"0.68538445",
"0.68401784",
"0.6834671",
"0.68273735",
"0.6804974",
"0.679944",
"0.67993325",
"0.6777217",
"0.6763263",
"0.67597806",
"0.67588305",
"0.67454964",
"0.67341167",
"0.6706694",
"0.6705662",
"0.67045283",
"0.6699736",
"0.6693855",
"0.66860694",
"0.6680185",
"0.6674877",
"0.666716",
"0.6660425",
"0.66569036",
"0.6639336",
"0.6633166",
"0.6622172",
"0.66211444",
"0.66187954",
"0.66089314",
"0.65949196",
"0.65787077",
"0.6563346",
"0.6554097",
"0.6554097",
"0.65515006",
"0.6549441",
"0.65493125",
"0.6544605",
"0.65344846",
"0.6528432",
"0.6524138",
"0.65231436",
"0.6521813",
"0.65183985",
"0.6512571",
"0.65099",
"0.6501056",
"0.64705014",
"0.6464258",
"0.64521265",
"0.6446159",
"0.64286226"
] | 0.67825985 | 54 |
Delegates the request data to a service method, which then decides what to do with it (maps it internally) | private boolean invoke(HttpRequest request, HttpResponse response) {
String[] requestSplit=request.getPath().split("/",3);
// first: empty (string starts with '/')
// second: service name
// third: URI rest
String serviceName="";
String methodName="";
String restURI="";
String content="";
try {
serviceName=requestSplit[1];
methodName=REST_DECODER; //special method in service
if(requestSplit.length>=3)
{
int varsstart=requestSplit[2].indexOf('?');
if(varsstart>0)
restURI=requestSplit[2].substring(0,varsstart);
else
restURI=requestSplit[2];
}
content=request.getContentString();
int httpMethodInt=request.getMethod();
String httpMethod="get";
switch (httpMethodInt)
{
case HttpRequest.METHOD_GET:
httpMethod="get";
break;
case HttpRequest.METHOD_HEAD:
httpMethod="head";
break;
case HttpRequest.METHOD_DELETE:
httpMethod="delete";
break;
case HttpRequest.METHOD_POST:
httpMethod="post";
break;
case HttpRequest.METHOD_PUT:
httpMethod="put";
break;
default:
break;
}
if(content==null)
content="";
String[][] variables = {};//extract variables from request
ArrayList<String[]> variablesList=new ArrayList<String[]>();
@SuppressWarnings("rawtypes")
Enumeration en = request.getGetVarNames();
String querystr="";
while(en.hasMoreElements())
{
String param = (String) en.nextElement();
String val= request.getGetVar(param);
String[] pair={param,val};
//connector.logMessage(param+" "+val);
variablesList.add(pair);
querystr+=param+" = "+val+" ";
}
connector.logMessage(request.getMethod()+" "+request.getUrl()+" "+querystr);
variables=variablesList.toArray(new String[variablesList.size()][2]);
//connector.logMessage(content);
Serializable[] parameters={httpMethod,restURI,variables,content};
Serializable result;
Mediator mediator = _userSessions.get(_currentUserId).getMediator();//get registered mediator
result= mediator.invoke(serviceName,methodName, parameters, connector.preferLocalServices());// invoke service method
sendInvocationSuccess ( result, response );
return true;
} catch ( NoSuchServiceException e ) {
sendNoSuchService(request, response, serviceName);
} catch ( TimeoutException e ) {
sendNoSuchService(request, response, serviceName);
} catch ( NoSuchServiceMethodException e ) {
sendNoSuchMethod(request, response);
} catch ( L2pSecurityException e ) {
sendSecurityProblems(request, response, e);
} catch ( ServiceInvocationException e ) {
if ( e.getCause() == null )
sendResultInterpretationProblems(request, response);
else
sendInvocationException(request, response, e);
} catch ( InterruptedException e ) {
sendInvocationInterrupted(request, response);
} catch ( InvalidCodingException e ) {
sendConnectorProblems(request, response, e);
} catch ( CodingException e ) {
sendResultInterpretationProblems(request, response);
} catch (Exception e)
{
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public DataHolder processRequest(DataHolder indataholder) throws java.rmi.RemoteException;",
"abstract protected void doService(HttpServletRequest request,\r\n\t\t\t\t\t\t\t\t\t HttpServletResponse response) throws ServletException, IOException,ApplicationException;",
"@Override\n\tpublic void service(ServletRequest arg0, ServletResponse arg1) throws ServletException, IOException {\n\t\tservice((HttpServletRequest) arg0, (HttpServletResponse) arg1);\n\t}",
"@Override\n protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.service(req, resp);\n logger.log(Level.INFO, \"service(req, resp) Invoked\");\n }",
"@Override\n public String invoke(Event event, RequestMap requestMap, HttpServletRequest request, HttpServletResponse response) throws EventHandlerException {\n LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute(\"dispatcher\");\n if (dispatcher == null) {\n throw new EventHandlerException(\"The local service dispatcher is null\");\n }\n DispatchContext dctx = dispatcher.getDispatchContext();\n if (dctx == null) {\n throw new EventHandlerException(\"Dispatch context cannot be found\");\n }\n\n // get the details for the service(s) to call\n String mode = SYNC;\n String serviceName = null;\n\n if (UtilValidate.isEmpty(event.getPath())) {\n mode = SYNC;\n } else {\n mode = event.getPath();\n }\n\n // we only support SYNC mode in this handler\n if (!SYNC.equals(mode)) {\n throw new EventHandlerException(\"Async mode is not supported\");\n }\n\n // nake sure we have a defined service to call\n serviceName = event.getInvoke();\n if (serviceName == null) {\n throw new EventHandlerException(\"Service name (eventMethod) cannot be null\");\n }\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Set mode/service]: \" + mode + \"/\" + serviceName, MODULE);\n }\n\n // some needed info for when running the service\n Locale locale = UtilHttp.getLocale(request);\n TimeZone timeZone = UtilHttp.getTimeZone(request);\n HttpSession session = request.getSession();\n GenericValue userLogin = (GenericValue) session.getAttribute(\"userLogin\");\n\n // get the service model to generate context(s)\n ModelService modelService = null;\n\n try {\n modelService = dctx.getModelService(serviceName);\n } catch (GenericServiceException e) {\n throw new EventHandlerException(\"Problems getting the service model\", e);\n }\n\n if (modelService == null) {\n throw new EventHandlerException(\"Problems getting the service model\");\n }\n\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Processing]: SERVICE Event\", MODULE);\n }\n if (Debug.verboseOn()) {\n Debug.logVerbose(\"[Using delegator]: \" + dispatcher.getDelegator().getDelegatorName(), MODULE);\n }\n\n // check if we are using per row submit\n boolean useRowSubmit = request.getParameter(\"_useRowSubmit\") == null ? false\n : \"Y\".equalsIgnoreCase(request.getParameter(\"_useRowSubmit\"));\n\n // check if we are to also look in a global scope (no delimiter)\n boolean checkGlobalScope = request.getParameter(\"_checkGlobalScope\") == null ? true\n : !\"N\".equalsIgnoreCase(request.getParameter(\"_checkGlobalScope\"));\n\n // The number of multi form rows is retrieved\n int rowCount = UtilHttp.getMultiFormRowCount(request);\n if (rowCount < 1) {\n throw new EventHandlerException(\"No rows to process\");\n }\n\n // some default message settings\n String errorPrefixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.error.prefix\", locale);\n String errorSuffixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.error.suffix\", locale);\n String messagePrefixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.message.prefix\", locale);\n String messageSuffixStr = UtilProperties.getMessage(\"DefaultMessagesUiLabels\", \"service.message.suffix\", locale);\n\n // prepare the error message and success message lists\n List<Object> errorMessages = new LinkedList<>();\n List<String> successMessages = new LinkedList<>();\n\n boolean eventGlobalTransaction = event.isGlobalTransaction();\n\n // big try/finally to make sure commit or rollback are run\n boolean beganTrans = false;\n String returnString = null;\n try {\n if (eventGlobalTransaction) {\n // start the global transaction\n try {\n beganTrans = TransactionUtil.begin(modelService.getTransactionTimeout() * rowCount);\n } catch (GenericTransactionException e) {\n throw new EventHandlerException(\"Problem starting multi-service global transaction\", e);\n }\n }\n\n // now loop throw the rows and prepare/invoke the service for each\n for (int i = 0; i < rowCount; i++) {\n String curSuffix = UtilHttp.getMultiRowDelimiter() + i;\n boolean rowSelected = false;\n if (UtilValidate.isNotEmpty(request.getAttribute(UtilHttp.getRowSubmitPrefix() + i))) {\n rowSelected = request.getAttribute(UtilHttp.getRowSubmitPrefix() + i) == null ? false\n : \"Y\".equalsIgnoreCase((String) request.getAttribute(UtilHttp.getRowSubmitPrefix() + i));\n } else {\n rowSelected = request.getParameter(UtilHttp.getRowSubmitPrefix() + i) == null ? false\n : \"Y\".equalsIgnoreCase(request.getParameter(UtilHttp.getRowSubmitPrefix() + i));\n }\n\n // make sure we are to process this row\n if (useRowSubmit && !rowSelected) {\n continue;\n }\n\n // build the context\n Map<String, Object> serviceContext = new HashMap<>();\n for (ModelParam modelParam: modelService.getInModelParamList()) {\n String paramName = modelParam.getName();\n\n // Debug.logInfo(\"In ServiceMultiEventHandler processing input parameter [\" + modelParam.name +\n // (modelParam.optional?\"(optional):\":\"(required):\") + modelParam.mode + \"] for service [\" + serviceName + \"]\", MODULE);\n\n // don't include userLogin, that's taken care of below\n if (\"userLogin\".equals(paramName)) continue;\n // don't include locale, that is also taken care of below\n if (\"locale\".equals(paramName)) continue;\n // don't include timeZone, that is also taken care of below\n if (\"timeZone\".equals(paramName)) continue;\n\n Object value = null;\n if (UtilValidate.isNotEmpty(modelParam.getStringMapPrefix())) {\n Map<String, Object> paramMap = UtilHttp.makeParamMapWithPrefix(request, modelParam.getStringMapPrefix(), curSuffix);\n value = paramMap;\n } else if (UtilValidate.isNotEmpty(modelParam.getStringListSuffix())) {\n List<Object> paramList = UtilHttp.makeParamListWithSuffix(request, modelParam.getStringListSuffix(), null);\n value = paramList;\n } else {\n // check attributes; do this before parameters so that attribute which can be changed by code can\n // override parameters which can't\n value = request.getAttribute(paramName + curSuffix);\n\n // first check for request parameters\n if (value == null) {\n String name = paramName + curSuffix;\n\n String[] paramArr = request.getParameterValues(name);\n if (paramArr != null) {\n if (paramArr.length > 1) {\n value = Arrays.asList(paramArr);\n } else {\n value = paramArr[0];\n }\n }\n }\n\n // if the parameter wasn't passed and no other value found, check the session\n if (value == null) {\n value = session.getAttribute(paramName + curSuffix);\n }\n\n // now check global scope\n if (value == null) {\n if (checkGlobalScope) {\n String[] gParamArr = request.getParameterValues(paramName);\n if (gParamArr != null) {\n if (gParamArr.length > 1) {\n value = Arrays.asList(gParamArr);\n } else {\n value = gParamArr[0];\n }\n }\n if (value == null) {\n value = request.getAttribute(paramName);\n }\n if (value == null) {\n value = session.getAttribute(paramName);\n }\n }\n }\n\n // make any composite parameter data (e.g., from a set of parameters {name_c_date, name_c_hour, name_c_minutes})\n if (value == null) {\n value = UtilHttp.makeParamValueFromComposite(request, paramName + curSuffix);\n }\n\n if (value == null) {\n // still null, give up for this one\n continue;\n }\n\n if (value instanceof String && ((String) value).isEmpty()) {\n // interpreting empty fields as null values for each in back end handling...\n value = null;\n }\n }\n // set even if null so that values will get nulled in the db later on\n serviceContext.put(paramName, value);\n\n // Debug.logInfo(\"In ServiceMultiEventHandler got value [\" + value + \"] for input parameter [\" + paramName + \"] for service [\"\n // + serviceName + \"]\", MODULE);\n }\n\n // get only the parameters for this service - converted to proper type\n serviceContext = modelService.makeValid(serviceContext, ModelService.IN_PARAM, true, null, timeZone, locale);\n\n // include the UserLogin value object\n if (userLogin != null) {\n serviceContext.put(\"userLogin\", userLogin);\n }\n\n // include the Locale object\n if (locale != null) {\n serviceContext.put(\"locale\", locale);\n }\n\n // include the TimeZone object\n if (timeZone != null) {\n serviceContext.put(\"timeZone\", timeZone);\n }\n\n // Debug.logInfo(\"ready to call \" + serviceName + \" with context \" + serviceContext, MODULE);\n\n // invoke the service\n Map<String, Object> result = null;\n try {\n result = dispatcher.runSync(serviceName, serviceContext);\n } catch (ServiceAuthException e) {\n // not logging since the service engine already did\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNonNestedMessage());\n } catch (ServiceValidationException e) {\n // not logging since the service engine already did\n request.setAttribute(\"serviceValidationException\", e);\n List<String> errors = e.getMessageList();\n if (errors != null) {\n for (String message: errors) {\n errorMessages.add(\"Service invocation error on row (\" + i + \"): \" + message);\n }\n } else {\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNonNestedMessage());\n }\n } catch (GenericServiceException e) {\n Debug.logError(e, \"Service invocation error\", MODULE);\n errorMessages.add(messagePrefixStr + \"Service invocation error on row (\" + i + \"): \" + e.getNested() + messageSuffixStr);\n }\n\n if (result == null) {\n returnString = ModelService.RESPOND_SUCCESS;\n } else {\n // check for an error message\n String errorMessage = ServiceUtil.makeErrorMessage(result, messagePrefixStr, messageSuffixStr, \"\", \"\");\n if (UtilValidate.isNotEmpty(errorMessage)) {\n errorMessages.add(errorMessage);\n }\n\n // get the success messages\n if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE))) {\n String newSuccessMessage = (String) result.get(ModelService.SUCCESS_MESSAGE);\n if (!successMessages.contains(newSuccessMessage)) {\n successMessages.add(newSuccessMessage);\n }\n }\n if (UtilValidate.isNotEmpty(result.get(ModelService.SUCCESS_MESSAGE_LIST))) {\n List<String> newSuccessMessages = UtilGenerics.cast(result.get(ModelService.SUCCESS_MESSAGE_LIST));\n for (int j = 0; j < newSuccessMessages.size(); j++) {\n String newSuccessMessage = newSuccessMessages.get(j);\n if (!successMessages.contains(newSuccessMessage)) {\n successMessages.add(newSuccessMessage);\n }\n }\n }\n }\n // set the results in the request\n if ((result != null) && (result.entrySet() != null)) {\n for (Map.Entry<String, Object> rme: result.entrySet()) {\n String resultKey = rme.getKey();\n Object resultValue = rme.getValue();\n\n if (resultKey != null && !ModelService.RESPONSE_MESSAGE.equals(resultKey) && !ModelService.ERROR_MESSAGE.equals(resultKey)\n && !ModelService.ERROR_MESSAGE_LIST.equals(resultKey) && !ModelService.ERROR_MESSAGE_MAP.equals(resultKey)\n && !ModelService.SUCCESS_MESSAGE.equals(resultKey) && !ModelService.SUCCESS_MESSAGE_LIST.equals(resultKey)) {\n //set the result to request w/ and w/o a suffix to handle both cases: to have the result in each iteration and to prevent\n // its overriding\n request.setAttribute(resultKey + curSuffix, resultValue);\n request.setAttribute(resultKey, resultValue);\n }\n }\n }\n }\n } finally {\n if (!errorMessages.isEmpty()) {\n if (eventGlobalTransaction) {\n // rollback the global transaction\n try {\n TransactionUtil.rollback(beganTrans, \"Error in multi-service event handling: \" + errorMessages.toString(), null);\n } catch (GenericTransactionException e) {\n Debug.logError(e, \"Could not rollback multi-service global transaction\", MODULE);\n }\n }\n errorMessages.add(0, errorPrefixStr);\n errorMessages.add(errorSuffixStr);\n StringBuilder errorBuf = new StringBuilder();\n for (Object em: errorMessages) {\n errorBuf.append(em + \"\\n\");\n }\n request.setAttribute(\"_ERROR_MESSAGE_\", errorBuf.toString());\n returnString = \"error\";\n } else {\n if (eventGlobalTransaction) {\n // commit the global transaction\n try {\n TransactionUtil.commit(beganTrans);\n } catch (GenericTransactionException e) {\n Debug.logError(e, \"Could not commit multi-service global transaction\", MODULE);\n throw new EventHandlerException(\"Commit multi-service global transaction failed\");\n }\n }\n if (!successMessages.isEmpty()) {\n request.setAttribute(\"_EVENT_MESSAGE_LIST_\", successMessages);\n }\n returnString = \"success\";\n }\n }\n\n return returnString;\n }",
"@Override\n\tpublic void service(ServletRequest arg0, ServletResponse arg1)\n\t\t\tthrows ServletException, IOException\n\t{\n\t\tsuper.service(arg0, arg1);\n\t\trenewObject(arg0, arg1);\n\t\tout.print(\"do my service\");\n\t}",
"protected void service(HttpServletRequest aRequest, HttpServletResponse aResponse) throws ServletException, IOException {\n\tif (aRequest.getAttribute(\"EXTRANET_METHOD\") == null) {\n\t\tsuper.service(aRequest, aResponse);\n\t} else {\n\t\t// If comming from a forward, determine if GET method should be invoked\n\t\tString lMethod = (String) aRequest.getAttribute(\"EXTRANET_METHOD\");\n\t\tif (lMethod != null && lMethod.equals(\"GET\")) {\n\t\t\tdoGet(aRequest, aResponse);\n\t\t} else {\n\t\t\tsuper.service(aRequest, aResponse);\n\t\t}\n\t}\n}",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.service(req, resp);\r\n\t}",
"@Override\n\tprotected void service(HttpServletRequest arg0, HttpServletResponse arg1)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.service(arg0, arg1);\n\t}",
"public Object handleRequest(P request) throws Exception;",
"@Override\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.service(req, resp);\n\t}",
"@Override\n\tpublic void service(ServletRequest req, ServletResponse res)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}",
"@Override\n public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {\n }",
"protected void doService(HttpServletRequest req, HttpServletResponse resp) throws Exception {\r\n // This class has been removed from all places where it was used and replaced by the Spring\r\n // dispatcher from which it inherits. Delegate to super for now in case this ever gets called.\r\n // There is one place that depends on the tool constants above, in CommentListGenerator.\r\n // These constants should be relocated and this class purged.\r\n super.doService(req, resp);\r\n }",
"void requestData();",
"void service(ServletRequest req, ServletResponse res) throws ServletException, IOException;",
"void invoke(Map<String, Object> data, String sender);",
"Object handle(Object request);",
"@Override\n public Object invoke(Object proxy, Method method, Object[] args)\n throws Throwable {\n if (method.getDeclaringClass() == Object.class) {\n return method.invoke(this, args);\n }\n ServiceMethod<Object, Object> serviceMethod =\n (ServiceMethod<Object, Object>) loadServiceMethod(method);\n ServiceCall<Object> serviceCall = new ServiceCall<>(serviceMethod, args);\n return serviceMethod.adapt(serviceCall, args);\n }",
"@Override\r public SpiServiceResult handle(SpiServiceProvider provider, SpiServiceRequest request) {",
"@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\n\t}",
"@Override\n public byte[] callMethod(String methodName, byte[] requestData) throws RemoteException\n {\n final ServiceData<? extends Writer> serviceData = serviceImpl.callMethod(methodName, requestData, null);\n return serviceData.getByteArray();\n }",
"private void callHandler(String method, HttpServletRequest request, HttpServletResponse response) throws IOException {\n JsonElement payload = getPayload(request, response);\n RequestContext context = new RequestContext(\n request, response, urlVariables, request.getParameterMap(), payload);\n PathNode apiStructure = getApiStructure(method);\n\n if (request.getPathInfo() == null) {\n logger.warn(\"Received \" + method + \" request with empty path.\");\n return;\n }\n\n PathNode.PathNodeResult result = apiStructure.getBindingForSubPath(request.getPathInfo());\n if (result != null) {\n urlVariables.putAll(result.getArgValues());\n result.getApiSpec().apiInterface.call(context);\n }\n }",
"public interface ICommonAction {\n\n void obtainData(Object data, String methodIndex, int status,Map<String, String> parameterMap);\n\n\n}",
"@Override\r\n\tprotected void doService(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tSystem.out.println(\"in child doService\");\r\n\t\t\r\n\t}",
"public interface ServiceRequest<T> extends Serializable {\r\n\t\r\n\t/**\r\n\t * Gets the service name for this request\r\n\t * @return the valid service name\r\n\t */\r\n\tpublic String getServiceName();\r\n\t\r\n\t/**\r\n\t * Gets the service version.\r\n\t * @return the service version as string\r\n\t */\r\n\tpublic String getServiceVersion();\r\n\t\r\n\t/**\r\n\t * Set the version of the service for this request.\r\n\t * @param serviceVersion\r\n\t */\r\n\tpublic void setServiceVersion(String serviceVersion);\r\n\t \r\n\t/**\r\n\t * Gets the request body data aka paylod for the request\r\n\t * @return the request data\r\n\t */\r\n\tpublic T getRequestData();\r\n\t\r\n\t/**\r\n\t * Returns the security context around this request.\r\n\t * @return the security context for this request\r\n\t */\r\n\tpublic SecurityContext getSecurityContext();\r\n\t\r\n\t/**\r\n\t * Returns all headers.\r\n\t * @return the array of headers\r\n\t */\r\n\tpublic Header[] getHeaders();\r\n\t\r\n\t/**\r\n\t * Returns the header object if the header with a specified key is present.\r\n\t * @param key The key for which value has to be returned\r\n\t * @return the value of the specified key\r\n\t */\r\n\tpublic Header getHeaderByKey(String key);\t\r\n}",
"protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\treq.setCharacterEncoding(\"utf-8\");\n\t\tString method = req.getParameter(\"method\");\n//\t\tSystem.out.println(\"PPPPPPPPPPPPPPP\");\n\t\tif (\"Time_qunee\".equals(method)) {\n\t\t\ttry {\n\t\t\t\tTime_qunee(req, resp);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse if (\"Time_qunee_pre\".equals(method)) {\n\t\t\ttry {\n\t\t\t\tTime_qunee_pre(req, resp);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse if (\"Time_qunee_fold\".equals(method)) {\n\t\t\ttry {\n\t\t\t\tTime_qunee_fold(req, resp);\n\t\t\t} catch (SQLException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse if(\"Create_root_json\".equals(method)) {\n\t\t\tresp.setCharacterEncoding(\"utf-8\");\n\t\t\tresp.getWriter().write(DataServlet.createRootInfoJson());\n\t\t}\n\t\telse if(\"Create_montior_json\".equals(method)) {\n\t\t\tresp.setCharacterEncoding(\"utf-8\");\n\t\t\tresp.getWriter().write(DataServlet.createMontiorInfoJson());\n\t\t}\n\t}",
"void processRequest(RequestInfo<T, O> requestInfo, Class<T> TClass, Class<O> OClass, boolean invalidateCache);",
"public interface HttpRequestService {\n\n String get(String url,HashMap<String,String> params) throws IOException;\n\n String get(String url) throws IOException;\n\n String post(String url,HashMap<String,String> params) throws Exception;\n\n}",
"@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}",
"@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"public abstract void dataFromEOJ(Service service);",
"protected void service(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tString actionType=req.getParameter(\"actionType\");\n\t\tif(actionType.equals(\"query\"))\n\t\t{\n\t\t\tquery(req,resp);\n\t\t}\n\t\tif(actionType.equals(\"kanweizhang\"))\n\t\t{\n\t\t\tkanweizhang(req,resp);\n\t\t}\n\t\tif(actionType.equals(\"tuiweizhang\"))\n\t\t{\n\t\t\ttuiweizhang(req,resp);\n\t\t}\n\t\t\n\t\tif(actionType.equals(\"querywenlei\"))\n\t\t{\n\t\t\tquerywenlei(req,resp);\n\t\t}\n\t}",
"@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}",
"public interface ApiService {\n @POST(\"/AutoComplete/autocomplete/json\")\n void placeAuto(@Query(\"input\") String input, @Query(\"key\") String key, Callback<AutoComplete> callback);\n\n @POST(\"/geocode/json\")\n void getLatLng(@Query(\"address\") String address, @Query(\"key\") String key, Callback<GeocodingMain> callback);\n\n @POST(\"/directions/json\")\n void getroute(@Query(\"origin\") String origin, @Query(\"destination\") String destination, @Query(\"key\") String key, Callback<Directions> callback);\n\n @POST(\"/geocode/json\")\n void reverseGeoCoding(@Query(\"latlng\") String latLng, @Query(\"key\") String key, Callback<RevGeocodingMain> callback);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n}",
"public T getRequestData();",
"@Override\n protected void service(HttpServletRequest req, HttpServletResponse resp) {\n OData odata = OData.newInstance();\n ServiceMetadata edm = odata.createServiceMetadata(new DemoEdmProvider(), new ArrayList<EdmxReference>());\n ODataHttpHandler handler = odata.createHandler(edm);\n handler.register(new DemoEntityCollectionProcessor());\n\n // let the handler do the work\n handler.process(req, resp);\n }",
"WebClientServiceRequest serviceRequest();",
"public interface ServiceInput {\n // base interface for all inputs\n // Generally the attributes that go in this base are RequestContext that has context information like user details, authorizations, calling application details etc).\n // This information is generally setup by the filters that intercept the request and set on ThreadLocal. The REST entry points\n // can grab them using util methods to pass on to create the input\n //\n\n // At this point I am having this class as a marker interface to communicate the idea. If we proceed in this direction, we could create a base class that has such\n // attributes.\n}",
"public void preinvoke(ServerServiceDesc serviceDesc, RequestMetaContext reqMetaCtx, ResponseMetaContext respMetaCtx) throws ServiceException;",
"protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoPost(request, response);\n\t}",
"Call mo35727a(Request request);",
"public void invoke(ServerServiceDesc serviceDesc, RequestMetaContext reqMetaCtx, ResponseMetaContext respMetaCtx) throws ServiceException;",
"@Override\r\n\t\t\tpublic String doService(String param) {\n\t\t\t\treturn null;\r\n\t\t\t}",
"void applyResponses(ReaderContext context, Operation operation, Method method);",
"public void doService() {\n }",
"public Response internalInvocation(HttpRequest request, HttpResponse response, Object entity)\n {\n ResteasyProviderFactory.addContextDataLevel();\n boolean pushedBody = false;\n try\n {\n MessageBodyParameterInjector.pushBody(entity);\n pushedBody = true;\n ResourceInvoker invoker = getInvoker(request);\n if (invoker != null)\n {\n pushContextObjects(request, response);\n return getResponse(request, response, invoker);\n }\n \n // this should never happen, since getInvoker should throw an exception\n // if invoker is null\n return null;\n }\n finally\n {\n ResteasyProviderFactory.removeContextDataLevel();\n if (pushedBody)\n {\n MessageBodyParameterInjector.popBody();\n }\n }\n }",
"@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\t\tthis.request = arg0;\n\t}",
"private ResponseEntity<String> processServiceMetadata(final Service sMetadata, final ExecuteServiceData data)\n\t\t\tthrows InterruptedException {\n\t\tObjectMapper objectMapper = new ObjectMapper();\n\t\tString requestMimeType = MIME_TYPE;\n\n\t\tString rawURL = sMetadata.getUrl();\n\t\tlogger.log(String.format(\"Executing Service with URL %s with ID %s\", rawURL, data.getServiceId()), Severity.INFORMATIONAL);\n\t\tUriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(rawURL);\n\n\t\tMap<String, DataType> postObjects = new HashMap<>();\n\t\tIterator<Entry<String, DataType>> it = data.getDataInputs().entrySet().iterator();\n\t\tString postString = \"\";\n\n\t\twhile (it.hasNext()) {\n\t\t\tEntry<String, DataType> entry = it.next();\n\t\t\tString inputName = entry.getKey();\n\t\t\tlogger.log(\"The parameter is \" + inputName, Severity.DEBUG);\n\n\t\t\tif (entry.getValue() instanceof URLParameterDataType) {\n\t\t\t\tString paramValue = ((URLParameterDataType) entry.getValue()).getContent();\n\n\t\t\t\tbuilder = processURLParameterDataTypeMetadata(paramValue, inputName, sMetadata, builder);\n\t\t\t} else if (entry.getValue() instanceof BodyDataType) {\n\t\t\t\tBodyDataType bdt = (BodyDataType) entry.getValue();\n\t\t\t\tpostString = bdt.getContent();\n\t\t\t\trequestMimeType = bdt.getMimeType();\n\t\t\t\tif ((requestMimeType == null) || (requestMimeType.length() == 0)) {\n\t\t\t\t\tlogger.log(\"Body mime type not specified\", Severity.ERROR);\n\t\t\t\t\treturn new ResponseEntity<>(\"Body mime type not specified\", HttpStatus.BAD_REQUEST);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default behavior for other inputs, put them in list of objects\n\t\t\t\t// which are transformed into JSON consistent with default requestMimeType\n\t\t\t\tlogger.log(\"inputName =\" + inputName + \"entry Value=\" + entry.getValue(), Severity.INFORMATIONAL);\n\t\t\t\tpostObjects.put(inputName, entry.getValue());\n\t\t\t}\n\t\t}\n\n\t\tlogger.log(\"Final Builder URL\" + builder.toUriString(), Severity.INFORMATIONAL);\n\t\tif (postObjects.size() > 0) {\n\n\t\t\tif (postString.length() > 0) {\n\t\t\t\tlogger.log(\"String Input not consistent with other Inputs\", Severity.ERROR);\n\t\t\t\treturn new ResponseEntity<>(\"String Input not consistent with other Inputs\", HttpStatus.BAD_REQUEST);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tpostString = objectMapper.writeValueAsString(postObjects);\n\t\t\t} catch (JsonProcessingException e) {\n\t\t\t\tLOG.error(\"Json processing error occurred\", e);\n\t\t\t\tlogger.log(e.getMessage(), Severity.ERROR);\n\t\t\t\treturn new ResponseEntity<>(\"Could not marshal post requests\", HttpStatus.BAD_REQUEST);\n\t\t\t}\n\t\t}\n\n\t\tlogger.log(String.format(\"Triggered execution of service %s\", sMetadata.getServiceId()), Severity.INFORMATIONAL,\n\t\t\t\tnew AuditElement(\"serviceController\", \"executingExternalService\", sMetadata.getServiceId()));\n\n\t\treturn executeJob(sMetadata.getMethod(), requestMimeType, builder.toUriString(), postString);\n\t}",
"public interface TicketCodeService {\r\n public JSONObject createCode(Map<String, Object> source);\r\n}",
"public interface IMailboxUsageMailboxCountsRequest extends IHttpRequest {\n\n /**\n * Gets the MailboxUsageMailboxCounts from the service\n *\n * @param callback the callback to be called after success or failure\n */\n void get(final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Gets the MailboxUsageMailboxCounts from the service\n *\n * @return the MailboxUsageMailboxCounts from the request\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts get() throws ClientException;\n\n /**\n * Delete this item from the service\n *\n * @param callback the callback when the deletion action has completed\n */\n void delete(final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Delete this item from the service\n *\n * @throws ClientException if there was an exception during the delete operation\n */\n void delete() throws ClientException;\n\n /**\n * Patches this MailboxUsageMailboxCounts with a source\n *\n * @param sourceMailboxUsageMailboxCounts the source object with updates\n * @param callback the callback to be called after success or failure\n */\n void patch(final MailboxUsageMailboxCounts sourceMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Patches this MailboxUsageMailboxCounts with a source\n *\n * @param sourceMailboxUsageMailboxCounts the source object with updates\n * @return the updated MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts patch(final MailboxUsageMailboxCounts sourceMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the new object to create\n * @param callback the callback to be called after success or failure\n */\n void post(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the new object to create\n * @return the created MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts post(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the object to create/update\n * @param callback the callback to be called after success or failure\n */\n void put(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts, final ICallback<? super MailboxUsageMailboxCounts> callback);\n\n /**\n * Posts a MailboxUsageMailboxCounts with a new object\n *\n * @param newMailboxUsageMailboxCounts the object to create/update\n * @return the created MailboxUsageMailboxCounts\n * @throws ClientException this exception occurs if the request was unable to complete for any reason\n */\n MailboxUsageMailboxCounts put(final MailboxUsageMailboxCounts newMailboxUsageMailboxCounts) throws ClientException;\n\n /**\n * Sets the select clause for the request\n *\n * @param value the select clause\n * @return the updated request\n */\n IMailboxUsageMailboxCountsRequest select(final String value);\n\n /**\n * Sets the expand clause for the request\n *\n * @param value the expand clause\n * @return the updated request\n */\n IMailboxUsageMailboxCountsRequest expand(final String value);\n\n}",
"public interface RequestHandler {\n\tpublic Map<String,Object> handleRequest(Map<String,Object> request,\n\t\t\t InetAddress client);\n}",
"void handleRequest();",
"@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\nSystem.err.println(\"=====================>>>>>123\");\n\t\tString key=req.getParameter(\"method\");\n\t\tswitch (key) {\n\t\tcase \"1\":\n\t\t\tgetProvinces(req,resp);\n\t\t\tbreak;\n\t\tcase \"2\":\n\t\t\tgetCities(req,resp);\t\t\t\n\t\t\tbreak;\n\t\tcase \"3\":\n\t\t\tgetAreas(req,resp);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\n\t}",
"public void request() {\n }",
"public void handleRequest(Request req) {\n\n }",
"public abstract void observeSpecificData(Service service);",
"public interface DeviceOperateService {\n public int opValve(Integer userid,String house_code,Integer open,Integer islock,JSONObject resultObj);\n\n public int setBuildingValve(Integer userid, Map<String,String> paramters,JSONObject resultObj);\n\n public int opBuildingValve(Integer userid, Map<String,String> paramters,JSONObject resultObj);\n\n public int readBuildingValveSet(Integer userid, Map<String,String> paramters,JSONObject resultObj);\n}",
"TransferInitiateResponse initiateProviderRequest(DataRequest dataRequest);",
"@Override\n public void onCallInformationRequestRequest(CallInformationRequestRequest arg0) {\n\n }",
"@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}",
"private void processRequest(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response) {\n\r\n\t}",
"@Service(value = SimpleTravelDao.class, locator = DaoServiceLocator.class)\npublic interface SimpleTravelRequest extends RequestContext {\n\n\t/**\n\t * Count simple travels.\n\t *\n\t * @return the request\n\t */\n\tRequest<Long> countSimpleTravels();\n\n\t/**\n\t * Find all simple travels.\n\t *\n\t * @return the request\n\t */\n\tRequest<List<SimpleTravelProxy>> findAllSimpleTravels();\n\n\t/**\n\t * Find simple travel.\n\t *\n\t * @param id the id\n\t * @return the request\n\t */\n\tRequest<SimpleTravelProxy> findSimpleTravel(Long id);\n\n\t/**\n\t * Save journey passenger.\n\t *\n\t * @param steps the steps\n\t * @param originAddress the origin address\n\t * @param destinationAddress the destination address\n\t * @param date the date\n\t * @param departureStart the departure start\n\t * @param departureEnd the departure end\n\t * @param arrival the arrival\n\t * @param id the id\n\t * @param comment the comment\n\t * @param distance the distance\n\t * @param duration the duration\n\t * @param mapUrl the map url\n\t * @return the request\n\t */\n\tRequest<SimpleTravelProxy> saveJourneyPassenger(List<String> steps,\n\t\t\tString originAddress, String destinationAddress, Date date,\n\t\t\tDate departureStart, Date departureEnd, Date arrival, Long id,\n\t\t\tString comment, double distance, double duration, String mapUrl);\n\n\t/**\n\t * Persist.\n\t *\n\t * @param simpleTravel the simple travel\n\t * @return the request\n\t */\n\tRequest<Long> persist(SimpleTravelProxy simpleTravel);\n\n\t/**\n\t * Removes the.\n\t *\n\t * @param simpleTravel the simple travel\n\t * @return the request\n\t */\n\tRequest<Void> remove(SimpleTravelProxy simpleTravel);\n\n\t/**\n\t * Gets the simple travels.\n\t *\n\t * @param steps the steps\n\t * @param departureStart the departure start\n\t * @param departureEnd the departure end\n\t * @param arrival the arrival\n\t * @param distanceMax the distance max\n\t * @param totalDistance the total distance\n\t * @return the simple travels\n\t */\n\tRequest<List<SimpleTravelProxy>> getSimpleTravels(List<String> steps,\n\t\t\tDate departureStart, Date departureEnd, Date arrival,\n\t\t\tfloat distanceMax, double totalDistance);\n\n\t/**\n\t * Gets the simple travels from user.\n\t *\n\t * @param userId the user id\n\t * @return the simple travels from user\n\t */\n\tRequest<List<SimpleTravelProxy>> getSimpleTravelsFromUser(Long userId);\n\n\t/**\n\t * Update simple travel.\n\t *\n\t * @param simpleTravel the simple travel\n\t * @param statusDriver the status driver\n\t * @param statusPassenger the status passenger\n\t * @return the request\n\t */\n\tRequest<Void> updateSimpleTravel(Long simpleTravel, String statusDriver,\n\t\t\tString statusPassenger);\n\n}",
"@Override\n\tpublic void handle(OperationRequest req, Context context) throws SoapClientException {\n\n\t\tObject responseInstance = context.getResponseInstance();\n\t\tMap<String, Holder<?>> resultHolders = context.getResultHolders();\n\t\t\n\t\tfor (Map.Entry<String, Holder<?>> resultHolder: resultHolders.entrySet()) {\n\t\t\tString setterName = \"set\" + Character.toUpperCase(resultHolder.getKey().charAt(0)) + resultHolder.getKey().substring(1);\n\t\t\tMethod[] meths = responseInstance.getClass().getMethods();\n\t\t\tMethod setter = null;\n\t\t\tfor (Method meth: meths) {\n\t\t\t\tif (meth.getName().equals(setterName)) {\n\t\t\t\t\tsetter = meth;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (setter == null) {\n\t\t\t\tLog.debug(\"Unable to find a setter method - falling back to field named \" + resultHolder.getKey());\n\t\t\t\tField field;\n\t\t\t\ttry {\n\t\t\t\t\tfield = responseInstance.getClass().getDeclaredField(resultHolder.getKey());\n\t\t\t\t} catch (NoSuchFieldException | SecurityException e) {\n\t\t\t\t\tthrow new SoapClientException(\"Unable to successfully get field \" + resultHolder.getKey() + \" due to \" + e.getClass().getSimpleName() + \": \" + e.getMessage(), e);\n\t\t\t\t}\n\t\t\t\tif (field.getType() == List.class) {\n\t\t\t\t\tfield.setAccessible(true);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfield.set(responseInstance, resultHolder.getValue().value);\n\t\t\t\t\t} catch (IllegalArgumentException | IllegalAccessException e) {\n\t\t\t\t\t\tthrow new SoapClientException(\"Unable to inoke setter on result holder due to \" + e.getClass().getSimpleName() + \": \" + e.getMessage(), e);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthrow new SoapClientException(\"Field \" + resultHolder.getKey() + \" was not of type List\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLog.debug(\"Invoking setter method \" + setterName + \" with value \" + resultHolder.getValue().value);\n\t\t\t\ttry {\n\t\t\t\t\tsetter.invoke(responseInstance, resultHolder.getValue().value);\n\t\t\t\t} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {\n\t\t\t\t\tthrow new SoapClientException(\"Unable to inoke setter on result holder due to \" + e.getClass().getSimpleName() + \": \" + e.getMessage(), e);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"@Service(value = UserInfoDetailsDao.class, locator = DaoServiceLocator.class)\npublic interface UserInfoDetailsRequest extends RequestContext {\n\t\n\t/**\n\t * Count user info details.\n\t *\n\t * @return the request\n\t */\n\tRequest<Long> countUserInfoDetails();\n\n\t/**\n\t * Find all user info details.\n\t *\n\t * @return the request\n\t */\n\tRequest<List<UserInfoDetailsProxy>> findAllUserInfoDetails();\n\n\t/**\n\t * Find user info details.\n\t *\n\t * @param id the id\n\t * @return the request\n\t */\n\tRequest<UserInfoDetailsProxy> findUserInfoDetails(Long id);\n\n\t/**\n\t * Persist.\n\t *\n\t * @param userDetails the user details\n\t * @return the request\n\t */\n\tRequest<Long> persist(UserInfoDetailsProxy userDetails);\n\n\t/**\n\t * Removes the.\n\t *\n\t * @param userDetails the user details\n\t * @return the request\n\t */\n\tRequest<Void> remove(UserInfoDetailsProxy userDetails);\n\n\t/**\n\t * Find details from user.\n\t *\n\t * @param id the id\n\t * @return the request\n\t */\n\tRequest<UserInfoDetailsProxy> findDetailsFromUser(Long id);\n\n\t/**\n\t * Gets the passenger list.\n\t *\n\t * @param passengers the passengers\n\t * @return the passenger list\n\t */\n\tRequest<List<UserInfoDetailsProxy>> getPassengerList(List<Long> passengers);\n\n\t/**\n\t * Channel.\n\t *\n\t * @param id the id\n\t * @return the request\n\t */\n\tRequest<UserInfoDetailsProxy> channel(Long id);\n\n\t/**\n\t * Modify user info details.\n\t *\n\t * @param id the id\n\t * @param firstName the first name\n\t * @param lastName the last name\n\t * @param language the language\n\t * @return the request\n\t */\n\tRequest<UserInfoDetailsProxy> modifyUserInfoDetails(Long id,\n\t\t\tString firstName, String lastName, String language);\n\n\t/**\n\t * Adds the message to user.\n\t *\n\t * @param id the id\n\t * @param messageId the message id\n\t * @return the request\n\t */\n\tRequest<UserInfoDetailsProxy> addMessageToUser(Long id, Long messageId);\n\n\t/**\n\t * Delete message.\n\t *\n\t * @param id the id\n\t * @param messageId the message id\n\t * @return the request\n\t */\n\tRequest<UserInfoDetailsProxy> deleteMessage(Long id, Long messageId);\n\n}",
"public interface CoreServiceInvoker {\n\n\n GWRequest processRequest(Object requestData, InterfaceMapper mapper);\n\n /**\n * 处理请求信息\n */\n GWRequest processRequest(Object requestData, InterfaceMapper mapper, boolean needPackage);\n\n /**\n * 调用核心方法\n */\n GWResponse invoke(GWRequest request, boolean needPackage);\n\n /**\n * 处理返回信息\n */\n Object analysisResponse(GWRequest request, GWResponse response);\n Object analysisResp(GWRequest request, GWResponse response);\n}",
"public interface Data {\n\n String getRequest();\n\n}",
"private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n HttpResponseHandler<AmazonServiceException> errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }",
"public void handleRequest(ExtractionRequest request);",
"private <X, Y extends AmazonWebServiceRequest> Response<X> doInvoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {\n\n if (discoveredEndpoint != null) {\n request.setEndpoint(discoveredEndpoint);\n request.getOriginalRequest().getRequestClientOptions().appendUserAgent(\"endpoint-discovery\");\n } else if (uriFromEndpointTrait != null) {\n request.setEndpoint(uriFromEndpointTrait);\n } else {\n request.setEndpoint(endpoint);\n }\n\n request.setTimeOffset(timeOffset);\n\n DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallersMap, defaultUnmarshaller);\n\n return client.execute(request, responseHandler, errorResponseHandler, executionContext);\n }",
"@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}",
"@Override\n public byte[] handleStringWebRequest(int httpMethod, String requestURL, String queryString,\n String capabilities, String requestData, String[] responseContentType, int[] respDataType)\n throws IOException, AutomationException {\n serverLog.addMessage(3, 200,\n \"Request received in Sample Object Interceptor for handleStringWebRequest\");\n\n /*\n * Add code to manipulate OGC (WMS, WFC, WCS etc) requests here\n */\n\n IWebRequestHandler webRequestHandler = soiHelper.findWebRequestHandlerDelegate(so);\n if (webRequestHandler != null) {\n return webRequestHandler.handleStringWebRequest(httpMethod, requestURL, queryString,\n capabilities, requestData, responseContentType, respDataType);\n }\n\n return null;\n }",
"public interface DataAnalyseService {\n JSONArray getDataOperateTimesInDay(String dataName,String month,String year);\n JSONArray getDataOperateTimesInMonth(String dataName,String year);\n JSONArray getDataOperateTimesInYear(String dataName);\n JSONArray getDataOperateTimesByType(String dataName);\n\n JSONObject getHotData();\n JSONObject getLikeData(String dataName);\n\n JSONObject getUserRecommendData(String userName);\n}",
"public abstract void handle(Request request, Response response) throws Exception;",
"private void processRequest(HttpServletRequest request, HttpServletResponse response) {\n }",
"@Override\n\tpublic List<Map<String,String>> dispatchRequest(Map<String, String[]> request) {\n\n\t\t// ********* LOGGING ********* \n\t\tSystem.out.println(\"reached DispatchRequest\");\n\t\tSystem.out.println(\"Request Keys : \");\n\t\tSystem.out.println(request.keySet());\n\t\t// ********* LOGGING ********* \n\n\n\t\tString classPrefix = request.get(\"requestID\")[0]; \n\n\t\t// ********* LOGGING ********* \n\t\tSystem.out.println(\"class name : \"+PACKAGE_NAME+classPrefix+CLASS_SUFFIX);\n\t\t// ********* LOGGING ********* \n\n\t\t// obtain class reference\t\t\n\t\tiManagementRequestHandlerObject = (IManagementRequestHandler) \n\t\t\t\tiReflectionManagerObject.getClass(PACKAGE_NAME+classPrefix+CLASS_SUFFIX);\n\n\t\t// ********* LOGGING *********\n\t\tSystem.out.println(\"object reference : \"+ iManagementRequestHandlerObject);\n\t\t// ********* LOGGING *********\n\n\t\t// Delegate the request to the appropriate class.\n\t\treturn (iManagementRequestHandlerObject.handleManagementRequest(request));\n\n\t}",
"private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {\n\n executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));\n\n return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {\n\n executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));\n\n return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {\n\n executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));\n\n return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {\n\n executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));\n\n return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);\n }",
"private <X, Y extends AmazonWebServiceRequest> Response<X> invoke(Request<Y> request, HttpResponseHandler<AmazonWebServiceResponse<X>> responseHandler,\n ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {\n\n executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));\n\n return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);\n }",
"public AnnotationRpcHandler(Method method, Object service, ProtobufRPCService protobufPRCService) {\n super(method, service, protobufPRCService);\n if (getInputClass() != null) {\n inputCodec = ProtobufProxy.create(getInputClass());\n }\n if (getOutputClass() != null) {\n outputCodec = ProtobufProxy.create(getOutputClass());\n }\n\n serviceSignature = ServiceSignatureUtils.makeSignature(getServiceName(), getMethodName());\n\n }",
"protected void doInvocation(){\n org.omg.CORBA.portable.Delegate delegate=StubAdapter.getDelegate(\n _target);\n // Initiate Client Portable Interceptors. Inform the PIHandler that\n // this is a DII request so that it knows to ignore the second\n // inevitable call to initiateClientPIRequest in createRequest.\n // Also, save the RequestImpl object for later use.\n _orb.getPIHandler().initiateClientPIRequest(true);\n _orb.getPIHandler().setClientPIInfo(this);\n InputStream $in=null;\n try{\n OutputStream $out=delegate.request(null,_opName,!_isOneWay);\n // Marshal args\n try{\n for(int i=0;i<_arguments.count();i++){\n NamedValue nv=_arguments.item(i);\n switch(nv.flags()){\n case ARG_IN.value:\n nv.value().write_value($out);\n break;\n case ARG_OUT.value:\n break;\n case ARG_INOUT.value:\n nv.value().write_value($out);\n break;\n }\n }\n }catch(Bounds ex){\n throw _wrapper.boundsErrorInDiiRequest(ex);\n }\n $in=delegate.invoke(null,$out);\n }catch(ApplicationException e){\n // REVISIT - minor code.\n // This is already handled in subcontract.\n // REVISIT - uncomment.\n //throw new INTERNAL();\n }catch(RemarshalException e){\n doInvocation();\n }catch(SystemException ex){\n _env.exception(ex);\n // NOTE: The exception should not be thrown.\n // However, JDK 1.4 and earlier threw the exception,\n // so we keep the behavior to be compatible.\n throw ex;\n }finally{\n delegate.releaseReply(null,$in);\n }\n }",
"@Override\r\n\tpublic void callMethod(MethodDescriptor method, RpcController controller, Message request, Message responsePrototype, RpcCallback<Message> done) {\n\t\t\r\n\t}",
"boolean service(Request request, Response response) throws IOException;",
"@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}",
"public interface ReceiveThirdDataService {\n\n /**\n * 解析第三数据,每叫号业务推送\n *\n * @param courtTakeNumPojo\n * @return\n */\n RestApiMsg<String> transferThirdData(CourtTakeNumPojo courtTakeNumPojo, HttpServletRequest request);\n}",
"public void onSuccessFetching(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public void onSuccessFetching(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"@Override\n public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {\n if (method.getName().equals(\"toString\") || method.getName().equals(\"hashCode\")) {\n return methodProxy.invokeSuper(o, objects);\n }\n logger.debug(\"Start microservice method {} in {}\", method.getName(), o.toString());\n\n List<String> result = new ArrayList<>();\n result.add(\"Ivan\");\n result.add(\"Petr\");\n\n logger.debug(\"End microservice method {} in {}\", method.getName(), o.toString());\n return result;\n }",
"@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (SQLException ex) {\n Logger.getLogger(loadServices.class.getName()).log(Level.SEVERE, null, ex);\n }\n }",
"public interface ServiceApi\n{\n @GET(\"{list}\")\n Call<ResponseBody> request(@Path(\"list\") String postfix, @QueryMap HashMap<String, Object> params);\n}",
"public interface RequestFunction {}",
"@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}",
"public interface IMsgService {\n\n public String executeMsg(HttpServletRequest request);\n\n\n}",
"@Override\n public void ParseRequestBean() {\n\n }",
"@FunctionalInterface\npublic interface ParamsHandlerFunc extends BaseHandlerFunc{\n\n default String handleRequest(Request request, Response response) {\n String check = checkSign(request);\n if (StringUtils.isNotBlank(check)) {\n return check;\n }\n Map<String, String> id = request.params();\n Answer processed = process(id);\n response.status(processed.getCode());\n return dataToJson(processed);\n }\n\n Answer process(Map<String, String> data);\n}",
"void onRequest(Member member, Map<String, ?> input, JSONObject output);"
] | [
"0.6449826",
"0.6423911",
"0.64041126",
"0.63938725",
"0.63524723",
"0.6322673",
"0.62390393",
"0.61942077",
"0.61916476",
"0.6181436",
"0.61719465",
"0.61361",
"0.6108828",
"0.60777086",
"0.60448873",
"0.5971751",
"0.59547025",
"0.59514236",
"0.59185195",
"0.5916416",
"0.58996505",
"0.587154",
"0.58678067",
"0.5847093",
"0.58348715",
"0.5826815",
"0.5820882",
"0.58138674",
"0.5810789",
"0.5804643",
"0.57933354",
"0.5757381",
"0.5724824",
"0.57165223",
"0.5694564",
"0.5684571",
"0.56773883",
"0.56771094",
"0.5675823",
"0.56612283",
"0.56599915",
"0.5654517",
"0.5653515",
"0.56507903",
"0.56376976",
"0.56254196",
"0.55971164",
"0.559636",
"0.5590209",
"0.55682147",
"0.55632925",
"0.5553513",
"0.5546323",
"0.55440927",
"0.5542101",
"0.5510358",
"0.550668",
"0.550398",
"0.5502399",
"0.54943216",
"0.54937035",
"0.54909074",
"0.5486649",
"0.5483612",
"0.54733485",
"0.547024",
"0.54681283",
"0.54580116",
"0.54580116",
"0.54580116",
"0.54580116",
"0.54280597",
"0.5414363",
"0.5411896",
"0.5411845",
"0.54107744",
"0.5408953",
"0.5397381",
"0.53965986",
"0.53885967",
"0.53885967",
"0.53885967",
"0.53885967",
"0.53885967",
"0.538047",
"0.53790593",
"0.53745407",
"0.53660136",
"0.5364257",
"0.5353075",
"0.53508717",
"0.53508717",
"0.5347211",
"0.5329768",
"0.53229314",
"0.5317388",
"0.53163296",
"0.53162766",
"0.5314131",
"0.53138363",
"0.53121465"
] | 0.0 | -1 |
send a response, that the connector has problems to interpret the incoming invocation request | private void sendConnectorProblems(HttpRequest request,
HttpResponse response, Exception e) {
response.clearContent();
response.setStatus( HttpResponse.STATUS_NOT_ACCEPTABLE );
response.setContentType( "text/plain" );
response.println ( "The invocation parameters could not be read!" );
response.println ( "Exception-Message: " + e.getMessage() );
connector.logError("Request coding exception in invocation request " + request.getPath());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void sendResultInterpretationProblems(HttpRequest request,\n\t\t\tHttpResponse response) {\n\t\t// result interpretation problems\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\tresponse.println (\"the result of the method call is not transferable!\");\n\t\tconnector.logError(\"Exception while processing RMI: \" + request.getPath());\n\t}",
"void faild_response();",
"private void sendInvocationInterrupted(HttpRequest request,\n\t\t\tHttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus (HttpResponse.STATUS_INTERNAL_SERVER_ERROR );\n\t\tresponse.setContentType ( \"text/plain\");\n\t\tresponse.println ( \"The invoction has been interrupted!\");\n\t\tconnector.logError(\"Invocation has been interrupted!\");\n\t}",
"public Object handleCommandResponse(Object response) throws RayoProtocolException;",
"private void sendInvocationException(HttpRequest request,\n\t\t\tHttpResponse response, ServiceInvocationException e) {\n\t\t// internal exception in service method\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\tconnector.logError(\"Exception while processing RMI: \" + request.getPath());\n\t\t\n\t\tObject[] ret = new Object[4];\n\t\tret[0] = \"Exception during RMI invocation!\";\n\t\t\n\t\tret[1] = e.getCause().getCause().getClass().getCanonicalName();\n\t\tret[2] = e.getCause().getCause().getMessage();\n\t\tret[3] = e.getCause().getCause();\n\t\tString code = ret[0]+\"\\n\"+ret[1]+\"\\n\"+ret[2]+\"\\n\"+ret[3];\n\t\tresponse.println ( code );\n\t}",
"@Override\n\tpublic void sendResponse() {\n\t\t\n\t}",
"void receiveResponse(String invocationId, HttpResponse response);",
"@Override\n public void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation) {\n }",
"private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_FOUND );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The method you requested is not known to this service!\" );\n\t\tconnector.logError(\"Invocation request \" + request.getPath() + \" for unknown service method\");\n\t}",
"@Override\n\tpublic void sendResponse() {\n\n\t}",
"public void sendResponse( Resolver resolver ){\n /*\n * Default handling for a response:\n * send it to the toMachine. If the destination is not a reference \n * to a machine, the response just gets dropped. 'Nowhere' is a good\n * non-reference to use in this case.\n */\n Pia.debug(this, \"Transmitting response...\");\n\n Machine machine = toMachine();\n \n if ( machine!= null ){\n try{\n\tmachine.sendResponse(this, resolver);\n }catch(PiaRuntimeException e){\n\tPia.debug(this, \"User stop\" );\n\t//errorResponse( e.getMessage() );\n }\n }\n else{\n Pia.debug(this, \"dropping response\" );\n }\n \n }",
"public static void handleResponse(HttpCarbonMessage requestMsg, HttpCarbonMessage responseMsg) {\n try {\n requestMsg.respond(responseMsg);\n } catch (ServerConnectorException e) {\n throw new HttpSourceAdaptorRuntimeException(\"Error occurred during response\", e);\n }\n }",
"@Override\n\t\t\t\t\tpublic void httpFail(String response) {\n\t\t\t\t\t}",
"protected abstract void askResponse();",
"private void sendInternalErrorResponse(HttpResponse response,\n\t\t\tString answerMessage, String logMessage) {\n\t\tresponse.clearContent();\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );\n\t\tresponse.println ( answerMessage );\n\t\tconnector.logMessage ( logMessage );\n\t}",
"@Override\r\n\tpublic Response invoke() {\n\t\treturn null;\r\n\t}",
"public String receiveResponse()\n\t{\n\t\t\n\t}",
"public Object answer(InvocationOnMock invocation) throws Throwable {\n return craftResponse(invocation);\n }",
"@Override\r\n\tpublic String execute(String request) {\n\t\treturn response = \"The command is invalid\";\r\n\r\n\t}",
"@Override\n\tpublic void handleResponse() {\n\t\t\n\t}",
"public void invoke() throws Exception, IOException {\n java.io.PrintWriter out = response.getWriter();\n out.println(\"Welcome to ping\");\n return;\n}",
"public void processBlockwiseResponseTransferFailed() {\n //to be overridden by extending classes\n }",
"private void sendSecurityProblems(HttpRequest request,\n\t\t\tHttpResponse response, L2pSecurityException e) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_FORBIDDEN );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"You don't have access to the method you requested\" );\n\t\tconnector.logError(\"Security exception in invocation request \" + request.getPath());\n\t\t\n\t\tif ( System.getProperty(\"http-connector.printSecException\") != null\n\t\t\t\t&& System.getProperty( \"http-connector.printSecException\").equals ( \"true\" ) )\n\t\t\te.printStackTrace();\n\t}",
"public void handleResponse(byte[] result, Command originalCommand);",
"protected void unexpectedReply() throws IOException {\n sendBye();\n throw new IOException(\"Unexpected reply from server \" + _reply_command);\n }",
"RequestSender onFailure(Consumer<Message> consumer);",
"private void err(Messenger replyTo, int encoderId, Bundle info) {\n\n // obtain new message\n Message message = obtainMessage(Geotracer.MESSAGE_TYPE_ERROR, encoderId, 0);\n message.setData(info);\n\n // send response\n send(replyTo, message);\n }",
"public abstract void onReceiveResponse(ExchangeContext context);",
"@Override\n \t\t\t\tpublic void finished(Response response) {\n \t\t\t\t\tLog.w(\"myApp\", response.getResult() + \" \" + response.getError());\n \t\t\t\t}",
"@Override\n \t\t\t\tpublic void finished(Response response) {\n \t\t\t\t\tLog.w(\"myApp\", response.getResult() + \" \" + response.getError());\n \t\t\t\t}",
"void sendResponseMessage(HttpResponse response) throws IOException;",
"protected void responseFail(){\n\t\tqueue.clear();\n\t}",
"public void serverSideOk();",
"public Response callback() throws Exception;",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\r\n\tprotected void processRespond() {\n\r\n\t}",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"@Override\r\n\t\t\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\t\t\tsToast(\"失败\");\r\n\t\t\t\t\t}",
"public void handleInvocationException(\n\t\t\tMessageExchangeInvocationException exception) {\n\t\tlogger.info(\"Handliing the invocation exception( \"\n\t\t\t\t+ \"\\n\\ttargetService: \" + exception.getTargetService()\n\t\t\t\t+ \"\\n\\tsender: \" + exception.getSender() + \")\");\n\t\t// retrieve exception message\n\t\tDocument excpDoc = createInvocationExceptionDocument(exception);\n\t\t// retrieve the session\n\t\tMessageSession session = exception.getSession();\n\t\tif (session == null) {\n\t\t\tlogger.error(\"Can't get the exchange session according to exchange\");\n\t\t\t// do nothing currently\n\t\t\treturn;\n\t\t}\n\t\t// set the response document into the exchange\n\t\tMessageExchange rootExchange = session.getRootExchange();\n\n\t\ttry {\n\t\t\tNormalizedMessage outMessage = rootExchange.createMessage();\n\t\t\toutMessage.setContent(new DOMSource(excpDoc));\n\n\t\t\t// MessageExchangeImpl impl = (MessageExchangeImpl)rootExchange;\n\t\t\t// impl.setOutMessage(outMessage);\n\t\t\t((MessageExchangeImpl) rootExchange).setOutMessage(outMessage);\n\t\t\t// send the exchange\n\t\t\tthis.sendResponse(rootExchange);\n\t\t} catch (MessagingException e) {\n\t\t\tlogger.error(\"Can't create the Normalized Message!\", e);\n\t\t}\n\t}",
"void endNegotiation(String reason);",
"protected HttpResponse doReceiveResponse(final HttpRequest request, final HttpClientConnection conn,\n final HttpContext context)\n throws HttpException, IOException\n {\n// log.debug(\"EspMeshHttpRequestExecutor::doReceiveResponse()\");\n if (request == null)\n {\n throw new IllegalArgumentException(\"HTTP request may not be null\");\n }\n if (conn == null)\n {\n throw new IllegalArgumentException(\"HTTP connection may not be null\");\n }\n if (context == null)\n {\n throw new IllegalArgumentException(\"HTTP context may not be null\");\n }\n \n HttpResponse response = null;\n int statuscode = 0;\n \n // check whether the request is instantly, instantly request don't wait the response\n boolean isInstantly = request.getParams().isParameterTrue(EspHttpRequest.ESP_INSTANTLY);\n if (isInstantly)\n {\n ProtocolVersion version = new ProtocolVersion(\"HTTP\", 1, 1);\n StatusLine statusline = new BasicStatusLine(version, 200, \"OK\");\n // let the connection used only once to check whether the device is available\n context.setAttribute(\"timeout\", 1);\n response = ResponseFactory.newHttpResponse(statusline, context);\n Header contentLengthHeader = new BasicHeader(HTTP.CONTENT_LEN, \"0\");\n response.addHeader(contentLengthHeader);\n }\n else\n {\n if (!request.getRequestLine().getMethod().equals(EspHttpRequest.METHOD_COMMAND))\n {\n while (response == null || statuscode < HttpStatus.SC_OK)\n {\n \n response = conn.receiveResponseHeader();\n if (canResponseHaveBody(request, response))\n {\n conn.receiveResponseEntity(response);\n }\n statuscode = response.getStatusLine().getStatusCode();\n \n } // while intermediate response\n }\n else\n {\n ProtocolVersion version = new ProtocolVersion(\"HTTP\", 1, 1);\n StatusLine statusline = new BasicStatusLine(version, 200, \"OK\");\n response = ResponseFactory.newHttpResponse(statusline, context);\n // copy request headers\n // Header[] requestHeaders = request.getAllHeaders();\n // for (Header requestHeader : requestHeaders) {\n // System.out.println(\"requestHeader:\" + requestHeader);\n // response.addHeader(requestHeader);\n // }\n \n Header[] contentLengthHeader = request.getHeaders(HTTP.CONTENT_LEN);\n if (contentLengthHeader == null || contentLengthHeader.length != 1)\n {\n throw new IllegalArgumentException(\"contentLengthHeader == null || contentLengthHeader.length != 1\");\n }\n // at the moment, mesh command request and response len is the same\n response.addHeader(contentLengthHeader[0]);\n \n conn.receiveResponseEntity(response);\n }\n }\n \n // for device won't reply \"Connection: Keep-Alive\" by default, add the header by manual\n if (response != null && response.getFirstHeader(HTTP.CONN_DIRECTIVE) == null)\n {\n response.addHeader(HTTP.CONN_DIRECTIVE, HTTP.CONN_KEEP_ALIVE);\n }\n \n return response;\n \n }",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"@Override\r\n\t\t\tpublic void sendResponse(String string) {\n\t\t\t\t\r\n\t\t\t}",
"protected void invokeInternal(XTeeMessage<Document> request, XTeeMessage<Element> response) throws Exception {\n throw new IllegalStateException(\"You must override either the 'invokeInternal' or the 'invokeInternalEx' method!\");\n }",
"@Override\n public void sendResponse(final Response response) {\n\n }",
"private void __getReply() throws IOException\n {\n __getReply(true); // tagged response\n }",
"@Override\r\n\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\tsToast(\"失败\");\r\n\t\t\t}",
"@Override\r\n\tprotected void processRespond() throws SGSException {\n\r\n\t}",
"public void handleResponseInternal(long connection, Object obj) {\n JResponse response = (JResponse) obj;\n Logger.m1416d(TAG, \"Action - handleResponse - connection:\" + connection + \", response:\" + response.toString());\n if (connection != NetworkingClient.sConnection.get()) {\n Logger.m1432w(TAG, \"Response connection is out-dated. \");\n }\n Long rid = response.getHead().getRid();\n Requesting origin = dequeSentQueue(rid);\n if (origin == null) {\n Logger.m1432w(TAG, \"Not found the request in SentQueue when response.\");\n } else {\n rid = origin.request.getHead().getRid();\n endSentTimeout(rid);\n }\n Requesting requesting = (Requesting) this.mRequestingCache.get(rid);\n if (requesting != null) {\n endRequestTimeout(requesting);\n } else {\n Logger.m1432w(TAG, \"Not found requesting in RequestingCache when response.\");\n }\n }",
"public void sendResponse(ResponseNetObject response){\r\n\r\n sendObject(response);\r\n\r\n }",
"public void startResponse()\n\t\t\t{\n\t\t\t\tsend(\"<response>\", false);\n\t\t\t}",
"@Override\n\t\t\tpublic void handleError(ClientHttpResponse response) throws IOException {\n\t\t\t\t\n\t\t\t}",
"@Override\r\n\tpublic void service(Request request,Response response) {\n\t\tresponse.print(\"lalaa\");\r\n\r\n\t\t\r\n\t}",
"@Override\n public void sendError(int arg0) throws IOException {\n\n }",
"public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String s) {\n/* 152 */ UPNPService.logger.warning(\"unable to map port for \" + port.toString());\n/* 153 */ port.addException(port.toString(), new Exception(s));\n/* */ }",
"public void sendResponse(){\n\n //DropItPacket dropPkt = new DropItPacket(Constants.PONG.toString());\n // Send out a dropit Packet\n Channel channel = e.getChannel();\n ChannelFuture channelFuture = Channels.future(e.getChannel());\n ChannelEvent responseEvent = new DownstreamMessageEvent(channel, channelFuture, packet, channel.getRemoteAddress());\n// System.out.println(\"===== sending to\" + channel.getRemoteAddress().toString());\n try{\n ctx.sendDownstream(responseEvent);\n }catch (Exception ex){\n System.out.println(\"Node: \" + fileServer.getNode().getPort() + \" sending to\"+\n channel.getRemoteAddress().toString() +\"failed! \" + ex.toString());\n }\n }",
"@Override\n\tpublic void processRequest(HttpRequest request, HttpResponse response) throws Exception {\n\t\tresponse.setHeaderField( \"Server-Name\", \"Las2peer 0.1\" );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\t\n\t\t\n\t\t\n\t\tif(authenticate(request,response))\n\t\t\tif(invoke(request,response));\n\t\t\t\t//logout(_currentUserId);\n\t \n\t\n\t\t//connector.logMessage(request.toString());\n\t\t\n\t\t\n\t}",
"@Override\n\t\t\t\tpublic void finished(Response response) {\n\t\t\t\t\tLog.w(\"myApp\", response.getResult() + \" \" + response.getError());\n\t\t\t\t}",
"public void sendResponse(MessageExchange exchange) {\n\t\tdoSend(exchange);\n\t}",
"@SuppressLint(\"CallbackMethodName\")\n void reply(@NonNull byte[] response);",
"String getResponse(String state, String message, Throwable throwable);",
"public void sendErrorResponse(MessageExchange exchange) {\n\t\tdoSend(exchange);\n\t}",
"@Override\n public void sendError(int arg0, String arg1) throws IOException {\n\n }",
"void responseSent( C conn ) ;",
"protected abstract void handleOk();",
"@Override\n\t\t\tpublic void onBizFailure(String responseDescription, JSONObject data, String flag) {\n\n\t\t\t}",
"public abstract String getResponse();",
"protected void writeRemoteInvocationResult(HttpExchange exchange, RemoteInvocationResult result)\n/* */ throws IOException\n/* */ {\n/* 143 */ exchange.getResponseHeaders().set(\"Content-Type\", getContentType());\n/* 144 */ exchange.sendResponseHeaders(200, 0L);\n/* 145 */ writeRemoteInvocationResult(exchange, result, exchange.getResponseBody());\n/* */ }",
"public void get(HttpRequest request, HttpResponse response) {\n\t\tresponse.setStatus(HttpStatus.SERVER_ERROR_NOT_IMPLEMENTED);\n\t\tresponse.write(\" \");\n\t}",
"void stubNextResponse(HttpExecuteResponse nextResponse);",
"void errorResponse( String error );",
"void action(String response, GameChatEvent cause) throws InterruptedException, IOException;",
"public void respondToError(Object source, String msg);",
"public void postInvoke(InvocationContext ic) throws Exception {\n ic.setResponse(response);\n }",
"public void sendResponse(ChannelHandlerContext ctx, CorfuMsg inMsg, CorfuMsg outMsg) {\n outMsg.copyBaseFields(inMsg);\n ctx.writeAndFlush(outMsg);\n log.trace(\"Sent response: {}\", outMsg);\n }",
"private void errorNotEnoughPointsForRoute(Response response) {\n System.out.println(\"Error in server request.\");\n String error = \"Для маршрута нужно как минимум две точки.\";\n JSONObject errorObject = new JSONObject();\n errorObject.put(\"wkt\", JSONObject.NULL);\n errorObject.put(\"error_message\", error);\n response.setContentType(\"application/json\");\n response.setBody(errorObject);\n System.out.println(\"Error to client: \" + errorObject.toString());\n System.out.println(\"end of post\");\n }",
"protected void sendFailureMessage(Request request, IOException e) {\n\t\tsendMessage(obtainMessage(HttpConsts.REQUEST_FAIL, new Object[] {request, e}));\n\t}",
"void receiveResponse(V response);",
"protected HttpResponse executeRequest(\n\t\t\tRPCRequest invocation, MethodInvocation originalInvocation) throws Exception {\n\t\treturn executeRequest(invocation);\n\t}",
"@Override\n public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {\n Log.i(\"doRequest\", \"doRequest failed\");\n\n }",
"static void confirm_A(Messenger messenger, Response_e response)\n {\n sendToClient(messenger, Request_e.Request_A_en.valueOf(), response, null);\n }",
"CompletionStage<ResponseMessage> invoke(RequestMessage requestMessage);",
"protected HttpResponse executeRequest(RPCRequest invocation) throws Exception {\n\t\treturn getHttpInvokerRequestExecutor().executeRequest(getServiceUrl(), invocation);\n\t}",
"@Override\n\tpublic void commence(HttpServletRequest request, HttpServletResponse response,\n\t\t\tAuthenticationException authException) throws IOException, ServletException {\n\t\tApiResponse res = new ApiResponse(HttpServletResponse.SC_UNAUTHORIZED, \"Unauthorised\");\n\t\tres.setErrors(authException.getMessage());\n\t\tres.setStatus(false);\n OutputStream out = response.getOutputStream();\n ObjectMapper mapper = new ObjectMapper();\n mapper.writeValue(out, res);\n out.flush();\n\t}",
"public void afterReceivingeGainChatResponse(ChatResponse response);",
"public Message invokeResponse(Message msg) {\n JMSBindingContext context = msg.getBindingContext();\n // The Binding Context may be null on an asynchronous response - in which case, create a new one\n if(context == null) {\n \tcontext = createBindingContext();\n \tmsg.setBindingContext(context);\n } // end if\n Session session = context.getJmsResponseSession();\n\n javax.jms.Message responseJMSMsg;\n \n boolean respondBytesMessage = context.isUseBytesForWFJMSDefaultResponse();\n \n if (msg.isFault()) {\n if (respondBytesMessage == true) {\n responseJMSMsg = requestMessageProcessor.createFaultJMSBytesMessage(session, (Throwable) msg.getBody());\n } else {\n responseJMSMsg = responseMessageProcessor.createFaultJMSTextMessage(session, (Throwable) msg.getBody());\n }\n } else {\n boolean unwrap = false;\n \n if (this.outputWrapperMap.get(msg.getOperation().getName()) != null){\n unwrap = this.outputWrapperMap.get(msg.getOperation().getName());\n }\n \n if (respondBytesMessage == true) {\n responseJMSMsg = requestMessageProcessor.insertPayloadIntoJMSBytesMessage(session, msg.getBody(), unwrap);\n } else {\n responseJMSMsg = requestMessageProcessor.insertPayloadIntoJMSTextMessage(session, msg.getBody(), unwrap);\n }\n }\n\n \n msg.setBody(responseJMSMsg);\n\n return msg;\n }",
"ResponseDTO performServerActions();",
"@Override\n\t\t\tpublic void handle(Response response) throws Exception\n\t\t\t{\n\t\t\t\tif(response ==null){\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(response.getStatusCode()==200){\n\t\t\t\t\tSystem.out.println(\"push seccuess\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}",
"public interface TransactionEndpointResponse {\n \n /**\n * Returns the status of the Response from the server.\n * By default \"no-error\" is returned.\n * \n * @return status of the Response from the server\n */\n public String error();\n}",
"protected void invokeInternalEx(XTeeMessage<Document> request,\n XTeeMessage<Element> response,\n SOAPMessage responseMessage,\n SOAPMessage requestMessage) throws Exception {\n invokeInternal(request, response);\n }",
"@Override\n protected void handleErrorResponseCode(int code, String message) {\n }",
"public interface HttpResponseProxylet extends Proxylet {\n \n /**\n * Possible return code of method 'accept'.\n * <br/>The proxylet accepts the message and will not block while processing it\n */\n public static final int ACCEPT = 0x03;\n /**\n * Possible return code of method 'accept'.\n * the proxylet accepts the message but might block while processing it\n */\n public static final int ACCEPT_MAY_BLOCK = 0x7;\n /**\n * Possible return code of method 'accept'.\n * <br/>The proxylet is not interested in the message\n */\n public static final int IGNORE = 0;\n \n /**\n * Called by the Engine to know how the proxylet will handle the Response.\n * <br/>The possible return codes are: ACCEPT, ACCEPT_MAY_BLOCK, IGNORE.\n * <b>NOTE: This method can be called by the Engine several times in a row for the same request.</b>\n * Therefore it should behave accordingly.\n * @param prolog the response prolog\n * @param headers the response headers\n * @return ACCEPT, ACCEPT_MAY_BLOCK, or IGNORE\n */\n public int accept(HttpResponseProlog prolog, HttpHeaders headers);\n \n}",
"public void handle(HttpExchange h) throws IOException {\n String message = \"The server is running without any problem\"; //Message to be shown to client\n h.sendResponseHeaders(200, message.length());//response code and the length of message to be sent\n \n /*writes in the output stream, converts the message into array of bytes and closes the stream.*/\n OutputStream out = h.getResponseBody();\n out.write(message.getBytes());\n out.close();\n }",
"private void sendResponse(String response) {\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n Message message = Message.obtain();\n message.setData(bundle);\n try {\n messenger.send(message);\n } catch (RemoteException e) {\n }\n }",
"static void invokeResponse(RoutingContext rc, Method m, Object toret, String resultType) {\n String[] _corsAllowedIPs = getCORS(m);\n \n if (_corsAllowedIPs != null && _corsAllowedIPs.length > 0) {\n CORS.allow(rc, _corsAllowedIPs);\n }\n \n // Combine errors\n if (toret == null || !(toret instanceof RestResponse)){\n\n \t// Handling function didn't return a RestResponse object, return an appropriate error message\n rc.response().setStatusCode(500).setStatusMessage(\"Error: Function didn't return a RestResponse object\").end();\n \n // We don't \"have\" to throw an exception, a 500 may suffice and client may log error and message in their logs\n// new RuntimeException(\"The return type of a REST function must be a RestResponse\");\n }else {\n \t\n \t// Put the custom headers first, if any\n \tputHeaders(((RestResponse) toret).getHeaders(), rc);\n \t\n \t// PUt the custom status code/message, if any\n \tputStatus((RestResponse) toret, rc);\n \t\n if (resultType != null) {\n\n if (resultType.equals(\"file\")) {\n \t\n // Send the file\n rc.response().sendFile(((RestResponse) toret).getBody()).end();\n } else if (resultType.equals(\"json\")) {\n\n // Set the header for json content - will override any custom header for content-type\n rc.response().putHeader(\"content-type\", \"application/json; charset=utf-8\");\n \n rc.response().end(((RestResponse) toret).getBody());\n }\n } else {\n \t\n \t// New assumption: If result type not set, we're sending back whatever the custom headers say to return\n \t// or else if no custom headers for content-type, we'll return text\n \t\n \tif (!rc.response().headers().contains(\"content-type\")) {\n \t\trc.response().putHeader(\"content-type\", \"text/plain\");\n \t}\n \t\n \tString result = ((((RestResponse) toret).getBody() != null) ? ((RestResponse) toret).getBody() : \" \");\n \t\n rc.response().end(result);\n }\n }\n }",
"@Override\r\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\r\n\t\t\t\t\t\t\tString responseString, Throwable throwable) {\n\t\t\t\t\t\tLoger.i(\"TEST\", \"topic->statusCode->\"+statusCode);\r\n\t\t\t\t\t\tMessage message = new Message();\r\n\t\t\t\t\t\tmessage.what = REFUSE_CODE;\r\n\t\t\t\t\t\tgetTopicHandler.sendMessage(message);\r\n\t\t\t\t\t\tnew ErrorServer(PropertyRepairActivity.this, responseString.toString());\r\n\t\t\t\t\t\tsuper.onFailure(statusCode, headers, responseString, throwable);\r\n\t\t\t\t\t}",
"@Override\n\tpublic void processResponse(ResponseEvent responseEvent) {\n\t\tResponse response = responseEvent.getResponse();\n\t\ttry {\n\t\t\t// Display the response message in the text area.\n\t\t\t//printMessage(\"\\nReceived response: \" + response.toString());\n\n\t\t\tClientTransaction tid = responseEvent.getClientTransaction();\n\t\t\tCSeqHeader cseq = (CSeqHeader) response.getHeader(CSeqHeader.NAME);\n\t\t\tif (response.getStatusCode() == Response.OK) {\n\t\t\t\tif (cseq.getMethod().equals(Request.REGISTER)) {\n\t\t\t\t\tSystem.out.println(\"regist ACK OK\");\n\t\t\t\t\t//onInvite();\n\t\t\t\t} else if (cseq.getMethod().equals(Request.INVITE)) {\n\t\t\t\t\tDialog dialog = inviteTid.getDialog();\n\t\t\t\t\tRequest ackRequest = dialog.createAck(cseq.getSeqNumber());\n\t\t\t\t\tdialog.sendAck(ackRequest);\n\t\t\t\t\tSystem.out.println(\"Sending ACK\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.MESSAGE)) {\n\t\t\t\t\tSystem.out.println(\"Send OK !\");\n\t\t\t\t} else if (cseq.getMethod().equals(Request.CANCEL)) {\n\t\t\t\t\tSystem.out.println(\"Sending BYE -- cancel went in too late !!\");\n\t\t\t\t}\n\t\t\t} else if (response.getStatusCode() == Response.PROXY_AUTHENTICATION_REQUIRED\n\t\t\t\t\t|| response.getStatusCode() == Response.UNAUTHORIZED) {\n\t\t\t\tauthenticationHelper = ((SipStackExt) sipStack)\n\t\t\t\t\t\t.getAuthenticationHelper(new AccountManagerImpl(),\n\t\t\t\t\t\t\t\theaderFactory);\n\t\t\t\tinviteTid = authenticationHelper.handleChallenge(response, tid,\n\t\t\t\t\t\tsipProvider, 5);\n\t\t\t\tinviteTid.getRequest().addHeader(\n\t\t\t\t\t\theaderFactory.createExpiresHeader(3600));\n\t\t\t\tinviteTid.getRequest().setMethod(Request.REGISTER);\n\t\t\t\tinviteTid.sendRequest();\n\t\t\t\tinvco++;\n\t\t\t\tprintMessage(\"[processResponse] Request sent:\\n\" + inviteTid.getRequest().toString() + \"\\n\\n\");\n\t\t\t}\n\t\t} catch (Exception ex) {\n\t\t\tex.printStackTrace();\n\t\t\tSystem.exit(0);\n\t\t}\n\t}",
"public abstract void handle(Request request, Response response) throws Exception;",
"@Override\r\n\t\tpublic void onHttpResponse(String response) {\n\t\t\tif(WebApi.isRespSuccess(response)){\r\n//\t\t\t\thandler.sendEmptyMessage(HANDLER_MSG_APKINFO_SYNC);\r\n\t\t\t}\r\n\t\t\tString resp_msg = WebApi.getRespMsg(response);\r\n\t\t\tMessage msg = new Message();\r\n\t\t\tmsg.what = HANDLER_MSG_TOAST;\r\n\t\t\tBundle bundle = new Bundle();\r\n\t\t\tbundle.putString(HANDLER_DATA_TOAST_TEXT, resp_msg);\r\n\t\t\tmsg.setData(bundle);\r\n\t\t\thandler.sendMessage(msg);\r\n\t\t}"
] | [
"0.67242014",
"0.6565023",
"0.65338045",
"0.6481144",
"0.6390035",
"0.63060266",
"0.628088",
"0.62616146",
"0.6219418",
"0.6210325",
"0.61832273",
"0.60062075",
"0.59803855",
"0.5950578",
"0.5939983",
"0.5926226",
"0.5914536",
"0.5910851",
"0.58555484",
"0.584568",
"0.5834292",
"0.58197355",
"0.5815514",
"0.58097494",
"0.5784781",
"0.5770075",
"0.57685655",
"0.57567",
"0.57497126",
"0.57497126",
"0.57460576",
"0.5726992",
"0.57204854",
"0.5709013",
"0.57089996",
"0.57089996",
"0.5684377",
"0.5681397",
"0.5678914",
"0.5669279",
"0.56667185",
"0.56653374",
"0.56653374",
"0.56653374",
"0.5663443",
"0.56629777",
"0.5644304",
"0.56433886",
"0.56394815",
"0.5630916",
"0.5613445",
"0.55982566",
"0.55863893",
"0.558181",
"0.5576364",
"0.5575832",
"0.55614096",
"0.55605584",
"0.5553277",
"0.553887",
"0.5532252",
"0.5530547",
"0.55265886",
"0.5517708",
"0.5514981",
"0.5502906",
"0.54973334",
"0.54960173",
"0.5495616",
"0.5493232",
"0.5476628",
"0.5464715",
"0.54539174",
"0.5452881",
"0.5451851",
"0.5450825",
"0.5444553",
"0.5444346",
"0.54434454",
"0.54430264",
"0.5423501",
"0.5420833",
"0.5417547",
"0.5415444",
"0.540829",
"0.5401221",
"0.5398743",
"0.53959966",
"0.53953093",
"0.5395294",
"0.5390335",
"0.5389353",
"0.5387354",
"0.5386778",
"0.5386194",
"0.5381923",
"0.5378706",
"0.537344",
"0.5373171",
"0.53720856"
] | 0.7308045 | 0 |
send a notification about an exception which occurred inside the requested service method | private void sendInvocationException(HttpRequest request,
HttpResponse response, ServiceInvocationException e) {
// internal exception in service method
response.clearContent();
response.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );
response.setContentType( "text/xml" );
connector.logError("Exception while processing RMI: " + request.getPath());
Object[] ret = new Object[4];
ret[0] = "Exception during RMI invocation!";
ret[1] = e.getCause().getCause().getClass().getCanonicalName();
ret[2] = e.getCause().getCause().getMessage();
ret[3] = e.getCause().getCause();
String code = ret[0]+"\n"+ret[1]+"\n"+ret[2]+"\n"+ret[3];
response.println ( code );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void onException(RequestException e);",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"@Override\n\t\t\t\t\t\tpublic void onFailure(Method method, Throwable exception) {\n\n\t\t\t\t\t\t}",
"private void handleServiceException(PortletRequest request,\n PortletResponse response, Application application, Throwable e)\n throws IOException, PortletException {\n if (getRequestType(request) == RequestType.UIDL) {\n Application.SystemMessages ci = getSystemMessages();\n criticalNotification(request, (ResourceResponse) response,\n ci.getInternalErrorCaption(), ci.getInternalErrorMessage(),\n null, ci.getInternalErrorURL());\n if (application != null) {\n application.getErrorHandler()\n .terminalError(new RequestError(e));\n } else {\n throw new PortletException(e);\n }\n } else {\n // Re-throw other exceptions\n throw new PortletException(e);\n }\n \n }",
"void failure(ServiceExecutionEvent e) {\n\n }",
"@Override\n public void onRequestFailure(SpiceException spiceException) {\n }",
"public FaultException raise(Throwable e);",
"public FaultException raise(Throwable e, Object argument);",
"@Override\n\tpublic void handlerFault(String msg) {\n\t\tSystem.out.println(\"Emailing the error \" +msg);\n\t}",
"private void sendNotificationError(Exception e) {\n logger.error(e.getMessage());\n \n }",
"ServiceProblemResponse postServiceProblem(ServiceProblem serviceProblem);",
"public abstract void onException(Exception e);",
"@Override\n public void onClosedWatchServiceException(ClosedWatchServiceException x) {\n\n }",
"@WebMethod(action = \"http://schemas.ogf.org/nsi/2013/12/connection/service/error\")\n @RequestWrapper(localName = \"error\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericErrorType\")\n @ResponseWrapper(localName = \"acknowledgment\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericAcknowledgmentType\")\n public void error(\n @WebParam(name = \"serviceException\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.ServiceExceptionType serviceException,\n @WebParam(name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType header,\n @WebParam(mode = WebParam.Mode.OUT, name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n javax.xml.ws.Holder<net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType> header1\n ) throws net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.ifce.ServiceException;",
"@Override\r\n public void onException(Exception arg0) {\n\r\n }",
"void onException(Exception e);",
"public void onException(JMSException exception)\n {\n System.err.println(\"something bad happended: \" + exception);\n }",
"public static void sendCaughtException(Activity context, String methodName,\n String msg, Exception e) {\n\n // Get tracker\n Tracker tracker = ((GlobalEntity) context.getApplicationContext())\n .getTracker(TrackerName.APP_TRACKER);\n if (tracker == null) {\n return;\n }\n\n // Build and send exception\n tracker.send(new HitBuilders.ExceptionBuilder()\n .setDescription(\n \"[\"\n + methodName\n + \"] \"\n + msg\n + \":\\n\"\n + new StandardExceptionParser(context, null)\n .getDescription(Thread.currentThread()\n .getName(), e)).setFatal(false)\n .build());\n }",
"protected abstract void onException(final Exception exception);",
"private void sendOldError(Exception e) {\n }",
"@Override\n\t\tpublic void onServiceError(String error) {\n\n\t\t}",
"@Override\n\t\tpublic void onServiceError(String error) {\n\n\t\t}",
"ServiceProblemAckResponse ackServiceProblem(ServiceProblemAckRequest serviceProblemAckRequest);",
"@Override\n\tpublic void fileDeliveryServiceError(int arg0, String arg1, Integer arg2) {\n\t\t\n\t}",
"public void exceptionOccured(Spy spy, String methodCall, Exception e, String sql, long execTime);",
"private void handleExceptions(Exception e,String uri) throws ServiceProxyException {\n \n //Step 1: Is error AdfInvocationRuntimeException, AdfInvocationException or AdfException? \n String exceptionPrimaryMessage = e.getLocalizedMessage();\n String exceptionSecondaryMessage = e.getCause() != null? e.getCause().getLocalizedMessage() : null;\n String combinedExceptionMessage = \"primary message:\"+exceptionPrimaryMessage+(exceptionSecondaryMessage!=null?(\"; secondary message: \"+exceptionSecondaryMessage):(\"\"));\n \n //chances are this is the Oracle MCS erro message. If so then ths message has a JSON format. A simple JSON parsing \n //test will show if our assumption is true. If JSONObject parsing fails then apparently the message is not the MCS\n //error message\n //{\n // \"type\":\".....\",\n // * \"status\": <error_code>,\n // * \"title\": \"<short description of the error>\",\n // * \"detail\": \"<long description of the error>\",\n // * \"o:ecid\": \"...\",\n // * \"o:errorCode\": \"MOBILE-<MCS error number here>\",\n // * \"o:errorPath\": \"<URI of the request>\"\n // }\n if(exceptionSecondaryMessage!=null){\n try {\n JSONObject jsonErrorObject = new JSONObject(exceptionSecondaryMessage);\n //if we get here, then its a Oracle MCS error JSON Object. Get the \n //status code or set it to 0 (means none is found)\n int statusCode = jsonErrorObject.optInt(\"status\", 0);\n throw new ServiceProxyException(statusCode, exceptionSecondaryMessage);\n \n } catch (JSONException jse) {\n //if parsing fails, the this is proof enough that the error message is not \n //an Oracle MCS message and we need to continue our analysis\n \n this.getMbe().getMbeConfiguration().getLogger().logFine(\"Exception message is not a Oracle MCS error JSONObject\", this.getClass().getSimpleName(), \"getCurrentUserInformation\");\n } \n }\n \n //continue message analysis and check for known error codes for the references MCS API\n \n this.getMbe().getMbeConfiguration().getLogger().logFine(\"Rest invocation failed with following message\"+exceptionPrimaryMessage, this.getClass().getSimpleName(), \"getCurrentUserInformation\");\n \n int httpErrorCode = -1; \n String restoredOracleMcsErrorMessage = null;\n \n /*\n * Try to identify an MCS failure from the exception message.\n */\n if(combinedExceptionMessage.contains(\"400\")){\n httpErrorCode = 400; \n restoredOracleMcsErrorMessage =\n OracleMobileErrorHelper.createOracleMobileErrorJson(400, \"Invalid JSON payload\", \"One of the following problems occurred: \" +\n \"the user does not exist, the JSON is invalid, or a property was not found.\", uri);\n }\n else if(combinedExceptionMessage.contains(\"401\")){\n httpErrorCode = 401; \n restoredOracleMcsErrorMessage =\n OracleMobileErrorHelper.createOracleMobileErrorJson(401, \"Authorization failure\", \"The user is not authorized to retrieve the information for another user.\",uri); \n }\n else if(combinedExceptionMessage.contains(\"403\")){\n httpErrorCode = 404; \n restoredOracleMcsErrorMessage =\n OracleMobileErrorHelper.createOracleMobileErrorJson(403, \"Functionality is not supported\", \"Functionality is not supported.\",uri); \n }\n else if(combinedExceptionMessage.contains(\"403\")){\n httpErrorCode = 404; \n restoredOracleMcsErrorMessage =\n OracleMobileErrorHelper.createOracleMobileErrorJson(404, \"User not found\", \"The user with the specified ID does not exist.\",uri);\n }\n \n else{\n this.getMbe().getMbeConfiguration().getLogger().logFine(\"Request failed with Exception: \"+e.getClass().getSimpleName()+\"; message: \"+e.getLocalizedMessage(), this.getClass().getSimpleName(), \"handleExcpetion\");\n throw new ServiceProxyException(e.getLocalizedMessage(), ServiceProxyException.ERROR);\n }\n //if we get here then again its an Oracle MCS error, though one we found by inspecting the exception message\n this.getMbe().getMbeConfiguration().getLogger().logFine(\"Request succeeded successful but failed with MCS application error. HTTP response: \"+httpErrorCode+\", Error message: \"+restoredOracleMcsErrorMessage, this.getClass().getSimpleName(), \"handleExcpetion\");\n throw new ServiceProxyException(httpErrorCode, restoredOracleMcsErrorMessage);\n }",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"@WebMethod(action = \"http://schemas.ogf.org/nsi/2013/12/connection/service/errorEvent\")\n @RequestWrapper(localName = \"errorEvent\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.ErrorEventType\")\n @ResponseWrapper(localName = \"acknowledgment\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/connection/types\", className = \"net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.GenericAcknowledgmentType\")\n public void errorEvent(\n @WebParam(name = \"connectionId\", targetNamespace = \"\")\n java.lang.String connectionId,\n @WebParam(name = \"notificationId\", targetNamespace = \"\")\n long notificationId,\n @WebParam(name = \"timeStamp\", targetNamespace = \"\")\n javax.xml.datatype.XMLGregorianCalendar timeStamp,\n @WebParam(name = \"event\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.types.EventEnumType event,\n @WebParam(name = \"originatingConnectionId\", targetNamespace = \"\")\n java.lang.String originatingConnectionId,\n @WebParam(name = \"originatingNSA\", targetNamespace = \"\")\n java.lang.String originatingNSA,\n @WebParam(name = \"additionalInfo\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.TypeValuePairListType additionalInfo,\n @WebParam(name = \"serviceException\", targetNamespace = \"\")\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.types.ServiceExceptionType serviceException,\n @WebParam(name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType header,\n @WebParam(mode = WebParam.Mode.OUT, name = \"nsiHeader\", targetNamespace = \"http://schemas.ogf.org/nsi/2013/12/framework/headers\", header = true)\n javax.xml.ws.Holder<net.es.nsi.lib.soap.gen.nsi_2_0_r117.framework.headers.CommonHeaderType> header1\n ) throws net.es.nsi.lib.soap.gen.nsi_2_0_r117.connection.ifce.ServiceException;",
"@Override\n\t\tpublic void onException(Exception arg0) {\n\t\t\t\n\t\t}",
"@AfterThrowing(pointcut = \"controllerClassMethods()\", throwing = \"exception\")\n\tpublic void logAfterThrowingCall(JoinPoint joinPoint, SPFException exception) throws Throwable {\n\t\tSystem.out.println(\"--------------------------------------------------\");\n\t\tSystem.out.println(\"Esto es el @AfterThrowing de aspect\");\n\t\tSystem.out.println(\"--------------------------------------------------\");\n\t\tlog.error(\"Error [{}] Calling [{}]:[{}] returned error message : , [{}]\", exception.getHttpStatus(),\n\t\t\t\tjoinPoint.getSignature().getDeclaringTypeName(), joinPoint.getSignature().getName(),\n\t\t\t\texception.getMessage());\n\t}",
"@Override\n public void onException(Exception arg0) {\n }",
"@Override\n\tpublic void onNotification(\n\t\t\torg.mule.context.notification.ExceptionNotification execptionNotification) {\n\n\t\t// initiates exceptions to log\n\t\ttry {\n\t\t\tlogExceptionNotificationReport(execptionNotification);\n\t\t} catch (InstrumentationException ie) {\n\t\t\tlog.error(ie.getMessage(),ie);\n\t\t}\n\t\t\t\n\t\t\n\t}",
"public void onException(Exception ex) {\n \t\t\t}",
"public synchronized void onRequestFailed(String message, Throwable ex) {\r\n\t\tString reason = message + \": \" + ex.getClass().getName() + \": \" + ex.getMessage();\r\n\t\tallRequestsTracker.onRequestFailed(reason);\r\n\t\trecentRequestsTracker.onRequestFailed(reason);\r\n\t\tmeter.mark();\r\n\t}",
"private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_FOUND );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The method you requested is not known to this service!\" );\n\t\tconnector.logError(\"Invocation request \" + request.getPath() + \" for unknown service method\");\n\t}",
"@Override\r\n\t\t\tpublic void onFault(Throwable fault) {\n\t\t\t\t\r\n\t\t\t}",
"void reportHeartbeatRpcFailure();",
"@Override\r\n\tpublic void err(ServiceStatistics serviceStatistics) {\n\t\t\r\n\t}",
"public DataAccessorServiceException(String msg) {\n super(msg);\n }",
"protected void raiseRequestError(Exception e) {\n\t\tmThrowedExceptions.add(e);\n\t}",
"public void logRunTimeException(JoinPoint jointPoint, RuntimeException ex) throws Throwable {\n\t\tLOGGER.info(\"SERVICE_LOGGER-\" + \"\", ex.getMessage().toString());\n\t\tLOGGER.info(\"ITOPS_LOGGER-\" + \"\", ex.getMessage().toString());\n\t}",
"public interface IErrorHandler<R> extends IModule {\n void handleException(ServiceExecutionException exception, R requestMessage, IRequestListener<R> requestListener, IConnection connection);\n}",
"public void exception(MessageEnvelope messageEnvelope, MessageResult messageResult, ExecutionContext executionContext, Exception ex) {\n\r\n\t\t\tfor (int i=0; i<CompoundMessagingTarget.this.messagingTargets.size(); i++) {\r\n\r\n\t\t\t\tAbstractMessagingTarget messagingTarget = CompoundMessagingTarget.this.messagingTargets.get(i);\r\n\r\n\t\t\t\tfor (MessageEnvelopeInterceptor messageEnvelopeInterceptor : messagingTarget.getMessageEnvelopeInterceptors()) {\r\n\r\n\t\t\t\t\tif (log.isDebugEnabled()) log.debug(\"Executing message envelope interceptor \" + messageEnvelopeInterceptor.getClass().getSimpleName() + \" (exception).\");\r\n\r\n\t\t\t\t\tmessageEnvelopeInterceptor.exception(messageEnvelope, messageResult, executionContext, ex);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"@Override\n\tpublic void onException(Exception e) {\n\n\t}",
"private void log(String methodName, RemoteException re) {\n this.log(methodName + \" failed due to \" + re.getClass().getName() + \n \": \" + re.getMessage());\n }",
"public interface OnGlobalExceptionListener {\n boolean handleException(AppException e);\n}",
"@Override\n\t\t\tpublic void onException(Exception arg0) {\n\n\t\t\t}",
"public void onFailure(Exception t);",
"@Override\r\n\tpublic void doException() {\n\r\n\t}",
"@Override\n public void errorReceived(Exception ex) {\n }",
"@Override\n public void errorReceived(Exception ex) {\n }",
"public interface EmailService {\n\n void sendVerificationEmail(User user)\n throws AddressException, MessagingException;\n\n}",
"public static String _service_create() throws Exception{\nreturn \"\";\n}",
"void sendError(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Throwable ex) throws IOException;",
"@Override\n\tpublic void onSDKIntegrationError(String arg0) {\n\t\t\n\t}",
"public void onError(Request request, Throwable exception) {\n\t\t\t logger.severe(\"HTTP error occurred\");\n\t\t\t \tdeliveryPoint.onDeliveryProblem(letterBox, 0);\n\t\t\t }",
"public interface ConfirmMailService {\n\n void confirmMail(String code) throws ConfirmMaliException;\n\n}",
"public synchronized void onExceptionSend(HttpPipelineRequest p_onExceptionSend_1_, Exception p_onExceptionSend_2_) {\n/* 339 */ terminate(p_onExceptionSend_2_);\n/* */ }",
"@Override\n\tpublic void onException(JMSException arg0) {\n\t\t\n\t}",
"@Override\n\tpublic void onException(JMSException arg0) {\n\t\t\n\t}",
"public void inquiryError() {\n\t\t\n\t}",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"void messageSendFailed(IMSession session, String messageId, ReasonInfo reason);",
"protected void connectionException(Exception exception) {}",
"@Override\n public void Wsdl2CodeFinishedWithException(Exception ex) {\n }",
"void dispatchException(Throwable exception);",
"public interface ExceptionHandler {\n public void onException(Exception e);\n}",
"public void error(Exception e);",
"void onSqsRequestFailure(String internalQueueName, Exception ex);",
"public JiraServiceException(String message) {\r\n super(message);\r\n }",
"@AfterThrowing(pointcut=\"args(name)\", throwing=\"ex\")\n\tpublic void allMethodStringArg(String name,Exception ex){\n\t\tSystem.out.println(\"A method with String arguments has called =\"+name);\n\t\tSystem.out.println(\"Exception was =\"+ex);\n\t}",
"void storeWebWideTrackingException(StoreExceptionsInformation args);",
"public interface ExceptionHandler\n{\n //TODO not sure how to handle this\n}",
"void onError(ModelNotification notification);",
"public void socketException(PacketChannel pc, Exception ex);",
"public GetEtudiantServiceException() {\n super(BaseService.messageExceptionEtudiantGet);\n BaseService.logger.info(BaseService.messageExceptionEtudiantGet);\n }",
"public void onFail(int statusCode, String address);",
"private void handleServiceException(Exception e1) {\n\t\t// logcat\n\t\te1.printStackTrace();\n\n\t\t// free resources\n\t\ttry {\n\t\t\tzabbix.closeLastStream();\n\t\t\tzabbix._endTransaction();\n\t\t} catch (Exception e) {\n\t\t}\n\n\t\t// no further queries\n\t\tauthError = true;\n\n\t\t// activity\n\t\tIntent intent = new Intent(CONTENT_PROVIDER_INTENT_ACTION);\n\t\tif (e1 instanceof NoAPIAccessException) {\n\t\t\tintent.putExtra(\"flag\", INTENT_FLAG_AUTH_FAILED);\n\t\t\tintent.putExtra(\"noApiAccess\", true);\n\t\t} else if (e1 instanceof SSLPeerUnverifiedException) {\n\t\t\t// SSL not trusted\n\t\t\tintent.putExtra(\"flag\", ZabbixContentProvider.INTENT_FLAG_SSL_NOT_TRUSTED);\n\t\t} else {\n\t\t\tintent.putExtra(\"flag\", ZabbixContentProvider.INTENT_FLAG_SHOW_EXCEPTION);\n\t\t\tintent.putExtra(\"value\", e1.toString()+\"/\"+e1.getMessage());\n\t\t}\n\t\tgetContext().sendBroadcast(intent);\n\t}",
"void notifyError(MessageSnapshot snapshot);",
"public void requestFailed(RequestFailureEvent e);",
"@Test\n public void testFindAllException() {\n when(client.receiveFromServer()).thenThrow(new RuntimeException(\"acces denied\"));\n\n service.findAll();\n\n verify(client).sendToServer(\"findAll#PlantedPlant\");\n }",
"public abstract void sendNotification(T notification) throws NotificationException;",
"@Override\n \tpublic void onError(Throwable error, Uri uri) {\n \n \t\tBugSenseHandler.sendExceptionMessage(\"uri\", uri.toString(),\n \t\t\t\tnew Exception(error));\n \n \t\tanalytics.sendException(error.getMessage(), error, false);\n \t}",
"void failed (Exception e);",
"public void errorOccured(String errorMessage, Exception e);",
"void namingExceptionThrown(NamingExceptionEvent evt) throws RemoteException;",
"void fileSendFailed(IMSession session, String requestId, String fileId, ReasonInfo reason);",
"String getException();",
"String getException();",
"void fireSignFailed(Throwable cause);",
"public interface OnError{void onReqError();}",
"Boolean confirmWebWideTrackingException(ExceptionInformation args);",
"String getOnExceptionEnd();",
"@ExceptionHandler(ServiceException.class)\n @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)\n public ExceptionResponse serviceException(final ServiceException serviceException) {\n return processError(serviceException, HttpStatus.INTERNAL_SERVER_ERROR);\n }",
"RequestSender onFailure(Consumer<Message> consumer);",
"void onInterceptFailed();",
"@Override\n public void onApiFailure(Throwable mThrowable) {\n\n }",
"public void toss(Exception e);",
"public void onApiRequestFailed();"
] | [
"0.65057755",
"0.64487594",
"0.6431343",
"0.6380239",
"0.63608944",
"0.6324947",
"0.6285559",
"0.61999786",
"0.6177453",
"0.6137774",
"0.6135842",
"0.6118816",
"0.60730076",
"0.6052193",
"0.60238916",
"0.60087883",
"0.59814465",
"0.5980334",
"0.5977453",
"0.5959323",
"0.59463453",
"0.59463453",
"0.59460115",
"0.5907951",
"0.58868724",
"0.58835685",
"0.5864398",
"0.5864398",
"0.58248484",
"0.58042616",
"0.578738",
"0.5740675",
"0.57259125",
"0.5725564",
"0.57176954",
"0.570644",
"0.5705791",
"0.5698529",
"0.56950647",
"0.56910527",
"0.56893945",
"0.5683438",
"0.5676611",
"0.5664679",
"0.5658845",
"0.56521285",
"0.56512195",
"0.56417555",
"0.56307155",
"0.56200373",
"0.5618432",
"0.5618432",
"0.5613394",
"0.5612491",
"0.5609075",
"0.56078756",
"0.55894756",
"0.55803317",
"0.5567122",
"0.5565572",
"0.5565572",
"0.5565563",
"0.5561309",
"0.55524445",
"0.5549166",
"0.5540676",
"0.55382234",
"0.55230594",
"0.5522698",
"0.5519426",
"0.551914",
"0.5517632",
"0.5516196",
"0.55148387",
"0.5509116",
"0.5508028",
"0.5506903",
"0.55020905",
"0.549667",
"0.5475146",
"0.54508054",
"0.5443557",
"0.54410756",
"0.5427398",
"0.542326",
"0.54217243",
"0.5417997",
"0.5410171",
"0.54092765",
"0.54092765",
"0.53991765",
"0.5396072",
"0.5395555",
"0.5395442",
"0.5395122",
"0.5391727",
"0.5391428",
"0.5391322",
"0.5391035",
"0.5385908"
] | 0.642713 | 3 |
send a notification, that the result of the service invocation is not transportable | private void sendResultInterpretationProblems(HttpRequest request,
HttpResponse response) {
// result interpretation problems
response.clearContent();
response.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );
response.setContentType( "text/xml" );
response.println ("the result of the method call is not transferable!");
connector.logError("Exception while processing RMI: " + request.getPath());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void notifyUnexpected();",
"public void notifyNoAcctReport (COPSPdpOSReqStateMan man);",
"private void onUnavailable() {\n // TODO: broadcast\n }",
"void failure(ServiceExecutionEvent e) {\n\n }",
"public void receiveResultrevokeApplication(\n boolean result\n ) {\n }",
"@Then(\"^a notification should not be shown$\")\n public void a_notification_should_not_be_shown() throws Throwable {\n Assert.assertFalse(result);\n }",
"@Override\r\n\t\tpublic void doTaskAsNoNetWork(Message msg) throws Exception {\n\r\n\t\t}",
"@Override\n public void doNotify(String result) {\n this.result = result;\n }",
"public void sendTestFutureNotification() {\n\n }",
"public void receiveResultsolveTempNoCanTicket(\n com.speed.esalDemo.generation.OrderServiceImplServiceStub.SolveTempNoCanTicketResponse1 result\n ) {\n }",
"private void sendNotification() {\n }",
"void discardIrrelevantResponse(CruiseControlParameters parameters);",
"@Test\n public void testProcessNoResponse() {\n // NOTE: this json file is a RESPONSE, not a request\n String request = ResourceUtils.getResourceAsString(\"org/onap/policy/simulators/appclcm/appc.lcm.success.json\");\n assertNotNull(request);\n\n server.onTopicEvent(CommInfrastructure.NOOP, MY_TOPIC, request);\n\n verify(sink, never()).send(any());\n }",
"protected void nop() throws Exception {\n reply_ok();\n }",
"public void notifyNoKAliveReceived (COPSPdpOSReqStateMan man);",
"@Override\r\n\tpublic Response invoke() {\n\t\treturn null;\r\n\t}",
"public void setSendingReferrersAsNotSent() {\n }",
"void disableNotifications();",
"RequestSender onFailure(Consumer<Message> consumer);",
"public void halt(ServiceResult result);",
"public void sendDiscrepancyEmail() throws Exception;",
"private void sendNotifications() {\n this.sendNotifications(null);\n }",
"public void receiveResultservicedis(\n ) {\n }",
"void notify(IUISemanticEvent event);",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"@Override\n protected boolean shouldSendThrowException() {\n return false;\n }",
"public abstract void sendNotification(T notification) throws NotificationException;",
"@Test\n public void give_subscriptionCreatedAfterLastScheduledDelivery_when_getDailySubscriptionsToDeliver_then_dontReturn() {\n }",
"boolean isBadCommunication();",
"public void sendToOutpatients(){\r\n\t\t//here is some code that we do not have access to\r\n\t}",
"boolean invokeOperation() {\n return false;\n }",
"@Override\n\tpublic void brokenSubscription() {\n\t\t\n\t}",
"public void noFlights();",
"public void __getReplyNoReport() {\n __getReply(false);\n }",
"public interface IVehicleNotInTrip\n{\n void onVehicleData(String response);\n}",
"public abstract Object notify(NotifyDescriptor descriptor);",
"@Override\r\n public void notify(Object arg) {\n }",
"public interface INotificationService {\n\n public boolean notifyForLeaseRequest(String userId, double duration, String reason, String nameOfTool);\n\n public boolean notifyForLeaseRequest(Lease lease);\n\n}",
"void declineNotification(NotificationDTO selectedNotification);",
"@Override\r\n public void onClick(View v) {\n try {\r\n postDatatoServer(\"reject_request\", notification.toJSON());\r\n fetchDatafromServer(\"notifications\");\r\n } \r\n catch (JSONException e) {\r\n e.printStackTrace();\r\n }\r\n }",
"@Override\n protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) {\n try {\n String result=receivedResult.payload.additionalData.getString(\"ng\");\n Advertise.AdvertiseReceived(result,getApplicationContext());\n } catch (Throwable tr) {\n// return false;\n }\n // Return true to stop the notification from displaying.\n return false;\n }",
"void unavailable();",
"void unavailable();",
"@Test\n public void testNotifySingleDeviceInterruptionDeviceNotFound() {\n ControllerEntity controller = new ControllerEntity(1L, \"EUI\", \"KEY\", ControllerCommunicationChannel.LORA);\n\n DeviceEntity device = new DeviceEntity(1L, \"Device\", null, controller);\n\n InterruptionGroupEntity group = new InterruptionGroupEntity(\n 1L,\n OffsetDateTime.ofInstant(Instant.ofEpochSecond(0), ZoneOffset.UTC),\n OffsetDateTime.ofInstant(Instant.ofEpochSecond(100), ZoneOffset.UTC));\n\n InterruptionEntity interruption = new InterruptionEntity(1L, device, group, false, null);\n\n Mockito.when(deviceController.listByInterruption(Mockito.any()))\n .thenReturn(Arrays.asList());\n\n subject.notifyInterruption(interruption);\n\n Assert.assertEquals(0, postResults.size());\n }",
"String getDisableRedelivery();",
"public void receiveResultisApplicationIdAvailable(\n boolean result\n ) {\n }",
"public void verifyNoMatching(AcBatchFlight e)\n {\n }",
"protected void makeClientMissed() {\n\t\tArrayList<String> key = new ArrayList<String>();\r\n\r\n\t\tkey.add(\"id\");\r\n\r\n\t\tArrayList<String> value = new ArrayList<String>();\r\n\r\n\t\tvalue.add(GlobalVariable.TrainerSessionId);\r\n\r\n\t\tSystem.out.println(\"se\" + GlobalVariable.TrainerSessionId);\r\n\r\n\t\td.showCustomSpinProgress(TrainerHomeActivity.this);\r\n\r\n\t\tString url = Constants.WEBSERVICE_URL+\"/webservice/missed\";\r\n\r\n\t\tcallWebService = new AsyncTaskCall(\r\n\t\t\t\tTrainerHomeActivity.this,\r\n\t\t\t\tTrainerHomeActivity.this,\r\n\t\t\t\t1,\r\n\t\t\t\turl,\r\n\t\t\t\tkey, value);\r\n\t\tcallWebService.execute();\r\n\r\n\t\tDialogView.customSpinProgress\r\n\t\t\t\t.setOnCancelListener(new OnCancelListener() {\r\n\r\n\t\t\t\t\t@Override\r\n\t\t\t\t\tpublic void onCancel(DialogInterface dialog) {\r\n\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\tcallWebService.cancel(true);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t}",
"public interface LongProcessOperations \n{\n ServoConRemote.LongProcessPackage.Status Completed ();\n\n //message is empty on success\n String Message ();\n double Progress ();\n void Detach ();\n}",
"public void reportIrreversibleChange() {\r\n Assert.isTrue(isReceiving());\r\n irreversibleChangeReported = true;\r\n }",
"public STATE_KEY eventRemoteStateMissedCall() {\n\t\tviewMissedNotification();\n\t\treturn STATE_KEY.NOT_CHANGE;\n\t}",
"@Override\r\n\tpublic void getServiceResult(ServiceResult result) {\n\t\t\r\n\t}",
"void success(ServiceExecutionEvent e) {\n }",
"private void sendNoSuchService(HttpRequest request, HttpResponse response,\n\t\t\tString service) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_SERVICE_UNAVAILABLE );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The service you requested is not known to this server!\" );\n\t\t\n\t\tconnector.logError (\"Service not found: \" +service);\n\t}",
"@Override\r\n\tpublic void onFail() {\n\t\tif(bSendStatus)\r\n\t\t\tnativeadstatus(E_ONFAIL);\r\n\t}",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.e(\"NoOperationReceiver\", \"NoOperationReceiver===================\" + intent.getAction());\n\n }",
"public interface NotificationService {\n\n void sendAsync(List<Notification> notifications, String CompanyName);\n\n void send(NotificationEvent notificationEvent);\n\n void send(Notification notification);\n\n void send(List<NotificationEvent> notificationEvents);\n}",
"@Override\n public void execute(DelegateExecution execution) throws Exception {\n\tlogger.info(\"NotificationActivity Task Started\");\n\tLoanApplicationReqeust sc = (LoanApplicationReqeust) execution.getVariable(ProcessConstants.VAR_CTX);\n\tMessageRequest messageRequest = new MessageRequest();\n\t\n\tmessageRequest.setServiceName(ProcessConstants.SERVICE_NAME_NOTIFICATION);\n\tlogger.info(\"NotificationActivity Task completed\\n\\n\");\n }",
"@Override\n boolean isFailed() {\n return false;\n }",
"public interface NotificationService {\n\n public void sendNotification(NotificationDTO notification);\n}",
"public void communicationChannelBroken() {\n\n }",
"boolean isRepliable();",
"private void notifyStakeholder(){\n }",
"V call() throws StatusRuntimeException;",
"@Test\n public void testNotifySingleDeviceInterruptionCancellation() {\n ControllerEntity controller = new ControllerEntity(1L, \"EUI\", \"KEY\", ControllerCommunicationChannel.LORA);\n\n DeviceEntity device = new DeviceEntity(1L, \"Device\", null, controller);\n\n InterruptionGroupEntity group = new InterruptionGroupEntity(\n 1L,\n OffsetDateTime.ofInstant(Instant.ofEpochSecond(0), ZoneOffset.UTC),\n OffsetDateTime.ofInstant(Instant.ofEpochSecond(100), ZoneOffset.UTC));\n\n InterruptionEntity interruption = new InterruptionEntity(1l, device, group, false, null);\n\n Mockito.when(deviceController.listByInterruption(Mockito.any()))\n .thenReturn(Arrays.asList(device));\n\n subject.notifyInterruptionCancellation(interruption);\n\n String expectedPost = \"http://jouko.test/?DevEUI=EUI\"\n + \"&FPort=1\"\n + \"&Payload=7b4567514b416767427d\"\n + \"&AS_ID=as\"\n + \"&Time=1970-01-01T00:00:00Z\"\n + \"&Token=31c171ca123ce8cf905ab83e4a9aad2f6190f3cdcb73b63714ea18eae2402d5f\";\n\n Assert.assertEquals(1, postResults.size());\n Assert.assertEquals(expectedPost, postResults.get(0));\n }",
"public void reportNothingToUndoYet() {\r\n Assert.isTrue(isReceiving());\r\n setNothingToUndoReported(true);\r\n }",
"ServiceProblemAckResponse ackServiceProblem(ServiceProblemAckRequest serviceProblemAckRequest);",
"boolean disableMonitoring();",
"static void call_without_condition(String passed){\n\t\tcomplete_call_req(passed.substring(5));\n\t}",
"public void indicateNot() {\r\n notIndicated = true;\r\n }",
"public interface WithHoldOrderContract {\r\n\r\n ResponseData resendWithholdOrder();\r\n \r\n}",
"@Override\n\tpublic boolean isPending();",
"private void sendInvocationInterrupted(HttpRequest request,\n\t\t\tHttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus (HttpResponse.STATUS_INTERNAL_SERVER_ERROR );\n\t\tresponse.setContentType ( \"text/plain\");\n\t\tresponse.println ( \"The invoction has been interrupted!\");\n\t\tconnector.logError(\"Invocation has been interrupted!\");\n\t}",
"@Override\n\tpublic boolean onApiMessage(ApiJob job) {\n\t\treturn false;\n\t}",
"private void notifyTaskFailure(Intent baseIntent, Exception exception) {\n int action = baseIntent.getIntExtra(ACTION, ACTION_NONE);\n Intent intent = new Intent(LocalAction.ACTION_BACKUP_SERVICE_FAILED);\n intent.putExtra(ACTION, action);\n intent.putExtra(EXCEPTION, exception);\n intent.putExtra(CALLER_ID, mCallerId);\n mBroadcastManager.sendBroadcast(intent);\n // update the notification if required\n if (mNotificationBuilder != null || mAutoBackup) {\n mNotificationBuilder = getBaseNotificationBuilder(NotificationContract.NOTIFICATION_CHANNEL_ERROR)\n .setContentTitle(getNotificationContentTitle(action, true))\n .setCategory(NotificationCompat.CATEGORY_ERROR);\n if (exception instanceof WiFiNotConnectedException) {\n // create a copy of the arguments used in this service\n Bundle intentArguments = new Bundle();\n intentArguments.putInt(ACTION, action);\n intentArguments.putString(BACKEND_ID, baseIntent.getStringExtra(BACKEND_ID));\n intentArguments.putBoolean(AUTO_BACKUP, baseIntent.getBooleanExtra(AUTO_BACKUP, DEFAULT_AUTO_BACKUP));\n intentArguments.putBoolean(ONLY_ON_WIFI, baseIntent.getBooleanExtra(ONLY_ON_WIFI, DEFAULT_ONLY_ON_WIFI));\n intentArguments.putBoolean(RUN_FOREGROUND, baseIntent.getBooleanExtra(RUN_FOREGROUND, DEFAULT_RUN_FOREGROUND));\n intentArguments.putString(PASSWORD, baseIntent.getStringExtra(PASSWORD));\n intentArguments.putParcelable(PARENT_FOLDER, baseIntent.getParcelableExtra(PARENT_FOLDER));\n intentArguments.putParcelable(BACKUP_FILE, baseIntent.getParcelableExtra(BACKUP_FILE));\n // prepare the pending intent for the notification receiver\n Intent retryIntent = new Intent(this, NotificationBroadcastReceiver.class);\n retryIntent.setAction(NotificationBroadcastReceiver.ACTION_RETRY_BACKUP_CREATION);\n retryIntent.putExtra(NotificationBroadcastReceiver.ACTION_INTENT_ARGUMENTS, intentArguments);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, retryIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n // finish to setup the notification body\n mNotificationBuilder.setContentText(getString(R.string.notification_content_backup_error_wifi_network));\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.notification_content_backup_error_wifi_network)));\n mNotificationBuilder.addAction(R.drawable.ic_refresh_black_24dp, getString(R.string.notification_action_retry), pendingIntent);\n } else if (exception instanceof BackendException) {\n if (((BackendException) exception).isRecoverable()) {\n // create a copy of the arguments used in this service\n Bundle intentArguments = new Bundle();\n intentArguments.putInt(ACTION, action);\n intentArguments.putString(BACKEND_ID, baseIntent.getStringExtra(BACKEND_ID));\n intentArguments.putBoolean(AUTO_BACKUP, baseIntent.getBooleanExtra(AUTO_BACKUP, DEFAULT_AUTO_BACKUP));\n intentArguments.putBoolean(ONLY_ON_WIFI, baseIntent.getBooleanExtra(ONLY_ON_WIFI, DEFAULT_ONLY_ON_WIFI));\n intentArguments.putBoolean(RUN_FOREGROUND, baseIntent.getBooleanExtra(RUN_FOREGROUND, DEFAULT_RUN_FOREGROUND));\n intentArguments.putString(PASSWORD, baseIntent.getStringExtra(PASSWORD));\n intentArguments.putParcelable(PARENT_FOLDER, baseIntent.getParcelableExtra(PARENT_FOLDER));\n intentArguments.putParcelable(BACKUP_FILE, baseIntent.getParcelableExtra(BACKUP_FILE));\n // prepare the pending intent for the notification receiver\n Intent retryIntent = new Intent(this, NotificationBroadcastReceiver.class);\n retryIntent.setAction(NotificationBroadcastReceiver.ACTION_RETRY_BACKUP_CREATION);\n retryIntent.putExtra(NotificationBroadcastReceiver.ACTION_INTENT_ARGUMENTS, intentArguments);\n PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, retryIntent, PendingIntent.FLAG_UPDATE_CURRENT);\n // finish to setup the notification body\n mNotificationBuilder.setContentText(getString(R.string.notification_content_backup_error_backend_recoverable));\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.notification_content_backup_error_backend_recoverable)));\n mNotificationBuilder.addAction(R.drawable.ic_refresh_black_24dp, getString(R.string.notification_action_retry), pendingIntent);\n } else {\n mNotificationBuilder.setContentText(getString(R.string.notification_content_backup_error_backend));\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(getString(R.string.notification_content_backup_error_backend)));\n }\n } else {\n String message = getString(R.string.notification_content_backup_error_internal, exception.getMessage());\n mNotificationBuilder.setContentText(message);\n mNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(message));\n }\n // use the notification service instead of the foreground service\n // because when the intent service has finished the notification\n // is removed even if the stopForeground is set to false\n NotificationManagerCompat notificationManager = NotificationManagerCompat.from(this);\n notificationManager.notify(NotificationContract.NOTIFICATION_ID_BACKUP_ERROR, mNotificationBuilder.build());\n }\n }",
"@Override\r\n\tpublic void sendNotifications() {\n\r\n\t}",
"@Override\n public int systemNotResponding(String msg) throws RemoteException {\n Log.i(TAG, String.format(\"System is not responding: %s\", msg));\n return 1;\n }",
"boolean hasUnReceived();",
"RequestSender otherwise(Consumer<Message> consumer);",
"public interface IShotRequest {\n\n /**\n * start request\n */\n void notifyStart();\n\n /**\n * notify on finish success\n *\n * @param response\n */\n void notifySuccess(final List<ShotBO> response);\n\n /**\n * notify error\n *\n * @param errorResponse\n */\n void notifyFailure(final ErrorResponse errorResponse);\n}",
"private void handleNotInService(int ss, SmsTracker tracker) {\n if (tracker.mSentIntent != null) {\n try {\n if (ss == ServiceState.STATE_POWER_OFF) {\n tracker.mSentIntent.send(SmsManager.RESULT_ERROR_RADIO_OFF);\n } else {\n tracker.mSentIntent.send(SmsManager.RESULT_ERROR_NO_SERVICE);\n }\n } catch (CanceledException ex) {}\n }\n }",
"static void call_when_sign_not(String passed){\n\t\tif(!S)\n\t\t\tcomplete_call_req(passed.substring(3));\n\t}",
"public interface CommercialUpdateNotificationService {\n void notify(Commercial commercial);\n}",
"public void processBlockwiseResponseTransferFailed() {\n //to be overridden by extending classes\n }",
"public boolean isExempt();",
"public void setStuckCall(){\n this.stuckCall = true;\n }",
"@Test(expected = NuxeoFraSCAtiException.class)\n public void testThrowExceptionIfGetUnexistingService() throws NuxeoFraSCAtiException { \t\n \tRunnable r = frascatiService.getService(fcomponent.getComponent(), \"unknown\", Runnable.class); \t\n }",
"Single<WebClientServiceRequest> whenSent();",
"Single<WebClientServiceRequest> whenSent();",
"@Test\n public void trackingDisabled_unsolicitedResultsIgnored_withoutToken() {\n configureTrackingDisabled();\n\n // Initialize the tracker.\n assertFalse(mPackageTracker.start());\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Receiving a check result when tracking is disabled should cause the storage to be\n // reset.\n mPackageTracker.recordCheckResult(null /* checkToken */, true /* success */);\n\n // Check reliability triggering state.\n mFakeIntentHelper.assertReliabilityTriggerNotScheduled();\n\n // Assert the storage was reset.\n checkPackageStorageStatusIsInitialOrReset();\n }",
"@Override\n public void onSuccess(Void unusedResult) {\n Discoverer.this.eventListener.trigger(EVENT_LOG, \"Connection requested with: \" + endpointId);\n }",
"@Override\n\tpublic void notifyFailure(ResourceOperationDescription operationDescription, Task task, OperationResult parentResult) {\n\t\tnotifyAny(operationDescription);\n\t}",
"void onFailure();",
"void onFailure();",
"void onFailure();",
"public void notify(String userId);",
"protected void responseFail(){\n\t\tqueue.clear();\n\t}",
"@Override\n public void onFailure(Throwable t) {\n log.error(\"Unexpected failure\", t);\n CoreEvents.firePaymentSentToRequestorEvent(\n new PaymentSentToRequestorEvent(\n false,\n CoreMessageKey.PAYMENT_SENT_TO_REQUESTER_FAILED,\n new String[]{t.getClass().getCanonicalName() + \" \" + t.getMessage()}));\n }",
"@Override\r\n\tpublic void sendGeneralNotification() {\n\t\t\r\n\t}",
"private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_FOUND );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The method you requested is not known to this service!\" );\n\t\tconnector.logError(\"Invocation request \" + request.getPath() + \" for unknown service method\");\n\t}",
"@Override\n public void onRequestNoAsk(String permissionName) {\n }"
] | [
"0.6282338",
"0.61298704",
"0.58571744",
"0.58447516",
"0.5728459",
"0.57231915",
"0.5706915",
"0.56851697",
"0.56644744",
"0.5647275",
"0.5638543",
"0.5635341",
"0.5633824",
"0.561799",
"0.5617714",
"0.5594095",
"0.55914634",
"0.5573837",
"0.5532086",
"0.5530195",
"0.5527208",
"0.5514954",
"0.5509763",
"0.55093986",
"0.5502912",
"0.55008614",
"0.5498277",
"0.54859716",
"0.5464854",
"0.5463519",
"0.5459131",
"0.54511845",
"0.54418814",
"0.5439839",
"0.54223067",
"0.54008365",
"0.53833836",
"0.53572583",
"0.53554726",
"0.53414685",
"0.53367364",
"0.53322256",
"0.53322256",
"0.5331193",
"0.5329293",
"0.5316203",
"0.53136235",
"0.5312269",
"0.5308716",
"0.5307333",
"0.5294771",
"0.5291662",
"0.52909774",
"0.5287709",
"0.5283084",
"0.5282386",
"0.5278632",
"0.5274835",
"0.5274103",
"0.5266803",
"0.5265671",
"0.5258374",
"0.5247319",
"0.5237189",
"0.523421",
"0.5226753",
"0.52267003",
"0.52187425",
"0.52185583",
"0.5212603",
"0.52111745",
"0.5210405",
"0.5210337",
"0.52081704",
"0.5206724",
"0.51903385",
"0.51757807",
"0.51751816",
"0.5167922",
"0.51597905",
"0.5159073",
"0.5158426",
"0.5157492",
"0.5155474",
"0.5151839",
"0.51501614",
"0.5146517",
"0.5142838",
"0.5142838",
"0.5142282",
"0.51377785",
"0.5130187",
"0.51295805",
"0.51295805",
"0.51295805",
"0.51274407",
"0.51272357",
"0.51204133",
"0.5119703",
"0.51159114",
"0.51130855"
] | 0.0 | -1 |
send a notification, that security problems occurred during the requested service method | private void sendSecurityProblems(HttpRequest request,
HttpResponse response, L2pSecurityException e) {
response.clearContent();
response.setStatus( HttpResponse.STATUS_FORBIDDEN );
response.setContentType( "text/plain" );
response.println ( "You don't have access to the method you requested" );
connector.logError("Security exception in invocation request " + request.getPath());
if ( System.getProperty("http-connector.printSecException") != null
&& System.getProperty( "http-connector.printSecException").equals ( "true" ) )
e.printStackTrace();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ServiceProblemResponse postServiceProblem(ServiceProblem serviceProblem);",
"@Override\n public void onRequestFailure(SpiceException spiceException) {\n }",
"void failure(ServiceExecutionEvent e) {\n\n }",
"ServiceProblemAckResponse ackServiceProblem(ServiceProblemAckRequest serviceProblemAckRequest);",
"public void getStatusCodesForMethod(java.lang.String unregisteredUserEmail, java.lang.String userID, java.lang.String password, java.lang.String methodname, com.strikeiron.www.holders.SIWsOutputOfMethodStatusRecordHolder getStatusCodesForMethodResult, com.strikeiron.www.holders.SISubscriptionInfoHolder SISubscriptionInfo) throws java.rmi.RemoteException;",
"private void enforcePermission() {\n\t\tif (context.checkCallingPermission(\"com.marakana.permission.FIB_SLOW\") == PackageManager.PERMISSION_DENIED) {\n\t\t\tSecurityException e = new SecurityException(\"Not allowed to use the slow algorithm\");\n\t\t\tLog.e(\"FibService\", \"Not allowed to use the slow algorithm\", e);\n\t\t\tthrow e;\n\t\t}\n\t}",
"void showForbiddenErrorSnackbar();",
"private void handleServiceException(PortletRequest request,\n PortletResponse response, Application application, Throwable e)\n throws IOException, PortletException {\n if (getRequestType(request) == RequestType.UIDL) {\n Application.SystemMessages ci = getSystemMessages();\n criticalNotification(request, (ResourceResponse) response,\n ci.getInternalErrorCaption(), ci.getInternalErrorMessage(),\n null, ci.getInternalErrorURL());\n if (application != null) {\n application.getErrorHandler()\n .terminalError(new RequestError(e));\n } else {\n throw new PortletException(e);\n }\n } else {\n // Re-throw other exceptions\n throw new PortletException(e);\n }\n \n }",
"@Override\n\t\t\t\t\t\tpublic void onFailure(Method method, Throwable exception) {\n\n\t\t\t\t\t\t}",
"void fireSignFailed(Throwable cause);",
"@Override\r\n\tpublic void err(ServiceStatistics serviceStatistics) {\n\t\t\r\n\t}",
"public void verifySecureResponse(com.tangosol.net.Service service, com.tangosol.net.security.PermissionInfo info)\n {\n }",
"public void sendDiscrepancyEmail() throws Exception;",
"public abstract boolean propagate(ServiceSecurity serviceSecurity, SecurityContext securityContext);",
"public void authFailure(BundleDescriptor desc, Endpoint ep, Principal principal) {\n if (ep == null) {\n _logger.fine(\"Endpoint is null for \" + desc.getModuleID());\n return;\n }\n // get the endpoint's fully qualified name\n String fqn =WebServiceMgrBackEnd.getManager().getFullyQualifiedName(ep);\n if (fqn == null) {\n _logger.fine(\"Fully Qualified could not be computed for the selector \" +\n ep.getEndpointSelector());\n return;\n }\n\n WebServiceEndpointStatsProviderImpl impl = (\n WebServiceEndpointStatsProviderImpl) StatsProviderManager.\n getInstance().getEndpointStatsProvider(fqn);\n \n // set auth failure time stamp\n if (impl != null) {\n impl.setAuthFailure(System.currentTimeMillis());\n }\n try {\n ConfigProvider cfgProv = ConfigFactory.getConfigFactory().getConfigProvider();\n if (cfgProv != null) {\n WebServiceConfig wsc = cfgProv.getWebServiceConfig(fqn);\n if ((wsc == null) || (wsc.getMonitoringLevel() == null) \n || (wsc.getMonitoringLevel().equals(\"OFF\"))) {\n // in this case, there wont be any stats \n _logger.fine(\"Monitoring is OFF for webservice endpoint \" +\n fqn);\n return;\n }\n }\n // get its corresponding stats provider\n if (impl == null) {\n if (cfgProv != null) {\n String msg = _stringMgr.getString(\"Auth.StatsNotReg\", fqn);\n throw new RuntimeException(msg);\n }\n return;\n }\n } catch (Exception e) {\n _logger.fine(\"Config provider could not be initialized \" +\n e.getMessage());\n }\n \n\n /** enable the following code, once bug# 6418025 is fixed.\n ** Need a way to HTTP headers and client host information.\n ** SOAPMessageContext needed to be passed to this method.\n **\n // create empty message trace for this element\n List l =\n FilterRegistry.getInstance().getFilters(Filter.POST_PROCESS_RESPONSE,\n fqn); \n Iterator itr = l.iterator();\n while (itr.hasNext()) {\n Object o = itr.next();\n if (o instanceof MessageFilter) {\n MessageTraceImpl m = new MessageTraceImpl(\n new Integer(GlobalMessageListenerImpl.newSequenceNumber())\n .toString());\n m.setRequestSize(0);\n m.setResponseSize(0);\n m.setRequestContent(null);\n m.setResponseContent(null);\n //m.setTransportType();\n //m.setHTTPRequestHeaders();\n //m.setHTTPResponseHeaders();\n //m.setClientHost();\n // Setting principal name to principal.getName() causing issues\n m.setPrincipalName(null);\n m.setResponseTime(0);\n m.setFaultCode(\"999\");\n m.setFaultString(null);\n m.setFaultActor(null);\n m.setTimeStamp(System.currentTimeMillis());\n //m.setCallFlowEnabled(false);\n m.setEndpointName(fqn);\n m.setApplicationID(null);\n\n ((MessageFilter)o)._handler.addMessage(m);\n return;\n }\n }\n */\n }",
"public void warningPermit();",
"public String formForbidden()\r\n {\r\n return formError(\"403 Forbidden\",\"You need permission for this service\");\r\n }",
"protected void notifyUser()\n {\n }",
"void permissionDenied(int requestCode, boolean willShowCheckBoxNextTime);",
"void onRetryAuthentication();",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public void securityOn(CallPeerSecurityOnEvent securityEvent);",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"public void notifyNoAcctReport (COPSPdpOSReqStateMan man);",
"public void sendToOutpatients(){\r\n\t\t//here is some code that we do not have access to\r\n\t}",
"@Override\n\t\tpublic void onServiceError(String error) {\n\n\t\t}",
"@Override\n\t\tpublic void onServiceError(String error) {\n\n\t\t}",
"public void alertUser(int status){\r\n\r\n }",
"public interface ConfirmMailService {\n\n void confirmMail(String code) throws ConfirmMaliException;\n\n}",
"@Override\n public void onFailure(Throwable caught) {\n Window.alert(\"ERROR from SERVER !!!\");\n }",
"public interface PermissionFailDefaultCallBack {\r\n void onRequestRefuse(int requestCode, String refuseTip);\r\n void onRequestForbid(int requestCode, String forbidTip);\r\n}",
"@Override\r\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tWindow.alert(\"failed to add new Information Request in Updated list\");\r\n\t\t\t}",
"void enableSecurity();",
"public void inquiryError() {\n\t\t\n\t}",
"@RequiresLock(\"SeaLock\")\r\n protected void dependentInvalidAction() {\r\n // by default do nothing\r\n }",
"void onInterceptFailed();",
"public static String _service_create() throws Exception{\nreturn \"\";\n}",
"public interface SysPermissionService {\n}",
"private AylaCallResponse checkRequest(int method, AylaRestService rs) {\n\t\tBundle responseBundle = null;\n\t\tAylaCallResponse commitResponse = null;\n\n\t\t// If this is a LAN mode request other than a notification, and we are not on the LAN, then fail immediately\n\t\tif ( (method != AylaRestService.PROPERTY_CHANGE_NOTIFIER) &&\n (method != AylaRestService.SEND_NETWORK_PROFILE_LANMODE) &&\n\t\t\t\tsupportsLanModeResponse(method) &&\n\t\t\t\t!AylaReachability.isWiFiConnected(null) &&\n // While we are in secure setup mode, wifi connectivity can report strange things\n AylaLanMode.getSecureSetupDevice() == null) {\n\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"E\", \"ExecuteRequest\", \"!LAN && supportsLanModeResponse\", method, \"execute\");\n\t\t\tresponseBundle = new Bundle();\n\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\tresponseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n\n\t\t\tif (async) {\n\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t} else {\n\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t}\n\t\t\treturn commitResponse;\n\t\t}\n\n\t\t// If this is request is going to a device directly, make sure the device we want to\n\t\t// contact is reachable. First get the URL from the rest service and see if it's a real\n\t\t// URL. If so, we'll see if it's addressed to one of our local devices.\n\t\tURL destinationURL;\n\t\ttry {\n\t\t\tdestinationURL = new URL(this.url);\n\t\t} catch (MalformedURLException ex) {\n\t\t\t// Ignore\n\t\t\tdestinationURL = null;\n\t\t}\n\n\t\t// If we got a valid URL for the destination, see if it's destined for a local device.\n\t\t// We will know that if DeviceManager finds it by the URL host, which will be the\n\t\t// device's IP address if this is in fact destined for a device.\n\t\tAylaDevice targetDevice = null;\n\t\tif ( destinationURL != null ) {\n\t\t\ttargetDevice = AylaDeviceManager.sharedManager().deviceWithLanIP(destinationURL.getHost());\n\t\t\tif ( targetDevice != null\n\t\t\t // Special case for getting the new device registration token during same lan registration flow\n\t\t\t && method != AylaRestService.GET_MODULE_REGISTRATION_TOKEN\n\t\t\t) {\n\t\t\t\t// Make sure the target device is reachable via the LAN\n\t\t\t\tint canReach = AylaReachability.getDeviceReachability(targetDevice);\n\t\t\t\tif ( canReach != AylaNetworks.AML_REACHABILITY_REACHABLE ) {\n\t\t\t\t\t// Throw out this request- we know now that it will fail, and don't want to\n\t\t\t\t\t// take the time to wait for it to do so.\n\t\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%s, %s, %s.\", \"E\", \"ExecuteRequest\",\n\t\t\t\t\t\t\t\"LM device not reachable\", destinationURL.toString(),\n\t\t\t\t\t\t\t\"canReach:\" + canReach, \"execute\");\n\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\t\tresponseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n\n\t\t\t\t\tif (async) {\n\t\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If this is a cloud request, and we can't reach the cloud, fail immediately\n\t\tif (!AylaReachability.isCloudServiceAvailable()) {\n\t\t\tif (AylaReachability.isDeviceLanModeAvailable(null) && supportsLanModeResponse(method)) {\n\t\t\t\t// We aren't connected to the cloud, but we are connected to the LAN mode device\n\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"V\", \"ExecuteRequest\", \"lanMode\", method, \"execute\");\n\t\t\t} else if (!supportsOfflineResponse(method)) {\n\t\t\t\t// Make sure the method supports cached results if we cannot reach the service.\\\n\t\t\t\t// return failure here\n\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"E\", \"ExecuteRequest\", \"!cloud && !supportOffline\", method, \"execute\");\n\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\tresponseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n\n\t\t\t\tif (async) {\n\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t} else {\n\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t}\n\t\t\t\treturn commitResponse;\n\t\t\t} else {\n\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"V\", \"ExecuteRequest\", \"cached\", method, \"execute\");\n\t\t\t}\n\t\t}\n\n\t\treturn commitResponse;\n\t}",
"public interface SecurityService\r\n{\r\n\t/**\r\n\t * This method return true if the given 'securityToken' is a valid token for the given security service. The security service can be any service\r\n\t * such as OAuth, LDAP, ActiveDirectory, OpenID etc. It is up to the implementor of this interface to interact with the appropriate security\r\n\t * service to determine if the given securityToken is valid. Reasons for a token to not be valid include but are not limited to, expired tokens, \r\n\t * incorrect tokens, not authenticated tokens etc.<br/>\r\n\t * This method will be used by the provider in a DIRECT environment to authenticate/validate a consumer.\r\n\t * \r\n\t * @param securityToken The token that shall be validated against a given security service such as LDAP, OAuth, Active Directory, etc.\r\n\t * @param requestMetadata Metadata that has been sourced from a request. The environmentID property is always null because the token is\r\n * not yet authenticated and therefore the environment is not yet determined. \r\n\t * \r\n\t * @return TRUE if the token is known and valid to the security server and not expired. If a token is expired then FALSE should be returned.\r\n\t */\r\n\tpublic boolean validate(String securityToken, RequestMetadata requestMetadata);\r\n\r\n\t/**\r\n\t * This method may contact the security server which can be an OAuth server, and LDAP server a Active Directory etc. In return it will provide \r\n\t * information that relate to the securityToken such as: <br/>\r\n\t * a) Information about the application and/or user of that securityToken (appUserInfo property populated in the TokenInfo) or<br/>\r\n\t * b) Information about the SIF environment or SIF session the securityToken relates to. This would be the case for already existing SIF\r\n\t * Environments.<br/>\r\n\t * Further an expire date might be set for the securityToken if the token has expired. If the securityToken does not expire then the \r\n\t * expire date is null in the returned TokenInfo object.<br/>\r\n * This method will be used by the provider in a DIRECT environment to get information about a consumer's security token.\r\n\t * \r\n\t * @param securityToken The security token for which the TokenInfo shall be returned.\r\n\t * @param requestMetadata Metadata that has been sourced from a request. The environmentID property is always null because the token is\r\n * not yet authenticated and therefore the environment is not yet determined. \r\n\t * \r\n\t * @return See Desc. It is expected that this method only returns either the environmentKey or the SIF environment ID or the SIF session token but\r\n\t * not all of these at the same time.\r\n\t */\r\n\tpublic TokenInfo getInfo(String securityToken, RequestMetadata requestMetadata);\r\n\t\r\n\t/**\r\n\t * This method may contact the security server which can be an OAuth server, and LDAP server a Active Directory etc. to generate a \r\n\t * security token based on the given 'coreInfo'. It is expected that any consumer or a provider in a BROKERED environment calls this \r\n\t * method to retrieve a security token which it will use as the authorisation token in all SIF requests to a provider or broker.\r\n\t * \r\n\t * @param coreInfo Information about the consumer/provider that might be used to generate a security token by the external security service.\r\n\t * In most cases it would at least need the application key.\r\n\t * @param password It is very likely that some sort of password will be required to generate a security token.\r\n\t * \r\n\t * @return A TokenInfo object which will have the 'token' property set (the security token). Optional the 'tokenExpiryDate' may be set\r\n\t * if the token has an expire date. If the 'tokenExpiryDate' is null it is assumed that the returned security token won't expire.\r\n\t * The returned token should only be a token without any authentication method as a prefix. For example the token may be\r\n\t * \"ZjI2NThiNTktNDM1Yi00YThkLTlmNzYtYzI0MDBiNjY1NWMxOlBhc3N3b3JkMQ\". It should not hold the authentication method such as 'Bearer'\r\n\t * (i.e. not look like this: \"Bearer ZjI2NThiNTktNDM1Yi00YThkLTlmNzYtYzI0MDBiNjY1NWMxOlBhc3N3b3JkMQ\"). The SIF3 Framework will\r\n\t * manage the authentication method.\r\n\t */\r\n\tpublic TokenInfo createToken(TokenCoreInfo coreInfo, String password);\r\n}",
"Boolean confirmWebWideTrackingException(ExceptionInformation args);",
"public void emergencyStopIssued()\n {\n // Default implementation does nothing\n }",
"public interface EmailService {\n\n void sendVerificationEmail(User user)\n throws AddressException, MessagingException;\n\n}",
"@Override\n\tpublic void onRequestDataError(Exception error) {\n\t\tLog.e(\"Jrv Activity jrv\", error.getMessage());\n\t}",
"@Override\n\t\t\t\t\t\tpublic void onSyncErr() {\n\t\t\t\t\t\t\tnotifyLoginEvent(true);\n\t\t\t\t\t\t}",
"public void failReport (COPSPdpOSReqStateMan man, List<COPSClientSI> reportSIs);",
"@Override\n public void onFailure(Throwable caught) {\n Window.alert(\"ERROR from SERVER\");\n }",
"private void onRequireSMSPermissionsDenied() {\r\n showToast(getString(R.string.contact_picker_requires_sms_permission), Toast.LENGTH_LONG);\r\n }",
"void reportHeartbeatRpcFailure();",
"public void checkForAlerts() {\n }",
"private void permissionsDenied() {\n Log.w(\"TAG\", \"permissionsDenied()\");\n }",
"void criticalNotification(PortletRequest request, MimeResponse response,\n String caption, String message, String details, String url)\n throws IOException {\n \n // clients JS app is still running, but server application either\n // no longer exists or it might fail to perform reasonably.\n // send a notification to client's application and link how\n // to \"restart\" application.\n \n if (caption != null) {\n caption = \"\\\"\" + caption + \"\\\"\";\n }\n if (details != null) {\n if (message == null) {\n message = details;\n } else {\n message += \"<br/><br/>\" + details;\n }\n }\n if (message != null) {\n message = \"\\\"\" + message + \"\\\"\";\n }\n if (url != null) {\n url = \"\\\"\" + url + \"\\\"\";\n }\n \n // Set the response type\n response.setContentType(\"application/json; charset=UTF-8\");\n final OutputStream out = response.getPortletOutputStream();\n final PrintWriter outWriter = new PrintWriter(new BufferedWriter(\n new OutputStreamWriter(out, \"UTF-8\")));\n outWriter.print(\"for(;;);[{\\\"changes\\\":[], \\\"meta\\\" : {\"\n + \"\\\"appError\\\": {\" + \"\\\"caption\\\":\" + caption + \",\"\n + \"\\\"message\\\" : \" + message + \",\" + \"\\\"url\\\" : \" + url\n + \"}}, \\\"resources\\\": {}, \\\"locales\\\":[]}]\");\n outWriter.close();\n }",
"public void actionPerformed(ActionEvent evt) {\n DialogManager.showMessage(null, \"Service Settings\", \"Not Implemented\");\n }",
"private static void LogError(final String method,\n final ResponseResult result)\n {\n if (result != null && !StringHelper.isNullOrEmpty(result.errorMessage))\n {\n// Crashlytics.log(\"SharecareClient() FAILURE: \"\n// + String.format(ERROR_MESSAGE, method, result.responseCode,\n// result.errorMessage));\n }\n }",
"public String formUnauthorized()\r\n {\r\n return formError(\"401 Unauthorized\",\"Unauthorized use of this service\");\r\n }",
"private void sendEmailToSubscriberForHealthTips() {\n\n\n\n }",
"public void onApiRequestFailed();",
"public interface ISecurityMonitorService {\n\n\n}",
"void onAuthenticationError(Throwable throwable);",
"public void securityMessageRecieved(CallPeerSecurityMessageEvent event)\n {\n int severity = event.getEventSeverity();\n \n String messageTitle = null;\n \n switch (severity)\n {\n // Don't play alert sound for Info or warning.\n case CallPeerSecurityMessageEvent.INFORMATION:\n {\n messageTitle = GuiActivator.getResources().getI18NString(\n \"service.gui.SECURITY_INFO\");\n break;\n }\n case CallPeerSecurityMessageEvent.WARNING:\n {\n messageTitle = GuiActivator.getResources().getI18NString(\n \"service.gui.SECURITY_WARNING\");\n break;\n }\n // Alert sound indicates: security cannot established\n case CallPeerSecurityMessageEvent.SEVERE:\n case CallPeerSecurityMessageEvent.ERROR:\n {\n messageTitle = GuiActivator.getResources().getI18NString(\n \"service.gui.SECURITY_ERROR\");\n NotificationManager.fireNotification(\n NotificationManager.CALL_SECURITY_ERROR);\n }\n }\n \n NotificationManager.fireNotification(\n NotificationManager.SECURITY_MESSAGE,\n messageTitle,\n event.getI18nMessage());\n }",
"@Override\npublic void checkServerTrusted(X509Certificate[] arg0, String arg1)\nthrows CertificateException {\n}",
"void warnInvalidActionMethod(Method m, String string) {\n log.warn(\"Invalid Action method '\" + m.toGenericString() + \"': \" + string);\n }",
"@RequestMapping(value = \"/dispatchService\")\n\t@ResponseBody\n\tpublic void dispatchService() throws ServiceException {\n\t\tif(checkAccessSecurity()) {\n\t\t\tString model = \"\";\n\t\t\tString serviceName = \"\";\n\t\t\tdispatchServiceController.run(model, serviceName);\n\t\t}\n\t\t\n\t}",
"public interface AspirantService {\n\n @Deprecated\n /**\n * Adds an aspirant to the system.\n * @param aspirantAccount aspirant account\n * @throws IllegalArgumentException when aspirantAccount is null.\n * @throws AspirantAlreadyExistsException when aspirant already exists in the system.\n * @throws ServiceException when an error occurred in service.\n */\n void register(AspirantAccount aspirantAccount)\n throws IllegalArgumentException, AspirantAlreadyExistsException, ServiceException;\n\n @Deprecated\n /**\n * Checks an aspirant credentials.\n * @param email aspirant email\n * @param password aspirant password\n * @return true if email and password are correct otherwise false.\n * @throws IllegalArgumentException when email or password is null, empty or whitespace.\n * @throws AspirantNotRegisteredException when aspirant is not registered in the system.\n * @throws ServiceException when an error occurred in service.\n */\n boolean isValidCredentials(String email, String password)\n throws IllegalArgumentException, AspirantNotRegisteredException, ServiceException;\n\n /**\n * Returns {@link AspirantAccount} with specific email.\n * @param email aspirant email.\n * @return instance of {@link AspirantAccount} or null\n * if AspirantAccount with specific email not found.\n * @throws ServiceException when error occurred in service.\n * @throws IllegalArgumentException when email is null, empty or white space.\n */\n AspirantAccount getAspirantAccountByEmail(String email)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Add aspirantProfile to aspirantAccount identifiable by email.\n * @param email aspirant email.\n * @param aspirantProfile aspirant profile.\n * @throws IllegalArgumentException when email is null, empty or whitespace or aspirantProfile is null.\n * @throws ServiceException when an error occurred in service.\n */\n void addAspirantProfile(String email, AspirantProfile aspirantProfile)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Returns an aspirant profile identifiable by aspirant account email.\n * @param email aspirant email.\n * @return An aspirant profile or null if profile is not found.\n * @throws IllegalArgumentException when email is null, empty or whitespace.\n * @throws ServiceException when an error occurred in service.\n */\n AspirantProfile getAspirantProfile(String email)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Updates existing aspirant profile identifiable by aspirant account email.\n * @param email aspirant email.\n * @param aspirantProfile aspirant profile.\n * @throws IllegalArgumentException when email is null, empty or whitespace or aspirantProfile is null.\n * @throws AspirantProfileNotFoundException when aspirant profile not found. Aspirant account have no profile.\n * @throws ServiceException when an error occurred in service.\n */\n void updateAspirantProfile(String email, AspirantProfile aspirantProfile)\n throws IllegalArgumentException, AspirantNotRegisteredException, AspirantProfileNotFoundException, ServiceException;\n\n /**\n * Add aspirant resume.\n * @param email aspirant email.\n * @param resume aspirant resume.\n * @throws IllegalArgumentException when email is null, empty or whitespace or resume is null.\n * @throws ServiceException when an error occurred in service.\n */\n void addAspirantResume(String email, Resume resume)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Returns all aspirant resume.\n * @param email aspirant email.\n * @return list of aspirant resume.\n * @throws IllegalArgumentException when email is null, empty or whitespace.\n * @throws ServiceException when an error occurred in service.\n */\n ArrayList<Resume> getAllAspirantResume(String email)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Returns an aspirant resume.\n * @param email aspirant email.\n * @param careerObjective career objective of the resume.\n * @return aspirant resume.\n * @throws IllegalArgumentException when email or careerObjective is null, empty or whitespace.\n * @throws ServiceException when an error occurred in service.\n */\n Resume getAspirantResume(String email, String careerObjective)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Delete aspirant resume.\n * @param email aspirant email.\n * @param careerObjective career objective of the resume.\n * @throws IllegalArgumentException when email or careerObjective is null, empty or whitespace.\n * @throws ServiceException when an error occurred in service.\n */\n void deleteAspirantResume(String email, String careerObjective)\n throws IllegalArgumentException, ServiceException;\n\n /**\n * Update aspirant resume.\n * @param email aspirant email.\n * @param careerObjective career objective of the resume.\n * @param resume aspirant resume.\n * @throws IllegalArgumentException when email or careerObjective is null, empty or whitespace.\n * @throws ResumeNotFoundException when aspirant resume not found.\n * @throws ServiceException when an error occurred in service.\n */\n void updateAspirantResume(String email, String careerObjective, Resume resume)\n throws IllegalArgumentException, ResumeNotFoundException, ServiceException;\n\n /**\n * Update resume date.\n * @param email aspirant email.\n * @param careerObjective career objective of the resume.\n * @param newDate new resume date.\n * @throws IllegalArgumentException when email or careerObjective is null, empty or whitespace or newDate is null.\n * @throws ResumeNotFoundException when aspirant resume not found.\n * @throws ServiceException when an error occurred in service.\n */\n void updateAspirantResumeDate(String email, String careerObjective, Date newDate)\n throws IllegalArgumentException, ResumeNotFoundException, ServiceException;\n\n /**\n * Return all aspirant resume view.\n * @param email aspirant email.\n * @param careerObjective career objective of the resume.\n * @return list of resume view.\n * @throws IllegalArgumentException when email or careerObjective is null, empty or whitespace or newDate is null.\n * @throws ResumeNotFoundException when aspirant resume not found.\n * @throws ServiceException when an error occurred in service.\n */\n ArrayList<ResumeView> getAllAspirantResumeViews(String email, String careerObjective)\n throws IllegalArgumentException, ResumeNotFoundException, ServiceException;\n\n ArrayList<Invitation> getAllAspirantInvitations(String email)\n throws IllegalArgumentException, ServiceException;\n\n Invitation getInvitation(String email, String careerObjective, String jobVacancyName, String companyName)\n throws IllegalArgumentException, ServiceException;\n\n AspirantAccount getAspirantAccountById(int id) throws ServiceException;\n\n Resume getResumeById(int id) throws ServiceException;\n\n ArrayList<Resume> getAllResume() throws ServiceException;\n\n void addAspirantResumeView(String aspirantEmail, String careerObjective, String HRManagerEmail)\n throws IllegalArgumentException, AspirantNotRegisteredException, ResumeNotFoundException, HRManagerNotFoundException, ServiceException;\n\n void sendInvitation(String aspirantEmail, String careerObjective, String jobVacancyName, String hrManagerEmail, Invitation invitation)\n throws IllegalArgumentException, AspirantNotRegisteredException, ResumeNotFoundException, HRManagerNotFoundException, CompanyNotFoundException, ServiceException;\n}",
"@PermissionSuccess(requestCode = 100)\n public void onPermissionSuccess(){\n }",
"@Override\n public void notifyPrivilege() {\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyPrivilege();\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending privilege error\");\n }\n }",
"@Override\n @SuppressFBWarnings(\"BC_UNCONFIRMED_CAST\")\n protected void validateSecurityMethods() throws SuiteBroken {\n // GATTT, PATTT, GHTTT, PHTTT\n this.currentState.combinations.add(\n new Combination(\"GET\", this.currentState.url, getMatchedApiEntry(),\n CombEntry.CLIAUTH_NONE,\n CombEntry.SRVAUTH_TLSCERT, CombEntry.REQENCR_TLS, CombEntry.RESENCR_TLS\n ));\n this.currentState.combinations.add(\n new Combination(\"POST\", this.currentState.url, getMatchedApiEntry(),\n CombEntry.CLIAUTH_NONE,\n CombEntry.SRVAUTH_TLSCERT, CombEntry.REQENCR_TLS, CombEntry.RESENCR_TLS\n ));\n this.currentState.combinations.add(\n new Combination(\"GET\", this.currentState.url, getMatchedApiEntry(),\n CombEntry.CLIAUTH_HTTPSIG, CombEntry.SRVAUTH_TLSCERT, CombEntry.REQENCR_TLS,\n CombEntry.RESENCR_TLS\n ));\n this.currentState.combinations.add(\n new Combination(\"POST\", this.currentState.url, getMatchedApiEntry(),\n CombEntry.CLIAUTH_HTTPSIG, CombEntry.SRVAUTH_TLSCERT, CombEntry.REQENCR_TLS,\n CombEntry.RESENCR_TLS\n ));\n }",
"void cronCheckAuthService();",
"private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_FOUND );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The method you requested is not known to this service!\" );\n\t\tconnector.logError(\"Invocation request \" + request.getPath() + \" for unknown service method\");\n\t}",
"@Override\r\n\tpublic void onFail() {\n\t\tif(bSendStatus)\r\n\t\t\tnativeadstatus(E_ONFAIL);\r\n\t}",
"private void handleServiceException(Exception e1) {\n\t\t// logcat\n\t\te1.printStackTrace();\n\n\t\t// free resources\n\t\ttry {\n\t\t\tzabbix.closeLastStream();\n\t\t\tzabbix._endTransaction();\n\t\t} catch (Exception e) {\n\t\t}\n\n\t\t// no further queries\n\t\tauthError = true;\n\n\t\t// activity\n\t\tIntent intent = new Intent(CONTENT_PROVIDER_INTENT_ACTION);\n\t\tif (e1 instanceof NoAPIAccessException) {\n\t\t\tintent.putExtra(\"flag\", INTENT_FLAG_AUTH_FAILED);\n\t\t\tintent.putExtra(\"noApiAccess\", true);\n\t\t} else if (e1 instanceof SSLPeerUnverifiedException) {\n\t\t\t// SSL not trusted\n\t\t\tintent.putExtra(\"flag\", ZabbixContentProvider.INTENT_FLAG_SSL_NOT_TRUSTED);\n\t\t} else {\n\t\t\tintent.putExtra(\"flag\", ZabbixContentProvider.INTENT_FLAG_SHOW_EXCEPTION);\n\t\t\tintent.putExtra(\"value\", e1.toString()+\"/\"+e1.getMessage());\n\t\t}\n\t\tgetContext().sendBroadcast(intent);\n\t}",
"@Override\n public void onDenied(String permission) {\n }",
"@Override\n public void onErrorResponse(VolleyError error) {\n SSLog.e(TAG, \"sendUserAccess :- \", error.getMessage());\n }",
"void success(ServiceExecutionEvent e) {\n }",
"public interface SmsService {\n void sendSms(String phoneNumber, String message) throws Exception;\n\n void sendSms(Constants.AlertType alertType);\n}",
"public boolean onSecurityCheck() {\n boolean continueProcessing = super.onSecurityCheck();\n if (!continueProcessing) {\n return false;\n }\n AuthorizationManager authzMan = getAuthorizationManager();\n try {\n if (!authzMan.canManageApplication(user)) {\n setRedirect(\"authorization-denied.htm\");\n return false;\n }\n return true;\n } catch (AuthorizationSystemException ex) {\n throw new RuntimeException(ex);\n }\n }",
"public void fireEmergencyRequest() {\n\t\televatorManager.handleEmergency();\n\t}",
"private void sendNotification() {\n }",
"public void onPermissionError(CommandEvent e);",
"public void securityOff(CallPeerSecurityOffEvent securityEvent);",
"private void realSubmitExcuse(){\r\n\t\ta.submitExcuse(userId, excuseTxt, excuseDesc, \r\n\t\t\t\tnew RestCallback(){\r\n\t\t\t@Override\r\n\t\t\tpublic void onTaskComplete(Object result) {\r\n\t\t\t\tIntent myIntent = new Intent(ExcuseCreate.this, RecordUpdated.class);\r\n\t\t\t\tmyIntent.putExtra(\"message\", \"Excuse Submitted\");\r\n\t\t\t\tstartActivity(myIntent);\r\n\t\t\t}\r\n\t\t});\r\n\t}",
"public void securityTimeout(CallPeerSecurityTimeoutEvent securityTimeoutEvent);",
"public void publishTiancheWarn(String errorMsg) {\n }",
"public void doTheFaultyThing();",
"public void unsuccessfulReservation()\n {\n showToastMessage(getResources().getString(R.string.unsuccessfulReservation));\n }",
"public interface ProductPeriodScheduleService {\n\n /**\n * 处理档期状态\n * @throws SQLException\n */\n @AllowMessageTask\n void dealPeriodStatus() throws SQLException;\n}",
"public interface FaultService\r\n{\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception/argument\r\n\t * @param e the thrown error\r\n\t * @param argument the processed argument\r\n\t * @return the wrapped exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e, Object argument);\r\n\t\r\n\t\r\n\t/**\r\n\t * Raise an exception based on the given exception\r\n\t * @param e the thrown error\r\n\t * @return the wrapper exception\r\n\t * @throws FaultException the GEDI exception will be thrown\r\n\t */\r\n\tpublic FaultException raise(Throwable e);\r\n\t\r\n}",
"@Override\n protected void onFailureComponentConnectionRequest(PlatformComponentProfile remoteParticipant) {\n System.out.println(\"************ Crypto Addresses -> FAILURE CONNECTION.\");\n checkFailedDeliveryTime(remoteParticipant.getIdentityPublicKey());\n }",
"@Override\n public void onDenied(String permission) {\n }",
"public Object run() throws Exception {\n System.out.println(\"Performing secure action ...\");\n return null;\n }",
"@Override\n\t\tpublic void emergencyServices() {\n\t\t\tSystem.out.println(\"FH--emergency services\");\t\n\t\t\t\n\t\t}",
"@Override\r\n\tpublic void list_private() throws Exception {\n\t\tif (JavastravaApplicationConfig.STRAVA_ALLOWS_CHALLENGES_ENDPOINT) {\r\n\t\t\tsuper.list_private();\r\n\t\t}\r\n\t}",
"public void communicationChannelBroken() {\n\n }",
"@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\n\t\t\t\t\t\t\t}",
"protected void service(HttpServletRequest req,\n HttpServletResponse res)\n throws ServletException, IOException {\n try {\n super.service(req, res);\n } catch (Throwable e) {\n log.error(\"Internal UI error\", e);\n res.sendError(500, \"Internal UI error: \" + e.getMessage());\n }\n }",
"public ModelAndView notifyAboutInvalidData() {\n \tSystem.out.println(\"radi ovo obavestenje\");\n this.template.convertAndSend(\"/nc/errors\", \"Registration failed\");\n //return \"Korisničko ime/email već postoji u sistemu\";\n String projectUrl = \"http://localhost:4200/registration/error\";\n\t\treturn new ModelAndView(\"redirect:\" + projectUrl);\n }",
"public void failure(ActionInvocation actionInvocation, UpnpResponse upnpResponse, String s) {\n/* 152 */ UPNPService.logger.warning(\"unable to map port for \" + port.toString());\n/* 153 */ port.addException(port.toString(), new Exception(s));\n/* */ }",
"public static void verifyServiceCertified(ServiceReqDetails createServiceInUI, User user) {\n\t\tSupplier<RestResponse> serviceGetter = () -> FunctionalInterfaces.swallowException(\n\t\t\t\t() -> ServiceRestUtils.getServiceByNameAndVersion(user, createServiceInUI.getName(), \"1.0\"));\n\t\tFunction<RestResponse, Boolean> serviceVerificator = restResp -> restResp.getErrorCode() == HttpStatus.SC_OK;\n\t\tRestResponse certifiedResourceResopnse = FunctionalInterfaces.retryMethodOnResult(serviceGetter,\n\t\t\t\tserviceVerificator);\n\t\tassertTrue(certifiedResourceResopnse.getErrorCode() == HttpStatus.SC_OK);\n\n\t}",
"boolean isBadCommunication();"
] | [
"0.62205577",
"0.57854193",
"0.57011265",
"0.5686398",
"0.55880827",
"0.5493347",
"0.54678357",
"0.5428453",
"0.54215324",
"0.54053015",
"0.53925824",
"0.5382021",
"0.537989",
"0.5374352",
"0.53681076",
"0.53421754",
"0.53378177",
"0.5331806",
"0.5325594",
"0.5312795",
"0.5302959",
"0.5302959",
"0.5301278",
"0.52940744",
"0.5280671",
"0.52710104",
"0.52494174",
"0.52494174",
"0.5221852",
"0.52118444",
"0.52027977",
"0.51672685",
"0.5162121",
"0.5153667",
"0.5144607",
"0.51280874",
"0.512132",
"0.5104259",
"0.5100692",
"0.50979036",
"0.5097241",
"0.50969166",
"0.50815886",
"0.5075191",
"0.50741035",
"0.50621325",
"0.5053957",
"0.5053522",
"0.5041679",
"0.5041013",
"0.5038582",
"0.5038347",
"0.50354624",
"0.50340974",
"0.5033283",
"0.50306606",
"0.5024807",
"0.50220954",
"0.5021236",
"0.50154036",
"0.5009704",
"0.50056195",
"0.5003583",
"0.50020057",
"0.49901593",
"0.49884704",
"0.49736935",
"0.4964077",
"0.4951495",
"0.4949807",
"0.49386618",
"0.49373868",
"0.49340817",
"0.49306172",
"0.49288708",
"0.4926134",
"0.49210417",
"0.49173263",
"0.49158418",
"0.49146664",
"0.4908532",
"0.4905493",
"0.4903946",
"0.48987836",
"0.48951432",
"0.48924273",
"0.489227",
"0.48881295",
"0.48878637",
"0.4885804",
"0.48844045",
"0.48806256",
"0.48794478",
"0.48723814",
"0.48722017",
"0.48713738",
"0.48708478",
"0.48700082",
"0.4868958",
"0.48673496"
] | 0.6543988 | 0 |
send a notification, that the requested method does not exists at the requested service | private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {
response.clearContent();
response.setStatus( HttpResponse.STATUS_NOT_FOUND );
response.setContentType( "text/plain" );
response.println ( "The method you requested is not known to this service!" );
connector.logError("Invocation request " + request.getPath() + " for unknown service method");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void reportMissingMethod(JavaMethod method, TagNode node) {\n\t\tString container = \"\";\n\t\tif (node.source().size() == 1) {\n\t\t\tICodeElement parentElement = node.source().get(0);\n\t\t\tif (parentElement instanceof JavaClass) {\n\t\t\t\tJavaClass javaClass = (JavaClass) parentElement;\n\t\t\t\tcontainer = \" in the \\\"\" + javaClass.className() + \"\\\" \"\n\t\t\t\t\t\t+ (javaClass.isInterface() ? \"interface\" : \"class\");\n\t\t\t}\n\t\t}\n\t\tstatus.add(new Status(IStatus.ERROR, status.getPlugin(), 1, pattern\n\t\t\t\t+ \": Method \" + method.type() + \" for the \\\"\" + method.name()\n\t\t\t\t+ \"()\\\" method is missing\" + container\n\t\t\t\t+ \". Try to generate code or update the model.\"\n\t\t\t\t+ \" \", null));\n\t}",
"@Override\n\tboolean isRegistedMethodNotNeed() {\n\t\treturn true;\n\t}",
"private void sendNoSuchService(HttpRequest request, HttpResponse response,\n\t\t\tString service) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_SERVICE_UNAVAILABLE );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The service you requested is not known to this server!\" );\n\t\t\n\t\tconnector.logError (\"Service not found: \" +service);\n\t}",
"@Override\n public MethodFault getExpectedMethodFault()\n {\n return new InvalidRequest();\n }",
"public void notifyNoAcctReport (COPSPdpOSReqStateMan man);",
"void warnInvalidActionMethod(Method m, String string) {\n log.warn(\"Invalid Action method '\" + m.toGenericString() + \"': \" + string);\n }",
"private void onUnavailable() {\n // TODO: broadcast\n }",
"@Test(expected = NuxeoFraSCAtiException.class)\n public void testThrowExceptionIfGetUnexistingService() throws NuxeoFraSCAtiException { \t\n \tRunnable r = frascatiService.getService(fcomponent.getComponent(), \"unknown\", Runnable.class); \t\n }",
"public void onMessageNotFound(Message message) throws MessagingException;",
"private void handleNotInService(int ss, SmsTracker tracker) {\n if (tracker.mSentIntent != null) {\n try {\n if (ss == ServiceState.STATE_POWER_OFF) {\n tracker.mSentIntent.send(SmsManager.RESULT_ERROR_RADIO_OFF);\n } else {\n tracker.mSentIntent.send(SmsManager.RESULT_ERROR_NO_SERVICE);\n }\n } catch (CanceledException ex) {}\n }\n }",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"public void onFailure(String method, Object data) {\n\t\t\t\t\n\t\t\t}",
"protected boolean methodForbidden() {\n return methodToTest.getName().equals(\"getClassNull\")\n || methodToTest.getName().startsWith(\"isA\")\n || methodToTest.getName().equals(\"create\")\n || methodToTest.getName().equals(\"getTipString\")\n || methodToTest.getName().equals(\"toString\");\n }",
"@Override\n\t\tpublic String getMethod() {\n\t\t\treturn null;\n\t\t}",
"@Override\n\t\t\t\t\t\tpublic void onFailure(Method method, Throwable exception) {\n\n\t\t\t\t\t\t}",
"public void noFlights();",
"Method getMethod(int id, boolean filterObsolete);",
"void unregister(String methodName);",
"public interface IVehicleNotInTrip\n{\n void onVehicleData(String response);\n}",
"@Then(\"^My Account button is not present$\")\r\n public void my_Account_button_is_not_present() throws Throwable {\n throw new PendingException();\r\n }",
"public void noSuchCommand() {\n }",
"private void missedCall() {\n\n NotificationCompat.Builder nBuilder = new NotificationCompat.Builder(this);\n\n nBuilder.setSmallIcon(android.R.drawable.stat_notify_missed_call);\n\n nBuilder.setContentTitle(name);\n\n nBuilder.setContentText(resources.getString(R.string.missed_call));\n\n nBuilder.setColor(Color.rgb(4, 137, 209));\n\n nBuilder.setAutoCancel(true);\n\n Intent showCallLog = new Intent(Intent.ACTION_VIEW);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, showCallLog, PendingIntent.FLAG_CANCEL_CURRENT);\n\n nBuilder.setContentIntent(pendingIntent);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n notificationManager.notify(MISSED_CALL_NOTIFICATION, nBuilder.build());\n\n CallLogUtilities.addCallToLog(contentResolver, number, 0, CallLog.Calls.MISSED_TYPE, System.currentTimeMillis());\n\n }",
"private void missedCall() {\n\n NotificationCompat.Builder nBuilder = new NotificationCompat.Builder(mContext);\n\n nBuilder.setSmallIcon(android.R.drawable.stat_notify_missed_call);\n\n nBuilder.setContentTitle(name);\n\n nBuilder.setContentText(resources.getString(R.string.missed_call));\n\n nBuilder.setColor(Color.rgb(4, 137, 209));\n\n nBuilder.setAutoCancel(true);\n\n Intent showCallLog = new Intent(Intent.ACTION_VIEW);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, showCallLog, PendingIntent.FLAG_CANCEL_CURRENT);\n\n nBuilder.setContentIntent(pendingIntent);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n notificationManager.notify(MISSED_CALL_NOTIFICATION, nBuilder.build());\n\n CallLogUtilities.addCallToLog(contentResolver, number, 0, CallLog.Calls.MISSED_TYPE, System.currentTimeMillis());\n\n }",
"public STATE_KEY eventRemoteStateMissedCall() {\n\t\tviewMissedNotification();\n\t\treturn STATE_KEY.NOT_CHANGE;\n\t}",
"public void method_204() {}",
"void disableNotifications();",
"void illegalCommand(final String reason);",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.e(\"NoOperationReceiver\", \"NoOperationReceiver===================\" + intent.getAction());\n\n }",
"public static Method getMethod(String method) throws IllegalArgumentException {\n/* 119 */ return getMethod(method, false);\n/* */ }",
"@Override\n public void onRequestNoAsk(String permissionName) {\n }",
"private void handleNoService() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleNoService():void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleNoService():void\");\n }",
"public void getStatusCodesForMethod(java.lang.String unregisteredUserEmail, java.lang.String userID, java.lang.String password, java.lang.String methodname, com.strikeiron.www.holders.SIWsOutputOfMethodStatusRecordHolder getStatusCodesForMethodResult, com.strikeiron.www.holders.SISubscriptionInfoHolder SISubscriptionInfo) throws java.rmi.RemoteException;",
"public void updateMissedCalls() {\n // Mark all \"new\" missed calls as not new anymore\n StringBuilder where = new StringBuilder();\n where.append(\"type = \");\n where.append(Calls.MISSED_TYPE);\n where.append(\" AND \");\n where.append(Calls.NEW);\n where.append(\" = 1\");\n \n ContentValues values = new ContentValues(1);\n values.put(Calls.NEW, \"0\");\n \n startUpdate(UPDATE_MISSED_CALLS_TOKEN, null, Calls.CONTENT_URI_WITH_VOICEMAIL,\n values, where.toString(), null);\n }",
"@Override\n public void onRequestFailure(SpiceException spiceException) {\n }",
"@Test(expectedExceptions = JodaEngineRuntimeException.class)\n public void testInvokingNonExistingMethodAndEvaluate() {\n\n new MethodInvokingEventCondition(DummyAdapterEvent.class, \"get123\", STRING_TO_MATCH);\n\n Assert.fail(\"An JodaEngineRuntimeException should already been raised.\");\n }",
"public MissingMethodArgumentException(String msg) {\n super(msg);\n }",
"public void onApiRequestFailed();",
"public void respondMethodNotImplemented( Resource resource, Response response, Request request ) {\n try {\r\n response.setStatus( Response.Status.SC_NOT_IMPLEMENTED );\r\n OutputStream out = response.getOutputStream();\r\n out.write( METHOD_NOT_IMPLEMENTED_HTML.getBytes() );\r\n } catch( IOException ex ) {\r\n log.warn( \"exception writing content\" );\r\n }\r\n }",
"public void onNoAccountsFound();",
"void noFriendsRetrieved();",
"@Override\n\t\t\t\t\t\t\t\t\t\tpublic void onRequestFail() {\n\n\t\t\t\t\t\t\t\t\t\t}",
"@Test\n public void test_getMethodWithoutData() {\n DataStoreResponse response = util.get(\"abcdefghijklmnopqrFsstuvwxyzABCD\");\n assertEquals(true, response.hasActionError);\n assertEquals(DataStoreConstants.DATA_NOT_FOUND, response.message);\n }",
"public void method_200() {}",
"void unavailable();",
"void unavailable();",
"void notifyUnexpected();",
"public void godNotAdded() {\n notifyGodNotAdded(this.getCurrentTurn().getCurrentPlayer().getNickname());\n }",
"static void call_when_sign_not(String passed){\n\t\tif(!S)\n\t\t\tcomplete_call_req(passed.substring(3));\n\t}",
"public void emergencyStopIssued()\n {\n // Default implementation does nothing\n }",
"private void logWarningsAboutUncoveredMethods(Map<String, PathSecurityInformation> matches, String prefix, String suffix) {\n for (Map.Entry<String, PathSecurityInformation> entry : matches.entrySet()) {\n if (entry.getValue().perMethodRequiredRoles.isEmpty() && entry.getValue().excludedMethodRoles.isEmpty()) {\n continue;\n }\n Set<String> missing = new HashSet<>(KNOWN_METHODS);\n for (String m : entry.getValue().perMethodRequiredRoles.keySet()) {\n missing.remove(m);\n }\n Iterator<String> it = missing.iterator();\n while (it.hasNext()) {\n String val = it.next();\n for (ExcludedMethodRoles excluded : entry.getValue().excludedMethodRoles) {\n if (!excluded.methods.contains(val)) {\n it.remove();\n break;\n }\n }\n }\n if (!missing.isEmpty()) {\n UndertowServletLogger.ROOT_LOGGER.unsecuredMethodsOnPath(prefix + entry.getKey() + suffix, missing);\n }\n }\n }",
"void failure(ServiceExecutionEvent e) {\n\n }",
"@Override\n public void onRemoteMapNotFound() {\n // non implementato\n }",
"@Override\n\tpublic int method() {\n\t\treturn 0;\n\t}",
"protected void nop() throws Exception {\n reply_ok();\n }",
"void unsetMethod();",
"private void foundNonExistent() {\n\t\tstate = BridgeState.NON_EXISTENT;\n\t}",
"public boolean addService(BluetoothGattService service) {\n/* 60 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"public void notifyNoKAliveReceived (COPSPdpOSReqStateMan man);",
"boolean isBadCommunication();",
"private void sendNotification() {\n }",
"protected ForUnresolvedMethod(String message) {\n this.message = message;\n }",
"default void onMissedHeartBeat(SessionID sessionID) {\n }",
"@ForOverride\n public void onNotInUse(InternalSubchannel internalSubchannel) {\n }",
"@Test\n public void test_invalid() throws Exception {\n matchInvoke(serviceURL, \"PWDDIC_testSearch_invalid_req.xml\",\n \"PWDDIC_testSearch_invalid_res.xml\");\n }",
"@Override\n public void populateServiceNotUpDiagnostics() {\n }",
"@Override\r\n\tprotected ResponseEntity<Object> handleMethodArgumentNotValid(MethodArgumentNotValidException ex,\r\n\t\t\tHttpHeaders headers, HttpStatus status, WebRequest request) {\n\t\treturn super.handleMethodArgumentNotValid(ex, headers, status, request);\r\n\t}",
"public interface INotificationService {\n\n public boolean notifyForLeaseRequest(String userId, double duration, String reason, String nameOfTool);\n\n public boolean notifyForLeaseRequest(Lease lease);\n\n}",
"@Override\r\npublic int method() {\n\treturn 0;\r\n}",
"public boolean ignoreService() {\n if (\"undef\".equalsIgnoreCase(type) || \"undef,1.0\".equalsIgnoreCase(type))\n return true;\n return false;\n }",
"@Override\n\t\tpublic ITestNGMethod getMethod() {\n\t\t\treturn null;\n\t\t}",
"@GetMapping(\"notfound\")\n public void notFound()\n {\n throw new NotFoundException(\"404\", \"404 Not Found - NotFoundException\");\n }",
"@Override\n public void onError(String method, String errorInfo) {\n hideLoading();\n }",
"private boolean isNoService() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.isNoService():boolean, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.isNoService():boolean\");\n }",
"void reportHeartbeatRpcFailure();",
"@DISPID(202)\r\n public boolean verbInvoked() {\r\n throw new UnsupportedOperationException();\r\n }",
"private void checkMethod(DetailAST aAST, String aPrefix, String aException)\n {\n final DetailAST nameAST = aAST.findFirstToken(TokenTypes.IDENT);\n final String name = nameAST.getText();\n if (name.startsWith(aPrefix)) {\n if (!Utils.isPublic(aAST)) {\n log(nameAST.getLineNo(), nameAST.getColumnNo(),\n \"nonpublic.bean\", \"Method \" + name);\n }\n if (Utils.isVoid(aAST)) {\n log(nameAST.getLineNo(), nameAST.getColumnNo(),\n \"voidmethod.bean\", name);\n }\n if (!Utils\n .hasThrows(aAST, aException))\n {\n log(nameAST.getLineNo(), nameAST.getColumnNo(),\n \"missingthrows.bean\",\n new Object[] {name, aException});\n }\n }\n }",
"public MissingMethodArgumentException(Exception e) {\n super(e);\n }",
"public void invokePropagateNotFound(HttpRequest request, HttpResponse response) throws NotFoundException\n {\n ResourceInvoker invoker = getInvoker(request);\n try\n {\n invoke(request, response, invoker);\n }\n catch (Failure e)\n {\n handleException(request, response, e);\n return;\n }\n }",
"public void verifyNoMatching(AcBatchFlight e)\n {\n }",
"public void getMethod () throws MqttException {\n if (message.getMethod().equals(\"GET\")) {\n if (message.getData() != null && !message.getData().equals(\"\")) {\n getPatient(message.getData());\n } else {\n getAllPatients();\n }\n }\n\n if (message.getMethod().equals(\"POST\")) {\n createPatient(new Gson().fromJson(message.getData(), Patient.class));\n }\n }",
"public void serviceRemoved(String serviceID);",
"@Override\n\tpublic void onNetNoStart(String id) {\n\t\t\n\t}",
"private void onAWNotUnderstood(ACLMessage msg) {\n\t\tLOG.error(\"service returned NOT_UNDERSTOOD: {}\", msg);\n\t\tdoDelete();\n\t}",
"public MissingMethodArgumentException() {\n }",
"public void updateRpc(MethodDescriptor method, Message param, CallStats stats, Throwable e) {\n int callsPerServer = stats.getConcurrentCallsPerServer();\n if (callsPerServer > 0) {\n concurrentCallsPerServerHist.update(callsPerServer);\n }\n // Update the counter that tracks RPCs by type.\n StringBuilder methodName = new StringBuilder();\n methodName.append(method.getService().getName()).append(\"_\").append(method.getName());\n // Distinguish mutate types.\n if (\"Mutate\".equals(method.getName())) {\n final MutationType type = ((MutateRequest) param).getMutation().getMutateType();\n switch (type) {\n case APPEND:\n methodName.append(\"(Append)\");\n break;\n case DELETE:\n methodName.append(\"(Delete)\");\n break;\n case INCREMENT:\n methodName.append(\"(Increment)\");\n break;\n case PUT:\n methodName.append(\"(Put)\");\n break;\n default:\n methodName.append(\"(Unknown)\");\n }\n }\n getMetric(CNT_BASE + methodName, rpcCounters, counterFactory).inc();\n if (e != null) {\n getMetric(FAILURE_CNT_BASE + methodName, rpcCounters, counterFactory).inc();\n getMetric(TOTAL_EXCEPTION_CNT, rpcCounters, counterFactory).inc();\n if (e instanceof RemoteException) {\n String fullClassName = ((RemoteException) e).getClassName();\n String simpleClassName = (fullClassName != null)\n ? fullClassName.substring(fullClassName.lastIndexOf(\".\") + 1)\n : \"unknown\";\n getMetric(REMOTE_EXCEPTION_CNT_BASE + simpleClassName, rpcCounters, counterFactory).inc();\n } else {\n getMetric(LOCAL_EXCEPTION_CNT_BASE + e.getClass().getSimpleName(), rpcCounters,\n counterFactory).inc();\n }\n }\n // this implementation is tied directly to protobuf implementation details. would be better\n // if we could dispatch based on something static, ie, request Message type.\n if (method.getService() == ClientService.getDescriptor()) {\n switch (method.getIndex()) {\n case 0:\n assert \"Get\".equals(method.getName());\n getTracker.updateRpc(stats);\n return;\n case 1:\n assert \"Mutate\".equals(method.getName());\n final MutationType mutationType = ((MutateRequest) param).getMutation().getMutateType();\n switch (mutationType) {\n case APPEND:\n appendTracker.updateRpc(stats);\n return;\n case DELETE:\n deleteTracker.updateRpc(stats);\n return;\n case INCREMENT:\n incrementTracker.updateRpc(stats);\n return;\n case PUT:\n putTracker.updateRpc(stats);\n return;\n default:\n throw new RuntimeException(\"Unrecognized mutation type \" + mutationType);\n }\n case 2:\n assert \"Scan\".equals(method.getName());\n scanTracker.updateRpc(stats);\n return;\n case 3:\n assert \"BulkLoadHFile\".equals(method.getName());\n // use generic implementation\n break;\n case 4:\n assert \"PrepareBulkLoad\".equals(method.getName());\n // use generic implementation\n break;\n case 5:\n assert \"CleanupBulkLoad\".equals(method.getName());\n // use generic implementation\n break;\n case 6:\n assert \"ExecService\".equals(method.getName());\n // use generic implementation\n break;\n case 7:\n assert \"ExecRegionServerService\".equals(method.getName());\n // use generic implementation\n break;\n case 8:\n assert \"Multi\".equals(method.getName());\n numActionsPerServerHist.update(stats.getNumActionsPerServer());\n multiTracker.updateRpc(stats);\n return;\n default:\n throw new RuntimeException(\"Unrecognized ClientService RPC type \" + method.getFullName());\n }\n }\n // Fallback to dynamic registry lookup for DDL methods.\n updateRpcGeneric(methodName.toString(), stats);\n }",
"@Override\n public int systemNotResponding(String msg) throws RemoteException {\n Log.i(TAG, String.format(\"System is not responding: %s\", msg));\n return 1;\n }",
"private void handleInvalidSimNotify(int r1, android.os.AsyncResult r2) {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00e9 in method: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleInvalidSimNotify(int, android.os.AsyncResult):void, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.mediatek.internal.telephony.worldphone.WorldPhoneOp01.handleInvalidSimNotify(int, android.os.AsyncResult):void\");\n }",
"public void addMethod(String method) {\n\t\tif (!(methods.contains(method))){\n\t\t\tmethods.add(method);\t\t\t\n\t\t}\n\t}",
"private static boolean supportsOfflineResponse(int method) {\n switch (method) {\n case AylaRestService.GET_DEVICES_LANMODE:\n case AylaRestService.GET_NODES_LOCAL_CACHE:\n case AylaRestService.CREATE_DATAPOINT_LANMODE:\n case AylaRestService.CREATE_NODE_DATAPOINT_LANMODE:\n \t\n case AylaRestService.GET_DATAPOINT_LANMODE:\n case AylaRestService.GET_DATAPOINTS_LANMODE:\n \t\n case AylaRestService.GET_PROPERTIES_LANMODE:\n case AylaRestService.GET_NODE_PROPERTIES_LANMODE:\n case AylaRestService.GET_NODE_DATAPOINT_LANMODE:\n \t\n case AylaRestService.GET_NODES_CONNECTION_STATUS_ZIGBEE_LANMODE:\n \t\n case AylaRestService.GET_PROPERTY_DETAIL_LANMODE:\n case AylaRestService.GET_NODES_CONNECTION_STATUS_LANMODE:\n case AylaRestService.POST_USER_LOGIN:\n\n\t\t\t// These APIs are used during wifi setup / registration where we may not be\n\t\t\t// connected to the cloud, but rather to the device's wifi AP.\n case AylaRestService.SET_DEVICE_CONNECT_TO_NETWORK:\n case AylaRestService.GET_MODULE_WIFI_STATUS:\n case AylaRestService.START_NEW_DEVICE_SCAN_FOR_APS:\n case AylaRestService.GET_NEW_DEVICE_STATUS:\n case AylaRestService.PUT_NEW_DEVICE_TIME:\n case AylaRestService.DELETE_DEVICE_WIFI_PROFILE:\n case AylaRestService.CONNECT_NEW_DEVICE_TO_SERVICE:\n case AylaRestService.SET_HOST_NETWORK_CONNECTION:\n case AylaRestService.DELETE_HOST_NETWORK_CONNECTION:\n case AylaRestService.DELETE_HOST_NETWORK_CONNECTIONS:\n case AylaRestService.CONFIRM_NEW_DEVICE_TO_SERVICE_CONNECTION:\n \t\n case AylaRestService.RETURN_HOST_SCAN:\n case AylaRestService.RETURN_HOST_NETWORK_CONNECTION:\n case AylaRestService.CONNECT_TO_NEW_DEVICE:\n case AylaRestService.GET_NEW_DEVICE_SCAN_RESULTS_FOR_APS:\n case AylaRestService.PUT_DISCONNECT_AP_MODE:\n \n // While this call should require network access, it is made right after re-connecting\n\t\t\t// to the original wifi network during wifi setup, and on certain devices the\n\t\t\t// check for reachability fails before this call is made. Including this API\n\t\t\t// in the list here allows these devices to complete setup.\n case AylaRestService.GET_NEW_DEVICE_CONNECTED:\n case AylaRestService.PROPERTY_CHANGE_NOTIFIER:\n case AylaRestService.PUT_LOCAL_REGISTRATION:\n \n // for same-lan wifi setup\n case AylaRestService.POST_LOCAL_REGISTRATION:\n case AylaRestService.DELETE_NETWORK_PROFILE_LANMODE:\n case AylaRestService.SEND_NETWORK_PROFILE_LANMODE:\n case AylaRestService.GET_NEW_DEVICE_WIFI_STATUS:\n\n // Confirm reachability state is finalized locally, either service or device, or both. \n case AylaRestService.REACHABILITY:\n return true;\n }\n return false;\n }",
"public void alarmOnMissingSetting(String settingName);",
"private String notFound() {\n\t\tquestionBot.put(owner.id(), \"Desculpe, não entendi sua resposta\");\n\t\treturn buildMessage(questionBot.get(owner.id()));\n\t}",
"@Override\n public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n for (Map.Entry<String, RequiredFunctionalExtension> behaviorEntry : myRequiredBehaviorById.entrySet()) {\n Object returnObj = behaviorEntry.getValue().invoke(proxy, method, args);\n if (SuccessorStrategy.NO_FOUND_CODE.equals(returnObj)) {\n continue;\n }\n return returnObj;\n }\n return SuccessorStrategy.NO_FOUND_CODE;\n }",
"private AylaCallResponse checkRequest(int method, AylaRestService rs) {\n\t\tBundle responseBundle = null;\n\t\tAylaCallResponse commitResponse = null;\n\n\t\t// If this is a LAN mode request other than a notification, and we are not on the LAN, then fail immediately\n\t\tif ( (method != AylaRestService.PROPERTY_CHANGE_NOTIFIER) &&\n (method != AylaRestService.SEND_NETWORK_PROFILE_LANMODE) &&\n\t\t\t\tsupportsLanModeResponse(method) &&\n\t\t\t\t!AylaReachability.isWiFiConnected(null) &&\n // While we are in secure setup mode, wifi connectivity can report strange things\n AylaLanMode.getSecureSetupDevice() == null) {\n\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"E\", \"ExecuteRequest\", \"!LAN && supportsLanModeResponse\", method, \"execute\");\n\t\t\tresponseBundle = new Bundle();\n\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\tresponseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n\n\t\t\tif (async) {\n\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t} else {\n\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t}\n\t\t\treturn commitResponse;\n\t\t}\n\n\t\t// If this is request is going to a device directly, make sure the device we want to\n\t\t// contact is reachable. First get the URL from the rest service and see if it's a real\n\t\t// URL. If so, we'll see if it's addressed to one of our local devices.\n\t\tURL destinationURL;\n\t\ttry {\n\t\t\tdestinationURL = new URL(this.url);\n\t\t} catch (MalformedURLException ex) {\n\t\t\t// Ignore\n\t\t\tdestinationURL = null;\n\t\t}\n\n\t\t// If we got a valid URL for the destination, see if it's destined for a local device.\n\t\t// We will know that if DeviceManager finds it by the URL host, which will be the\n\t\t// device's IP address if this is in fact destined for a device.\n\t\tAylaDevice targetDevice = null;\n\t\tif ( destinationURL != null ) {\n\t\t\ttargetDevice = AylaDeviceManager.sharedManager().deviceWithLanIP(destinationURL.getHost());\n\t\t\tif ( targetDevice != null\n\t\t\t // Special case for getting the new device registration token during same lan registration flow\n\t\t\t && method != AylaRestService.GET_MODULE_REGISTRATION_TOKEN\n\t\t\t) {\n\t\t\t\t// Make sure the target device is reachable via the LAN\n\t\t\t\tint canReach = AylaReachability.getDeviceReachability(targetDevice);\n\t\t\t\tif ( canReach != AylaNetworks.AML_REACHABILITY_REACHABLE ) {\n\t\t\t\t\t// Throw out this request- we know now that it will fail, and don't want to\n\t\t\t\t\t// take the time to wait for it to do so.\n\t\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%s, %s, %s.\", \"E\", \"ExecuteRequest\",\n\t\t\t\t\t\t\t\"LM device not reachable\", destinationURL.toString(),\n\t\t\t\t\t\t\t\"canReach:\" + canReach, \"execute\");\n\t\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\t\tresponseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n\n\t\t\t\t\tif (async) {\n\t\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If this is a cloud request, and we can't reach the cloud, fail immediately\n\t\tif (!AylaReachability.isCloudServiceAvailable()) {\n\t\t\tif (AylaReachability.isDeviceLanModeAvailable(null) && supportsLanModeResponse(method)) {\n\t\t\t\t// We aren't connected to the cloud, but we are connected to the LAN mode device\n\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"V\", \"ExecuteRequest\", \"lanMode\", method, \"execute\");\n\t\t\t} else if (!supportsOfflineResponse(method)) {\n\t\t\t\t// Make sure the method supports cached results if we cannot reach the service.\\\n\t\t\t\t// return failure here\n\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"E\", \"ExecuteRequest\", \"!cloud && !supportOffline\", method, \"execute\");\n\t\t\t\tresponseBundle = new Bundle();\n\t\t\t\tresponseBundle.putString(\"result\", rs.jsonResults); // response v3.07\n\t\t\t\tresponseBundle.putInt(\"subTask\", rs.subTaskFailed);\n\t\t\t\tresponseCode = AylaNetworks.AML_ERROR_UNREACHABLE;\n\n\t\t\t\tif (async) {\n\t\t\t\t\treceiver.send(responseCode, responseBundle);\n\t\t\t\t} else {\n\t\t\t\t\tcommitResponse = new AylaCallResponse(responseCode, responseBundle);\n\t\t\t\t}\n\t\t\t\treturn commitResponse;\n\t\t\t} else {\n\t\t\t\tAylaSystemUtils.saveToLog(\"%s, %s, %s:%d, %s\", \"V\", \"ExecuteRequest\", \"cached\", method, \"execute\");\n\t\t\t}\n\t\t}\n\n\t\treturn commitResponse;\n\t}",
"public void onServiceUnregistered() {\r\n \t// Update the list of sessions\r\n\t\tupdateList();\r\n }",
"@Override\n public void cannotRetrieveRemoteMapDetails() {\n // non implementato\n }",
"public void onUnscuuessNotificationUpdate(String message);",
"public boolean removeAction(AccessibilityAction action) {\n/* 364 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tpublic SipProteccionesEventos registrarDisminucion(ParamRegistroProtecciones param) {\n\t\tthrow new RuntimeExceptionSipas(\"Metodo no implementado\");\n\t}",
"public void method_203() {}",
"protected static void errorUnimplementedMethod(String sMethod)\n throws IOException\n {\n throw new IOException(\"DataOutputAdapter: \"+sMethod+\"not implemented\");\n }"
] | [
"0.64002424",
"0.6398021",
"0.63373774",
"0.5891384",
"0.58668274",
"0.5802847",
"0.57674444",
"0.5713725",
"0.56943196",
"0.56219506",
"0.5596516",
"0.5596516",
"0.5553656",
"0.55215955",
"0.5487089",
"0.54769653",
"0.5459625",
"0.5457042",
"0.5443239",
"0.5427267",
"0.5416662",
"0.54139334",
"0.5399039",
"0.5379672",
"0.53787565",
"0.53745973",
"0.53618556",
"0.5319485",
"0.52983636",
"0.5292274",
"0.5291816",
"0.52904093",
"0.52874076",
"0.5281332",
"0.52776545",
"0.52736837",
"0.52674437",
"0.52613604",
"0.526065",
"0.52518135",
"0.5208128",
"0.52064866",
"0.5174422",
"0.51728827",
"0.51728827",
"0.5161175",
"0.5159792",
"0.5157786",
"0.51531965",
"0.515178",
"0.51499003",
"0.51424766",
"0.5142033",
"0.51328236",
"0.51295",
"0.5117172",
"0.5114011",
"0.5089125",
"0.5079353",
"0.5078869",
"0.50744164",
"0.5065047",
"0.50591946",
"0.5057928",
"0.50562626",
"0.5055119",
"0.505466",
"0.5040529",
"0.5035524",
"0.5031077",
"0.5028887",
"0.50276524",
"0.5025809",
"0.50181824",
"0.5018075",
"0.50135297",
"0.5011218",
"0.50079465",
"0.50053036",
"0.5003591",
"0.49910352",
"0.4989825",
"0.49854028",
"0.4984141",
"0.4978933",
"0.49748445",
"0.49720454",
"0.49708483",
"0.49698648",
"0.49510834",
"0.49507475",
"0.49469405",
"0.494396",
"0.4934464",
"0.49310315",
"0.49256548",
"0.49142903",
"0.49138093",
"0.49065822",
"0.49004957"
] | 0.73187506 | 0 |
send a notification, that the requested service does not exists | private void sendNoSuchService(HttpRequest request, HttpResponse response,
String service) {
response.clearContent();
response.setStatus( HttpResponse.STATUS_SERVICE_UNAVAILABLE );
response.setContentType( "text/plain" );
response.println ( "The service you requested is not known to this server!" );
connector.logError ("Service not found: " +service);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private void handleNotInService(int ss, SmsTracker tracker) {\n if (tracker.mSentIntent != null) {\n try {\n if (ss == ServiceState.STATE_POWER_OFF) {\n tracker.mSentIntent.send(SmsManager.RESULT_ERROR_RADIO_OFF);\n } else {\n tracker.mSentIntent.send(SmsManager.RESULT_ERROR_NO_SERVICE);\n }\n } catch (CanceledException ex) {}\n }\n }",
"@Test(expected = NuxeoFraSCAtiException.class)\n public void testThrowExceptionIfGetUnexistingService() throws NuxeoFraSCAtiException { \t\n \tRunnable r = frascatiService.getService(fcomponent.getComponent(), \"unknown\", Runnable.class); \t\n }",
"private void onUnavailable() {\n // TODO: broadcast\n }",
"public void notifyNoAcctReport (COPSPdpOSReqStateMan man);",
"public void onServiceDisconnected(ComponentName className) {\n _boundService = null; \n Toast.makeText(TestServiceHolder.this, \"Service connected\", \n Toast.LENGTH_SHORT).show(); \n }",
"public void onServiceUnregistered() {\r\n \t// Update the list of sessions\r\n\t\tupdateList();\r\n }",
"public void onMessageNotFound(Message message) throws MessagingException;",
"public void verifyService() throws Throwable{\r\n\t\twdlib.waitForElement(getServiceText());\r\n\t\t\r\n\t\tif(!getServiceText().getText().equals(\"None Included\"))\r\n\t\t{\r\n\t\t\tReporter.log(getServiceText().getText()+\" is deleted\",true);\r\n\t\t\tdeleteService();\r\n\t\t}\r\n\t}",
"@Override\n @MainThread\n public void onServiceDisconnected(ComponentName name) {\n Slog.i(TAG, \"Explicit health check service is disconnected \" + name);\n synchronized (mLock) {\n mRemoteService = null;\n }\n }",
"public void notifyNoKAliveReceived (COPSPdpOSReqStateMan man);",
"private void foundNonExistent() {\n\t\tstate = BridgeState.NON_EXISTENT;\n\t}",
"void failure(ServiceExecutionEvent e) {\n\n }",
"protected void onDiscoveryFailed() {\n logAndShowSnackbar(\"Could not subscribe.\");\n }",
"@Then(\"^My Account button is not present$\")\r\n public void my_Account_button_is_not_present() throws Throwable {\n throw new PendingException();\r\n }",
"private void sendNoSuchMethod(HttpRequest request, HttpResponse response) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_FOUND );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The method you requested is not known to this service!\" );\n\t\tconnector.logError(\"Invocation request \" + request.getPath() + \" for unknown service method\");\n\t}",
"@Override\n protected void notifyUserOnPlayServicesUnavailable() {\n final View rootView = findViewById(R.id.root_layout);\n if (rootView == null) return;\n Snackbar.make(rootView, R.string.google_play_services_error, Snackbar.LENGTH_LONG)\n .show();\n }",
"public boolean ignoreService() {\n if (\"undef\".equalsIgnoreCase(type) || \"undef,1.0\".equalsIgnoreCase(type))\n return true;\n return false;\n }",
"@Override\n public void serviceLost(DNSSDService browser, int flags, int ifIndex, String serviceName, String regType, String domain) {\n }",
"@Override\n public int systemNotResponding(String msg) throws RemoteException {\n Log.i(TAG, String.format(\"System is not responding: %s\", msg));\n return 1;\n }",
"boolean hasService();",
"boolean hasService();",
"boolean hasService();",
"boolean hasService();",
"boolean hasService();",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n serviceBound = false; // Indicates that the service is no longer bound.\n }",
"public void onNoAccountsFound();",
"@Test\n public void testConnectToInvalidService()\n throws IOException\n {\n final boolean availability = ConnectionChecker.checkServiceAvailability(\"localhost\", 65534, 3000);\n\n assertFalse(availability);\n }",
"public void serviceUninstalled(String serviceID) {\r\n \t\teventIDFilter.serviceUninstalled(serviceID);\r\n \t}",
"public boolean addService(BluetoothGattService service) {\n/* 60 */ throw new RuntimeException(\"Stub!\");\n/* */ }",
"@Override\n\tpublic void unregisterService(String service) {\n\t\tassert((service!=null)&&(!\"\".equals(service))); //$NON-NLS-1$\n\t\tsuper.unregisterService(service);\n\t\t// Informs the other kernels about this registration\n\t\tgetMTS(NetworkMessageTransportService.class).broadcast(new KernelMessage(YellowPages.class,KernelMessage.Type.YELLOW_PAGE_UNREGISTERING,service,null));\n\t}",
"protected void noActiveActivity() {\n\t\tLog.i(STARTUP, \"no active activity\");\n\t\tcancelNotification();\n\t\tcreateNotification();\n\t\tstartMainService();\t\t\n\t}",
"public void onServiceDisconnected(ComponentName arg0) {\n\t\t\tmServiceBind = false;\n\t\t}",
"@Override\n\t\tpublic void onServiceDisconnected(ComponentName name) {\n\t\t\t\n\t\t}",
"@Override\n\t\tpublic void onServiceDisconnected(ComponentName name) {\n\t\t\t\n\t\t}",
"public void onServiceDisconnected();",
"public void reportNotWorking(Exception e) {\n if (isWorking == true) {\n\n if (e != null) {\n System.out.println(\"Subsystem \" + getName() + \" encountered a \" + e.getClass().getName() + \" and has stopped working!\");\n } else {\n System.out.println(\"Subsystem \" + getName() + \" has stopped working!\");\n }\n\n SmartDashboard.putBoolean(getName()+\" status\", false);\n\n isWorking = false;\n }\n }",
"@ForOverride\n public void onNotInUse(InternalSubchannel internalSubchannel) {\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n mService = null;\n mKillBtn.setEnabled(false);\n mCallbackText.setText(\"Disconnected\");\n Log.i(TAG, \"Disconnected form remote service\");\n }",
"@Override\n public void onServiceDisconnected(ComponentName className) {\n Log.d(TAG, className.toString() + \" service is unbound\");\n }",
"void disableNotifications();",
"public void onServiceRegistered() {\r\n \t// Nothing to do here\r\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n messengerService = null;\n messengerServiceBound = false;\n }",
"private void handleServerNotExist(String serverId) {\n String message = \"Artifactory Trigger failed triggering the job, since Artifactory server \";\n if (StringUtils.isNotBlank(serverId)) {\n message += \"'\" + serverId + \"' \";\n }\n message += \"does not exist.\";\n logger.warning(message);\n throw new RuntimeException(message);\n }",
"Object getService(String serviceName, boolean checkExistence);",
"public void onServiceDisconnected(ComponentName className) {\n\t\t\tLog.i(LOG_TAG, \"onService connected......method\");\n\t\t\tmBoundService = null;\n\t\t\t// Toast.makeText(ChatActivity.this, \"Disconnected to service\",\n\t\t\t// Toast.LENGTH_SHORT).show();\n\t\t}",
"boolean notifyDeleteService(InetAddress address, ContentEntry recording);",
"@Override\n public void onFailure(int code) {\n Log.e(TAG, \"discoverServices Failure \" + code);\n\n if (code == WifiP2pManager.BUSY && mDeviceRegistering != null) {\n discoverServices();\n } else {\n mService.stopSelf();\n }\n }",
"public void serviceRemoved(String serviceID);",
"public void godNotAdded() {\n notifyGodNotAdded(this.getCurrentTurn().getCurrentPlayer().getNickname());\n }",
"public void noFlights();",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n\n mBound = false;\n }",
"@Override\n\t\tpublic void onServiceError(String error) {\n\n\t\t}",
"@Override\n\t\tpublic void onServiceError(String error) {\n\n\t\t}",
"public void alarmOnMissingSetting(String settingName);",
"@Override\n public void onFailure(int code) {\n Log.e(TAG, \"addServiceRequest Failure \" + code);\n mService.stopSelf();\n }",
"private void missedCall() {\n\n NotificationCompat.Builder nBuilder = new NotificationCompat.Builder(this);\n\n nBuilder.setSmallIcon(android.R.drawable.stat_notify_missed_call);\n\n nBuilder.setContentTitle(name);\n\n nBuilder.setContentText(resources.getString(R.string.missed_call));\n\n nBuilder.setColor(Color.rgb(4, 137, 209));\n\n nBuilder.setAutoCancel(true);\n\n Intent showCallLog = new Intent(Intent.ACTION_VIEW);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, showCallLog, PendingIntent.FLAG_CANCEL_CURRENT);\n\n nBuilder.setContentIntent(pendingIntent);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n notificationManager.notify(MISSED_CALL_NOTIFICATION, nBuilder.build());\n\n CallLogUtilities.addCallToLog(contentResolver, number, 0, CallLog.Calls.MISSED_TYPE, System.currentTimeMillis());\n\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n \n }",
"@Test\n public void testDeployedStateNotDeployedService() {\n cleanUp();\n\n State state = makeState(1L, \"State 1\");\n deployedServiceDataService.create(new DeployedService(state, Service.MOBILE_ACADEMY));\n\n assertFalse(propertyService.isServiceDeployedInState(Service.KILKARI, state));\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n }",
"@Override\n\t\t\tpublic void onServiceDisconnected(ComponentName name) {\n\t\t\t\t\n\t\t\t}",
"private void missedCall() {\n\n NotificationCompat.Builder nBuilder = new NotificationCompat.Builder(mContext);\n\n nBuilder.setSmallIcon(android.R.drawable.stat_notify_missed_call);\n\n nBuilder.setContentTitle(name);\n\n nBuilder.setContentText(resources.getString(R.string.missed_call));\n\n nBuilder.setColor(Color.rgb(4, 137, 209));\n\n nBuilder.setAutoCancel(true);\n\n Intent showCallLog = new Intent(Intent.ACTION_VIEW);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n PendingIntent pendingIntent = PendingIntent.getActivity(mContext, 0, showCallLog, PendingIntent.FLAG_CANCEL_CURRENT);\n\n nBuilder.setContentIntent(pendingIntent);\n\n showCallLog.setType(CallLog.Calls.CONTENT_TYPE);\n\n notificationManager.notify(MISSED_CALL_NOTIFICATION, nBuilder.build());\n\n CallLogUtilities.addCallToLog(contentResolver, number, 0, CallLog.Calls.MISSED_TYPE, System.currentTimeMillis());\n\n }",
"boolean removeServiceSubscriber(Service service);",
"public void NoGodHasSuchName() {\n notifyGodNotCorrect(this.getCurrentTurn().getCurrentPlayer().getNickname(), availableGods, chosenGodList);\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n }",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n }",
"public void onServiceDisconnected(ComponentName className) {\n\t\t// Log.i(this.getClass().getSimpleName(), \"onServiceDisconnected\"\n\t\t// + className.toShortString());\n\t\tbtService = null;\n\t\tToast.makeText(BaseAct.this, R.string.btservice_disconnected,\n\t\t\t\tToast.LENGTH_SHORT).show();\n\t}",
"public void onServiceDisconnected(ComponentName className) {\n\t\t\tmBoundService = null;\r\n\t\t\t// Toast.makeText(MainActivity.this, \"Service disconnected.\", Toast.LENGTH_SHORT).show();\r\n\t\t}",
"@Override\n public void onServiceDisconnected(ComponentName name) {\n\n }",
"final void rescanService(EventBus eventBus) {\n eventBus.send(config.getAnnounceAddress(), new JsonObject().put(\"status\", Status.UNKNOWN));\n }",
"private void StartUnipointNotificationService(Intent intent) {\n\n\t\tIntent b = new Intent(Unipoint_ServiceActivity.SERVICEACTION);\n\n\t\tif (Unipoint_ServiceActivity.bDEBUG)\n\t\t\tLog.v(TAG, \"Call Service function \");\n\t\tcontext.startService(b);\n\n\t}",
"@Override\r\n public void onServiceDisconnected(ComponentName className) {\r\n isObdServiceBound = false;\r\n }",
"public void onServiceDisconnected(ComponentName className) {\n\t\t\t\tservice = null;\n\t\t\t\tLog.d(\"OpenXC binding\", \"openXC service disconnected\");\n\t\t\t}",
"private void PatientNoExist(View v) {\n\t\t//create an alert box with specified properties\n \tnew AlertDialog.Builder(this)\n \t.setTitle(\"Error\")\n \t.setMessage(\"Sorry, This Patient doesn't exist\")\n \t.setNeutralButton(\"ok\", null)\n \t.show();\n\t}",
"public NotificationService(String name) {\n super(name);\n }",
"@Override\n\t\tpublic void onServiceDisconnected(ComponentName name) {\n\t\t}",
"@Override\n\t\tpublic void onServiceDisconnected(ComponentName name) {\n\t\t}",
"@Test\n\tpublic void emailNotExistsAuth() {\n\t\tassertFalse(service.emailExists(\"iamlegend@willsmith.com\"));\n\t}",
"public NotificationService() {\n super(\"NotificationService\");\n }",
"@Override\n public void onReceive(Context context, Intent intent) {\n Log.e(\"NoOperationReceiver\", \"NoOperationReceiver===================\" + intent.getAction());\n\n }",
"private void registerWithService() {\n\n try {\n\n Message msg = Message.obtain(null, TallyDeviceService.MSG_REGISTER_MESSAGE_ACTIVITY);\n if (msg == null) { return; }\n msg.obj = this;\n msg.replyTo = messenger;\n service.send(msg);\n\n } catch (Exception e) {\n Log.e(LOG_TAG, \"Line 306 :: \" + e.getMessage());\n service = null;\n }\n\n }",
"@Override\n\t\t\t\tpublic void onServiceDisconnected(ComponentName p1)\n\t\t\t\t{\n\t\t\t\t}",
"@Override\n\t\tpublic void onServiceDisconnected(ComponentName name) {\n\n\t\t}",
"public void clickOnWithoutNotificationTemplate() {\r\n\r\n\t\treportStep(\"About to click on With out Notification Template\", \"INFO\");\r\n\r\n\t\tif(clickAfterWait(withOutTemplateNotification)) {\r\n\r\n\t\t\treportStep(\"Successfully clicked on the Without Notification template \", \"PASS\");\r\n\r\n\t\t}else {\r\n\t\t\treportStep(\"Failed to click on the Without Notification template \", \"FAIL\");\r\n\t\t}\r\n\t}",
"public void onServiceDisconnected(ComponentName className) {\n Log.e(\"Activity\", \"Service has unexpectedly disconnected\");\n wsService = null;\n }",
"void notifyError(String strStatus)\n \t{\n \tNotification notification = new Notification(\n \t\t\tR.drawable.icon, strStatus, System.currentTimeMillis());\n \tPendingIntent contentIntent = PendingIntent.getActivity(\n \t\t\tthis, 0, new Intent(this, MainActivity.class), 0);\n \tnotification.setLatestEventInfo(\n \t\t\tthis, getText(R.string.app_name), strStatus, contentIntent);\n \tmNM.notify(R.string.app_name, notification);\n \t}",
"@Override\n public void populateServiceNotUpDiagnostics() {\n }",
"@Override\r\n\t\tpublic void onServiceDisconnected(ComponentName arg0) {\n\r\n\t\t}",
"@Override\n public void onServiceDisconnected(ComponentName componentName) {\n //Log.e(\"SERVICE_DISCONNECTED\", \"Disconnecting service\");\n boundNewsService = null;\n }",
"void clearService();",
"@Override\n\t\tpublic void getService(String system_id) throws RemoteException {\n\t\t\tSystem.out.println(\"get service invoke on \" + system_id);\n\t\t}",
"public void testBackgroundCheckStopsService() throws Exception {\n final Parcel data = Parcel.obtain();\n ServiceConnectionHandler conn = new ServiceConnectionHandler(mContext, mServiceIntent,\n WAIT_TIME);\n ServiceConnectionHandler conn2 = new ServiceConnectionHandler(mContext, mService2Intent,\n WAIT_TIME);\n\n ActivityManager am = mContext.getSystemService(ActivityManager.class);\n\n InstrumentationRegistry.getInstrumentation().getUiAutomation().grantRuntimePermission(\n STUB_PACKAGE_NAME, android.Manifest.permission.PACKAGE_USAGE_STATS);\n /*\n Log.d(\"XXXX\", \"Invoke: \" + cmd);\n Log.d(\"XXXX\", \"Result: \" + result);\n Log.d(\"XXXX\", SystemUtil.runShellCommand(getInstrumentation(), \"dumpsys package \"\n + STUB_PACKAGE_NAME));\n */\n\n ApplicationInfo appInfo = mContext.getPackageManager().getApplicationInfo(\n SIMPLE_PACKAGE_NAME, 0);\n\n UidImportanceListener uidServiceListener = new UidImportanceListener(mContext,\n appInfo.uid, ActivityManager.RunningAppProcessInfo.IMPORTANCE_SERVICE, WAIT_TIME);\n uidServiceListener.register();\n UidImportanceListener uidGoneListener = new UidImportanceListener(mContext,\n appInfo.uid, ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED, WAIT_TIME);\n uidGoneListener.register();\n\n WatchUidRunner uidWatcher = new WatchUidRunner(getInstrumentation(), appInfo.uid,\n WAIT_TIME);\n\n // First kill the process to start out in a stable state.\n mContext.stopService(mServiceIntent);\n mContext.stopService(mService2Intent);\n conn.bind();\n conn2.bind();\n IBinder service = conn.getServiceIBinder();\n IBinder service2 = conn2.getServiceIBinder();\n conn.unbind();\n conn2.unbind();\n try {\n service.transact(IBinder.FIRST_CALL_TRANSACTION, data, null, 0);\n } catch (RemoteException e) {\n }\n try {\n service2.transact(IBinder.FIRST_CALL_TRANSACTION, data, null, 0);\n } catch (RemoteException e) {\n }\n service = service2 = null;\n\n // Wait for uid's process to go away.\n uidGoneListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // And wait for the uid report to be gone.\n uidWatcher.waitFor(WatchUidRunner.CMD_GONE, null, WAIT_TIME);\n\n String cmd = \"appops set \" + SIMPLE_PACKAGE_NAME + \" RUN_IN_BACKGROUND deny\";\n String result = SystemUtil.runShellCommand(getInstrumentation(), cmd);\n\n // This is a side-effect of the app op command.\n uidWatcher.expect(WatchUidRunner.CMD_IDLE, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_NONEXISTENT);\n\n // We don't want to wait for the uid to actually go idle, we can force it now.\n cmd = \"am make-uid-idle \" + SIMPLE_PACKAGE_NAME;\n result = SystemUtil.runShellCommand(getInstrumentation(), cmd);\n\n // Make sure app is not yet on whitelist\n cmd = \"cmd deviceidle whitelist -\" + SIMPLE_PACKAGE_NAME;\n result = SystemUtil.runShellCommand(getInstrumentation(), cmd);\n\n // We will use this to monitor when the service is running.\n conn.startMonitoring();\n\n try {\n // Try starting the service. Should fail!\n boolean failed = false;\n try {\n mContext.startService(mServiceIntent);\n } catch (IllegalStateException e) {\n failed = true;\n }\n if (!failed) {\n fail(\"Service was allowed to start while in the background\");\n }\n\n // First poke the process into the foreground, so we can avoid background check.\n conn2.bind();\n conn2.waitForConnect();\n\n // Wait for process state to reflect running service.\n uidServiceListener.waitForValue(\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // Also make sure the uid state reports are as expected.\n uidWatcher.waitFor(WatchUidRunner.CMD_ACTIVE, null);\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_FG_SERVICE);\n\n conn2.unbind();\n\n // Wait for process to recover back down to being cached.\n uidServiceListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n uidWatcher.waitFor(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n // Try starting the service now that the app is waiting to idle... should work!\n mContext.startService(mServiceIntent);\n conn.waitForConnect();\n\n uidWatcher.waitFor(WatchUidRunner.CMD_UNCACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_SERVICE);\n\n // And also start the second service.\n conn2.startMonitoring();\n mContext.startService(mService2Intent);\n conn2.waitForConnect();\n\n // Force app to go idle now\n cmd = \"am make-uid-idle \" + SIMPLE_PACKAGE_NAME;\n result = SystemUtil.runShellCommand(getInstrumentation(), cmd);\n\n // Wait for services to be stopped by system.\n uidServiceListener.waitForValue(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n ActivityManager.RunningAppProcessInfo.IMPORTANCE_GONE);\n assertEquals(ActivityManager.RunningAppProcessInfo.IMPORTANCE_CACHED,\n am.getPackageImportance(SIMPLE_PACKAGE_NAME));\n\n // And service should be stopped by system, so just make sure it is disconnected.\n conn.waitForDisconnect();\n conn2.waitForDisconnect();\n\n uidWatcher.expect(WatchUidRunner.CMD_IDLE, null);\n // There may be a transient 'SVC' proc state here.\n uidWatcher.waitFor(WatchUidRunner.CMD_CACHED, null);\n uidWatcher.expect(WatchUidRunner.CMD_PROCSTATE, WatchUidRunner.STATE_CACHED_EMPTY);\n\n } finally {\n mContext.stopService(mServiceIntent);\n mContext.stopService(mService2Intent);\n conn.cleanup();\n conn2.cleanup();\n\n uidWatcher.finish();\n\n cmd = \"appops set \" + SIMPLE_PACKAGE_NAME + \" RUN_IN_BACKGROUND allow\";\n result = SystemUtil.runShellCommand(getInstrumentation(), cmd);\n cmd = \"cmd deviceidle whitelist -\" + SIMPLE_PACKAGE_NAME;\n result = SystemUtil.runShellCommand(getInstrumentation(), cmd);\n\n uidGoneListener.unregister();\n uidServiceListener.unregister();\n\n data.recycle();\n }\n }",
"public void onServiceDisconnected(ComponentName className) {\n \t\t\tmService = null;\n \t\t}",
"@Test\n public void testProcessNoResponse() {\n // NOTE: this json file is a RESPONSE, not a request\n String request = ResourceUtils.getResourceAsString(\"org/onap/policy/simulators/appclcm/appc.lcm.success.json\");\n assertNotNull(request);\n\n server.onTopicEvent(CommInfrastructure.NOOP, MY_TOPIC, request);\n\n verify(sink, never()).send(any());\n }",
"private void sendNotification() {\n }",
"public void startWithoutChecks() {\n service.enableMonitoring();\n for (ServiceNotifier serviceNotifier : serviceNotifiers) {\n serviceNotifier.onStart();\n }\n }",
"@Override\n\t\tpublic void emergencyServices() {\n\t\t\tSystem.out.println(\"FH--emergency services\");\t\n\t\t\t\n\t\t}",
"public void emergencyStopIssued()\n {\n // Default implementation does nothing\n }",
"public void actionPerformed(ActionEvent evt) {\n DialogManager.showMessage(null, \"Service Settings\", \"Not Implemented\");\n }",
"public void notifyDisplayNotFound();"
] | [
"0.69374394",
"0.6461096",
"0.621907",
"0.62181497",
"0.5889775",
"0.5846829",
"0.58165425",
"0.5774479",
"0.57358515",
"0.56942815",
"0.5693007",
"0.5644845",
"0.56437206",
"0.56131625",
"0.5612953",
"0.560876",
"0.5602512",
"0.5582086",
"0.55549115",
"0.55447495",
"0.55447495",
"0.55447495",
"0.55447495",
"0.55447495",
"0.5544703",
"0.5527037",
"0.5518781",
"0.5511159",
"0.5494223",
"0.54721373",
"0.5441394",
"0.54148614",
"0.54116094",
"0.54116094",
"0.5411188",
"0.53930366",
"0.53849155",
"0.53770447",
"0.5373784",
"0.5368318",
"0.53633237",
"0.5359728",
"0.53582734",
"0.5357286",
"0.5356787",
"0.5356374",
"0.53559226",
"0.53554237",
"0.5355065",
"0.53536636",
"0.5345748",
"0.534541",
"0.534541",
"0.5335671",
"0.53344893",
"0.5333317",
"0.5333157",
"0.5322695",
"0.53134775",
"0.53134775",
"0.53087044",
"0.53007185",
"0.5298365",
"0.52962446",
"0.5293995",
"0.5293995",
"0.52896446",
"0.52869457",
"0.52847683",
"0.528007",
"0.5276877",
"0.5271845",
"0.5269377",
"0.52686524",
"0.5268592",
"0.52683395",
"0.52683395",
"0.52603966",
"0.52490044",
"0.52308923",
"0.5230838",
"0.5229502",
"0.5229202",
"0.52271694",
"0.52231777",
"0.5219143",
"0.5218369",
"0.5217156",
"0.5214607",
"0.51882684",
"0.51875746",
"0.5183061",
"0.51744694",
"0.5169373",
"0.5168317",
"0.51664007",
"0.51632607",
"0.51631904",
"0.51619405",
"0.5154221"
] | 0.7643214 | 0 |
send a notification, that the processing of the invocation has been interrupted | private void sendInvocationInterrupted(HttpRequest request,
HttpResponse response) {
response.clearContent();
response.setStatus (HttpResponse.STATUS_INTERNAL_SERVER_ERROR );
response.setContentType ( "text/plain");
response.println ( "The invoction has been interrupted!");
connector.logError("Invocation has been interrupted!");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public void interrupted() {\n\n }",
"protected void interrupted() {\r\n\t\t \tP.println(Tt.getClassName(this) + \" interrupted\");\r\n\t\t }",
"protected void interrupted() {\r\n\t }",
"protected void interrupted() {\r\n }",
"protected void interrupted() {\r\n }",
"protected void interrupted() {\r\n }",
"protected void interrupted() {\r\n }",
"protected void interrupted() {\r\n }",
"protected void interrupted() {\r\n }",
"@Override\n\tprotected void interrupted() {\n\t\t//System.out.println(this.getClass().getSimpleName() + \" interrupted\");\n\t}",
"protected void interrupted() {\n \t// who cares\n }",
"protected void interrupted() {\n \t\n }",
"protected void interrupted() {\n \t\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n }",
"protected void interrupted() {\n \n }",
"public void interrupt();",
"protected void interrupted() {\n\t\tL.ogInterrupt(this);\n\t}",
"public void interrupt() {\n\t\tinterrupted = true;\n\t}",
"void interrupted(W worker);",
"public abstract void interrupt();",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\t}",
"protected void interrupted() {\n\r\n\t}",
"protected void interrupted() {\n\r\n\t}",
"protected void interrupted()\n\t{\n\t}",
"@Override\r\n\tpublic void onInterrupt() {\n\t\t\r\n\t}",
"@Override\n protected void interrupted() {\n System.out.println(\"SendToSmartDashBoard was interrupted.\");\n }",
"public void interrupt() {\r\n ServerLogger.log(this.myID + \" interrupt()\");\r\n this.run = false;\r\n //super.interrupt(); //To change body of overridden methods use File | Settings | File Templates.\r\n }",
"@Override\n public void interrupt() {\n super.interrupt(); //To change body of generated methods, choose Tools | Templates.\n }",
"@Override\n public void onInterrupt() {\n }",
"public void interrupt() {\n interrupted.set(true);\n Thread.currentThread().interrupt();\n }",
"public void interruptTask() {\n }",
"public void interruptTask() {\n }",
"@Override\r\n protected void interrupted() {\r\n }",
"@Override\n\tpublic void interrupted() {\n\n\t}",
"protected void interrupted() {\n \tSystem.out.println(\"pid Get\" + RobotMap.visionSensor.pidGet());\n\t\tRobotMap.visionSensor.stopProcessing();\n \tRobotMap.VisionDistanceRightPIDController.stop();\n\t\tRobotMap.VisionDistanceLeftPIDController.stop();\n \tRobot.driveTrain.resetTalonControlMode();\n\t\tRobot.driveTrain.setTalonsReversedState(false);\n\t\tSystem.out.println(\"Drive Forward By Vision Has Been Interupted\");\n\t}",
"public void stopProcessing() {\n interrupted = true;\n }",
"@Override\n\t\tpublic void interrupt() {\n\t\t\t\n\t\t\t///why is this method not called?????\n\t\t\tSystem.out.println(\"here\");\n\t\t\tsuper.interrupt();\n\t\t}",
"final void interruptTask() {\n/* 82 */ Thread currentRunner = this.runner;\n/* 83 */ if (currentRunner != null) {\n/* 84 */ currentRunner.interrupt();\n/* */ }\n/* 86 */ this.doneInterrupting = true;\n/* */ }",
"@Override\n\tprotected void onInterruption() throws SimControlException {\n\t\t\n\t}",
"@Override\n protected void interrupted() {\n }",
"public boolean isInterrupted();",
"protected void interrupted() {\n \tlogger.info(\"Interrupting AutoMoveLiftUp Command, encoder inches = {}\", Robot.liftSubsystem.readEncoderInInches());\n \t\n }",
"protected void interrupted()\n\t{\n\t\tstop();\n\t}",
"protected void interrupted() {\n\t\tSystem.out.println(\"AlignAndDrive interupted\");\n\t\tend();\n\t}",
"protected void interrupted ()\n\t{\n\n\t}",
"public void markInterrupted() {\n\t\tenvironmentStatus = State.INTERRUPTED.name();\n\t\terrorMessage = \"setup was interrupted\";\n\t\tthis.statusCode = StatusCode.Interrupted.code;\n\t}",
"public static void main(String[] args) throws InterruptedException {\n InterruptRethrow thread = new InterruptRethrow();\n thread.start();\n Thread.sleep(3000);\n // let me interrupt\n log.info(\"let me interrupt the task thread:D\");\n thread.interrupt();\n log.info(\"task thread interrupted? \" + thread.isInterrupted());\n }",
"protected void interrupted() {\n \tRobot.conveyor.stop();\n }",
"protected void interrupted() {\n \tRobot.lift.hold();\n \tRobot.debug.Stop();\n }",
"@Override\n protected void interrupted() {\n // isFinished = true;\n // end();\n }",
"protected void interrupted() {\n\t\tpid.disable();\n\t}",
"@Override\r\n\tprotected void interrupted() {\r\n\t}"
] | [
"0.77858585",
"0.76778305",
"0.7619255",
"0.7427392",
"0.7427392",
"0.7427392",
"0.7427392",
"0.7427392",
"0.7427392",
"0.7410991",
"0.7406487",
"0.7375838",
"0.7375838",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.734982",
"0.7336096",
"0.7283904",
"0.72833157",
"0.7253833",
"0.71859676",
"0.71688104",
"0.71518993",
"0.71518993",
"0.71518993",
"0.71518993",
"0.71518993",
"0.71518993",
"0.71518993",
"0.71518993",
"0.71518993",
"0.7094116",
"0.7094116",
"0.6938509",
"0.69331336",
"0.684508",
"0.68395233",
"0.68261033",
"0.679359",
"0.6787183",
"0.675847",
"0.675847",
"0.67377883",
"0.6737177",
"0.6727258",
"0.66951454",
"0.66484773",
"0.662773",
"0.6616743",
"0.653584",
"0.6534657",
"0.6529419",
"0.6526867",
"0.65245813",
"0.65053797",
"0.6499785",
"0.6495526",
"0.64854723",
"0.64521885",
"0.64519113",
"0.6445331",
"0.6430276"
] | 0.73475623 | 54 |
send a response that an internal error occurred | private void sendInternalErrorResponse(HttpResponse response,
String answerMessage, String logMessage) {
response.clearContent();
response.setContentType( "text/plain" );
response.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );
response.println ( answerMessage );
connector.logMessage ( logMessage );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"void sendError(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Throwable ex) throws IOException;",
"private void handleError(HttpServletResponse resp, Throwable ex) {\r\n try {\r\n if (resp.isCommitted()) {\r\n PrintWriter out = resp.getWriter();\r\n ex.printStackTrace(out);\r\n return;\r\n }\r\n resp.setStatus(500);\r\n resp.setContentType(\"text/html\");\r\n PrintWriter out = resp.getWriter();\r\n out.println(\"<html>\");\r\n out.println(\" <head><title>Execution Error: 500</title></head>\");\r\n out.println(\" <body>\");\r\n out.println(\" <h2>Execution Error: \"+ex.getClass().getSimpleName()+\"</h2>\");\r\n out.println(\" <p>Stack trace:</p>\");\r\n out.print(\" <blockquote><pre>\");\r\n if (ex instanceof RhinoException) {\r\n RhinoException rex = (RhinoException)ex;\r\n rex.printStackTrace(out);\r\n } else {\r\n ex.printStackTrace(out);\r\n }\r\n out.println(\"</pre></blockquote>\");\r\n out.println(\" <p><address>Powered by Alt Framework</address></p>\");\r\n out.println(\" </body>\");\r\n out.println(\"</html>\");\r\n } catch (IOException ex2) {\r\n ex2.printStackTrace(System.err);\r\n }\r\n }",
"@SuppressWarnings(\"ThrowableNotThrown\") \n public static Response getSCIMInternalErrorResponse() {\n JSONEncoder encoder = new JSONEncoder();\n CharonException exception = new CharonException(\"Internal Error\");\n String responseStr = encoder.encodeSCIMException(exception);\n return Response.status(exception.getStatus()).entity(responseStr).build();\n }",
"public SimpleResponse ERROR_INTERNAL_SERVER() {\n this.state = HttpStatus.INTERNAL_SERVER_ERROR.value();\n return ERROR_CUSTOM();\n }",
"public String formInternalError() \r\n {\r\n return formError(\"500 Internal server error\",\"Server broke\");\r\n }",
"@Override\n\tpublic Response toResponse(Throwable arg0) {\n\t\tErrorMessage errorMsg = new ErrorMessage(arg0.getMessage(),500,\"http://www.google.com\");\n\t\treturn Response.status(Status.INTERNAL_SERVER_ERROR).entity(errorMsg).build();\n\t}",
"@GetMapping(\"/500\")\n public void error()\n {\n throw new BadRequestException(\"500\", \"500 Internal Server Error - Threw BadRequestException.\");\n }",
"private void sendError(HttpExchange exchange, java.lang.String error, int errorCode) throws IOException {\n\n\t\tlogger.debug(\"Illegal request from \" + exchange.getRemoteAddress().getHostName() + \": \" + error);\n\t\texchange.sendResponseHeaders(errorCode, 0);\n\t\texchange.close();\n\t\treturn;\n\n\t}",
"void errorResponse( String error );",
"public void sendErrorResponse(MessageExchange exchange) {\n\t\tdoSend(exchange);\n\t}",
"private void retryTask(HttpServletResponse resp) {\n resp.setStatus(500);\n }",
"protected void printError(Exception ex, HttpServletResponse response) {\n int statusCode = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;\n String exceptionName = \"runtime\";\n\n if (ex instanceof CmisRuntimeException) {\n LOG.error(ex.getMessage(), ex);\n } else if (ex instanceof CmisStorageException) {\n LOG.error(ex.getMessage(), ex);\n statusCode = getErrorCode((CmisStorageException) ex);\n exceptionName = ((CmisStorageException) ex).getExceptionName();\n } else if (ex instanceof CmisBaseException) {\n statusCode = getErrorCode((CmisBaseException) ex);\n exceptionName = ((CmisBaseException) ex).getExceptionName();\n } else if (ex instanceof IOException) {\n LOG.warn(ex.getMessage(), ex);\n } else {\n LOG.error(ex.getMessage(), ex);\n }\n\n if (response.isCommitted()) {\n LOG.warn(\"Failed to send error message to client. Response is already committed.\", ex);\n return;\n }\n\n String message = ex.getMessage();\n if (!(ex instanceof CmisBaseException)) {\n message = \"An error occurred!\";\n }\n\n try {\n response.resetBuffer();\n response.setStatus(statusCode);\n response.setContentType(\"text/html\");\n response.setCharacterEncoding(IOUtils.UTF8);\n\n PrintWriter pw = response.getWriter();\n\n pw.print(\"<html><head><title>Apache Chemistry OpenCMIS - \"\n + exceptionName\n + \" error</title>\"\n + \"<style><!--H1 {font-size:24px;line-height:normal;font-weight:bold;background-color:#f0f0f0;color:#003366;border-bottom:1px solid #3c78b5;padding:2px;} \"\n + \"BODY {font-family:Verdana,arial,sans-serif;color:black;font-size:14px;} \"\n + \"HR {color:#3c78b5;height:1px;}--></style></head><body>\");\n pw.print(\"<h1>HTTP Status \" + statusCode + \" - <!--exception-->\" + exceptionName + \"<!--/exception--></h1>\");\n pw.print(\"<p><!--message-->\" + StringEscapeUtils.escapeHtml(message) + \"<!--/message--></p>\");\n\n String st = ExceptionHelper.getStacktraceAsString(ex);\n if (st != null) {\n pw.print(\"<hr noshade='noshade'/><!--stacktrace--><pre>\\n\" + st\n + \"\\n</pre><!--/stacktrace--><hr noshade='noshade'/>\");\n }\n\n pw.print(\"</body></html>\");\n } catch (Exception e) {\n LOG.error(e.getMessage(), e);\n try {\n response.sendError(statusCode, message);\n } catch (Exception en) {\n // there is nothing else we can do\n }\n }\n }",
"public void sendError(HttpServletRequest request,\r\n\t\t\t\t\t\t HttpServletResponse response, \r\n\t\t\t\t\t\t int code, \r\n\t\t\t\t\t\t String message)\r\n\t\tthrows IOException {\n\r\n\t\tresponse.setHeader(\"Cache-Control\",\"no-cache\");\r\n\t\tresponse.setHeader(\"Pragma\",\"no-cache\");\r\n\t\tresponse.setDateHeader(\"Expires\", 0);\r\n\t\t\r\n\t\tresponse.sendError(code, message);\r\n\t}",
"public static void sendError(HttpServletResponse res, int status, Throwable e) throws IOException {\n\t\tif(!res.isCommitted()) {\n\t\t\tif(e != null) {\n\t\t\t\tres.sendError(status, e.getMessage());\n\t\t\t} else {\n\t\t\t\tres.sendError(status);\n\t\t\t}\n\t\t}\n\t\tres.getOutputStream().close(); // prevent tomcat error pages\n\t}",
"protected static HttpResponseImpl createError(String message, final Throwable t) {\n final HttpResponseImpl res = new HttpResponseImpl(500, \"Internal Server Error\", \"text/html\");\n final PrintWriter body;\n try {\n body = res.getWriter();\n } catch (final IOException e) { // impossible normally\n return res;\n }\n\n body.println(\"<html>\");\n body.println(\"<body>\");\n body.println(\"<h3>Internal Server Error</h3>\");\n body.println(\"<br><br>\");\n\n if (LOGGER.isDebugEnabled()) { // this is not an error, don't log it by default\n LOGGER.error(String.valueOf(t), t);\n }\n\n if (message != null) {\n final StringTokenizer msg = new StringTokenizer(message, \"\\n\\r\");\n\n while (msg.hasMoreTokens()) {\n body.print(msg.nextToken());\n body.println(\"<br>\");\n }\n }\n\n if (t != null) {\n\n PrintWriter writer = null;\n\n try {\n body.println(\"<br><br>\");\n body.println(\"Stack Trace:<br>\");\n final ByteArrayOutputStream baos = new ByteArrayOutputStream();\n writer = new PrintWriter(baos);\n t.printStackTrace(writer);\n writer.flush();\n\n message = new String(baos.toByteArray());\n final StringTokenizer msg = new StringTokenizer(message, \"\\n\\r\");\n\n while (msg.hasMoreTokens()) {\n body.print(msg.nextToken());\n body.println(\"<br>\");\n }\n } catch (final Exception e) {\n //no-op\n } finally {\n if (writer != null) {\n writer.close();\n }\n }\n }\n\n body.println(\"</body>\");\n body.println(\"</html>\");\n\n return res;\n }",
"@Override\n\t\t\t\t\tpublic void httpFail(String response) {\n\t\t\t\t\t}",
"private void sendErrMsg(HttpServletResponse response, String errMsg) throws IOException {\n\t\tresponse.setStatus(HttpServletResponse.SC_OK);\n\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\tPrintWriter respWriter = response.getWriter();\n\t\trespWriter.println(errMsg);\n\t\tresponse.flushBuffer();\n\t}",
"private void sendProcessingError(Throwable t, ServletResponse response) {\n String stackTrace = getStackTrace(t); \n \n if (stackTrace != null && !stackTrace.equals(\"\")) {\n try {\n response.setContentType(\"text/html\");\n PrintStream ps = new PrintStream(response.getOutputStream());\n PrintWriter pw = new PrintWriter(ps); \n pw.print(\"<html>\\n<head>\\n<title>Error</title>\\n</head>\\n<body>\\n\"); //NOI18N\n\n // PENDING! Localize this for next official release\n pw.print(\"<h1>We had an error converting the URL to HTTPS</h1>\\n<pre>\\n\"); \n pw.print(stackTrace); \n pw.print(\"</pre></body>\\n</html>\"); //NOI18N\n pw.close();\n ps.close();\n response.getOutputStream().close();\n } catch (Exception ex) {\n }\n } else {\n try {\n PrintStream ps = new PrintStream(response.getOutputStream());\n t.printStackTrace(ps);\n ps.close();\n response.getOutputStream().close();\n } catch (Exception ex) {\n }\n }\n }",
"@GetAction(\"e500\")\n public static String backendServerError() {\n return Act.crypto().decrypt(\"bad-crypted-msg\");\n }",
"private static void writeErrorResponse(\n final ChannelHandlerContext ctx,\n final FullHttpRequest request,\n final HttpResponseStatus status) {\n\n writeResponse(ctx, request, status, TYPE_PLAIN, status.reasonPhrase().toString());\n }",
"protected void sendFailureMessage(Request request, IOException e) {\n\t\tsendMessage(obtainMessage(HttpConsts.REQUEST_FAIL, new Object[] {request, e}));\n\t}",
"@ExceptionHandler(Exception.class)\n\t@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)\n\t@ResponseBody\n\tpublic ErrorModel handleInternal(final Exception ex, final WebRequest request) {\n\t\tlogger.error(ex);\n\t\treturn new ErrorModel(\"server_error\", ex.getMessage());\n\t}",
"public void doError (int status, String message) {\n\tthis.statusCode = Integer.toString (status);\n\tHttpHeader header = responseHandler.getHeader (\"HTTP/1.0 400 Bad Request\");\n\tStringBuilder error = \n\t new StringBuilder (HtmlPage.getPageHeader (this, \"400 Bad Request\") +\n\t\t\t \"Unable to handle request:<br><b>\" + \n\t\t\t message +\n\t\t\t \"</b></body></html>\\n\");\n\theader.setContent (error.toString ());\n\tsendAndClose (header);\n }",
"private void action_error(HttpServletRequest request, HttpServletResponse response, String message) {\n\n FailureResult fail = new FailureResult(getServletContext());\n fail.activate(message, request, response);\n }",
"@Override\r\n\t\t\tpublic void onErrorResponse(String errorMessage) {\n\r\n\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(int statusCode, Header[] headers,\n\t\t\t\t\t\t\tThrowable throwable, JSONObject errorResponse) {\n\t\t\t\t\t\tToast.makeText(getActivity().getApplicationContext(), \"提交超时\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t}",
"public SimpleResponse ERROR() {\n this.state = HttpStatus.BAD_REQUEST.value();\n\n return ERROR_CUSTOM();\n }",
"public void httpfailure(String errmsg) {\n\t\t\n\t}",
"public void sendError()\n {\n \tString resultText = Integer.toString(stdID);\n \tresultText += \": \";\n\t\tfor(int i = 0; i<registeredCourses.size();i++)\n\t\t{\n\t\t\tresultText += registeredCourses.get(i);\n\t\t\tresultText += \" \";\n\t\t}\n\t\tresultText += \"--\";\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(semesterNum);\n\t\tresultText += \" \";\n\t\tresultText += Integer.toString(0); \n\t\tresultText += \" \";\n\t\tprintResults.writeResult(resultText);\n \tSystem.exit(1);\n }",
"public void sendErrorMessage( int statusCode ) {\r\n\r\n\t\tString httpVersion = HttpdConf.DEFAULT_HTTP_VERSION;\r\n\t\tif ( request != null && request.getHttpVersion() != null )\r\n\t\t\thttpVersion = request.getHttpVersion();\r\n\r\n\t\ttry {\r\n\r\n\t\t\tFile errorFile = new File( ERROR_FILE_PATH + Integer.toString( statusCode ) + \".html\" );\r\n\t\t\tHeaderBuilder builder = new HeaderBuilder();\r\n\t\t\tString headerMessage = builder.buildHeaderBegin( statusCode, httpVersion )\r\n\t\t\t\t\t.buildContentTypeAndLength( errorFile ).toString();\r\n\t\t\twriteHeaderMessage( headerMessage );\r\n\t\t\tserveFile( errorFile );\r\n\r\n\t\t} catch ( ServerException se ) {\r\n\t\t\tse.printStackTrace();\r\n\t\t}\r\n\r\n\t}",
"private void sendErrorResponse(String aText, int aStatus, HttpServletRequest aRequest, HttpServletResponse aResponse){\n try {\n aResponse.setStatus(aStatus);\n //fLogger.fine(\"Sending response in uncompressed form, as UTF-8. Length: \" + aText.length());\n String utf8Text = new String(aText.getBytes(), ENCODING);\n aResponse.setCharacterEncoding(\"UTF-8\");\n aResponse.setContentLength(utf8Text.getBytes().length); \n aResponse.setContentType(\"application/text\");\n PrintWriter out = aResponse.getWriter();\n out.append(utf8Text);\n } \n catch (IOException ex) {\n //in practice this won't happen\n logProblem(\"Problem sending an error response.\", ex);\n }\n }",
"void sendFailureMessage(int statusCode, Header[] headers, byte[] responseBody, Throwable error);",
"@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)\n @ExceptionHandler(Exception.class)\n public String handleAllException() {\n\n return \"server_error\";\n }",
"@Override\r\n\tpublic Response error(ErrorMessage errorMessage) {\r\n\r\n\t\tJSONObject json = new JSONObject();\r\n\r\n\t\ttry {\r\n\t\t\tjson.put(STAT, FAIL);\r\n\t\t\tjson.put(CODE, errorMessage.getCode());\r\n\t\t\tjson.put(MESSAGE, errorMessage.getMessage());\r\n\t\t} catch (JSONException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn buildResponse(json);\r\n\t}",
"@Override\n public void sendError(int arg0) throws IOException {\n\n }",
"private void sendError() throws IOException {\n System.out.println(\"Error Message\");\n DataOutputStream dos = new DataOutputStream(os);\n dos.writeInt(1);\n dos.writeByte(Message.MSG_ERROR_STATUS);\n }",
"public void errorResponse(int code, String msg){\n msg = errorMessage(code, msg);\n StringReader inputStream = new StringReader( msg );\n\n Content ct = new crc.content.text.html( inputStream, this );\n Transaction response = new HTTPResponse( Pia.instance().thisMachine,\n\t\t\t\t\t toMachine(), ct, false);\n response.setStatus( code );\n response.setContentType( \"text/html\" );\n response.setContentLength( msg.length() );\n Pia.debug(this, \"The header : \\n\" + response.headersAsString() );\n response.startThread();\n }",
"@Override\n public Response toResponse(InternalException ex) {\n ExternalException externalException = new ExternalException(\n ex.getErrorCode(),\n ex.getErrorDescription());\n\n Response.ResponseBuilder builder = Response\n .status(ex.getHttpStatusCode())\n .entity(externalException)\n .type(MediaType.APPLICATION_JSON);\n\n return builder.build();\n }",
"@Test(priority = 6)\n\tpublic void internalServerError() throws JsonProcessingException {\n\n\t\t\n\t\ttest.log(LogStatus.INFO, \"My test is starting.....\");\n\t\tResponse resp=given()\n\t .contentType(\"multipart/form-data\")\n\t .multiPart(\"product_line\",\"testing\")\n\t .multiPart(\"file\", new File(\"./src/test/resources/Sovdata.xlsx\"))\n\t .post(APIPath.apiPath.POST_VALID_PATH);\n\n\t\tAssert.assertEquals(resp.getStatusCode(),500);\n\t\ttest.log(LogStatus.PASS, \"Successfully validated status code expected 500 and Actual status code is :: \" + resp.getStatusCode());\n\n\t\tresp.then().body(\"message\",equalTo(\"Oops some error occured, please try again.\"));\n\t\ttest.log(LogStatus.FAIL, \"Oops some error occured, please try again.\");\n\t\ttest.log(LogStatus.INFO, \"My Test Has been ended \");\n\n\n\t}",
"@Override\n public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {\n Log.d(\"recon\", \"error \" + statusCode + \" \" + throwable);\n\n Toast.makeText(getApplicationContext(), \"Error: \" + statusCode + \" Verify your Internet Connection is stable or working.\", Toast.LENGTH_LONG).show();\n }",
"@RequestMapping(\"generalError\")\n\tpublic String error(HttpServletRequest request, HttpServletResponse response, Model model) {\n\t\tString classpath = \"javax.servlet.error\";\n\t\tInteger statusCode = (Integer) request.getAttribute(classpath + \".status_code\");\n\t\tThrowable throwable= (Throwable) request.getAttribute(classpath + \".exception\");\n\t\tString exceptionMessage= getExceptionMessage(throwable, statusCode);\n\t\tString requestUri = (String) request.getAttribute(classpath + \".request_uri\");\n\t\tif (requestUri == null) requestUri = \"Unknown\";\n\t\t\n\t\tString message = MessageFormat.format(\"{0} returned for {1} with message {2}\", statusCode, requestUri, exceptionMessage);\n\t\tmodel.addAttribute(\"errorMessage\", message);\n\t\treturn \"error/general\";\n\t}",
"@ExceptionHandler(Throwable.class)\n @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)\n public ErrorResponse handleBadRequest(Throwable e) {\n return new ErrorResponse(Constants.INTERNAL_ERROR, \"Internal Error\");\n }",
"public static void sendException( HttpServletResponse response, Exception e ) {\n \n // LOG.logInfo( \"Sending OGCWebServiceException to client.\" );\n OGCWebServiceException oe = new OGCWebServiceException( e.getMessage() );\n ExceptionReport report = new ExceptionReport( new OGCWebServiceException[] { oe } );\n e.printStackTrace();\n \n try {\n response.setContentType( \"application/vnd.ogc.se_xml\" );\n XMLFragment doc = XMLFactory.export( report );\n OutputStream os = response.getOutputStream();\n doc.write( os );\n os.close();\n } catch (Exception ex) {\n // LOG.logError( \"ERROR: \" + ex.getMessage(), ex );\n }\n }",
"@ExceptionHandler(value = {NullPointerException.class, \n \t\t\t\t\t\t RuntimeException.class, \n \t\t\t\t\t\t IOException.class})\n public ResponseEntity<Object> handleInternalServerErr(RuntimeException exception, WebRequest request) {\n return handleExceptionInternal(exception, \n \t\t\t\t\t\t\t \"Error interno en el servidor\", \n \t\t\t\t\t\t\t new HttpHeaders(), \n \t\t\t\t\t\t\t HttpStatus.INTERNAL_SERVER_ERROR, \n \t\t\t\t\t\t\t request);\n }",
"@Override\n\t\tpublic void onFailure(HttpException error, String msg) {\n\t\t\t\n\t\t}",
"@Override\n public void onFailure(int statusCode, Throwable error,\n String content) {\n\n if(statusCode == 404){\n Toast.makeText(context, \"Requested resource not found\", Toast.LENGTH_LONG).show();\n }else if(statusCode == 500){\n Toast.makeText(context, \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }else{\n // Toast.makeText(context, \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet]\", Toast.LENGTH_LONG).show();\n }\n }",
"public void sendError(int errorCode, String msg) {\n\t\t\tif (isCloseOnSendingError || ((errorCode >= 500) && IS_CLOSE_CONNECTION_ON_5XX_RESPONSE)) {\n\t\t\t\tsetPersistent(false);\n\t\t\t}\n\t\t\t\n\t\t\tif (isResponseCommitted()) {\n\t\t\t\tthrow new IllegalStateException(\"response is already committed\"); \n\t\t\t}\n\n\t\t\tsuper.sendError(errorCode, msg);\n\t\t}",
"private String httpNotOk() {\n return \"HTTP/1.1 404 not Found\\r\\n\"\n + \"Content-Type: text/html\\r\\n\"\n + \"\\r\\n\"\n + \"<!DOCTYPE html>\\n\"\n + \"<html>\\n\"\n + \"<head>\\n\"\n + \"<meta charset=\\\"UTF-8\\\">\\n\"\n + \"<title>Error</title>\\n\"\n + \"</head>\\n\"\n + \"<body>\\n\"\n + \"<h1>There is an error</h1>\\n\"\n + \"</body>\\n\"\n + \"</html>\\n\";\n }",
"public void doError (int statuscode, Exception e) {\n\tStringWriter sw = new StringWriter ();\n\tPrintWriter ps = new PrintWriter (sw);\n\te.printStackTrace (ps);\n\tString message = sw.toString ();\n\tthis.statusCode = Integer.toString (statuscode);\n\textraInfo = (extraInfo != null ? \n\t\t extraInfo + e.toString () : \n\t\t e.toString ());\n\tHttpHeader header = null;\n\tif (statuscode == 504) \n\t header = getHttpGenerator ().get504 (e, requestLine);\n\telse \n\t header = getHttpGenerator ().getHeader (\"HTTP/1.0 400 Bad Request\");\n\t\n\tStringBuilder sb = new StringBuilder ();\n\tsb.append (HtmlPage.getPageHeader (this, statuscode + \" \" + \n\t\t\t\t\t header.getReasonPhrase ()) +\n\t\t \"Unable to handle request:<br><b>\" + \n\t\t e.getMessage () +\n\t\t (header.getContent () != null ? \n\t\t \"<br>\" + header.getContent () : \n\t\t \"\") + \n\t\t \"</b><br><xmp>\" + message + \"</xmp></body></html>\\n\");\n\theader.setContent (sb.toString ());\n\tsendAndClose (header);\n }",
"@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\tLog.e(\"ee\", \"失败:\" + arg1);\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}",
"@Override\n public Response toResponse(Exception e) {\n\n\n ResponseEntity<Exception> re = new ResponseEntity<>(e, HttpStatus.INTERNAL_SERVER_ERROR);\n logger.error(\"errorResponse\", e); // logging stack trace.\n\n return this.errorResponse(HttpStatus.INTERNAL_SERVER_ERROR.value(), re, e);\n }",
"private void sendOldError(Exception e) {\n }",
"public void onFailure(Throwable caught) {\n Window.alert(SERVER_ERROR);\n }",
"public void onFailure(Throwable caught) {\n Window.alert(SERVER_ERROR);\n }",
"protected void serverError() throws IOException {\n cleanup();\n throw new IOException(\"Recieved error message from server:\\n\" + new String(_text_buffer));\n }",
"public void handleError(ClientHttpResponse response) throws IOException {\n }",
"@Override\n\t\t\t\t\t\t\tpublic void HttpFail(int ErrCode) {\n\n\t\t\t\t\t\t\t}",
"@Override\n\t\t\t\t\tpublic void onFailure(HttpException arg0, String arg1) {\n\t\t\t\t\t\tLog.e(\"ee\", \"失败:\" + arg1);\n\t\t\t\t\t\thandler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t\t// handler.sendEmptyMessage(HANDLER_NET_FAILURE);\n\t\t\t\t\t}",
"private static Response handleIOError(IOException e) {\n log.log(Level.WARNING, \"Error retrieving values\", e);\n ServiceError errMsg = new ServiceError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), \"Internal error retrieving value. If this error persists, please contact the site administrator\");\n return Response.status(Response.Status.BAD_REQUEST)\n .entity(errMsg)\n .build();\n }",
"@Override\n public void sendError(int arg0, String arg1) throws IOException {\n\n }",
"abstract void setResponseErrorMsg(HttpServletResponse response, String msg) throws IOException;",
"@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n // Hide Progress Dialog\n prgDialog.hide();\n // When Http response code is '400'\n if(statusCode == 400){\n Toast.makeText(getApplicationContext(), \"Error Creating Donation!!\", Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if(statusCode == 500){\n Toast.makeText(getApplicationContext(), \"Something went wrong at server end\", Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 400, 500\n else{\n Toast.makeText(getApplicationContext(), \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet or remote server is not up and running]\", Toast.LENGTH_LONG).show();\n }\n }",
"public SimpleResponse ERROR_CUSTOM() {\n this.success = false;\n this.timestamp = System.currentTimeMillis();\n this.message = this.message == null ? \"На данный момент Ваш запрос не может быть выполнен. Пожалуйста попробуйте обновить страницу или попробовать позже\"\n : this.message;\n\n return this;\n }",
"private void action_error(HttpServletRequest request, HttpServletResponse response) throws IOException {\n //assumiamo che l'eccezione sia passata tramite gli attributi della request\n //we assume that the exception has been passed using the request attributes \n Map data=new HashMap();\n \n Exception exception = (Exception) request.getAttribute(\"exception\");\n String message;\n if (exception != null && exception.getMessage() != null) {\n message = exception.getMessage();\n } else {\n message = \"Unknown error\";\n }\n data.put(\"errore\",message);\n FreeMarker.process(\"404error.html\",data, response, getServletContext()); \n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, String content,\n Throwable e) {\n Log.d(\"statusCode\", \"4XX\");\n // Hide Progress Dialog\n //progress.hide();\n String resultErrorMsg = \"\";\n // When Http response code is '404'\n if (statusCode == 404) {\n resultErrorMsg = \"Requested resource not found\";\n }\n // When Http response code is '500'\n else if (statusCode == 500) {\n resultErrorMsg = \"Something went wrong at server end\";\n }\n // When Http response code other than 404, 500\n else {\n resultErrorMsg = \"Unexpected Error occcured! [Most common Error: Device might not be connected to Internet or remote server is not up and running]\";\n }\n bro.setResultStateCode(statusCode);\n bro.setResultMsg(resultErrorMsg);\n bro.setResultJSONArray(null);\n listener.onShowJobsFailure(bro);\n }",
"@Override\n\t\t\tpublic void handleError(ClientHttpResponse response) throws IOException {\n\t\t\t\t\n\t\t\t}",
"public void sendError(int i) throws IOException {\n\t\t\n\t}",
"protected HTTPSampleResult errorResult(Throwable e, HTTPSampleResult res) {\n res.setSampleLabel(res.getSampleLabel());\n res.setDataType(SampleResult.TEXT);\n ByteArrayOutputStream text = new ByteArrayOutputStream(200);\n e.printStackTrace(new PrintStream(text));\n res.setResponseData(text.toByteArray());\n res.setResponseCode(NON_HTTP_RESPONSE_CODE+\": \"+e.getClass().getName());\n res.setResponseMessage(NON_HTTP_RESPONSE_MESSAGE+\": \"+e.getMessage());\n res.setSuccessful(false);\n res.setMonitor(this.isMonitor());\n return res;\n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, String responseString, Throwable throwable) {\n loopjListener.getResponse(\"Error Bro:(\");\n Log.d(TAG, \"onFailure#2: \" + responseString);\n }",
"private void sendInternalError(Exception e) {\n LOG.error(\"Error after vertex manager callback \" + managedVertex.getLogIdentifier(), e);\n appContext.getEventHandler().handle(\n (new DAGEventInternalError(managedVertex.getVertexId().getDAGID(),\n \"Error in VertexManager for vertex: \" + managedVertex.getLogIdentifier()\n + \", error=\" + ExceptionUtils.getStackTrace(e))));\n }",
"@Override\r\n\tpublic Response error(String message) {\r\n\t\tJSONObject json = new JSONObject();\r\n\r\n\t\ttry {\r\n\t\t\tjson.put(STAT, FAIL);\r\n\t\t\tjson.put(MESSAGE, message);\r\n\t\t} catch (JSONException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn buildResponse(json);\r\n\t}",
"@Override\r\n\t\t\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\t\t\tsToast(\"失败\");\r\n\t\t\t\t\t}",
"private void sendInvocationException(HttpRequest request,\n\t\t\tHttpResponse response, ServiceInvocationException e) {\n\t\t// internal exception in service method\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_INTERNAL_SERVER_ERROR );\n\t\tresponse.setContentType( \"text/xml\" );\n\t\tconnector.logError(\"Exception while processing RMI: \" + request.getPath());\n\t\t\n\t\tObject[] ret = new Object[4];\n\t\tret[0] = \"Exception during RMI invocation!\";\n\t\t\n\t\tret[1] = e.getCause().getCause().getClass().getCanonicalName();\n\t\tret[2] = e.getCause().getCause().getMessage();\n\t\tret[3] = e.getCause().getCause();\n\t\tString code = ret[0]+\"\\n\"+ret[1]+\"\\n\"+ret[2]+\"\\n\"+ret[3];\n\t\tresponse.println ( code );\n\t}",
"@Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n loopjListener.getResponse(\"Error Bro:(\");\n Log.d(TAG, \"onFailure#1: \" + errorResponse);\n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {\n loopjListener.getResponse(\"Error Bro:(\");\n Log.d(TAG, \"onFailure#1: \" + errorResponse);\n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n e.printStackTrace();\n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n e.printStackTrace();\n }",
"protected HTTPSampleResult errorResult(Throwable e, HTTPSampleResult res) {\n res.setSampleLabel(res.getSampleLabel());\n res.setDataType(SampleResult.TEXT);\n ByteArrayOutputStream text = new ByteArrayOutputStream(200);\n e.printStackTrace(new PrintStream(text));\n res.setResponseData(text.toByteArray());\n res.setResponseCode(NON_HTTP_RESPONSE_CODE+\": \" + e.getClass().getName());\n res.setResponseMessage(NON_HTTP_RESPONSE_MESSAGE+\": \" + e.getMessage());\n res.setSuccessful(false);\n res.setMonitor(this.isMonitor());\n return res;\n }",
"private void sendConnectorProblems(HttpRequest request,\n\t\t\tHttpResponse response, Exception e) {\n\t\tresponse.clearContent();\n\t\tresponse.setStatus( HttpResponse.STATUS_NOT_ACCEPTABLE );\n\t\tresponse.setContentType( \"text/plain\" );\n\t\tresponse.println ( \"The invocation parameters could not be read!\" );\n\t\tresponse.println ( \"Exception-Message: \" + e.getMessage() );\n\t\tconnector.logError(\"Request coding exception in invocation request \" + request.getPath());\n\t}",
"@Override\n public void onFailure(int statusCode, cz.msebera.android.httpclient.Header[] headers, byte[] bytes, Throwable throwable) {\n\n // Hide Progress Dialog\n prgDialog.hide();\n // When Http response code is '404'\n if (statusCode == 404) {\n Toast.makeText(getApplicationContext(),\n \"Requested resource not found\",\n Toast.LENGTH_LONG).show();\n }\n // When Http response code is '500'\n else if (statusCode == 500) {\n Toast.makeText(getApplicationContext(),\n \"Something went wrong at server end\",\n Toast.LENGTH_LONG).show();\n }\n // When Http response code other than 404, 500\n else {\n Toast.makeText(\n getApplicationContext(),\n \"Error Occured n Most Common Error: n1. Device not connected to Internetn2. Web App is not deployed in App servern3. App server is not runningn HTTP Status code : \"\n + statusCode, Toast.LENGTH_LONG)\n .show();\n }\n }",
"@Override\r\n\t\t\tpublic void onFailure(Request arg0, IOException arg1) {\n\t\t\t\tsToast(\"失败\");\r\n\t\t\t}",
"public void sendError(String message) { \n\t\tthis.send(\"Error:\" + message); //remember a String IS-A Object!\n\t}",
"@Override\n public void onFailure(int statusCode, Headers headers, String response, Throwable throwable) {\n Log.i(\"doRequest\", \"doRequest failed\");\n\n }",
"private void sendToErrorPage(String errorMessage, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n RequestDispatcher dispatcher = request.getRequestDispatcher(\"/error.jsp\");\n ErrorBean errorBean = new ErrorBean();\n errorBean.setErrorText(errorMessage);\n request.setAttribute(ERROR_ATTRIBUTE_NAME, errorBean);\n dispatcher.forward(request, response);\n }",
"public void sendError(String xml, PrintWriter out) throws Exception {\n send(new StringReader(xml), out, m_errorTemplates);\n }",
"@Override\n\t\t\t\t\t\tpublic void onErrorResponse(String errorResponse) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}",
"@Override\n\t\t\tpublic void onError(int httpcode) {\n\t\t\t\t\n\t\t\t}",
"private void badMove(HttpServletResponse response) throws IOException {\r\n // Handle a bad request\r\n response.setStatus(400);\r\n try (PrintWriter out = response.getWriter()) {\r\n out.println(\"<!DOCTYPE html>\");\r\n out.println(\"<html>\");\r\n out.println(\"<head>\");\r\n out.println(\"<title>Tic Tac Toe</title>\"); \r\n out.println(\"</head>\");\r\n out.println(\"<body>\");\r\n out.println(\"<h1>400 Bad Request</h1>\");\r\n out.println(\"</html>\"); \r\n }\r\n }",
"public void sendError(String message) { \r\n this.send(\"Error:\" + message);\t//remember a String IS-A Object!\r\n }",
"@Override\n public void onFailure(Throwable t) {\n errorOut();\n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n }",
"@Override\n public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {\n }",
"private void errorProcess(CallbackContext callbackContext, Exception ex) {\n // Convierte el payLoad a JSON.\n Gson gson = new Gson();\n Map<String, String> exc_map = new HashMap<String, String>();\n exc_map.put(\"message\", ex.toString());\n exc_map.put(\"stacktrace\", getStackTrace(ex));\n // Convierte el payLoad a JSON.\n String jsonError = new Gson().toJson(exc_map);\n\n sendResultError(callbackContext, jsonError);\n ex.printStackTrace();\n if (callbackContext != null) {\n callbackContext.error(jsonError);\n }\n }",
"@Override\n public void onFailure(Throwable caught) {\n Window.alert(\"ERROR from SERVER\");\n }",
"@Override\n public void onFailure(Throwable caught) {\n Window.alert(\"ERROR from SERVER !!!\");\n }"
] | [
"0.74596363",
"0.7227734",
"0.7188947",
"0.7144633",
"0.70888644",
"0.7030464",
"0.69975865",
"0.69804937",
"0.6950978",
"0.6899659",
"0.6865351",
"0.6862976",
"0.67728233",
"0.67165333",
"0.66508055",
"0.65905803",
"0.6560623",
"0.6534828",
"0.64859515",
"0.64798045",
"0.6442935",
"0.64369726",
"0.6411224",
"0.63973963",
"0.6376353",
"0.63755125",
"0.63755125",
"0.63755125",
"0.63755125",
"0.63658166",
"0.6334021",
"0.63334906",
"0.63017195",
"0.6289113",
"0.62878805",
"0.62799215",
"0.6268337",
"0.6267501",
"0.62649935",
"0.62415236",
"0.62254757",
"0.6222359",
"0.6220527",
"0.6220507",
"0.6216501",
"0.6212683",
"0.62115747",
"0.62016714",
"0.6172207",
"0.616606",
"0.6155944",
"0.61552215",
"0.6150371",
"0.6150371",
"0.6146174",
"0.61339563",
"0.61314195",
"0.61291814",
"0.61291814",
"0.61239403",
"0.6120353",
"0.61196685",
"0.6115183",
"0.6106545",
"0.6094897",
"0.609102",
"0.6084273",
"0.6072019",
"0.6062828",
"0.60542375",
"0.6052843",
"0.6051561",
"0.6041558",
"0.6040608",
"0.6035866",
"0.60332114",
"0.60308826",
"0.6026333",
"0.60214865",
"0.60214865",
"0.60129076",
"0.60129076",
"0.60092807",
"0.6006344",
"0.6005953",
"0.5985114",
"0.59680617",
"0.59657097",
"0.59571064",
"0.5947504",
"0.5941877",
"0.5941665",
"0.5940579",
"0.5939167",
"0.5932761",
"0.59314275",
"0.59314275",
"0.5930623",
"0.5926353",
"0.5917874"
] | 0.7018993 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.