Package org.astrogrid.samp.web
Class WebHubProfile.ServerFactory
- java.lang.Object
-
- org.astrogrid.samp.web.WebHubProfile.ServerFactory
-
- Enclosing class:
- WebHubProfile
public static class WebHubProfile.ServerFactory extends java.lang.Object
Creates and configures the HTTP server on which the Web Profile resides.
-
-
Constructor Summary
Constructors Constructor Description ServerFactory()
Constructs a ServerFactory with default properties.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InternalServer
createSampXmlRpcServer()
Returns a new internal server.protected java.net.ServerSocket
createServerSocket(int port)
Creates a socket on a given port to be used by the server this object produces.java.lang.String
getLogType()
Returns the type of logging to use.OriginAuthorizer
getOriginAuthorizer()
Returns the authorization policy for external origins.int
getPort()
Returns the port number the server will run on.java.lang.String
getXmlrpcPath()
Returns the path on the HTTP server at which the XML-RPC server will reside.boolean
isAllowFlash()
Indicates whether Adobe Flash cross-domain workaround will be supported.boolean
isAllowSilverlight()
Indicates whether Microsoft Silverlight cross-domain workaround will be supported.void
setAllowFlash(boolean allowFlash)
Sets whether Adobe Flash cross-domain workaround will be supported.void
setAllowSilverlight(boolean allowSilverlight)
Sets whether Microsoft Silverlight cross-domain workaround will be supported.void
setLogType(java.lang.String logType)
Sets the type of logging to use.void
setOriginAuthorizer(OriginAuthorizer oAuth)
Sets the authorization policy for external origins.void
setPort(int port)
Sets the port number the server will run on.void
setXmlrpcPath(java.lang.String xmlrpcPath)
Sets the path on the HTTP server at which the XML-RPC server will reside.
-
-
-
Method Detail
-
createSampXmlRpcServer
public InternalServer createSampXmlRpcServer() throws java.io.IOException
Returns a new internal server.- Returns:
- new server for use with WebHubProfile
- Throws:
java.io.IOException
-
setLogType
public void setLogType(java.lang.String logType)
Sets the type of logging to use.- Parameters:
logType
- logging type; may be "http", "rpc", "xml", "none" or null
-
getLogType
public java.lang.String getLogType()
Returns the type of logging to use.- Returns:
- logging type; may be "http", "rpc", "xml", "none" or null
-
setPort
public void setPort(int port)
Sets the port number the server will run on. If port=0, then an unused port will be used at run time.- Parameters:
port
- port number
-
getPort
public int getPort()
Returns the port number the server will run on.- Returns:
- port number
-
setXmlrpcPath
public void setXmlrpcPath(java.lang.String xmlrpcPath)
Sets the path on the HTTP server at which the XML-RPC server will reside.- Parameters:
xmlrpcPath
- server path for XML-RPC server
-
getXmlrpcPath
public java.lang.String getXmlrpcPath()
Returns the path on the HTTP server at which the XML-RPC server will reside.- Returns:
- XML-RPC path on server
-
setAllowFlash
public void setAllowFlash(boolean allowFlash)
Sets whether Adobe Flash cross-domain workaround will be supported.- Parameters:
allowFlash
- true iff supported
-
isAllowFlash
public boolean isAllowFlash()
Indicates whether Adobe Flash cross-domain workaround will be supported.- Returns:
- true iff supported
-
setAllowSilverlight
public void setAllowSilverlight(boolean allowSilverlight)
Sets whether Microsoft Silverlight cross-domain workaround will be supported.- Parameters:
allowSilverlight
- true iff supported
-
isAllowSilverlight
public boolean isAllowSilverlight()
Indicates whether Microsoft Silverlight cross-domain workaround will be supported.- Returns:
- true iff supported
-
setOriginAuthorizer
public void setOriginAuthorizer(OriginAuthorizer oAuth)
Sets the authorization policy for external origins.- Parameters:
oAuth
- authorizer
-
getOriginAuthorizer
public OriginAuthorizer getOriginAuthorizer()
Returns the authorization policy for external origins.- Returns:
- authorizer
-
createServerSocket
protected java.net.ServerSocket createServerSocket(int port) throws java.io.IOException
Creates a socket on a given port to be used by the server this object produces.- Parameters:
port
- port number- Returns:
- new server socket
- Throws:
java.io.IOException
-
-