◆ createHandshakeFromContract()
Definition at line 59 of file HandshakeContract.java.
60 Company company = CompanyWrapper.getDefaultCompany();
62 HandshakeContract hc =
new HandshakeContract();
63 hc.petitioner = company.getName();
64 hc.remoteServer = ElephantContext.getServerUrl(
"http");
65 hc.remoteId = contract.getId();
66 hc.remoteName = contract.getName();
◆ createHandshakeFromFile()
static HandshakeContract org.turro.financials.handshake.HandshakeContract.createHandshakeFromFile |
( |
File |
file | ) |
|
|
static |
Definition at line 76 of file HandshakeContract.java.
79 }
catch (IOException ex) {
80 Logger.getLogger(HandshakeContract.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
static HandshakeContract createHandshakeFromJson(String value)
◆ createHandshakeFromJson()
static HandshakeContract org.turro.financials.handshake.HandshakeContract.createHandshakeFromJson |
( |
String |
value | ) |
|
|
static |
◆ createJsonFromContract()
static String org.turro.financials.handshake.HandshakeContract.createJsonFromContract |
( |
Contract |
contract | ) |
|
|
static |
Definition at line 51 of file HandshakeContract.java.
54 return new Gson().toJson(hc);
static HandshakeContract createHandshakeFromContract(Contract contract)
◆ equals()
boolean org.turro.financials.handshake.HandshakeContract.equals |
( |
Object |
obj | ) |
|
Definition at line 157 of file HandshakeContract.java.
161 if (getClass() != obj.getClass()) {
164 final HandshakeContract other = (HandshakeContract) obj;
165 if (this.
remoteId != other.remoteId) {
168 if (!Objects.equals(
this.remoteServer, other.remoteServer)) {
◆ existsHandshake()
static boolean org.turro.financials.handshake.HandshakeContract.existsHandshake |
( |
HandshakeContract |
hc | ) |
|
|
static |
Definition at line 122 of file HandshakeContract.java.
124 if(!folder.exists()) { folder.mkdirs(); }
125 for(File file : folder.listFiles()) {
static final String HANDSHAKE_FOLDER
static HandshakeContract createHandshakeFromFile(File file)
◆ getContractFromHandshake()
Definition at line 98 of file HandshakeContract.java.
100 return ch !=
null ? ch.getContract() :
null;
static ContractHandshake getContractHandshakeFromHandshake(HandshakeContract hc)
◆ getContractFromRemoteContract()
static Contract org.turro.financials.handshake.HandshakeContract.getContractFromRemoteContract |
( |
String |
value | ) |
|
|
static |
◆ getContractHandshakeFromHandshake()
Definition at line 103 of file HandshakeContract.java.
104 Dao dao =
new FinancialsPU();
105 return (ContractHandshake) dao.getSingleResultOrNull(
106 "select ch from ContractHandshake ch " +
107 "where ch.remoteServer = ? " +
108 "and ch.remoteId = ?",
◆ hashCode()
int org.turro.financials.handshake.HandshakeContract.hashCode |
( |
| ) |
|
◆ saveHandshakePetition()
static void org.turro.financials.handshake.HandshakeContract.saveHandshakePetition |
( |
HandshakeContract |
hc | ) |
|
|
static |
Definition at line 115 of file HandshakeContract.java.
117 File file =
new File(ElephantContext.getRealPath(
HANDSHAKE_FOLDER) +
"/contract" + IdGenerator.generate() +
".handshake");
static void saveHandshakeToFile(File file, HandshakeContract hc)
static boolean existsHandshake(HandshakeContract hc)
◆ saveHandshakeToFile()
static void org.turro.financials.handshake.HandshakeContract.saveHandshakeToFile |
( |
File |
file, |
|
|
HandshakeContract |
hc |
|
) |
| |
|
static |
Definition at line 85 of file HandshakeContract.java.
87 FileUtil.setContent(file,
new Gson().toJson(hc));
88 }
catch (IOException ex) {
89 Logger.getLogger(HandshakeContract.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
◆ updateRemoteId()
static boolean org.turro.financials.handshake.HandshakeContract.updateRemoteId |
( |
String |
remoteServer, |
|
|
String |
remoteId, |
|
|
long |
contractId |
|
) |
| |
|
static |
Definition at line 134 of file HandshakeContract.java.
135 Dao dao =
new FinancialsPU();
136 return dao.executeUpdate(
137 "update ContractHandshake " +
138 "set remoteId = ? " +
139 "where remoteServer = ? " +
140 "and contract.id = ?",
◆ HANDSHAKE_FOLDER
final String org.turro.financials.handshake.HandshakeContract.HANDSHAKE_FOLDER = "/WEB-INF/handshake/contract" |
|
static |
◆ petitioner
String org.turro.financials.handshake.HandshakeContract.petitioner |
◆ remoteId
long org.turro.financials.handshake.HandshakeContract.remoteId |
◆ remoteName
String org.turro.financials.handshake.HandshakeContract.remoteName |
◆ remoteServer
String org.turro.financials.handshake.HandshakeContract.remoteServer |
The documentation for this class was generated from the following file: