Class VNS
- java.lang.Object
-
- org.apache.vinci.transport.VinciServableAdapter
-
- org.apache.vinci.transport.vns.service.VNS
-
- All Implemented Interfaces:
TransportableFactory
,VinciServable
public class VNS extends VinciServableAdapter
VNS (Vinci Naming Service) provides the "directory" of all available Vinci services. VNS must be running somewhere on the network for VinciClient and VinciServer classes to function. These classes consult org.apache.vinci.transport.vns.client.VNSConfig to determine the location of the VNS service.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
backlog
private static java.lang.String
backupFile
private static int
backupInterval
(package private) java.lang.Thread
backupThread
(package private) BackupThread
backupThreadRunnable
private static java.lang.String
bindAddress
private java.util.HashMap
cachedResults
private static java.lang.String
configDir
private static java.lang.String
configFile
private static java.lang.String
counterFile
static java.lang.String
dirCmdAddAlias
static java.lang.String
dirCmdAddService
static java.lang.String
dirCmdDelAlias
static java.lang.String
dirCmdDelService
static java.lang.String
dirCmdGetHits
static java.lang.String
dirCmdGetList
static java.lang.String
dirCmdGetNames
static java.lang.String
dirCmdUpdateService
java.lang.String
ENV_PROXY
(package private) java.util.Hashtable
hits
(package private) java.io.Writer
log
private static java.lang.String
logFile
private static boolean
logFlag
private static int
maxThreads
(package private) java.lang.String
myLogFile
(package private) int
port
(package private) static java.io.File
quitFile
(package private) ServiceRegistry
SR
private static int
srvPort
(package private) java.lang.String
starttime
(package private) int
totalhits
private static java.lang.String
workspacesFile
(package private) WorkspaceConfig
WS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) VinciFrame
addAlias(VinciFrame in)
(package private) VinciFrame
addService(VinciFrame in)
private void
cache(java.lang.String s, java.lang.Object o)
private java.lang.Object
checkCache(java.lang.String s)
void
cleanExit()
Called when the service is being shutdown by the server/service container.(package private) VinciFrame
delAlias(VinciFrame in)
(package private) VinciFrame
delService(VinciFrame in)
static java.lang.String
emptyString(java.lang.String s)
Transportable
eval(Transportable inp)
The eval method accepts an input document and returns an output document that is the result of performing the service.(package private) VinciFrame
getFrame(boolean ok, java.lang.String err)
(package private) VinciFrame
getHits(VinciFrame in)
(package private) VinciFrame
getList(VinciFrame in)
(package private) VinciFrame
getNames(VinciFrame in)
boolean
loadConfig(java.lang.String cFile)
void
loadCounters(java.lang.String cFile)
void
loadWorkspaces(java.lang.String wFile)
(package private) void
logRequest(java.lang.String type, java.lang.String ip, java.lang.String text)
static void
main(java.lang.String[] args)
private static void
printUsage()
(package private) VinciFrame
resolve(VinciFrame in)
(package private) VinciFrame
resolveDefaults(VinciFrame in)
(package private) VinciFrame
resolveLocal(VinciFrame in)
(package private) VinciFrame
resolveProxy(VinciFrame in, java.lang.String workspace)
void
saveConfig(java.lang.String cFile)
void
saveCounters(java.lang.String cFile)
void
saveWorkspaces(java.lang.String wFile)
(package private) VinciFrame
serveon(VinciFrame in)
private static void
setConfigDir(java.lang.String path)
static void
startServing()
static java.lang.String
strip(java.lang.String s)
private void
updateCache(java.lang.String s)
private Service
updateCache(Service S)
(package private) VinciFrame
updateService(VinciFrame in)
-
Methods inherited from class org.apache.vinci.transport.VinciServableAdapter
makeTransportable
-
-
-
-
Field Detail
-
cachedResults
private java.util.HashMap cachedResults
-
dirCmdAddService
public static final java.lang.String dirCmdAddService
- See Also:
- Constant Field Values
-
dirCmdAddAlias
public static final java.lang.String dirCmdAddAlias
- See Also:
- Constant Field Values
-
dirCmdDelService
public static final java.lang.String dirCmdDelService
- See Also:
- Constant Field Values
-
dirCmdDelAlias
public static final java.lang.String dirCmdDelAlias
- See Also:
- Constant Field Values
-
dirCmdUpdateService
public static final java.lang.String dirCmdUpdateService
- See Also:
- Constant Field Values
-
dirCmdGetList
public static final java.lang.String dirCmdGetList
- See Also:
- Constant Field Values
-
dirCmdGetNames
public static final java.lang.String dirCmdGetNames
- See Also:
- Constant Field Values
-
dirCmdGetHits
public static final java.lang.String dirCmdGetHits
- See Also:
- Constant Field Values
-
ENV_PROXY
public java.lang.String ENV_PROXY
-
configFile
private static java.lang.String configFile
-
backupFile
private static java.lang.String backupFile
-
workspacesFile
private static java.lang.String workspacesFile
-
counterFile
private static java.lang.String counterFile
-
logFile
private static java.lang.String logFile
-
configDir
private static java.lang.String configDir
-
backupInterval
private static int backupInterval
-
srvPort
private static int srvPort
-
logFlag
private static boolean logFlag
-
bindAddress
private static java.lang.String bindAddress
-
backlog
private static int backlog
-
maxThreads
private static int maxThreads
-
port
int port
-
myLogFile
java.lang.String myLogFile
-
backupThread
java.lang.Thread backupThread
-
backupThreadRunnable
BackupThread backupThreadRunnable
-
hits
java.util.Hashtable hits
-
totalhits
int totalhits
-
SR
ServiceRegistry SR
-
WS
WorkspaceConfig WS
-
log
java.io.Writer log
-
starttime
java.lang.String starttime
-
quitFile
static java.io.File quitFile
-
-
Method Detail
-
setConfigDir
private static void setConfigDir(java.lang.String path)
-
main
public static void main(java.lang.String[] args) throws java.io.IOException
- Throws:
java.io.IOException
-
printUsage
private static void printUsage()
-
startServing
public static void startServing() throws java.io.IOException
- Throws:
java.io.IOException
-
loadConfig
public boolean loadConfig(java.lang.String cFile)
-
loadWorkspaces
public void loadWorkspaces(java.lang.String wFile)
-
loadCounters
public void loadCounters(java.lang.String cFile)
-
saveConfig
public void saveConfig(java.lang.String cFile)
-
saveCounters
public void saveCounters(java.lang.String cFile)
-
saveWorkspaces
public void saveWorkspaces(java.lang.String wFile)
-
eval
public Transportable eval(Transportable inp) throws ServiceException
Description copied from interface:VinciServable
The eval method accepts an input document and returns an output document that is the result of performing the service.- Specified by:
eval
in interfaceVinciServable
- Specified by:
eval
in classVinciServableAdapter
- Parameters:
inp
- The input document- Returns:
- The output document
- Throws:
ServiceException
- thrown when there is an application level error that should result in the client receiving the same ServiceException on the other end.
-
resolveLocal
VinciFrame resolveLocal(VinciFrame in)
-
resolveProxy
VinciFrame resolveProxy(VinciFrame in, java.lang.String workspace)
-
resolveDefaults
VinciFrame resolveDefaults(VinciFrame in)
-
resolve
VinciFrame resolve(VinciFrame in)
-
serveon
VinciFrame serveon(VinciFrame in)
-
addService
VinciFrame addService(VinciFrame in)
-
addAlias
VinciFrame addAlias(VinciFrame in)
-
delService
VinciFrame delService(VinciFrame in)
-
delAlias
VinciFrame delAlias(VinciFrame in)
-
updateService
VinciFrame updateService(VinciFrame in)
-
getList
VinciFrame getList(VinciFrame in)
-
getNames
VinciFrame getNames(VinciFrame in)
-
getHits
VinciFrame getHits(VinciFrame in)
-
cache
private void cache(java.lang.String s, java.lang.Object o)
-
updateCache
private void updateCache(java.lang.String s)
-
checkCache
private java.lang.Object checkCache(java.lang.String s)
-
getFrame
VinciFrame getFrame(boolean ok, java.lang.String err)
-
strip
public static java.lang.String strip(java.lang.String s)
-
emptyString
public static java.lang.String emptyString(java.lang.String s)
-
logRequest
void logRequest(java.lang.String type, java.lang.String ip, java.lang.String text)
-
cleanExit
public void cleanExit()
Description copied from interface:VinciServable
Called when the service is being shutdown by the server/service container.- Specified by:
cleanExit
in interfaceVinciServable
- Overrides:
cleanExit
in classVinciServableAdapter
-
-