public class SocketServerInterface extends java.lang.Object implements ServerInterface
| Modifier and Type | Class and Description |
|---|---|
private class |
SocketServerInterface.PingThread |
| Modifier and Type | Field and Description |
|---|---|
private ErrorHandler |
errorHandler |
private boolean |
gzip |
private java.lang.String |
host |
private java.io.InputStream |
in |
private javax.crypto.SecretKey |
key |
private java.io.InputStream |
originalIn |
private java.util.Hashtable |
originalTimes |
private java.io.OutputStream |
out |
private long |
pingdelay |
private int |
port |
private java.net.Socket |
s |
private java.lang.StringBuffer |
session |
private TopicMap |
tm |
private boolean |
uncommitted |
| Constructor and Description |
|---|
SocketServerInterface() |
SocketServerInterface(java.lang.String host,
int port)
Creates a new instance of SocketServerInterface
|
SocketServerInterface(java.lang.String host,
int port,
long pingdelay) |
| Modifier and Type | Method and Description |
|---|---|
void |
applySession(java.lang.StringBuffer session) |
void |
checkTopics(TopicMap tm) |
boolean |
cipher() |
void |
clearCache() |
boolean |
clearTopicMap() |
void |
close() |
void |
commit(boolean force) |
void |
connect() |
java.lang.String |
customCommand(java.lang.String command) |
static java.lang.String |
decode(java.lang.String sis) |
boolean |
delete(java.lang.String filename) |
static java.lang.String |
encode(java.lang.String sis) |
private Topic |
fetchTopic(java.lang.String topicSI) |
private Topic[] |
fetchTopics(java.lang.String[] topicSIs) |
private Topic[] |
fetchTopicsOfType(java.lang.String typeSI) |
boolean |
fileExists(java.lang.String file) |
java.lang.StringBuffer |
getSession() |
java.lang.String |
getTimeStamp(Topic t) |
Topic |
getTopic(java.lang.String topicSI) |
Topic |
getTopicByName(java.lang.String name) |
Topic[] |
getTopics(java.lang.String[] topicSIs) |
Topic[] |
getTopicsOfType(java.lang.String typeSI) |
private java.lang.String |
getTransferableSI(Topic t) |
boolean |
gzip() |
void |
handleServerError(java.lang.Exception e) |
private void |
initialize() |
private void |
initializeTopicMap() |
boolean |
isConnected() |
boolean |
isUncommitted() |
java.lang.String[] |
listDirectories(java.lang.String dir) |
java.lang.String[] |
listFiles(java.lang.String dir) |
boolean |
login(java.lang.String user,
java.lang.String password) |
void |
mergeIn(TopicMap tm) |
boolean |
needLogin() |
boolean |
openTopicMap(java.lang.String key) |
boolean |
ping() |
private java.lang.String |
readLine() |
static java.lang.String |
readLine(java.io.InputStream in) |
private void |
readTopicMapIn() |
void |
removeAssociation(Association a) |
void |
removeBaseName(Topic t) |
void |
removeData(Topic t,
Topic type,
Topic version) |
void |
removeSubjectIdentifier(Topic t,
Locator l) |
void |
removeSubjectLocator(Topic t) |
void |
removeTopic(Topic t) |
void |
removeTopicType(Topic t,
Topic type) |
void |
removeVariantName(Topic t,
java.util.Collection scope) |
void |
rollback() |
java.lang.String[] |
search(java.lang.String query) |
void |
setServerErrorHandler(ErrorHandler handler) |
java.lang.String |
upload(java.io.InputStream in,
java.lang.String filename,
long length) |
java.lang.String |
upload(java.io.InputStream in,
java.lang.String filename,
long length,
boolean overwrite) |
void |
writelog(java.lang.String lvl,
java.lang.String msg) |
boolean |
writeTopicMapTo(java.io.OutputStream tmout) |
private TopicMap tm
private java.net.Socket s
private java.io.InputStream in
private java.io.InputStream originalIn
private java.io.OutputStream out
private java.util.Hashtable originalTimes
private long pingdelay
private boolean uncommitted
private boolean gzip
private javax.crypto.SecretKey key
private java.lang.StringBuffer session
private ErrorHandler errorHandler
private java.lang.String host
private int port
public SocketServerInterface(java.lang.String host,
int port)
throws java.io.IOException
java.io.IOExceptionpublic SocketServerInterface(java.lang.String host,
int port,
long pingdelay)
throws java.io.IOException
java.io.IOExceptionpublic SocketServerInterface()
throws java.io.IOException
java.io.IOExceptionpublic void connect()
throws java.io.IOException
connect in interface ServerInterfacejava.io.IOExceptionprivate void initialize()
throws java.io.IOException
java.io.IOExceptionprivate void initializeTopicMap()
public void checkTopics(TopicMap tm) throws ServerException
checkTopics in interface ServerInterfaceServerExceptionpublic java.lang.String getTimeStamp(Topic t)
public void commit(boolean force)
throws WandoraException,
ServerException
commit in interface ServerInterfaceWandoraExceptionServerExceptionprivate java.lang.String readLine()
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readLine(java.io.InputStream in)
throws java.io.IOException
java.io.IOExceptionprivate Topic fetchTopic(java.lang.String topicSI) throws ServerException
ServerExceptionprivate void readTopicMapIn()
throws java.io.IOException,
TopicMapException
java.io.IOExceptionTopicMapExceptionprivate Topic[] fetchTopicsOfType(java.lang.String typeSI) throws ServerException
ServerExceptionprivate Topic[] fetchTopics(java.lang.String[] topicSIs) throws ServerException
ServerExceptionpublic Topic getTopic(java.lang.String topicSI) throws ServerException
getTopic in interface ServerInterfaceServerExceptionpublic Topic[] getTopics(java.lang.String[] topicSIs) throws ServerException
getTopics in interface ServerInterfaceServerExceptionpublic Topic[] getTopicsOfType(java.lang.String typeSI) throws ServerException
getTopicsOfType in interface ServerInterfaceServerExceptionpublic void mergeIn(TopicMap tm) throws ServerException
mergeIn in interface ServerInterfaceServerExceptionpublic void removeAssociation(Association a) throws ServerException
removeAssociation in interface ServerInterfaceServerExceptionpublic void removeData(Topic t, Topic type, Topic version) throws ServerException
removeData in interface ServerInterfaceServerExceptionpublic void removeTopic(Topic t) throws ServerException
removeTopic in interface ServerInterfaceServerExceptionpublic void removeVariantName(Topic t, java.util.Collection scope) throws ServerException
removeVariantName in interface ServerInterfaceServerExceptionpublic void removeBaseName(Topic t) throws ServerException
removeBaseName in interface ServerInterfaceServerExceptionpublic void rollback()
throws ServerException
rollback in interface ServerInterfaceServerExceptionpublic Topic getTopicByName(java.lang.String name) throws ServerException
getTopicByName in interface ServerInterfaceServerExceptionpublic void removeSubjectLocator(Topic t) throws ServerException
removeSubjectLocator in interface ServerInterfaceServerExceptionpublic void removeTopicType(Topic t, Topic type) throws ServerException
removeTopicType in interface ServerInterfaceServerExceptionpublic boolean clearTopicMap()
throws ServerException
clearTopicMap in interface ServerInterfaceServerExceptionpublic void clearCache()
clearCache in interface ServerInterfacepublic void writelog(java.lang.String lvl,
java.lang.String msg)
throws ServerException
writelog in interface ServerInterfaceServerExceptionpublic boolean writeTopicMapTo(java.io.OutputStream tmout)
throws java.io.IOException,
ServerException
writeTopicMapTo in interface ServerInterfacejava.io.IOExceptionServerExceptionpublic java.lang.String upload(java.io.InputStream in,
java.lang.String filename,
long length)
throws ServerException
ServerExceptionpublic java.lang.String upload(java.io.InputStream in,
java.lang.String filename,
long length,
boolean overwrite)
throws ServerException
upload in interface ServerInterfaceServerExceptionpublic java.lang.String[] listDirectories(java.lang.String dir)
throws ServerException
listDirectories in interface ServerInterfaceServerExceptionpublic java.lang.String[] listFiles(java.lang.String dir)
throws ServerException
listFiles in interface ServerInterfaceServerExceptionpublic boolean fileExists(java.lang.String file)
throws ServerException
fileExists in interface ServerInterfaceServerExceptionpublic boolean delete(java.lang.String filename)
throws ServerException
delete in interface ServerInterfaceServerExceptionpublic boolean gzip()
throws ServerException
gzip in interface ServerInterfaceServerExceptionpublic boolean cipher()
throws ServerException
cipher in interface ServerInterfaceServerExceptionpublic boolean login(java.lang.String user,
java.lang.String password)
throws ServerException
login in interface ServerInterfaceServerExceptionpublic boolean needLogin()
needLogin in interface ServerInterfacepublic boolean openTopicMap(java.lang.String key)
throws ServerException
openTopicMap in interface ServerInterfaceServerExceptionpublic void removeSubjectIdentifier(Topic t, Locator l) throws ServerException
removeSubjectIdentifier in interface ServerInterfaceServerExceptionpublic java.lang.String customCommand(java.lang.String command)
throws ServerException
customCommand in interface ServerInterfaceServerExceptionpublic boolean ping()
throws ServerException
ServerExceptionpublic boolean isUncommitted()
isUncommitted in interface ServerInterfacepublic java.lang.String[] search(java.lang.String query)
throws ServerException
search in interface ServerInterfaceServerExceptionpublic void close()
throws ServerException
close in interface ServerInterfaceServerExceptionpublic java.lang.StringBuffer getSession()
getSession in interface ServerInterfacepublic void setServerErrorHandler(ErrorHandler handler)
setServerErrorHandler in interface ServerInterfacepublic void handleServerError(java.lang.Exception e)
handleServerError in interface ServerInterfacepublic boolean isConnected()
isConnected in interface ServerInterfacepublic void applySession(java.lang.StringBuffer session)
throws ServerException
applySession in interface ServerInterfaceServerExceptionprivate java.lang.String getTransferableSI(Topic t)
public static java.lang.String decode(java.lang.String sis)
public static java.lang.String encode(java.lang.String sis)
Copyright 2004-2015 Wandora Team