Examples of ResourceProperty


Examples of org.apache.ws.resource.properties.ResourceProperty

    * Test for XmlBeansResourceProperty#size.
    */
   public void testSize()
         throws Exception
   {
      ResourceProperty prop = m_resourcePropSet.get( SushiPropertyQNames.IKA );
      assertEquals( 1,
            prop.size() );
      final String stringValue = "somethang";
      prop.add( XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      prop.add( XmlObject.Factory.parse( "<" + SushiPropertyQNames.IKA.getLocalPart() + " xmlns=\"" + SushiPropertyQNames.IKA.getNamespaceURI() + "\">" + stringValue + "</" + SushiPropertyQNames.IKA.getLocalPart() + ">" ) );
      assertEquals( 3,
            prop.size() );
      prop.remove( prop.get( 0 ) );
      prop.remove( prop.get( 0 ) );
      assertEquals( 1,
            prop.size() );
   }
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

    */
   public void init(  )
   {
      super.init(  );

      ResourceProperty resourceProperty = m_propSet.get( JobPortPropertyQNames.JOB_NAME );
      JobNameDocument  jobNameDocument = JobNameDocument.Factory.newInstance(  );
      jobNameDocument.setJobName( m_jobName );
      resourceProperty.add( jobNameDocument );

      resourceProperty = m_propSet.get( JobPortPropertyQNames.JOB_ID );
      JobIdDocument jobIdDocument = JobIdDocument.Factory.newInstance(  );
      jobIdDocument.setJobId( BigInteger.valueOf( m_jobId ) );
      resourceProperty.add( jobIdDocument );

      resourceProperty = m_propSet.get( JobPortPropertyQNames.JOB_ORIGINATING_USER_NAME );
      JobOriginatingUserNameDocument jobOriginatingUserNameDocument =
         JobOriginatingUserNameDocument.Factory.newInstance(  );
      jobOriginatingUserNameDocument.setJobOriginatingUserName( m_origUserName );
      resourceProperty.add( jobOriginatingUserNameDocument );

      resourceProperty = m_propSet.get( JobPortPropertyQNames.JOB_PRINTER_REFERENCE );
      JobPrinterReferenceDocument jobPrinterReferenceDocument =
         JobPrinterReferenceDocument.Factory.newInstance(  );
      jobPrinterReferenceDocument.setJobPrinterReference( m_printerRef );
      resourceProperty.add( jobPrinterReferenceDocument );

      resourceProperty = m_propSet.get( JobPortPropertyQNames.JOB_REFERENCE );
      JobReferenceDocument jobReferenceDocument = JobReferenceDocument.Factory.newInstance(  );
      jobReferenceDocument.setJobReference( getEpr(  ) );
      resourceProperty.add( jobReferenceDocument );

      resourceProperty = m_propSet.get( JobPortPropertyQNames.JOB_STATE );
      JobStateDocument jobStateDocument = JobStateDocument.Factory.newInstance(  );
      jobStateDocument.setJobState( JobStateType.PENDING );
      resourceProperty.add( jobStateDocument );

      Calendar currentTime = getCurrentTime();
      Calendar termTime = Calendar.getInstance(  );
      termTime.set( currentTime.get( Calendar.YEAR ),
                    currentTime.get( Calendar.MONTH ),
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

     * Initializes this resource's state (properties, etc.).
     */
    public void init()
    {
        super.init();
        ResourceProperty resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_REFERENCE);
        PrinterReferenceDocument printerRefDoc = PrinterReferenceDocument.Factory.newInstance();
        printerRefDoc.setPrinterReference(getEpr());
        resourceProperty.add(printerRefDoc);

        resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_STATE);
        PrinterStateDocument printerState = PrinterStateDocument.Factory.newInstance();
        printerState.setPrinterState(PrinterStateType.IDLE);
        resourceProperty.add(printerState);

        resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_NAME);
        PrinterNameDocument printName = PrinterNameDocument.Factory.newInstance();
        printName.setPrinterName(m_name);
        resourceProperty.add(printName);

        resourceProperty = m_propSet.get(PrinterPortPropertyQNames.PRINTER_IS_ACCEPTING_JOBS);
        PrinterIsAcceptingJobsDocument isAccepting = PrinterIsAcceptingJobsDocument.Factory.newInstance();
        isAccepting.setPrinterIsAcceptingJobs(false);
        resourceProperty.add(isAccepting);

        resourceProperty = m_propSet.get(PrinterPortPropertyQNames.QUEUED_JOB_COUNT);
        QueuedJobCountDocument queuedJobCountDocument = QueuedJobCountDocument.Factory.newInstance();
        queuedJobCountDocument.setQueuedJobCount(BigInteger.valueOf(0));
        resourceProperty.add(queuedJobCountDocument);

        resourceProperty = m_propSet.get(PrinterPortPropertyQNames.OPERATIONS_SUPPORTED);
        OperationsSupportedDocument operationsSupportedDocument =
                OperationsSupportedDocument.Factory.newInstance();
        List operationsSupported = new ArrayList();
        operationsSupported.add(Operations.PRINT_JOB); //refer to doc...
        operationsSupported.add(Operations.CREATE_JOB); //refer to doc...
        operationsSupported.add(Operations.SEND_DOCUMENT); //refer to doc...
        operationsSupportedDocument.setOperationsSupported(operationsSupported);
        resourceProperty.add(operationsSupportedDocument);

        resourceProperty = m_propSet.get(PrinterPortPropertyQNames.DOCUMENT_FORMAT_SUPPORTED);
        DocumentFormatSupportedDocument documentFormatSupportedDocument =
                DocumentFormatSupportedDocument.Factory.newInstance();
        MimeMediaTypes mimeMediaTypes =
                documentFormatSupportedDocument.addNewDocumentFormatSupported();
        mimeMediaTypes.addMimeMediaType(MimeMediaTypeType.TEXT_PLAIN);
        resourceProperty.add(documentFormatSupportedDocument);
    }
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

                    setJobState(job, JobStateType.PROCESSING);
                    //set termination time to now to make it be removed.
                    job.setTerminationTime(Calendar.getInstance());

                    XmlBeansResourcePropertySet jobPropSet = (XmlBeansResourcePropertySet) job.getResourcePropertySet();
                    ResourceProperty resourceProperty = jobPropSet.get(JobPortPropertyQNames.JOB_ID);
                    XmlInteger jobint = (XmlInteger) resourceProperty.get(0);
                    BigInteger bigIntegerValue = jobint.getBigIntegerValue();                   

                    decrementQueueCount();
                    setJobState(job, JobStateType.COMPLETED);
                }
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

        {
            LOG.debug( MSG.getMessage( Keys.GET_RP_REQ, requestDoc.toString() ) );
        }
        GetResourcePropertyResponseDocument responseDoc = createResponseDocument();
        QName propName = requestDoc.getGetResourceProperty();
        ResourceProperty prop = getProperties().get( propName );
        if ( prop == null )
        {
            throw new InvalidResourcePropertyQNameFaultException( propName );
        }
        refreshProperty( prop );
        Iterator propElemIter = prop.iterator();
        while ( propElemIter.hasNext() )
        {
            XmlObject propElem = (XmlObject) propElemIter.next();
            XmlBeanUtils.addChildElement( responseDoc.getGetResourcePropertyResponse(),
                    propElem );
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

    {
        m_resourceContext = new SushiResourceContext();
        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );
        final QName[] propNames = new QName[]{SushiPropertyQNames.EBI, SushiPropertyQNames.IKA};
        GetMultipleResourcePropertiesResponseDocument.GetMultipleResourcePropertiesResponse response = getMultipleResourceProperties( propNames );
        XmlObject[] propElems = XmlBeanUtils.getChildElements( response );
        assertNotNull( propElems );
        assertEquals( propNames[0], XmlBeanUtils.getName( propElems[0] ) );
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

        String value = XmlBeanUtils.getValue( ebiPropElems[0] );
        assertEquals( "9", value );

        //setup callback to modify resource prop
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );

        queryResourcePropertiesResponse = queryResourceProperties( "*" );

        ebiPropElems = XmlBeanUtils.getChildElements( queryResourcePropertiesResponse, SushiPropertyQNames.EBI );
        assertNotNull( ebiPropElems );
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

        m_resourceContext = new SushiResourceContext();
        // create and register callback object
        SushiPlate plate = new SushiPlate();
        SushiCallback callback = new SushiCallback( plate );
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( callback );
        // send GetRP request and make sure prop got updated by callback.refreshProperty()
        GetResourcePropertyResponseDocument.GetResourcePropertyResponse response = getResourceProperty( SushiPropertyQNames.EBI );
        XmlObject[] ebiPropElems = XmlBeanUtils.getChildElements( response, SushiPropertyQNames.EBI );
        assertNotNull( ebiPropElems );
        assertEquals( 1, ebiPropElems.length );
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

    {
        m_resourceContext = new SushiResourceContext();
        //build callback obj
        //setup callback on resource prop
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.EBI );
        resourceProp.setCallback( m_callback );

        SetResourcePropertiesProvider set_provider = new SetResourcePropertiesProvider( m_resourceContext );
        InsertDocument insertDoc = InsertDocument.Factory.newInstance();
        InsertType insertType = insertDoc.addNewInsert();
View Full Code Here

Examples of org.apache.ws.resource.properties.ResourceProperty

        set_provider.insertResourceProperty( insertType );

        //setup callback on resource prop
        SushiResource resource = (SushiResource) m_resourceContext.getResource();
        ResourceProperty resourceProp = resource.getResourcePropertySet().get( SushiPropertyQNames.IKA );
        resourceProp.setCallback( m_callback );

        DeleteDocument deleteDoc = DeleteDocument.Factory.newInstance();
        DeleteType deleteType = deleteDoc.addNewDelete();
        deleteType.setResourceProperty( SushiPropertyQNames.IKA );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.