Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


oracle.wcps.property
Class ServiceFactory

java.lang.Object
  extended by oracle.wcps.property.ServiceFactory


public abstract class ServiceFactory
extends java.lang.Object

A factory class to manage namespaces (INamespace) and property services (IPropertyService).


Constructor Summary
ServiceFactory()
           

 

Method Summary
static INamespace createNamespace(IContext context, INamespace namespace)
          Creates the given namespace.
static INamespace createNamespace(IContext context, INamespaceName namespaceName)
          Creates an empty namespace with the given name namespaceName.
static IPagedList<INamespace> filter(IContext context, NamespaceFilterContext fc)
          Searches for the namespaces based on the given namespace filter context fc.
static INamespace getNamespace(IContext context, INamespaceName namespaceName)
          Retrieves the namespace with the given name namespaceName.
static INamespace getNamespace(IContext context, java.lang.String namespaceIdStr)
          Retrieves the namespace with the given name namespaceName.
static IPagedList<INamespace> getNamespaces(IContext context, PaginationContext paginationContext)
          Retrieves a paged list of namespaces found in the system.
static IPropertyService getPropertyService(IContext context, INamespaceName namespaceName)
          Returns the namespace scoped property service to manager propertydefinitions, propertysetdefinitions and propertysets.
static IPropertyService getPropertyService(IContext context, java.lang.String namespaceId)
          Returns the namespace scoped property service to manage the propertydefinitions, propertysetdefinitions and propertysets.
static void removeAllNamespaces(IContext context)
          Removes all the namespaces in the system.
static INamespace removeNamespace(IContext context, INamespace namespace)
          Removes the given namespace.
static INamespace removeNamespace(IContext context, INamespaceName namespaceName)
          Removes the namespace associated with the given namespaceName.
static INamespace updateNamespace(IContext context, INamespace namespace)
          Updates the given namespace in the system.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ServiceFactory

public ServiceFactory()

Method Detail

getNamespace

public static INamespace getNamespace(IContext context,
                                      java.lang.String namespaceIdStr)
Retrieves the namespace with the given name namespaceName.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespaceIdStr - The namespace name.
Returns:
a namespace if found otherwise null.

getNamespace

public static INamespace getNamespace(IContext context,
                                      INamespaceName namespaceName)
Retrieves the namespace with the given name namespaceName.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespaceName - The namespace name.
Returns:
a namespace if found otherwise null.

getNamespaces

public static IPagedList<INamespace> getNamespaces(IContext context,
                                                   PaginationContext paginationContext)
Retrieves a paged list of namespaces found in the system. The paged list size and starting index is determined by the given paginationContext.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
paginationContext - containing page size and starting index.
Returns:
a paged list of namespaces.

filter

public static IPagedList<INamespace> filter(IContext context,
                                            NamespaceFilterContext fc)
Searches for the namespaces based on the given namespace filter context fc.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
fc - a filter context that contains search expression and pagination context.
Returns:
a paged list of namespaces that satisfy the given filter context criteria.

createNamespace

public static INamespace createNamespace(IContext context,
                                         INamespaceName namespaceName)
                                  throws AlreadyExistsException
Creates an empty namespace with the given name namespaceName.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespaceName - a namespace name.
Returns:
the newly created namespace.
Throws:
AlreadyExistsException - if the namespace with the given name namespaceName exists.

createNamespace

public static INamespace createNamespace(IContext context,
                                         INamespace namespace)
                                  throws AlreadyExistsException
Creates the given namespace.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespace - a namespace instance used as a template.
Returns:
the newly create namespace.
Throws:
AlreadyExistsException - if the namespace with the given name exists.

updateNamespace

public static INamespace updateNamespace(IContext context,
                                         INamespace namespace)
                                  throws ObjectOutOfSyncException
Updates the given namespace in the system. If the optimistic concurrency feature is enabled IContext.isOptimisticConcurrencyEnabled(), this method updates namespace optimistically. The given namespace is updated only if its updatedOn time matched with the updatedOn time of the namespace in the system.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespace - a namespace that was returned by this system.
Returns:
the updated namespace.
Throws:
NotFoundException - if there is no namespace in the system.
ObjectOutOfSyncException - if the optimistic concurrency feature is enabled and updatedOn time of the given namespace doesn't match with the namespace in the system.

removeNamespace

public static INamespace removeNamespace(IContext context,
                                         INamespaceName namespaceName)
                                  throws ObjectInUseException
Removes the namespace associated with the given namespaceName.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespaceName - a namespace name.
Returns:
the deleted namespace.
Throws:
ObjectInUseException - if there are propertysets, propertydefinitions and propertysetdefinitions referring this namespace. Remove all the propertysetdefinitions, propertydefinitions and propertysets by calling removeAll* methods in IPropertyService and then call this to avoid getting this exception.

removeNamespace

public static INamespace removeNamespace(IContext context,
                                         INamespace namespace)
                                  throws ObjectInUseException,
                                         ObjectOutOfSyncException
Removes the given namespace. If the optimistic concurrency feature is enabled, this method removes the namespace optimistically, it is removed only if its updatedOn time is matches with the updatedOn time of the namespace in the system.
Parameters:
context - A property service context. If this API is accessed remotely this context must have remote properties.
namespace - a namespace that was returned by this system.
Returns:
the deleted namespace.
Throws:
ObjectInUseException - if there are propertysets, propertydefinitions and propertysetdefinitions referring this namespace. Remove all the propertysetdefinitions, propertydefinitions and propertysets by calling removeAll* methods in IPropertyService and then call this to avoid getting this exception.
ObjectOutOfSyncException - if optimistic concurrency is enabled and updatedOn time of the given namespace doesn't match with the current version in the system.
See Also:
PropertyServiceContext.isOptimisticConcurrencyEnabled()

removeAllNamespaces

public static void removeAllNamespaces(IContext context)
                                throws ObjectInUseException
Removes all the namespaces in the system.
Parameters:
context - A property service context. If this API is accessed remotely this context must have remote properties.
Throws:
ObjectInUseException - if there is at least one namespace, there are propertysets, propertydefinitions and propertysetdefinitions referring it. Remove all the propertysetdefinitions, propertydefinitions and propertysets by calling removeAll* methods in IPropertyService and then call this to avoid getting this exception.

getPropertyService

public static IPropertyService getPropertyService(IContext context,
                                                  java.lang.String namespaceId)
Returns the namespace scoped property service to manage the propertydefinitions, propertysetdefinitions and propertysets.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespaceId - a namespace name.
Returns:
the namespace scoped property service.

getPropertyService

public static IPropertyService getPropertyService(IContext context,
                                                  INamespaceName namespaceName)
Returns the namespace scoped property service to manager propertydefinitions, propertysetdefinitions and propertysets.
Parameters:
context - a property service context. If this API is accessed remotely this context must have remote properties.
namespaceName - a namespace name.
Returns:
the namespace scoped property service.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved.