Translate to EnglishÜbersetzen Sie zum Deutsch/GermanΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/NorwegianÖversätta till Svensk/Swedishहिनà¥à¤¦à¥€ अनà¥à¤µà¤¾à¤¦ करने के लिà¤/Hindi
Tradueix al català/CatalanTulkot uz latviešu/LatvianPreložiť do slovenčiny/SlovakVertaal aan het Nederlands/Dutchترجمة الى العربية/ArabicTraduzca al Español/SpanishTraduisez au Français/French
Traduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese TraditionalПереклад на українську/Ukrainian

XAM

, - , , XSets, SNIA XAM v1.0 (XAM QL), SQL, XUIDs XSets - .

: , , , , , , , , , typeof, , , , , , , , . , XAM SQL . ASCII - .

XAM:

select ".xset.xuid" where "com.example.name" = ’Tuckers Plantation'


1.0 XAM 2 , 1 .. 1 2. XSets . XSet XAM . 2 1 XStreams . , XAM . 2, 1.

XAM . XAM v1.0 `.xset.xuid'. XUID.

select ".xset.xuid "


XSet .

XSets, . 1 XSet and/or .

select ".xset.xuid" where ".xam.time.xuid" > date(’2009-02-01T00:00:00.0’)


Xsets 1- 2009.

field .

xam_intxam_doublexam_stringxam_datetimexam_xuid
int**
**
*
datetime*
XUID*

XAM UTF-8. Non-conforming UTF-8 XAM non-fatal. non printable . --. . .

. non-fatal .

\ \ (\)
\ « (")
\ ' (')
\ uxxxx Unicode (xxxx)

. . , ' literal
select ".xset.xuid" where "com.example.string-property" = ’This is a string literal’


,

select ".xset.xuid" where "com.example.claimed.ownership" = ’Tucker\’s’


XAM . , . , xam_boolean com.example. » qstring»

select ".xam.xuid" where "com.example.\"qstring\"" = TRUE


, . , xam_double com.example.file \

select ".xam.xuid" where "com.example.file\\ratio" = 100.1


date-time XUID- () xuid () . () date-time, date-time XAM.

select ".xset.xuid" where ".xam.time.xuid" = date(’2009-06-01T00:00:00.0’)


xuid () XUID base64 . non-fatal parsing .

, typeof, , , accessor . () () XSet. TRUE XSet , .

select ".xset.xuid" where exists("com.example.name")


typeof () MIME XSet - .

select ".xset.xuid" where typeof("com.example.data") = ’text/plain’
select ".xset.xuid" where typeof("com.example.data") like ’text%’


- . non- non-fatal parsing .

() TRUE XSet .

select ".xset.xuid" where readonly("com.example.flag")
select ".xset.xuid" where not readonly("com.example.name")


Binding () TRUE XSet .

select ".xset.xuid" where binding("com.example.case_id")
select ".xset.xuid" where not binding("com.example.subject")


() , , .

select ".xset.xuid" where length("com.example.data") > 1024


fields stypes. .

. Subclauses , . SQL.

, subclauses TRUE XSet .

select ".xset.xuid" where typeof("com.example.stream") = ’image/gif’ and length("com.example.stream") > 4096


XSets GIF 4096 . TRUE subclause TRUE.

select ".xset.xuid" where typeof("com.example.stream") = ’image/jpeg’ or typeof("com.example.stream") = ’image/gif’


XSets JPEG GIF . .

select ".xset.xuid" where not binding("com.example.property")


XSets nonbinding com.example.property.

SQL . XAM QL :

1, , typeof, , , +, -
2= <>, >, >=, <>
3
4
5

. .
select ".xset.xuid" where not "com.example.bool-prop" and  "com.example.int-prop" = 64
select ".xset.xuid" where not ("com.example.bool-prop" and "com.example.int-prop" = 64)


, com.example.bool-prop. , com.example.bool-prop, com.example.int-prop = 42.

, XAM QL, , , XAM . XAM . XSet . XSet 2 - mand org.snia.xam.job.com `xam.job.query mand XStream xam.job.query.com UTF-8 ( MIME `/; charset=utf-8') .

, . . .xsystem.job.com mit.supported XSystem . XSet .

submitJob. 2 XSet , .xam.job.error XSet org.snia.xam:: not_a_job org.snia.xam:: unspecified_command . , .xam.job.status.

, XSet XStream xam.job.query.results. XStream MIME /vnd.snia.xam.query.xuid_list XUIDs XSets . XUID 80 . XUID 80 , 80 .

XStream setup. xam.job.query.results.count xam_int XUID XStream. XStream . . Xam_string xam.job.query.level . org.snia.xam.job.query.level.1 org.snia.xam.job.query.level.2.

. XStream XSets , , .

.xam.job.error:

xam.job.query:: level_not_supported XAM . Non-fatal .
xam.job.query:: invalid_command_syntaxNon-fatal parsing
xam.job.query:: insufficient_permission authenticated

xam.job.query:: insufficient_resources XAM

, , .. .xam.job.errorhealth .xam.job.status, XAM XUIDs XStream. XUID XStream. .

, RDBMS, XAM . XAM. XAM . XSet XStream , , XSet XStream. XSets . XStream. XUIDs XSets XAM XUIDs XSets XSet XSet.

Java XAM XAM.

import org.snia.xam.XAMException;
import org.snia.xam.XAMLibrary;
import org.snia.xam.XSystem;
import org.snia.xam.toolkit.XAMXUID;
import org.snia.xam.util.XAMLibraryFactory;

public class CheckQuerySupport
{
    private static XAMLibrary xamLib;
    private static XSystem xSystem;

    public static void main(String[] args)
    {
        String xri = "snia-xam://centera_vim!XXX.XXXX.XXX.XXX?/home/fpm/xam/xamconnect.pea";

        long exitCode = 0;
        boolean isSupported = false;

        try
        {
            xamLib = XAMLibraryFactory.newXAMLibrary();
            System.out.println("Connecting to XSystem: " + xri + "\n");

            xSystem = xamLib.connect(xri);

            // support job commit?
            isSupported = xSystem.getBoolean(XSystem.XAM_XSYSTEM_JOB_COMMIT_SUPPORTED);
            System.out.println("Support job commit? " + (isSupported ? "Yes" : "No"));

            // support continuance of job?
            isSupported = xSystem.getBoolean(XSystem.XAM_XSYSTEM_JOB_QUERY_CONTINUANCE_SUPPORTED);
            System.out.println("Support job continuance? " + (isSupported ? "Yes" : "No"));

            // support level 1 query?
            isSupported = xSystem.getBoolean(XSystem.XAM_XSYSTEM_JOB_QUERY_LEVEL1_SUPPORTED);
            System.out.println("Support level 1 query? " + (isSupported ? "Yes" : "No"));

            // support level 2 query?
            isSupported = xSystem.getBoolean(XSystem.XAM_XSYSTEM_JOB_QUERY_LEVEL2_SUPPORTED);
            System.out.println("Support level 2 query? " + (isSupported ? "Yes" : "No"));

            xSystem.close();
            System.out.println("\nClosed connection to XSystem");

        } catch (XAMException xe) {
            exitCode = xe.getStatusCode();
            System.err.println("XAM Error occured: " + xe.getMessage());
        } catch (IllegalArgumentException e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
            exitCode = 1;
        }

        System.exit((int) exitCode);
    }
}


EMC Centera XAM

Connecting to XSystem: snia-xam://centera_vim!XXX.XXX.XXX.XXX?/home/fpm/xam/xamconnect.pea

Support job commit? No
Support job continuance? No
Support level 1 query? Yes
Support level 2 query? No

Closed connection to XSystem


Java 3 XSets 10.8 V1.0 XAM.

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import org.snia.xam.XAMException;
import org.snia.xam.XAMLibrary;
import org.snia.xam.XSet;
import org.snia.xam.XStream;
import org.snia.xam.XSystem;
import org.snia.xam.XUID;
import org.snia.xam.toolkit.XAMXUID;
import org.snia.xam.util.XAMLibraryFactory;

public class QueryExample
{
    private static XAMLibrary xamLib;
    private static XSystem xSystem;

    private static void CreateXset(int parm1, String parm2, double parm3)
             throws XAMException
    {
        System.out.print("Create XSet 1 ....  ");

        XSet xSet = xSystem.createXSet(XSet.MODE_UNRESTRICTED);
        xSet.createProperty("com.example.rhc", false, true);
        xSet.createProperty("com,example.foo", false, parm1);
        xSet.createProperty("com.example.bar", false, parm2);
        xSet.createProperty("com.example.num", false, parm3);

        XUID xuID = xSet.commit();
        System.out.println("XUID: " + xuID.toString());

        xSet.close();
    }

   private static void CreateXset(int parm1, int parm2, int parm3)
             throws XAMException
    {
        System.out.print("Create XSet 2 ....  ");

        XSet xSet = xSystem.createXSet(XSet.MODE_UNRESTRICTED);
        xSet.createProperty("com.example.rhc", false, true);
        xSet.createProperty("com,example.foo", false, parm1);
        xSet.createProperty("com.example.bar", false, parm2);
        xSet.createProperty("com.example.num", false, parm3);

        XUID xuID = xSet.commit();
        System.out.println("XUID: " + xuID.toString());

        xSet.close();
    }

    private static void CreateXset(int parm1, int parm2)
             throws XAMException
    {
        System.out.print("Create XSet 3 ....  ");

        XSet xSet = xSystem.createXSet(XSet.MODE_UNRESTRICTED);
        xSet.createProperty("com.example.rhc", false, true);
        xSet.createProperty("com,example.foo", false, parm1);
        xSet.createProperty("com.example.num", false, parm2);

        XUID xuID = xSet.commit();
        System.out.println("XUID: " + xuID.toString());

        xSet.close();
    }

    private static void QueryXsystem(String queryString)
            throws XAMException
    {
        boolean finished = false;
        final int XAM_MAX_XUID = 80;
        int resultCount = 0;
        String status;

        System.out.println("Create query XSet. Query string: " + queryString);

        XSet query = xSystem.createXSet(XSet.MODE_UNRESTRICTED);
        query.createProperty(XSet.XAM_JOB_COMMAND, true, XSet.XAM_JOB_QUERY);

        byte[] buffer = queryString.getBytes();
        XStream queryStream = query.createXStream(XSet.XAM_JOB_QUERY_COMMAND, true, XAMLibrary.TEXT_PLAIN_MIME_TYPE);
        queryStream.write(buffer);
        queryStream.close();

        System.out.println("Submit query job ....");
        query.submitJob();

        System.out.println("Wait for query job to finish ....");

        while (!finished)
        {
            // check  status of query job
            status = query.getString(XSet.XAM_JOB_ERRORHEALTH);
            if (status.equals(XSet.XAM_JOB_ERRORHEALTH_ERROR))
            {
                System.out.println("ERROR: Errorhealth - " + query.getString(XSet.XAM_JOB_ERROR));
                query.haltJob();
                System.out.println("ERROR: Job halted");
                break;
            }

            status = query.getString(XSet.XAM_JOB_STATUS);
            resultCount = (int) query.getLong(XSet.XAM_JOB_QUERY_RESULTS_COUNT);

            // uncomment if you want continuous job status
            // System.out.println("Job Status: " + status + "  Result count: " + resultCount);

            // exit loop if job complete
            if (status.equals(XSet.XAM_JOB_STATUS_COMPLETE))
            {
                finished = true;
            }
       }

        System.out.println("Query job completed ....");
        System.out.println("Result set final count is: " + resultCount);

        if (resultCount > 0)
        {
             // open query job result stream
             XStream results = query.openXStream(XSet.XAM_JOB_QUERY_RESULTS, XStream.MODE_READ_ONLY);

             byte rawXUID[] = new byte[XAM_MAX_XUID];
             long bytesRead = 0;

             // output XUIDs in result set
             while( (bytesRead = results.read(rawXUID, XAM_MAX_XUID)) >= 0 )
             {
                 XAMXUID resultXUID = new XAMXUID(rawXUID);
                 System.out.println("XUID: " + resultXUID.toString());
             }

             results.close();
        }

        query.close();
    }

    public static void main(String[] args)
    {
        String xri = "snia-xam://centera_vim!XXX.XXX.XXX.XXX?/home/fpm/xam/xamconnect.pea";
        long exitCode = 0;

        try
        {
            xamLib = XAMLibraryFactory.newXAMLibrary();

            // uncomment next 2 lines if you want extensive XAM Library logging
            // xamLib.setProperty(XAMLibrary.XAM_LOG_VERBOSITY, 1);
            // xamLib.setProperty(XAMLibrary.XAM_LOG_LEVEL, 5);

            System.out.println("Connecting to XSystem " +  xri + "\n");

            xSystem = xamLib.connect(xri);
            xSystem.setProperty(".xsystem.log.verbosity", 1);
            xSystem.setProperty(".xsystem.log.level", 5);

            CreateXset(1, "string", 123.55);
            CreateXset(77, 42, 100);
            CreateXset(6, 200);

            xSystem.close();

            System.out.println("\nClose/reopen XSystem\n");

            xSystem = xamLib.connect(xri);

            // uncomment one or more of the following queries
            // QueryXsystem("select \".xset.xuid\"");
            QueryXsystem("select \".xset.xuid\" where (\"com.example.foo\" > 0) and (\"com.example.foo\" < 50)");
            // QueryXsystem("select \".xset.xuid\" where (\"com.example.bar\" > 0) and (\"com.example.bar\" < 100)");
            // QueryXsystem("select \".xset.xuid\" where exists (\"com.example.bar\")");
            // QueryXsystem("select \".xset.xuid\" where \"com.example.bar\" like '%ing%'");
            // QueryXsystem("select \".xset.xuid\" where \"com.example.num\" >= 124");
            // QueryXsystem("select \".xset.xuid\" where \"com.example.num\" >= 124.6 ");
            // QueryXsystem("select \".xset.xuid\" where (\"com.example.num\" >= 123) and typeof(\"com.example.num\") = 'application/vnd.snia.xam.int'");

            xSystem.close();
            System.out.println("\nClosed connection to XSystem");

        } catch (XAMException xe) {
            exitCode = xe.getStatusCode();
            System.err.println("XAM Error occured: " + xe.getMessage() + "("
                    + exitCode + ")");
        } catch (IllegalArgumentException e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
            exitCode = -1;
        }

        System.exit((int) exitCode);
    }
}


XStream XAM XUIDs XStream XStream.asyncRead XStream.read.

XAM . XAM Google .

, XAM metadata, - XAM .