Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.5.3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.product
Class TypeBuilder

    java.lang.Object
      org.hyperic.hq.product.TypeBuilder

    public class TypeBuilder

extends Object

Simple helper class to help keep plugin entity names consistent. This class supports adding one server, and its child services. This class also supports adding multiple versions of the same server. Typically, the plugin developer uses the default `PLATFORM_NAMES` for the list of platforms supported by a given server. The plugin developer can specify her own list of supported platforms.

Since:
  1.0
Version:
  1.0

Field Summary
`static String[]` | `ALL_PLATFORM_NAMES`
`static String` | `NO_VERSION` Version will be excluded from composed server name.
`static String[]` | `UNIX_PLATFORM_NAMES`
`static String[]` | `WIN32_PLATFORM_NAMES`

Constructor Summary
`TypeBuilder()`
`TypeBuilder(String serverName, String serverDesc)` Create a server type for use on all supported platforms
`TypeBuilder(String serverName, String serverDesc, String[] platforms)` use this constructor for specifying a list of supported platforms.

Method Summary
`boolean` | `add(TypeInfo type)`
`PlatformTypeInfo` | `addPlatform(String name)`
`ServerTypeInfo` | `addServer(ServerTypeInfo server, String[] platforms)` Add a ServerTypeInfo clone of the given server, changing valid platforms to the given platforms.
`ServerTypeInfo` | `addServer(String version)` This method creates a ServerTypeInfo and adds this object to the entity list using a version string.
`ServerTypeInfo` | `addServer(String name, String version)` This method creates a ServerTypeInfo and adds this object to the entity list using a version string.
`ServerTypeInfo` | `addServer(String name, String version, String[] platforms)`
`ServerTypeInfo` | `addServerAndServices(ServerTypeInfo server, String[] platforms)` Add a ServerTypeInfo clone of the given server, changing valid platforms to the given platforms.
`ServiceTypeInfo` | `addService(ServerTypeInfo server, String name)` This method creates a deployed (non-internal) ServiceTypeInfo object and adds it services to the entity list
`void` | `addServices(ServerTypeInfo fromServer, ServerTypeInfo toServer)` Clone all services from an existing server.
`void` | `addServices(ServerTypeInfo server, String[] services)` This method adds a list of services to the this.entity list.
`void` | `addServices(ServerTypeInfo server, String[] deployedServices, String[] internalServices)` This method adds a list of internal and deployed services to the this.entity.
`static String` | `composePlatformTypeName(String name, String platformName)`
`static String` | `composeServerTypeName(String name, String version)`
`static String` | `composeServiceTypeName(String serverName, String serviceName)` Given a serverName and a serviceName, return the name of the service type.
`TypeInfo[]` | `getTypes()` This method returns a list of server/service added to this object.

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

Field Detail

### NO_VERSION

    public static final String NO_VERSION

  Version will be excluded from composed server name.

  See Also:
    Constant Field Values

### ALL_PLATFORM_NAMES

    public static final String[] ALL_PLATFORM_NAMES

### WIN32_PLATFORM_NAMES

    public static final String[] WIN32_PLATFORM_NAMES

### UNIX_PLATFORM_NAMES

    public static final String[] UNIX_PLATFORM_NAMES

Constructor Detail

### TypeBuilder

    public TypeBuilder()

### TypeBuilder

    public TypeBuilder(String serverName,
                       String serverDesc)

  Create a server type for use on all supported platforms

  Parameters:
    `serverName` - name of the server
    `serverDesc` - server description

### TypeBuilder

    public TypeBuilder(String serverName,
                       String serverDesc,
                       String[] platforms)

  use this constructor for specifying a list of supported platforms.

  Parameters:
    `serverName` - name of the server
    `serverDesc` - server description

Method Detail

### addPlatform

    public PlatformTypeInfo addPlatform(String name)

### addServer

    public ServerTypeInfo addServer(String version)

  This method creates a ServerTypeInfo and adds this object to the entity list using a version string.

  Parameters:
    `version` - version of the server
  Returns:
    ServerTypeInfo

### addServer

    public ServerTypeInfo addServer(String name,
                                    String version)

  This method creates a ServerTypeInfo and adds this object to the entity list using a version string.

  Parameters:
    `name` - name of the server
    `version` - version of the server
  Returns:
    ServerTypeInfo

### addServer

    public ServerTypeInfo addServer(String name,
                                    String version,
                                    String[] platforms)

### addServer

    public ServerTypeInfo addServer(ServerTypeInfo server,
                                    String[] platforms)

  Add a ServerTypeInfo clone of the given server, changing valid platforms to the given platforms.

  Parameters:
    `server` - Server type to clone.
    `platforms` - Platforms supported by the server clone.
  Returns:
    The cloned server with valid platforms updated.

### addServices

    public void addServices(ServerTypeInfo server,
                            String[] services)

  This method adds a list of services to the this.entity list. All the services added through this method will be marked with the internal flag set to false

  Parameters:
    `server` - the server the services belong to
    `services` - a list of services names to add

### addServices

    public void addServices(ServerTypeInfo server,
                            String[] deployedServices,
                            String[] internalServices)

  This method adds a list of internal and deployed services to the this.entity.

  Parameters:
    `server` -
    `deployedServices` -
    `internalServices` -

### addServices

    public void addServices(ServerTypeInfo fromServer,
                            ServerTypeInfo toServer)

  Clone all services from an existing server.

  Parameters:
    `fromServer` - Server from which to clone services.
    `toServer` - Server to which the clones services are tied.

### addService

    public ServiceTypeInfo addService(ServerTypeInfo server,
                                      String name)

  This method creates a deployed (non-internal) ServiceTypeInfo object and adds it services to the entity list

  Parameters:
    `server` - server which the server belongs to
    `name` - name of the service
  Returns:
    ServiceTypeInfo

### composeServiceTypeName

    public static String composeServiceTypeName(String serverName,
                                                String serviceName)

  Given a serverName and a serviceName, return the name of the service type. This procedure is abstracted out into this method because it needs to be reused in runtime discovery.

### composeServerTypeName

    public static String composeServerTypeName(String name,
                                               String version)

### composePlatformTypeName

    public static String composePlatformTypeName(String name,
                                                 String platformName)

### addServerAndServices

    public ServerTypeInfo addServerAndServices(ServerTypeInfo server,
                                               String[] platforms)

  Add a ServerTypeInfo clone of the given server, changing valid platforms to the given platforms. Clone all services from the given server.

  Parameters:
    `server` - Server to clone
    `platforms` - Supported platforms of the server clone
  See Also:
    `addServer(ServerTypeInfo server,String[] platforms)`, `addServices(ServerTypeInfo fromServer,ServerTypeInfo toServer)`

### getTypes

    public TypeInfo[] getTypes()

  This method returns a list of server/service added to this object.

  Returns:
    a list of TypeInfo objects.

### add

    public boolean add(TypeInfo type)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.5.3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2010 Hyperic, Inc. support@hyperic.net, All Rights Reserved.