Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
String getLocations(String clientId);

Retrieves configured Locations

  • clientId: <id not required>
  • returns: Default Locations.xml file from the OC configuration. Note file is not is PI_Locations XSD format.

...

Code Block
String getClientConfigFile(String clientId, String fileExtension);

Retrieves a client configuration file.

  • clientId: File name of client configuration file located in the OC configuration directory 'PiClientConfigFiles'. This file is free format and content is only read by client application. Only requirement is that content is text based.
  • fileExtension: Extension of client file.
  • returns: Text file containing client configuration.
Code Block
Date getSystemTime(String clientId);

Get current OC system time.

  • clientId: <id not required>
  • returns: Date field containing OC system time.
Code Block
String getTimeZoneId(String clientId);

Get OC timeZone id.

  • clientId: <id not required>
  • returns: String representation of time zone.
Code Block
String[] getColdStateIds(String clientId, String id);

Get list of available ColdState ids.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a ModuleState element in the service configuration file.
  • returns: List of ColdStateGroup ids.

...

Code Block
Date[] getAvailableStateTimes(String clientId, String id);

Get available warm state times.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a ModuleState element in the service configuration file.
  • returns: Available warmstate times for requested ModuleState.
Code Block
int[] getEnsembleMemberIndices(String clientId, String ensembleId);

Get available ensemble member ids.

  • clientId: <id not required>
  • ensembleId: Id of requested ensemble.
  • returns: Available member indices of requested ensemble.
Code Block
String getLogMessages(String clientId, String taskId)

Get log messages produces by the last run of given task id.

  • clientId: <id not required but can not be null>
  • taskId: Task ID for which to retrieve log messages. Only messages for the last run are returned.
  • returns: String containing the log messages in the format defined by the PI Diag XSD
Code Block
byte[] getModuleDataSet(String clientId, String id, String ensembleId, int ensembleMemberIndex)

Get a module data set.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a ModuleDataSet element in the service configuration file.
  • ensembleId: <currently not supported>
  • ensembleMemberIndex: <currently not supported>
  • returns: Binary content of the ModuleDataSet file for requested ModuleState.
Code Block
byte[] getModuleParameterSet(String clientId, String id, String ensembleId, int ensembleMemberIndex)

Get a module parameter set.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a ModuleParameterSet element in the service configuration file.
  • ensembleId: <currently not supported>
  • ensembleMemberIndex: <currently not supported>
  • returns: String content of the ModuleParameterSet file for requested ModuleState.
Code Block
byte[] getModuleStateBinary(String clientId, String id, Date stateTime, String ensembleId, int ensembleMemberIndex);

Get a cold state file.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a ModuleState element in the service configuration file.
  • stateTime: Time for which to retrieve warm state file. Time values can be obtained from method #getAvailableStateTimes
  • ensembleId: <currently not supported>
  • ensembleMemberIndex: <currently not supported>
Code Block
String getTimeSeriesHeaders(String clientId, String id, String taskId, Date startTime,
		Date timeZero, Date endTime, String[] parameterIds, String[] locationIds, String ensembleId, int ensembleMemberIndex);

Get the header information for requested timeseries.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a TimeSeries element in the service configuration file.
  • taskId: <id not required however can not be null>
  • startTime: Start date/time of run - Long.MAXVALUE if the configured default is to be used
  • timeZero: Forecast time zero.
  • endTime: End date/time of run - Long.MAXVALUE if the configured default is to be used
  • parameterIds: Subset of parmater IDs for which to retrieve timeseries.
  • locationIds: Subset of location IDs for which to retrieve timeseries.
  • ensembleId: Id of the ensemble, can be null.
  • ensembleMemberIndex Ensemble member index for this time series. (Only if configured)
  • returns: String content of a PiTimeseries XML file only containing header information.
Code Block
String getTimeSeries(String clientId, String id, String taskId, Date startTime,
		Date timeZero, Date endTime, String[] parameterIds, String[] locationIds, String ensembleId, int ensembleMemberIndex);

Get header and data for requested timeseries.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a TimeSeries element in the service configuration file.
  • taskId: <id not required however can not be null>
  • startTime: Start date/time of run - Long.MAXVALUE if the configured default is to be used
  • timeZero: Forecast time zero.
  • endTime: End date/time of run - Long.MAXVALUE if the configured default is to be used
  • parameterIds: Subset of parmater IDs for which to retrieve timeseries.
  • locationIds: Subset of location IDs for which to retrieve timeseries.
  • ensembleId: Id of the ensemble, can be null.
  • ensembleMemberIndex Ensemble member index for this time series. (Only if configured)
  • returns: String content of a PiTimeseries XML file.
Code Block
byte[] getTimeSeriesBytes(String clientId, String id, String taskId, Date startTime,
		Date timeZero, Date endTime,&nbsp;String[] parameterIds, String[] locationIds,
                String ensembleId, int ensembleMemberIndex);

Get binary data for requested timeseries.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • id: Reference to the ID of a TimeSeries element in the service configuration file.
  • taskId: <id not required however can not be null>
  • startTime: Start date/time of run - Long.MAXVALUE if the configured default is to be used
  • timeZero: Forecast time zero.
  • endTime: End date/time of run - Long.MAXVALUE if the configured default is to be used
  • parameterIds: Subset of parmater IDs for which to retrieve timeseries.
  • locationIds: Subset of location IDs for which to retrieve timeseries.
  • ensembleId: Id of the ensemble, can be null.
  • ensembleMemberIndex Ensemble member index for this time series. (Only if configured)
  • returns: Content of the binary file that can be exported together with the PITimeseries XML files.

...

Code Block
void putLogMessage(String clientId, String piDiagnosticsXmlContent);

Insert log messages

  • clientId: <id only used as description>
  • piDiagnosticsXmlContent: String containing the log messages in the format defined by the PI Diag XSD
Code Block
void putModuleDataSet(String clientId, String taskId, String id, byte[] byteModuleDataSetContent,
               Date validityStartTime, Date validityEndTime, String ensembleId, int ensembleMemberIndex);

Insert a module data set.

  • <not implemented>
Code Block
void putModuleParameterSet(String clientId, String id, String taskId, String piParameterSetXmlContent,
               Date validityStartTime, Date validityEndTime, String ensembleId, int ensembleMemberIndex);

Insert a module parameter set.

  • <not implemented>
Code Block
void putState(String clientId, String taskId, String piStateXmlContent, String byteStateFileName,
                byte[] byteStateContent, String ensembleId, int ensembleMemberIndex);

...

Code Block
void putTimeSeries(String clientId, String taskId, String id, String piTimeSeriesXmlContent,
                String ensembleId, int ensembleMemberIndex);

Insert a timeseries.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • taskId: <id not required>
  • id: Reference to the ID of a TimeSeries element in the service configuration file.
  • piTimeSeriesXmlContent: Time Series content in the form of a Pi timeseries xml file.
  • ensembleId: Id of the ensemble
  • ensembleMemberIndex: Ensemble member index for this time series. NULL if this is not an ensemble.
Code Block
void putTimeSeriesBinary(String clientId, String taskId, String id, String piTimeSeriesXmlContent,
                 byte[] byteTimeSeriesContent, String ensembleId, int ensembleMemberIndex);

Insert a timeseries using the binary format.

  • clientId: File name of service configuration file located in the OC configuration directory 'PiServiceConfigFiles'. This file is an instance of the FewsPiServiceConfig XSD.
  • taskId: <id not required>
  • id: Reference to the ID of a TimeSeries element in the service configuration file.
  • piTimeSeriesXmlContent: Time Series content in the form of a Pi timeseries xml file.
  • byteTimeSeriesContent: TimeSeries data content in the form of a byte array.
  • ensembleId: Id of the ensemble
  • ensembleMemberIndex: Ensemble member index for this time series. NULL if this is not an ensemble.

...

Code Block
String createTask(String clientId);

Create a new task.

  • clientId: <not required>
  • returns: Unique task id.

...

Code Block
String runTask(String clientId, String taskId, String workflowId, Date startTime, Date timeZero,
          Date endTime, String coldStateId, String scenarioId, String userId, String description);

Run a newly created task.

  • clientId: <not required>
  • taskId: Id obtained by calling method #createTask
  • workflowId: Id of workflow to run by task.
  • startTime: <not required>
  • timeZero: <not required>
  • endTime: <not required>
  • coldStateId: <not implemented>
  • userId: Id of user running task.
  • description: Description
  • returns: TaskRun id
Code Block
void cancelTask(String clientId, String taskId);

Cancel a running task.

  • <not implemented>
Code Block
boolean waitForTask(String clientId, String taskId, int waitMillis);

Wait for a running task to finish.

  • clientId: <not required>
  • taskId: Id of task run. Returned by callingmethod #runTask.
  • waitMillis: Wait time in milli seconds.
  • returns: TRUE if task run completes successfully, else FALSE

...