org.openrdf.http.object
Class HTTPObjectServer

java.lang.Object
  extended by org.openrdf.http.object.HTTPObjectServer
Type Parameters:
a -
All Implemented Interfaces:
HTTPService, HTTPObjectAgentMXBean

public class HTTPObjectServer
extends Object
implements HTTPService, HTTPObjectAgentMXBean

Manages the start and stop stages of the server.

Author:
James Leigh

Field Summary
protected static String DEFAULT_NAME
           
 
Constructor Summary
HTTPObjectServer(ObjectRepository repository, File www, File cacheDir, String basic)
           
 
Method Summary
 void destroy()
           
 int getCacheCapacity()
           
 int getCacheSize()
           
 ConnectionBean[] getConnections()
           
 String getEnvelopeType()
           
 String getErrorXSLT()
           
 String getFrom()
           
 String[] getIdentityPrefix()
           
static HTTPObjectServer[] getInstances()
           
 String getName()
           
 Repository getRepository()
           
 String getStatus()
           
 int getTimeout()
          Defines the keep alive timeout in milliseconds, which is the timeout for waiting for data.
 void invalidateCache()
           
 boolean isCacheAggressive()
           
 boolean isCacheDisconnected()
           
 boolean isCacheEnabled()
           
 boolean isRunning()
           
 void listen(int... ports)
           
 void poke()
           
static void resetAllCache()
           
 void resetCache()
           
 void resetConnections()
           
 org.apache.http.HttpResponse service(org.apache.http.HttpRequest request)
          HttpEntity.consumeContent() or HttpEntity.writeTo(java.io.OutputStream) must be called if HttpResponse.getEntity() is non-null.
 void setCacheAggressive(boolean cacheAggressive)
           
 void setCacheCapacity(int capacity)
           
 void setCacheDisconnected(boolean cacheDisconnected)
           
 void setCacheEnabled(boolean cacheEnabled)
           
 void setEnvelopeType(String type)
           
 void setErrorXSLT(String url)
           
 void setFrom(String from)
           
 void setIdentityPrefix(String[] prefix)
           
 void setName(String serverName)
           
 void setTimeout(int timeout)
          Defines the keep alive timeout in milliseconds, which is the timeout for waiting for data.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_NAME

protected static final String DEFAULT_NAME
Constructor Detail

HTTPObjectServer

public HTTPObjectServer(ObjectRepository repository,
                        File www,
                        File cacheDir,
                        String basic)
                 throws IOException
Parameters:
basic - username:password
Throws:
IOException
Method Detail

getInstances

public static HTTPObjectServer[] getInstances()

resetAllCache

public static void resetAllCache()

getErrorXSLT

public String getErrorXSLT()

setErrorXSLT

public void setErrorXSLT(String url)

getRepository

public Repository getRepository()

getName

public String getName()
Specified by:
getName in interface HTTPObjectAgentMXBean

setName

public void setName(String serverName)
Specified by:
setName in interface HTTPObjectAgentMXBean

getIdentityPrefix

public String[] getIdentityPrefix()

getTimeout

public int getTimeout()
Defines the keep alive timeout in milliseconds, which is the timeout for waiting for data. A timeout value of zero is interpreted as an infinite timeout.


setTimeout

public void setTimeout(int timeout)
Defines the keep alive timeout in milliseconds, which is the timeout for waiting for data. A timeout value of zero is interpreted as an infinite timeout.


setIdentityPrefix

public void setIdentityPrefix(String[] prefix)

getEnvelopeType

public String getEnvelopeType()

setEnvelopeType

public void setEnvelopeType(String type)
                     throws MimeTypeParseException
Throws:
MimeTypeParseException

isCacheAggressive

public boolean isCacheAggressive()
Specified by:
isCacheAggressive in interface HTTPObjectAgentMXBean

isCacheDisconnected

public boolean isCacheDisconnected()
Specified by:
isCacheDisconnected in interface HTTPObjectAgentMXBean

isCacheEnabled

public boolean isCacheEnabled()
Specified by:
isCacheEnabled in interface HTTPObjectAgentMXBean

setCacheAggressive

public void setCacheAggressive(boolean cacheAggressive)
Specified by:
setCacheAggressive in interface HTTPObjectAgentMXBean

setCacheDisconnected

public void setCacheDisconnected(boolean cacheDisconnected)
Specified by:
setCacheDisconnected in interface HTTPObjectAgentMXBean

setCacheEnabled

public void setCacheEnabled(boolean cacheEnabled)
Specified by:
setCacheEnabled in interface HTTPObjectAgentMXBean

getCacheCapacity

public int getCacheCapacity()
Specified by:
getCacheCapacity in interface HTTPObjectAgentMXBean

setCacheCapacity

public void setCacheCapacity(int capacity)
Specified by:
setCacheCapacity in interface HTTPObjectAgentMXBean

getCacheSize

public int getCacheSize()
Specified by:
getCacheSize in interface HTTPObjectAgentMXBean

getFrom

public String getFrom()
Specified by:
getFrom in interface HTTPObjectAgentMXBean

setFrom

public void setFrom(String from)
Specified by:
setFrom in interface HTTPObjectAgentMXBean

invalidateCache

public void invalidateCache()
                     throws IOException,
                            InterruptedException
Specified by:
invalidateCache in interface HTTPObjectAgentMXBean
Throws:
IOException
InterruptedException

resetCache

public void resetCache()
Specified by:
resetCache in interface HTTPObjectAgentMXBean

resetConnections

public void resetConnections()
                      throws IOException
Specified by:
resetConnections in interface HTTPObjectAgentMXBean
Throws:
IOException

listen

public void listen(int... ports)
            throws Exception
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface HTTPObjectAgentMXBean
Throws:
Exception

isRunning

public boolean isRunning()

stop

public void stop()
          throws Exception
Specified by:
stop in interface HTTPObjectAgentMXBean
Throws:
Exception

destroy

public void destroy()
             throws Exception
Specified by:
destroy in interface HTTPObjectAgentMXBean
Throws:
Exception

poke

public void poke()
Specified by:
poke in interface HTTPObjectAgentMXBean

getStatus

public String getStatus()
Specified by:
getStatus in interface HTTPObjectAgentMXBean

getConnections

public ConnectionBean[] getConnections()
Specified by:
getConnections in interface HTTPObjectAgentMXBean

service

public org.apache.http.HttpResponse service(org.apache.http.HttpRequest request)
                                     throws IOException
Description copied from interface: HTTPService
HttpEntity.consumeContent() or HttpEntity.writeTo(java.io.OutputStream) must be called if HttpResponse.getEntity() is non-null.

Specified by:
service in interface HTTPService
Throws:
IOException


Copyright © 2004-2011 James Leigh Services Inc.. All Rights Reserved.