|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.accpac.hosting.SDSFactory
public class SDSFactory
An SDSFactory is a factory for Accpac SharedDataSet
objects. It is
required to support hosting, where the host server may handle multiple shared
data sets.
Be aware that this class contains some code that is quite specific to the way AccpacOnline manages hosting.
Constructor Summary | |
---|---|
SDSFactory(javax.servlet.ServletContext context)
creates an instance of the SDSFactory |
Method Summary | |
---|---|
java.lang.String |
getHostCompanyID(javax.servlet.http.HttpServletRequest request)
gets the host company ID corresponding to this request. |
com.sage.accpac.sm.SharedDataSet |
getNonHostedSharedDataSet()
gets the SharedDataSet for a non-hosted situation |
com.sage.accpac.sm.SharedDataSet |
getSharedDataSet(javax.servlet.http.HttpServletRequest request)
gets a SharedDataSet that is compatible with the given request. |
java.lang.Iterable<com.sage.accpac.sm.SharedDataSet> |
getSharedDataSets()
gets an iterable collection of all the shared data sets that the factory controls |
boolean |
hostingIsEnabled()
returns true if and only if hosting is enabled on this factory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SDSFactory(@NonNull javax.servlet.ServletContext context)
SDSFactory
context
- the ServletContext
for which the factory is defined.Method Detail |
---|
@NonNull public com.sage.accpac.sm.SharedDataSet getSharedDataSet(@NonNull javax.servlet.http.HttpServletRequest request)
SharedDataSet
that is compatible with the given request.
In non-hosted situations there is only one shared data directory and so
this will return either a new SharedDataSet
or else a new
reference to a shared object of the class.
In hosted environments different users use different shared data
directories and this method will ensure that the user identified by the
request has a shared data directory and will return a
SharedDataSet
against that directory. (Again it may be a
second reference to a shared copy)
request
- the request being handled. If the system is in hosting mode
(with multiple shared data directories) then the request must
include an authorization header containing a Basic mode
authorization. The system will use the user name from that
header to decide upon the correct shared data directory to use.
SharedDataSet
that is compatible with the request, or
null if there is none.
java.lang.IllegalArgumentException
- if the request is not in the correct form. The message will
indicate in what way the request is unsuitable.@NonNull public com.sage.accpac.sm.SharedDataSet getNonHostedSharedDataSet()
SharedDataSet
for a non-hosted situation
In non-hosted situations there is only one shared data directory and so
this will return either a new SharedDataSet
or else a new
reference to a shared object of the class.
This method should not be called from a hosted environment. Calling this
from a hosted environment will result in an IllegalStateException
being thrown.
SharedDataSet
that is compatible with the request, or
null if there is none.
java.lang.IllegalStateException
- if called in a hosted situationpublic boolean hostingIsEnabled()
public java.lang.Iterable<com.sage.accpac.sm.SharedDataSet> getSharedDataSets()
public java.lang.String getHostCompanyID(javax.servlet.http.HttpServletRequest request)
If hosting is not enabled a blank string will be returned.
This is equivalent to
hostingIsEnabled() ? ((HostedSharedDataSet)getSharedDataSet(request)).getHostCompanyID() : "";
request
- the request being handled. If the system is in hosting mode
(with multiple shared data directories) then the request must
include an authorization header containing a Basic mode
authorization. The system will use the user name from that
header to decide upon the correct shared data directory to use.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |