| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.apelon.apelonserver.client.BasicQuery
com.apelon.dts.client.namespace.NamespaceQuery
public abstract class NamespaceQuery
A NamespaceQuery provides common methods for using namespaces.
The following events are fired in this class:
NamespaceEvent is fired for adding/modifying/deleting Namespace
 KBTypeEvent is fired for adding/deleting/ Authority
 NamespaceQuery nq1 = null; NamespaceQuery nq2 = null; // Initialization code for nq1 and nq2 nq2.addNamespaceListener(nq1.getNamespaceListener()); nq2.addKBTypeListener(nq1.getKBTypeListener()); // Now any event from nq2 will be available to nq1 listeners
Copyright: Copyright (c) 2003
Company: Apelon, Inc.
| Field Summary | |
|---|---|
protected  KBTypeListener | 
kbtypeListener
 | 
protected  NamespaceListener | 
namespaceListener
 | 
| Fields inherited from class com.apelon.apelonserver.client.BasicQuery | 
|---|
ADMIN, queryHeader | 
| Constructor Summary | |
|---|---|
NamespaceQuery()
 | 
|
| Method Summary | |
|---|---|
 boolean | 
addAuthority(Authority authority)
Adds an Authority to the DTS knowledgebase by sending a query to the server.  | 
 void | 
addKBTypeListener(KBTypeListener listener)
 | 
 boolean | 
addNamespace(Namespace namespace)
Adds a Namespace to the DTS knowledgebase by sending a query to the DTS server.  | 
 void | 
addNamespaceListener(NamespaceListener listener)
 | 
static NamespaceQuery | 
createInstance(ServerConnection sc)
Creates an instance of NamespaceQuery.  | 
static NamespaceQuery | 
createInstance(ServerConnection sc,
               boolean isValidating)
Creates an instance of NamespaceQuery.  | 
 boolean | 
deleteAuthority(Authority authority)
 | 
 boolean | 
deleteAuthorityByDescription(String authorityDescription)
Deletes the Authority with the specified description from the DTS knowledgebase by sending a query to the server.  | 
 boolean | 
deleteAuthorityById(int authorityId)
Deletes the Authority with the specified ID from the DTS knowledgebase by sending a query to the server.  | 
 boolean | 
deleteNamespaceByCode(String namespaceCode)
Deletes the Namespace with the specified code from the DTS knowledgebase by sending a query to the server.  | 
 boolean | 
deleteNamespaceById(int namespaceId)
Deletes the Namespace with the specified ID from the DTS knowledgebase by sending a query to the server.  | 
 boolean | 
deleteNamespaceByName(String namespaceName)
Deletes the Namespace with the specified name from the DTS knowledgebase by sending a query to the server.  | 
 Namespace | 
findNamespaceByCode(String namespaceCode)
Gets a Namespace object by passing the namespace code. | 
 Namespace | 
findNamespaceById(int namespaceId)
Gets a Namespace object by passing the namespace ID. | 
 Namespace | 
findNamespaceByName(String namespaceName)
Gets a Namespace object by passing the namespace name. | 
protected  void | 
fireAuthorityAction(KBTypeEvent event)
 | 
protected  void | 
fireNamespaceAction(NamespaceEvent event)
 | 
 Authority[] | 
getAuthorities()
Retrieves an array of Authoritys which represent the available
 namespace authorities in the DTS knowledgebase. | 
static Namespace | 
getDefaultNamespace()
Returns the Namespace that's been set as the default. | 
static int | 
getDefaultNamespaceId()
Return default namespace ID, if available.  | 
 Namespace[] | 
getExtendingNamespaces(int subsNamespaceId)
Gets an array of Ontylog Extension Namespaces which the given
 subscription namespace extends | 
 KBTypeListener | 
getKBTypeListener()
Get the KBTypeListener.  | 
 NamespaceListener | 
getNamespaceListener()
Get the NamespaceListener.  | 
 Namespace[] | 
getNamespaces()
Retrieves an array of Namespaces which represent the available
 namespaces in the knowledgebase. | 
 ContentVersion[] | 
getVersions(int namespaceId)
Retrieves an array of ContentVersions which are the list of
 versions for the given namespace Id in the knowledgebase. | 
 boolean | 
hasPermission(int namespaceId)
Determine whether the currently logged on user has permission to write to the specified namespace.  | 
 void | 
removeKBTypeListener(KBTypeListener listener)
 | 
 void | 
removeNamespaceListener(NamespaceListener listener)
 | 
 void | 
setDefaultNamespace()
Sets the Namespace to be used as the default Namespace in the system, if it can be determined by the system.  | 
static void | 
setDefaultNamespace(Namespace namespace)
Sets the Namespace to be used as the default Namespace in the system.  | 
 boolean | 
updateNamespace(Namespace oldNamespace,
                Namespace newNamespace)
Updates an existing Namespace in the DTS knowledgebase with the
 values specified in a new one. | 
 boolean | 
updateNamespaceAuthority(Namespace namespace,
                         Authority newNamespaceAuthority)
Deprecated. Use updateNamespace(Namespace oldNamespace, Namespace newNamespace)
             instead. | 
 boolean | 
updateNamespaceType(Namespace namespace,
                    NamespaceType namespaceType)
Deprecated. Use updateNamespace(Namespace oldNamespace, Namespace newNamespace)
             instead. | 
 boolean | 
updateNamespaceWritability(Namespace namespace,
                           boolean isWritable)
Deprecated. Use updateNamespace(Namespace oldNamespace, Namespace newNamespace)
             instead. | 
| Methods inherited from class com.apelon.apelonserver.client.BasicQuery | 
|---|
executeQuery, executeQueryNoParse, getServerConnection, initializeDtds, initializeDtds, ping, setVersion | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected transient KBTypeListener kbtypeListener
protected transient NamespaceListener namespaceListener
| Constructor Detail | 
|---|
public NamespaceQuery()
| Method Detail | 
|---|
public static NamespaceQuery createInstance(ServerConnection sc)
                                     throws IllegalArgumentException
sc - the type of server connection
IllegalArgumentException - if a null server connection is passedServerConnectionJDBC, 
ServerConnectionSocket
public static NamespaceQuery createInstance(ServerConnection sc,
                                            boolean isValidating)
                                     throws IllegalArgumentException
sc - the type of server connectionisValidating - a boolean value.  It is true if XML needs to
                              be validated, otherwise it is false.
IllegalArgumentException - if a null server connection is passedServerConnectionJDBC, 
ServerConnectionSocket
public boolean addNamespace(Namespace namespace)
                     throws DTSException
 Namespace.LOCAL_NAMESPACE_ID_THRESHOLD 
 and equal to or less than  Namespace.MAXIMUM_NAMESPACE_ID  (i.e.,   32678 <= id <= 65535 ).
namespace - the Namespace to add
DTSException - if any error occurs in the method
public boolean deleteNamespaceByName(String namespaceName)
                              throws DTSException
namespaceName - name of Namespace to be deleted
DTSException - if any error occurs in the method
public boolean deleteNamespaceByCode(String namespaceCode)
                              throws DTSException
namespaceCode - code of Namespace to be deleted
DTSException - if any error occurs in the method
public boolean deleteNamespaceById(int namespaceId)
                            throws DTSException
namespaceId - ID of Namespace to be deleted
DTSException - if any error occurs in the method
public Namespace findNamespaceByName(String namespaceName)
                              throws DTSException
Namespace object by passing the namespace name.
namespaceName - the namespace name
Namespace object corresponding to the specified
             namespace name
DTSException - if any error occurs in the method
public Namespace findNamespaceById(int namespaceId)
                            throws DTSException
Namespace object by passing the namespace ID.
namespaceId - the namespace ID
Namespace object corresponding to the specified
             namespace ID
DTSException - if any error occurs in the method
public Namespace findNamespaceByCode(String namespaceCode)
                              throws DTSException
Namespace object by passing the namespace code.
namespaceCode - the namespace code
Namespace object corresponding to the specified
             namespace Code
DTSException - if any error occurs in the method
public boolean updateNamespace(Namespace oldNamespace,
                               Namespace newNamespace)
                        throws DTSException
Namespace in the DTS knowledgebase with the
 values specified in a new one.  Updating the name, code, Authority,
 NamespaceType, and writability is allowed,  Updating the
 namespaced ID is not.
oldNamespace - the Namespace to be updatednewNamespace - the Namespace object containing
                              the new values
DTSException - if any error occurs in the method
public boolean updateNamespaceType(Namespace namespace,
                                   NamespaceType namespaceType)
                            throws DTSException
updateNamespace(Namespace oldNamespace, Namespace newNamespace)
             instead.
namespace - the Namespace to be updatednamespaceType - the NamespaceType of the namespace
DTSException - if any error occurs in the method
public boolean updateNamespaceWritability(Namespace namespace,
                                          boolean isWritable)
                                   throws DTSException
updateNamespace(Namespace oldNamespace, Namespace newNamespace)
             instead.
namespace - the Namespace to be updatedisWritable - the new namespace access:
                              'T' - read/write, 'F' - read only
DTSException - if any error occurs in the method
public boolean updateNamespaceAuthority(Namespace namespace,
                                        Authority newNamespaceAuthority)
                                 throws DTSException
updateNamespace(Namespace oldNamespace, Namespace newNamespace)
             instead.
namespace - the Namespace to be updatednewNamespaceAuthority - the new namespace authority
DTSException - if any error occurs in the method
public Namespace[] getNamespaces()
                          throws DTSException
Namespaces which represent the available
 namespaces in the knowledgebase.
DTSException - if any error occurs in the method
public ContentVersion[] getVersions(int namespaceId)
                             throws DTSException
ContentVersions which are the list of
 versions for the given namespace Id in the knowledgebase.
namespaceId - the namespace ID
ContentVersions of the given namespace
DTSException - if unable to retrieve any versions
public boolean addAuthority(Authority authority)
                     throws DTSException
authority - the Authority to add
DTSException - if any error occurs in the method
public boolean deleteAuthority(Authority authority)
                        throws DTSException
DTSException
public boolean deleteAuthorityByDescription(String authorityDescription)
                                     throws DTSException
authorityDescription - description of Authority to be deleted
DTSException - if any error occurs in the method
public boolean deleteAuthorityById(int authorityId)
                            throws DTSException
authorityId - ID of Authority to be deleted
DTSException - if any error occurs in the method
public Authority[] getAuthorities()
                           throws DTSException
Authoritys which represent the available
 namespace authorities in the DTS knowledgebase.
DTSException - if any error occurs in the method
public static Namespace getDefaultNamespace()
                                     throws DTSException
Namespace that's been set as the default.
DTSException - if the default namespace has not been setpublic static int getDefaultNamespaceId()
public static void setDefaultNamespace(Namespace namespace)
namespace - the Namespace to be used as the default in API
                              methods where it's not explicitly specified
public void setDefaultNamespace()
                         throws DTSException
setDefaultNamespace(Namespace namespace), or if there
 is only one namespace.
DTSException - if any error occurs in the method
public boolean hasPermission(int namespaceId)
                      throws DTSException
namespaceId - the ID of the namespace to check for permission
true if using a secure socket connection and the
             currently logged on user has permission to write to this
             namespace, or if using any other type of server connection;
             otherwise false
DTSException - if any error occurs in the method
public Namespace[] getExtendingNamespaces(int subsNamespaceId)
                                   throws DTSException
Namespaces which the given
 subscription namespace extends
subsNamespaceId - The Subscription Namespace id
Namespace Ids which are
         extended by above subscription namespace
DTSException - for any other errorprotected void fireAuthorityAction(KBTypeEvent event)
public KBTypeListener getKBTypeListener()
public void addKBTypeListener(KBTypeListener listener)
public void removeKBTypeListener(KBTypeListener listener)
protected void fireNamespaceAction(NamespaceEvent event)
public NamespaceListener getNamespaceListener()
public void addNamespaceListener(NamespaceListener listener)
public void removeNamespaceListener(NamespaceListener listener)
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||