|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
PageBoxLib.DynDns
PageBox DNS registration using DynDNS protocol.
Changes:
alexis.grandemange@pagebox.net
Copyright (c) 2002-2004 Alexis Grandemange
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. A copy of the GNU Lesser General Public License lesser.txt should be included in the distribution.
Field Summary | |
(package private) java.util.TreeMap |
archives
Archives currently installed Key: archive name Value: Archive object |
(package private) ServletContext |
ctx
Unique to the Web application |
(package private) java.lang.String |
dnshost
Already used DynDNS registration service URL (from dyndns.txt) |
(package private) java.io.File |
f
Points on DynDNS.txt |
(package private) java.io.File |
fif
Points on fileinfo.xml |
(package private) java.lang.String |
host
DNS name to register |
(package private) java.lang.String |
inter
Network interface registered on DynDNS |
(package private) ListenerIF |
listener
Non-HTTP listener instance |
Log |
log
Logging object. |
(package private) java.lang.String |
myaddr
Already used IP address (from dyndns.txt) |
(package private) java.lang.String |
myhost
Already used host name (from dyndns.txt) |
(package private) java.lang.String |
name
Name of the host to register on DynDNS |
(package private) java.lang.String |
PageBoxURL
URL of the DeployIF Web service of this PageBox |
(package private) java.lang.String |
password
Password used to connect to DynDNS |
(package private) long |
period
Period between two retries = 1/4 hour |
(package private) java.util.HashMap |
repositories
Key: Repository URL Value: FixInfo object |
Reinstall |
ri
Instance used to reinstal archives on startup |
(package private) RepoTest |
rt
Used to test repNotifyFix. |
(package private) RuleHandler.Rule |
rule
Memory representation of rules.xml |
TokenCallbackImpl |
tcbi
Token callback instance |
(package private) boolean |
toRegister
If true register the PageBox |
private boolean |
toStop
If true ends the thread |
(package private) java.lang.String |
url
DynDNS registration service URL |
(package private) java.lang.String |
user
User used to connect to DynDNS |
(package private) java.lang.String |
workDir
Directory where dyndns.txt is defined |
(package private) java.lang.String |
ws
Web service URL |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
DynDns(java.lang.String workDir,
Log log,
ServletContext ctx)
Constructor. |
Method Summary | |
private void |
checkArchives()
Notify fix to the repository if the archive still exists and if its status has not changed. |
java.lang.String |
computeURL(HttpServletRequest request)
Compute the URL of the DeployIF Web service of this PageBox. |
void |
end()
Requires the thread termination |
private void |
initialize()
Check Dynamic DNS parameters and restores dyndns.txt. |
void |
notifyFix(java.lang.String repURL,
java.lang.String repUser,
java.lang.String repPassword,
java.lang.String arch,
int status,
java.lang.String subscriber)
Notify a fix of a PageBox setting problem. |
private void |
register()
Retrieves the IP address and calls register2.. |
(package private) void |
register2(java.lang.String addr)
Calls the registration page and updates dyndns.txt if needed. |
private boolean |
repNotifyFix(java.lang.String repURL,
FixInfo fixInfo,
java.lang.String subscriber)
Notify a fix of a PageBox setting problem. |
private java.lang.String |
restorePbArchs()
Parse PbArchives.xml and set the archives HashMap. |
void |
run()
Main method of the Retry thread. |
private void |
saveFixInfo()
Save pending notifications of PageBox fixes in fixinfo.xml. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
java.lang.String workDir
public Log log
java.lang.String url
java.lang.String user
java.lang.String password
java.lang.String host
java.lang.String inter
java.lang.String name
java.lang.String dnshost
java.lang.String myhost
java.lang.String myaddr
java.io.File f
java.io.File fif
long period
private boolean toStop
java.util.HashMap repositories
java.lang.String PageBoxURL
RepoTest rt
java.util.TreeMap archives
ServletContext ctx
boolean toRegister
RuleHandler.Rule rule
public TokenCallbackImpl tcbi
ListenerIF listener
java.lang.String ws
public Reinstall ri
Constructor Detail |
public DynDns(java.lang.String workDir, Log log, ServletContext ctx)
workDir
- Directory where to record the registrationlog
- logging objectctx
- used to retrieve DynDNS parametersMethod Detail |
private void initialize()
public void run()
public void end()
private void checkArchives()
private java.lang.String restorePbArchs()
private void register()
void register2(java.lang.String addr)
public void notifyFix(java.lang.String repURL, java.lang.String repUser, java.lang.String repPassword, java.lang.String arch, int status, java.lang.String subscriber)
repURL
- URL of the RepositoryrepUser
- Repository subscriber namerepPassword
- Repository subscriber passwordarch
- archive namestatus
- archive installation statussubscriber
- subscribed PageBox that was fixed
private void saveFixInfo()
private boolean repNotifyFix(java.lang.String repURL, FixInfo fixInfo, java.lang.String subscriber)
repURL
- URL of the repositoryfixInfo
- notification informationsubscriber
- subscribed PageBox that was fixed
public java.lang.String computeURL(HttpServletRequest request)
request
- HttpServletRequest.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |