|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.apelon.apelonserver.client.BasicQuery com.apelon.dts.client.attribute.QualifierTypeQuery com.apelon.dts.client.association.AssociationQuery
public abstract class AssociationQuery
AssociationQuery
provides common methods for maintaining
associations and association types. For synonym associations, use the
DTSConceptQuery
class.
The following events are fired in this class:
ConceptEvent
is fired for adding/modifying/deleting ConceptAssociation
TermEvent
is fired for adding/modifying/deleting TermAssociation
KBTypeEvent
is fired for adding/modifying/deleting AssociationType
AssociationQuery aq1 = null; AssociationQuery aq2 = null; // Initialization code for aq1 and aq2 aq2.addConceptListener(aq1.getConceptListener()); aq2.addTermListener(aq1.getTermListener()); aq2.addKBTypeListener(aq1.getKBTypeListener()); // Now any event from aq2 will be available to aq1 listeners
Copyright: Copyright (c) 2003
Company: Apelon, Inc.
Field Summary | |
---|---|
protected ConceptListener |
conceptListener
|
protected TermListener |
termListener
|
Fields inherited from class com.apelon.dts.client.attribute.QualifierTypeQuery |
---|
kbtypeListener |
Fields inherited from class com.apelon.apelonserver.client.BasicQuery |
---|
ADMIN, queryHeader |
Method Summary | |
---|---|
AssociationType |
addAssociationType(AssociationType assocType)
Adds an association type to the knowledgebase by passing an AssociationType object. |
boolean |
addConceptAssociation(ConceptAssociation newConceptAssociation)
Adds a concept association to the knowledgebase. |
void |
addConceptListener(ConceptListener listener)
|
boolean |
addTermAssociation(TermAssociation newTermAssociation)
Adds a term association to the knowledgebase. |
void |
addTermListener(TermListener listener)
|
static AssociationQuery |
createInstance(ServerConnection sc)
Creates an instance of AssociationQuery. |
static AssociationQuery |
createInstance(ServerConnection sc,
boolean isValidating)
Creates an instance of AssociationQuery. |
boolean |
deleteAssociationType(AssociationType assocType)
Deletes the specified association type. |
boolean |
deleteConceptAssociation(ConceptAssociation conceptAssociation)
Deletes a concept association from the knowledgebase. |
boolean |
deleteTermAssociation(TermAssociation termAssociation)
Deletes a term association. |
AssociationType |
findAssociationTypeByCode(String code,
int namespaceID)
Retrieves the AssociationType type with the specified code
and namespace ID. |
AssociationType |
findAssociationTypeById(int assocId,
int namespaceID)
Retrieves the AssociationType with the specified ID and
namespace ID. |
AssociationType |
findAssociationTypeByName(String assocName,
int namespaceID)
Retrieves the AssociationType with the specified name and
namespace ID. |
protected void |
fireConceptAssociationAction(ConceptEvent event)
|
protected void |
fireTermAssociationAction(TermEvent event)
|
AssociationType[] |
getAllAssociationTypes()
Retrieves all association types known in the knowledgebase. |
AssociationType[] |
getAllConceptAssociationTypes()
Retrieves all concept association types. |
AssociationType[] |
getAllSynonymTypes()
Retrieves all synonym types. |
AssociationType[] |
getAllTermAssociationTypes()
Retrieves all term association types. |
AssociationType[] |
getConceptAssociationTypes(int namespaceId)
Retrieves all concept association types in a namespace. |
ConceptListener |
getConceptListener()
Get the ConceptListener. |
AssociationType[] |
getSynonymTypes(int namespaceId)
Retrieves all synonym association types within a given namespace. |
AssociationType[] |
getTermAssociationTypes(int namespaceId)
Retrieves all term association types in a namespace. |
TermListener |
getTermListener()
Get the TermListener. |
boolean |
isAssociationTypeUsed(AssociationType assocType)
Returns whether an association type is used in an association definition or not. |
void |
removeConceptListener(ConceptListener listener)
|
void |
removeTermListener(TermListener listener)
|
AssociationType |
updateAssociationType(AssociationType oldAssocType,
AssociationType newAssocType)
Updates an association type in the knowledgebase corresponding to an old AssociationType to values from a new AssociationType . |
boolean |
updateConceptAssociation(ConceptAssociation oldConceptAssociation,
ConceptAssociation newConceptAssociation)
Updates a concept association by passing the original association and a second one representing the updated values. |
boolean |
updateTermAssociation(TermAssociation oldTermAssociation,
TermAssociation newTermAssociation)
Updates a term association by passing the original association and a second one representing the updated values. |
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 ConceptListener conceptListener
protected transient TermListener termListener
Method Detail |
---|
public AssociationType[] getAllAssociationTypes() throws DTSException
DTSException
- if any error occurs in the methodpublic AssociationType[] getAllConceptAssociationTypes() throws DTSException
DTSException
- if any error occurs in the methodpublic AssociationType[] getConceptAssociationTypes(int namespaceId) throws DTSException
namespaceId
- desired namespace ID of association types
DTSException
- if any error occurs in the methodpublic AssociationType[] getAllTermAssociationTypes() throws DTSException
DTSException
- if any error occurs in the methodpublic AssociationType[] getTermAssociationTypes(int namespaceId) throws DTSException
namespaceId
- desired namespace ID of association types
DTSException
- if any error occurs in the methodpublic AssociationType[] getAllSynonymTypes() throws DTSException
AssociationType
s.
Returns an empty array if there are no synonym
AssociationType
s.
DTSException
- if any error occurs in the methodpublic AssociationType[] getSynonymTypes(int namespaceId) throws DTSException
namespaceId
- the ID of the namespace of interest
AssociationType
s in the
namespace. Returns an empty array if there are no synonym
AssociationType
s.
DTSException
- if any error occurs in the methodpublic AssociationType addAssociationType(AssociationType assocType) throws DTSException
AssociationType
object.
assocType
- an association type which is added
DTSException
- if any error occurs in the methodpublic AssociationType findAssociationTypeByName(String assocName, int namespaceID) throws DTSException
AssociationType
with the specified name and
namespace ID.
assocName
- the name of the AssociationType to fetchnamespaceID
- the AssociationType's namespace ID
AssociationType
, or null if not found
DTSException
- if any error occurs in the methodpublic AssociationType findAssociationTypeById(int assocId, int namespaceID) throws DTSException
AssociationType
with the specified ID and
namespace ID.
assocId
- the ID of the AssociationType to fetchnamespaceID
- the AssociationType's namespace ID
DTSException
- if any error occurs in the methodpublic AssociationType findAssociationTypeByCode(String code, int namespaceID) throws DTSException
AssociationType
type with the specified code
and namespace ID.
code
- the code of the AssociationType to fetchnamespaceID
- the AssociationType's namespace ID
DTSException
- if any error occurs in the methodpublic boolean isAssociationTypeUsed(AssociationType assocType) throws DTSException
assocType
- Association Type
DTSException
- for any error while executing requestpublic AssociationType updateAssociationType(AssociationType oldAssocType, AssociationType newAssocType) throws DTSException
AssociationType
to values from a new AssociationType
.
oldAssocType
- the AssociationType to be updatenewAssocType
- an AssociationType containing the new values
true
if the update is successful; false
otherwise
DTSException
- if any error occurs in the methodpublic boolean deleteAssociationType(AssociationType assocType) throws DTSException
assocType
- association type to be deleted
true
if the association is deleted succesfully;
otherwise false
.
DTSException
- if any error occurs in the methodpublic boolean addConceptAssociation(ConceptAssociation newConceptAssociation) throws DTSException
AssociationType
of the
ConceptAssociation
.
newConceptAssociation
- the new concept association
true
if the concept association is added
succesfully; otherwise false
.
DTSException
- if any error occurs in the methodpublic boolean addTermAssociation(TermAssociation newTermAssociation) throws DTSException
AssociationType
.
newTermAssociation
- the new term association
true
if the term association is added
successfully; otherwise false
.
DTSException
- if any error occurs in the methodpublic boolean updateConceptAssociation(ConceptAssociation oldConceptAssociation, ConceptAssociation newConceptAssociation) throws DTSException
oldConceptAssociation
- the original concept associationnewConceptAssociation
- the updated concept association
true
if the update is successful; false
otherwise
DTSException
- if any error occurs in the methodpublic boolean updateTermAssociation(TermAssociation oldTermAssociation, TermAssociation newTermAssociation) throws DTSException
oldTermAssociation
- the original term associationnewTermAssociation
- the updated term association
true
if the update is successful; false
otherwise
DTSException
- if any error occurs in the methodpublic boolean deleteConceptAssociation(ConceptAssociation conceptAssociation) throws DTSException
conceptAssociation
- the concept association to delete
true
if the association between the two concepts
is deleted succesfully; otherwise false
.
DTSException
- if any error occurs in the methodpublic boolean deleteTermAssociation(TermAssociation termAssociation) throws DTSException
termAssociation
- the term association to delete
true
if the term association is deleted
succesfully; otherwise return false
.
DTSException
- if any error occurs in the methodpublic static AssociationQuery createInstance(ServerConnection sc) throws IllegalArgumentException
sc
- the type of server connection
IllegalArgumentException
- if a null server connection is passedServerConnectionJDBC
,
ServerConnectionSocket
public static AssociationQuery createInstance(ServerConnection sc, boolean isValidating) throws IllegalArgumentException
sc
- the type of server connectionisValidating
- true
if XML needs to
be validated; otherwise it is false
.
IllegalArgumentException
- if a null server connection is passedServerConnectionJDBC
,
ServerConnectionSocket
protected void fireConceptAssociationAction(ConceptEvent event)
protected void fireTermAssociationAction(TermEvent event)
public ConceptListener getConceptListener()
public TermListener getTermListener()
public void addConceptListener(ConceptListener listener)
public void addTermListener(TermListener listener)
public void removeConceptListener(ConceptListener listener)
public void removeTermListener(TermListener listener)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |