|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sdas.core.client.SDASClient
public class SDASClient
This class allows to connect and interact with a SDAS XML-RPC Server. All methods for getting data, searching parameters and events are fully implemented here.
Nested Class Summary | |
---|---|
class |
SDASClient.HttpAuthenticateProxy
|
Field Summary |
---|
Fields inherited from interface org.sdas.core.common.ISDASProtocol |
---|
SERVER_HANDLER_ID |
Constructor Summary | |
---|---|
SDASClient(java.lang.String hostname,
int port)
Creates a new instance of SDASClient. |
|
SDASClient(java.lang.String hostname,
int port,
int timeout,
boolean synchronizePlugins,
java.lang.String proxyURL,
int proxyPort,
java.lang.String proxyUser,
java.lang.String proxyPass,
java.lang.String credentialsFile)
Creates a new instance of SDASClient. |
|
SDASClient(java.lang.String hostname,
int port,
int timeout,
java.lang.String credentialsFile)
Creates a new instance of SDASClient. |
|
SDASClient(java.lang.String hostname,
int port,
java.lang.String credentialsFile)
Creates a new instance of SDASClient. |
|
SDASClient(java.lang.String hostname,
int port,
java.lang.String proxyURL,
int proxyPort)
Creates a new instance of SDASClient. |
|
SDASClient(java.lang.String hostname,
int port,
java.lang.String proxyURL,
int proxyPort,
java.lang.String proxyUser,
java.lang.String proxyPass)
Creates a new instance of SDASClient. |
Method Summary | |
---|---|
java.lang.String |
authenticate(java.lang.String[][] credentials)
|
void |
deletePlugins()
Delete all the plug-ins from the plug-in dir |
void |
fetchPlugins()
Fetch the plug-ins from the server and saves them on the plug-in directory |
IData[] |
getData(java.lang.String parameterUniqueID,
IHEvent event)
Fetches a data structure from the SDAS server. |
IData[] |
getData(java.lang.String parameterUniqueID,
java.lang.String eventUniqueID,
int eventNumber)
Fetches a data structure from the SDAS server. |
IData[][] |
getMultipleData(java.lang.String[] parameterUniqueID,
IHEvent event)
Fetches several data structures from the SDAS server. |
IData[][] |
getMultipleData(java.lang.String[] parameterUniqueID,
IHEvent[] event)
Fetches several data structures from the SDAS server. |
IData[][] |
getMultipleData(java.lang.String[] parameterUniqueID,
java.lang.String[] eventUniqueID,
int[] eventNumber)
Fetches several data structures from the SDAS server. |
IData[][] |
getMultipleData(java.lang.String[] parameterUniqueID,
java.lang.String eventUniqueID,
int eventNumber)
Fetches several data structures from the SDAS server. |
IData[][] |
getMultipleData(java.lang.String parameterUniqueID,
java.lang.String[] eventUniqueID,
int[] eventNumber)
Fetches several data structures, all for the same parameter, from the SDAS server. |
IData[][] |
getMultipleData(java.lang.String parameterUniqueID,
java.lang.String eventUniqueID,
int[] eventNumber)
Fetches several data structures, all for the same parameter, from the SDAS server. |
byte[][] |
getPluginFiles()
Returns all the plug-in files as byte arrays. |
IUserData |
getUserData(IData data)
Return data as a user data structure |
void |
logout()
|
boolean |
parameterExists(java.lang.String parameterUniqueID,
java.lang.String eventUniqueID,
int eventNumber)
Checks if a parameter exists for a particular event. |
boolean |
putData(IData data)
Stores this data on the server. |
void |
reloadPlugins()
Reloads all the plugins |
java.lang.String[] |
searchDataByEvent(IHEvent event)
Searches data by an event. |
java.lang.String[] |
searchDataByEvent(java.lang.String eventUniqueID,
int eventNumber)
Searches data by an event. |
IDescriptorUID[] |
searchDeclaredEventsByDescription(java.lang.String search)
Searches declared events by the description. |
IDescriptorUID[] |
searchDeclaredEventsByDescription(java.lang.String search,
java.lang.String locale)
Searches declared events by the description and locale. |
IDescriptorUID[] |
searchDeclaredEventsByName(java.lang.String search)
Searches declared events by the name. |
IDescriptorUID[] |
searchDeclaredEventsByName(java.lang.String search,
java.lang.String locale)
Searches declared events by the name and locale. |
IDescriptorUID[] |
searchDeclaredEventsByUniqueID(java.lang.String uniqueID)
Searches declared events by the unique identifier. |
IHEvent[] |
searchEventsByEventNumber(int number)
Searches events by the event number. |
IHEvent[] |
searchEventsByEventTimeWindow(ITimeStamp tstart,
ITimeStamp tend)
Searches events whose time stamp is inside a time window. |
int |
searchMaxEventNumber(java.lang.String uniqueID)
Searches the maximum event number for an event defined by this uniqueID. |
int |
searchMinEventNumber(java.lang.String uniqueID)
Searches the minimum event number for an event defined by this uniqueID. |
IParameter[] |
searchParametersByDescription(java.lang.String search)
Searches parameters by the description. |
IParameter[] |
searchParametersByDescription(java.lang.String search,
java.lang.String locale)
Searches parameters by the description and locale. |
IParameter[] |
searchParametersByName(java.lang.String search)
Searches parameters by the name. |
IParameter[] |
searchParametersByName(java.lang.String search,
java.lang.String locale)
Searches parameters by the name and locale. |
IParameter[] |
searchParametersByUniqueID(java.lang.String uniqueID)
Search parameters by the unique identifier. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SDASClient(java.lang.String hostname, int port) throws java.net.MalformedURLException, java.io.IOException, BadCredentials
hostname
- the location of the SDAS server.port
- the port of the SDAS server.
java.net.MalformedURLException
- if an invalid hostname is entered.
java.io.IOException
- if connection to the SDAS server cannot be established.
BadCredentials
- if the credentials aren't accepted on the server.public SDASClient(java.lang.String hostname, int port, java.lang.String credentialsFile) throws java.net.MalformedURLException, java.io.IOException, BadCredentials
hostname
- the location of the SDAS server.port
- the port of the SDAS server.credentialsFile
- the location of the file with the credentials information. This file is a list of key/values separated by comma
java.net.MalformedURLException
- if an invalid hostname is entered.
java.io.IOException
- if connection to the SDAS server cannot be established.
BadCredentials
- if the credentials aren't accepted on the server.public SDASClient(java.lang.String hostname, int port, int timeout, java.lang.String credentialsFile) throws java.net.MalformedURLException, java.io.IOException, BadCredentials
hostname
- the location of the SDAS server.port
- the port of the SDAS server.timeout
- the maximum time to successfully create a connection.credentialsFile
- the location of the file with the credentials information. This file is a list of key/values separated by comma
java.net.MalformedURLException
- if an invalid hostname is entered.
java.io.IOException
- if connection to the SDAS server cannot be established.
BadCredentials
- if the credentials aren't accepted on the server.public SDASClient(java.lang.String hostname, int port, java.lang.String proxyURL, int proxyPort) throws java.net.MalformedURLException, java.io.IOException, BadCredentials
hostname
- the location of the SDAS server.port
- the port of the SDAS server.proxyURL
- the proxy urlproxyPort
- the proxy port
java.net.MalformedURLException
- if an invalid hostname is entered.
java.io.IOException
- if connection to the SDAS server cannot be established.
BadCredentials
- if the credentials aren't accepted on the server.public SDASClient(java.lang.String hostname, int port, java.lang.String proxyURL, int proxyPort, java.lang.String proxyUser, java.lang.String proxyPass) throws java.net.MalformedURLException, java.io.IOException, BadCredentials
hostname
- the location of the SDAS server.port
- the port of the SDAS server.proxyURL
- the proxy urlproxyPort
- the proxy portproxyUser
- the proxy userproxyPass
- the proxy password
java.net.MalformedURLException
- if an invalid hostname is entered.
java.io.IOException
- if connection to the SDAS server cannot be established.
BadCredentials
- if the credentials aren't accepted on the server.public SDASClient(java.lang.String hostname, int port, int timeout, boolean synchronizePlugins, java.lang.String proxyURL, int proxyPort, java.lang.String proxyUser, java.lang.String proxyPass, java.lang.String credentialsFile) throws java.net.MalformedURLException, java.io.IOException, BadCredentials
hostname
- the location of the SDAS server.port
- the port of the SDAS server.timeout
- the maximum time to successfully create a connection.synchronizePlugins
- if to fetch the plugins from the serverproxyURL
- the proxy urlproxyPort
- the proxy portproxyUser
- the proxy userproxyPass
- the proxy passwordcredentialsFile
- the location of the file with the credentials information. This file is a list of key/values separated by comma
java.net.MalformedURLException
- if an invalid hostname is entered.
java.io.IOException
- if connection to the SDAS server cannot be established.
BadCredentials
- if the credentials aren't accepted on the server.Method Detail |
---|
public IDescriptorUID[] searchDeclaredEventsByDescription(java.lang.String search)
searchDeclaredEventsByDescription
in interface ISDASProtocol
search
- the word(s) to search.
public IDescriptorUID[] searchDeclaredEventsByDescription(java.lang.String search, java.lang.String locale)
searchDeclaredEventsByDescription
in interface ISDASProtocol
search
- the word(s) to search.locale
- the locale in the format languageCode_countryCode, for example: pt_PT
public IDescriptorUID[] searchDeclaredEventsByUniqueID(java.lang.String uniqueID)
searchDeclaredEventsByUniqueID
in interface ISDASProtocol
uniqueID
- the unique identifier to search.
public IDescriptorUID[] searchDeclaredEventsByName(java.lang.String search)
searchDeclaredEventsByName
in interface ISDASProtocol
search
- the word(s) to search.
public IDescriptorUID[] searchDeclaredEventsByName(java.lang.String search, java.lang.String locale)
searchDeclaredEventsByName
in interface ISDASProtocol
search
- the word(s) to search.locale
- the locale in the format languageCode_countryCode, for example: pt_PT
public IHEvent[] searchEventsByEventNumber(int number)
searchEventsByEventNumber
in interface ISDASProtocol
number
- the number to search.
public int searchMaxEventNumber(java.lang.String uniqueID)
searchMaxEventNumber
in interface ISDASProtocol
uniqueID
- the unique identifier of the event.
public int searchMinEventNumber(java.lang.String uniqueID)
searchMinEventNumber
in interface ISDASProtocol
uniqueID
- the unique identifier of the event.
public IHEvent[] searchEventsByEventTimeWindow(ITimeStamp tstart, ITimeStamp tend)
searchEventsByEventTimeWindow
in interface ISDASProtocol
tstart
- from this time.tend
- to this time.
public IParameter[] searchParametersByUniqueID(java.lang.String uniqueID)
searchParametersByUniqueID
in interface ISDASProtocol
uniqueID
- the unique identifier to search.
public IParameter[] searchParametersByDescription(java.lang.String search)
searchParametersByDescription
in interface ISDASProtocol
search
- the word(s) to search.
public IParameter[] searchParametersByDescription(java.lang.String search, java.lang.String locale)
searchParametersByDescription
in interface ISDASProtocol
search
- the word(s) to search.locale
- the locale in the format languageCode_countryCode, for example: pt_PT
public IParameter[] searchParametersByName(java.lang.String search)
searchParametersByName
in interface ISDASProtocol
search
- the word(s) to search.
public IParameter[] searchParametersByName(java.lang.String search, java.lang.String locale)
searchParametersByName
in interface ISDASProtocol
search
- the word(s) to search.locale
- the locale in the format languageCode_countryCode, for example: pt_PT
public java.lang.String[] searchDataByEvent(IHEvent event)
searchDataByEvent
in interface ISDASProtocol
event
- the event to search.
public java.lang.String[] searchDataByEvent(java.lang.String eventUniqueID, int eventNumber)
searchDataByEvent
in interface ISDASProtocol
eventUniqueID
- the event unique identifier.eventNumber
- the event number.
public IData[] getData(java.lang.String parameterUniqueID, java.lang.String eventUniqueID, int eventNumber)
getData
in interface ISDASProtocol
parameterUniqueID
- the parameter unique identifier.eventUniqueID
- the event unique identifier.eventNumber
- the event number.
public IData[] getData(java.lang.String parameterUniqueID, IHEvent event)
getData
in interface ISDASProtocol
parameterUniqueID
- the parameter unique identifier.event
- the event for the desired data.
public IUserData getUserData(IData data)
data
- the raw data as it is returned by SDAS
public IData[][] getMultipleData(java.lang.String[] parameterUniqueID, IHEvent event)
getMultipleData
in interface ISDASProtocol
parameterUniqueID
- an array with all the parameters unique identifiers.event
- the event for the desired data.
public IData[][] getMultipleData(java.lang.String[] parameterUniqueID, IHEvent[] event)
getMultipleData
in interface ISDASProtocol
parameterUniqueID
- an array with all the parameters unique identifiers.event
- an array with an event for each selected parameter.
If you wish to use the same event for all the parameters see getMultipleData(java.lang.String[], IHEvent)
.
The size of this array should be the same of parameterUniqueID.
public IData[][] getMultipleData(java.lang.String[] parameterUniqueID, java.lang.String eventUniqueID, int eventNumber)
getMultipleData
in interface ISDASProtocol
parameterUniqueID
- an array with all the parameters unique identifier.eventUniqueID
- the event unique identifier.eventNumber
- the event number.
public IData[][] getMultipleData(java.lang.String[] parameterUniqueID, java.lang.String[] eventUniqueID, int[] eventNumber)
getMultipleData
in interface ISDASProtocol
parameterUniqueID
- an array with all the parameters unique identifiers.eventUniqueID
- an array with all the events unique identifiers. If you wish to
use the same event for all the parameters see getMultipleData(java.lang.String[], java.lang.String, int)
.
The size of this array should be the same of parameterUniqueID.eventNumber
- an array with all the events numbers. The size of this array should be the same of eventUniqueID.
public IData[][] getMultipleData(java.lang.String parameterUniqueID, java.lang.String eventUniqueID, int[] eventNumber)
getMultipleData
in interface ISDASProtocol
parameterUniqueID
- the parameter unique identifier.eventUniqueID
- the event unique identifier.eventNumber
- all the events number.
public IData[][] getMultipleData(java.lang.String parameterUniqueID, java.lang.String[] eventUniqueID, int[] eventNumber)
getMultipleData
in interface ISDASProtocol
parameterUniqueID
- the parameter unique identifier.eventUniqueID
- an array with all the events unique identifiers.
If you wish to use the same event for all the event numbers see getMultipleData(java.lang.String, java.lang.String, int[])
.eventNumber
- an array with all the events numbers.
The size of this array should be the same of eventUniqueID.
public boolean parameterExists(java.lang.String parameterUniqueID, java.lang.String eventUniqueID, int eventNumber)
ISDASProtocol
parameterExists
in interface ISDASProtocol
parameterUniqueID
- the parameter unique identifier.eventUniqueID
- the event unique identifier.eventNumber
- the events number.
public byte[][] getPluginFiles()
getPluginFiles
in interface ISDASProtocol
public boolean putData(IData data)
putData
in interface ISDASProtocol
data
- The data to be stored;
public void logout()
public java.lang.String authenticate(java.lang.String[][] credentials)
public void reloadPlugins()
public void fetchPlugins()
public void deletePlugins()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |