org.eclipse.emf.cdo.util

## Class CDOURIData

- java.lang.Object
- - org.eclipse.emf.cdo.util.CDOURIData

-     public final class CDOURIData
      extends Object

  Represents a CDO-specific `URI` in connection-aware format.

  CDO URIs are in one of two different formats, either canonical or connection-aware. The connection-aware format is:

  > cdo.net4j. ConnectorType :// [User [: Password] @] ConnectorSpecificAuthority / RepositoryName / ResourcePath [? Param=Value (& Param=Value)*]

  The non-terminals being:

  - ConnectorType: one of tcp | ssl | jvm | http
  - User/Password: to be provided if the repository is configured with an `IUserManager` and, hence, triggers authentication on the client. Note: the password may be stored in resources in clear text!
  - ConnectorSpecificAuthority: examples are
    - Host [: Port] (if ConnectorType is tcp)
    - AcceptorName (if ConnectorType is jvm)
  - RepositoryName: the `name` of the repository (not the `UUID`!).
  - ResourcePath: the full path of the `resource` within the repository, segments separated by slashes, no leading slash.
  - Param: one of the following
    - branch: the value must be a `branch path`, the full path of the branch in the branch tree, segments separated by slashes, no leading slash, defaults to MAIN.
    - time: the value must be the time at which the resource is supposed to be valid, parseable by SimpleDateFormat. The special value HEAD indicates a floating view/transaction that always shows the latest state in the chosen branch, the default if no Time parameter is specified.
    - transactional: a boolean value. The value true forces a the resource to be opened in a transaction rather than in a read-only view. This can not be combined with a Time other than HEAD.
    - prefetch: a boolean value. The value true attempts to load all objects contained by the resource in a single server-round trip and cache the results.

  Note: With the current design and implementation of connection-aware URI (mainly CDONet4jViewProvider) it is still unclear when and how the allocated "resources" (aka IConnector, CDOSession, CDOView, etc) are supposed to be freed!

  For a description of the canonical URI format refer to `CDOURIUtil`.

  Since:
    4.0
  Author:
    Eike Stepper

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `BRANCH_PARAMETER`
    `static String` | `TIME_PARAMETER`
    `static String` | `TRANSACTIONAL_PARAMETER`
    `static String` | `VIEW_ID_PARAMETER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CDOURIData()`
    `CDOURIData(String uri)`
    `CDOURIData(URI uri)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getAuthority()`
    `IPath` | `getBranchPath()`
    `Map<String,String>` | `getExtraParameters()`
    `String` | `getPassWord()`
    `String` | `getRepositoryName()`
    `IPath` | `getResourcePath()`
    `String` | `getScheme()`
    `long` | `getTimeStamp()`
    `String` | `getUserName()`
    `String` | `getViewID()`
    `boolean` | `isTransactional()`
    `void` | `setAuthority(String authority)`
    `void` | `setBranchPath(IPath branchPath)`
    `void` | `setExtraParameters(Map<String,String> extraParameters)`
    `void` | `setPassWord(String passWord)`
    `void` | `setRepositoryName(String repositoryName)`
    `void` | `setResourcePath(IPath resourcePath)`
    `void` | `setScheme(String scheme)`
    `void` | `setTimeStamp(long timeStamp)`
    `void` | `setTransactional(boolean transactional)`
    `void` | `setUserName(String userName)`
    `void` | `setViewID(String viewID)`
    `String` | `toString()`
    `URI` | `toURI()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### BRANCH_PARAMETER

          public static final String BRANCH_PARAMETER

      See Also:
        Constant Field Values

    - #### TIME_PARAMETER

          public static final String TIME_PARAMETER

      See Also:
        Constant Field Values

    - #### VIEW_ID_PARAMETER

          public static final String VIEW_ID_PARAMETER

      Since:
        4.1
      See Also:
        Constant Field Values

    - #### TRANSACTIONAL_PARAMETER

          public static final String TRANSACTIONAL_PARAMETER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CDOURIData

          public CDOURIData()

    - #### CDOURIData

          public CDOURIData(String uri)
                     throws InvalidURIException

      Throws:
        `InvalidURIException`

    - #### CDOURIData

          public CDOURIData(URI uri)
                     throws InvalidURIException

      Throws:
        `InvalidURIException`

  - ### Method Detail

    - #### getScheme

          public String getScheme()

    - #### setScheme

          public void setScheme(String scheme)

    - #### getUserName

          public String getUserName()

    - #### setUserName

          public void setUserName(String userName)

    - #### getPassWord

          public String getPassWord()

    - #### setPassWord

          public void setPassWord(String passWord)

    - #### getAuthority

          public String getAuthority()

    - #### setAuthority

          public void setAuthority(String authority)

    - #### getRepositoryName

          public String getRepositoryName()

    - #### setRepositoryName

          public void setRepositoryName(String repositoryName)

    - #### getResourcePath

          public IPath getResourcePath()

    - #### setResourcePath

          public void setResourcePath(IPath resourcePath)

    - #### getBranchPath

          public IPath getBranchPath()

    - #### setBranchPath

          public void setBranchPath(IPath branchPath)

    - #### getTimeStamp

          public long getTimeStamp()

    - #### setTimeStamp

          public void setTimeStamp(long timeStamp)

    - #### getViewID

          public String getViewID()

      Since:
        4.1

    - #### setViewID

          public void setViewID(String viewID)

      Since:
        4.1

    - #### isTransactional

          public boolean isTransactional()

    - #### setTransactional

          public void setTransactional(boolean transactional)

    - #### getExtraParameters

          public Map<String,String> getExtraParameters()

      Since:
        4.1

    - #### setExtraParameters

          public void setExtraParameters(Map<String,String> extraParameters)

      Since:
        4.4

    - #### toURI

          public URI toURI()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html