com.hp.ucmdb.api.view
Interface ViewService


public interface ViewService

Provides viewing system services.

Since:
8.0

Method Summary
 View createViewStub(java.lang.String viewName)
          Creates a View - a "stub" that holds the view name and allows retrieval of the view definition.
 boolean deleteView(java.lang.String viewName)
          Deletes a view identified by viewName from the UCMDB.
 com.hp.ucmdb.api.view.result.ViewResult executeView(java.lang.String viewName)
          Executes a view identified in the UCMDB by the view name and returns the result.
 com.hp.ucmdb.api.view.result.ViewResult executeView(java.lang.String viewName, ViewExecutionOptions options)
          Executes a view identified in the UCMDB by the view name and returns the result.
 com.hp.ucmdb.api.view.result.ViewResult executeView(View view)
          Executes the given view and returns the result.
 com.hp.ucmdb.api.view.result.ViewResult executeView(View view, ViewExecutionOptions options)
          Executes the given view and returns the result.
 com.hp.ucmdb.api.view.result.ViewResult executeViewDefinition(ViewDefinition viewDefinition, ExecutableQuery query)
          Executes the given view definition and returns the result.
 com.hp.ucmdb.api.view.result.ViewResult executeViewDefinition(ViewDefinition viewDefinition, ExecutableQuery query, ViewExecutionOptions options)
          Executes the given view definition and returns the result.
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getAllViewsBundleNames()
          Returns a map between each bundle name that contains views to a collection of its bundled views.
 java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getBundleNamesToViews()
          Returns a map between each bundle name that contains views to a collection of its bundled views.
 ViewFactory getFactory()
           
 FoldersManagementSubService<ViewFolder,View> getViewsFoldersSubService()
          Returns the sub service regarding folder management.
 ViewFolder getViewTree()
          Queries the whole views tree organized in folder structure.
 java.util.Set<java.lang.String> hasChanges(java.util.Map<java.lang.String,com.hp.ucmdb.api.view.result.ViewResultVersion> views2check)
          Returns a set of view names for which: the results of the query under it were changed since the result version was created, the view definition creating it was changed, or the query definition under it was changed.
 boolean hasChanges(java.lang.String viewName, java.lang.String viewResultVersionAsString)
          Same as hasChanges(String, ViewResultVersion), but accepts the result of {ViewResultVersion#asString()}.
 boolean hasChanges(java.lang.String viewName, com.hp.ucmdb.api.view.result.ViewResultVersion viewResultVersion)
          Returns true if the results of the query under the given view were changed since the result version was created, if the view definition creating this view was changed, or if the query definition under the view definition was changed.
 java.lang.String registerViewDependenciesChangeListener(ViewDependenciesChangeListener listener, ViewManagementListenerFilter filter)
          Registers a listener to be called when a change occurs in view dependencies
 java.lang.String registerViewManagementListener(ViewManagementListener listener, ViewManagementListenerFilter filter)
          Registers a listener to be called when view management change occurs.
 void saveView(ViewDefinition viewDefinition)
          Saves the view definition to the server, updating an existing view by the same name if such exists.
 ViewDefinition stringToViewDefinition(java.lang.String str)
          Given a string created by viewDefinitionToString(com.hp.ucmdb.api.view.ViewDefinition), this methods returns a copy of the original ViewDefinition.
 void unregisterViewDependenciesChangeListener(java.lang.String listenerId)
          Unregisters the specified view dependencies change listener.
 void unregisterViewManagementListener(java.lang.String listenerId)
          Unregisters the specified view management listener.
 void validateBulk(ViewValidationBulk bulk)
           
 java.lang.String viewDefinitionToString(ViewDefinition viewDefinition)
          Given a ViewDefinition this method returns the view's string representation.
 DependsOnView whoDependsOn(java.lang.String viewName)
           
 

Method Detail

getFactory

ViewFactory getFactory()

createViewStub

View createViewStub(java.lang.String viewName)
Creates a View - a "stub" that holds the view name and allows retrieval of the view definition.

It is possible to create View stubs for non-existent views. However, further operations on those stubs fail.

This method does not communicate with the UCMDB server. However, operations from the stub object do communicate with the UCMDB server. They fetch the view definition and related information. See View for details.


getViewTree

ViewFolder getViewTree()
Queries the whole views tree organized in folder structure.

Returns:
the root folder

executeView

com.hp.ucmdb.api.view.result.ViewResult executeView(java.lang.String viewName)
Executes a view identified in the UCMDB by the view name and returns the result. The view must not have non-assigned query parameters.

The view is executed with a default options object. See ViewExecutionOptions for details.

Returns:
the view result.

executeView

com.hp.ucmdb.api.view.result.ViewResult executeView(java.lang.String viewName,
                                                    ViewExecutionOptions options)
Executes a view identified in the UCMDB by the view name and returns the result. The view must not have non-assigned query parameters.

This method uses the options object passed to it.

Returns:
the view result.

executeView

@NotFinalAPI
com.hp.ucmdb.api.view.result.ViewResult executeView(View view)
Executes the given view and returns the result. The view must not have non-assigned query parameters.

The view is executed with a default options object. See ViewExecutionOptions for details.

Returns:
the view result.

executeView

@NotFinalAPI
com.hp.ucmdb.api.view.result.ViewResult executeView(View view,
                                                                ViewExecutionOptions options)
Executes the given view and returns the result. The view must not have non-assigned query parameters.

This method uses the options object passed to it.

Returns:
the view result.

executeViewDefinition

@NotFinalAPI
com.hp.ucmdb.api.view.result.ViewResult executeViewDefinition(ViewDefinition viewDefinition,
                                                                          ExecutableQuery query)
Executes the given view definition and returns the result. The given executable query is used instead of the view query name. If a null query is supplied, the view is executed over the query name specified in the view definition. The view must not have non-assigned query parameters.

The view is executed with a default options object. See ViewExecutionOptions for details.

If a PerspectiveBasedViewReferenceDefinition is passed, the specified ExecutableQuery is ignored.

Returns:
the view result.

executeViewDefinition

@NotFinalAPI
com.hp.ucmdb.api.view.result.ViewResult executeViewDefinition(ViewDefinition viewDefinition,
                                                                          ExecutableQuery query,
                                                                          ViewExecutionOptions options)
Executes the given view definition and returns the result. The given executable query is used instead of the view query name. If a null query is supplied, the view is executed over the query name specified in the view definition. The view must not have non-assigned query parameters.

This method uses the options object passed to it.

If a PerspectiveBasedViewReferenceDefinition is passed, the specified ExecutableQuery is ignored.

Returns:
the view result.

saveView

@NotFinalAPI
void saveView(ViewDefinition viewDefinition)
Saves the view definition to the server, updating an existing view by the same name if such exists.

If a view by the same name exists, it is overwritten. If that view is attached to a folder, its position remains the same. Otherwise, the view is created in the root folder.

If the view is a perspective based view, additional queries may be created (auto-generated) to represent the perspective hierarhcy.

Parameters:
viewDefinition - the definition to save.

deleteView

@NotFinalAPI
boolean deleteView(java.lang.String viewName)
Deletes a view identified by viewName from the UCMDB.

If the view is a perspective based view, the entire (auto-generated) perspective instances hierarhcy is deleted.

Returns:
true if a view was deleted, false if it was not found.

getViewsFoldersSubService

@NotFinalAPI
FoldersManagementSubService<ViewFolder,View> getViewsFoldersSubService()
Returns the sub service regarding folder management.

Returns:
the sub service regarding folder management.

getBundleNamesToViews

@NotFinalAPI
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getBundleNamesToViews()
Returns a map between each bundle name that contains views to a collection of its bundled views.


getAllViewsBundleNames

@NotFinalAPI
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getAllViewsBundleNames()
Returns a map between each bundle name that contains views to a collection of its bundled views.


registerViewManagementListener

@NotFinalAPI
java.lang.String registerViewManagementListener(ViewManagementListener listener,
                                                            ViewManagementListenerFilter filter)
Registers a listener to be called when view management change occurs.

Parameters:
listener - a listener to be called when a view management change occurs
filter - filters view management changes
Returns:
registration ID

unregisterViewManagementListener

@NotFinalAPI
void unregisterViewManagementListener(java.lang.String listenerId)
Unregisters the specified view management listener.

Parameters:
listenerId - registration ID of the listener

registerViewDependenciesChangeListener

@NotFinalAPI
java.lang.String registerViewDependenciesChangeListener(ViewDependenciesChangeListener listener,
                                                                    ViewManagementListenerFilter filter)
Registers a listener to be called when a change occurs in view dependencies

Parameters:
listener - a listener to be called when a view management change occurs
filter - filters the changes by name and/or bundles of a root view (dependent)
Returns:
registration ID

unregisterViewDependenciesChangeListener

@NotFinalAPI
void unregisterViewDependenciesChangeListener(java.lang.String listenerId)
Unregisters the specified view dependencies change listener.

Parameters:
listenerId - registration ID of the listener

hasChanges

@NotFinalAPI
boolean hasChanges(java.lang.String viewName,
                               com.hp.ucmdb.api.view.result.ViewResultVersion viewResultVersion)
Returns true if the results of the query under the given view were changed since the result version was created, if the view definition creating this view was changed, or if the query definition under the view definition was changed.

This API is similar to TopologyQueryService.hasChanges(java.lang.String, com.hp.ucmdb.api.topology.QueryResultVersion) However, this method:

The restrictions and notes for TopologyQueryService.hasChanges apply to this method.

Parameters:
viewName - the view whose query is to be checked.
viewResultVersion - the version to check changes from.
Returns:
true if there were any changes in the query results. false if no changes or if the query does not support changes.

hasChanges

@NotFinalAPI
java.util.Set<java.lang.String> hasChanges(java.util.Map<java.lang.String,com.hp.ucmdb.api.view.result.ViewResultVersion> views2check)
Returns a set of view names for which: the results of the query under it were changed since the result version was created, the view definition creating it was changed, or the query definition under it was changed.

The restrictions and notes for TopologyQueryService.hasChanges apply to this method.

Parameters:
views2check - view names whose query is to be checked.
Returns:
the set of changed views.

hasChanges

@NotFinalAPI
boolean hasChanges(java.lang.String viewName,
                               java.lang.String viewResultVersionAsString)
Same as hasChanges(String, ViewResultVersion), but accepts the result of {ViewResultVersion#asString()}.

Parameters:
viewName - the view whose query is to be checked.
viewResultVersionAsString - the asString() result of the version to check changes from.
Returns:
true if there were any changes in the query results, false if no or if the query does not support changes.
See Also:
hasChanges(String, ViewResultVersion)

whoDependsOn

@NotFinalAPI
DependsOnView whoDependsOn(java.lang.String viewName)

validateBulk

@NotFinalAPI
void validateBulk(ViewValidationBulk bulk)

viewDefinitionToString

java.lang.String viewDefinitionToString(ViewDefinition viewDefinition)
                                        throws UcmdbException
Given a ViewDefinition this method returns the view's string representation. The conversion from ViewDefinition to string is done in the server, requiring a server request.

This string representation is not guaranteed to be version compatible and should not be serialized for long term storage.

Parameters:
viewDefinition - - the view definition to convert
Returns:
String representation of the given view definition
Throws:
UcmdbException

stringToViewDefinition

ViewDefinition stringToViewDefinition(java.lang.String str)
                                      throws UcmdbException
Given a string created by viewDefinitionToString(com.hp.ucmdb.api.view.ViewDefinition), this methods returns a copy of the original ViewDefinition. The actual conversion from string to ViewDefinition is done in the server, requiring a server request.

Parameters:
str - - view's string representation
Returns:
query definition represented by the given str
Throws:
UcmdbException


Documentation Feedback
Copyright 2010 Hewlett-Packard Development Company, L.P.