Search in sources :

Example 6 with AbsTime

use of org.codice.alliance.nsili.common.UCO.AbsTime in project alliance by codice.

the class DAGConverterTest method addTestDateAttribute.

public static void addTestDateAttribute(DirectedAcyclicGraph<Node, Edge> graph, Node parentNode, String key, ORB orb) {
    Any any = orb.create_any();
    AbsTime absTime = getTestTime();
    AbsTimeHelper.insert(any, absTime);
    Node node = new Node(0, NodeType.ATTRIBUTE_NODE, key, any);
    graph.addVertex(node);
    graph.addEdge(parentNode, node);
}
Also used : AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) Node(org.codice.alliance.nsili.common.UCO.Node) Any(org.omg.CORBA.Any)

Example 7 with AbsTime

use of org.codice.alliance.nsili.common.UCO.AbsTime in project alliance by codice.

the class SubmitStandingQueryRequestImpl method printLifeEvent.

private void printLifeEvent(LifeEvent lifeEvent) {
    String discriminatorText = getLifeEventDiscriminator(lifeEvent.discriminator());
    Date atDate = null;
    String relTimeStr = null;
    String dayEventTimeStr = null;
    String dayEventStr = null;
    String event = null;
    if (lifeEvent.discriminator() == LifeEventType.ABSOLUTE_TIME) {
        AbsTime atTime = lifeEvent.at();
        atDate = convertAbsTime(atTime);
    } else if (lifeEvent.discriminator() == LifeEventType.RELATIVE_TIME) {
        Time relTime = lifeEvent.rt();
        relTimeStr = relTime.hour + ":" + relTime.minute + ":" + relTime.second;
    } else if (lifeEvent.discriminator() == LifeEventType.NAMED_EVENT) {
        event = lifeEvent.ev();
    } else if (lifeEvent.discriminator() == LifeEventType.DAY_EVENT_TIME) {
        DayEventTime dayEventTime = lifeEvent.day_event();
        dayEventStr = getDayEvent(dayEventTime.day_event);
        dayEventTimeStr = dayEventTime.time.hour + ":" + dayEventTime.time.minute + ":" + dayEventTime.time.second;
    }
    LOGGER.trace("\t\tDiscriminator: {}", discriminatorText);
    if (atDate != null) {
        LOGGER.trace("\t\tAt Time: {}", atDate);
    }
    LOGGER.trace("\t\tRel Time: {}", relTimeStr);
    LOGGER.trace("\t\tEvent: {}", event);
    LOGGER.trace("\t\tDayEvent: {}, time: {}", dayEventStr, dayEventTimeStr);
}
Also used : AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) DayEventTime(org.codice.alliance.nsili.common.GIAS.DayEventTime) Time(org.codice.alliance.nsili.common.UCO.Time) AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) LocalDateTime(java.time.LocalDateTime) DayEventTime(org.codice.alliance.nsili.common.GIAS.DayEventTime) DateTime(org.joda.time.DateTime) Date(java.util.Date)

Example 8 with AbsTime

use of org.codice.alliance.nsili.common.UCO.AbsTime in project alliance by codice.

the class DataModelMgrImplTest method testGetModelDate.

@Test
public void testGetModelDate() throws InvalidInputParameter, SystemFault, ProcessingFault {
    AbsTime modelDate = dataModelMgr.get_data_model_date(null);
    assertThat(modelDate, notNullValue());
}
Also used : AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) Test(org.junit.Test)

Example 9 with AbsTime

use of org.codice.alliance.nsili.common.UCO.AbsTime in project alliance by codice.

the class SubmitStandingQueryRequestImplTest method testExecutionTimes.

@Test
public void testExecutionTimes() throws SystemFault, ProcessingFault {
    AbsTime lastExec = standingQueryRequest.get_time_last_executed();
    assertThat(lastExec, notNullValue());
    AbsTime nextExec = standingQueryRequest.get_time_next_execution();
    assertThat(nextExec, notNullValue());
    DelayEstimate delayEstimate = standingQueryRequest.get_remaining_delay();
    assertThat(delayEstimate, notNullValue());
}
Also used : AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) DelayEstimate(org.codice.alliance.nsili.common.GIAS.DelayEstimate) Test(org.junit.Test)

Example 10 with AbsTime

use of org.codice.alliance.nsili.common.UCO.AbsTime in project alliance by codice.

the class SampleNsiliClient method createEmailOrder.

private OrderContents createEmailOrder(ORB orb, Product product, String[] supportedPackagingSpecs) throws Exception {
    NameName[] nameName = { new NameName("", "") };
    String orderPackageId = UUID.randomUUID().toString();
    TailoringSpec tailoringSpec = new TailoringSpec(nameName);
    PackagingSpec pSpec = new PackagingSpec(orderPackageId, supportedPackagingSpecs[0]);
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date());
    int year = cal.get(Calendar.YEAR);
    year++;
    AbsTime needByDate = new AbsTime(new Date((short) year, (short) 2, (short) 10), new Time((short) 10, (short) 0, (short) 0));
    MediaType[] mTypes = { new MediaType("", (short) 1) };
    String[] benums = new String[0];
    Rectangle region = new Rectangle(new Coordinate2d(1.1, 1.1), new Coordinate2d(2.2, 2.2));
    ImageSpec imageSpec = new ImageSpec();
    imageSpec.encoding = SupportDataEncoding.ASCII;
    imageSpec.rrds = new short[] { 1 };
    imageSpec.algo = "";
    imageSpec.bpp = 0;
    imageSpec.comp = "A";
    imageSpec.imgform = "A";
    imageSpec.imageid = "1234abc";
    imageSpec.geo_region_type = GeoRegionType.LAT_LON;
    Rectangle subSection = new Rectangle();
    subSection.lower_right = new Coordinate2d(0, 0);
    subSection.upper_left = new Coordinate2d(1, 1);
    imageSpec.sub_section = subSection;
    Any imageSpecAny = orb.create_any();
    ImageSpecHelper.insert(imageSpecAny, imageSpec);
    AlterationSpec aSpec = new AlterationSpec("JPEG", imageSpecAny, region, GeoRegionType.NULL_REGION);
    Destination destination = new Destination();
    destination.e_dest(emailAddress);
    ProductDetails[] productDetails = { new ProductDetails(mTypes, benums, aSpec, product, ALLIANCE) };
    DeliveryDetails[] deliveryDetails = { new DeliveryDetails(destination, "", "") };
    return new OrderContents(ALLIANCE, tailoringSpec, pSpec, needByDate, "Give me an order!", (short) 1, productDetails, deliveryDetails);
}
Also used : Destination(org.codice.alliance.nsili.common.GIAS.Destination) DeliveryDetails(org.codice.alliance.nsili.common.GIAS.DeliveryDetails) Rectangle(org.codice.alliance.nsili.common.UCO.Rectangle) Time(org.codice.alliance.nsili.common.UCO.Time) AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) ImageSpec(org.codice.alliance.nsili.common.GIAS.ImageSpec) Any(org.omg.CORBA.Any) AlterationSpec(org.codice.alliance.nsili.common.GIAS.AlterationSpec) AbsTime(org.codice.alliance.nsili.common.UCO.AbsTime) Coordinate2d(org.codice.alliance.nsili.common.UCO.Coordinate2d) ProductDetails(org.codice.alliance.nsili.common.GIAS.ProductDetails) MediaType(org.codice.alliance.nsili.common.GIAS.MediaType) NameName(org.codice.alliance.nsili.common.UCO.NameName) PackagingSpec(org.codice.alliance.nsili.common.GIAS.PackagingSpec) Calendar(java.util.Calendar) Date(org.codice.alliance.nsili.common.UCO.Date) TailoringSpec(org.codice.alliance.nsili.common.GIAS.TailoringSpec) OrderContents(org.codice.alliance.nsili.common.GIAS.OrderContents)

Aggregations

AbsTime (org.codice.alliance.nsili.common.UCO.AbsTime)10 Time (org.codice.alliance.nsili.common.UCO.Time)6 Test (org.junit.Test)4 Calendar (java.util.Calendar)3 Date (org.codice.alliance.nsili.common.UCO.Date)3 Any (org.omg.CORBA.Any)3 Date (java.util.Date)2 AlterationSpec (org.codice.alliance.nsili.common.GIAS.AlterationSpec)2 DayEventTime (org.codice.alliance.nsili.common.GIAS.DayEventTime)2 DeliveryDetails (org.codice.alliance.nsili.common.GIAS.DeliveryDetails)2 Destination (org.codice.alliance.nsili.common.GIAS.Destination)2 ImageSpec (org.codice.alliance.nsili.common.GIAS.ImageSpec)2 LifeEvent (org.codice.alliance.nsili.common.GIAS.LifeEvent)2 MediaType (org.codice.alliance.nsili.common.GIAS.MediaType)2 OrderContents (org.codice.alliance.nsili.common.GIAS.OrderContents)2 PackagingSpec (org.codice.alliance.nsili.common.GIAS.PackagingSpec)2 ProductDetails (org.codice.alliance.nsili.common.GIAS.ProductDetails)2 TailoringSpec (org.codice.alliance.nsili.common.GIAS.TailoringSpec)2 Coordinate2d (org.codice.alliance.nsili.common.UCO.Coordinate2d)2 NameName (org.codice.alliance.nsili.common.UCO.NameName)2