コード例 #1
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerates the resources in the specified repository.
/// Resources of all types can be enumerated all at once, or only
/// resources of a given type.
///
MgByteReader* MgProxyResourceService::EnumerateResources(
    MgResourceIdentifier* resource, INT32 depth, CREFSTRING type,
    INT32 properties, CREFSTRING fromDate, CREFSTRING toDate, bool computeChildren)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knObject,
                       MgResourceService::opIdEnumerateResources,
                       7,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knInt32, depth,
                       MgCommand::knString, &type,
                       MgCommand::knInt32, properties,
                       MgCommand::knString, &fromDate,
                       MgCommand::knString, &toDate,
                       MgCommand::knInt8, (int)computeChildren,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
コード例 #2
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate the resource documents in the specified repository.
///
STRING MgProxyResourceService::EnumerateResourceDocuments(
    MgStringCollection* resources, CREFSTRING type, INT32 properties)
{
    STRING resourceList;
    MgCommand cmd;

    MG_TRY()

    cmd.ExecuteCommand(
        m_connProp,                                         // Connection
        MgCommand::knString,                                // Return type
        MgResourceService::opIdEnumerateResourceDocuments,  // Command code
        3,                                                  // Number of arguments
        Resource_Service,                                   // Service ID
        BUILD_VERSION(1,0,0),                               // Operation version
        MgCommand::knObject, resources,                     // Argument #1
        MgCommand::knString, &type,                         // Argument #2
        MgCommand::knInt32, properties,                     // Argument #3
        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    resourceList = *(cmd.GetReturnValue().val.m_str);
    delete cmd.GetReturnValue().val.m_str;

    MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateResourceDocuments")

    return resourceList;
}
コード例 #3
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////
/// \brief
/// Enumerate all the parent Map Definition resources of the specified
/// resources.
///
MgSerializableCollection* MgProxyResourceService::EnumerateParentMapDefinitions(
    MgSerializableCollection* resources)
{
    MgCommand cmd;

    MG_TRY()

    assert(m_connProp != NULL);

    cmd.ExecuteCommand(
        m_connProp,                                         // Connection
        MgCommand::knObject,                                // Return type
        MgResourceService::opIdEnumerateParentMapDefinitions, // Command code
        1,                                                  // Number of arguments
        Resource_Service,                                   // Service ID
        BUILD_VERSION(1,0,0),                               // Operation version
        MgCommand::knObject, resources,                     // Argument #1
        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    MG_CATCH_AND_THROW(L"MgProxyResourceService.EnumerateParentMapDefinitions")

    return (MgSerializableCollection*)cmd.GetReturnValue().val.m_obj;
}
コード例 #4
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////
/// \brief
/// Gets the contents of the specified resources.
///
MgStringCollection* MgProxyResourceService::GetResourceContents(MgStringCollection* resources,
        MgStringCollection* preProcessTags)
{
    Ptr<MgStringCollection> resourceContents;

    MG_TRY()

    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,                      // Connection
                       MgCommand::knObject,                            // Return type expected
                       MgResourceService::opIdGetResourceContents,     // Command Code
                       2,                                              // Count of arguments
                       Resource_Service,                               // Service Id
                       BUILD_VERSION(2,2,0),                           // Operation version
                       MgCommand::knObject, resources,                 // Argument#1
                       MgCommand::knObject, preProcessTags,            // Argument#2
                       MgCommand::knNone);                             // End of argument

    SetWarning(cmd.GetWarningObject());

    resourceContents = (MgStringCollection*)cmd.GetReturnValue().val.m_obj;

    // Decrypt the document if Substitution pre-processing is required.
    if(preProcessTags != NULL && resourceContents != NULL && preProcessTags->GetCount() == resourceContents->GetCount())
    {
        for(INT32 i = 0; i < resourceContents->GetCount(); i ++)
        {
            STRING tag = preProcessTags->GetItem(i);

            if (MgResourcePreProcessingType::Substitution == tag)
            {
                STRING cipherContent = resourceContents->GetItem(i);

                string cipherText, plainText;
                MgUtil::WideCharToMultiByte(cipherContent, cipherText);

                MG_CRYPTOGRAPHY_TRY()

                MgCryptographyUtil cryptoUtil;

                cryptoUtil.DecryptString(cipherText, plainText);

                MG_CRYPTOGRAPHY_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceContents")

                STRING decryptedContent;
                MgUtil::MultiByteToWideChar(plainText, decryptedContent);
                resourceContents->SetItem(i, decryptedContent);
            }
        }
    }

    MG_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceContents")

    return resourceContents.Detach();
}
コード例 #5
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Returns tagged data for the specified resource.
/// </summary>
/// <param name="resource">
/// Resource identifier describing the resource.
/// </param>
/// <param name="dataName">
/// Name for data.  Either a resource-unique stream name for streams or a
/// resource-unique file name for file data.
/// </param>
/// <param name="preProcessTags">
/// Pre-processing to apply to resource data before returning.  An empty
/// string indicate no pre-processing. See MgResourcePreProcessingType for
/// a list of supported pre-processing tags.
/// </param>
/// <returns>
/// MgByteReader containing the previously updated or added tagged data.
/// </returns>
/// EXCEPTIONS:
/// MgRepositoryNotOpenException
///
/// MgResourceDataNotFoundException
/// MgInvalidResourceTypeException
///
MgByteReader* MgProxyResourceService::GetResourceData(
    MgResourceIdentifier* resource, CREFSTRING dataName,
    CREFSTRING preProcessTags)
{
    Ptr<MgByteReader> byteReader;

    MG_TRY()

    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knObject,
                       MgResourceService::opIdGetResourceData,
                       3,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knString, &dataName,
                       MgCommand::knString, &preProcessTags,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    byteReader = (MgByteReader*)cmd.GetReturnValue().val.m_obj;

    // Decrypt the document if Substitution pre-processing is required.

    if (MgResourcePreProcessingType::Substitution == preProcessTags
            && byteReader != NULL)
    {
        STRING mimeType = byteReader->GetByteSource()->GetMimeType();
        string cipherText, plainText;

        byteReader->ToStringUtf8(cipherText);

        MG_CRYPTOGRAPHY_TRY()

        MgCryptographyUtil cryptoUtil;

        cryptoUtil.DecryptString(cipherText, plainText);

        MG_CRYPTOGRAPHY_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceData")

        Ptr<MgByteSource> byteSource = new MgByteSource(
            (BYTE_ARRAY_IN)plainText.c_str(), (INT32)plainText.length());

        byteSource->SetMimeType(mimeType);
        byteReader = byteSource->GetReader();
    }

    MG_CATCH_AND_THROW(L"MgProxyResourceService.GetResourceData")

    return byteReader.Detach();
}
コード例 #6
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Deletes the specified log if it exists.
/// </summary>
/// <param name="fileName'>
/// The name of the log to be deleted from the logs directory (does not include path)
/// </param>
/// <returns>
/// Nothing.
/// </returns>
///
/// EXCEPTIONS:
/// MgNullArgumentException
/// MgFileNotFoundException
/// MgFileIoException
void MgServerAdmin::DeleteLog(CREFSTRING fileName)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                              // Connection
                        MgCommand::knVoid,                      // Return type expected
                        MgServerAdminServiceOpId::DeleteLog,    // Command Code
                        1,                                      // No. of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knString, &fileName,         // Argument #1
                        MgCommand::knNone);
}
コード例 #7
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Prevents the server from processing client operations.  When offline, the
/// adminstrator can access the server via "Admin" operations without worrying
/// about Mg clients using the server.
/// </summary>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
void MgServerAdmin::TakeOffline()
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                              // Connection
                        MgCommand::knVoid,                      // Return type expected
                        MgServerAdminServiceOpId::TakeOffline,  // Command Code
                        0,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #8
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
//////////////////////////////////////////////////////////////////
/// <summary>
/// Delete a repository with the given name and type.
///
/// This method only works on "Library" and "Session" repositories.
/// If you specify a repository that is not supported this method
/// will throw an InvalidRepositoryType exception.
/// </summary>
/// <param name="resource">
/// Resource identifier describing the repository to delete
/// The following repositories are supported:
///     1) Library
///     2) Session
/// </param>
/// <returns>
/// Nothing
/// </returns>
/// EXCEPTIONS:
///   MgOutOfMemoryException
///   MgInvalidRepositoryTypeException
void MgProxyResourceService::DeleteRepository(MgResourceIdentifier* resource)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knVoid,
                       MgResourceService::opIdDeleteRepository,
                       1,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knNone);
}
コード例 #9
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Specifies the maximum size in kilobytes for the log files.  When the maximum
/// size is exceeded, the current log will be archived, and a new log will be created.
///
/// </summary>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
void MgServerAdmin::SetMaximumLogSize(INT32 size)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                            // Connection
                        MgCommand::knVoid,                    // Return type expected
                        MgServerAdminServiceOpId::SetMaximumLogSize,       // Command Code
                        1,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knInt32, size,              // Argument#1
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #10
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Delete the specified package, if able.
/// </summary>
///
/// <param name="packageName">
/// The name of the package to be deleted.  Available packages can be found by
/// using EnumeratePackages().
/// </param>
///
/// <returns>
/// Nothing.
/// </returns>
///
/// EXCEPTIONS:
/// MgInvalidArgumentException
/// MgFileIoException
/// MgFileNotFoundException
void MgServerAdmin::DeletePackage(CREFSTRING packageName)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                              // Connection
                        MgCommand::knVoid,                      // Return type expected
                        MgServerAdminServiceOpId::DeletePackage,// Command Code
                        1,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knString, &packageName,      // Argument #1
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #11
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the online status of the server.
/// </summary>
/// <returns>
/// True for online, False for offline.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
bool MgServerAdmin::IsOnline()
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                            // Connection
                        MgCommand::knInt8,                      // Return type expected
                        MgServerAdminServiceOpId::IsOnline,     // Command Code
                        0,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (bool)cmd.GetReturnValue().val.m_i8;
}
コード例 #12
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Enumerates the packages available in the package directory.
/// </summary>
///
/// <returns>
/// An MgStringCollection containing a list of packages in the packages directory
/// </returns>
///
/// EXCEPTIONS:
/// MgOutOfMemoryException
/// MgFileNotFoundException
/// MgFileIoException
MgStringCollection* MgServerAdmin::EnumeratePackages()
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                              // Connection
                        MgCommand::knObject,                    // Return type expected
                        MgServerAdminServiceOpId::EnumeratePackages, // Command Code
                        0,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (MgStringCollection*)cmd.GetReturnValue().val.m_obj;
}
コード例 #13
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Removes the configuration properties for the specified property section.
/// If the properties are not specified, then the entire section will be removed.
/// </summary>
/// <param name="propertySection">
/// The property section to set.
/// </param>
/// <param name="properties">
/// The collection of configuration properties associated with the specified property section that you want to remove.
/// </param>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidPropertySectionException
/// MgPropertySectionNotAvailableException
/// MgPropertySectionReadOnlyException
/// MgInvalidPropertyException
void MgServerAdmin::RemoveConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                            // Connection
                        MgCommand::knVoid,                      // Return type expected
                        MgServerAdminServiceOpId::RemoveConfigurationProperties, // Command Code
                        2,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knString, &propertySection,  // Argument#1
                        MgCommand::knObject, properties,        // Argument#2
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #14
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
//////////////////////////////////////////////////////////////////
/// <summary>
/// Gets a list of entries for the specified repository type. The
/// following lists will be returned for the specified repository
/// type:
///     1) Session - A list of session IDs is returned.
///
/// This method only works on "Session" repositories.
/// If you specify a repository that is not supported this method
/// will throw an MgInvalidRepositoryTypeException exception.
/// </summary>
/// <param name="repositoryType">
/// The type of repository you want to list the entries for.
/// The following repositories are supported:
///     1) Session
/// </param>
/// <returns>
/// MgByteReader object representing the list of entries for the
/// repository type specified.
/// </returns>
/// EXCEPTIONS:
///   MgOutOfMemoryException
///   MgInvalidRepositoryTypeException
MgByteReader* MgProxyResourceService::EnumerateRepositories(CREFSTRING repositoryType)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knObject,
                       MgResourceService::opIdEnumerateRepositories,
                       1,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knString, &repositoryType,
                       MgCommand::knNone);

    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
コード例 #15
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Sets the contents of the specified document.
/// </summary>
/// <param name="identifier">
/// The document to set.
/// </param>
/// <param name="data">
/// The data to set the document contents to.
/// </param>
/// <returns>
/// Nothing
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidArgumentException
/// MgNullReferenceException
/// MgOutOfMemoryException
void MgServerAdmin::SetDocument(CREFSTRING identifier, MgByteReader* data)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                             // Connection
                       MgCommand::knVoid,                      // Return type expected
                       MgServerAdminServiceOpId::SetDocument,  // Command Code
                       2,                                      // No of arguments
                       ServerAdmin_Service,                    // Service Id
                       BUILD_VERSION(1,0,0),                   // Operation version
                       MgCommand::knString, &identifier,       // Argument#1
                       MgCommand::knObject, data,              // Argument#2
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #16
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
void MgProxyResourceService::InheritPermissionsFrom(
    MgResourceIdentifier* resource)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knVoid,
                       MgResourceService::opIdInheritPermissionsFrom,
                       1,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #17
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Clears the specified log.
/// </summary>
/// <param name="log">
/// The log to be cleared. (AccessLog, AdminLog, AuthenticationLog, ErrorLog,
/// SessionLog, TraceLog)
/// </param>
/// <returns>
/// True if the log was successfully cleared, false otherwise.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidArgumentException
/// MgNullReferenceException
bool MgServerAdmin::ClearLog(CREFSTRING log)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                            // Connection
                        MgCommand::knInt8,                      // Return type expected
                        MgServerAdminServiceOpId::ClearLog,     // Command Code
                        1,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knString, &log,              // Argument#1
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (bool)cmd.GetReturnValue().val.m_i8;
}
コード例 #18
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets current log of the specified package
/// </summary>
///
/// <param name="packageName">
/// The name of the package to get the status for.  Available packages can be
/// found by using EnumeratePackages().
/// </param>
///
/// <returns>
/// An MgByteReader containing the contents of the package's log.
/// </returns>
///
/// EXCEPTIONS:
/// MgFileNotFoundException
/// MgFileIoException
/// MgInvalidArgumentException
/// MgOutOfMemoryException
MgByteReader* MgServerAdmin::GetPackageLog(CREFSTRING packageName)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                                  // Connection
                        MgCommand::knObject,                        // Return type expected
                        MgServerAdminServiceOpId::GetPackageLog,    // Command Code
                        1,                                          // No of arguments
                        ServerAdmin_Service,                        // Service Id
                        BUILD_VERSION(1,0,0),                       // Operation version
                        MgCommand::knString, &packageName,          // Argument #1
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
コード例 #19
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
//////////////////////////////////////////////////////////////////
/// <summary>
/// Deletes tagged data from the specified resource
/// </summary>
/// <param name="resource">
/// Resource identifier describing the resource
/// </param>
/// <param name="dataName">
/// Tag name for the data
/// </param>
/// <returns>
/// Nothing
/// </returns>
/// EXCEPTIONS:
/// MgInvalidResourceTypeException
void MgProxyResourceService::DeleteResourceData(MgResourceIdentifier* resource, CREFSTRING dataName)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knVoid,
                       MgResourceService::opIdDeleteResourceData,
                       2,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knString, &dataName,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #20
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
//////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the header associated with the specified resource.
/// </summary>
/// <param name="resource">
/// Resource identifier for desired resource
/// </param>
/// <returns>
/// MgByteReader object representing the XML resource header.
/// </returns>
/// EXCEPTIONS:
/// MgRepositoryNotOpenException
///
/// MgInvalidResourceTypeException
MgByteReader* MgProxyResourceService::GetResourceHeader(MgResourceIdentifier* resource)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knObject,
                       MgResourceService::opIdGetResourceHeader,
                       1,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
コード例 #21
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Checks to see if the specified resource exists.
///
bool MgProxyResourceService::ResourceExists(MgResourceIdentifier* resource)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,                                  // Connection
                       MgCommand::knInt8,                           // Return type expected
                       MgResourceService::opIdResourceExists,       // Command code
                       1,                                           // Number of arguments
                       Resource_Service,                            // Service ID
                       BUILD_VERSION(1,0,0),                        // Operation version
                       MgCommand::knObject, resource,               // Argument #1
                       MgCommand::knNone);                          // End of argument

    SetWarning(cmd.GetWarningObject());

    return (bool)cmd.GetReturnValue().val.m_i8;
}
コード例 #22
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the configuration properties for the specified property section.
/// </summary>
/// <param name="propertySection">
/// The property section to get.
/// </param>
/// <returns>
/// The collection of configuration properties associated with the specified property section.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidPropertySectionException
/// MgPropertySectionNotAvailableException
MgPropertyCollection* MgServerAdmin::GetConfigurationProperties(CREFSTRING propertySection)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,                            // Connection
                        MgCommand::knObject,                    // Return type expected
                        MgServerAdminServiceOpId::GetConfigurationProperties, // Command Code
                        1,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knString, &propertySection,  // Argument#1
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (MgPropertyCollection*)cmd.GetReturnValue().val.m_obj;
}
コード例 #23
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Applies a package of resource changes to the repository.
///
void MgProxyResourceService::ApplyResourcePackage(MgByteReader* resourcePackage)
{
    assert(m_connProp != NULL);
    MgCommand cmd;

    cmd.ExecuteCommand(
        m_connProp,                                         // Connection
        MgCommand::knVoid,                                  // Return type
        MgResourceService::opIdApplyResourcePackage,        // Command Code
        1,                                                  // Number of arguments
        Resource_Service,                                   // Service ID
        BUILD_VERSION(1,0,0),                               // Operation version
        MgCommand::knObject, resourcePackage,               // Argument #1
        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #24
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
void MgProxyResourceService::SetResource(MgResourceIdentifier* resource, MgByteReader* content, MgByteReader* header)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knVoid,
                       MgResourceService::opIdSetResource,
                       3,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knObject, content,
                       MgCommand::knObject, header,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #25
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Loads the specified package into a resource repository.
///
void MgServerAdmin::LoadPackage(CREFSTRING packageName)
{
    assert(m_connProp != NULL);
    MgCommand cmd;

    cmd.ExecuteCommand(
        m_connProp,                                         // Connection
        MgCommand::knVoid,                                  // Return type
        MgServerAdminServiceOpId::LoadPackage,              // Command Code
        1,                                                  // Number of arguments
        ServerAdmin_Service,                                // Service ID
        BUILD_VERSION(1,0,0),                               // Operation version
        MgCommand::knString, &packageName,                  // Argument #1
        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #26
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
void MgProxyResourceService::ChangeResourceOwner(MgResourceIdentifier* resource,
        CREFSTRING owner, bool includeDescendants)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knVoid,
                       MgResourceService::opIdChangeResourceOwner,
                       3,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, resource,
                       MgCommand::knString, &owner,
                       MgCommand::knInt8, (int)includeDescendants,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #27
0
ファイル: ProxyResourceService.cpp プロジェクト: kanbang/Colt
void MgProxyResourceService::CopyResource(MgResourceIdentifier* sourceResource,
        MgResourceIdentifier* destResource, bool overwrite)
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,
                       MgCommand::knVoid,
                       MgResourceService::opIdCopyResource,
                       3,
                       Resource_Service,
                       BUILD_VERSION(1,0,0),
                       MgCommand::knObject, sourceResource,
                       MgCommand::knObject, destResource,
                       MgCommand::knInt8, (int)overwrite,
                       MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());
}
コード例 #28
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the contents of the specified log between two dates.  A maximum 24 hour
/// period is allowed to be retrieved.  This will use the current file name convention
/// for the log so if the filename was changed it will be unable to find entries
/// located previous files.
/// </summary>
/// <param name="log">
/// The log to retrieve. (AccessLog, AdminLog, AuthenticationLog, ErrorLog,
/// MapLayerAccessLog, SessionLog, TraceLog)
/// </param>
/// <param name="fromDate">
/// Date & time to start pulling entries from
/// </param>
/// <param name="toDate">
/// Last date & time to pull entries for
/// </param>
/// <returns>
/// The log contents in a ByteReader.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
/// MgInvalidLogTypeException
/// MgNullReferenceException
/// MgInvalidArgumentException
/// MgOutOfMemoryException
MgByteReader* MgServerAdmin::GetLog(CREFSTRING log, MgDateTime* fromDate, MgDateTime* toDate)
{
    MgCommand cmd;
    cmd.ExecuteCommand(m_connProp,                            // Connection
                        MgCommand::knObject,                    // Return type expected
                        MgServerAdminServiceOpId::GetLog,       // Command Code
                        3,                                      // No of arguments
                        ServerAdmin_Service,                    // Service Id
                        BUILD_VERSION(1,0,0),                   // Operation version
                        MgCommand::knString, &log,              // Argument#1
                        MgCommand::knObject, fromDate,          // Argument#2
                        MgCommand::knObject, toDate,            // Argument#3
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (MgByteReader*)cmd.GetReturnValue().val.m_obj;
}
コード例 #29
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////
/// \brief
/// Retrieves the current status of the specified package.
///
/// \param packageName
/// The name of the package to get the status for.
/// Available packages can be found by using EnumeratePackages().
///
/// \return
/// The status of the package.
///
MgPackageStatusInformation* MgServerAdmin::GetPackageStatus(CREFSTRING packageName)
{
    ACE_ASSERT(m_connProp != NULL);
    MgCommand cmd;

    cmd.ExecuteCommand(
        m_connProp,                                         // Connection
        MgCommand::knObject,                                // Return type
        MgServerAdminServiceOpId::GetPackageStatus,         // Command Code
        1,                                                  // Number of arguments
        ServerAdmin_Service,                                // Service ID
        BUILD_VERSION(1,0,0),                               // Operation version
        MgCommand::knString, &packageName,                  // Argument #1
        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    return (MgPackageStatusInformation*)cmd.GetReturnValue().val.m_obj;
}
コード例 #30
0
ファイル: ServerAdmin.cpp プロジェクト: asir6/Colt
///////////////////////////////////////////////////////////////////////////////////
/// <summary>
/// Gets the site version.
/// </summary>
/// <returns>
/// The site version.
/// </returns>
///
/// EXCEPTIONS:
/// MgConnectionNotOpenException
STRING MgServerAdmin::GetSiteVersion()
{
    MgCommand cmd;

    cmd.ExecuteCommand(m_connProp,                                // Connection
                        MgCommand::knString,                      // Return type expected
                        MgServerAdminServiceOpId::GetSiteVersion, // Command Code
                        0,                                        // No of arguments
                        ServerAdmin_Service,                      // Service Id
                        BUILD_VERSION(1,0,0),                     // Operation version
                        MgCommand::knNone);

    SetWarning(cmd.GetWarningObject());

    STRING retVal = *(cmd.GetReturnValue().val.m_str);
    delete cmd.GetReturnValue().val.m_str;

    return retVal;
}