com.versionone.apiclient.interfaces

## Interface IServices

- All Known Implementing Classes:
    Services

      public interface IServices

  Methods implemented by a class providing VersionOne services.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Asset` | `createNew(IAssetType assetType, Oid context)` Creates a new asset.
    `Oid` | `executeOperation(IOperation op, Oid oid)` Executes an operation.
    `String` | `executePassThroughQuery(String query)` Executes a Query API query using in JSON or YAML format.
    `IAssetType` | `getAssetType(String token)` Returns the type information for an asset specified in a token.
    `InputStream` | `getAttachment(Oid attachmentOid)` Returns the attachment data for the specified attachment Oid.
    `IAttributeDefinition` | `getAttributeDefinition(String token)` Returns the type information for an attribute specified in a token.
    `Reader` | `getEmbeddedImage(Oid embeddedImageOid)` Returns the embedded image data for the specified attachment Oid.
    `Map<String,String>` | `getLocalization(ArrayList<IAttributeDefinition> attributes)` Returns a Map of localized values.
    `String` | `getLocalization(IAttributeDefinition attribute)` Returns a localization value based on an attribute definition.
    `String` | `getLocalization(String key)` Returns a localization value based on key.
    `Oid` | `getLoggedIn()` Determines the OID of the currently logged in user.
    `IMetaModel` | `getMeta()` Returns the MetaModel.
    `Oid` | `getOid(String token)` Returns an object identifier for the specified token.
    `IOperation` | `getOperation(String token)` Returns the type information for an operation specified in a token.
    `V1Connector` | `getV1Connector()` Returns the V1Connector.
    `QueryResult` | `retrieve(Query query)` Executes a query and returns the results.
    `void` | `save(Asset asset)` Persists changes to an asset without a comment.
    `void` | `save(Asset[] assetList)` Saves multiple assets without a comment.
    `void` | `save(Asset asset, String comment)` Persists changes to as asset with a comment.
    `Oid` | `saveAttachment(String filePath, Asset asset, String attachmentName)` Saves an attachment to the specified asset.
    `Oid` | `saveEmbeddedImage(String filePath, Asset asset)` Saves an embedded image to the specified asset.

- - ### Method Detail

    - #### getAssetType

          IAssetType getAssetType(String token)
                           throws MetaException

      Returns the type information for an asset specified in a token.
      Parameters:
        `token` - The token to process
      Returns:
        IAssetType Based on the token
      Throws:
        `MetaException` - if the token is invalid

    - #### getAttributeDefinition

          IAttributeDefinition getAttributeDefinition(String token)
                                               throws MetaException

      Returns the type information for an attribute specified in a token.
      Parameters:
        `token` - The token to process
      Returns:
        IAttributeDefinition Based on the token
      Throws:
        `MetaException` - if the token is invalid

    - #### getOperation

          IOperation getOperation(String token)
                           throws MetaException

      Returns the type information for an operation specified in a token.
      Parameters:
        `token` - The token to process
      Returns:
        IOperation Based on the token
      Throws:
        `MetaException` - if the token is invalid

    - #### getOid

          Oid getOid(String token)
              throws OidException

      Returns an object identifier for the specified token.
      Parameters:
        `token` - The token to process
      Returns:
        Object Identifier
      Throws:
        `OidException` - if the token is invalid

    - #### retrieve

          QueryResult retrieve(Query query)
                        throws ConnectionException,
                               APIException,
                               OidException

      Executes a query and returns the results.
      Parameters:
        `query` - The query to execute.
      Returns:
        QueryResult of the query
      Throws:
        `ConnectionException` - - if connection to VersionOne down
        `OidException` - - if there is problem related to Object Identifiers
        `APIException` - if there is a problem executing the query

    - #### save

          void save(Asset asset)
             throws APIException,
                    ConnectionException

      Persists changes to an asset without a comment.
      Parameters:
        `asset` - The asset that changed
      Throws:
        `ConnectionException` - - if connection to VersionOne down
        `APIException` - - if the save fails

    - #### save

          void save(Asset asset,
                    String comment)
             throws APIException,
                    ConnectionException

      Persists changes to as asset with a comment.
      Parameters:
        `asset` - The asset that changed
        `comment` - - comment
      Throws:
        `ConnectionException` - - if connection to VersionOne down
        `APIException` - - if the save fails

    - #### save

          void save(Asset[] assetList)
             throws V1Exception

      Saves multiple assets without a comment.
      Parameters:
        `assetList` - An array of assets to save
      Throws:
        `V1Exception` - - if the save fails

    - #### getLoggedIn

          Oid getLoggedIn()
                   throws APIException,
                          ConnectionException,
                          OidException

      Determines the OID of the currently logged in user.
      Returns:
        Object Identifier for current user
      Throws:
        `ConnectionException` - - if connection to VersionOne down
        `OidException` - - if there is problem related to Object Identifiers
        `APIException` - - if there is any other error

    - #### createNew

          Asset createNew(IAssetType assetType,
                          Oid context)
                   throws V1Exception

      Creates a new asset.
      Parameters:
        `assetType` - The type of asset to create
        `context` - - context under which to create the asset
      Returns:
        New Asset
      Throws:
        `V1Exception` - - when the create fails

    - #### executeOperation

          Oid executeOperation(IOperation op,
                               Oid oid)
                        throws APIException

      Executes an operation.
      Parameters:
        `op` - The operation to execute
        `oid` - - OID of object on which method is executed
      Returns:
        Oid result of operation
      Throws:
        `APIException` - - when the operation fails

    - #### getMeta

          IMetaModel getMeta()

      Returns the MetaModel.
      Returns:
        IMetaModel

    - #### getV1Connector

          V1Connector getV1Connector()

      Returns the V1Connector.
      Returns:
        V1Connector

    - #### executePassThroughQuery

          String executePassThroughQuery(String query)

      Executes a Query API query using in JSON or YAML format.
      Parameters:
        `query` - The query JSON or YAML query string
      Returns:
        String

    - #### getLocalization

          String getLocalization(IAttributeDefinition attribute)
                          throws V1Exception

      Returns a localization value based on an attribute definition.
      Parameters:
        `attribute` - An attribute definition
      Returns:
        String String
      Throws:
        `V1Exception` - V1Exception

    - #### getLocalization

          String getLocalization(String key)
                          throws V1Exception

      Returns a localization value based on key.
      Parameters:
        `key` - String A string value of the key
      Returns:
        String String
      Throws:
        `V1Exception` - V1Exception

    - #### getLocalization

          Map<String,String> getLocalization(ArrayList<IAttributeDefinition> attributes)
                                      throws ConnectionException

      Returns a Map of localized values.
      Parameters:
        `attributes` - attributes
      Returns:
        Map Map of strings
      Throws:
        `ConnectionException` - ConnectionException

    - #### saveAttachment

          Oid saveAttachment(String filePath,
                             Asset asset,
                             String attachmentName)
                      throws V1Exception,
                             IOException

      Saves an attachment to the specified asset.
      Parameters:
        `filePath` - Path and name of the attachment file.
        `asset` - Asset to save the attachment to.
        `attachmentName` - The name of the attachment.
      Returns:
        Oid
      Throws:
        `V1Exception` - V1Exception
        `IOException` - IOException

    - #### getAttachment

          InputStream getAttachment(Oid attachmentOid)
                             throws V1Exception

      Returns the attachment data for the specified attachment Oid.
      Parameters:
        `attachmentOid` - The Oid of the attachment to return.
      Returns:
        Reader
      Throws:
        `V1Exception` - V1Exception

    - #### saveEmbeddedImage

          Oid saveEmbeddedImage(String filePath,
                                Asset asset)
                         throws V1Exception,
                                IOException

      Saves an embedded image to the specified asset.
      Parameters:
        `filePath` - Path and name of the embedded image file.
        `asset` - Asset to save the embedded image to.
      Returns:
        Oid
      Throws:
        `V1Exception` - V1Exception
        `IOException` - IOException

    - #### getEmbeddedImage

          Reader getEmbeddedImage(Oid embeddedImageOid)
                           throws V1Exception

      Returns the embedded image data for the specified attachment Oid.
      Parameters:
        `embeddedImageOid` - The Oid of the embedded image to return.
      Returns:
        Reader
      Throws:
        `V1Exception` - V1Exception

Copyright © 2016 VersionOne, Inc.. All rights reserved.