Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="parentUri">The parent URI.</param>
        /// <param name="contentType">The content type.</param>
        /// <param name="folderName">The folder name.</param>
        /// <param name="childCount">The child count.</param>
        /// <param name="appendFolderName">if set to <c>true</c> append folder name.</param>
        /// <returns>A new <see cref="IResource"/> instance.</returns>
        public static IResource NewFolder(this IEtpAdapter etpAdapter, EtpUri parentUri, EtpContentType contentType, string folderName, int childCount = -1, bool appendFolderName = false)
        {
            if (etpAdapter is Energistics.Etp.v11.Etp11Adapter)
            {
                return(Discovery11StoreProvider.NewFolder(parentUri, contentType, folderName, childCount, appendFolderName));
            }

            return(Discovery12StoreProvider.NewFolder(parentUri, contentType, folderName, childCount, appendFolderName));
        }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="protocolUri">The protocol URI.</param>
        /// <param name="folderName">The folder name.</param>
        /// <param name="count">Elements count</param>
        /// <returns>The resource instance.</returns>
        public static IResource NewProtocol(this IEtpAdapter etpAdapter, EtpUri protocolUri, string folderName, int count = -1)
        {
            if (etpAdapter is Energistics.Etp.v11.Etp11Adapter)
            {
                return(Discovery11StoreProvider.NewProtocol(protocolUri, folderName, count));
            }

            return(Discovery12StoreProvider.NewProtocol(protocolUri, folderName, count));
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="uuid">The UUID.</param>
        /// <param name="uri">The URI.</param>
        /// <param name="resourceType">The resource type.</param>
        /// <param name="name">The name.</param>
        /// <param name="count">The count.</param>
        /// <param name="lastChanged">The last changed in microseconds.</param>
        /// <returns>The resource instance.</returns>
        public static IResource CreateResource(this IEtpAdapter etpAdapter, string uuid, EtpUri uri, ResourceTypes resourceType, string name, int count = 0, long lastChanged = 0)
        {
            if (etpAdapter is Energistics.Etp.v11.Etp11Adapter)
            {
                return(Discovery11StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
            }

            return(Discovery12StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="parentUri">The parent URI.</param>
        /// <param name="contentType">The content type.</param>
        /// <param name="folderName">The folder name.</param>
        /// <param name="childCount">The child count.</param>
        /// <param name="appendFolderName">if set to <c>true</c> append folder name.</param>
        /// <returns>A new <see cref="IResource"/> instance.</returns>
        public static IResource NewFolder(this IEtpAdapter etpAdapter, EtpUri parentUri, EtpContentType contentType, string folderName, int childCount = -1, bool appendFolderName = false)
        {
            if (etpAdapter.SupportedVersion == EtpVersion.v11)
            {
                return(Discovery11StoreProvider.NewFolder(parentUri, contentType, folderName, childCount, appendFolderName));
            }

            return(Discovery12StoreProvider.NewFolder(parentUri, contentType, folderName, childCount, appendFolderName));
        }
Beispiel #5
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="protocolUri">The protocol URI.</param>
        /// <param name="folderName">The folder name.</param>
        /// <param name="count">Elements count</param>
        /// <returns>The resource instance.</returns>
        public static IResource NewProtocol(this IEtpAdapter etpAdapter, EtpUri protocolUri, string folderName, int count = -1)
        {
            if (etpAdapter.SupportedVersion == EtpVersion.v11)
            {
                return(Discovery11StoreProvider.NewProtocol(protocolUri, folderName, count));
            }

            return(Discovery12StoreProvider.NewProtocol(protocolUri, folderName, count));
        }
Beispiel #6
0
        /// <summary>
        /// Initializes a new instance of <see cref="IResource" /> using the specified parameters.
        /// </summary>
        /// <param name="etpAdapter">The ETP adapter.</param>
        /// <param name="uuid">The UUID.</param>
        /// <param name="uri">The URI.</param>
        /// <param name="resourceType">The resource type.</param>
        /// <param name="name">The name.</param>
        /// <param name="count">The count.</param>
        /// <param name="lastChanged">The last changed in microseconds.</param>
        /// <returns>The resource instance.</returns>
        public static IResource CreateResource(this IEtpAdapter etpAdapter, string uuid, EtpUri uri, ResourceTypes resourceType, string name, int count = 0, long lastChanged = 0)
        {
            if (etpAdapter.SupportedVersion == EtpVersion.v11)
            {
                return(Discovery11StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
            }

            return(Discovery12StoreProvider.New(uuid, uri, resourceType, name, count, lastChanged));
        }