Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jini.rio.jsb
Class ServiceElementUtil

    java.lang.Object
      org.jini.rio.jsb.ServiceElementUtil

    public class ServiceElementUtil

extends Object

The ServiceElementUtil class provides static methods to assist in loading and determining if contents within ServiceElement instances have changed

Constructor Summary
`ServiceElementUtil()`

Method Summary
`static ServiceBeanConfig` | `addConfigParameter(ServiceBeanConfig sbc, String key, Integer value)` Add a name,value pair to the ServiceBeanConfig
`static ServiceElement` | `copyServiceElement(ServiceElement sElem)` Make a copy of the ServiceElement
`static AssociationDescriptor[]` | `getAssociationDescriptors(ServiceElement elem, AssociationType type)` Get the AssociationDescriptors from the ServiceElement that match the `AssociationType` type
`static PlatformCapability[]` | `getMatchedPlatformCapabilities(ServiceElement sElem, PlatformCapability[] pCaps)` Get the PlatformCapability instances that match declared operational requirements
`static long` | `getNextID(long[] lArray)` Get the next instance ID
`static boolean` | `hasDifferentGroups(ServiceElement sElem1, ServiceElement sElem2)` Determine if the Discovery groups are different between the two ServiceElement instances
`static boolean` | `hasDifferentLocators(ServiceElement sElem1, ServiceElement sElem2)` Determine if the LookupLocators are different between the two ServiceElement instances
`static boolean` | `hasDifferentLoggerConfig(ServiceElement sElem1, ServiceElement sElem2)` Determine if the LoggerConfig attributes are different between the two ServiceElement instances
`static boolean` | `hasDifferentServiceUIs(Entry[] serviceUIs, ServiceElement sElem2, String codebase)` Determine if there are different ServiceUI declarations in the ServiceElement instance
`static boolean` | `hasHTTPCodebase(ServiceElement sElem)` Determine if the ServiceElement has a HTTP based codebase
`static boolean` | `matchesServiceElement(ServiceElement sElem, String name, String[] interfaces, String opStringName)` Determines if the name, interfaces and opStringName equate to attributes found in the provided ServiceElement
`static ServiceBeanInstance` | `prepareInstanceID(ServiceBeanInstance sbi, long id)` Set the instanceID, optionally making a copy of the ServiceElement
`static ServiceElement` | `prepareInstanceID(ServiceElement sElem, boolean copy, long id)` Set the instanceID, optionally making a copy of the ServiceElement
`static ServiceElement` | `prepareInstanceID(ServiceElement sElem, long id)` Make a copy of the ServiceElement and set the instance ID
`static void` | `setCodebase(ServiceElement sElem, String codebase)` Set the codebase for the ServiceElement

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

Constructor Detail

### ServiceElementUtil

    public ServiceElementUtil()

Method Detail

### setCodebase

    public static void setCodebase(ServiceElement sElem,
                                   String codebase)

  Set the codebase for the ServiceElement

  Parameters:
    `sElem` - The ServiceElement
    `codebase` - The codebase to set
  Throws:
    `NullPointerException` - if either of the parameters are null

### hasHTTPCodebase

    public static boolean hasHTTPCodebase(ServiceElement sElem)

  Determine if the ServiceElement has a HTTP based codebase

  Parameters:
    `sElem` - The ServiceElement
  Returns:
    True if the ServiceElement has either a component or export bundle which has a codebase that is HTTP based
  Throws:
    `NullPointerException` - if either of the parameters are null

### hasDifferentLoggerConfig

    public static boolean hasDifferentLoggerConfig(ServiceElement sElem1,
                                                   ServiceElement sElem2)

  Determine if the LoggerConfig attributes are different between the two ServiceElement instances

  Parameters:
    `sElem1` - ServiceElement to compare
    `sElem2` - ServiceElement to compare
  Returns:
    True if there is a difference between the LoggerConfig attributes, false otherwise

### hasDifferentServiceUIs

    public static boolean hasDifferentServiceUIs(Entry[] serviceUIs,
                                                 ServiceElement sElem2,
                                                 String codebase)

  Determine if there are different ServiceUI declarations in the ServiceElement instance

  Parameters:
    `serviceUIs` - Array of attributes
    `sElem2` - ServiceElement to compare
    `codebase` - The codebase to use
  Returns:
    True if there are differences. false if the same

### hasDifferentGroups

    public static boolean hasDifferentGroups(ServiceElement sElem1,
                                             ServiceElement sElem2)

  Determine if the Discovery groups are different between the two ServiceElement instances

  Parameters:
    `sElem1` - ServiceElement to compare
    `sElem2` - ServiceElement to compare
  Returns:
    True if there is a difference between the Discovery groups, false otherwise

### hasDifferentLocators

    public static boolean hasDifferentLocators(ServiceElement sElem1,
                                               ServiceElement sElem2)

  Determine if the LookupLocators are different between the two ServiceElement instances

  Parameters:
    `sElem1` - ServiceElement to compare
    `sElem2` - ServiceElement to compare
  Returns:
    True if there is a difference between the LookupLocators, false otherwise

### prepareInstanceID

    public static ServiceElement prepareInstanceID(ServiceElement sElem,
                                                   boolean copy,
                                                   long id)

  Set the instanceID, optionally making a copy of the ServiceElement

  Parameters:
    `sElem` - The ServiceElement to use
    `copy` - If true, make a copy of the ServiceElement before assigning the instanceID
    `id` - The instanceID to assign
  Returns:
    A ServiceElement with it's instanceID set to the value provided

### prepareInstanceID

    public static ServiceBeanInstance prepareInstanceID(ServiceBeanInstance sbi,
                                                        long id)

  Set the instanceID, optionally making a copy of the ServiceElement

  Parameters:
    `sbi` - The ServiceBeanInstance to use
    `id` - The instanceID to assign
  Returns:
    A ServiceBeanInstance with it's instanceID set to the value provided

### prepareInstanceID

    public static ServiceElement prepareInstanceID(ServiceElement sElem,
                                                   long id)

  Make a copy of the ServiceElement and set the instance ID

  Parameters:
    `sElem` - ServiceElement to use
    `id` - the id to set
  Returns:
    A new ServiceElement

### getNextID

    public static long getNextID(long[] lArray)

  Get the next instance ID

  Parameters:
    `lArray` - An array of ids
  Returns:
    The next instanceID

### copyServiceElement

    public static ServiceElement copyServiceElement(ServiceElement sElem)

  Make a copy of the ServiceElement

  Parameters:
    `sElem` - The ServiceElement to copy
  Returns:
    A new ServiceElement

### addConfigParameter

    public static ServiceBeanConfig addConfigParameter(ServiceBeanConfig sbc,
                                                       String key,
                                                       Integer value)

  Add a name,value pair to the ServiceBeanConfig

  Parameters:
    `sbc` - The current ServiceBeanConfig to set
    `key` - The key to set
    `value` - The value for the key
  Returns:
    A ServiceBeanConfig with the added properties

### matchesServiceElement

    public static boolean matchesServiceElement(ServiceElement sElem,
                                                String name,
                                                String[] interfaces,
                                                String opStringName)

  Determines if the name, interfaces and opStringName equate to attributes found in the provided ServiceElement

  Parameters:
    `sElem` - The ServiceElement to test, must not be null
    `name` - The name to check, may be null
    `interfaces` - The ames of the interfaces the service advertises, must not be null
    `opStringName` - The name of the operationalString, may be null
  Returns:
    If the attributes can be found in the ServiceElement, return true

### getMatchedPlatformCapabilities

    public static PlatformCapability[] getMatchedPlatformCapabilities(ServiceElement sElem,
                                                                      PlatformCapability[] pCaps)

  Get the PlatformCapability instances that match declared operational requirements

  Parameters:
    `sElem` - The ServiceElement to use
    `pCaps` - Array of PlatformCapability objects objects
  Returns:
    Array of matching `PlatformCapability` objects. If there are no matching PlatformCapability instances, a zero-length array is returned. A new array is allocated each time.

### getAssociationDescriptors

    public static AssociationDescriptor[] getAssociationDescriptors(ServiceElement elem,
                                                                    AssociationType type)

  Get the AssociationDescriptors from the ServiceElement that match the `AssociationType` type

  Parameters:
    `elem` - The ServiceElement
    `type` - The AssociationType type
  Returns:
    An array of AssociationDescriptor instances that match the AssociationType type. If there are no matching AssociationDescriptors, return an empty array. A new array is allocated each time

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Project Rio
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Project Rio.