OBEROn SDK

com.oberon.ooql.sdk
Class WebService

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminBase
          extended by com.oberon.ooql.sdk.WebService
All Implemented Interfaces:
java.io.Serializable

public class WebService
extends AdminBase
implements java.io.Serializable

WebService Admin Object: defines java programs employed as SOAP interfaces

Version:
5.0
See Also:
Serialized Form

Field Summary
static int FILESPACE_OPTION
          The FileSpace flag index inside the Option Set
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
WebService()
           
WebService(java.lang.String name)
           
 
Method Summary
 java.lang.String compareSimple(WebService refWebService, boolean checkImage)
          Return the template of OOQL command to update this WebService object and let it become equals to another reference object.
 java.lang.String compareUpdate(WebService refWebService, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this WebService object and let it become equals to another reference object.
static void compile(AdminQuery adminQuery, Framework framework, boolean force)
          Compile one or more WebServices
 void compile(Framework framework, boolean force)
          Compile the WebService
 void create(boolean force, Framework framework)
          Create a new WebService object on the database
 void create(Framework framework)
          Create a new WebService object on the database
 void destroy(Framework framework)
          Remove the WebService object from the database.
 void fromXML(org.jdom.Element rootElement)
          Load the WebService object from XML element tree
 void generateClient(java.lang.String wsdl, boolean overwrite, Framework framework)
          Generate client classes from wsdl
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this WebService object with the settled properties
 java.lang.String getCreateCommand(boolean force, boolean simple)
          Return the OOQL command to create this WebService object with the settled properties
static javax.servlet.http.HttpSession getCXFHttpSession(javax.xml.ws.WebServiceContext context)
          Get the CXF WebService Http Session
 java.lang.String getNameSpace()
          Get the WebService namespace
 java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
          Get a property for this WebService object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this WebService object with the modified properties.
 java.lang.String getService()
          Get the WebService service name
 java.lang.String getSourceCode()
          Get the WebService java source code
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Return a Vector of administrative object names extracted by using an OOQL selector
 java.lang.String getURL()
          Get the web-service URL (http)
 boolean isFileSpaceService()
          Check if the WebService is used as FileSpace interface.
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the WebService object: connect the memory instance with the database instance
static WebService open(java.lang.String name, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open an administrative object and read properties from the database or retrieve them from memory
 void publish(Framework framework)
          Call the Publish servlet and expose the WebService to public access
static void retract(AdminQuery adminQuery, Framework framework)
          Call the Retract servlet and remove one or more WebServices from public access
 void retract(Framework framework)
          Call the Retract servlet and remove the WebServices from public access
 void setFileSpaceService(boolean filespace)
          Set if the WebService is used as FileSpace interface.
 void setName(java.lang.String name)
          Set the WebService name
 void setNameSpace(java.lang.String namespace)
          Set the WebService namespace
 void setService(java.lang.String service)
          Set the WebService service name
 void setSourceCode(java.lang.String javacode)
          Set the WebService java source code.
 void setSourceFile(java.lang.String fileName)
          Load the WebService java source code from a local disk file
 void setURL(java.lang.String url)
          Set the web-service URL (http)
 java.lang.String toString()
          Return the WebService object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the WebService object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the WebService object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the WebService object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void write(boolean force, Framework framework)
          Update the WebService object to the database
 void write(Framework framework)
          Update the WebService object to the database
 
Methods inherited from class com.oberon.ooql.sdk.AdminBase
addFeature, changedApplication, checkChangeName, checkCounters, checkCounters, getAdminType, getApplication, getCommonProperty, getCommonTargetNames, getCounters, getCreateBasicCommand, getCreateCommand, getCrtDate, getDescription, getEditBasicCommand, getFeature, getFeatures, getFeaturesAsString, getImage, getImage, getImage, getImageData, getImageFile, getModDate, getModUser, getName, getOldName, getPlainFeatures, getSaveCommand, getSVNRevision, getXMLFeatureList, hasImage, isHidden, setApplication, setCounters, setCrtDate, setDescription, setHidden, setImage, setImageData, setImageFile, setModDate, setModUser, setSVNRevision, show, show, toCommonXML, toXML
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FILESPACE_OPTION

public static final int FILESPACE_OPTION
The FileSpace flag index inside the Option Set

See Also:
Constant Field Values
Constructor Detail

WebService

public WebService()

WebService

public WebService(java.lang.String name)
           throws OberonException
Parameters:
name - the name of the administrative object
Throws:
OberonException - if the name contains invalid characters
Method Detail

open

public static WebService open(java.lang.String name,
                              Framework framework,
                              java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                       throws OberonException
Open an administrative object and read properties from the database or retrieve them from memory

Parameters:
name - the object name
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

link

public void link(Framework framework,
                 java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          throws OberonException
Open the WebService object: connect the memory instance with the database instance

Specified by:
link in class AdminBase
Parameters:
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

create

public void create(Framework framework)
            throws OberonException
Create a new WebService object on the database

Specified by:
create in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

create

public void create(boolean force,
                   Framework framework)
            throws OberonException
Create a new WebService object on the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

write

public void write(Framework framework)
           throws OberonException
Update the WebService object to the database

Specified by:
write in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

write

public void write(boolean force,
                  Framework framework)
           throws OberonException
Update the WebService object to the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

unlink

public void unlink(Framework framework)
            throws OberonException
Close the object: disconnect the memory instance from the database instance

Specified by:
unlink in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

destroy

public void destroy(Framework framework)
             throws OberonException
Remove the WebService object from the database.

Specified by:
destroy in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

compile

public void compile(Framework framework,
                    boolean force)
             throws OberonException
Compile the WebService

Parameters:
framework - the current framework
force - if true re-compile the WebService also if already compiled
Throws:
OberonException - due to Java compilation errors

compile

public static void compile(AdminQuery adminQuery,
                           Framework framework,
                           boolean force)
                    throws OberonException
Compile one or more WebServices

Parameters:
adminQuery - administrative query to extract the WebService list to compile
framework - the current framework
force - if true re-compile the WebService(s) also if already compiled
Throws:
OberonException - due to Java compilation errors

publish

public void publish(Framework framework)
             throws OberonException
Call the Publish servlet and expose the WebService to public access

Parameters:
framework - the current framework
Throws:
OberonException - due to compile errors or application server problems or to limited user access rights

retract

public void retract(Framework framework)
             throws OberonException
Call the Retract servlet and remove the WebServices from public access

Parameters:
framework - the current framework
Throws:
OberonException - due to application server problems or to limited user access rights

retract

public static void retract(AdminQuery adminQuery,
                           Framework framework)
                    throws OberonException
Call the Retract servlet and remove one or more WebServices from public access

Parameters:
adminQuery - administrative query to extract the WebService list to retract
framework - the current framework
Throws:
OberonException - due to application server problems or to limited user access rights

generateClient

public void generateClient(java.lang.String wsdl,
                           boolean overwrite,
                           Framework framework)
                    throws OberonException
Generate client classes from wsdl

Parameters:
wsdl - location of wsdl file ( can be any valid url )
overwrite - allows to overwrite previously generated classes
framework - the current framework
Throws:
OberonException - due to application server problems or to limited user access rights
Since:
1.3

getCXFHttpSession

public static javax.servlet.http.HttpSession getCXFHttpSession(javax.xml.ws.WebServiceContext context)
                                                        throws OberonException
Get the CXF WebService Http Session

Parameters:
context - the CXF WebService context
Throws:
OberonException
Since:
4.0

setName

public void setName(java.lang.String name)
             throws OberonException
Set the WebService name

Overrides:
setName in class AdminBase
Parameters:
name - the name of the administrative object
Throws:
OberonException - if the name contains the pipe '|' character

setFileSpaceService

public void setFileSpaceService(boolean filespace)
Set if the WebService is used as FileSpace interface. When a WebService is a FileSpace interface it must implements all FileSpace access methods

Parameters:
filespace - true to define the WebService as FileSpace interface

isFileSpaceService

public boolean isFileSpaceService()
Check if the WebService is used as FileSpace interface.

Returns:
the filespace flag

setSourceCode

public void setSourceCode(java.lang.String javacode)
Set the WebService java source code. The WebService class must implement the WebServiceCode interface. It should have the following structure:

package com.oberon.webservices;
public class <CLASSNAME> {
... statements ...
public .... exposeMethod1( .... ) {
.... statements ....
}
public .... exposeMethod2( .... ) throws .... {
.... statements ....
}
public .... exposeMethod3( .... ) {
.... statements ....
}
... statements ...
}

If the WebService is used as a FileSpace interface then it must implement the WebServiceSpaceCode interface.


setSourceFile

public void setSourceFile(java.lang.String fileName)
                   throws OberonException
Load the WebService java source code from a local disk file

Parameters:
fileName - the path/name of java code file
Throws:
OberonException - due to file IO Exceptions

getSourceCode

public java.lang.String getSourceCode()
Get the WebService java source code


setService

public void setService(java.lang.String service)
                throws OberonException
Set the WebService service name

Parameters:
service - the name registered on the service list
Throws:
OberonException

getService

public java.lang.String getService()
Get the WebService service name


setNameSpace

public void setNameSpace(java.lang.String namespace)
                  throws OberonException
Set the WebService namespace

Throws:
OberonException

getNameSpace

public java.lang.String getNameSpace()
Get the WebService namespace


setURL

public void setURL(java.lang.String url)
Set the web-service URL (http)


getURL

public java.lang.String getURL()
Get the web-service URL (http)


getProperty

public java.lang.String getProperty(java.lang.String propertyName,
                                    java.util.Vector<java.lang.Object> filterArgs,
                                    java.lang.String token,
                                    Framework framework)
Get a property for this WebService object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: source , service ...)
filterArgs - extra arguments used to compute properties
token - separator token for complex properties
framework - the current framework
Returns:
the property value

getTargetNames

public java.util.Vector<?> getTargetNames(java.lang.String composedName,
                                          java.util.Vector<java.lang.Object> filterArgs,
                                          Framework framework)
Return a Vector of administrative object names extracted by using an OOQL selector

Specified by:
getTargetNames in class OBBase
Parameters:
composedName - OOQL property identifier/name
filterArgs - extra arguments used to compute properties
framework - the current framework
Returns:
a Vector of target names, used to extract their (sub)properties values

toString

public java.lang.String toString()
Return the WebService object basic properties as a single String

Overrides:
toString in class AdminBase

toString

public java.lang.String toString(Framework framework)
Return the WebService object extended properties as a single String

Overrides:
toString in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(Framework framework)
Return the WebService object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the WebService object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
getImage - true to include "imagedata" element with the base64 encoded image data
fullDump - true to include detailed information
framework - the current framework

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the WebService object from XML element tree

Overrides:
fromXML in class AdminBase

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
Return the OOQL command to create this WebService object with the settled properties

Specified by:
getCreateCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

getCreateCommand

public java.lang.String getCreateCommand(boolean force,
                                         boolean simple)
Return the OOQL command to create this WebService object with the settled properties

Parameters:
simple - if true return the command template

getSaveCommand

public java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update this WebService object with the modified properties.
If the object is new, it returns the create command.

Specified by:
getSaveCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

compareUpdate

public java.lang.String compareUpdate(WebService refWebService,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this WebService object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refWebService - the reference WebService object
checkImage - if true compare also the image icon
overwrite - if true update the database object instance
force - if true ignores optional properties
framework - the current framework
Throws:
OberonException
See Also:
fromXML(Element)

compareSimple

public java.lang.String compareSimple(WebService refWebService,
                                      boolean checkImage)
                               throws OberonException
Return the template of OOQL command to update this WebService object and let it become equals to another reference object.

Parameters:
refWebService - the reference WebService object
checkImage - if true compare also the image icon
Throws:
OberonException

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.